Index: lams_central/conf/language/ApplicationResources.properties =================================================================== diff -u -rb3da97f5c8cfdd02a2c2cb566dcee601100f3c07 -rded807ef4781623cba0fa8b364f55e015cf2358b --- lams_central/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision b3da97f5c8cfdd02a2c2cb566dcee601100f3c07) +++ lams_central/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision ded807ef4781623cba0fa8b364f55e015cf2358b) @@ -66,11 +66,16 @@ msg.import.success=Learning design and activities import successfully. msg.import.ld.success=Learning design import successfully. msg.import.tool.error.prefix=But there are some tool(s) imported failed +msg.import.failed=Learning design import failed +msg.export.loading=Learning desing is exporting, please wait. msg.export.success=Learning design and activities export successfully. msg.export.ld.success=Learning design export successfully. msg.export.tool.error.prefix=But there are some tool(s) exported failed +msg.export.failed=Learning design export failed +msg.reason.is=The reason is + button.open.design=Open learning design button.close=Close button.import=Import \ No newline at end of file Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/ExportToolContentAction.java =================================================================== diff -u -rb3da97f5c8cfdd02a2c2cb566dcee601100f3c07 -rded807ef4781623cba0fa8b364f55e015cf2358b --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/ExportToolContentAction.java (.../ExportToolContentAction.java) (revision b3da97f5c8cfdd02a2c2cb566dcee601100f3c07) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/ExportToolContentAction.java (.../ExportToolContentAction.java) (revision ded807ef4781623cba0fa8b364f55e015cf2358b) @@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; @@ -48,7 +49,7 @@ /** * * @struts.action name = "ExportAction" - * parameter = "method" + * path = "/authoring/exportToolContent" * validate = "false" * @struts.action-forward name = "loading" path = "/toolcontent/exportloading.jsp" * @struts.action-forward name = "result" path = "/toolcontent/exportresult.jsp" @@ -69,9 +70,9 @@ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { - String param = mapping.getParameter(); + String param = request.getParameter("method"); //-----------------------Resource Author function --------------------------- - if(param.equals("export")){ + if(StringUtils.equals(param,"export")){ return exportLD(mapping,request,response); }else{ Long learningDesignId = WebUtil.readLongParam(request,PARAM_LEARING_DESIGN_ID); @@ -107,7 +108,6 @@ log.debug("Wrote out " + count + " bytes"); response.setContentLength(count); out.flush(); - return null; } catch (Exception e) { log.error( "Exception occured writing out file:" + e.getMessage()); throw new ExportToolContentException(e); @@ -120,7 +120,7 @@ log.error("Error Closing file. File already written out - no exception being thrown.",e); } } - } catch (ExportToolContentException e1) { + } catch (Exception e1) { log.error("Unable to export tool content: " + e1.toString()); request.setAttribute(ATTR_LD_ERROR_MESSAGE,ldErrorMsgs); } Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java =================================================================== diff -u -rb3da97f5c8cfdd02a2c2cb566dcee601100f3c07 -rded807ef4781623cba0fa8b364f55e015cf2358b --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java (.../ImportToolContentAction.java) (revision b3da97f5c8cfdd02a2c2cb566dcee601100f3c07) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java (.../ImportToolContentAction.java) (revision ded807ef4781623cba0fa8b364f55e015cf2358b) @@ -36,6 +36,7 @@ import org.apache.commons.fileupload.DiskFileUpload; import org.apache.commons.fileupload.FileItem; +import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.math.NumberUtils; import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; @@ -55,7 +56,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils; /** * * @struts.action name = "ImportAction" - * parameter = "method" + * path = "/authoring/importToolContent" * validate = "false" * @struts.action-forward name = "upload" path = "/toolcontent/import.jsp" * @struts.action-forward name = "success" path = "/toolcontent/importresult.jsp" @@ -81,14 +82,14 @@ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { - String param = mapping.getParameter(); + String param = request.getParameter("method"); //-----------------------Resource Author function --------------------------- - if(param.equals("import")){ - importLD(request); - return mapping.findForward("success"); - }else{ + if(StringUtils.equals(param,"import")){ //display initial page for upload return mapping.findForward("upload"); + }else{ + importLD(request); + return mapping.findForward("success"); } } Index: lams_central/web/toolcontent/exportloading.jsp =================================================================== diff -u -rb3da97f5c8cfdd02a2c2cb566dcee601100f3c07 -rded807ef4781623cba0fa8b364f55e015cf2358b --- lams_central/web/toolcontent/exportloading.jsp (.../exportloading.jsp) (revision b3da97f5c8cfdd02a2c2cb566dcee601100f3c07) +++ lams_central/web/toolcontent/exportloading.jsp (.../exportloading.jsp) (revision ded807ef4781623cba0fa8b364f55e015cf2358b) @@ -1,22 +1,27 @@ <%@ taglib uri="tags-lams" prefix="lams"%> <%@ taglib uri="tags-core" prefix="c"%> <%@ taglib uri="tags-fmt" prefix="fmt"%> + + <fmt:message key="title.export.loading" /> - +

- +
+ Index: lams_central/web/toolcontent/exportresult.jsp =================================================================== diff -u -rb3da97f5c8cfdd02a2c2cb566dcee601100f3c07 -rded807ef4781623cba0fa8b364f55e015cf2358b --- lams_central/web/toolcontent/exportresult.jsp (.../exportresult.jsp) (revision b3da97f5c8cfdd02a2c2cb566dcee601100f3c07) +++ lams_central/web/toolcontent/exportresult.jsp (.../exportresult.jsp) (revision ded807ef4781623cba0fa8b364f55e015cf2358b) @@ -39,6 +39,8 @@

+ ${ldErrorMessages} +
Index: lams_central/web/toolcontent/import.jsp =================================================================== diff -u -rb3da97f5c8cfdd02a2c2cb566dcee601100f3c07 -rded807ef4781623cba0fa8b364f55e015cf2358b --- lams_central/web/toolcontent/import.jsp (.../import.jsp) (revision b3da97f5c8cfdd02a2c2cb566dcee601100f3c07) +++ lams_central/web/toolcontent/import.jsp (.../import.jsp) (revision ded807ef4781623cba0fa8b364f55e015cf2358b) @@ -1,5 +1,7 @@ <%@ taglib uri="tags-lams" prefix="lams"%> <%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> + @@ -17,11 +19,11 @@ -
" method="post" enctype="multipart/form-data"> + " method="post" enctype="multipart/form-data"> : - " /> + " class="buttonStyle"/> Index: lams_central/web/toolcontent/importresult.jsp =================================================================== diff -u -rb3da97f5c8cfdd02a2c2cb566dcee601100f3c07 -rded807ef4781623cba0fa8b364f55e015cf2358b --- lams_central/web/toolcontent/importresult.jsp (.../importresult.jsp) (revision b3da97f5c8cfdd02a2c2cb566dcee601100f3c07) +++ lams_central/web/toolcontent/importresult.jsp (.../importresult.jsp) (revision ded807ef4781623cba0fa8b364f55e015cf2358b) @@ -10,9 +10,11 @@ @@ -25,7 +27,7 @@

- +

@@ -39,15 +41,19 @@ ${toolError} - +

- + ${ldErrorMessages} +

+

+ +