Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/AuthoringAction.java =================================================================== diff -u -r021a7a0c1e8d0a0592047fa4b3840872d8bfbc05 -r5e2d4a2d74479d27d024a7f32994f35bad5c68f1 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 021a7a0c1e8d0a0592047fa4b3840872d8bfbc05) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 5e2d4a2d74479d27d024a7f32994f35bad5c68f1) @@ -71,6 +71,10 @@ public IChatService chatService; // Authoring SessionMap key names + private static final String KEY_TOOL_CONTENT_ID = "toolContentID"; + + private static final String KEY_CONTENT_FOLDER_ID = "contentFolderID"; + private static final String KEY_MODE = "mode"; private static final String KEY_ONLINE_FILES = "onlineFiles"; @@ -139,11 +143,9 @@ // Set up sessionMap SessionMap map = createSessionMap(chat, - getAccessMode(request)); + getAccessMode(request), contentFolderID, toolContentID); authForm.setSessionMapID(map.getSessionID()); - authForm.setContentFolderID(contentFolderID); - // add the sessionMap to HTTPSession. request.getSession().setAttribute(map.getSessionID(), map); request.setAttribute(ChatConstants.ATTR_SESSION_MAP, map); @@ -160,7 +162,8 @@ SessionMap map = getSessionMap(request, authForm); // get chat content. - Chat chat = chatService.getChatByContentId(authForm.getToolContentID()); + Chat chat = chatService.getChatByContentId((Long) map + .get(KEY_TOOL_CONTENT_ID)); // update chat content using form inputs. updateChat(chat, authForm); @@ -263,8 +266,8 @@ if (file.getFileName().length() != 0) { // upload file to repository - ChatAttachment newAtt = chatService.uploadFileToContent(authForm - .getToolContentID(), file, type); + ChatAttachment newAtt = chatService.uploadFileToContent((Long) map + .get(KEY_TOOL_CONTENT_ID), file, type); // Add attachment to unsavedFiles // check to see if file with same name exists @@ -377,7 +380,6 @@ * @return */ private void updateAuthForm(AuthoringForm authForm, Chat chat) { - authForm.setToolContentID(chat.getToolContentId()); authForm.setTitle(chat.getTitle()); authForm.setInstructions(chat.getInstructions()); authForm.setOnlineInstruction(chat.getOnlineInstructions()); @@ -396,11 +398,13 @@ * @param mode */ private SessionMap createSessionMap(Chat chat, - ToolAccessMode mode) { + ToolAccessMode mode, String contentFolderID, Long toolContentID) { SessionMap map = new SessionMap(); map.put(KEY_MODE, mode); + map.put(KEY_CONTENT_FOLDER_ID, contentFolderID); + map.put(KEY_TOOL_CONTENT_ID, toolContentID); map.put(KEY_ONLINE_FILES, new LinkedList()); map.put(KEY_OFFLINE_FILES, new LinkedList()); map.put(KEY_UNSAVED_ONLINE_FILES, new LinkedList()); @@ -441,23 +445,6 @@ } /** - * Set up SessionMap for first use. Creates empty lists and sets the access - * mode. - * - * @param map - * @param request - */ - private void initSessionMap(SessionMap map, - HttpServletRequest request) { - map.put(KEY_MODE, getAccessMode(request)); - map.put(KEY_ONLINE_FILES, new LinkedList()); - map.put(KEY_OFFLINE_FILES, new LinkedList()); - map.put(KEY_UNSAVED_ONLINE_FILES, new LinkedList()); - map.put(KEY_UNSAVED_OFFLINE_FILES, new LinkedList()); - map.put(KEY_DELETED_FILES, new LinkedList()); - } - - /** * Retrieves a List of attachments from the map using the key. * * @param key Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/forms/AuthoringForm.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r5e2d4a2d74479d27d024a7f32994f35bad5c68f1 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/forms/AuthoringForm.java (.../AuthoringForm.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/forms/AuthoringForm.java (.../AuthoringForm.java) (revision 5e2d4a2d74479d27d024a7f32994f35bad5c68f1) @@ -52,10 +52,6 @@ String onlineInstruction; - Long toolContentID; - - String contentFolderID; - boolean lockOnFinished; boolean reflectOnActivity; @@ -168,14 +164,6 @@ this.title = title; } - public Long getToolContentID() { - return toolContentID; - } - - public void setToolContentID(Long toolContentID) { - this.toolContentID = toolContentID; - } - public void setSessionMap(SessionMap sessionMap) { this.sessionMap = sessionMap; @@ -224,12 +212,4 @@ public void setReflectInstructions(String reflectInstructions) { this.reflectInstructions = reflectInstructions; } - - public String getContentFolderID() { - return contentFolderID; - } - - public void setContentFolderID(String contentFolderID) { - this.contentFolderID = contentFolderID; - } } Index: lams_tool_chat/web/pages/authoring/authoring.jsp =================================================================== diff -u -r6f21f23b5ae790598b2b954a47b7693aa27e245a -r5e2d4a2d74479d27d024a7f32994f35bad5c68f1 --- lams_tool_chat/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 6f21f23b5ae790598b2b954a47b7693aa27e245a) +++ lams_tool_chat/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 5e2d4a2d74479d27d024a7f32994f35bad5c68f1) @@ -28,8 +28,6 @@
- - @@ -55,10 +53,10 @@ + contentFolderID="${sessionMap.contentFolderID}" />
Index: lams_tool_chat/web/pages/authoring/basic.jsp =================================================================== diff -u -r467d38ce63854f33b9ee6794c67ba250b52fa7ba -r5e2d4a2d74479d27d024a7f32994f35bad5c68f1 --- lams_tool_chat/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 467d38ce63854f33b9ee6794c67ba250b52fa7ba) +++ lams_tool_chat/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 5e2d4a2d74479d27d024a7f32994f35bad5c68f1) @@ -1,29 +1,29 @@ <%@ include file="/common/taglibs.jsp"%> - + + - - - - - - - - + + + + + +
-
- -
- -
-
- -
- -
+
+ +
+ +
+
+ +
+ +
Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java =================================================================== diff -u -r021a7a0c1e8d0a0592047fa4b3840872d8bfbc05 -r5e2d4a2d74479d27d024a7f32994f35bad5c68f1 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 021a7a0c1e8d0a0592047fa4b3840872d8bfbc05) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 5e2d4a2d74479d27d024a7f32994f35bad5c68f1) @@ -71,6 +71,10 @@ public INotebookService notebookService; // Authoring SessionMap key names + private static final String KEY_TOOL_CONTENT_ID = "toolContentID"; + + private static final String KEY_CONTENT_FOLDER_ID = "contentFolderID"; + private static final String KEY_MODE = "mode"; private static final String KEY_ONLINE_FILES = "onlineFiles"; @@ -140,11 +144,9 @@ // Set up sessionMap SessionMap map = createSessionMap(notebook, - getAccessMode(request)); + getAccessMode(request), contentFolderID, toolContentID); authForm.setSessionMapID(map.getSessionID()); - authForm.setContentFolderID(contentFolderID); - // add the sessionMap to HTTPSession. request.getSession().setAttribute(map.getSessionID(), map); request.setAttribute(NotebookConstants.ATTR_SESSION_MAP, map); @@ -161,8 +163,8 @@ SessionMap map = getSessionMap(request, authForm); // get notebook content. - Notebook notebook = notebookService.getNotebookByContentId(authForm - .getToolContentID()); + Notebook notebook = notebookService.getNotebookByContentId((Long) map + .get(KEY_TOOL_CONTENT_ID)); // update notebook content using form inputs. updateNotebook(notebook, authForm); @@ -267,7 +269,7 @@ // upload file to repository NotebookAttachment newAtt = notebookService.uploadFileToContent( - authForm.getToolContentID(), file, type); + (Long) map.get(KEY_TOOL_CONTENT_ID), file, type); // Add attachment to unsavedFiles // check to see if file with same name exists @@ -377,7 +379,6 @@ * @return */ private void updateAuthForm(AuthoringForm authForm, Notebook notebook) { - authForm.setToolContentID(notebook.getToolContentId()); authForm.setTitle(notebook.getTitle()); authForm.setInstructions(notebook.getInstructions()); authForm.setOnlineInstruction(notebook.getOnlineInstructions()); @@ -393,11 +394,13 @@ * @param mode */ private SessionMap createSessionMap(Notebook notebook, - ToolAccessMode mode) { + ToolAccessMode mode, String contentFolderID, Long toolContentID) { SessionMap map = new SessionMap(); map.put(KEY_MODE, mode); + map.put(KEY_CONTENT_FOLDER_ID, contentFolderID); + map.put(KEY_TOOL_CONTENT_ID, toolContentID); map.put(KEY_ONLINE_FILES, new LinkedList()); map.put(KEY_OFFLINE_FILES, new LinkedList()); map.put(KEY_UNSAVED_ONLINE_FILES, new LinkedList()); @@ -440,25 +443,6 @@ } /** - * Set up SessionMap for first use. Creates empty lists and sets the access - * mode. - * - * @param map - * @param request - */ - private void initSessionMap(SessionMap map, - HttpServletRequest request) { - map.put(KEY_MODE, getAccessMode(request)); - map.put(KEY_ONLINE_FILES, new LinkedList()); - map.put(KEY_OFFLINE_FILES, new LinkedList()); - map.put(KEY_UNSAVED_ONLINE_FILES, new LinkedList()); - map - .put(KEY_UNSAVED_OFFLINE_FILES, - new LinkedList()); - map.put(KEY_DELETED_FILES, new LinkedList()); - } - - /** * Retrieves a List of attachments from the map using the key. * * @param key Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/forms/AuthoringForm.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r5e2d4a2d74479d27d024a7f32994f35bad5c68f1 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/forms/AuthoringForm.java (.../AuthoringForm.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/forms/AuthoringForm.java (.../AuthoringForm.java) (revision 5e2d4a2d74479d27d024a7f32994f35bad5c68f1) @@ -52,10 +52,6 @@ String onlineInstruction; - Long toolContentID; - - String contentFolderID; - boolean lockOnFinished; boolean allowRichEditor; @@ -162,17 +158,8 @@ this.title = title; } - public Long getToolContentID() { - return toolContentID; - } - - public void setToolContentID(Long toolContentID) { - this.toolContentID = toolContentID; - } - public void setSessionMap(SessionMap sessionMap) { this.sessionMap = sessionMap; - } public SessionMap getSessionMap() { @@ -194,12 +181,4 @@ public void setAllowRichEditor(boolean allowRichEditor) { this.allowRichEditor = allowRichEditor; } - - public String getContentFolderID() { - return contentFolderID; - } - - public void setContentFolderID(String contentFolderID) { - this.contentFolderID = contentFolderID; - } } Index: lams_tool_notebook/web/pages/authoring/authoring.jsp =================================================================== diff -u -r6f21f23b5ae790598b2b954a47b7693aa27e245a -r5e2d4a2d74479d27d024a7f32994f35bad5c68f1 --- lams_tool_notebook/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 6f21f23b5ae790598b2b954a47b7693aa27e245a) +++ lams_tool_notebook/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 5e2d4a2d74479d27d024a7f32994f35bad5c68f1) @@ -31,8 +31,6 @@
- - @@ -57,9 +55,10 @@ + customiseSessionID="${sessionMap.sessionID}" + contentFolderID="${sessionMap.contentFolderID}" />
Index: lams_tool_notebook/web/pages/authoring/basic.jsp =================================================================== diff -u -r9ad7805407672e72dfc83fb0ba49ccafb0d43d6f -r5e2d4a2d74479d27d024a7f32994f35bad5c68f1 --- lams_tool_notebook/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 9ad7805407672e72dfc83fb0ba49ccafb0d43d6f) +++ lams_tool_notebook/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 5e2d4a2d74479d27d024a7f32994f35bad5c68f1) @@ -1,26 +1,28 @@ <%@ include file="/common/taglibs.jsp"%> - + + - - - - - - + + + + + +
-
- -
- -
-
- -
- -
+
+ +
+ +
+
+ +
+ +