Index: lams_build/lib/lams/lams-central.jar =================================================================== diff -u -rb7aef118db71bf93f74bf91c76fbd4e59de37dff -ra127989b08183726fcbb9956721eff6553c4a0eb Binary files differ Index: lams_central/src/java/org/lamsfoundation/lams/comments/web/CommentForm.java =================================================================== diff -u -rf32bc3c30b8ea0463d84b4dbdc112f77a400297a -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/src/java/org/lamsfoundation/lams/comments/web/CommentForm.java (.../CommentForm.java) (revision f32bc3c30b8ea0463d84b4dbdc112f77a400297a) +++ lams_central/src/java/org/lamsfoundation/lams/comments/web/CommentForm.java (.../CommentForm.java) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -25,7 +25,6 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.apache.struts.action.ActionMessage; import org.lamsfoundation.lams.comments.Comment; import org.lamsfoundation.lams.util.MessageService; import org.springframework.beans.factory.annotation.Autowired; @@ -59,7 +58,7 @@ MultiValueMap errorMap = new LinkedMultiValueMap<>(); try { if (StringUtils.isBlank(comment.getBody())) { - ActionMessage error = new ActionMessage("error.body.required"); + errorMap.add("message.body", messageservice.getMessage("error.body.required")); } } catch (Exception e) { Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeController.java =================================================================== diff -u -rb7aef118db71bf93f74bf91c76fbd4e59de37dff -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/src/java/org/lamsfoundation/lams/web/HomeController.java (.../HomeController.java) (revision b7aef118db71bf93f74bf91c76fbd4e59de37dff) +++ lams_central/src/java/org/lamsfoundation/lams/web/HomeController.java (.../HomeController.java) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -363,7 +363,7 @@ public String logout(HttpServletRequest req) throws IOException, ServletException { req.getSession().invalidate(); - return "index"; + return "redirect:/index.do"; } private String displayMessage(HttpServletRequest req, String messageKey) { @@ -378,5 +378,5 @@ private User getRealUser(UserDTO dto) { return userManagementService.getUserByLogin(dto.getLogin()); - } + } } \ No newline at end of file Index: lams_central/src/java/org/lamsfoundation/lams/web/PasswordChangeController.java =================================================================== diff -u -r52f09d3d3dd6998ff9cb9e7377c7501341ad7a23 -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/src/java/org/lamsfoundation/lams/web/PasswordChangeController.java (.../PasswordChangeController.java) (revision 52f09d3d3dd6998ff9cb9e7377c7501341ad7a23) +++ lams_central/src/java/org/lamsfoundation/lams/web/PasswordChangeController.java (.../PasswordChangeController.java) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -26,7 +26,6 @@ import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; -import org.apache.struts.Globals; import org.lamsfoundation.lams.logevent.LogEvent; import org.lamsfoundation.lams.logevent.service.ILogEventService; import org.lamsfoundation.lams.usermanagement.User; @@ -71,14 +70,8 @@ * */ @RequestMapping(path = "/passwordChanged", method = RequestMethod.POST) - public String execute(@ModelAttribute("PasswordChangeActionForm") PasswordChangeActionForm passwordChangeForm, HttpServletRequest request) - throws Exception { - // -- isCancelled? - if (request.getAttribute(Globals.CANCEL_KEY) != null) { - request.getSession().removeAttribute(PasswordChangeActionForm.formName); - request.setAttribute("redirect", "profile"); - return "redirect:/index.do"; - } + public String execute(@ModelAttribute("PasswordChangeActionForm") PasswordChangeActionForm passwordChangeForm, + HttpServletRequest request) throws Exception { MultiValueMap errorMap = new LinkedMultiValueMap<>(); Index: lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveController.java =================================================================== diff -u -r1c001afed4496daabc08f0b83a4118458d400e5a -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveController.java (.../PortraitSaveController.java) (revision 1c001afed4496daabc08f0b83a4118458d400e5a) +++ lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveController.java (.../PortraitSaveController.java) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -32,9 +32,6 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.apache.struts.Globals; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.contentrepository.NodeKey; import org.lamsfoundation.lams.logevent.LogEvent; import org.lamsfoundation.lams.logevent.service.ILogEventService; @@ -87,14 +84,9 @@ * Upload portrait image. */ @RequestMapping("") - public String unspecified(@ModelAttribute("PortraitActionForm") PortraitActionForm portraitForm, HttpServletRequest request, - HttpServletResponse response) throws Exception { + public String unspecified(@ModelAttribute("PortraitActionForm") PortraitActionForm portraitForm, + HttpServletRequest request, HttpServletResponse response) throws Exception { - if (request.getAttribute(Globals.CANCEL_KEY) != null) { - request.setAttribute("redirect", "profile"); - return "redirect:/index.do"; - } - MultiValueMap errorMap = new LinkedMultiValueMap<>(); MultipartFile file = portraitForm.getFile(); @@ -182,8 +174,7 @@ /** Called from sysadmin to delete an inappropriate portrait */ @RequestMapping("/deletePortrait") - public String deletePortrait(HttpServletRequest request, - HttpServletResponse response) throws Exception { + public String deletePortrait(HttpServletRequest request, HttpServletResponse response) throws Exception { Integer userId = WebUtil.readIntParam(request, "userId", true); Index: lams_central/src/java/org/lamsfoundation/lams/web/ProfileSaveController.java =================================================================== diff -u -r0e9eca8da006863730e793b75a47803bc6142c67 -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/src/java/org/lamsfoundation/lams/web/ProfileSaveController.java (.../ProfileSaveController.java) (revision 0e9eca8da006863730e793b75a47803bc6142c67) +++ lams_central/src/java/org/lamsfoundation/lams/web/ProfileSaveController.java (.../ProfileSaveController.java) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -29,7 +29,6 @@ import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.apache.struts.Globals; import org.lamsfoundation.lams.themes.Theme; import org.lamsfoundation.lams.usermanagement.SupportedLocale; import org.lamsfoundation.lams.usermanagement.User; @@ -47,7 +46,6 @@ import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; /** * @author jliew @@ -66,11 +64,6 @@ @RequestMapping(path = "/saveprofile") public String execute(@ModelAttribute("newForm") UserForm userForm, HttpServletRequest request) throws Exception { - if (request.getAttribute(Globals.CANCEL_KEY) != null) { - request.setAttribute("redirect", "profile"); - return "redirect:/index.do"; - } - MultiValueMap errorMap = new LinkedMultiValueMap<>(); if (!Configuration.getAsBoolean(ConfigurationKeys.PROFILE_EDIT_ENABLE)) { Index: lams_central/src/java/org/lamsfoundation/lams/web/QuestionsController.java =================================================================== diff -u -r792f30e164500b758d9eeac2dcf19853be4dfd9f -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/src/java/org/lamsfoundation/lams/web/QuestionsController.java (.../QuestionsController.java) (revision 792f30e164500b758d9eeac2dcf19853be4dfd9f) +++ lams_central/src/java/org/lamsfoundation/lams/web/QuestionsController.java (.../QuestionsController.java) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -11,14 +11,16 @@ import org.apache.commons.fileupload.DiskFileUpload; import org.apache.commons.fileupload.FileItem; import org.apache.commons.lang.StringUtils; -import org.apache.struts.Globals; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; import org.lamsfoundation.lams.questions.Question; import org.lamsfoundation.lams.questions.QuestionParser; import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.ConfigurationKeys; +import org.lamsfoundation.lams.util.MessageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; import org.springframework.web.bind.annotation.RequestMapping; /** @@ -30,6 +32,11 @@ */ @Controller public class QuestionsController { + + @Autowired + @Qualifier("centralMessageService") + MessageService messageService; + @SuppressWarnings("unchecked") @RequestMapping("/questions") public String execute(HttpServletRequest request) throws Exception { @@ -63,9 +70,10 @@ // user did not choose a file if ((uploadedFileStream == null) || !(packageName.endsWith(".zip") || packageName.endsWith(".xml"))) { - ActionMessages errors = new ActionMessages(); - errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("label.questions.file.missing")); - request.setAttribute(Globals.ERROR_KEY, errors); + + MultiValueMap errorMap = new LinkedMultiValueMap<>(); + errorMap.add("GLOBAL", messageService.getMessage("label.questions.file.missing")); + request.setAttribute("errorMap", errorMap); return "questions/questionFile"; } Index: lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerController.java =================================================================== diff -u -rf32bc3c30b8ea0463d84b4dbdc112f77a400297a -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerController.java (.../PedagogicalPlannerController.java) (revision f32bc3c30b8ea0463d84b4dbdc112f77a400297a) +++ lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerController.java (.../PedagogicalPlannerController.java) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -49,9 +49,6 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.authoring.service.IAuthoringService; import org.lamsfoundation.lams.contentrepository.exception.RepositoryCheckedException; import org.lamsfoundation.lams.learningdesign.Activity; @@ -104,6 +101,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.StaxDriver; @@ -867,11 +865,11 @@ node.setLearningDesignId(null); node.setLearningDesignTitle(null); node.setPermissions(PedagogicalPlannerSequenceNode.PERMISSION_DEFAULT_SETTING); - } else if ((nodeForm.getFile() != null) && (nodeForm.getFile().getFileSize() > 0)) { + } else if ((nodeForm.getFile() != null) && (nodeForm.getFile().getSize() > 0)) { // file has been uploaded, so copy it to file system and import LD - FormFile file = nodeForm.getFile(); + MultipartFile file = nodeForm.getFile(); InputStream inputStream = file.getInputStream(); - File sourceFile = new File(FileUtil.getTempDir(), file.getFileName()); + File sourceFile = new File(FileUtil.getTempDir(), file.getName()); try { FileUtils.copyInputStreamToFile(inputStream, sourceFile); @@ -975,10 +973,10 @@ */ private MultiValueMap validateFormFile(PedagogicalPlannerSequenceNodeForm form) { MultiValueMap errorMap = new LinkedMultiValueMap<>(); - if ((form.getFile() == null) || (form.getFile().getFileSize() == 0)) { + if ((form.getFile() == null) || (form.getFile().getSize() == 0)) { errorMap.add("GLOBAL", messageService.getMessage(PedagogicalPlannerController.ERROR_KEY_FILE_EMPTY)); } else { - String fileName = form.getFile().getFileName(); + String fileName = form.getFile().getName(); boolean badExtension = false; if (fileName.length() >= 4) { String extension = fileName.substring(fileName.length() - 4); @@ -1202,7 +1200,7 @@ if (errorMap.isEmpty()) { try { String uploadPath = FileUtil.createTempDirectory(PedagogicalPlannerController.DIR_UPLOADED_NODE_SUFFIX); - String fileName = nodeForm.getFile().getFileName(); + String fileName = nodeForm.getFile().getName(); File importFile = new File(uploadPath + fileName); PedagogicalPlannerController.log.debug("Importing a node from file: " + fileName); Index: lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerSequenceNodeForm.java =================================================================== diff -u -rf32bc3c30b8ea0463d84b4dbdc112f77a400297a -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerSequenceNodeForm.java (.../PedagogicalPlannerSequenceNodeForm.java) (revision f32bc3c30b8ea0463d84b4dbdc112f77a400297a) +++ lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerSequenceNodeForm.java (.../PedagogicalPlannerSequenceNodeForm.java) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -22,8 +22,8 @@ package org.lamsfoundation.lams.web.planner; -import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.planner.PedagogicalPlannerSequenceNode; +import org.springframework.web.multipart.MultipartFile; public class PedagogicalPlannerSequenceNodeForm { public final static String NODE_TYPE_SUBNODES = "subnodes"; @@ -35,7 +35,7 @@ private String title; private String briefDescription; private String fullDescription; - private FormFile file; + private MultipartFile file; private Boolean removeTemplate; private String nodeType = PedagogicalPlannerSequenceNodeForm.NODE_TYPE_SUBNODES; @@ -157,11 +157,11 @@ this.parentUid = parentUid; } - public FormFile getFile() { + public MultipartFile getFile() { return file; } - public void setFile(FormFile file) { + public void setFile(MultipartFile file) { this.file = file; } Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/web/tag/MultiLinesTextareaTag.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/struts-config.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tiles-defs.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/web/WEB-INF/tlds/lams/lams.tld =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_central/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -212,191 +212,6 @@ - - STRUTS-textarea - org.lamsfoundation.lams.web.tag.MultiLinesTextareaTag - empty - - accesskey - false - true - - - alt - false - true - - - altKey - false - true - - - bundle - false - true - - - cols - false - true - - - disabled - false - true - - - errorKey - false - true - - - errorStyle - false - true - - - errorStyleClass - false - true - - - errorStyleId - false - true - - - index - false - true - - - indexed - false - true - - - name - false - true - - - onblur - false - true - - - onchange - false - true - - - onclick - false - true - - - ondblclick - false - true - - - onfocus - false - true - - - onkeydown - false - true - - - onkeypress - false - true - - - onkeyup - false - true - - - onmousedown - false - true - - - onmousemove - false - true - - - onmouseout - false - true - - - onmouseover - false - true - - - onmouseup - false - true - - - property - true - true - - - readonly - false - true - - - rows - false - true - - - style - false - true - - - styleClass - false - true - - - styleId - false - true - - - tabindex - false - true - - - title - false - true - - - titleKey - false - true - - - value - false - true - - Small portrait of a user Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tlds/struts/struts-bean-el.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tlds/struts/struts-bean.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tlds/struts/struts-html-el.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tlds/struts/struts-html.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tlds/struts/struts-logic-el.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tlds/struts/struts-logic.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tlds/struts/struts-nested.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tlds/struts/struts-tiles-el.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/tlds/struts/struts-tiles.tld'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/validation.xml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag a127989b08183726fcbb9956721eff6553c4a0eb refers to a dead (removed) revision in file `lams_central/web/WEB-INF/validator-rules.xml'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/web/WEB-INF/web.xml =================================================================== diff -u -rf32bc3c30b8ea0463d84b4dbdc112f77a400297a -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/web/WEB-INF/web.xml (.../web.xml) (revision f32bc3c30b8ea0463d84b4dbdc112f77a400297a) +++ lams_central/web/WEB-INF/web.xml (.../web.xml) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -523,49 +523,6 @@ - - - - tags-bean - /WEB-INF/tlds/struts/struts-bean.tld - - - - tags-html - /WEB-INF/tlds/struts/struts-html.tld - - - - tags-logic - /WEB-INF/tlds/struts/struts-logic.tld - - - - tags-tiles - /WEB-INF/tlds/struts/struts-tiles.tld - - - - tags-bean-el - /WEB-INF/tlds/struts/struts-bean-el.tld - - - - tags-html-el - /WEB-INF/tlds/struts/struts-html-el.tld - - - - tags-logic-el - /WEB-INF/tlds/struts/struts-logic-el.tld - - - - tags-tiles-el - /WEB-INF/tlds/struts/struts-tiles-el.tld - - - Index: lams_central/web/editprofile.jsp =================================================================== diff -u -r0e9eca8da006863730e793b75a47803bc6142c67 -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/web/editprofile.jsp (.../editprofile.jsp) (revision 0e9eca8da006863730e793b75a47803bc6142c67) +++ lams_central/web/editprofile.jsp (.../editprofile.jsp) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -115,7 +115,7 @@
+ disabled="${!profileEditEnabled}" cssClass="form-control" />
Index: lams_central/web/emailuser.jsp =================================================================== diff -u -r5943e05705f7614c7c1c29d13ce50deacdc46cc0 -ra127989b08183726fcbb9956721eff6553c4a0eb --- lams_central/web/emailuser.jsp (.../emailuser.jsp) (revision 5943e05705f7614c7c1c29d13ce50deacdc46cc0) +++ lams_central/web/emailuser.jsp (.../emailuser.jsp) (revision a127989b08183726fcbb9956721eff6553c4a0eb) @@ -3,9 +3,9 @@ contentType="text/html;charset=utf-8"%> <%@ taglib uri="tags-lams" prefix="lams"%> -<%@ taglib uri="tags-html" prefix="html"%> <%@ taglib uri="tags-fmt" prefix="fmt"%> <%@ taglib uri="tags-core" prefix="c"%> + <fmt:message key="title.admin.window" /> @@ -26,9 +26,9 @@ //constant for instantedit.js var IS_AJAX_CALL_REQUIRED = false; - - - + + +