Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -r005c4f0dbcc48d991798597e5c42b6d84ea9efdf -re0b158087e5f4e1e07e373051b8ff1935797b3d3 Binary files differ Index: lams_central/src/flash/org/lamsfoundation/lams/learner/Scratchpad.as =================================================================== diff -u -r886e4fd14c4b6f14a19bae20c1b823f06e603966 -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_central/src/flash/org/lamsfoundation/lams/learner/Scratchpad.as (.../Scratchpad.as) (revision 886e4fd14c4b6f14a19bae20c1b823f06e603966) +++ lams_central/src/flash/org/lamsfoundation/lams/learner/Scratchpad.as (.../Scratchpad.as) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -249,7 +249,7 @@ public function viewNotebookEntries(){ // TODO: Pop-up for Notebook Entries - var notebook_url:String = _root.serverURL + 'learning/notebook.do?method=viewAll'; + var notebook_url:String = _root.serverURL + 'learning/notebook.do?method=viewAll&lessonID=' + _root.lessonID; JsPopup.getInstance().launchPopupWindow(notebook_url, 'Notebook', 570, 796, true, true, false, false, false); Index: lams_central/src/java/org/lamsfoundation/lams/notebook/web/StoreNBEntryServlet.java =================================================================== diff -u -r2579fb9a7e2c8581699bca77eb894f25e06eb249 -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_central/src/java/org/lamsfoundation/lams/notebook/web/StoreNBEntryServlet.java (.../StoreNBEntryServlet.java) (revision 2579fb9a7e2c8581699bca77eb894f25e06eb249) +++ lams_central/src/java/org/lamsfoundation/lams/notebook/web/StoreNBEntryServlet.java (.../StoreNBEntryServlet.java) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -91,9 +91,7 @@ } // set date fields - Date createDate = new Date(); - notebookEntry.setCreateDate(createDate); - notebookEntry.setLastModified(createDate); + notebookEntry.setCreateDate(new Date()); notebookService.saveOrUpdateNotebookEntry(notebookEntry); Index: lams_common/src/java/org/lamsfoundation/lams/commonContext.xml =================================================================== diff -u -r6714bb80a3a4e55ec960a617bc7f7da67c02094d -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision 6714bb80a3a4e55ec960a617bc7f7da67c02094d) +++ lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -206,11 +206,30 @@ - + + + + + + + + + true + + + + PROPAGATION_REQUIRED + PROPAGATION_REQUIRED + PROPAGATION_REQUIRED + PROPAGATION_REQUIRED + + + + Index: lams_learning/conf/language/ApplicationResources.properties =================================================================== diff -u -rf5f5bfd4dc0cf0051debdce823b5e6ab8fa42ad4 -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_learning/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision f5f5bfd4dc0cf0051debdce823b5e6ab8fa42ad4) +++ lams_learning/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -2,7 +2,7 @@ #language code: en #locale code: AU - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Fri Sep 29 02:24:07 GMT 2006 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Fri Sep 08 02:05:32 GMT 2006 #=================== labels for Learner (Java) =================# @@ -18,6 +18,8 @@ exit.message =You can resume this lesson using the Resume button. label.next.button =Next label.finish.button =Finish +label.cancel.button =Cancel +label.edit.button =Edit message.activity.parallel.partialComplete =You have to complete the other task before progressing to the next activity.... message.activity.parallel.noFrames =Your browser does not handle frames! message.activity.options.noActivitySelected =Please select an activity from the list @@ -49,12 +51,24 @@ export.portfolio.generating.message =Portfolio generated. Your browser should be downloading the file now. When the file is saved please close this window. export.portfolio.generation.complete.message =Export Portfolio message.window.closing =Please close this window. -export.portfolio.notebook.title ={0} - Notebook -export.portfolio.notebook.link.label =View Notebook -export.portfolio.notebook.created.label =created: {0} -export.portfolio.notebook.modified.label =last modified: {0} -export.portfolio.notebook.private.label =Private -export.portfolio.notebook.public.label =Teacher viewable +export.portfolio.notebook.title ={0} - Notebook +export.portfolio.notebook.link.label =View Notebook +export.portfolio.notebook.created.label =created: {0} +export.portfolio.notebook.modified.label =last modified: {0} +export.portfolio.notebook.private.label =private +export.portfolio.notebook.public.label =staff viewable +mynotes.title =My Notes +mynotes.view.all.button =View All +mynotes.add.new.button =Add New +mynotes.notebook.save.button =Save to Notebook +mynotes.journal.save.button =Save to Journal +mynotes.signature.JOURNAL.heading =Journal +mynotes.signature.SCRATCHPAD.heading =Scratchpad +mynotes.entry.title.label =Title +mynotes.entry.create.date.label =Created on +mynotes.entry.last.modified.label =Last Modified +mynotes.entry.entry.label =Entry +mynotes.edit.heading =Edit: {0} -#======= End labels: Exported 49 labels for en AU ===== +#======= End labels: Exported 42 labels for en AU ===== Index: lams_learning/conf/xdoclet/struts-actions.xml =================================================================== diff -u -r005c4f0dbcc48d991798597e5c42b6d84ea9efdf -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_learning/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 005c4f0dbcc48d991798597e5c42b6d84ea9efdf) +++ lams_learning/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -13,4 +13,7 @@ parameter=".requestDisplay"/> \ No newline at end of file + parameter=".parallelWait"/> + \ No newline at end of file Index: lams_learning/conf/xdoclet/struts-forms.xml =================================================================== diff -u -r005c4f0dbcc48d991798597e5c42b6d84ea9efdf -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_learning/conf/xdoclet/struts-forms.xml (.../struts-forms.xml) (revision 005c4f0dbcc48d991798597e5c42b6d84ea9efdf) +++ lams_learning/conf/xdoclet/struts-forms.xml (.../struts-forms.xml) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -14,9 +14,10 @@ - + + Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/NotebookAction.java =================================================================== diff -u -r005c4f0dbcc48d991798597e5c42b6d84ea9efdf -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/NotebookAction.java (.../NotebookAction.java) (revision 005c4f0dbcc48d991798597e5c42b6d84ea9efdf) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/NotebookAction.java (.../NotebookAction.java) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -25,6 +25,7 @@ package org.lamsfoundation.lams.learning.web.action; import java.util.List; +import java.lang.Integer; import java.io.IOException; import java.io.PrintWriter; @@ -68,6 +69,7 @@ * validate="false" * * @struts.action-forward name = "viewAll" path = ".notebookViewAll" + * @struts.action-forward name= "viewSingle" path = ".notebookViewSingle" * @struts.action-forward name = "addNew" path = ".notebookAddNew" * @struts.action-forward name = "saveSuccess" path = ".notebookSaveSuccess" * ----------------XDoclet Tags-------------------- @@ -83,6 +85,7 @@ private static IAuditService auditService; private static final String VIEW_ALL = "viewAll"; + private static final String VIEW_SINGLE = "viewSingle"; private static final String ADD_NEW = "addNew"; private static final String SAVE_SUCCESS = "saveSuccess"; @@ -104,30 +107,53 @@ // initialize service object IExtendedCoreNotebookService notebookService = (IExtendedCoreNotebookService) getNotebookService(); + DynaActionForm notebookForm = (DynaActionForm)actionForm; + // getting requested object according to coming parameters Integer learnerID = LearningWebUtil.getUserId(); + + // lessonID + Long lessonID = (Long) notebookForm.get(AttributeNames.PARAM_LESSON_ID); + // get all notebook entries for the learner List entries = notebookService.getEntry(learnerID, CoreNotebookConstants.SCRATCH_PAD); request.getSession().setAttribute("entries", entries); + request.setAttribute("lessonID", lessonID); return mapping.findForward(VIEW_ALL); } /** - * make a struts forward + * View all notebook entries */ - public ActionForward addNew( + public ActionForward viewEntry( ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - return mapping.findForward(ADD_NEW); - + // initialize service object + IExtendedCoreNotebookService notebookService = (IExtendedCoreNotebookService) getNotebookService(); + + DynaActionForm notebookForm = (DynaActionForm)actionForm; + Long uid = (Long) notebookForm.get("uid"); + String mode = WebUtil.readStrParam(request, "mode", true); + + NotebookEntry entry = notebookService.getEntry(uid); + + if(mode != null) + request.setAttribute("mode", mode); + + if(entry != null) + request.setAttribute("entry", entry); + + return mapping.findForward(VIEW_SINGLE); } + + /** * @@ -143,13 +169,62 @@ ICoreNotebookService notebookService = (ICoreNotebookService) getNotebookService(); DynaActionForm notebookForm = (DynaActionForm)actionForm; - + Long id = (Long) notebookForm.get(AttributeNames.PARAM_LESSON_ID); + String title = (String) notebookForm.get("title"); + String entry = (String) notebookForm.get("entry"); + String signature = (String) notebookForm.get("signature"); + Integer userID = LearningWebUtil.getUserId(); - return mapping.findForward(SAVE_SUCCESS); + notebookService.createNotebookEntry(id, CoreNotebookConstants.SCRATCH_PAD, signature, + userID, title, entry); + return viewAll(mapping, actionForm, request, response); + } /** + * + */ + public ActionForward updateEntry( + ActionMapping mapping, + ActionForm actionForm, + HttpServletRequest request, + HttpServletResponse response) + throws IOException, ServletException { + + // initialize service object + ICoreNotebookService notebookService = (ICoreNotebookService) getNotebookService(); + + // get form data + DynaActionForm notebookForm = (DynaActionForm)actionForm; + Long uid = (Long) notebookForm.get("uid"); + Long id = (Long) notebookForm.get(AttributeNames.PARAM_LESSON_ID); + String title = (String) notebookForm.get("title"); + String entry = (String) notebookForm.get("entry"); + String signature = (String) notebookForm.get("signature"); + + + // get existing entry to edit + NotebookEntry entryObj = notebookService.getEntry(uid); + + // check entry is being edited by it's owner + Integer userID = LearningWebUtil.getUserId(); + if(userID != entryObj.getUserID()) { + // throw exception + } + + //update entry + entryObj.setTitle(title); + entryObj.setEntry(entry); + entryObj.setExternalSignature(signature); + + notebookService.updateEntry(entryObj); + + return viewAll(mapping, actionForm, request, response); + + } + + /** * Get AuditService bean. * @return */ Index: lams_learning/web/WEB-INF/struts/struts-config.xml =================================================================== diff -u -r005c4f0dbcc48d991798597e5c42b6d84ea9efdf -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_learning/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 005c4f0dbcc48d991798597e5c42b6d84ea9efdf) +++ lams_learning/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -42,9 +42,10 @@ - + + @@ -139,6 +140,11 @@ redirect="false" /> + + Index: lams_learning/web/WEB-INF/struts/tiles-defs.xml =================================================================== diff -u -r005c4f0dbcc48d991798597e5c42b6d84ea9efdf -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_learning/web/WEB-INF/struts/tiles-defs.xml (.../tiles-defs.xml) (revision 005c4f0dbcc48d991798597e5c42b6d84ea9efdf) +++ lams_learning/web/WEB-INF/struts/tiles-defs.xml (.../tiles-defs.xml) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -102,6 +102,9 @@ + + + Index: lams_learning/web/lams_learner.swf =================================================================== diff -u -r005c4f0dbcc48d991798597e5c42b6d84ea9efdf -re0b158087e5f4e1e07e373051b8ff1935797b3d3 Binary files differ Index: lams_learning/web/notebook/addnew.jsp =================================================================== diff -u -r005c4f0dbcc48d991798597e5c42b6d84ea9efdf -re0b158087e5f4e1e07e373051b8ff1935797b3d3 --- lams_learning/web/notebook/addnew.jsp (.../addnew.jsp) (revision 005c4f0dbcc48d991798597e5c42b6d84ea9efdf) +++ lams_learning/web/notebook/addnew.jsp (.../addnew.jsp) (revision e0b158087e5f4e1e07e373051b8ff1935797b3d3) @@ -33,16 +33,12 @@ -

-
- -
- -
+
- + +

@@ -63,16 +59,21 @@
- -
- - - -
+ + + + +
+
+ + + +
+
-