Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20180726.sql =================================================================== diff -u -r48337b2996c80397d21fbbe77d610d2c04b7dd6e -r280d5dec6be0fb026eb13b77a507e454ac0219ba --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20180726.sql (.../patch20180726.sql) (revision 48337b2996c80397d21fbbe77d610d2c04b7dd6e) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20180726.sql (.../patch20180726.sql) (revision 280d5dec6be0fb026eb13b77a507e454ac0219ba) @@ -1,7 +1,19 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + -- LDEV-4440 Change tool access URLs after migration to Spring MVC UPDATE lams_tool SET author_url = 'tool/laqa11/authoring/authoring.do', learner_url = 'tool/laqa11/learning/learning.do', monitor_url = 'tool/laqa11/monitoring/monitoring.do', pedagogical_planner_url = 'tool/laqa11/pedagogicalPlanner/initPedagogicalPlannerForm.do' -WHERE tool_signature = 'laqa11'; \ No newline at end of file +WHERE tool_signature = 'laqa11'; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_laqa/web/authoring/BasicContent.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r280d5dec6be0fb026eb13b77a507e454ac0219ba --- lams_tool_laqa/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_laqa/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision 280d5dec6be0fb026eb13b77a507e454ac0219ba) @@ -64,7 +64,7 @@
Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/controller/AuthoringController.java =================================================================== diff -u -r94e36ba92006160e48c47ff2a60bb4f525c011e1 -r280d5dec6be0fb026eb13b77a507e454ac0219ba --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 94e36ba92006160e48c47ff2a60bb4f525c011e1) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 280d5dec6be0fb026eb13b77a507e454ac0219ba) @@ -64,6 +64,8 @@ import org.lamsfoundation.lams.tool.rsrc.web.form.ResourceItemForm; import org.lamsfoundation.lams.tool.rsrc.web.form.ResourcePedagogicalPlannerForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.Configuration; +import org.lamsfoundation.lams.util.ConfigurationKeys; import org.lamsfoundation.lams.util.FileValidatorSpringUtil; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; @@ -112,7 +114,7 @@ */ @RequestMapping("/removeItemAttachment") private String removeItemAttachment(HttpServletRequest request) { - request.setAttribute("itemAttachment", null); + request.setAttribute("resourceItemForm", null); return "pages/authoring/parts/itemattachment"; } @@ -976,8 +978,12 @@ || resourceItemForm.getItemType() == ResourceConstants.RESOURCE_TYPE_LEARNING_OBJECT || resourceItemForm.getItemType() == ResourceConstants.RESOURCE_TYPE_FILE) { // validate item size - boolean fileSizeValid = FileValidatorSpringUtil.validateFileSize(resourceItemForm.getFile().getSize(), - false); + if(!FileValidatorSpringUtil.validateFileSize(resourceItemForm.getFile().getSize(), + false)) { + errorMap.add("GLOBAL", messageService.getMessage("errors.maxfilesize", + new Object[] { Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_MAX_SIZE) })); + } + // for edit validate: file already exist if (!resourceItemForm.isHasFile() && (resourceItemForm.getFile() == null || StringUtils.isEmpty(resourceItemForm.getFile().getOriginalFilename()))) { Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/controller/LearningController.java =================================================================== diff -u -ra5f1ca1dd020bb422c0a23bc69bdb18ec372696e -r280d5dec6be0fb026eb13b77a507e454ac0219ba --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/controller/LearningController.java (.../LearningController.java) (revision a5f1ca1dd020bb422c0a23bc69bdb18ec372696e) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/controller/LearningController.java (.../LearningController.java) (revision 280d5dec6be0fb026eb13b77a507e454ac0219ba) @@ -58,6 +58,8 @@ import org.lamsfoundation.lams.tool.rsrc.web.form.ReflectionForm; import org.lamsfoundation.lams.tool.rsrc.web.form.ResourceItemForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.Configuration; +import org.lamsfoundation.lams.util.ConfigurationKeys; import org.lamsfoundation.lams.util.FileUtil; import org.lamsfoundation.lams.util.FileValidatorSpringUtil; import org.lamsfoundation.lams.util.MessageService; @@ -558,28 +560,6 @@ * @return */ -// private ActionForward findForward(short type, ActionMapping mapping) { -// ActionForward forward; -// switch (type) { -// case ResourceConstants.RESOURCE_TYPE_URL: -// forward = mapping.findForward("url"); -// break; -// case ResourceConstants.RESOURCE_TYPE_FILE: -// forward = mapping.findForward("file"); -// break; -// case ResourceConstants.RESOURCE_TYPE_WEBSITE: -// forward = mapping.findForward("website"); -// break; -// case ResourceConstants.RESOURCE_TYPE_LEARNING_OBJECT: -// forward = mapping.findForward("learningobject"); -// break; -// default: -// forward = null; -// break; -// } -// return forward; -// } - private ResourceUser getCurrentUser(IResourceService service, Long sessionId) { // try to get form system session HttpSession ss = SessionManager.getSession(); @@ -639,7 +619,10 @@ } // validate item size - FileValidatorSpringUtil.validateFileSize(resourceItemForm.getFile(), false); + if (!FileValidatorSpringUtil.validateFileSize(resourceItemForm.getFile(), false)) { + errorMap.add("GLOBAL", messageService.getMessage("errors.maxfilesize", + new Object[] { Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_MAX_SIZE) })); + } // for edit validate: file already exist if (!resourceItemForm.isHasFile() && ((resourceItemForm.getFile() == null) Index: lams_tool_larsrc/web/pages/authoring/parts/addlearningobject.jsp =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r280d5dec6be0fb026eb13b77a507e454ac0219ba --- lams_tool_larsrc/web/pages/authoring/parts/addlearningobject.jsp (.../addlearningobject.jsp) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_larsrc/web/pages/authoring/parts/addlearningobject.jsp (.../addlearningobject.jsp) (revision 280d5dec6be0fb026eb13b77a507e454ac0219ba) @@ -85,7 +85,7 @@