Index: lams_tool_wiki/conf/language/rams/ApplicationResources_en_AU.properties =================================================================== diff -u -r17690c3ef82e9cba26cc0cd656b40d212871ba07 -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/conf/language/rams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 17690c3ef82e9cba26cc0cd656b40d212871ba07) +++ lams_tool_wiki/conf/language/rams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 98272e08314f1487800201921390914652849147) @@ -141,7 +141,7 @@ monitor.summary.td.notebookInstructions =Notebook instructions monitor.nosessions =There are no sessions running yet for this Wiki. monitor.notebooks =Notebook Reflections -output.learner.number.of.edits =Learner's number of Wiki edits -output.learner.number.of.add =Learner's number added Wiki pages +output.learner.number.of.edits =Number of page edits +output.learner.number.of.add =Number of pages added #======= End labels: Exported 81 labels for en AU ===== Index: lams_tool_wiki/db/sql/create_lams_tool_wiki.sql =================================================================== diff -u -r17690c3ef82e9cba26cc0cd656b40d212871ba07 -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/db/sql/create_lams_tool_wiki.sql (.../create_lams_tool_wiki.sql) (revision 17690c3ef82e9cba26cc0cd656b40d212871ba07) +++ lams_tool_wiki/db/sql/create_lams_tool_wiki.sql (.../create_lams_tool_wiki.sql) (revision 98272e08314f1487800201921390914652849147) @@ -11,7 +11,7 @@ create table tl_lawiki10_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, status integer, session_id bigint, session_name varchar(250), wiki_uid bigint, wiki_main_page_uid bigint, primary key (uid)); create table tl_lawiki10_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), login_name varchar(255), first_name varchar(255), finishedActivity bit, wiki_session_uid bigint, entry_uid bigint, wiki_edits integer, primary key (uid)); create table tl_lawiki10_wiki (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), instructions text, run_offline bit, lock_on_finished bit, allow_learner_create_pages bit, allow_learner_insert_links bit, allow_learner_attach_images bit, reflect_on_activity bit, reflect_instructions text, minimum_edits integer, maximum_edits integer, online_instructions text, offline_instructions text, content_in_use bit, define_later bit, tool_content_id bigint, wiki_main_page_uid bigint, primary key (uid)); -create table tl_lawiki10_wiki_page (uid bigint not null auto_increment, wiki_uid bigint, title varchar(255), editable bit, wiki_current_content bigint, editor bigint, wiki_session_uid bigint, primary key (uid)); +create table tl_lawiki10_wiki_page (uid bigint not null auto_increment, wiki_uid bigint, title varchar(255), editable bit, wiki_current_content bigint, added_by bigint, wiki_session_uid bigint, primary key (uid)); create table tl_lawiki10_wiki_page_content (uid bigint not null auto_increment, wiki_page_uid bigint, body text, editor bigint, edit_date datetime, version bigint, primary key (uid)); alter table tl_lawiki10_attachment add index FK9406D87760B3B03B (wiki_uid), add constraint FK9406D87760B3B03B foreign key (wiki_uid) references tl_lawiki10_wiki (uid); alter table tl_lawiki10_session add index FKF01D63C260B3B03B (wiki_uid), add constraint FKF01D63C260B3B03B foreign key (wiki_uid) references tl_lawiki10_wiki (uid); @@ -21,7 +21,7 @@ alter table tl_lawiki10_wiki_page add index FK961AFFEAD8004954 (wiki_session_uid), add constraint FK961AFFEAD8004954 foreign key (wiki_session_uid) references tl_lawiki10_session (uid); alter table tl_lawiki10_wiki_page add index FK961AFFEA60B3B03B (wiki_uid), add constraint FK961AFFEA60B3B03B foreign key (wiki_uid) references tl_lawiki10_wiki (uid); alter table tl_lawiki10_wiki_page add index FK961AFFEAE48332B4 (wiki_current_content), add constraint FK961AFFEAE48332B4 foreign key (wiki_current_content) references tl_lawiki10_wiki_page_content (uid); -alter table tl_lawiki10_wiki_page add index FK961AFFEA3233D952 (editor), add constraint FK961AFFEA3233D952 foreign key (editor) references tl_lawiki10_user (uid); +alter table tl_lawiki10_wiki_page add index FK961AFFEA3233D952 (added_by), add constraint FK961AFFEA3233D952 foreign key (added_by) references tl_lawiki10_user (uid); alter table tl_lawiki10_wiki_page_content add index FK528051242D44CCF8 (wiki_page_uid), add constraint FK528051242D44CCF8 foreign key (wiki_page_uid) references tl_lawiki10_wiki_page (uid); alter table tl_lawiki10_wiki_page_content add index FK528051243233D952 (editor), add constraint FK528051243233D952 foreign key (editor) references tl_lawiki10_user (uid); Fisheye: Tag 98272e08314f1487800201921390914652849147 refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/NotebookEntryDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageDTO.java =================================================================== diff -u -r1082bdcc357c105126a5641cecc68acfa645b66b -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageDTO.java (.../WikiPageDTO.java) (revision 1082bdcc357c105126a5641cecc68acfa645b66b) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageDTO.java (.../WikiPageDTO.java) (revision 98272e08314f1487800201921390914652849147) @@ -6,6 +6,7 @@ private Long uid; private String title; + private String javaScriptTitle; private Boolean editable; private WikiPageContentDTO currentWikiContentDTO; @@ -17,6 +18,7 @@ this.title = wikiPage.getTitle(); this.editable = wikiPage.getEditable(); this.currentWikiContentDTO = new WikiPageContentDTO(wikiPage.getCurrentWikiContent()); + this.javaScriptTitle = this.javaScriptEscape(wikiPage.getTitle()); } public Long getUid() { @@ -46,13 +48,27 @@ public WikiPageContentDTO getCurrentWikiContentDTO() { return currentWikiContentDTO; } + + public String getJavaScriptTitle() { + return javaScriptTitle; + } + public void setJavaScriptTitle(String javaScriptTitle) { + this.javaScriptTitle = javaScriptTitle; + } + public void setCurrentWikiContentDTO(WikiPageContentDTO currentWikiContentDTO) { this.currentWikiContentDTO = currentWikiContentDTO; } public int compareTo(WikiPageDTO wikiPageDTO) { return wikiPageDTO.getUid().compareTo(uid) * -1; } + + public String javaScriptEscape(String string) + { + //return string.replaceAll("\'", "\\\\'").replaceAll("\"","\\\\\""); + return string.replaceAll("\'", "`").replaceAll("\"","\\""); + } } Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/WikiPage.java =================================================================== diff -u -r17690c3ef82e9cba26cc0cd656b40d212871ba07 -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/WikiPage.java (.../WikiPage.java) (revision 17690c3ef82e9cba26cc0cd656b40d212871ba07) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/WikiPage.java (.../WikiPage.java) (revision 98272e08314f1487800201921390914652849147) @@ -110,7 +110,7 @@ /** * @hibernate.many-to-one not-null="true" - * @hibernate.column name="editor" + * @hibernate.column name="added_by" * */ public WikiUser getAddedBy() { Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java =================================================================== diff -u -r23d3a9ebc582896d8379f662e312c6d3b383c226 -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java (.../LearningAction.java) (revision 23d3a9ebc582896d8379f662e312c6d3b383c226) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java (.../LearningAction.java) (revision 98272e08314f1487800201921390914652849147) @@ -140,43 +140,41 @@ } else { wikiUser = getCurrentUser(toolSessionID); } - + 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()); - } + // 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()); + } } 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); + 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(); - //WikiPage mainPage = null; + // WikiPage mainPage = null; for (WikiPage wikiPage : wikiSession.getWikiPages()) { WikiPageDTO pageDTO = new WikiPageDTO(wikiPage); wikiPageDTOs.add(pageDTO); // Set the main page // if (wikiPage.getTitle().equals(wiki.getMainPage().getTitle())) { - // mainPage = wikiPage; - //} + // mainPage = wikiPage; + // } } request.setAttribute(WikiConstants.ATTR_WIKI_PAGES, wikiPageDTOs); request.setAttribute(WikiConstants.ATTR_MAIN_WIKI_PAGE, new WikiPageDTO(wikiSession.getMainPage())); @@ -243,15 +241,14 @@ // TODO fix idType to use real value not 999 /* - if (wikiUser.getEntryUID() == null) { - wikiUser.setEntryUID(wikiService.createNotebookEntry(toolSessionID, - CoreNotebookConstants.NOTEBOOK_TOOL, WikiConstants.TOOL_SIGNATURE, wikiUser.getUserId() - .intValue(), learningForm.getEntryText())); - } else { - // update existing entry. - wikiService.updateEntry(wikiUser.getEntryUID(), learningForm.getEntryText()); - } - */ + * if (wikiUser.getEntryUID() == null) { + * wikiUser.setEntryUID(wikiService.createNotebookEntry(toolSessionID, + * CoreNotebookConstants.NOTEBOOK_TOOL, + * WikiConstants.TOOL_SIGNATURE, wikiUser.getUserId() .intValue(), + * learningForm.getEntryText())); } else { // update existing entry. + * wikiService.updateEntry(wikiUser.getEntryUID(), + * learningForm.getEntryText()); } + */ wikiUser.setFinishedActivity(true); wikiService.saveOrUpdateWikiUser(wikiUser); @@ -276,33 +273,31 @@ return null; // TODO need to return proper page. } - - public ActionForward openNotebook(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) { - - LearningForm lrnForm = (LearningForm) form; - - // set the finished flag - WikiUser wikiUser = this.getCurrentUser(lrnForm.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) { - lrnForm.setEntryText(notebookEntry.getEntry()); - } - - return mapping.findForward("notebook"); + + public ActionForward openNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + LearningForm lrnForm = (LearningForm) form; + + // set the finished flag + WikiUser wikiUser = this.getCurrentUser(lrnForm.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) { + lrnForm.setEntryText(notebookEntry.getEntry()); + } + + return mapping.findForward("notebook"); } - - public ActionForward submitReflection(ActionMapping mapping, - ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + public ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + // save the reflection entry and call the notebook. LearningForm lrnForm = (LearningForm) form; Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/MonitoringAction.java =================================================================== diff -u -r23d3a9ebc582896d8379f662e312c6d3b383c226 -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision 23d3a9ebc582896d8379f662e312c6d3b383c226) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision 98272e08314f1487800201921390914652849147) @@ -141,7 +141,9 @@ for (WikiUserDTO userDTO : sessionDTO.getUserDTOs()) { NotebookEntry notebookEntry = wikiService.getEntry(toolSessionId, CoreNotebookConstants.NOTEBOOK_TOOL, WikiConstants.TOOL_SIGNATURE, userDTO.getUserId().intValue()); - userDTO.setNotebookEntry(notebookEntry.getEntry()); + if (notebookEntry != null) { + userDTO.setNotebookEntry(notebookEntry.getEntry()); + } sessionDTO.getUserDTOs().add(userDTO); } request.setAttribute(WikiConstants.ATTR_SESSION_DTO, sessionDTO); Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/WikiPageAction.java =================================================================== diff -u -r16b67860ab51e6ba2a8f91220dda61d67334e1b0 -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/WikiPageAction.java (.../WikiPageAction.java) (revision 16b67860ab51e6ba2a8f91220dda61d67334e1b0) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/WikiPageAction.java (.../WikiPageAction.java) (revision 98272e08314f1487800201921390914652849147) @@ -277,7 +277,7 @@ WikiSession session = null; WikiPage wikiPage = null; - String newPageName = WebUtil.readStrParam(request, WikiConstants.ATTR_NEW_PAGE_NAME); + String newPageName = WebUtil.readStrParam(request, WikiConstants.ATTR_NEW_PAGE_NAME).replaceAll("`", "'"); Long toolSessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID, true); @@ -295,6 +295,11 @@ // Get the page to change to wikiPage = wikiService.getWikiBySessionAndTitle(session, newPageName); } + + if (wikiPage == null) + { + //TODO: Error handling page does not exist + } // go through unspecified to display the author screen, using wrapper // method to set the current page Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java =================================================================== diff -u -r23d3a9ebc582896d8379f662e312c6d3b383c226 -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 23d3a9ebc582896d8379f662e312c6d3b383c226) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 98272e08314f1487800201921390914652849147) @@ -34,7 +34,6 @@ import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.wiki.dto.WikiDTO; -import org.lamsfoundation.lams.tool.wiki.dto.NotebookEntryDTO; import org.lamsfoundation.lams.tool.wiki.dto.WikiSessionDTO; import org.lamsfoundation.lams.tool.wiki.dto.WikiUserDTO; import org.lamsfoundation.lams.tool.wiki.model.Wiki; Index: lams_tool_wiki/web/pages/authoring/authoring.jsp =================================================================== diff -u -r1082bdcc357c105126a5641cecc68acfa645b66b -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 1082bdcc357c105126a5641cecc68acfa645b66b) +++ lams_tool_wiki/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 98272e08314f1487800201921390914652849147) @@ -34,7 +34,6 @@ - Index: lams_tool_wiki/web/pages/authoring/basic.jsp =================================================================== diff -u -r16b67860ab51e6ba2a8f91220dda61d67334e1b0 -r98272e08314f1487800201921390914652849147 --- lams_tool_wiki/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 16b67860ab51e6ba2a8f91220dda61d67334e1b0) +++ lams_tool_wiki/web/pages/authoring/basic.jsp (.../basic.jsp) (revision 98272e08314f1487800201921390914652849147) @@ -11,9 +11,9 @@
@@ -213,7 +213,7 @@
- + ${wikiPage.title} @@ -228,9 +228,8 @@ function populateWikiLinkArray() { - wikiLinkArray[wikiLinkArray.length] = '${wikiPage.title}'; + wikiLinkArray[wikiLinkArray.length] = '${wikiPage.javaScriptTitle}'; - document.getElementById("wikiLinks").value = wikiLinkArray.toString(); } function doEditOrAdd(dispatch) @@ -255,7 +254,7 @@ for (i=0; i
@@ -320,7 +320,7 @@
- + ${wikiPage.title} @@ -358,7 +358,7 @@ function populateWikiLinkArray() { - wikiLinkArray[wikiLinkArray.length] = '${wikiPage.title}'; + wikiLinkArray[wikiLinkArray.length] = '${wikiPage.javaScriptTitle}'; document.getElementById("wikiLinks").value = wikiLinkArray.toString(); } @@ -397,7 +397,7 @@ for (i=0; i - + ${wikiPage.title} @@ -253,7 +253,7 @@ function populateWikiLinkArray() { - wikiLinkArray[wikiLinkArray.length] = '${wikiPage.title}'; + wikiLinkArray[wikiLinkArray.length] = '${wikiPage.javaScriptTitle}'; document.getElementById("wikiLinks").value = wikiLinkArray.toString(); } @@ -280,7 +280,7 @@ for (i=0; i