Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java,v diff -u -r1.5 -r1.6 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java 16 Aug 2006 06:19:05 -0000 1.5 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java 31 Aug 2006 00:35:33 -0000 1.6 @@ -54,7 +54,6 @@ import org.lamsfoundation.lams.web.util.AttributeNames; import org.lamsfoundation.lams.web.util.SessionMap; - /** * @author * @version @@ -97,14 +96,18 @@ Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + String contentFolderID = WebUtil.readStrParam(request, + AttributeNames.PARAM_CONTENT_FOLDER_ID); + // set up notebookService if (notebookService == null) { - notebookService = NotebookServiceProxy.getNotebookService(this.getServlet() - .getServletContext()); + notebookService = NotebookServiceProxy.getNotebookService(this + .getServlet().getServletContext()); } // retrieving Notebook with given toolContentID - Notebook notebook = notebookService.getNotebookByContentId(toolContentID); + Notebook notebook = notebookService + .getNotebookByContentId(toolContentID); if (notebook == null) { notebook = notebookService.copyDefaultContent(toolContentID); notebook.setCreateDate(new Date()); @@ -125,23 +128,21 @@ notebook.setDefineLater(true); notebookService.saveOrUpdateNotebook(notebook); - // Set up sessionMap - SessionMap map = new SessionMap(); - initSessionMap(map, request); - updateSessionMap(map, notebook); - // Set up the authForm. AuthoringForm authForm = (AuthoringForm) form; updateAuthForm(authForm, notebook); - // add the sessionMapID to form + // Set up sessionMap + SessionMap map = createSessionMap(notebook, + getAccessMode(request)); 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); - + return mapping.findForward("success"); } @@ -154,7 +155,8 @@ SessionMap map = getSessionMap(request, authForm); // get notebook content. - Notebook notebook = notebookService.getNotebookByContentId(authForm.getToolContentID()); + Notebook notebook = notebookService.getNotebookByContentId(authForm + .getToolContentID()); // update notebook content using form inputs. updateNotebook(notebook, authForm); @@ -171,11 +173,11 @@ .getFileVersionId()); attachments.remove(att); } - + // add unsaved attachments attachments.addAll(getAttList(KEY_UNSAVED_ONLINE_FILES, map)); attachments.addAll(getAttList(KEY_UNSAVED_OFFLINE_FILES, map)); - + // set attachments in case it didn't exist notebook.setNotebookAttachments(attachments); @@ -189,10 +191,10 @@ request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); - + // add the sessionMapID to form authForm.setSessionMapID(map.getSessionID()); - + request.setAttribute(NotebookConstants.ATTR_SESSION_MAP, map); return mapping.findForward("success"); @@ -258,8 +260,8 @@ } // upload file to repository - NotebookAttachment newAtt = notebookService.uploadFileToContent(authForm - .getToolContentID(), file, type); + NotebookAttachment newAtt = notebookService.uploadFileToContent( + authForm.getToolContentID(), file, type); // Add attachment to unsavedFiles // check to see if file with same name exists @@ -380,17 +382,23 @@ /** * Updates SessionMap using Notebook content. * - * @param map * @param notebook + * @param mode */ - private void updateSessionMap(SessionMap map, Notebook notebook) { + private SessionMap createSessionMap(Notebook notebook, + ToolAccessMode mode) { - getAttList(KEY_UNSAVED_OFFLINE_FILES, map).clear(); - getAttList(KEY_UNSAVED_ONLINE_FILES, map).clear(); - getAttList(KEY_DELETED_FILES, map).clear(); - getAttList(KEY_OFFLINE_FILES, map).clear(); - getAttList(KEY_ONLINE_FILES, map).clear(); + SessionMap map = new SessionMap(); + map.put(KEY_MODE, mode); + 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()); + Iterator iter = notebook.getNotebookAttachments().iterator(); while (iter.hasNext()) { NotebookAttachment attachment = (NotebookAttachment) iter.next(); @@ -402,6 +410,8 @@ getAttList(KEY_ONLINE_FILES, map).add(attachment); } } + + return map; } /** @@ -429,12 +439,15 @@ * @param map * @param request */ - private void initSessionMap(SessionMap map, HttpServletRequest 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_UNSAVED_OFFLINE_FILES, + new LinkedList()); map.put(KEY_DELETED_FILES, new LinkedList()); } @@ -445,7 +458,8 @@ * @param map * @return */ - private List getAttList(String key, SessionMap map) { + private List getAttList(String key, + SessionMap map) { List list = (List) map.get(key); return list; } @@ -457,8 +471,9 @@ * @param authForm * @return */ - private SessionMap getSessionMap(HttpServletRequest request, - AuthoringForm authForm) { - return (SessionMap) request.getSession().getAttribute(authForm.getSessionMapID()); + private SessionMap getSessionMap( + HttpServletRequest request, AuthoringForm authForm) { + return (SessionMap) request.getSession().getAttribute( + authForm.getSessionMapID()); } } \ No newline at end of file Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/forms/AuthoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/forms/AuthoringForm.java,v diff -u -r1.2 -r1.3 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/forms/AuthoringForm.java 27 Jul 2006 06:06:46 -0000 1.2 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/forms/AuthoringForm.java 31 Aug 2006 00:35:33 -0000 1.3 @@ -53,6 +53,8 @@ String onlineInstruction; Long toolContentID; + + String contentFolderID; boolean lockOnFinished; @@ -192,4 +194,12 @@ 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/WEB-INF/lams.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/WEB-INF/Attic/lams.tld,v diff -u -r1.2 -r1.3 --- lams_tool_notebook/web/WEB-INF/lams.tld 23 Aug 2006 07:47:08 -0000 1.2 +++ lams_tool_notebook/web/WEB-INF/lams.tld 31 Aug 2006 00:29:53 -0000 1.3 @@ -287,14 +287,10 @@ /WEB-INF/tags/TabBody.tag - HTMLEditor - /WEB-INF/tags/HTMLEditor.tag + FCKEditor + /WEB-INF/tags/FCKEditor.tag - SetEditor - /WEB-INF/tags/SetEditor.tag - - AuthoringButton /WEB-INF/tags/AuthoringButton.tag Index: lams_tool_notebook/web/WEB-INF/fckeditor/tlds/FCKeditor.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/WEB-INF/fckeditor/tlds/Attic/FCKeditor.tld,v diff -u -r1.1 -r1.2 --- lams_tool_notebook/web/WEB-INF/fckeditor/tlds/FCKeditor.tld 20 Jul 2006 01:11:10 -0000 1.1 +++ lams_tool_notebook/web/WEB-INF/fckeditor/tlds/FCKeditor.tld 31 Aug 2006 00:29:52 -0000 1.2 @@ -14,6 +14,7 @@ id true + true basePath Index: lams_tool_notebook/web/WEB-INF/tags/AuthoringButton.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/WEB-INF/tags/AuthoringButton.tag,v diff -u -r1.1 -r1.2 Binary files differ Index: lams_tool_notebook/web/WEB-INF/tags/FCKEditor.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/WEB-INF/tags/Attic/FCKEditor.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_notebook/web/WEB-INF/tags/FCKEditor.tag 31 Aug 2006 00:38:51 -0000 1.1 @@ -0,0 +1,57 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="fck-editor" prefix="fck"%> + +<%@ attribute name="id" required="true" rtexprvalue="true"%> +<%@ attribute name="value" required="true" rtexprvalue="true"%> +<%@ attribute name="toolbarSet" required="false" rtexprvalue="true"%> +<%@ attribute name="contentFolderID" required="true" rtexprvalue="true"%> + + + + + + + + + + + + + + + ${value} + + + + + Index: lams_tool_notebook/web/includes/javascript/authoring.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/includes/javascript/authoring.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_notebook/web/includes/javascript/authoring.js 31 Aug 2006 00:29:52 -0000 1.1 @@ -0,0 +1,28 @@ + +function init() { + + // initialising tabs + initTabSize(3); + + // open the current tab + var tag = document.getElementById("currentTab"); + if (tag.value != "") { + selectTab(tag.value); + } else { + selectTab(1); + } +} +function doSelectTab(tabId) { + var tag = document.getElementById("currentTab"); + tag.value = tabId; + selectTab(tabId); +} +function doSubmit(method) { + document.authoringForm.dispatch.value = method; + document.authoringForm.submit(); +} +function deleteAttachment(dispatch, uuid) { + document.authoringForm.dispatch.value = dispatch; + document.authoringForm.deleteFileUuid.value = uuid; + document.authoringForm.submit(); +} \ No newline at end of file Index: lams_tool_notebook/web/layouts/defaultLayout.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/layouts/defaultLayout.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_notebook/web/layouts/defaultLayout.jsp 20 Jul 2006 01:11:09 -0000 1.1 +++ lams_tool_notebook/web/layouts/defaultLayout.jsp 31 Aug 2006 00:29:52 -0000 1.2 @@ -1,5 +1,5 @@ - + <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_notebook/web/layouts/learningLayout.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/layouts/learningLayout.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_notebook/web/layouts/learningLayout.jsp 20 Jul 2006 01:11:09 -0000 1.1 +++ lams_tool_notebook/web/layouts/learningLayout.jsp 31 Aug 2006 00:29:52 -0000 1.2 @@ -1,5 +1,5 @@ - + <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_notebook/web/layouts/tabLayout.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/layouts/tabLayout.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_notebook/web/layouts/tabLayout.jsp 20 Jul 2006 01:11:09 -0000 1.1 +++ lams_tool_notebook/web/layouts/tabLayout.jsp 31 Aug 2006 00:29:52 -0000 1.2 @@ -1,5 +1,5 @@ - + <%@ include file="/common/taglibs.jsp"%> Index: lams_tool_notebook/web/pages/authoring/advanced.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/authoring/advanced.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_notebook/web/pages/authoring/advanced.jsp 27 Jul 2006 06:06:46 -0000 1.2 +++ lams_tool_notebook/web/pages/authoring/advanced.jsp 31 Aug 2006 00:29:51 -0000 1.3 @@ -1,7 +1,5 @@ <%@ include file="/common/taglibs.jsp"%> - - @@ -17,4 +15,3 @@
- Index: lams_tool_notebook/web/pages/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/authoring/authoring.jsp,v diff -u -r1.2 -r1.3 --- lams_tool_notebook/web/pages/authoring/authoring.jsp 20 Aug 2006 23:31:33 -0000 1.2 +++ lams_tool_notebook/web/pages/authoring/authoring.jsp 31 Aug 2006 00:29:51 -0000 1.3 @@ -39,11 +39,10 @@ + accessMode="${sessionMap.mode}" defineLater="${defineLater}" customiseSessionID="${sessionMap.sessionID}" contentFolderID="abc"/> - Index: lams_tool_notebook/web/pages/authoring/basic.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/authoring/basic.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_notebook/web/pages/authoring/basic.jsp 20 Jul 2006 01:11:10 -0000 1.1 +++ lams_tool_notebook/web/pages/authoring/basic.jsp 31 Aug 2006 00:29:51 -0000 1.2 @@ -1,18 +1,27 @@ <%@ include file="/common/taglibs.jsp"%> - + Index: lams_tool_notebook/web/pages/authoring/headItems.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/authoring/headItems.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_notebook/web/pages/authoring/headItems.jsp 20 Jul 2006 01:11:10 -0000 1.1 +++ lams_tool_notebook/web/pages/authoring/headItems.jsp 31 Aug 2006 00:29:51 -0000 1.2 @@ -1,49 +1,9 @@ <%@ include file="/common/taglibs.jsp"%> - - + + -<%-- Authoring Script --%> - - \ No newline at end of file Index: lams_tool_notebook/web/pages/authoring/instructions.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/authoring/Attic/instructions.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_notebook/web/pages/authoring/instructions.jsp 20 Jul 2006 01:11:10 -0000 1.1 +++ lams_tool_notebook/web/pages/authoring/instructions.jsp 31 Aug 2006 00:29:51 -0000 1.2 @@ -1,73 +1,92 @@ <%@ include file="/common/taglibs.jsp"%> -
- +
+ +
+
- +
+ +
+
- + <%-- Online Instructions --%> - - - - - + <%-- Online Attachments --%> + - + <%-- Online Attachments Upload --%> @@ -77,7 +96,8 @@
- +
@@ -90,70 +110,91 @@
- +
+ +
+
- -
  • - - - - -   +
      + + <%-- Online Saved Files --%> + +
    • + + + + + +   - - - -   + + + + +   - - - -
    • -
      + + + + + - <%-- Displaying unsaved Files --%> - -
    • - - * - - - -   + <%-- Online Unsaved Files --%> + +
    • + + * + + + + +   - - - -   + + + + +   - - - -
    • -
      + + + + + + +
  • -
    +
    - + <%-- Offline Instructions --%> - - + <%-- Offline Attachments --%> + - - + <%--Offline Attachments Upload --%> @@ -163,7 +204,8 @@
    - +
    - +
    + +
    +
    - - -
  • - - - - -   +
      - - - -   + <%-- Offline Saved Attachments --%> + +
    • + + + + + +   - - - -
    • -
      + + + + +   - - -
    • - - * - - - -   + + + +
    • +
      + + <%-- Offline Unsaved Attachments --%> + +
    • + + * + + + + +   - - - -   + + + + +   - - - -
    • -
      + + + + + + +
  • -
    +