Index: lams_tool_wiki/db/sql/create_lams_tool_wiki.sql =================================================================== diff -u -r98272e08314f1487800201921390914652849147 -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/db/sql/create_lams_tool_wiki.sql (.../create_lams_tool_wiki.sql) (revision 98272e08314f1487800201921390914652849147) +++ lams_tool_wiki/db/sql/create_lams_tool_wiki.sql (.../create_lams_tool_wiki.sql) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -8,7 +8,7 @@ drop table if exists tl_lawiki10_wiki_page; drop table if exists tl_lawiki10_wiki_page_content; create table tl_lawiki10_attachment (uid bigint not null auto_increment, file_version_id bigint, file_type varchar(255), file_name varchar(255), file_uuid bigint, create_date datetime, wiki_uid bigint, primary key (uid)); -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_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, content_folder_id varchar(255), 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, added_by bigint, wiki_session_uid bigint, primary key (uid)); @@ -20,8 +20,8 @@ alter table tl_lawiki10_wiki add index FKED5E3E04A3FF7EC0 (wiki_main_page_uid), add constraint FKED5E3E04A3FF7EC0 foreign key (wiki_main_page_uid) references tl_lawiki10_wiki_page (uid); 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 FK961AFFEA36CBA7DB (added_by), add constraint FK961AFFEA36CBA7DB foreign key (added_by) references tl_lawiki10_user (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 (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); Index: lams_tool_wiki/db/sql/table-schema.sql =================================================================== diff -u -r17690c3ef82e9cba26cc0cd656b40d212871ba07 -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/db/sql/table-schema.sql (.../table-schema.sql) (revision 17690c3ef82e9cba26cc0cd656b40d212871ba07) +++ lams_tool_wiki/db/sql/table-schema.sql (.../table-schema.sql) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -5,8 +5,8 @@ alter table tl_lawiki10_wiki drop foreign key FKED5E3E04A3FF7EC0; alter table tl_lawiki10_wiki_page drop foreign key FK961AFFEAD8004954; alter table tl_lawiki10_wiki_page drop foreign key FK961AFFEA60B3B03B; +alter table tl_lawiki10_wiki_page drop foreign key FK961AFFEA36CBA7DB; alter table tl_lawiki10_wiki_page drop foreign key FK961AFFEAE48332B4; -alter table tl_lawiki10_wiki_page drop foreign key FK961AFFEA3233D952; alter table tl_lawiki10_wiki_page_content drop foreign key FK528051242D44CCF8; alter table tl_lawiki10_wiki_page_content drop foreign key FK528051243233D952; drop table if exists tl_lawiki10_attachment; @@ -16,10 +16,10 @@ drop table if exists tl_lawiki10_wiki_page; drop table if exists tl_lawiki10_wiki_page_content; create table tl_lawiki10_attachment (uid bigint not null auto_increment, file_version_id bigint, file_type varchar(255), file_name varchar(255), file_uuid bigint, create_date datetime, wiki_uid bigint, primary key (uid)); -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_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, content_folder_id varchar(255), 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); @@ -28,7 +28,7 @@ alter table tl_lawiki10_wiki add index FKED5E3E04A3FF7EC0 (wiki_main_page_uid), add constraint FKED5E3E04A3FF7EC0 foreign key (wiki_main_page_uid) references tl_lawiki10_wiki_page (uid); 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 FK961AFFEA36CBA7DB (added_by), add constraint FK961AFFEA36CBA7DB foreign key (added_by) references tl_lawiki10_user (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_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); Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiSessionDTO.java =================================================================== diff -u -r23d3a9ebc582896d8379f662e312c6d3b383c226 -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiSessionDTO.java (.../WikiSessionDTO.java) (revision 23d3a9ebc582896d8379f662e312c6d3b383c226) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiSessionDTO.java (.../WikiSessionDTO.java) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -43,12 +43,15 @@ int numberOfLearners; int numberOfFinishedLearners; - + boolean reflectOnActivity; + String contentFolderID; + public WikiSessionDTO(WikiSession session) { this.sessionID = session.getSessionId(); this.sessionName = session.getSessionName(); + this.contentFolderID = session.getContentFolderID(); numberOfFinishedLearners = 0; for (Iterator iterator = session.getWikiUsers().iterator(); iterator.hasNext();) { @@ -61,7 +64,7 @@ } numberOfLearners = userDTOs.size(); - + reflectOnActivity = session.getWiki().isReflectOnActivity(); } @@ -120,10 +123,19 @@ } public boolean isReflectOnActivity() { - return reflectOnActivity; + return reflectOnActivity; } public void setReflectOnActivity(boolean reflectOnActivity) { - this.reflectOnActivity = reflectOnActivity; + this.reflectOnActivity = reflectOnActivity; } + + public String getContentFolderID() { + return contentFolderID; + } + + public void setContentFolderID(String contentFolderID) { + this.contentFolderID = contentFolderID; + } + } Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/WikiSession.java =================================================================== diff -u -r16b67860ab51e6ba2a8f91220dda61d67334e1b0 -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/WikiSession.java (.../WikiSession.java) (revision 16b67860ab51e6ba2a8f91220dda61d67334e1b0) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/WikiSession.java (.../WikiSession.java) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -65,6 +65,8 @@ private Set wikiPages; // Need a runtime copy for each wikiPage private WikiPage mainPage; //Need a runtime reference to the main page + + private String contentFolderID; //Need a runtime content folder to share files // Constructors @@ -74,7 +76,7 @@ /** full constructor */ public WikiSession(Date sessionEndDate, Date sessionStartDate, Integer status, Long sessionId, String sessionName, - Wiki wiki, Set wikiUsers, Set wikiPages) { + Wiki wiki, Set wikiUsers, Set wikiPages, String contentFolderID) { this.sessionEndDate = sessionEndDate; this.sessionStartDate = sessionStartDate; this.status = status; @@ -83,6 +85,7 @@ this.wiki = wiki; this.wikiUsers = wikiUsers; this.wikiPages = wikiPages; + this.contentFolderID = contentFolderID; } // Property accessors @@ -220,7 +223,20 @@ public void setMainPage(WikiPage mainPage) { this.mainPage = mainPage; } + + + /** + * @hibernate.property column="content_folder_id" length="255" + * + */ + public String getContentFolderID() { + return contentFolderID; + } + public void setContentFolderID(String contentFolderID) { + this.contentFolderID = contentFolderID; + } + /** * toString * Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java =================================================================== diff -u -r02454b2f2a995f3aab41c2007c44290979605d8e -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java (.../WikiService.java) (revision 02454b2f2a995f3aab41c2007c44290979605d8e) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java (.../WikiService.java) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -34,7 +34,6 @@ import java.util.List; import java.util.Set; import java.util.SortedMap; -import java.util.TreeMap; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; @@ -86,6 +85,7 @@ import org.lamsfoundation.lams.tool.wiki.util.diff.Difference; import org.lamsfoundation.lams.tool.wiki.web.forms.WikiPageForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.FileUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.util.audit.IAuditService; @@ -148,6 +148,9 @@ // Get the wiki content to start a session Wiki wiki = wikiDAO.getByContentId(toolContentId); session.setWiki(wiki); + + // Generate a unique content folder id for the wiki + session.setContentFolderID(FileUtil.generateUniqueContentFolderID()); // Create an empty list to copy the wiki pages into Set sessionWikiPages = new HashSet(); Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java =================================================================== diff -u -r98272e08314f1487800201921390914652849147 -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java (.../LearningAction.java) (revision 98272e08314f1487800201921390914652849147) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java (.../LearningAction.java) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -55,11 +55,9 @@ 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.AuthoringForm; import org.lamsfoundation.lams.tool.wiki.web.forms.LearningForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.WebUtil; -import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -195,6 +193,9 @@ } request.setAttribute(WikiConstants.ATTR_WIKI_PAGE_CONTENT_HISTORY, currentWikiPageHistoryDTOs); + // Set the content folder id + request.setAttribute(WikiConstants.ATTR_CONTENT_FOLDER_ID, wikiSession.getContentFolderID()); + // set readOnly flag. if (mode.equals(ToolAccessMode.TEACHER) || (wiki.isLockOnFinished() && wikiUser.isFinishedActivity())) { request.setAttribute(WikiConstants.ATTR_CONTENT_EDITAVLE, false); Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/MonitoringAction.java =================================================================== diff -u -r98272e08314f1487800201921390914652849147 -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision 98272e08314f1487800201921390914652849147) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -160,6 +160,10 @@ wikiPageDTOs.add(pageDTO); } + + // Set the content folder id + request.setAttribute(WikiConstants.ATTR_CONTENT_FOLDER_ID, wikiSession.getContentFolderID()); + request.setAttribute(WikiConstants.ATTR_WIKI_PAGES, wikiPageDTOs); request.setAttribute(WikiConstants.ATTR_MAIN_WIKI_PAGE, new WikiPageDTO(wikiSession.getMainPage())); Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java =================================================================== diff -u -rd64a81769de37acdf103017a62cb0e2a46f7a774 -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision d64a81769de37acdf103017a62cb0e2a46f7a774) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -25,24 +25,30 @@ package org.lamsfoundation.lams.tool.wiki.web.servlets; +import java.io.IOException; import java.util.SortedSet; import java.util.TreeSet; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; +import org.lamsfoundation.lams.learning.export.web.action.ImageBundler; 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.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.WikiSessionDTO; 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; @@ -84,6 +90,8 @@ } } catch (WikiException e) { logger.error("Cannot perform export for wiki tool."); + } catch (IOException e) { + logger.error("Cannot perform export for wiki tool."); } // writeResponseToFile(basePath + "/pages/export/exportPortfolio.jsp", @@ -117,7 +125,7 @@ } private void doLearnerExport(HttpServletRequest request, HttpServletResponse response, String directoryName, - String basePath, Cookie[] cookies) throws WikiException { + String basePath, Cookie[] cookies) throws WikiException, IOException { logger.debug("doExportLearner: toolContentID:" + toolSessionID); @@ -143,7 +151,15 @@ // construct wiki pages dto SortedSet wikiPageDTOs = new TreeSet(); for (WikiPage wikiPage : wikiSession.getWikiPages()) { - wikiPageDTOs.add(new WikiPageDTO(wikiPage)); + + WikiPageDTO wikiPageDTO = new WikiPageDTO(wikiPage); + + // Update image links + WikiPageContentDTO contentDTO = wikiPageDTO.getCurrentWikiContentDTO(); + contentDTO.setBody(replaceImageFolderLinks(contentDTO.getBody(), wikiSession.getContentFolderID())); + wikiPageDTO.setCurrentWikiContentDTO(contentDTO); + + wikiPageDTOs.add(wikiPageDTO); } request.getSession().setAttribute(WikiConstants.ATTR_WIKI_PAGES, wikiPageDTOs); @@ -154,6 +170,11 @@ request.getSession() .setAttribute(WikiConstants.ATTR_MAIN_WIKI_PAGE, new WikiPageDTO(wikiSession.getMainPage())); + // bundle all user uploaded content and FCKEditor smileys with the + // package + ImageBundler imageBundler = new ImageBundler(directoryName, wikiSession.getContentFolderID()); + imageBundler.bundleImages(); + // Construct the user dto UserDTO lamsUserDTO = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); WikiUser wikiUser = wikiService.getUserByUserIdAndSessionId(new Long(lamsUserDTO.getUserID()), toolSessionID); @@ -175,7 +196,7 @@ } private void doTeacherExport(HttpServletRequest request, HttpServletResponse response, String directoryName, - String basePath, Cookie[] cookies) throws WikiException { + String basePath, Cookie[] cookies) throws WikiException, IOException { logger.debug("doExportTeacher: toolContentID:" + toolContentID); @@ -202,7 +223,7 @@ for (WikiSession wikiSession : wiki.getWikiSessions()) { // construct wiki session dto WikiSessionDTO sessionDTO = new WikiSessionDTO(wikiSession); - + for (WikiUserDTO wikiUserDTO : sessionDTO.getUserDTOs()) { if (wikiUserDTO.isFinishedActivity()) { // get the notebook entry. @@ -220,7 +241,15 @@ // construct wiki pages dto SortedSet wikiPageDTOs = new TreeSet(); for (WikiPage wikiPage : wikiSession.getWikiPages()) { - wikiPageDTOs.add(new WikiPageDTO(wikiPage)); + + WikiPageDTO wikiPageDTO = new WikiPageDTO(wikiPage); + + // Update image links + WikiPageContentDTO contentDTO = wikiPageDTO.getCurrentWikiContentDTO(); + contentDTO.setBody(replaceImageFolderLinks(contentDTO.getBody(), wikiSession.getContentFolderID())); + wikiPageDTO.setCurrentWikiContentDTO(contentDTO); + + wikiPageDTOs.add(wikiPageDTO); } request.getSession().setAttribute(WikiConstants.ATTR_WIKI_PAGES, wikiPageDTOs); @@ -232,6 +261,11 @@ request.getSession().setAttribute(WikiConstants.ATTR_MAIN_WIKI_PAGE, new WikiPageDTO(wikiSession.getMainPage())); + // bundle all user uploaded content and FCKEditor smileys with the + // package + ImageBundler imageBundler = new ImageBundler(directoryName, wikiSession.getContentFolderID()); + imageBundler.bundleImages(); + writeResponseToFile(basePath + "/pages/export/exportPortfolio.jsp", directoryName, wikiSession .getSessionId() + ".html", cookies); @@ -242,4 +276,28 @@ } } + private String replaceImageFolderLinks(String body, String contentFolderID) { + String fckeditorpath = "/rams//www/secure/" + contentFolderID; + String fckeditorsmiley = "/rams//fckeditor/editor/images/smiley"; + + String newfckeditorpath = "./" + contentFolderID; + String newfckeditorsmiley = "./fckeditor/editor/images/smiley"; + + // The pattern matches control characters + Pattern p = Pattern.compile(fckeditorpath); + Matcher m = p.matcher(""); + + Pattern p2 = Pattern.compile(fckeditorsmiley); + Matcher m2 = p2.matcher(""); + + // Replace the p matching pattern with the newfckeditorpath + m.reset(body); + String result = m.replaceAll(newfckeditorpath); + + m2.reset(result); + result = m2.replaceAll(newfckeditorsmiley); + + return result; + } + } Index: lams_tool_wiki/web/pages/learning/parts/finishButton.jsp =================================================================== diff -u -rb8a1ab746ef08520a4167fa35d3532e8a5c3a73a -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/web/pages/learning/parts/finishButton.jsp (.../finishButton.jsp) (revision b8a1ab746ef08520a4167fa35d3532e8a5c3a73a) +++ lams_tool_wiki/web/pages/learning/parts/finishButton.jsp (.../finishButton.jsp) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -13,8 +13,6 @@ } -Reflect: ${wikiDTO.reflectOnActivity}
-User:${userDTO.finishedActivity}
@@ -45,8 +43,6 @@ -${!userDTO.finishedActivity and wikiDTO.reflectOnActivity} - Index: lams_tool_wiki/web/pages/learning/wiki.jsp =================================================================== diff -u -rb8a1ab746ef08520a4167fa35d3532e8a5c3a73a -ra5bf36d6e7324507406e5dfa59d4d75ef29fff6e --- lams_tool_wiki/web/pages/learning/wiki.jsp (.../wiki.jsp) (revision b8a1ab746ef08520a4167fa35d3532e8a5c3a73a) +++ lams_tool_wiki/web/pages/learning/wiki.jsp (.../wiki.jsp) (revision a5bf36d6e7324507406e5dfa59d4d75ef29fff6e) @@ -261,7 +261,7 @@ @@ -277,7 +277,7 @@ - +