Index: lams_tool_wiki/.classpath =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -rada9f9222f66994c94c2989aea922429377f06ed --- lams_tool_wiki/.classpath (.../.classpath) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_wiki/.classpath (.../.classpath) (revision ada9f9222f66994c94c2989aea922429377f06ed) @@ -2,7 +2,7 @@ - + Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/AuthoringController.java =================================================================== diff -u -r82c8ee6bc80d47736337c5b07ccc686c5ea3ba32 -rada9f9222f66994c94c2989aea922429377f06ed --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/AuthoringController.java (.../AuthoringController.java) (revision 82c8ee6bc80d47736337c5b07ccc686c5ea3ba32) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/AuthoringController.java (.../AuthoringController.java) (revision ada9f9222f66994c94c2989aea922429377f06ed) @@ -31,10 +31,6 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.lamsfoundation.lams.authoring.web.AuthoringAction; import org.lamsfoundation.lams.authoring.web.AuthoringConstants; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.wiki.dto.WikiPageContentDTO; @@ -44,12 +40,17 @@ import org.lamsfoundation.lams.tool.wiki.model.WikiPageContent; import org.lamsfoundation.lams.tool.wiki.model.WikiUser; import org.lamsfoundation.lams.tool.wiki.service.IWikiService; -import org.lamsfoundation.lams.tool.wiki.service.WikiServiceProxy; import org.lamsfoundation.lams.tool.wiki.util.WikiConstants; import org.lamsfoundation.lams.tool.wiki.web.forms.AuthoringForm; +import org.lamsfoundation.lams.tool.wiki.web.forms.WikiPageForm; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.util.AttributeNames; import org.lamsfoundation.lams.web.util.SessionMap; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; /** * This action handles all the authoring actions, which include opening author, saving, uploading instruction files and @@ -60,11 +61,15 @@ * * @author lfoxton */ -public class AuthoringController { +@Controller +@RequestMapping("/authoring") +public class AuthoringController extends WikiPageController { private static Logger logger = Logger.getLogger(AuthoringController.class); - public IWikiService wikiService; + @Autowired + @Qualifier("wikiService") + private IWikiService wikiService; // Authoring SessionMap key names private static final String KEY_TOOL_CONTENT_ID = "toolContentID"; @@ -78,8 +83,8 @@ * toolContentID will be passed in. This will be used to retrieve content for this tool. * */ - @Override - protected ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, + @RequestMapping("/authoring") + public String unspecified(@ModelAttribute AuthoringForm authoringForm, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract toolContentID from parameters. @@ -90,15 +95,9 @@ ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); // Set up the authForm. - AuthoringForm authForm = (AuthoringForm) form; - Long currentPageUid = authForm.getCurrentWikiPageId(); + Long currentPageUid = authoringForm.getCurrentWikiPageId(); - // set up wikiService - if (wikiService == null) { - wikiService = WikiServiceProxy.getWikiService(this.getServlet().getServletContext()); - } - // retrieving Wiki with given toolContentID Wiki wiki = wikiService.getWikiByContentId(toolContentID); if (wiki == null) { @@ -120,7 +119,7 @@ } // update the form - updateAuthForm(authForm, wiki); + updateAuthForm(authoringForm, wiki); // Set the required main wiki page WikiPageDTO mainPageDTO = new WikiPageDTO(wiki.getMainPage()); @@ -138,7 +137,7 @@ request.setAttribute(WikiConstants.ATTR_CURRENT_WIKI, currentPageDTO); // Reset the isEditable field for the form - authForm.setIsEditable(currentPageDTO.getEditable()); + authoringForm.setIsEditable(currentPageDTO.getEditable()); // Set the current wiki history SortedSet currentWikiPageHistoryDTOs = new TreeSet<>(); @@ -161,48 +160,42 @@ // Set up sessionMap SessionMap map = createSessionMap(wiki, mode, contentFolderID, toolContentID); - authForm.setSessionMapID(map.getSessionID()); + authoringForm.setSessionMapID(map.getSessionID()); // add the sessionMap to HTTPSession. request.getSession().setAttribute(map.getSessionID(), map); request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map); - return mapping.findForward("success"); + return "pages/authoring/authoring"; } @Override - public ActionForward removePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws Exception { + public String removePage(@ModelAttribute WikiPageForm wikiForm, HttpServletRequest request) throws Exception { + Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); Wiki wiki = wikiService.getWikiByContentId(toolContentID); if (wiki.isDefineLater()) { // Only mark as removed if editing a live version (monitor/live edit) - return super.removePage(mapping, form, request, response); + return super.removePage(wikiForm, request); } // Completely delete the page Long currentPageUid = WebUtil.readLongParam(request, WikiConstants.ATTR_CURRENT_WIKI); - // set up wikiService - if (wikiService == null) { - wikiService = WikiServiceProxy.getWikiService(this.getServlet().getServletContext()); - } - WikiPage wikiPage = wikiService.getWikiPageByUid(currentPageUid); wikiService.deleteWikiPage(wikiPage); // return to the main page, by setting the current page to null - return this.returnToWiki(mapping, form, request, response, null); + return this.returnToWiki(wikiForm, request, null); } /** * Wrapper method to make sure that the correct wiki is returned to from the WikiPageAction class */ @Override - protected ActionForward returnToWiki(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response, Long currentWikiPageId) throws Exception { - AuthoringForm authForm = (AuthoringForm) form; - authForm.setCurrentWikiPageId(currentWikiPageId); - return unspecified(mapping, authForm, request, response); + protected String returnToWiki(AuthoringForm authoringForm, HttpServletRequest request, HttpServletResponse response, + Long currentWikiPageId) throws Exception { + authoringForm.setCurrentWikiPageId(currentWikiPageId); + return unspecified(authoringForm, request, response); } /** @@ -218,26 +211,19 @@ * Saves the Wiki content including uploaded files and advance options * * The WikiPage content is not saved here as that is done in the WikiPageAction - * - * @param mapping - * @param form - * @param request - * @param response - * @return */ - public ActionForward updateContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, + @RequestMapping("/updateContent") + public String updateContent(@ModelAttribute AuthoringForm authoringForm, HttpServletRequest request, HttpServletResponse response) { // TODO need error checking. - // get authForm and session map. - AuthoringForm authForm = (AuthoringForm) form; - SessionMap map = getSessionMap(request, authForm); + SessionMap map = getSessionMap(request, authoringForm); // get wiki content. - Wiki wiki = wikiService.getWikiByContentId((Long) map.get(AuthoringAction.KEY_TOOL_CONTENT_ID)); + Wiki wiki = wikiService.getWikiByContentId((Long) map.get(AuthoringController.KEY_TOOL_CONTENT_ID)); // update wiki content using form inputs - updateWiki(wiki, authForm); + updateWiki(wiki, authoringForm); // set the update date wiki.setUpdateDate(new Date()); @@ -250,19 +236,15 @@ request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); // add the sessionMapID to form - authForm.setSessionMapID(map.getSessionID()); + authoringForm.setSessionMapID(map.getSessionID()); request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map); - return mapping.findForward("success"); + return "pages/authoring/authoring"; } /** * Updates Wiki content using AuthoringForm inputs. - * - * @param authForm - * @param mode - * @return */ private void updateWiki(Wiki wiki, AuthoringForm authForm) { // wiki.setTitle(authForm.getTitle()); @@ -287,10 +269,6 @@ /** * Updates AuthoringForm using Wiki content. - * - * @param wiki - * @param authForm - * @return */ private void updateAuthForm(AuthoringForm authForm, Wiki wiki) { authForm.setLockOnFinished(wiki.isLockOnFinished()); @@ -307,9 +285,6 @@ /** * Updates SessionMap using Wiki content. - * - * @param wiki - * @param mode */ private SessionMap createSessionMap(Wiki wiki, ToolAccessMode mode, String contentFolderID, Long toolContentID) { @@ -325,10 +300,6 @@ /** * Retrieve the SessionMap from the HttpSession. - * - * @param request - * @param authForm - * @return */ private SessionMap getSessionMap(HttpServletRequest request, AuthoringForm authForm) { return (SessionMap) request.getSession().getAttribute(authForm.getSessionMapID()); Fisheye: Tag ada9f9222f66994c94c2989aea922429377f06ed refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/LearningAction.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/LearningController.java =================================================================== diff -u --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/LearningController.java (revision 0) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/LearningController.java (revision ada9f9222f66994c94c2989aea922429377f06ed) @@ -0,0 +1,380 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.wiki.web.controller; + +import java.io.IOException; +import java.util.Date; +import java.util.SortedSet; +import java.util.TimeZone; +import java.util.TreeSet; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.learning.web.util.LearningWebUtil; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.ToolSessionManager; +import org.lamsfoundation.lams.tool.exception.DataMissingException; +import org.lamsfoundation.lams.tool.exception.ToolException; +import org.lamsfoundation.lams.tool.wiki.dto.WikiDTO; +import org.lamsfoundation.lams.tool.wiki.dto.WikiPageContentDTO; +import org.lamsfoundation.lams.tool.wiki.dto.WikiPageDTO; +import org.lamsfoundation.lams.tool.wiki.dto.WikiUserDTO; +import org.lamsfoundation.lams.tool.wiki.model.Wiki; +import org.lamsfoundation.lams.tool.wiki.model.WikiPage; +import org.lamsfoundation.lams.tool.wiki.model.WikiPageContent; +import org.lamsfoundation.lams.tool.wiki.model.WikiSession; +import org.lamsfoundation.lams.tool.wiki.model.WikiUser; +import org.lamsfoundation.lams.tool.wiki.service.IWikiService; +import org.lamsfoundation.lams.tool.wiki.service.WikiServiceProxy; +import org.lamsfoundation.lams.tool.wiki.util.WikiConstants; +import org.lamsfoundation.lams.tool.wiki.util.WikiException; +import org.lamsfoundation.lams.tool.wiki.web.forms.LearningForm; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.DateUtil; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.context.WebApplicationContext; + +/** + * This action handles all the learning actions, which include opening learner, + * relection, going to the next activity, and all the wikipage actions + * + * It inherits from the WikiPageAction which inherits from the + * LamsDispatchAction so that common actions can be used in learner, monitor and + * author + * + * @author lfoxton + * @version + * + * + * + * + * + * + * + * + */ +@Controller +@RequestMapping("/learning") +public class LearningController extends WikiPageController { + + private static Logger log = Logger.getLogger(LearningController.class); + + private static final boolean MODE_OPTIONAL = false; + + @Autowired + @Qualifier("wikiService") + private IWikiService wikiService; + + @Autowired + private WebApplicationContext applicationContext; + + /** + * unspecified loads the learner window with the current wiki page as well + * as setting all the advanced options and user-specifice info + */ + @RequestMapping("/learning") + public String unspecified(@ModelAttribute LearningForm learningForm, HttpServletRequest request, + HttpServletResponse response) throws Exception { + + // 'toolSessionID' and 'mode' parameters are expected to be present. + // TODO need to catch exceptions and handle errors. + ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, MODE_OPTIONAL); + + Long toolSessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + + Long currentPageUid = learningForm.getCurrentWikiPageId(); + + // Retrieve the session and content. + WikiSession wikiSession = wikiService.getSessionBySessionId(toolSessionID); + if (wikiSession == null) { + throw new WikiException("Cannot retrieve session with toolSessionID" + toolSessionID); + } + + Wiki wiki = wikiSession.getWiki(); + + // check defineLater + if (wiki.isDefineLater()) { + return "pages/learning/defineLater"; + } + + // set mode, toolSessionID and WikiDTO + request.setAttribute(WikiConstants.ATTR_MODE, mode.toString()); + learningForm.setToolSessionID(toolSessionID); + + WikiDTO wikiDTO = new WikiDTO(wiki); + request.setAttribute(WikiConstants.ATTR_WIKI_DTO, wikiDTO); + + // Set the content in use flag. + if (!wiki.isContentInUse()) { + wiki.setContentInUse(new Boolean(true)); + wikiService.saveOrUpdateWiki(wiki); + } + + LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionID, request, + applicationContext.getServletContext()); + + // get the user + WikiUser wikiUser; + if (mode.equals(ToolAccessMode.TEACHER)) { + Long userID = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID, false); + wikiUser = wikiService.getUserByUserIdAndSessionId(userID, toolSessionID); + } else { + wikiUser = getCurrentUser(toolSessionID); + } + + // Create the userDTO + WikiUserDTO wikiUserDTO = new WikiUserDTO(wikiUser); + if (wikiUser.isFinishedActivity()) { + // get the notebook entry. + NotebookEntry notebookEntry = wikiService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + WikiConstants.TOOL_SIGNATURE, wikiUser.getUserId().intValue()); + if (notebookEntry != null) { + wikiUserDTO.setNotebookEntry(notebookEntry.getEntry()); + } + } + + // Set whether the user has enabled notifications + if (wikiService.getEventNotificationService().eventExists(WikiConstants.TOOL_SIGNATURE, + WikiConstants.EVENT_NOTIFY_LEARNERS, toolSessionID) + && wikiService.getEventNotificationService().isSubscribed(WikiConstants.TOOL_SIGNATURE, + WikiConstants.EVENT_NOTIFY_LEARNERS, toolSessionID, wikiUser.getUserId())) { + wikiUserDTO.setNotificationEnabled(true); + } + + // add the userDTO to attributes + request.setAttribute(WikiConstants.ATTR_USER_DTO, wikiUserDTO); + + // Set whether user has reached maximum edits + int maxEdits = wiki.getMaximumEdits(); + Boolean maxEditsReached = (maxEdits != 0 && wikiUser.getWikiEdits() >= maxEdits); + request.setAttribute(WikiConstants.ATTR_MAX_EDITS_REACHED, maxEditsReached); + request.setAttribute(WikiConstants.ATTR_EDITS_LEFT, maxEdits - wikiUser.getWikiEdits()); + + // Set whether user has reached minimum edits + int minEdits = wiki.getMinimumEdits(); + Boolean minEditsReached = (wikiUser.getWikiEdits() >= minEdits); + request.setAttribute(WikiConstants.ATTR_MIN_EDITS_REACHED, minEditsReached); + + // Get the wikipages from the session and the main page + SortedSet wikiPageDTOs = new TreeSet<>(); + for (WikiPage wikiPage : wikiSession.getWikiPages()) { + WikiPageDTO pageDTO = new WikiPageDTO(wikiPage); + + wikiPageDTOs.add(pageDTO); + + } + request.setAttribute(WikiConstants.ATTR_WIKI_PAGES, wikiPageDTOs); + request.setAttribute(WikiConstants.ATTR_MAIN_WIKI_PAGE, new WikiPageDTO(wikiSession.getMainPage())); + + // Set the current wiki page, if there is none, set to the main page + WikiPage currentWikiPage = null; + if (currentPageUid != null) { + currentWikiPage = wikiService.getWikiPageByUid(currentPageUid); + } else { + currentWikiPage = wikiSession.getMainPage(); + } + request.setAttribute(WikiConstants.ATTR_CURRENT_WIKI, new WikiPageDTO(currentWikiPage)); + + // Set the current wiki history + SortedSet currentWikiPageHistoryDTOs = new TreeSet<>(); + for (WikiPageContent wikiPageContentHistoryItem : currentWikiPage.getWikiContentVersions()) { + currentWikiPageHistoryDTOs.add(new WikiPageContentDTO(wikiPageContentHistoryItem)); + } + request.setAttribute(WikiConstants.ATTR_WIKI_PAGE_CONTENT_HISTORY, currentWikiPageHistoryDTOs); + + // Set the content folder id + request.setAttribute(WikiConstants.ATTR_CONTENT_FOLDER_ID, + wikiService.getLearnerContentFolder(toolSessionID, wikiUser.getUserId())); + + // set readOnly flag. + if (mode.equals(ToolAccessMode.TEACHER) || (wiki.isLockOnFinished() && wikiUser.isFinishedActivity())) { + request.setAttribute(WikiConstants.ATTR_CONTENT_EDITAVLE, false); + } else { + request.setAttribute(WikiConstants.ATTR_CONTENT_EDITAVLE, true); + } + request.setAttribute(WikiConstants.ATTR_FINISHED_ACTIVITY, wikiUser.isFinishedActivity()); + + /* Check if submission deadline is null */ + + Date submissionDeadline = wikiDTO.getSubmissionDeadline(); + request.setAttribute("wikiDTO", wikiDTO); + + if (submissionDeadline != null) { + + HttpSession ss = SessionManager.getSession(); + UserDTO learnerDto = (UserDTO) ss.getAttribute(AttributeNames.USER); + TimeZone learnerTimeZone = learnerDto.getTimeZone(); + Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline); + Date currentLearnerDate = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, new Date()); + request.setAttribute("submissionDeadline", submissionDeadline); + + // calculate whether submission deadline has passed, and if so forward to "submissionDeadline" + if (currentLearnerDate.after(tzSubmissionDeadline)) { + return "pages/learning/submissionDeadline"; + } + + } + + return "pages/learning/wiki"; + } + + /** + * Wrapper method to make sure that the correct wiki is returned to from the + * WikiPageAction class + */ + @Override + public String returnToWiki(LearningForm learnForm, HttpServletRequest request, HttpServletResponse response, + Long currentWikiPageId) throws Exception { + learnForm.setCurrentWikiPageId(currentWikiPageId); + // put the tool session id in the attributes so that the progress bar can pick it up. + request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID, learnForm.getToolSessionID()); + return unspecified(learnForm, request, response); + } + + /** + * Gets the current user by toolSessionId + */ + @Override + protected WikiUser getCurrentUser(Long toolSessionId) { + UserDTO user = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); + + // attempt to retrieve user using userId and toolSessionId + WikiUser wikiUser = wikiService.getUserByUserIdAndSessionId(new Long(user.getUserID().intValue()), + toolSessionId); + + if (wikiUser == null) { + WikiSession wikiSession = wikiService.getSessionBySessionId(toolSessionId); + wikiUser = wikiService.createWikiUser(user, wikiSession); + } + + return wikiUser; + } + + /** + * Finish the activity, we dont need to save anything here, as that is done + * by the wikipage actions + */ + @RequestMapping("/finishActivity") + public String finishActivity(@ModelAttribute LearningForm learningForm, HttpServletRequest request, + HttpServletResponse response) { + + Long toolSessionID = WebUtil.readLongParam(request, "toolSessionID"); + + WikiUser wikiUser = getCurrentUser(toolSessionID); + + if (wikiUser != null) { + wikiUser.setFinishedActivity(true); + wikiService.saveOrUpdateWikiUser(wikiUser); + } else { + log.error("finishActivity(): couldn't find WikiUser with id: " + wikiUser.getUserId() + + "and toolSessionID: " + toolSessionID); + } + + ToolSessionManager sessionMgrService = WikiServiceProxy + .getWikiSessionManager(applicationContext.getServletContext()); + + String nextActivityUrl; + try { + nextActivityUrl = sessionMgrService.leaveToolSession(toolSessionID, wikiUser.getUserId()); + response.sendRedirect(nextActivityUrl); + } catch (DataMissingException e) { + throw new WikiException(e); + } catch (ToolException e) { + throw new WikiException(e); + } catch (IOException e) { + throw new WikiException(e); + } + + return null; // TODO need to return proper page. + } + + /** + * Opens the notebook page for reflections + */ + @RequestMapping("/openNotebook") + public String openNotebook(@ModelAttribute LearningForm learningForm, HttpServletRequest request, + HttpServletResponse response) { + + // set the finished flag + WikiUser wikiUser = this.getCurrentUser(learningForm.getToolSessionID()); + WikiDTO wikiDTO = new WikiDTO(wikiUser.getWikiSession().getWiki()); + + request.setAttribute("wikiDTO", wikiDTO); + + NotebookEntry notebookEntry = wikiService.getEntry(wikiUser.getWikiSession().getSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, WikiConstants.TOOL_SIGNATURE, wikiUser.getUserId().intValue()); + + if (notebookEntry != null) { + learningForm.setEntryText(notebookEntry.getEntry()); + } + + LearningWebUtil.putActivityPositionInRequestByToolSessionId(learningForm.getToolSessionID(), request, + applicationContext.getServletContext()); + + return "pages/learning/notebook"; + } + + /** + * Submit reflections + */ + @RequestMapping("/submitReflection") + public String submitReflection(@ModelAttribute LearningForm learningForm, HttpServletRequest request, + HttpServletResponse response) { + + // save the reflection entry and call the notebook. + + WikiUser wikiUser = this.getCurrentUser(learningForm.getToolSessionID()); + Long toolSessionID = wikiUser.getWikiSession().getSessionId(); + Integer userID = wikiUser.getUserId().intValue(); + + // check for existing notebook entry + NotebookEntry entry = wikiService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + WikiConstants.TOOL_SIGNATURE, userID); + + if (entry == null) { + // create new entry + wikiService.createNotebookEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + WikiConstants.TOOL_SIGNATURE, userID, learningForm.getEntryText()); + } else { + // update existing entry + entry.setEntry(learningForm.getEntryText()); + entry.setLastModified(new Date()); + wikiService.updateEntry(entry); + } + + return finishActivity(learningForm, request, response); + } +} Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/MonitoringAction.java =================================================================== diff -u -r82c8ee6bc80d47736337c5b07ccc686c5ea3ba32 -rada9f9222f66994c94c2989aea922429377f06ed --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/MonitoringAction.java (.../MonitoringAction.java) (revision 82c8ee6bc80d47736337c5b07ccc686c5ea3ba32) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/MonitoringAction.java (.../MonitoringAction.java) (revision ada9f9222f66994c94c2989aea922429377f06ed) @@ -21,21 +21,19 @@ * **************************************************************** */ - package org.lamsfoundation.lams.tool.wiki.web.controller; import java.io.IOException; +import java.util.Date; import java.util.SortedSet; +import java.util.TimeZone; import java.util.TreeSet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.wiki.dto.WikiDTO; @@ -49,21 +47,22 @@ import org.lamsfoundation.lams.tool.wiki.model.WikiSession; import org.lamsfoundation.lams.tool.wiki.model.WikiUser; import org.lamsfoundation.lams.tool.wiki.service.IWikiService; -import org.lamsfoundation.lams.tool.wiki.service.WikiServiceProxy; import org.lamsfoundation.lams.tool.wiki.util.WikiConstants; import org.lamsfoundation.lams.tool.wiki.util.WikiException; import org.lamsfoundation.lams.tool.wiki.web.forms.MonitoringForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.DateUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; -import java.util.Date; - -import org.lamsfoundation.lams.util.DateUtil; - -import java.util.TimeZone; - /** * This action handles all the monitoring actions, which include opening * monitor, and all the wikipage actions @@ -74,23 +73,23 @@ * * @author lfoxton */ -public class MonitoringAction extends WikiPageAction { +@Controller +@RequestMapping("/monitoring") +public class MonitoringController extends WikiPageController { - private static Logger log = Logger.getLogger(MonitoringAction.class); + private static Logger log = Logger.getLogger(MonitoringController.class); - public IWikiService wikiService; + @Autowired + @Qualifier("wikiService") + private IWikiService wikiService; /** * Sets up the main authoring page which lists the tool sessions and allows * you to view their respective WikiPages */ - @Override - public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws Exception { + @RequestMapping("/monitoring") + public String unspecified(HttpServletRequest request) throws Exception { - if (wikiService == null) { - wikiService = WikiServiceProxy.getWikiService(this.getServlet().getServletContext()); - } String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); Long toolContentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID, true); @@ -114,7 +113,7 @@ Long currentTab = WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true); wikiDT0.setCurrentTab(currentTab); - + /* Check if submission deadline is null */ Date submissionDeadline = wikiDT0.getSubmissionDeadline(); @@ -127,33 +126,30 @@ Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline); request.setAttribute("submissionDeadline", tzSubmissionDeadline.getTime()); // use the unconverted time, as convertToStringForJSON() does the timezone conversion if needed - request.setAttribute("submissionDateString", DateUtil.convertToStringForJSON(submissionDeadline, request.getLocale())); + request.setAttribute("submissionDateString", + DateUtil.convertToStringForJSON(submissionDeadline, request.getLocale())); - } request.setAttribute(WikiConstants.ATTR_WIKI_DTO, wikiDT0); request.setAttribute(WikiConstants.ATTR_CONTENT_FOLDER_ID, contentFolderID); request.setAttribute(WikiConstants.ATTR_IS_GROUPED_ACTIVITY, wikiService.isGroupedActivity(toolContentID)); - return mapping.findForward("success"); + return "pages/monitoring/monitoring"; } /** * Wrapper method to make sure that the correct wiki is returned to from the * WikiPageAction class */ @Override - protected ActionForward returnToWiki(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response, Long currentWikiPageId) throws Exception { - MonitoringForm monitoringForm = (MonitoringForm) form; + public String returnToWiki(MonitoringForm monitoringForm, HttpServletRequest request, HttpServletResponse response, + Long currentWikiPageId) throws Exception { monitoringForm.setCurrentWikiPageId(currentWikiPageId); - return showWiki(mapping, monitoringForm, request, response); + return showWiki(monitoringForm, request, response); } /** * Gets the current user by toolSessionId - * - * @param toolSessionId */ @Override protected WikiUser getCurrentUser(Long toolSessionId) { @@ -170,29 +166,18 @@ return wikiUser; } - - + /** * Set Submission Deadline - * - * @param mapping - * @param form - * @param request - * @param response - * @return */ - public ActionForward setSubmissionDeadline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException { + @RequestMapping(path = "/setSubmissionDeadline", produces = MediaType.TEXT_PLAIN_VALUE) + @ResponseBody + public String setSubmissionDeadline(HttpServletRequest request, HttpServletResponse response) throws IOException { - // set up wikiService - if (wikiService == null) { - wikiService = WikiServiceProxy.getWikiService(this.getServlet().getServletContext()); - } - Long contentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); Wiki wiki = wikiService.getWikiByContentId(contentID); - Long dateParameter = WebUtil.readLongParam(request,WikiConstants.ATTR_SUBMISSION_DEADLINE, true); + Long dateParameter = WebUtil.readLongParam(request, WikiConstants.ATTR_SUBMISSION_DEADLINE, true); Date tzSubmissionDeadline = null; String formattedDate = ""; if (dateParameter != null) { @@ -206,29 +191,19 @@ wiki.setSubmissionDeadline(tzSubmissionDeadline); wikiService.saveOrUpdateWiki(wiki); response.setContentType("text/plain;charset=utf-8"); - response.getWriter().print(formattedDate); - return null; + return formattedDate; } /** * Shows a specific wiki based on the session id - * - * @param mapping - * @param form - * @param request - * @param response - * @return */ - public ActionForward showWiki(ActionMapping mapping, ActionForm form, HttpServletRequest request, + @RequestMapping("/showWiki") + public String showWiki(@ModelAttribute MonitoringForm monitoringForm, HttpServletRequest request, HttpServletResponse response) { Long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - if (wikiService == null) { - wikiService = WikiServiceProxy.getWikiService(this.getServlet().getServletContext()); - } - WikiSession wikiSession = wikiService.getSessionBySessionId(toolSessionId); WikiSessionDTO sessionDTO = new WikiSessionDTO(wikiSession); Long toolContentId = wikiSession.getWiki().getToolContentId(); @@ -245,12 +220,11 @@ request.setAttribute(WikiConstants.ATTR_SESSION_DTO, sessionDTO); // Set up the authForm. - MonitoringForm monForm = (MonitoringForm) form; - Long currentPageUid = monForm.getCurrentWikiPageId(); + Long currentPageUid = monitoringForm.getCurrentWikiPageId(); // Get the wikipages from the session and the main page - SortedSet wikiPageDTOs = new TreeSet(); + SortedSet wikiPageDTOs = new TreeSet<>(); for (WikiPage wikiPage : wikiSession.getWikiPages()) { WikiPageDTO pageDTO = new WikiPageDTO(wikiPage); @@ -270,18 +244,18 @@ request.setAttribute(WikiConstants.ATTR_CURRENT_WIKI, new WikiPageDTO(currentWikiPage)); // Reset the isEditable and newPageIdEditable field for the form - monForm.setIsEditable(currentWikiPage.getEditable()); - monForm.setNewPageIsEditable(true); + monitoringForm.setIsEditable(currentWikiPage.getEditable()); + monitoringForm.setNewPageIsEditable(true); // Set the current wiki history - SortedSet currentWikiPageHistoryDTOs = new TreeSet(); + SortedSet currentWikiPageHistoryDTOs = new TreeSet<>(); for (WikiPageContent wikiPageContentHistoryItem : currentWikiPage.getWikiContentVersions()) { currentWikiPageHistoryDTOs.add(new WikiPageContentDTO(wikiPageContentHistoryItem)); } request.setAttribute(WikiConstants.ATTR_WIKI_PAGE_CONTENT_HISTORY, currentWikiPageHistoryDTOs); request.setAttribute(WikiConstants.ATTR_CONTENT_FOLDER_ID, contentFolderID); request.setAttribute(WikiConstants.ATTR_IS_GROUPED_ACTIVITY, wikiService.isGroupedActivity(toolContentId)); - return mapping.findForward("wiki_display"); + return "pages/monitoring/wikiDisplay"; } } Fisheye: Tag ada9f9222f66994c94c2989aea922429377f06ed refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/PedagogicalPlannerAction.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/PedagogicalPlannerController.java =================================================================== diff -u --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/PedagogicalPlannerController.java (revision 0) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/PedagogicalPlannerController.java (revision ada9f9222f66994c94c2989aea922429377f06ed) @@ -0,0 +1,91 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.wiki.web.controller; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.wiki.model.Wiki; +import org.lamsfoundation.lams.tool.wiki.service.IWikiService; +import org.lamsfoundation.lams.tool.wiki.web.forms.WikiPedagogicalPlannerForm; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.planner.PedagogicalPlannerAction; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * @author Marcin Cieslak + * + * + * + * + * + */ +@Controller +@RequestMapping("/pedagogicalPlanner") +public class PedagogicalPlannerController { + + private static Logger logger = Logger.getLogger(PedagogicalPlannerAction.class); + + @Autowired + @Qualifier("wikiService") + private IWikiService wikiService; + + @RequestMapping("/initPedagogicalPlannerForm") + public String initPedagogicalPlannerForm(@ModelAttribute WikiPedagogicalPlannerForm plannerForm, + HttpServletRequest request, HttpServletResponse response) { + Long toolContentID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Wiki wiki = wikiService.getWikiByContentId(toolContentID); + plannerForm.fillForm(wiki); + String contentFolderId = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + plannerForm.setContentFolderID(contentFolderId); + return "pages/authoring/pedagogicalPlannerForm"; + } + + @RequestMapping("/saveOrUpdatePedagogicalPlannerForm") + public String saveOrUpdatePedagogicalPlannerForm(@ModelAttribute WikiPedagogicalPlannerForm plannerForm, + HttpServletRequest request, HttpServletResponse response) throws IOException { +// ActionMessages errors = plannerForm.validate(); +// if (errors.isEmpty()) { +// String instructions = plannerForm.getWikiBody(); +// Long toolContentID = plannerForm.getToolContentID(); +// Wiki wiki = getWikiService().getWikiByContentId(toolContentID); +// WikiPage wikiPage = wiki.getWikiPages().iterator().next(); +// wikiPage.setTitle(plannerForm.getTitle()); +// wikiPage.getCurrentWikiContent().setBody(plannerForm.getWikiBody()); +// getWikiService().saveOrUpdateWikiPage(wikiPage); +// } else { +// saveErrors(request, errors); +// } + return "pages/authoring/pedagogicalPlannerForm"; + } + +} \ No newline at end of file Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/WikiPageController.java =================================================================== diff -u -r82c8ee6bc80d47736337c5b07ccc686c5ea3ba32 -rada9f9222f66994c94c2989aea922429377f06ed --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/WikiPageController.java (.../WikiPageController.java) (revision 82c8ee6bc80d47736337c5b07ccc686c5ea3ba32) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/controller/WikiPageController.java (.../WikiPageController.java) (revision ada9f9222f66994c94c2989aea922429377f06ed) @@ -26,14 +26,10 @@ import java.util.List; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.codec.binary.Base64; import org.apache.log4j.Logger; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.events.IEventNotificationService; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.wiki.dto.WikiPageContentDTO; @@ -44,7 +40,6 @@ import org.lamsfoundation.lams.tool.wiki.model.WikiSession; import org.lamsfoundation.lams.tool.wiki.model.WikiUser; import org.lamsfoundation.lams.tool.wiki.service.IWikiService; -import org.lamsfoundation.lams.tool.wiki.service.WikiServiceProxy; import org.lamsfoundation.lams.tool.wiki.util.WikiConstants; import org.lamsfoundation.lams.tool.wiki.web.forms.WikiPageForm; import org.lamsfoundation.lams.usermanagement.User; @@ -82,7 +77,6 @@ /** * Default method when no dispatch parameter is specified. */ - @Override protected abstract String unspecified(WikiPageForm wikiForm, HttpServletRequest request) throws Exception; /** @@ -96,7 +90,6 @@ /** * Edit a page and make a new page content entry */ - @RequestMapping("/editPage") public String editPage(@ModelAttribute WikiPageForm wikiForm, HttpServletRequest request) throws Exception { Long currentPageUid = WebUtil.readLongParam(request, WikiConstants.ATTR_CURRENT_WIKI); @@ -154,7 +147,6 @@ /** * Revert to a previous page content in the page history */ - @RequestMapping("/revertPage") public String revertPage(@ModelAttribute WikiPageForm wikiForm, HttpServletRequest request) throws Exception { Long revertPageContentVersion = new Long( WebUtil.readLongParam(request, WikiConstants.ATTR_HISTORY_PAGE_CONTENT_ID)); @@ -194,7 +186,6 @@ /** * Compare two page content history items and return the result */ - @RequestMapping("/comparePage") public String comparePage(HttpServletRequest request) throws Exception { Long revertPageContentVersion = new Long( @@ -222,7 +213,6 @@ /** * View a page content from a wiki page's history */ - @RequestMapping("/viewPage") public String viewPage(HttpServletRequest request) throws Exception { Long revertPageContentVersion = new Long( WebUtil.readLongParam(request, WikiConstants.ATTR_HISTORY_PAGE_CONTENT_ID)); @@ -247,7 +237,6 @@ /** * Change the active page of the wiki form */ - @RequestMapping("/changePage") public String changePage(@ModelAttribute WikiPageForm wikiForm, HttpServletRequest request) throws Exception { Wiki wiki = null; @@ -285,7 +274,6 @@ /** * Add a new wiki page to this wiki instance */ - @RequestMapping("/addPage") public String addPage(@ModelAttribute WikiPageForm wikiForm, HttpServletRequest request) throws Exception { Wiki wiki = null; @@ -344,7 +332,6 @@ /** * Remove a wiki page from the wiki instance */ - @RequestMapping("/removePage") public String removePage(@ModelAttribute WikiPageForm wikiForm, HttpServletRequest request) throws Exception { // The page to be removed Long currentPageUid = WebUtil.readLongParam(request, WikiConstants.ATTR_CURRENT_WIKI); @@ -372,7 +359,6 @@ /** * Restore a page previously marked as removed. */ - @RequestMapping("/restorePage") public String restorePage(@ModelAttribute WikiPageForm wikiForm, HttpServletRequest request) throws Exception { // The page to be restored Long currentPageUid = WebUtil.readLongParam(request, WikiConstants.ATTR_CURRENT_WIKI); @@ -399,8 +385,8 @@ /** * Toggles whether a learner wants to receive notifications for wiki changes */ - @RequestMapping("/toggleLearnerSubsciption") - public String toggleLearnerSubsciption(@ModelAttribute WikiPageForm wikiForm, HttpServletRequest request) throws Exception { + public String toggleLearnerSubsciption(@ModelAttribute WikiPageForm wikiForm, HttpServletRequest request) + throws Exception { Long toolSessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID, true); Long currentPageUid = WebUtil.readLongParam(request, WikiConstants.ATTR_CURRENT_WIKI); @@ -435,7 +421,6 @@ private void notifyWikiChange(Long toolSessionID, String subjectLangKey, String bodyLangKey, WikiUser wikiUser, HttpServletRequest request) throws Exception { - WikiSession wikiSession = wikiService.getSessionBySessionId(toolSessionID); IEventNotificationService notificationService = wikiService.getEventNotificationService(); Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/forms/AuthoringForm.java =================================================================== diff -u -r82c8ee6bc80d47736337c5b07ccc686c5ea3ba32 -rada9f9222f66994c94c2989aea922429377f06ed --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/forms/AuthoringForm.java (.../AuthoringForm.java) (revision 82c8ee6bc80d47736337c5b07ccc686c5ea3ba32) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/forms/AuthoringForm.java (.../AuthoringForm.java) (revision ada9f9222f66994c94c2989aea922429377f06ed) @@ -21,23 +21,17 @@ * **************************************************************** */ - - package org.lamsfoundation.lams.tool.wiki.web.forms; import javax.servlet.http.HttpServletRequest; -import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.web.util.SessionMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; +import org.springframework.web.multipart.MultipartFile; /** * @@ -49,7 +43,7 @@ @Autowired @Qualifier("wikiMessageService") private MessageService messageService; - + // Properties String offlineInstruction; @@ -74,9 +68,9 @@ Integer maximumEdits; - FormFile onlineFile; + MultipartFile onlineFile; - FormFile offlineFile; + MultipartFile offlineFile; String currentTab; @@ -94,6 +88,7 @@ SessionMap sessionMap; + @Override public MultiValueMap validate(HttpServletRequest arg1) { MultiValueMap errorMap = new LinkedMultiValueMap<>(); @@ -134,11 +129,11 @@ this.lockOnFinished = lockOnFinished; } - public FormFile getOfflineFile() { + public MultipartFile getOfflineFile() { return offlineFile; } - public void setOfflineFile(FormFile offlineFile) { + public void setOfflineFile(MultipartFile offlineFile) { this.offlineFile = offlineFile; } @@ -150,11 +145,11 @@ this.offlineInstruction = offlineInstruction; } - public FormFile getOnlineFile() { + public MultipartFile getOnlineFile() { return onlineFile; } - public void setOnlineFile(FormFile onlineFile) { + public void setOnlineFile(MultipartFile onlineFile) { this.onlineFile = onlineFile; } Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/forms/WikiPedagogicalPlannerForm.java =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -rada9f9222f66994c94c2989aea922429377f06ed --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/forms/WikiPedagogicalPlannerForm.java (.../WikiPedagogicalPlannerForm.java) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/forms/WikiPedagogicalPlannerForm.java (.../WikiPedagogicalPlannerForm.java) (revision ada9f9222f66994c94c2989aea922429377f06ed) @@ -20,20 +20,16 @@ * **************************************************************** */ - package org.lamsfoundation.lams.tool.wiki.web.forms; -import org.apache.commons.lang.StringUtils; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; import org.lamsfoundation.lams.tool.wiki.model.Wiki; import org.lamsfoundation.lams.tool.wiki.model.WikiPage; -import org.lamsfoundation.lams.web.planner.PedagogicalPlannerActivityForm; +import org.lamsfoundation.lams.web.planner.PedagogicalPlannerActivitySpringForm; /** * */ -public class WikiPedagogicalPlannerForm extends PedagogicalPlannerActivityForm { +public class WikiPedagogicalPlannerForm extends PedagogicalPlannerActivitySpringForm { String title; String wikiBody; String contentFolderID;