Index: lams_tool_wiki/db/sql/create_lams_tool_wiki.sql
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_wiki/db/sql/create_lams_tool_wiki.sql,v
diff -u -r1.7 -r1.7.6.1
--- lams_tool_wiki/db/sql/create_lams_tool_wiki.sql 21 Oct 2008 05:35:10 -0000 1.7
+++ lams_tool_wiki/db/sql/create_lams_tool_wiki.sql 17 Apr 2009 05:31:14 -0000 1.7.6.1
@@ -11,8 +11,22 @@
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))TYPE=InnoDB;
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))TYPE=InnoDB;
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, notify_updates 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))TYPE=InnoDB;
-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), unique key (title, wiki_session_uid))TYPE=InnoDB;
+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),
+ unique key (wiki_uid, title, wiki_session_uid)
+)TYPE=InnoDB;
+
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))TYPE=InnoDB;
+
+
+
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);
alter table tl_lawiki10_session add index FKF01D63C2A3FF7EC0 (wiki_main_page_uid), add constraint FKF01D63C2A3FF7EC0 foreign key (wiki_main_page_uid) references tl_lawiki10_wiki_page (uid);
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20090121_updateFrom22.sql
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20090121_updateFrom22.sql,v
diff -u -r1.1 -r1.1.4.1
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20090121_updateFrom22.sql 21 Jan 2009 22:17:04 -0000 1.1
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20090121_updateFrom22.sql 17 Apr 2009 05:31:14 -0000 1.1.4.1
@@ -7,6 +7,31 @@
UPDATE lams_tool SET pedagogical_planner_url='tool/lawiki10/pedagogicalPlanner.do' WHERE tool_signature='lawiki10';
+SET FOREIGN_KEY_CHECKS=0;
+drop table if exists tl_lawiki10_wiki_page_temp;
+create table tl_lawiki10_wiki_page_temp (
+ 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),
+ unique key (wiki_uid, title, wiki_session_uid)
+)TYPE=InnoDB;
+
+INSERT INTO tl_lawiki10_wiki_page_temp SELECT * from tl_lawiki10_wiki_page;
+drop table if exists tl_lawiki10_wiki_page;
+COMMIT;
+rename table tl_lawiki10_wiki_page_temp to tl_lawiki10_wiki_page;
+alter table tl_lawiki10_wiki_page add index FK961AFFEAD111111 (wiki_session_uid), add constraint FK961AFFEAD8004954 foreign key (wiki_session_uid) references tl_lawiki10_session (uid);
+alter table tl_lawiki10_wiki_page add index FK961AFFEA6111111 (wiki_uid), add constraint FK961AFFEA60B3B03B foreign key (wiki_uid) references tl_lawiki10_wiki (uid);
+alter table tl_lawiki10_wiki_page add index FK961AFFEA3111111 (added_by), add constraint FK961AFFEA36CBA7DB foreign key (added_by) references tl_lawiki10_user (uid);
+alter table tl_lawiki10_wiki_page add index FK961AFFEAE111111 (wiki_current_content), add constraint FK961AFFEAE48332B4 foreign key (wiki_current_content) references tl_lawiki10_wiki_page_content (uid);
+
+SET FOREIGN_KEY_CHECKS=1;
+
----------------------Put all sql statements above here-------------------------
-- If there were no errors, commit and restore autocommit to on
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageContentDTO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageContentDTO.java,v
diff -u -r1.1 -r1.1.6.1
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageContentDTO.java 8 Oct 2008 05:33:00 -0000 1.1
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageContentDTO.java 17 Apr 2009 05:31:15 -0000 1.1.6.1
@@ -17,7 +17,7 @@
public WikiPageContentDTO(WikiPageContent pageContent) {
this.uid = pageContent.getUid();
- this.body = pageContent.getBody();
+ this.body = pageContent.getBody().trim();
this.editDate = pageContent.getEditDate();
this.version = pageContent.getVersion();
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageDTO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageDTO.java,v
diff -u -r1.2 -r1.2.6.1
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageDTO.java 13 Oct 2008 03:02:29 -0000 1.2
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiPageDTO.java 17 Apr 2009 05:31:15 -0000 1.2.6.1
@@ -15,7 +15,7 @@
public WikiPageDTO(WikiPage wikiPage) {
this.uid = wikiPage.getUid();
- this.title = wikiPage.getTitle();
+ this.title = wikiPage.getTitle().trim();
this.editable = wikiPage.getEditable();
this.currentWikiContentDTO = new WikiPageContentDTO(wikiPage.getCurrentWikiContent());
this.javaScriptTitle = this.javaScriptEscape(wikiPage.getTitle());
@@ -67,8 +67,10 @@
public String javaScriptEscape(String string)
{
+
+ String replaced = string.replaceAll("\n", "").replaceAll("\'", "`").replaceAll("\"","\\"");;
//return string.replaceAll("\'", "\\\\'").replaceAll("\"","\\\\\"");
- return string.replaceAll("\'", "`").replaceAll("\"","\\"");
+ return replaced;
}
}
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java,v
diff -u -r1.10 -r1.10.4.1
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java 16 Mar 2009 05:56:06 -0000 1.10
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java 17 Apr 2009 05:31:15 -0000 1.10.4.1
@@ -399,6 +399,13 @@
// reset it to new toolContentId
wiki.setToolContentId(toolContentId);
wiki.setCreateBy(new Long(newUserUid.longValue()));
+
+ // Making sure the wiki titles do not have trailing newline characters
+ for (WikiPage wikiPage : wiki.getWikiPages()) {
+ String title = wikiPage.getTitle();
+ title = title.replaceAll("\n", "").replaceAll("\r", "").replaceAll("\t", "");
+ wikiPage.setTitle(title);
+ }
insertUnsavedWikiContent(wiki);
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/WikiPageAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/WikiPageAction.java,v
diff -u -r1.7 -r1.7.4.1
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/WikiPageAction.java 15 Jan 2009 03:32:21 -0000 1.7
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/WikiPageAction.java 17 Apr 2009 05:31:14 -0000 1.7.4.1
@@ -115,7 +115,7 @@
WikiPage currentPage = wikiService.getWikiPageByUid(currentPageUid);
// Check if the content is different
- if (!currentPage.getCurrentWikiContent().getBody().equals(wikiForm.getWikiBody())) {
+ if (!currentPage.getCurrentWikiContent().getBody().equals(wikiForm.getWikiBody()) || !currentPage.getTitle().equals(wikiForm.getTitle())) {
// Set up the wiki user if this is a tool session (learner)
// Also set the editable flag here
Index: lams_tool_wiki/web/login.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_wiki/web/login.jsp,v
diff -u -r1.1 -r1.1.6.1
--- lams_tool_wiki/web/login.jsp 21 Oct 2008 03:20:19 -0000 1.1
+++ lams_tool_wiki/web/login.jsp 17 Apr 2009 05:31:14 -0000 1.1.6.1
@@ -4,14 +4,13 @@
<%@ page import="org.lamsfoundation.lams.security.JspRedirectStrategy" %>
-gyig
+
<%
if(true)
{
return;
}
%>
-fufy