-
+/fckeditor/
+
Index: lams_admin/web/template.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/web/template.jsp,v
diff -u -r1.18 -r1.19
--- lams_admin/web/template.jsp 15 Nov 2006 06:48:49 -0000 1.18
+++ lams_admin/web/template.jsp 9 May 2007 01:02:41 -0000 1.19
@@ -5,7 +5,7 @@
- LAMS ::
+
Index: lams_admin/web/WEB-INF/web.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/web/WEB-INF/Attic/web.xml,v
diff -u -r1.19 -r1.20
--- lams_admin/web/WEB-INF/web.xml 2 Jan 2007 06:03:48 -0000 1.19
+++ lams_admin/web/WEB-INF/web.xml 9 May 2007 01:02:41 -0000 1.20
@@ -104,11 +104,30 @@
1
+
+ Connector
+ com.fredck.FCKeditor.connector.ConnectorServlet
+
+ baseDir
+ /UserFiles/
+
+
+ debug
+ false
+
+ 1
+
+
action*.do
+
+ Connector
+ /fckeditor/editor/filemanager/browser/default/connectors/jsp/connector
+
+
120
Index: lams_admin/web/WEB-INF/struts/struts-config.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/web/WEB-INF/struts/Attic/struts-config.xml,v
diff -u -r1.19 -r1.20
--- lams_admin/web/WEB-INF/struts/struts-config.xml 2 Jan 2007 23:57:01 -0000 1.19
+++ lams_admin/web/WEB-INF/struts/struts-config.xml 9 May 2007 01:02:41 -0000 1.20
@@ -22,6 +22,14 @@
type="org.lamsfoundation.lams.admin.web.CacheActionForm"
/>
+
+
@@ -136,6 +144,10 @@
+
+
+
+
@@ -208,6 +220,26 @@
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+/fckeditor/
-
-
-
-
+<%
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+ /**
+ * Passon
+ * Author: Mitchell Seaton
+ * Description: Passes on progress data to the Flash Learner to update the progress bar.
+ *
+ */
+
+ %>
+<%@ tag body-content="empty" %>
+<%@ attribute name="progress" required="true" rtexprvalue="true" type="java.lang.String" %>
+<%@ attribute name="version" required="false" rtexprvalue="true" %>
+<%@ attribute name="id" required="true" rtexprvalue="true" %>
+<%@ attribute name="redirect" required="false" rtexprvalue="true" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_admin/web/WEB-INF/tags/Tab.tag
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/web/WEB-INF/tags/Tab.tag,v
diff -u -r1.3 -r1.4
--- lams_admin/web/WEB-INF/tags/Tab.tag 28 Sep 2006 23:24:42 -0000 1.3
+++ lams_admin/web/WEB-INF/tags/Tab.tag 9 May 2007 01:02:41 -0000 1.4
@@ -1,99 +1,99 @@
-<%/****************************************************************
- * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
- * =============================================================
- * License Information: http://lamsfoundation.org/licensing/lams/2.0/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2.0
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- *
- * http://www.gnu.org/licenses/gpl.txt
- * ****************************************************************
- */
-
-/**
- * Tab.tag
- * Author: Mitchell Seaton
- * Description: Creates a tab element.
- * Wiki:
- */
-
- %>
-<%@ tag body-content="empty"%>
-<%@ attribute name="id" required="true" rtexprvalue="true"%>
-<%@ attribute name="value" required="false" rtexprvalue="true"%>
-<%@ attribute name="key" required="false" rtexprvalue="true"%>
-<%@ attribute name="inactive" required="false" rtexprvalue="true"%>
-<%@ attribute name="methodCall" required="false" rtexprvalue="true"%>
-
-<%@ taglib uri="tags-core" prefix="c"%>
-<%@ taglib uri="tags-bean" prefix="bean"%>
-<%@ taglib uri="tags-lams" prefix="lams"%>
-
-
-
-
-
-
-
-
-<%// Usually methodCall is selectTab, but the calling code can override methodCall if desired.
- // this is handy if the page needs different logic on initialisation and user switching tabs %>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+<%/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/**
+ * Tab.tag
+ * Author: Mitchell Seaton
+ * Description: Creates a tab element.
+ * Wiki:
+ */
+
+ %>
+<%@ tag body-content="empty"%>
+<%@ attribute name="id" required="true" rtexprvalue="true"%>
+<%@ attribute name="value" required="false" rtexprvalue="true"%>
+<%@ attribute name="key" required="false" rtexprvalue="true"%>
+<%@ attribute name="inactive" required="false" rtexprvalue="true"%>
+<%@ attribute name="methodCall" required="false" rtexprvalue="true"%>
+
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-bean" prefix="bean"%>
+<%@ taglib uri="tags-lams" prefix="lams"%>
+
+
+
+
+
+
+
+
+<%// Usually methodCall is selectTab, but the calling code can override methodCall if desired.
+ // this is handy if the page needs different logic on initialisation and user switching tabs %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_admin/web/WEB-INF/tags/TabBody.tag
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/web/WEB-INF/tags/TabBody.tag,v
diff -u -r1.2 -r1.3
--- lams_admin/web/WEB-INF/tags/TabBody.tag 17 Sep 2006 06:09:51 -0000 1.2
+++ lams_admin/web/WEB-INF/tags/TabBody.tag 9 May 2007 01:02:41 -0000 1.3
@@ -1,52 +1,52 @@
-<%/****************************************************************
- * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
- * =============================================================
- * License Information: http://lamsfoundation.org/licensing/lams/2.0/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2.0
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- *
- * http://www.gnu.org/licenses/gpl.txt
- * ****************************************************************
- */
-
-/**
- * TabBody.tag
- * Author: Mitchell Seaton
- * Description: Creates the body container for a tab element
- * Wiki:
- */
-
- %>
-<%@ tag body-content="scriptless"%>
-<%@ attribute name="id" required="true" rtexprvalue="true"%>
-<%@ attribute name="tabTitle" required="false" rtexprvalue="true"%>
-<%@ attribute name="titleKey" required="false" rtexprvalue="true"%>
-<%@ attribute name="page" required="false" rtexprvalue="true"%>
-<%@ taglib uri="tags-core" prefix="c"%>
-<%@ taglib uri="tags-bean" prefix="bean"%>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+<%/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/**
+ * TabBody.tag
+ * Author: Mitchell Seaton
+ * Description: Creates the body container for a tab element
+ * Wiki:
+ */
+
+ %>
+<%@ tag body-content="scriptless"%>
+<%@ attribute name="id" required="true" rtexprvalue="true"%>
+<%@ attribute name="tabTitle" required="false" rtexprvalue="true"%>
+<%@ attribute name="titleKey" required="false" rtexprvalue="true"%>
+<%@ attribute name="page" required="false" rtexprvalue="true"%>
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-bean" prefix="bean"%>
+
+
+
+<%/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/**
+ * Tabs.tag
+ * Author: Mitchell Seaton
+ * Description: Create a tab list from a input collection or nested Tab tags.
+ * Wiki:
+ */
+
+ %>
+<%@ tag body-content="scriptless"%>
+<%@ attribute name="collection" type="java.util.Collection" required="false" rtexprvalue="true"%>
+<%@ attribute name="control" required="false" rtexprvalue="true"%>
+<%@ attribute name="useKey" required="false" rtexprvalue="true"%>
+<%@ taglib uri="tags-core" prefix="c"%>
+<%@ taglib uri="tags-lams" prefix="lams"%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_central/build.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/build.xml,v
diff -u -r1.39 -r1.40
--- lams_central/build.xml 23 Apr 2007 00:54:34 -0000 1.39
+++ lams_central/build.xml 9 May 2007 01:05:24 -0000 1.40
@@ -112,9 +112,12 @@
-
-
-
+
+
+
+
+
+
@@ -141,7 +144,7 @@
file="${build.lib}/${product}.war/images/css/rams_login.gif" verbose="true"/>
-
+
Index: lams_central/conf/favicon/lams/favicon.ico
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/favicon/lams/favicon.ico,v
diff -u -r1.1 -r1.2
Binary files differ
Index: lams_central/conf/favicon/rams/favicon.ico
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/favicon/rams/Attic/favicon.ico,v
diff -u -r1.1 -r1.2
Binary files differ
Index: lams_central/conf/flashxml/lams/defaultTheme.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/flashxml/lams/defaultTheme.xml,v
diff -u -r1.2 -r1.3
--- lams_central/conf/flashxml/lams/defaultTheme.xml 17 Apr 2007 08:27:41 -0000 1.2
+++ lams_central/conf/flashxml/lams/defaultTheme.xml 9 May 2007 01:06:17 -0000 1.3
@@ -1 +1 @@
-0x33364810Verdana0x669BF20x669BF20x669BF2insetdefaultbutton0x3336489Verdana0xBFFFBF0xBFFFBF0xBFFFBF0x669BF2label0x33364812VerdanaPIlabel0x33364810VerdanaCALabel0x33364811VerdananoneEndGatelabel0x3336487VerdanaLFWindow0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFinsettreeview0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFElasticdatagrid0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFElasticcombo0x33364811Verdana0xBFFFBF0xBFFFBF0xBFFFBFpicombo0x3336489Verdana0xBFFFBF0xBFFFBF0xBFFFBFLFMenuBar0x33364811Verdana0xBFFFBF0xBFFFBF0xBFFFBFBGPaneloutset0xC2D5FEFlowPanelnone0xC2D5FEWZPaneloutset0xDBE6FDMHPanelnone0xDBE6FDTAPaneloutset0xC2D5FE0x000000scrollpane0x669BF2textarea0x333648Verdana10CanvasPanel0xFCFCFCACTPanelNone0xC2D5FEACTPanel0None0xE1E7E7ACTPanel1None0xC2D5FEACTPanel2None0xFFFDBEACTPanel3None0xDDFCB1ACTPanel4None0xFFEEC8ACTPanel5None0xE9E2F5OptActContainerPanelinset0x25a56fOptActPanelnone0xd8ffefparallelHeadPaneloutset0x4684F7OptHeadPaneloutset0x4684F7ACTPanelNegativeNone0x000000smallLabel0x33364810VerdanaredLabel0xFF000012VerdanaboldTAPanelSelected0x1B6BA7TAPanelRollover0xFFFFFFoutsetBGPanelShadow0xAFC8FFCAHighlightBorder0x266DEE
\ No newline at end of file
+0x33364810Verdana0x669BF20x669BF20x669BF2insetdefaultbutton0x3336489Verdana0xBFFFBF0xBFFFBF0xBFFFBF0x669BF2label0x33364812VerdanaPIlabel0x33364810VerdanaCALabel0x33364811VerdananoneEndGatelabel0x3336487VerdanaLFWindow0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFinsettreeview0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFElasticdatagrid0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFElasticcombo0x33364811Verdana0xBFFFBF0xBFFFBF0xBFFFBFpicombo0x3336489Verdana0xBFFFBF0xBFFFBF0xBFFFBFLFMenuBar0x33364811Verdana0xBFFFBF0xBFFFBF0xBFFFBFBGPaneloutset0xC2D5FEFlowPanelnone0xC2D5FEWZPaneloutset0xDBE6FDMHPanelnone0xDBE6FDTAPaneloutset0xC2D5FE0x000000scrollpane0x669BF2textarea0x333648Verdana10CanvasPanel0xFCFCFCACTPanelNone0xC2D5FEACTPanel0None0xE1E7E7ACTPanel1None0xC2D5FEACTPanel2None0xFFFDBEACTPanel3None0xDDFCB1ACTPanel4None0xFFEEC8ACTPanel5None0xE9E2F5OptActContainerPanelinset0x25a56fOptActPanelnone0xd8ffefparallelHeadPaneloutset0x4684F7OptHeadPaneloutset0x4684F7ACTPanelNegativeNone0x000000smallLabel0x33364810VerdanaredLabel0xFF000012VerdanaboldTAPanelSelected0x1B6BA7TAPanelRollover0xFFFFFFoutsetBGPanelShadow0xAFC8FFCAHighlightBorder0x266DEELTVLearnerText0x555555Verdana11bold0xE7EEFEsolid
\ No newline at end of file
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_central/conf/flashxml/lams/preloaderStyle.xml'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/conf/flashxml/rams/defaultTheme.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/flashxml/rams/Attic/defaultTheme.xml,v
diff -u -r1.2 -r1.3
--- lams_central/conf/flashxml/rams/defaultTheme.xml 18 Apr 2007 03:44:38 -0000 1.2
+++ lams_central/conf/flashxml/rams/defaultTheme.xml 9 May 2007 01:06:25 -0000 1.3
@@ -1 +1 @@
-0x33364810Verdana0x669BF20x669BF20x669BF2insetdefaultbutton0x3336489Verdana0xBFFFBF0xBFFFBF0xBFFFBF0x669BF2label0x33364812VerdanaPIlabel0x33364810VerdanaCALabel0x33364811VerdananoneEndGatelabel0x3336487VerdanaLFWindow0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFinsettreeview0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFElasticdatagrid0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFElasticcombo0x33364811Verdana0xBFFFBF0xBFFFBF0xBFFFBFpicombo0x3336489Verdana0xBFFFBF0xBFFFBF0xBFFFBFLFMenuBar0x33364811Verdana0xBFFFBF0xBFFFBF0xBFFFBFBGPaneloutset0xC2D5FEFlowPanelnone0xC2D5FEWZPaneloutset0xDBE6FDMHPanelnone0xDBE6FDTAPaneloutset0xC2D5FE0x000000scrollpane0x669BF2textarea0x333648Verdana10CanvasPanel0xFCFCFCACTPanelNone0xC2D5FEACTPanel0None0xE1E7E7ACTPanel1None0xC2D5FEACTPanel2None0xFFFDBEACTPanel3None0xDDFCB1ACTPanel4None0xFFEEC8ACTPanel5None0xE9E2F5OptActContainerPanelinset0x25a56fOptActPanelnone0xd8ffefparallelHeadPaneloutset0x4684F7OptHeadPaneloutset0x4684F7ACTPanelNegativeNone0x000000smallLabel0x33364810VerdanaredLabel0xFF000012VerdanaboldTAPanelSelected0x1B6BA7TAPanelRollover0xFFFFFFoutsetBGPanelShadow0xAFC8FFCAHighlightBorder0x266DEE
\ No newline at end of file
+0x33364810Verdana0x669BF20x669BF20x669BF2insetdefaultbutton0x3336489Verdana0xBFFFBF0xBFFFBF0xBFFFBF0x669BF2label0x33364812VerdanaPIlabel0x33364810VerdanaCALabel0x33364811VerdananoneEndGatelabel0x3336487VerdanaLFWindow0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFinsettreeview0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFElasticdatagrid0x33364814Verdana0xBFFFBF0xBFFFBF0xBFFFBFElasticcombo0x33364811Verdana0xBFFFBF0xBFFFBF0xBFFFBFpicombo0x3336489Verdana0xBFFFBF0xBFFFBF0xBFFFBFLFMenuBar0x33364811Verdana0xBFFFBF0xBFFFBF0xBFFFBFBGPaneloutset0xC2D5FEFlowPanelnone0xC2D5FEWZPaneloutset0xDBE6FDMHPanelnone0xDBE6FDTAPaneloutset0xC2D5FE0x000000scrollpane0x669BF2textarea0x333648Verdana10CanvasPanel0xFCFCFCACTPanelNone0xC2D5FEACTPanel0None0xE1E7E7ACTPanel1None0xC2D5FEACTPanel2None0xFFFDBEACTPanel3None0xDDFCB1ACTPanel4None0xFFEEC8ACTPanel5None0xE9E2F5OptActContainerPanelinset0x25a56fOptActPanelnone0xd8ffefparallelHeadPaneloutset0x4684F7OptHeadPaneloutset0x4684F7ACTPanelNegativeNone0x000000smallLabel0x33364810VerdanaredLabel0xFF000012VerdanaboldTAPanelSelected0x1B6BA7TAPanelRollover0xFFFFFFoutsetBGPanelShadow0xAFC8FFCAHighlightBorder0x266DEELTVLearnerText0x555555Verdana11bold0xE7EEFEsolid
\ No newline at end of file
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_central/conf/flashxml/rams/preloaderStyle.xml'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/conf/flashxml/rams/ramsTheme.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/flashxml/rams/Attic/ramsTheme.xml,v
diff -u -r1.2 -r1.3
--- lams_central/conf/flashxml/rams/ramsTheme.xml 18 Apr 2007 03:44:38 -0000 1.2
+++ lams_central/conf/flashxml/rams/ramsTheme.xml 9 May 2007 01:06:25 -0000 1.3
@@ -1 +1 @@
-0x33364810Verdana0xFFEBD00xFFEBD00xFFEBD0insetdefaultbutton0x3336489Verdana0xF98C3D0xF98C3D0xF98C3D0xF98C3Dlabel0x33364812VerdanaPIlabel0x33364810VerdanaCALabel0x33364811VerdananoneEndGatelabel0x3336487VerdanaLFWindow0x33364814Verdana0xF98C3D0xF98C3D0xF98C3Dinsettreeview0x33364814Verdana0xF98C3D0xF98C3D0xF98C3DElasticdatagrid0x33364814Verdana0xF98C3D0xF98C3D0xF98C3DElasticcombo0x33364811Verdana0xFFEEC80xFFEEC80xFFEEC8picombo0x3336489Verdana0xFFEEC80xF98C3D0xF98C3DLFMenuBar0x33364811Verdana0xF98C3D0xF98C3D0xF98C3DBGPaneloutset0xE3E3E3FlowPanelnone0xE3E3E3WZPaneloutset0xEFEFEFMHPanelnone0xE3E3E3TAPaneloutset0xE3E3E30x000000scrollpane0xE3E3E3textarea0x333648Verdana10CanvasPanel0xFCFCFCACTPanelNone0xFFEBD0ACTPanel0None0xE1E7E7ACTPanel1None0xC2D5FEACTPanel2None0xFFFDBEACTPanel3None0xDDFCB1ACTPanel4None0xFFEEC8ACTPanel5None0xE9E2F5OptActContainerPanelinset0xFFEBD0OptActPanelnone0xE3E3E3parallelHeadPaneloutset0xE3E3E3OptHeadPaneloutset0xE3E3E3ACTPanelNegativeNone0x000000smallLabel0x33364810VerdanaredLabel0xFF000012VerdanaboldTAPanelSelected0xA3A3A3TAPanelRollover0xFFFFFFoutsetBGPanelShadow0xA3A3A3CAHighlightBorder0x333648
\ No newline at end of file
+0x33364810Verdana0xFFEBD00xFFEBD00xFFEBD0insetdefaultbutton0x3336489Verdana0xF98C3D0xF98C3D0xF98C3D0xF98C3Dlabel0x33364812VerdanaPIlabel0x33364810VerdanaCALabel0x33364811VerdananoneEndGatelabel0x3336487VerdanaLFWindow0x33364814Verdana0xF98C3D0xF98C3D0xF98C3Dinsettreeview0x33364814Verdana0xF98C3D0xF98C3D0xF98C3DElasticdatagrid0x33364814Verdana0xF98C3D0xF98C3D0xF98C3DElasticcombo0x33364811Verdana0xFFEEC80xFFEEC80xFFEEC8picombo0x3336489Verdana0xFFEEC80xF98C3D0xF98C3DLFMenuBar0x33364811Verdana0xF98C3D0xF98C3D0xF98C3DBGPaneloutset0xE3E3E3FlowPanelnone0xE3E3E3WZPaneloutset0xEFEFEFMHPanelnone0xE3E3E3TAPaneloutset0xE3E3E30x000000scrollpane0xE3E3E3textarea0x333648Verdana10CanvasPanel0xFCFCFCACTPanelNone0xFFEBD0ACTPanel0None0xE1E7E7ACTPanel1None0xC2D5FEACTPanel2None0xFFFDBEACTPanel3None0xDDFCB1ACTPanel4None0xFFEEC8ACTPanel5None0xE9E2F5OptActContainerPanelinset0xFFEBD0OptActPanelnone0xE3E3E3parallelHeadPaneloutset0xE3E3E3OptHeadPaneloutset0xE3E3E3ACTPanelNegativeNone0x000000smallLabel0x33364810VerdanaredLabel0xFF000012VerdanaboldTAPanelSelected0xA3A3A3TAPanelRollover0xFFFFFFoutsetBGPanelShadow0xA3A3A3CAHighlightBorder0x333648LTVLearnerText0x555555Verdana11bold0xFDF8F2solid
\ No newline at end of file
Index: lams_central/conf/xdoclet/filter-mappings.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/conf/xdoclet/filter-mappings.xml,v
diff -u -r1.6 -r1.7
--- lams_central/conf/xdoclet/filter-mappings.xml 24 Sep 2006 02:15:33 -0000 1.6
+++ lams_central/conf/xdoclet/filter-mappings.xml 9 May 2007 01:06:41 -0000 1.7
@@ -29,6 +29,11 @@
+ SystemSessionFilter
+ /eof/*
+
+
+ hibernateFilter*.do
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/ObjectExtractor.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/ObjectExtractor.java,v
diff -u -r1.37 -r1.38
--- lams_central/src/java/org/lamsfoundation/lams/authoring/ObjectExtractor.java 8 May 2007 04:40:42 -0000 1.37
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/ObjectExtractor.java 9 May 2007 01:03:36 -0000 1.38
@@ -34,7 +34,7 @@
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.dao.hibernate.BaseDAO;
+import org.lamsfoundation.lams.dao.IBaseDAO;
import org.lamsfoundation.lams.learningdesign.Activity;
import org.lamsfoundation.lams.learningdesign.ChosenGrouping;
import org.lamsfoundation.lams.learningdesign.ComplexActivity;
@@ -52,20 +52,23 @@
import org.lamsfoundation.lams.learningdesign.ScheduleGateActivity;
import org.lamsfoundation.lams.learningdesign.SequenceActivity;
import org.lamsfoundation.lams.learningdesign.SynchGateActivity;
+import org.lamsfoundation.lams.learningdesign.SystemGateActivity;
import org.lamsfoundation.lams.learningdesign.ToolActivity;
import org.lamsfoundation.lams.learningdesign.Transition;
-import org.lamsfoundation.lams.learningdesign.dao.hibernate.ActivityDAO;
-import org.lamsfoundation.lams.learningdesign.dao.hibernate.GroupDAO;
-import org.lamsfoundation.lams.learningdesign.dao.hibernate.GroupingDAO;
-import org.lamsfoundation.lams.learningdesign.dao.hibernate.LearningDesignDAO;
-import org.lamsfoundation.lams.learningdesign.dao.hibernate.LearningLibraryDAO;
-import org.lamsfoundation.lams.learningdesign.dao.hibernate.LicenseDAO;
-import org.lamsfoundation.lams.learningdesign.dao.hibernate.TransitionDAO;
+import org.lamsfoundation.lams.learningdesign.dao.IActivityDAO;
+import org.lamsfoundation.lams.learningdesign.dao.IGroupDAO;
+import org.lamsfoundation.lams.learningdesign.dao.IGroupingDAO;
+import org.lamsfoundation.lams.learningdesign.dao.ILearningDesignDAO;
+import org.lamsfoundation.lams.learningdesign.dao.ILearningLibraryDAO;
+import org.lamsfoundation.lams.learningdesign.dao.ILicenseDAO;
+import org.lamsfoundation.lams.learningdesign.dao.ITransitionDAO;
import org.lamsfoundation.lams.lesson.LessonClass;
import org.lamsfoundation.lams.tool.SystemTool;
import org.lamsfoundation.lams.tool.Tool;
-import org.lamsfoundation.lams.tool.dao.hibernate.SystemToolDAO;
-import org.lamsfoundation.lams.tool.dao.hibernate.ToolDAO;
+import org.lamsfoundation.lams.tool.ToolSession;
+import org.lamsfoundation.lams.tool.dao.ISystemToolDAO;
+import org.lamsfoundation.lams.tool.dao.IToolDAO;
+import org.lamsfoundation.lams.tool.dao.IToolSessionDAO;
import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.WorkspaceFolder;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
@@ -98,29 +101,38 @@
*/
public class ObjectExtractor implements IObjectExtractor {
- protected BaseDAO baseDAO = null;
- protected LearningDesignDAO learningDesignDAO = null;
- protected ActivityDAO activityDAO =null;
- protected TransitionDAO transitionDAO =null;
- protected LearningLibraryDAO learningLibraryDAO = null;
- protected LicenseDAO licenseDAO = null;
- protected GroupingDAO groupingDAO = null;
- protected ToolDAO toolDAO = null;
- protected SystemToolDAO systemToolDAO = null;
- protected GroupDAO groupDAO = null;
+ protected IBaseDAO baseDAO = null;
+ protected ILearningDesignDAO learningDesignDAO = null;
+ protected IActivityDAO activityDAO =null;
+ protected ITransitionDAO transitionDAO =null;
+ protected ILearningLibraryDAO learningLibraryDAO = null;
+ protected ILicenseDAO licenseDAO = null;
+ protected IGroupingDAO groupingDAO = null;
+ protected IToolDAO toolDAO = null;
+ protected ISystemToolDAO systemToolDAO = null;
+ protected IGroupDAO groupDAO = null;
+ protected IToolSessionDAO toolSessionDAO = null;
private Integer mode = null;
- /** The newActivityMap is a local copy of all the current activities. This will include
+ /* The newActivityMap is a local copy of all the current activities. This will include
* the "top level" activities and subactivities. It is used to "crossreference" activities
* as we go, without having to repull them from the database. The keys are the UIIDs
* of the activities, not the IDs. It is important that the values in this map are the Activity
* objects related to the Hibernate session as they are updated by the parseTransitions code.
*/
protected HashMap newActivityMap = new HashMap();
- // cache of groupings - too hard to get them from the db
+ /*
+ * Record the tool sessions and activities as we go for edit on fly. This is needed in case we delete any.
+ * Cannot get them at the end as Hibernate tries to store the activities before getting the
+ * tool sessions, and this fails due to a foriegn key error. Its the foriegn key error
+ * that we are trying to avoid!
+ */
+ protected HashMap> toolSessionMap = new HashMap>(); // Activity UIID -> ToolSession
+ protected HashMap oldActivityMap = new HashMap(); // Activity UIID -> Activity
+ /* cache of groupings - too hard to get them from the db */
protected HashMap groupings = new HashMap();
- // can't delete as we go as they are linked to other items - keep a list and delete at the end.
+ /* can't delete as we go as they are linked to other items - keep a list and delete at the end. */
protected Set groupingsToDelete = new HashSet();
protected LearningDesign learningDesign = null;
@@ -131,11 +143,11 @@
}
/** Constructor to be used if Spring method injection is not used */
- public ObjectExtractor(BaseDAO baseDAO,
- LearningDesignDAO learningDesignDAO, ActivityDAO activityDAO,
- LearningLibraryDAO learningLibraryDAO, LicenseDAO licenseDAO,
- GroupingDAO groupingDAO, ToolDAO toolDAO, SystemToolDAO systemToolDAO,
- GroupDAO groupDAO,TransitionDAO transitionDAO) {
+ public ObjectExtractor(IBaseDAO baseDAO,
+ ILearningDesignDAO learningDesignDAO, IActivityDAO activityDAO,
+ ILearningLibraryDAO learningLibraryDAO, ILicenseDAO licenseDAO,
+ IGroupingDAO groupingDAO, IToolDAO toolDAO, ISystemToolDAO systemToolDAO,
+ IGroupDAO groupDAO, ITransitionDAO transitionDAO, IToolSessionDAO toolSessionDAO) {
this.baseDAO = baseDAO;
this.learningDesignDAO = learningDesignDAO;
this.activityDAO = activityDAO;
@@ -146,57 +158,66 @@
this.systemToolDAO = systemToolDAO;
this.groupDAO = groupDAO;
this.transitionDAO = transitionDAO;
+ this.toolSessionDAO = toolSessionDAO;
}
/** Spring injection methods */
- public ActivityDAO getActivityDAO() {
+ public IActivityDAO getActivityDAO() {
return activityDAO;
}
- public void setActivityDAO(ActivityDAO activityDAO) {
+ public void setActivityDAO(IActivityDAO activityDAO) {
this.activityDAO = activityDAO;
}
- public GroupDAO getGroupDAO() {
+ public IGroupDAO getGroupDAO() {
return groupDAO;
}
- public void setGroupDAO(GroupDAO groupDAO) {
+ public void setGroupDAO(IGroupDAO groupDAO) {
this.groupDAO = groupDAO;
}
- public GroupingDAO getGroupingDAO() {
+ public IGroupingDAO getGroupingDAO() {
return groupingDAO;
}
- public void setGroupingDAO(GroupingDAO groupingDAO) {
+ public void setGroupingDAO(IGroupingDAO groupingDAO) {
this.groupingDAO = groupingDAO;
}
- public LearningDesignDAO getLearningDesignDAO() {
+ public ILearningDesignDAO getLearningDesignDAO() {
return learningDesignDAO;
}
- public void setLearningDesignDAO(LearningDesignDAO learningDesignDAO) {
+ public void setLearningDesignDAO(ILearningDesignDAO learningDesignDAO) {
this.learningDesignDAO = learningDesignDAO;
}
- public LearningLibraryDAO getLearningLibraryDAO() {
+ public ILearningLibraryDAO getLearningLibraryDAO() {
return learningLibraryDAO;
}
- public void setLearningLibraryDAO(LearningLibraryDAO learningLibraryDAO) {
+ public void setLearningLibraryDAO(ILearningLibraryDAO learningLibraryDAO) {
this.learningLibraryDAO = learningLibraryDAO;
}
- public LicenseDAO getLicenseDAO() {
+ public ILicenseDAO getLicenseDAO() {
return licenseDAO;
}
- public void setLicenseDAO(LicenseDAO licenseDAO) {
+ public void setLicenseDAO(ILicenseDAO licenseDAO) {
this.licenseDAO = licenseDAO;
}
+ public IToolSessionDAO getToolSessionDAODAO() {
+ return toolSessionDAO;
+ }
+
+ public void setToolSessionDAO(IToolSessionDAO toolSessionDAO) {
+ this.toolSessionDAO = toolSessionDAO;
+ }
+
public HashMap getNewActivityMap() {
return newActivityMap;
}
@@ -205,36 +226,36 @@
this.newActivityMap = newActivityMap;
}
- public ToolDAO getToolDAO() {
+ public IToolDAO getToolDAO() {
return toolDAO;
}
- public void setToolDAO(ToolDAO toolDAO) {
+ public void setToolDAO(IToolDAO toolDAO) {
this.toolDAO = toolDAO;
}
- public SystemToolDAO getSystemToolDAO() {
+ public ISystemToolDAO getSystemToolDAO() {
return systemToolDAO;
}
- public void setSystemToolDAO(SystemToolDAO systemToolDAO) {
+ public void setSystemToolDAO(ISystemToolDAO systemToolDAO) {
this.systemToolDAO = systemToolDAO;
}
- public TransitionDAO getTransitionDAO() {
+ public ITransitionDAO getTransitionDAO() {
return transitionDAO;
}
- public void setTransitionDAO(TransitionDAO transitionDAO) {
+ public void setTransitionDAO(ITransitionDAO transitionDAO) {
this.transitionDAO = transitionDAO;
}
- public BaseDAO getBaseDAO() {
+ public IBaseDAO getBaseDAO() {
return baseDAO;
}
- public void setBaseDAO(BaseDAO baseDAO) {
+ public void setBaseDAO(IBaseDAO baseDAO) {
this.baseDAO = baseDAO;
}
@@ -255,10 +276,10 @@
copyTypeID = LearningDesign.COPY_TYPE_NONE;
}
if ( learningDesign != null && learningDesign.getCopyTypeID() != null &&
- ! learningDesign.getCopyTypeID().equals(copyTypeID) ) {
+ ! learningDesign.getCopyTypeID().equals(copyTypeID) && !learningDesign.getEditOverrideLock()) {
throw new ObjectExtractorException("Unable to save learning design. Cannot change copy type on existing design.");
}
- if ( ! copyTypeID.equals(LearningDesign.COPY_TYPE_NONE) ) {
+ if ( ! copyTypeID.equals(LearningDesign.COPY_TYPE_NONE) && !learningDesign.getEditOverrideLock()) {
throw new ObjectExtractorException("Unable to save learning design. Learning design is read-only");
}
learningDesign.setCopyTypeID(copyTypeID);
@@ -268,6 +289,9 @@
// here for reference later.
initialiseGroupings();
+ // get a mapping of all the existing activities and their tool sessions, in case we need to delete some tool sessions later.
+ initialiseToolSessionMap(learningDesign);
+
//get the core learning design stuff - default to invalid
learningDesign.setValidDesign(Boolean.FALSE);
if (keyExists(table, WDDXTAGS.LEARNING_DESIGN_UIID))
@@ -282,6 +306,8 @@
learningDesign.setValidDesign(WDDXProcessor.convertToBoolean(table,WDDXTAGS.VALID_DESIGN));
if (keyExists(table, WDDXTAGS.READ_ONLY))
learningDesign.setReadOnly(WDDXProcessor.convertToBoolean(table,WDDXTAGS.READ_ONLY));
+ if (keyExists(table, WDDXTAGS.EDIT_OVERRIDE_LOCK))
+ learningDesign.setEditOverrideLock(WDDXProcessor.convertToBoolean(table, WDDXTAGS.EDIT_OVERRIDE_LOCK));
if (keyExists(table, WDDXTAGS.DATE_READ_ONLY))
learningDesign.setDateReadOnly(WDDXProcessor.convertToDate(table, WDDXTAGS.DATE_READ_ONLY));
if (keyExists(table, WDDXTAGS.OFFLINE_INSTRUCTIONS))
@@ -372,6 +398,7 @@
learningDesign.setFirstActivity(learningDesign.calculateFirstActivity());
learningDesignDAO.insertOrUpdate(learningDesign);
deleteUnwantedGroupings();
+ deleteUnwantedToolSessions(learningDesign);
return learningDesign;
}
@@ -389,12 +416,64 @@
}
}
+ /** Initialise the map of tool sessions already in the database. Used to work out what will be deleted
+ * by Hibernate later - useful to clean up any unwanted tool sessions for edit on the fly.
+ */
+ private void initialiseToolSessionMap(LearningDesign learningDesign) {
+ if (learningDesign.getEditOverrideLock() && learningDesign.getEditOverrideUser() != null) {
+ Iterator iter = learningDesign.getActivities().iterator();
+ while ( iter.hasNext() ) {
+ Activity activity = (Activity) iter.next();
+ oldActivityMap.put(activity.getActivityUIID(), activity);
+ List toolSessions = toolSessionDAO.getToolSessionByActivity(activity);
+ if ( toolSessions != null && toolSessions.size() > 0 )
+ toolSessionMap.put(activity.getActivityUIID(),toolSessions);
+ }
+ }
+ }
+
/** Delete the old unneeded groupings. Won't be done via a cascase */
private void deleteUnwantedGroupings() {
for ( Grouping grouping: groupingsToDelete) {
groupingDAO.delete(grouping);
}
}
+
+ /** Delete the old tool session. Won't be done via Hibernate cascades as we only want to do it
+ * for edit on fly. The progress engine pre-generates the tool sessions for class level activities,
+ * so if we edit the design, we need to delete the tool sessions. If we encounter evidence that this
+ * is a grouped activity - either more than one tool session exists or the activity is grouped, then abort. */
+ private void deleteUnwantedToolSessions(LearningDesign learningDesign) throws ObjectExtractorException {
+ if (learningDesign.getEditOverrideLock() && learningDesign.getEditOverrideUser() != null) {
+
+ for ( Integer uiid : toolSessionMap.keySet() ) {
+ if ( ! newActivityMap.containsKey(uiid) ) {
+ List toolSessions = toolSessionMap.get(uiid);
+ if ( toolSessions != null ) {
+
+ Activity activity = oldActivityMap.get(uiid);
+ if ( toolSessions.size() > 1 ) {
+ throw new ObjectExtractorException("More than one tool session exists for activity "+activity.getTitle()+" ("+uiid+") but this shouldn't be possible. Cannot delete this tool session so editing is not allowed!");
+ } else if (toolSessions.size() == 1) {
+
+ ToolSession toolSession = (ToolSession) toolSessions.get(0);
+ if ( activity.isGroupingActivity() ) {
+ throw new ObjectExtractorException("Activity "+activity.getTitle()+" ("+activity.getActivityUIID()+") has a tool session but it is grouped. Cannot delete this tool session so editing is not allowed!");
+ }
+
+ // all okay, do ahead and delete the tool session
+ if ( log.isDebugEnabled())
+ log.debug("Removing tool session for activity "+activity.getTitle()+" ("+activity.getActivityUIID()+")");
+
+ toolSessionDAO.removeToolSession(toolSession);
+ }
+ }
+ }
+ }
+
+ }
+ }
+
/**
* Parses the groupings array sent from the WDDX packet. It will create
* the groupings object (ChosenGrouping, RandomGrouping) so that when the
@@ -417,7 +496,7 @@
Hashtable groupingDetails = (Hashtable)iterator.next();
if( groupingDetails != null )
{
- Grouping grouping = extractGroupingObject(groupingDetails);
+ Grouping grouping = extractGroupingObject(groupingDetails);
groupingDAO.insertOrUpdate(grouping);
groupings.put(grouping.getGroupingUIID(),grouping);
}
@@ -443,8 +522,7 @@
if ( grouping != null && ! grouping.getGroupingTypeId().equals(groupingTypeID) ) {
groupings.remove(grouping.getGroupingUIID());
groupingsToDelete.add(grouping);
-
- grouping = null;
+ grouping = null;
}
if (grouping == null) {
@@ -506,7 +584,7 @@
// this means we don't have to manually remove the transition object.
// Note: This will leave orphan content in the tool tables. It can be removed by the tool content cleaning job,
// which may be run from the admin screen or via a cron job.
-
+
learningDesign.getActivities().clear();
learningDesign.getActivities().addAll(newActivityMap.values());
@@ -800,6 +878,8 @@
buildSynchGateActivity((SynchGateActivity)activity,activityDetails);
else if (activity instanceof PermissionGateActivity)
buildPermissionGateActivity((PermissionGateActivity)activity,activityDetails);
+ else if (activity instanceof SystemGateActivity)
+ buildSystemGateActivity((SystemGateActivity)activity,activityDetails);
else
buildScheduleGateActivity((ScheduleGateActivity)activity,activityDetails);
GateActivity gateActivity = (GateActivity)activity ;
@@ -815,6 +895,10 @@
SystemTool systemTool = systemToolDAO.getSystemToolByID(SystemTool.PERMISSION_GATE);
activity.setSystemTool(systemTool);
}
+ private void buildSystemGateActivity(SystemGateActivity activity,Hashtable activityDetails) throws WDDXProcessorConversionException{
+ SystemTool systemTool = systemToolDAO.getSystemToolByID(SystemTool.SYSTEM_GATE);
+ activity.setSystemTool(systemTool);
+ }
private void buildScheduleGateActivity(ScheduleGateActivity activity,Hashtable activityDetails) throws WDDXProcessorConversionException{
//activity.setGateStartDateTime(WDDXProcessor.convertToDate(activityDetails,WDDXTAGS.GATE_START_DATE));
//activity.setGateEndDateTime(WDDXProcessor.convertToDate(activityDetails,WDDXTAGS.GATE_END_DATE));
@@ -1020,4 +1104,4 @@
return learner != null ? learner.getUserID() : null;
}
}
-
\ No newline at end of file
+
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml,v
diff -u -r1.13 -r1.14
--- lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml 27 Oct 2006 00:56:19 -0000 1.13
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml 9 May 2007 01:03:37 -0000 1.14
@@ -32,6 +32,7 @@
+
@@ -41,13 +42,16 @@
+
+
+
@@ -66,6 +70,9 @@
PROPAGATION_REQUIREDPROPAGATION_REQUIREDPROPAGATION_REQUIRED
+ PROPAGATION_REQUIRED
+ PROPAGATION_REQUIRED
+ PROPAGATION_REQUIRED
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java,v
diff -u -r1.41 -r1.42
--- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 12 Jan 2007 05:03:04 -0000 1.41
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 9 May 2007 01:03:36 -0000 1.42
@@ -35,6 +35,7 @@
import java.util.Set;
import java.util.TreeSet;
import java.util.Vector;
+import java.util.Date;
import org.apache.log4j.Logger;
import org.hibernate.Hibernate;
@@ -45,10 +46,12 @@
import org.lamsfoundation.lams.dao.hibernate.BaseDAO;
import org.lamsfoundation.lams.learningdesign.Activity;
import org.lamsfoundation.lams.learningdesign.ActivityOrderComparator;
+import org.lamsfoundation.lams.learningdesign.GateActivity;
import org.lamsfoundation.lams.learningdesign.Grouping;
import org.lamsfoundation.lams.learningdesign.GroupingActivity;
import org.lamsfoundation.lams.learningdesign.LearningDesign;
import org.lamsfoundation.lams.learningdesign.License;
+import org.lamsfoundation.lams.learningdesign.ScheduleGateActivity;
import org.lamsfoundation.lams.learningdesign.ToolActivity;
import org.lamsfoundation.lams.learningdesign.Transition;
import org.lamsfoundation.lams.learningdesign.dao.hibernate.ActivityDAO;
@@ -64,8 +67,14 @@
import org.lamsfoundation.lams.learningdesign.dto.ValidationErrorDTO;
import org.lamsfoundation.lams.learningdesign.exception.LearningDesignException;
import org.lamsfoundation.lams.learningdesign.service.ILearningDesignService;
+import org.lamsfoundation.lams.lesson.Lesson;
+import org.lamsfoundation.lams.lesson.service.ILessonService;
+import org.lamsfoundation.lams.monitoring.service.IMonitoringService;
+import org.lamsfoundation.lams.monitoring.service.MonitoringServiceException;
+import org.lamsfoundation.lams.tool.SystemTool;
import org.lamsfoundation.lams.tool.Tool;
import org.lamsfoundation.lams.tool.ToolContentIDGenerator;
+import org.lamsfoundation.lams.tool.dao.hibernate.SystemToolDAO;
import org.lamsfoundation.lams.tool.dao.hibernate.ToolDAO;
import org.lamsfoundation.lams.tool.exception.DataMissingException;
import org.lamsfoundation.lams.tool.exception.ToolException;
@@ -83,7 +92,6 @@
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
-
/**
* @author Manpreet Minhas
*/
@@ -101,9 +109,12 @@
protected LicenseDAO licenseDAO;
protected GroupingDAO groupingDAO;
protected GroupDAO groupDAO;
+ protected SystemToolDAO systemToolDAO;
protected ILamsCoreToolService lamsCoreToolService;
protected ILearningDesignService learningDesignService;
protected MessageService messageService;
+ protected ILessonService lessonService;
+ protected IMonitoringService monitoringService;
protected ToolContentIDGenerator contentIDGenerator;
@@ -171,6 +182,12 @@
this.toolDAO = toolDAO;
}
/**
+ * @param toolDAO The toolDAO to set
+ */
+ public void setSystemToolDAO(SystemToolDAO systemToolDAO) {
+ this.systemToolDAO = systemToolDAO;
+ }
+ /**
* @param licenseDAO The licenseDAO to set
*/
public void setLicenseDAO(LicenseDAO licenseDAO) {
@@ -196,6 +213,23 @@
this.learningDesignService = learningDesignService;
}
+ public MessageService getMessageService() {
+ return messageService;
+ }
+
+ public ILessonService getLessonService() {
+ return lessonService;
+ }
+
+ public void setLessonService(ILessonService lessonService) {
+ this.lessonService = lessonService;
+ }
+
+ public void setMonitoringService(IMonitoringService monitoringService) {
+ this.monitoringService = monitoringService;
+ }
+
+
/**
* @param contentIDGenerator The contentIDGenerator to set.
*/
@@ -248,14 +282,385 @@
*/
public String getLearningDesignDetails(Long learningDesignID)throws IOException{
FlashMessage flashMessage= null;
+
LearningDesignDTO learningDesignDTO = learningDesignService.getLearningDesignDTO(learningDesignID);
+
if(learningDesignDTO==null)
flashMessage = FlashMessage.getNoSuchLearningDesignExists("getLearningDesignDetails",learningDesignID);
else{
flashMessage = new FlashMessage("getLearningDesignDetails",learningDesignDTO);
}
return flashMessage.serializeMessage();
- }
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#isLearningDesignAvailable(LearningDesign, java.lang.Integer)
+ */
+ public boolean isLearningDesignAvailable(LearningDesign design, Integer userID) throws LearningDesignException, IOException {
+ if(design == null)
+ throw new LearningDesignException(FlashMessage.getNoSuchLearningDesignExists("getLearningDesignDetails",design.getLearningDesignId()).serializeMessage());
+
+ if(design.getEditOverrideUser() != null && design.getEditOverrideLock() != null)
+ return (design.getEditOverrideUser().getUserId().equals(userID)) ? true : !design.getEditOverrideLock();
+ else
+ return true;
+ }
+
+ private void setLessonLock(LearningDesign design, boolean lock) {
+ Lesson lesson = null;
+
+ // lock active lesson
+ Set lessons = design.getLessons();
+ Iterator it = lessons.iterator();
+
+ while(it.hasNext()) {
+ lesson = (Lesson) it.next();
+ lesson.setLockedForEdit(lock);
+ }
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#setupEditOnFlyLock(LearningDesign, java.lang.Integer)
+ */
+ public boolean setupEditOnFlyLock(Long learningDesignID, Integer userID) throws LearningDesignException, UserException, IOException {
+ User user = (User)baseDAO.find(User.class,userID);
+
+ LearningDesign design = learningDesignID!=null ? getLearningDesign(learningDesignID) : null;
+
+ if(isLearningDesignAvailable(design, userID)) {
+
+ if(design.getLessons().isEmpty())
+ throw new LearningDesignException("There are no lessons attached to the design."); // TODO: add error msg
+ else if(user==null)
+ throw new UserException(messageService.getMessage("no.such.user.exist",new Object[]{userID}));
+
+ setLessonLock(design, true);
+
+ // lock Learning Design
+ design.setEditOverrideLock(true);
+ design.setEditOverrideUser(user);
+
+ learningDesignDAO.update(design);
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#setupEditOnFlyGate(java.lang.Long, java.lang.Integer)
+ */
+ public String setupEditOnFlyGate(Long learningDesignID, Integer userID) throws UserException, IOException {
+ User user = (User)baseDAO.find(User.class,userID);
+ LearningDesign design = learningDesignID!=null ? getLearningDesign(learningDesignID) : null;
+
+ if(user==null)
+ throw new UserException(messageService.getMessage("no.such.user.exist",new Object[]{userID}));
+
+ EditOnFlyProcessor processor = new EditOnFlyProcessor(design, activityDAO); /* parse Learning Design to find last read-only Activity */
+ processor.parseLearningDesign();
+
+ ArrayList activities = processor.getLastReadOnlyActivity();
+ addSystemGateAfterActivity(activities, design); /* add new System Gate after last read-only Activity */
+
+ setLessonLock(design, false);
+
+ learningDesignDAO.update(design);
+
+ return new FlashMessage("setupEditOnFlyGate", true).serializeMessage();
+ }
+
+
+ /**
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#finishEditOnFly(java.lang.Long, java.lang.Integer)
+ */
+ public String finishEditOnFly(Long learningDesignID, Integer userID) throws IOException {
+ FlashMessage flashMessage= null;
+ Lesson lesson = null;
+
+ LearningDesign design = learningDesignID!=null ? learningDesignDAO.getLearningDesignById(learningDesignID) : null;
+
+ User user = (User)baseDAO.find(User.class,userID);
+ if(user==null)
+ flashMessage = FlashMessage.getNoSuchUserExists("finishEditOnFly", userID);
+
+ if(design != null) { /* only the user who is editing the design may unlock it */
+ if(design.getEditOverrideUser().equals(user)) {
+ design.setEditOverrideLock(false);
+ design.setEditOverrideUser(null);
+
+ Set lessons = design.getLessons(); /* unlock lesson */
+
+ Iterator it = lessons.iterator();
+ while(it.hasNext()) {
+ lesson = (Lesson) it.next();
+ lesson.setLockedForEdit(false);
+ }
+
+ EditOnFlyProcessor processor = new EditOnFlyProcessor(design, activityDAO); /* parse Learning Design to find last read-only Activity (hopefully the system gate in this case) */
+ processor.parseLearningDesign();
+
+ ArrayList activities = processor.getLastReadOnlyActivity();
+
+ GateActivity gate = null; /* open and release waiting list on system gate */
+
+ if(activities != null)
+ if(!activities.isEmpty() && activities.get(0).isGateActivity())
+ gate = (GateActivity) activities.get(0);
+
+ if(gate != null)
+ design = removeTempSystemGate(gate, design); /* remove inputted system gate */
+
+ lessonService.performMarkLessonUncompleted(lesson.getLessonId()); /* the lesson may now have additional activities on the end, so clear any completed flags */
+
+ initialiseToolActivityForRuntime(design, lesson);
+ learningDesignDAO.insertOrUpdate(design);
+
+ flashMessage = new FlashMessage("finishEditOnFly", lesson.getLessonId());
+
+ } else {
+ flashMessage = FlashMessage.getNoSuchUserExists("finishEditOnFly", userID);
+ }
+ } else {
+
+ flashMessage = FlashMessage.getNoSuchLearningDesignExists("finishEditOnFly", learningDesignID);
+ }
+
+ return flashMessage.serializeMessage();
+
+ }
+
+ /**
+ * Remove a temp. System Gate from the design. Requires removing the gate from any learner progress entries - should only
+ * be a current activity but remove it from previous and next, just in case.
+ *
+ * This will leave a "hole" in the learner progress, but the progress engine can take care of that.
+ * @param gate
+ * @param design
+ * @return Learning Design with removed System Gate
+ */
+ public LearningDesign removeTempSystemGate(GateActivity gate, LearningDesign design) {
+ Transition toTransition = gate.getTransitionTo(); /* get transitions */
+ Transition fromTransition = gate.getTransitionFrom();
+
+ if(toTransition != null && fromTransition != null) { /* rearrange to-transition and/or delete redundant transition */
+ toTransition.setToActivity(fromTransition.getToActivity());
+ toTransition.setToUIID(toTransition.getToActivity().getActivityUIID());
+
+ design.getTransitions().remove(fromTransition);
+ transitionDAO.update(toTransition);
+
+ } else if(toTransition != null && fromTransition == null) {
+ design.getTransitions().remove(toTransition);
+ } else if(toTransition == null && fromTransition != null) {
+ design.setFirstActivity(fromTransition.getToActivity());
+ design.getTransitions().remove(fromTransition);
+ }
+
+ design.getActivities().remove(gate); /* remove temp system gate */
+
+ design.setDesignVersion(design.getDesignVersion() + 1); /* increment design version field */
+
+ lessonService.removeProgressReferencesToActivity(gate); /* need to remove it from any learner progress entries */
+
+ return design;
+ }
+
+ /**
+ * Add a temp. System Gate. to the design.
+ *
+ * @param activities
+ * @param design
+ */
+ public void addSystemGateAfterActivity(ArrayList activities, LearningDesign design) {
+ GateActivity gate = null;
+
+ Integer syncType = new Integer(Activity.SYSTEM_GATE_ACTIVITY_TYPE);
+ Integer activityType = new Integer(Activity.SYSTEM_GATE_ACTIVITY_TYPE);
+ Integer maxId = design.getMaxID();
+ String title = "System Gate"; /* messageService.getMessage(MSG_KEY_SYNC_GATE); */
+
+ SystemTool systemTool = systemToolDAO.getSystemToolByID(SystemTool.SYSTEM_GATE);
+ Activity activity = (activities.isEmpty()) ? null : (Activity) activities.get(0);
+
+ try { /* create new System Gate Activity */
+ gate = (GateActivity) Activity.getActivityInstance(syncType.intValue());
+ gate.setActivityTypeId(activityType.intValue());
+ gate.setActivityCategoryID(Activity.CATEGORY_SYSTEM);
+ gate.setSystemTool(systemTool);
+ gate.setActivityUIID(++maxId);
+ gate.setTitle(title!=null?title:"Gate");
+ gate.setGateOpen(false);
+ gate.setWaitingLearners(null);
+ gate.setGateActivityLevelId(GateActivity.LEARNER_GATE_LEVEL);
+ gate.setApplyGrouping(false); // not nullable so default to false
+ gate.setGroupingSupportType(Activity.GROUPING_SUPPORT_OPTIONAL);
+ gate.setOrderId(null);
+ gate.setDefineLater(Boolean.FALSE);
+ gate.setCreateDateTime(new Date());
+ gate.setRunOffline(Boolean.FALSE);
+ gate.setReadOnly(Boolean.TRUE);
+ gate.setLearningDesign(design);
+
+ design.getActivities().add(gate);
+ baseDAO.insert(gate);
+
+ Transition fromTransition;
+ Transition newTransition = new Transition();
+ Activity toActivity = null;
+
+ if(activity != null) {
+ fromTransition = activity.getTransitionFrom(); /* update transitions */
+
+ if(fromTransition != null) {
+ toActivity = fromTransition.getToActivity();
+
+ fromTransition.setToActivity(gate);
+ fromTransition.setToUIID(gate.getActivityUIID());
+
+ newTransition.setTransitionUIID(++maxId);
+ newTransition.setFromActivity(gate);
+ newTransition.setFromUIID(gate.getActivityUIID());
+ newTransition.setToActivity(toActivity);
+ newTransition.setToUIID(toActivity.getActivityUIID());
+ newTransition.setLearningDesign(design);
+
+ gate.setTransitionFrom(newTransition);
+
+ toActivity.setTransitionTo(newTransition);
+
+ Integer x1 = (activity.getXcoord() != null) ? activity.getXcoord() : 0; /* set x/y position for Gate */
+ Integer x2 = (toActivity.getXcoord() != null) ? toActivity.getXcoord() : 0;
+
+ gate.setXcoord(new Integer(((x1.intValue() + 123 + x2.intValue()) / 2) - 13));
+
+ Integer y1 = (activity.getYcoord() != null) ? activity.getYcoord() : 0;
+ Integer y2 = (toActivity.getYcoord() != null) ? toActivity.getYcoord() : 0;
+
+ gate.setYcoord(new Integer((y1.intValue() + 50 + y2.intValue()) / 2));
+
+ } else {
+ //fromTransition = newTransition;
+
+ newTransition.setTransitionUIID(++maxId);
+ newTransition.setFromActivity(activity);
+ newTransition.setFromUIID(activity.getActivityUIID());
+ newTransition.setToActivity(gate);
+ newTransition.setToUIID(gate.getActivityUIID());
+ newTransition.setLearningDesign(design);
+
+ activity.setTransitionFrom(fromTransition);
+ gate.setTransitionTo(fromTransition);
+
+ Integer x1 = (activity.getTransitionTo() != null) ? activity.getTransitionTo().getFromActivity().getXcoord() : 0; /* set x/y position for Gate */
+ Integer x2 = (activity.getXcoord() != null) ? activity.getXcoord() : 0;
+
+ if(x1 != null && x2 != null) gate.setXcoord(x2>=x1 ? new Integer(x2.intValue()+123+13+20) : new Integer(x2.intValue()-13-20));
+ else gate.setXcoord(new Integer(x2.intValue()+123+13+20));
+
+ gate.setYcoord(activity.getYcoord() + 25);
+ }
+
+ } else {
+ fromTransition = newTransition; /* no read-only activities insert gate at start of sequence */
+ toActivity = design.getFirstActivity();
+
+ newTransition.setTransitionUIID(++maxId);
+ newTransition.setToActivity(toActivity);
+ newTransition.setToUIID(toActivity.getActivityUIID());
+ newTransition.setFromActivity(gate);
+ newTransition.setFromUIID(gate.getActivityUIID());
+ newTransition.setLearningDesign(design);
+
+ gate.setTransitionFrom(fromTransition);
+ toActivity.setTransitionTo(fromTransition);
+
+ gate.setGateOpen(false); /* keep gate door closed to stop learner's from going past this point */
+
+ design.setFirstActivity(gate); /* set gate as first activity in sequence */
+
+ Integer x1 = (toActivity.getXcoord() != null) ? toActivity.getXcoord() : 0; /* set x/y position for Gate */
+ Integer x2 = (toActivity.getTransitionFrom() != null) ? toActivity.getTransitionFrom().getToActivity().getXcoord() : null;
+
+ if(x1 != null && x2 != null) gate.setXcoord(x2>=x1 ? new Integer(x1.intValue()-13-20) : new Integer(x1.intValue()+123+13+20));
+ else gate.setXcoord(new Integer(x1.intValue()-13-20));
+
+ gate.setYcoord(toActivity.getYcoord() + 25);
+ }
+
+ design.getTransitions().add(newTransition);
+ design.setMaxID(maxId);
+
+ design.setDesignVersion(design.getDesignVersion() + 1); /* increment design version field */
+
+ if(gate != null) activityDAO.update(gate);
+ if(activity != null) activityDAO.update(activity);
+ if(toActivity != null) activityDAO.update(toActivity);
+
+ if(fromTransition != null && !fromTransition.equals(newTransition)) baseDAO.update(fromTransition);
+ if(newTransition != null) baseDAO.insert(newTransition);
+ if(design != null) learningDesignDAO.insertOrUpdate(design);
+
+ } catch(NullPointerException npe) {
+ log.error(npe.getMessage(), npe);
+ }
+
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getFirstUnattemptedActivity(org.lamsfoundation.lams.learningdesign.LearningDesign)
+ */
+ public Activity getFirstUnattemptedActivity(LearningDesign design) throws LearningDesignException {
+ Activity activity = design.getFirstActivity();
+
+ while(activity.getReadOnly() && activity.getTransitionFrom() != null) {
+ activity = activity.getTransitionFrom().getToActivity();
+ }
+
+ return activity;
+ }
+
+ private void initialiseToolActivityForRuntime(LearningDesign design, Lesson lesson) throws MonitoringServiceException {
+ Date now = new Date();
+
+ Set activities = design.getActivities();
+ for (Iterator i = activities.iterator(); i.hasNext();) {
+ Activity activity = (Activity) i.next();
+
+ if ( activity.isInitialised() ) {
+ if ( ! activity.isActivityReadOnly() && activity.isToolActivity() ) {
+ // Activity is initialised so it was set up previously. So its tool content will be okay
+ // but the run offline flags and define later flags might have been changed, so they need to be updated
+ // Content ID shouldn't change, but we update it in case it does change while we update the status flags.
+ ToolActivity toolActivity = (ToolActivity) activityDAO.getActivityByActivityId(activity.getActivityId());
+ Long newContentId = lamsCoreToolService.notifyToolOfStatusFlags(toolActivity);
+ toolActivity.setToolContentId(newContentId);
+ }
+
+ } else {
+ // this is a new activity - need to set up the content, do any scheduling, etc
+ // always have to copy the tool content, even though it may point to unique content - that way if the
+ // teacher has double clicked on the tool icon (and hence set up a tool content id) but not saved any content
+ // the code in copyToolContent will ensure that there is content for this activity. So we end up with a few
+ // unused records - we are trading database space for reliability. If we don't ensure that there is always
+ // a content record, then shortcomings in the createToolSession code may throw exceptions.
+ if ( activity.isToolActivity() ) {
+ ToolActivity toolActivity = (ToolActivity) activityDAO.getActivityByActivityId(activity.getActivityId());
+ Long newContentId = lamsCoreToolService.notifyToolToCopyContent(toolActivity, true);
+ toolActivity.setToolContentId(newContentId);
+
+ } else if ( activity.isScheduleGate() ) {
+ //if it is schedule gate, we need to initialize the sheduler for it.
+ ScheduleGateActivity gateActivity = (ScheduleGateActivity) activityDAO.getActivityByActivityId(activity.getActivityId());
+ monitoringService.runGateScheduler(gateActivity,now,lesson.getLessonName());
+ }
+ activity.setInitialised(Boolean.TRUE);
+ activityDAO.update(activity);
+ }
+ }
+ }
+
public LearningDesign copyLearningDesign(Long originalDesignID,Integer copyType,
Integer userID, Integer workspaceFolderID, boolean setOriginalDesign)
throws UserException, LearningDesignException,
@@ -316,6 +721,9 @@
Long newContentId = lamsCoreToolService.notifyToolToCopyContent(toolActivity, copyType.intValue() != LearningDesign.COPY_TYPE_PREVIEW);
toolActivity.setToolContentId(newContentId);
+ // clear read only field
+ toolActivity.setReadOnly(false);
+
} catch (DataMissingException e) {
String error = "Unable to initialise the lesson. Data is missing for activity "+currentActivity.getActivityUIID()
+" in learning design "+originalLearningDesign.getLearningDesignId()
@@ -694,9 +1102,5 @@
}
- public MessageService getMessageService() {
- return messageService;
- }
-
}
\ No newline at end of file
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/authoring/service/EditOnFlyProcessor.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java,v
diff -u -r1.19 -r1.20
--- lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 20 Sep 2006 03:00:29 -0000 1.19
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 9 May 2007 01:03:36 -0000 1.20
@@ -27,6 +27,8 @@
import java.util.List;
import java.util.Vector;
+import org.lamsfoundation.lams.learningdesign.Activity;
+import org.lamsfoundation.lams.learningdesign.GateActivity;
import org.lamsfoundation.lams.learningdesign.LearningDesign;
import org.lamsfoundation.lams.learningdesign.dto.AuthoringActivityDTO;
import org.lamsfoundation.lams.learningdesign.dto.ValidationErrorDTO;
@@ -45,6 +47,7 @@
/** Message key returned by the storeLearningDesignDetails() method */
public static final String STORE_LD_MESSAGE_KEY = "storeLearningDesignDetails";
+ public static final String START_EDIT_ON_FLY_MESSAGE_KEY = "startEditOnFly";
/**
* Returns a populated LearningDesign object corresponding to the given learningDesignID
@@ -241,6 +244,53 @@
public String generateUniqueContentFolder() throws FileUtilException, IOException;
/**
+ * Prepares a LearningDesign to be ready for Edit-On-The-Fly (Editing).
+ * Return a string representing the updated learning design in WDDX format.
+ *
+ * @param design The learning design whose WDDX packet is requested
+ * @param userID user_id of the User who will be editing the design.
+ * @throws UserException
+ * @throws LearningDesignException
+ * @throws IOException
+ */
+ public String setupEditOnFlyGate(Long learningDesignID, Integer userID) throws UserException, LearningDesignException, IOException;
+ public boolean setupEditOnFlyLock(Long learningDesignID, Integer userID) throws LearningDesignException, UserException, IOException;
+
+ /**
+ *
+ *
+ * @param learningDesignID The learning_design_id of the design for which editing has finished.
+ * @param userID user_id of the User who has finished editing the design.
+ * @return wddx packet.
+ * @throws IOException
+ */
+ public String finishEditOnFly(Long learningDesignID, Integer userID) throws IOException;
+
+ /**
+ *
+ * @param gate
+ */
+ public LearningDesign removeTempSystemGate(GateActivity gate, LearningDesign design);
+
+ /**
+ *
+ * @param design
+ * @return
+ * @throws LearningDesignException
+ */
+ public Activity getFirstUnattemptedActivity(LearningDesign design) throws LearningDesignException;
+
+ /**
+ *
+ * @param design
+ * @param userID
+ * @return
+ * @throws LearningDesignException
+ * @throws IOException
+ */
+ public boolean isLearningDesignAvailable(LearningDesign design, Integer userID) throws LearningDesignException, IOException;
+
+ /**
* Returns the generic help url from configuration
*
* @return String Generic help url
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java,v
diff -u -r1.18 -r1.19
--- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 25 Oct 2006 03:48:06 -0000 1.18
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 9 May 2007 01:03:36 -0000 1.19
@@ -101,13 +101,35 @@
IAuthoringService authoringService = getAuthoringService();
try {
Long learningDesignID = new Long(WebUtil.readLongParam(request,"learningDesignID"));
+
wddxPacket = authoringService.getLearningDesignDetails(learningDesignID);
} catch (Exception e) {
wddxPacket = handleException(e, "getLearningDesignDetails", authoringService).serializeMessage();
}
return outputPacket(mapping, request, response, wddxPacket, "details");
}
+ public ActionForward finishLearningDesignEdit(ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response) throws ServletException, IOException{
+
+ String wddxPacket;
+ IAuthoringService authoringService = getAuthoringService();
+ try {
+ Long learningDesignID = new Long(WebUtil.readLongParam(request,"learningDesignID"));
+
+ wddxPacket = authoringService.finishEditOnFly(learningDesignID, getUserId());
+
+ } catch (Exception e) {
+ wddxPacket = handleException(e, "getLearningDesignDetails", authoringService).serializeMessage();
+ return outputPacket(mapping, request, response, wddxPacket, "details");
+ }
+
+ return outputPacket(mapping, request, response, wddxPacket, "details");
+
+ }
+
public ActionForward getLearningDesignsForUser(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringConstants.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringConstants.java,v
diff -u -r1.11 -r1.12
--- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringConstants.java 17 Sep 2006 06:12:05 -0000 1.11
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringConstants.java 9 May 2007 01:03:36 -0000 1.12
@@ -39,5 +39,4 @@
// used for tool content folder creation.
public static final String LAMS_WWW_FOLDER = "www/";
- public static final String LAMS_LAMS_FOLDER = "lams/";
}
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/authoring/web/EditOnFlyServlet.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java,v
diff -u -r1.24 -r1.25
--- lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java 22 Feb 2007 00:28:56 -0000 1.24
+++ lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java 9 May 2007 01:03:36 -0000 1.25
@@ -186,11 +186,29 @@
log.error("admin: User missing from session. ");
return mapping.findForward("error");
} else {
+ Long learningDesignID = null;
+ String layout = null;
String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL);
req.setAttribute("serverUrl", serverUrl);
String requestSrc = req.getParameter("requestSrc");
String notifyCloseURL = req.getParameter("notifyCloseURL");
+
+ if(req.getParameter("learningDesignID") != null)
+ learningDesignID = WebUtil.readLongParam(req, "learningDesignID");
+
+ if(req.getParameter("layout") != null)
+ layout = WebUtil.readStrParam(req, "layout");
+
+ if(layout != null)
+ req.setAttribute("layout", layout);
+
+ if(req.getParameter("learningDesignID") != null)
+ learningDesignID = WebUtil.readLongParam(req, "learningDesignID");
+
+ if(learningDesignID != null)
+ req.setAttribute("learningDesignID", learningDesignID);
+
req.setAttribute("requestSrc", requestSrc);
req.setAttribute("notifyCloseURL", notifyCloseURL);
Index: lams_central/src/java/org/lamsfoundation/lams/web/LAMSConnectorServlet.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/LAMSConnectorServlet.java,v
diff -u -r1.5 -r1.6
--- lams_central/src/java/org/lamsfoundation/lams/web/LAMSConnectorServlet.java 30 Oct 2006 04:09:17 -0000 1.5
+++ lams_central/src/java/org/lamsfoundation/lams/web/LAMSConnectorServlet.java 9 May 2007 01:03:36 -0000 1.6
@@ -80,6 +80,7 @@
private static String baseDir;
private String realBaseDir;
+ private String lamsContextPath;
private static boolean debug=false;
/**
@@ -96,6 +97,7 @@
baseDir="secure";
realBaseDir = Configuration.get(ConfigurationKeys.LAMS_EAR_DIR) + File.separator + FileUtil.LAMS_WWW_DIR + File.separator + baseDir;
+ lamsContextPath = "/" + Configuration.get(ConfigurationKeys.SERVER_URL_CONTEXT_PATH) +"/";
File baseFile=new File(realBaseDir);
if(!baseFile.exists()){
@@ -127,7 +129,7 @@
String currentDirPath=realBaseDir + currentFolderStr;
String validCurrentDirPath = currentDirPath.replace('/', File.separatorChar);
- String currentWebPath= "/" + AuthoringConstants.LAMS_LAMS_FOLDER + AuthoringConstants.LAMS_WWW_FOLDER + FileUtil.LAMS_WWW_SECURE_DIR + currentFolderStr + typeStr + "/";
+ String currentWebPath= lamsContextPath + AuthoringConstants.LAMS_WWW_FOLDER + FileUtil.LAMS_WWW_SECURE_DIR + currentFolderStr + typeStr + "/";
File currentContentDir=new File(validCurrentDirPath);
if(!currentContentDir.exists()){
Index: lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java,v
diff -u -r1.5 -r1.6
--- lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java 30 Oct 2006 04:09:17 -0000 1.5
+++ lams_central/src/java/org/lamsfoundation/lams/web/LAMSUploadServlet.java 9 May 2007 01:03:36 -0000 1.6
@@ -75,6 +75,7 @@
private static String baseDir;
private String realBaseDir;
+ private String lamsContextPath;
private static boolean debug=false;
private static boolean enabled=false;
private static Hashtable allowedExtensions;
@@ -100,7 +101,8 @@
baseDir="secure";
realBaseDir = Configuration.get(ConfigurationKeys.LAMS_EAR_DIR) + File.separator + FileUtil.LAMS_WWW_DIR + File.separator + baseDir;
-
+ lamsContextPath = "/" + Configuration.get(ConfigurationKeys.SERVER_URL_CONTEXT_PATH) +"/";
+
File baseFile=new File(realBaseDir);
if(!baseFile.exists()){
baseFile.mkdir();
@@ -167,7 +169,7 @@
String currentDirPath=realBaseDir + currentFolderStr;
String validCurrentDirPath = currentDirPath.replace('/', File.separatorChar);
- String currentWebPath= "/" + AuthoringConstants.LAMS_LAMS_FOLDER + AuthoringConstants.LAMS_WWW_FOLDER + FileUtil.LAMS_WWW_SECURE_DIR + currentFolderStr + typeStr;
+ String currentWebPath= lamsContextPath + AuthoringConstants.LAMS_WWW_FOLDER + FileUtil.LAMS_WWW_SECURE_DIR + currentFolderStr + typeStr;
File currentContentDir=new File(validCurrentDirPath);
if(!currentContentDir.exists()){
Index: lams_central/web/author.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/author.jsp,v
diff -u -r1.36 -r1.37
--- lams_central/web/author.jsp 20 Dec 2006 05:29:49 -0000 1.36
+++ lams_central/web/author.jsp 9 May 2007 01:05:11 -0000 1.37
@@ -91,6 +91,8 @@
closeWindow();
}else if(command == "openURL"){
openURL(args, "_blank");
+ }else if(command == "openMonitorLesson") {
+ openMonitorLesson(args);
}
}
@@ -235,17 +237,22 @@
}
}
+function openMonitorLesson(lessonID) {
+ window.opener.openMonitorLesson(lessonID);
+}
+
+
if(window.attachEvent) { window.attachEvent("onbeforeunload", myOnBeforeUnload); }
else { window.onbeforeunload = myOnBeforeUnload; }
//-->
-Author :: LAMS
+
-?loadFile=lams_authoring.swf&loadLibrary=lams_authoring_library.swf&userID=&serverURL=<%=pathToRoot%>&build=<%=authoringClientVersion%>&lang=&country=&langDate=<%=languageDate%>&theme=&actColour=<%= actColour %>&requestSrc=${requestSrc}&uniqueID=
+?loadFile=lams_authoring.swf&loadLibrary=lams_authoring_library.swf&userID=&serverURL=<%=pathToRoot%>&build=<%=authoringClientVersion%>&lang=&country=&langDate=<%=languageDate%>&theme=&actColour=<%= actColour %>&requestSrc=${requestSrc}&learningDesignID=${learningDesignID}&layout=${layout}&uniqueID=lams_preloader.swflams_preloader
Index: lams_central/web/favicon.ico
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/Attic/favicon.ico,v
diff -u -r1.1 -r1.2
Binary files differ
Index: lams_central/web/main.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/main.jsp,v
diff -u -r1.15 -r1.16
--- lams_central/web/main.jsp 20 Apr 2007 06:12:04 -0000 1.15
+++ lams_central/web/main.jsp 9 May 2007 01:05:11 -0000 1.16
@@ -14,7 +14,15 @@
- LAMS::
+
+
+ ::
+
+
+ ::
+
+
+
Index: lams_central/web/WEB-INF/lams.tld
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/WEB-INF/Attic/lams.tld,v
diff -u -r1.34 -r1.35
--- lams_central/web/WEB-INF/lams.tld 19 Feb 2007 23:22:17 -0000 1.34
+++ lams_central/web/WEB-INF/lams.tld 9 May 2007 01:05:11 -0000 1.35
@@ -13,28 +13,56 @@
- Output the basic URL for the current webapp. e.g. http://server/lams/tool/nb11/
- Base URL for the current web app
+ Converts role name into form usable as message resources key
+ Converts role name into form usable as message resources key
- WebAppURL
- org.lamsfoundation.lams.web.tag.WebAppURLTag
+ role
+ org.lamsfoundation.lams.web.tag.RoleTagempty
+
+ Converts role name into form usable as message resources key
+ role
+ true
+
+ true
+
+
+
- Output a random number for the learner and passon flash movies to communicate directly.
- generate unique ID
+ Output the Server URL as defined in the lams.xml configuration file.
+ LAMS URL
- generateID
- org.lamsfoundation.lams.web.tag.GenerateIDTag
+ LAMSURL
+ org.lamsfoundation.lams.web.tag.LAMSURLTagempty
+
+
+
+ converts text from \n or \r\n to <BR> before rendering
+ converts text from \n or \r\n to <BR> before rendering
+
+
+ out
+ org.lamsfoundation.lams.web.tag.MultiLinesOutputTag
+ empty
+
- Output a random number for the learner and passon flash movies to communicate directly.
- id
+ converts text from \n or \r\n to <BR> before rendering
+ value
+ true
+
+ true
+
+
+
+ converts text from \n or \r\n to <BR> before rendering
+ escapeXmlfalsetrue
@@ -44,18 +72,18 @@
- Converts role name into form usable as message resources key
- Converts role name into form usable as message resources key
+ Render html tag with direction and language
+ Render html tag with direction and language
- role
- org.lamsfoundation.lams.web.tag.RoleTag
- empty
+ html
+ org.lamsfoundation.lams.web.tag.HtmlTag
+ JSP
- Converts role name into form usable as message resources key
- role
- true
+ Render html tag with direction and language
+ xhtml
+ falsetrue
@@ -100,42 +128,23 @@
- Output the Server URL as defined in the lams.xml configuration file.
- LAMS URL
+ Output a random number for the learner and passon flash movies to communicate directly.
+ generate unique ID
- LAMSURL
- org.lamsfoundation.lams.web.tag.LAMSURLTag
+ generateID
+ org.lamsfoundation.lams.web.tag.GenerateIDTagempty
-
-
-
- Output stylesheet based on the user preferences.
- User's chosen stylesheet
-
-
- css
- org.lamsfoundation.lams.web.tag.CssTag
- empty
-
- Output stylesheet based on the user preferences.
- localLinkPath
+ Output a random number for the learner and passon flash movies to communicate directly.
+ idfalsetrue
-
- Output stylesheet based on the user preferences.
- style
- false
- true
-
-
-
@@ -159,45 +168,36 @@
- Render html tag with direction and language
- Render html tag with direction and language
+ Output the basic URL for the current webapp. e.g. http://server/lams/tool/nb11/
+ Base URL for the current web app
- html
- org.lamsfoundation.lams.web.tag.HtmlTag
- JSP
+ WebAppURL
+ org.lamsfoundation.lams.web.tag.WebAppURLTag
+ empty
-
- Render html tag with direction and language
- xhtml
- false
-
- true
-
-
-
- converts text from \n or \r\n to <BR> before rendering
- converts text from \n or \r\n to <BR> before rendering
+ Output stylesheet based on the user preferences.
+ User's chosen stylesheet
- out
- org.lamsfoundation.lams.web.tag.MultiLinesOutputTag
+ css
+ org.lamsfoundation.lams.web.tag.CssTagempty
- converts text from \n or \r\n to <BR> before rendering
- value
- true
+ Output stylesheet based on the user preferences.
+ localLinkPath
+ falsetrue
- converts text from \n or \r\n to <BR> before rendering
- escapeXml
+ Output stylesheet based on the user preferences.
+ stylefalsetrue
Index: lams_central/web/WEB-INF/web.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/WEB-INF/Attic/web.xml,v
diff -u -r1.30 -r1.31
--- lams_central/web/WEB-INF/web.xml 19 Feb 2007 23:22:17 -0000 1.30
+++ lams_central/web/WEB-INF/web.xml 9 May 2007 01:05:11 -0000 1.31
@@ -72,6 +72,10 @@
/fckeditor/*
+ SystemSessionFilter
+ /eof/*
+
+ hibernateFilter*.do
@@ -149,21 +153,26 @@
- storeTheme
- org.lamsfoundation.lams.themes.web.StoreThemeServlet
+ editLD
+ org.lamsfoundation.lams.authoring.web.EditOnFlyServlet
- flashCrashDump
- org.lamsfoundation.lams.web.FlashCrashDumpServlet
+ storeLD
+ org.lamsfoundation.lams.authoring.web.StoreLDServlet
- storeLD
- org.lamsfoundation.lams.authoring.web.StoreLDServlet
+ dumpWDDX
+ org.lamsfoundation.lams.web.ReportWddxStructureServlet
+ storeTheme
+ org.lamsfoundation.lams.themes.web.StoreThemeServlet
+
+
+ SimpleUploaderorg.lamsfoundation.lams.web.LAMSUploadServlet
@@ -208,6 +217,11 @@
+ storeNotebookEntry
+ org.lamsfoundation.lams.notebook.web.StoreNBEntryServlet
+
+
+ Connectororg.lamsfoundation.lams.web.LAMSConnectorServlet
@@ -224,16 +238,11 @@
- dumpWDDX
- org.lamsfoundation.lams.web.ReportWddxStructureServlet
+ flashCrashDump
+ org.lamsfoundation.lams.web.FlashCrashDumpServlet
-
- storeNotebookEntry
- org.lamsfoundation.lams.notebook.web.StoreNBEntryServlet
-
-
action
@@ -297,6 +306,22 @@
+
+ LearningDesignRepository
+ LearningDesignRepository Servlet
+
+ org.lamsfoundation.lams.webservice.xml.LearningDesignRepositoryServlet
+
+
+
+
+ LessonManager
+ LessonManager Servlet
+
+ org.lamsfoundation.lams.webservice.xml.LessonManagerServlet
+
+
+
action*.do
@@ -327,34 +352,48 @@
/LoginRequest
+
+ LearningDesignRepository
+ /services/xml/LearningDesignRepository/*
+
+
+
+ LessonManager
+ /services/xml/LessonManager/*
+
+
- storeTheme
- /themes/servlet/storeTheme
+ editLD
+ /eof/authoring/editLearningDesign
- flashCrashDump
- /servlet/flashCrashDump
-
- storeLD/servlet/authoring/storeLearningDesignDetails
- SimpleUploader
- /fckeditor/editor/filemanager/upload/simpleuploader
+ dumpWDDX
+ /servlet/dumpWDDX
- Connector
- /fckeditor/editor/filemanager/browser/default/connectors/jsp/connector
+ storeTheme
+ /themes/servlet/storeTheme
- dumpWDDX
- /servlet/dumpWDDX
+ SimpleUploader
+ /fckeditor/editor/filemanager/upload/simpleuploaderstoreNotebookEntry/servlet/notebook/storeNotebookEntry
+
+ Connector
+ /fckeditor/editor/filemanager/browser/default/connectors/jsp/connector
+
+
+ flashCrashDump
+ /servlet/flashCrashDump
+ 120
Index: lams_central/web/WEB-INF/struts/struts-config.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/WEB-INF/struts/Attic/struts-config.xml,v
diff -u -r1.22 -r1.23
--- lams_central/web/WEB-INF/struts/struts-config.xml 22 Feb 2007 00:29:14 -0000 1.22
+++ lams_central/web/WEB-INF/struts/struts-config.xml 9 May 2007 01:05:11 -0000 1.23
@@ -297,7 +297,7 @@
/>
Index: lams_central/web/WEB-INF/tags/FCKEditor.tag
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/WEB-INF/tags/Attic/FCKEditor.tag,v
diff -u -r1.2 -r1.3
--- lams_central/web/WEB-INF/tags/FCKEditor.tag 29 Sep 2006 05:41:47 -0000 1.2
+++ lams_central/web/WEB-INF/tags/FCKEditor.tag 9 May 2007 01:05:11 -0000 1.3
@@ -15,7 +15,7 @@
-
+/fckeditor/
@@ -214,6 +216,9 @@
@hibernate.class
+
+ @hibernate.class
+
Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml,v
diff -u -r1.16 -r1.17
--- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml 23 Oct 2006 23:58:54 -0000 1.16
+++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml 9 May 2007 01:09:26 -0000 1.17
@@ -90,6 +90,29 @@
+
+ @hibernate.property
+ column="edit_override_lock"
+
+
+
+
+
+ @hibernate.property
+ column="design_version"
+
+
+
+
+
+
+
+
+
+
+
Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/lesson/Lesson.hbm.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/lesson/Lesson.hbm.xml,v
diff -u -r1.23 -r1.24
--- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/lesson/Lesson.hbm.xml 16 Nov 2006 01:05:05 -0000 1.23
+++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/lesson/Lesson.hbm.xml 9 May 2007 01:09:26 -0000 1.24
@@ -14,6 +14,11 @@
+
+
@@ -44,6 +49,9 @@
+
+
Index: lams_common/db/sql/insert_lams_windows_config_data.sql
===================================================================
RCS file: /usr/local/cvsroot/lams_common/db/sql/insert_lams_windows_config_data.sql,v
diff -u -r1.1 -r1.2
--- lams_common/db/sql/insert_lams_windows_config_data.sql 23 Apr 2007 00:55:02 -0000 1.1
+++ lams_common/db/sql/insert_lams_windows_config_data.sql 9 May 2007 01:10:47 -0000 1.2
@@ -1,4 +1,5 @@
insert into lams_configuration (config_key, config_value) values ('ServerURL','http://localhost:8080/lams/');
+insert into lams_configuration (config_key, config_value) values ('ServerURLContextPath','lams/');
insert into lams_configuration (config_key, config_value) values ('Version','2.0.2');
insert into lams_configuration (config_key, config_value) values ('TempDir','C:/lams/temp');
insert into lams_configuration (config_key, config_value) values ('DumpDir','C:/lams/dump');
@@ -29,4 +30,5 @@
insert into lams_configuration (config_key, config_value) values ('DefaultFlashTheme','default');
insert into lams_configuration (config_key, config_value) values ('DefaultHTMLTheme','defaultHTML');
insert into lams_configuration (config_key, config_value) values ('AllowDirectLessonLaunch','false');
-insert into lams_configuration (config_key, config_value) values ('LAMS_Community_enable','false');
\ No newline at end of file
+insert into lams_configuration (config_key, config_value) values ('LAMS_Community_enable','false');
+insert into lams_configuration (config_key, config_value) values ('AllowLiveEdit','true');
\ No newline at end of file
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/Activity.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/Activity.java,v
diff -u -r1.57 -r1.58
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/Activity.java 23 Oct 2006 23:58:53 -0000 1.57
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/Activity.java 9 May 2007 01:07:24 -0000 1.58
@@ -69,6 +69,7 @@
public static final int PARALLEL_ACTIVITY_TYPE = 6;
public static final int OPTIONS_ACTIVITY_TYPE = 7;
public static final int SEQUENCE_ACTIVITY_TYPE = 8;
+ public static final int SYSTEM_GATE_ACTIVITY_TYPE = 9;
/******************************************************************/
/**
@@ -197,7 +198,15 @@
* this activity. e.g. org.lamsfoundation.lams.tool.sbmt.SbmtResources.properties. */
private String languageFile;
- //---------------------------------------------------------------------
+ /** An activity is readOnly when a learner starts doing the activity.
+ * Used in editOnFly. */
+ private Boolean readOnly;
+
+ /** An activity is initialised if it is ready to be used in lesson ie the tool content
+ * is set up, schedule gates are scheduled, etc. Used to detect which activities
+ * need to be initialised for live edit. */
+ private Boolean initialised;
+ //---------------------------------------------------------------------
// Object constructors
//---------------------------------------------------------------------
@@ -245,11 +254,15 @@
this.transitionTo = transitionTo;
this.transitionFrom = transitionFrom;
this.languageFile = languageFile;
+ this.readOnly = false;
+ this.initialised = false;
}
/** default constructor */
public Activity() {
this.grouping = null;
this.createDateTime = new Date(); //default value is set to when the object is created
+ this.readOnly = false;
+ this.initialised = false;
}
/** minimal constructor */
@@ -274,6 +287,7 @@
this.activityTypeId = activityTypeId;
this.transitionTo = transitionTo;
this.transitionFrom = transitionFrom;
+ this.readOnly = false;
}
public static Activity getActivityInstance(int activityType)
@@ -311,6 +325,10 @@
activity = new PermissionGateActivity();
activity.setActivityCategoryID(CATEGORY_SYSTEM);
break;
+ case SYSTEM_GATE_ACTIVITY_TYPE:
+ activity = new SystemGateActivity();
+ activity.setActivityCategoryID(CATEGORY_SYSTEM);
+ break;
default:
activity = new GroupingActivity();
activity.setActivityCategoryID(CATEGORY_SYSTEM);
@@ -517,6 +535,32 @@
this.groupingSupportType = groupingSupportType;
}
+ /**
+ * @return Returns the readOnly.
+ */
+ public Boolean getReadOnly() {
+ return readOnly;
+ }
+ /**
+ * @param readOnly The readOnly to set.
+ */
+ public void setReadOnly(Boolean readOnly) {
+ this.readOnly = readOnly;
+ }
+
+ /**
+ * @return Returns the initialised.
+ */
+ public Boolean isInitialised() {
+ return initialised;
+ }
+ /**
+ * @param readOnly The readOnly to set.
+ */
+ public void setInitialised(Boolean initialised) {
+ this.initialised = initialised;
+ }
+
public String toString() {
return new ToStringBuilder(this)
.append("activityId", activityId)
@@ -761,7 +805,8 @@
{
return getActivityTypeId().intValue()== SCHEDULE_GATE_ACTIVITY_TYPE ||
getActivityTypeId().intValue()== PERMISSION_GATE_ACTIVITY_TYPE ||
- getActivityTypeId().intValue()== SYNCH_GATE_ACTIVITY_TYPE;
+ getActivityTypeId().intValue()== SYNCH_GATE_ACTIVITY_TYPE ||
+ getActivityTypeId().intValue() == SYSTEM_GATE_ACTIVITY_TYPE;
}
/**
@@ -791,11 +836,25 @@
return getActivityTypeId().intValue() == SCHEDULE_GATE_ACTIVITY_TYPE;
}
+ /**
+ * Check up whether an activity is schedule gate activity or not.
+ * @return is this activity a schedule gate activity.
+ */
+ public boolean isSystemGate()
+ {
+ return getActivityTypeId().intValue() == SYSTEM_GATE_ACTIVITY_TYPE;
+ }
+
public boolean isGroupingActivity()
{
return getActivityTypeId().intValue()== GROUPING_ACTIVITY_TYPE;
}
+ public boolean isActivityReadOnly()
+ {
+ return readOnly.equals(Boolean.TRUE);
+ }
+
//---------------------------------------------------------------------
// Data Transfer object creation methods
//---------------------------------------------------------------------
@@ -860,6 +919,7 @@
newActivity.setLanguageFile(this.getLanguageFile());
newActivity.setOrderId(this.getOrderId());
+ newActivity.setReadOnly(this.getReadOnly());
}
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ContributionTypes.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/ContributionTypes.java,v
diff -u -r1.2 -r1.3
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ContributionTypes.java 17 Sep 2006 06:14:16 -0000 1.2
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ContributionTypes.java 9 May 2007 01:07:24 -0000 1.3
@@ -36,6 +36,7 @@
public static final Integer SCHEDULE_GATE = new Integer(5);
public static final Integer CHOSEN_GROUPING = new Integer(6);
public static final Integer CONTRIBUTION = new Integer(7);
+ public static final Integer SYSTEM_GATE = new Integer(7);
}
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/LearningDesign.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/LearningDesign.java,v
diff -u -r1.31 -r1.32
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/LearningDesign.java 17 Sep 2006 06:14:16 -0000 1.31
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/LearningDesign.java 9 May 2007 01:07:24 -0000 1.32
@@ -92,6 +92,13 @@
/** nullable persistent field */
private Date dateReadOnly;
+ /** Override the read only field. When set to true, the user
+ * specified in editOverrideUser can edit the learning design. Used by edit
+ * on the fly. */
+ private Boolean editOverrideLock;
+ private User editOverrideUser;
+ private Integer designVersion;
+
/** nullable persistent field */
private String helpText;
@@ -146,7 +153,6 @@
/** Online Instructions for this activity*/
private String onlineInstructions;
-
/* If the values for createDateTime and/or lastModifiedDateTime
* are null, then it will default to the current datetime.
*/
@@ -175,7 +181,10 @@
License license,
String offlineInstructions,
String onlineInstructions,
- String contentFolderID
+ String contentFolderID,
+ Boolean editOverrideLock,
+ User editOverrideUser,
+ Integer designVersion
) {
this.learningDesignId = learningDesignId;
this.learningDesignUIID = ui_id;
@@ -203,13 +212,18 @@
this.onlineInstructions = onlineInstructions;
this.contentFolderID = contentFolderID;
this.lastModifiedDateTime = new Date();
+ this.editOverrideLock = editOverrideLock;
+ this.editOverrideUser = editOverrideUser;
+ this.designVersion = designVersion;
}
/** default constructor */
public LearningDesign() {
//set the default values to the current datetime
this.createDateTime = new Date();
this.lastModifiedDateTime = new Date();
+ this.editOverrideLock = false;
+ this.designVersion = new Integer(1);
}
/** minimal constructor */
@@ -237,6 +251,8 @@
this.transitions = transitions;
this.activities = activities;
this.lastModifiedDateTime = new Date();
+ this.editOverrideLock = false;
+ this.designVersion = new Integer(1);
}
/** Create a new learning design based on an existing learning design. If setOriginalDesign is true, then set the input design
* as the original design in the copied design - this is used when runtime copies of a design are created. It is not used
@@ -251,7 +267,8 @@
newDesign.setDescription(design.getDescription());
newDesign.setTitle(design.getTitle());
newDesign.setMaxID(design.getMaxID());
- newDesign.setValidDesign(design.getValidDesign());
+ newDesign.setValidDesign(design.getValidDesign());
+ newDesign.setDesignVersion(design.getDesignVersion());
newDesign.setDateReadOnly(design.getDateReadOnly());
newDesign.setHelpText(design.getHelpText());
newDesign.setVersion(design.getVersion());
@@ -271,6 +288,8 @@
newDesign.setCopyTypeID(designCopyType);
newDesign.setContentFolderID(design.getContentFolderID());
+ newDesign.setEditOverrideLock(design.getEditOverrideLock());
+ newDesign.setEditOverrideUser(design.getEditOverrideUser());
return newDesign;
}
@@ -329,6 +348,27 @@
public void setDateReadOnly(Date dateReadOnly) {
this.dateReadOnly = dateReadOnly;
}
+ /** Override the read only field. When set to true, the user
+ * specified in editOverrideUser can edit the learning design.
+ * Used by edit on the fly. */
+ public Boolean getEditOverrideLock() {
+ return editOverrideLock;
+ }
+ public void setEditOverrideLock(Boolean editOverrideLock) {
+ this.editOverrideLock = editOverrideLock;
+ }
+ public User getEditOverrideUser() {
+ return editOverrideUser;
+ }
+ public void setEditOverrideUser(User editOverrideUser) {
+ this.editOverrideUser = editOverrideUser;
+ }
+ public void setDesignVersion(Integer designVersion) {
+ this.designVersion = designVersion;
+ }
+ public Integer getDesignVersion() {
+ return designVersion;
+ }
public String getHelpText() {
return helpText;
}
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_common/src/java/org/lamsfoundation/lams/learningdesign/SystemGateActivity.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolActivity.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolActivity.java,v
diff -u -r1.27 -r1.28
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolActivity.java 17 Sep 2006 06:14:16 -0000 1.27
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolActivity.java 9 May 2007 01:07:24 -0000 1.28
@@ -311,4 +311,5 @@
protected void getToolActivitiesInActivity(SortedSet toolActivities) {
toolActivities.add(this);
}
+
}
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/dao/hibernate/ActivityDAO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/dao/hibernate/ActivityDAO.java,v
diff -u -r1.17 -r1.18
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dao/hibernate/ActivityDAO.java 17 Sep 2006 06:14:16 -0000 1.17
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dao/hibernate/ActivityDAO.java 9 May 2007 01:07:25 -0000 1.18
@@ -34,6 +34,7 @@
import org.lamsfoundation.lams.learningdesign.ParallelActivity;
import org.lamsfoundation.lams.learningdesign.PermissionGateActivity;
import org.lamsfoundation.lams.learningdesign.ScheduleGateActivity;
+import org.lamsfoundation.lams.learningdesign.SystemGateActivity;
import org.lamsfoundation.lams.learningdesign.SequenceActivity;
import org.lamsfoundation.lams.learningdesign.SynchGateActivity;
import org.lamsfoundation.lams.learningdesign.ToolActivity;
@@ -96,6 +97,8 @@
return getActivityByActivityId(activityId,OptionsActivity.class);
case Activity.SEQUENCE_ACTIVITY_TYPE:
return getActivityByActivityId(activityId,SequenceActivity.class);
+ case Activity.SYSTEM_GATE_ACTIVITY_TYPE:
+ return getActivityByActivityId(activityId,SystemGateActivity.class);
default: break;
}
}
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java,v
diff -u -r1.25 -r1.26
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java 18 Oct 2006 02:21:32 -0000 1.25
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java 9 May 2007 01:07:23 -0000 1.26
@@ -35,6 +35,7 @@
import org.lamsfoundation.lams.learningdesign.ScheduleGateActivity;
import org.lamsfoundation.lams.learningdesign.SequenceActivity;
import org.lamsfoundation.lams.learningdesign.SynchGateActivity;
+import org.lamsfoundation.lams.learningdesign.SystemGateActivity;
import org.lamsfoundation.lams.learningdesign.ToolActivity;
import org.lamsfoundation.lams.util.wddx.WDDXTAGS;
/**
@@ -181,6 +182,13 @@
private Integer createGroupingUIID;
+ private Boolean readOnly;
+
+ /** An activity is initialised if it is ready to be used in lesson ie the tool content
+ * is set up, schedule gates are scheduled, etc. Used to detect which activities
+ * need to be initialised for live edit. */
+ private Boolean initialised;
+
/* Server will send Grouping objects as an array (in the Groupings array)
* rather than being part of the GroupingActivity. For the groupings array
* see LearningDesignDTO.
@@ -215,7 +223,8 @@
String libraryActivityUiImage, Long createGroupingID,
Integer createGroupingUIID, Long libraryActivityID,
Boolean applyGrouping,Integer groupingSupportType,
- Integer groupingType,GroupingDTO groupingDTO) {
+ Integer groupingType,GroupingDTO groupingDTO,
+ Boolean readOnly, Boolean initialised) {
super();
this.activityID = activityID;
this.activityUIID = activityUIID;
@@ -257,6 +266,8 @@
this.groupingSupportType = groupingSupportType;
this.groupingType = groupingType;
//this.groupingDTO = groupingDTO;
+ this.readOnly = readOnly;
+ this.initialised = initialised;
}
public AuthoringActivityDTO(ToolActivity toolActivity){
super();
@@ -302,6 +313,8 @@
null;
this.applyGrouping = activity.getApplyGrouping();
this.groupingSupportType = activity.getGroupingSupportType();
+ this.readOnly = activity.getReadOnly();
+ this.initialised = activity.isInitialised();
}
@@ -360,6 +373,8 @@
addSynchGateActivityAttributes((SynchGateActivity)activity);
else if (activity instanceof PermissionGateActivity)
addPermissionGateActivityAttributes((PermissionGateActivity)activity);
+ else if(activity instanceof SystemGateActivity)
+ addSystemGateActivityAttributes((SystemGateActivity)activity);
else
addScheduleGateActivityAttributes((ScheduleGateActivity)activity);
GateActivity gateActivity = (GateActivity)activity ;
@@ -371,6 +386,8 @@
}
private void addPermissionGateActivityAttributes(PermissionGateActivity activity){
}
+ private void addSystemGateActivityAttributes(SystemGateActivity activity){
+ }
private void addScheduleGateActivityAttributes(ScheduleGateActivity activity){
this.gateStartDateTime = activity.getGateStartDateTime();
this.gateStartTimeOffset = activity.getGateStartTimeOffset();
@@ -873,6 +890,21 @@
this.groupingDTO = groupingDTO;
} */
+ /**
+ * @return Returns the readOnly.
+ */
+ public Boolean getReadOnly() {
+ return readOnly;
+ }
+ /**
+ *
+ * @param readOnly The readOnly to set.
+ */
+ public void setReadOnly(Boolean readOnly) {
+ if(!readOnly.equals(WDDXTAGS.BOOLEAN_NULL_VALUE))
+ this.readOnly = readOnly;
+ }
+
/** Get the authoring url related to this tool */
public String getAuthoringURL() {
return authoringURL;
@@ -935,4 +967,10 @@
public void setToolVersion(String toolVersion) {
this.toolVersion = toolVersion;
}
+ public Boolean getInitialised() {
+ return initialised;
+ }
+ public void setInitialised(Boolean initialised) {
+ this.initialised = initialised;
+ }
}
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/DesignDetailDTO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/DesignDetailDTO.java,v
diff -u -r1.9 -r1.10
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/DesignDetailDTO.java 17 Sep 2006 06:14:19 -0000 1.9
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/DesignDetailDTO.java 9 May 2007 01:07:23 -0000 1.10
@@ -39,12 +39,15 @@
private String title;
private Long firstActivityID;
private Boolean validDesign;
- private Boolean readOnly;
+ private Boolean readOnly;
+ private Boolean editOverrideLock;
private Date dateReadOnly;
private Integer userID;
+ private Integer editOverrideUserID;
private String helpText;
private Integer copyTypeID;
- private String version;
+ private String version;
+ private Integer designVersion;
private Long parentLearningDesignID;
private Integer workspaceFolderID;
private String contentFolderID;
@@ -54,9 +57,9 @@
}
public DesignDetailDTO(Long learningDesignID, Integer learningDesignUIID,
String description, String title, Long firstActivityID,
- Boolean validDesign, Boolean readOnly,
- Date dateReadOnly, Integer userID, String helpText,
- Integer copyTypeID, String version, Long parentLearningDesignID,
+ Boolean validDesign, Boolean readOnly, Boolean editLock,
+ Date dateReadOnly, Integer userID, Integer editOverrideUserID, String helpText,
+ Integer copyTypeID, String version, Integer designVersion, Long parentLearningDesignID,
Integer workspaceFolderID) {
this.learningDesignID = learningDesignID;
this.learningDesignUIID = learningDesignUIID;
@@ -67,9 +70,11 @@
this.readOnly = readOnly;
this.dateReadOnly = dateReadOnly;
this.userID = userID;
+ this.editOverrideUserID = editOverrideUserID;
this.helpText = helpText;
this.copyTypeID = copyTypeID;
this.version = version;
+ this.designVersion = designVersion;
this.parentLearningDesignID = parentLearningDesignID;
this.workspaceFolderID = workspaceFolderID;
}
@@ -83,11 +88,14 @@
null;
this.validDesign = learningDesign.getValidDesign();
this.readOnly = learningDesign.getReadOnly();
+ this.editOverrideLock = learningDesign.getEditOverrideLock();
this.dateReadOnly = learningDesign.getDateReadOnly();
this.userID = learningDesign.getUser().getUserId();
+ this.editOverrideUserID = learningDesign.getEditOverrideUser().getUserId();
this.helpText = learningDesign.getHelpText();
this.copyTypeID = learningDesign.getCopyTypeID();
this.version = learningDesign.getVersion();
+ this.designVersion = learningDesign.getDesignVersion();
this.parentLearningDesignID = learningDesign.getOriginalLearningDesign()!=null?
learningDesign.getOriginalLearningDesign().getLearningDesignId():
null;
@@ -149,6 +157,12 @@
return readOnly;
}
/**
+ * @return Returns the editLock.
+ */
+ public Boolean getEditOverrideLock() {
+ return editOverrideLock;
+ }
+ /**
* @return Returns the title.
*/
public String getTitle() {
@@ -161,6 +175,12 @@
return userID;
}
/**
+ * @return Returns the editOnFlyUserID.
+ */
+ public Integer geteditOverrideUserID() {
+ return editOverrideUserID;
+ }
+ /**
* @return Returns the validDesign.
*/
public Boolean getValidDesign() {
@@ -173,6 +193,13 @@
return version;
}
/**
+ *
+ * @return Returns the design version.
+ */
+ public Integer getDesignVersion() {
+ return designVersion;
+ }
+ /**
* @return Returns the workspaceFolderID.
*/
public Integer getWorkspaceFolderID() {
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/LearningDesignDTO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/LearningDesignDTO.java,v
diff -u -r1.24 -r1.25
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/LearningDesignDTO.java 17 Sep 2006 06:14:19 -0000 1.24
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/LearningDesignDTO.java 9 May 2007 01:07:22 -0000 1.25
@@ -53,13 +53,17 @@
private Integer firstActivityUIID;
private Integer maxID;
private Boolean validDesign;
- private Boolean readOnly;
+ private Boolean readOnly;
+ private Boolean editOverrideLock;
private Date dateReadOnly;
private Integer userID;
+ private Integer editOverrideUserID;
+ private String editOverrideUserFullName;
private String helpText;
private Integer copyTypeID;
private Date createDateTime;
private String version;
+ private Integer designVersion;
private Long originalLearningDesignID;
private Integer workspaceFolderID;
private Long duration;
@@ -88,12 +92,16 @@
Integer maxId,
Boolean validDesign,
Boolean readOnly,
+ Boolean editOverrideLock,
Date dateReadOnly,
Integer userID,
+ Integer editOverrideUserID,
+ String editOverrideUserFullName,
String helpText,
Integer copyTypeID,
Date createDateTime,
String version,
+ Integer designVersion,
Long originalLearningDesignID,
Integer workspaceFolderID,
Long duration,
@@ -112,14 +120,18 @@
this.maxID = maxId;
this.validDesign = validDesign;
this.readOnly = readOnly;
+ this.editOverrideLock = editOverrideLock;
this.dateReadOnly = dateReadOnly;
this.offlineInstructions = offlineInstructions;
this.onlineInstructions = onlineInstructions;
this.userID = userID;
+ this.editOverrideUserID = editOverrideUserID;
+ this.editOverrideUserFullName = editOverrideUserFullName;
this.helpText = helpText;
this.copyTypeID = copyTypeID;
this.createDateTime = createDateTime;
this.version = version;
+ this.designVersion = designVersion;
this.originalLearningDesignID = originalLearningDesignID;
this.workspaceFolderID = workspaceFolderID;
this.duration = duration;
@@ -143,7 +155,9 @@
null;
this.maxID = learningDesign.getMaxID();
this.validDesign = learningDesign.getValidDesign();
+ this.designVersion = learningDesign.getDesignVersion();
this.readOnly = learningDesign.getReadOnly();
+ this.editOverrideLock = learningDesign.getEditOverrideLock();
this.dateReadOnly = learningDesign.getDateReadOnly();
this.offlineInstructions = learningDesign.getOfflineInstructions();
@@ -152,6 +166,13 @@
this.userID = learningDesign.getUser()!=null?
learningDesign.getUser().getUserId():
null;
+
+ this.editOverrideUserID = learningDesign.getEditOverrideUser()!=null?
+ learningDesign.getEditOverrideUser().getUserId():
+ null;
+ this.editOverrideUserFullName = learningDesign.getEditOverrideUser()!=null?
+ learningDesign.getEditOverrideUser().getFullName():
+ null;
this.helpText = learningDesign.getHelpText();
this.copyTypeID = learningDesign.getCopyTypeID();
@@ -291,10 +312,17 @@
* @return Returns the readOnly.
*/
public Boolean getReadOnly() {
- //return readOnly!=null?readOnly:WDDXTAGS.BOOLEAN_NULL_VALUE;
+ //return readOnly!=null?readOnly:WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER;
return readOnly;
}
/**
+ * @return Returns the editLock.
+ */
+ public Boolean getEditOverrideLock() {
+ return editOverrideLock;
+ }
+
+ /**
* @return Returns the title.
*/
public String getTitle() {
@@ -309,6 +337,19 @@
return userID;
}
/**
+ * @return Returns the editOnFlyUserID.
+ */
+ public Integer getEditOverrideUserID() {
+ //return userID!=null?userID:WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER;
+ return editOverrideUserID;
+ }
+ /**
+ * @return Returns the editOnFlyUserFullName.
+ */
+ public String getEditOverrideUserFullName() {
+ return editOverrideUserFullName;
+ }
+ /**
* @return Returns the validDesign.
*/
public Boolean getValidDesign() {
@@ -323,6 +364,12 @@
return version;
}
/**
+ * @return Returns the design version.
+ */
+ public Integer getDesignVersion() {
+ return designVersion;
+ }
+ /**
* @return Returns the workspaceFolderID.
*/
public Integer getWorkspaceFolderID() {
@@ -530,6 +577,20 @@
this.userID = userID;
}
/**
+ * @param userID The userID to set.
+ */
+ public void setEditOverrideUserID(Integer editOverrideUserID) {
+ if(!editOverrideUserID.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER))
+ this.editOverrideUserID = editOverrideUserID;
+ }
+ /**
+ * @param userID The userID to set.
+ */
+ public void setEditOverrideUserFullName(String editOverrideUserFullName) {
+ if(!editOverrideUserFullName.equals(WDDXTAGS.STRING_NULL_VALUE))
+ this.editOverrideUserFullName = editOverrideUserFullName;
+ }
+ /**
* @param validDesign The validDesign to set.
*/
public void setValidDesign(Boolean validDesign) {
@@ -543,6 +604,13 @@
this.version = version;
}
/**
+ * @param designVersion The design version to set.
+ */
+ public void setVersion(Integer designVersion) {
+ if(!designVersion.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER))
+ this.designVersion = designVersion;
+ }
+ /**
* @param workspaceFolderID The workspaceFolderID to set.
*/
public void setWorkspaceFolderID(Integer workspaceFolderID) {
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LD102Importer.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LD102Importer.java,v
diff -u -r1.24 -r1.25
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LD102Importer.java 2 Dec 2006 08:00:01 -0000 1.24
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LD102Importer.java 9 May 2007 01:07:24 -0000 1.25
@@ -523,6 +523,7 @@
ld.setValidDesign(Boolean.FALSE);
ld.setReadOnly(Boolean.FALSE);
+ ld.setEditOverrideLock(Boolean.FALSE);
ld.setDateReadOnly(null);
ld.setOfflineInstructions(null);
ld.setOnlineInstructions(null);
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `lams_common/src/java/org/lamsfoundation/lams/learningdesign/strategy/SystemGateActivityStrategy.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_common/src/java/org/lamsfoundation/lams/lesson/Lesson.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/lesson/Lesson.java,v
diff -u -r1.28 -r1.29
--- lams_common/src/java/org/lamsfoundation/lams/lesson/Lesson.java 16 Nov 2006 01:04:50 -0000 1.28
+++ lams_common/src/java/org/lamsfoundation/lams/lesson/Lesson.java 9 May 2007 01:07:27 -0000 1.29
@@ -75,6 +75,9 @@
/** identifier field */
private Long lessonId;
+ /** Hibernate managed version field */
+ private Integer version;
+
/** persistent field */
private String lessonName;
@@ -120,6 +123,9 @@
/** Persistent field. Defaults to FALSE if not set to anything by a constructor parameter. */
private Boolean learnerExportAvailable;
+ /** Persistent field. Defaults to FALSE - is not included in the constructor anywhere. */
+ private Boolean lockedForEdit;
+
//---------------------------------------------------------------------
// constructors
//---------------------------------------------------------------------
@@ -137,7 +143,7 @@
LearningDesign learningDesign,Set learnerProgresses)
{
this(null,name,description,createDateTime,null,null,user,lessonStateId,previousLessonStateId,
- learnerExportAvailable,learningDesign,null,null,learnerProgresses);
+ learnerExportAvailable,false, learningDesign,null,null,learnerProgresses);
}
/**
@@ -150,12 +156,12 @@
Organisation organisation, Set learnerProgresses)
{
this(null,name,description,createDateTime,null,null,user,lessonStateId,previousLessonStateId,
- learnerExportAvailable, learningDesign,lessonClass,organisation,learnerProgresses);
+ learnerExportAvailable, false, learningDesign,lessonClass,organisation,learnerProgresses);
}
/** full constructor */
public Lesson(Long lessonId,String name,String description, Date createDateTime, Date startDateTime, Date endDateTime, User user,
- Integer lessonStateId, Integer previousLessonStateId, Boolean learnerExportAvailable,
+ Integer lessonStateId, Integer previousLessonStateId, Boolean learnerExportAvailable, Boolean lockedForEdit,
LearningDesign learningDesign, LessonClass lessonClass,
Organisation organisation, Set learnerProgresses)
{
@@ -169,6 +175,7 @@
this.lessonStateId = lessonStateId;
this.previousLessonStateId = previousLessonStateId;
this.learnerExportAvailable = learnerExportAvailable != null ? learnerExportAvailable : Boolean.FALSE;
+ this.lockedForEdit = false;
this.learningDesign = learningDesign;
this.lessonClass = lessonClass;
this.organisation = organisation;
@@ -249,7 +256,20 @@
this.lessonId = lessonId;
}
- /**
+ /**
+ * Hibernate version column - updated automatically
+ *
+ * @hibernate.version type="java.lang.Integer"
+ * column="version"
+ */
+ public Integer getVersion() {
+ return this.version;
+ }
+
+ public void setVersion(Integer version) {
+ this.version = version;
+ }
+ /**
* @hibernate.property column="name" length="255" not-null="true"
* @return Returns the lessonName.
*/
@@ -399,6 +419,18 @@
}
/**
+ * @hibernate.property type="java.lang.Boolean" column="locked_for_edit"
+ * length="1"
+ */
+ public Boolean getLockedForEdit() {
+ return lockedForEdit;
+ }
+
+ public void setLockedForEdit(Boolean lockedForEdit) {
+ this.lockedForEdit = lockedForEdit;
+ }
+
+ /**
* @hibernate.many-to-one not-null="true" cascade="none"
* @hibernate.column name="learning_design_id"
*/
Index: lams_common/src/java/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml,v
diff -u -r1.7 -r1.8
--- lams_common/src/java/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml 26 Nov 2006 07:01:22 -0000 1.7
+++ lams_common/src/java/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml 9 May 2007 01:07:27 -0000 1.8
@@ -28,6 +28,7 @@
+
Index: lams_common/src/java/org/lamsfoundation/lams/lesson/dao/ILearnerProgressDAO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/lesson/dao/ILearnerProgressDAO.java,v
diff -u -r1.10 -r1.11
--- lams_common/src/java/org/lamsfoundation/lams/lesson/dao/ILearnerProgressDAO.java 17 Sep 2006 06:14:23 -0000 1.10
+++ lams_common/src/java/org/lamsfoundation/lams/lesson/dao/ILearnerProgressDAO.java 9 May 2007 01:07:27 -0000 1.11
@@ -23,6 +23,9 @@
/* $$Id$$ */
package org.lamsfoundation.lams.lesson.dao;
+import java.util.List;
+
+import org.lamsfoundation.lams.learningdesign.Activity;
import org.lamsfoundation.lams.lesson.LearnerProgress;
/**
@@ -64,4 +67,19 @@
* @param learnerProgress
*/
public void updateLearnerProgress(LearnerProgress learnerProgress);
-}
+
+ /**
+ * Get all the learner progress records where the current, previous or next activity is the given activity.
+ * @param activity
+ * @return List
+ */
+ public List getLearnerProgressReferringToActivity(final Activity activity);
+
+ /**
+ * Get all the learner progress records for a lesson where the progress is marked as completed.
+ * @param lessonId
+ * @return List
+ */
+ public List getCompletedLearnerProgressForLesson(final Long lessonId);
+
+ }
Index: lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LearnerProgressDAO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LearnerProgressDAO.java,v
diff -u -r1.12 -r1.13
--- lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LearnerProgressDAO.java 17 Sep 2006 06:14:17 -0000 1.12
+++ lams_common/src/java/org/lamsfoundation/lams/lesson/dao/hibernate/LearnerProgressDAO.java 9 May 2007 01:07:26 -0000 1.13
@@ -23,8 +23,13 @@
/* $$Id$$ */
package org.lamsfoundation.lams.lesson.dao.hibernate;
+import java.util.List;
+
+import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
+import org.hibernate.Query;
import org.hibernate.Session;
+import org.lamsfoundation.lams.learningdesign.Activity;
import org.lamsfoundation.lams.lesson.LearnerProgress;
import org.lamsfoundation.lams.lesson.dao.ILearnerProgressDAO;
import org.springframework.orm.hibernate3.HibernateCallback;
@@ -37,8 +42,17 @@
*/
public class LearnerProgressDAO extends HibernateDaoSupport implements ILearnerProgressDAO
{
- private final static String LOAD_PROGRESS_BY_LEARNER =
+
+ protected Logger log = Logger.getLogger(LearnerProgressDAO.class);
+
+ private final static String LOAD_PROGRESS_BY_LEARNER =
"from LearnerProgress p where p.user.id = :learnerId and p.lesson.id = :lessonId";
+ private final static String LOAD_PROGRESS_BY_ACTIVITY =
+ "from LearnerProgress p where p.previousActivity = :activity or p.currentActivity = :activity or p.nextActivity = :activity ";
+ // +
+ // "or activity in elements(p.previousActivity) or activity in elements(p.completedActivities)";
+ private final static String LOAD_COMPLETED_PROGRESS_BY_LESSON =
+ "from LearnerProgress p where p.lessonComplete = true and p.lesson.id = :lessonId";
/**
* Retrieves the Lesson
@@ -96,4 +110,50 @@
{
this.getHibernateTemplate().update(learnerProgress);
}
+
+ /**
+ * Get all the learner progress records where the current, previous or next activity is the given activity.
+ * @param activity
+ * @return List
+ */
+ public List getLearnerProgressReferringToActivity(final Activity activity)
+ {
+ HibernateTemplate hibernateTemplate = new HibernateTemplate(this.getSessionFactory());
+
+ return (List)hibernateTemplate.execute(
+ new HibernateCallback()
+ {
+ public Object doInHibernate(Session session) throws HibernateException
+ {
+ return session.createQuery(LOAD_PROGRESS_BY_ACTIVITY)
+ .setEntity("activity",activity)
+ .list();
+ }
+ }
+ );
+ }
+
+ /**
+ * Get all the learner progress records for a lesson where the progress is marked as completed.
+ * @param lessonId
+ * @return List
+ */
+ public List getCompletedLearnerProgressForLesson(final Long lessonId)
+ {
+ HibernateTemplate hibernateTemplate = new HibernateTemplate(this.getSessionFactory());
+ log.debug("Hibernate template is "+hibernateTemplate);
+
+ return (List)hibernateTemplate.execute(
+ new HibernateCallback()
+ {
+ public Object doInHibernate(Session session) throws HibernateException
+ {
+ return session.createQuery(LOAD_COMPLETED_PROGRESS_BY_LESSON)
+ .setLong("lessonId",lessonId)
+ .list();
+ }
+ }
+ );
+ }
+
}
Index: lams_common/src/java/org/lamsfoundation/lams/lesson/dto/LessonDetailsDTO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/lesson/dto/LessonDetailsDTO.java,v
diff -u -r1.13 -r1.14
--- lams_common/src/java/org/lamsfoundation/lams/lesson/dto/LessonDetailsDTO.java 16 Nov 2006 01:04:50 -0000 1.13
+++ lams_common/src/java/org/lamsfoundation/lams/lesson/dto/LessonDetailsDTO.java 9 May 2007 01:07:26 -0000 1.14
@@ -56,6 +56,7 @@
private Integer numberPossibleLearners;
private Integer numberStartedLearners;
private Boolean learnerExportAvailable;
+ private Boolean locked_for_edit;
/** Create the DTO based on the lesson. Sets up all the fields except numberStartedLearners */
public LessonDetailsDTO(Lesson lesson){
@@ -113,6 +114,8 @@
this.numberStartedLearners = new Integer(0);
this.learnerExportAvailable = lesson.getLearnerExportAvailable();
+
+ this.locked_for_edit = lesson.getLockedForEdit();
}
public Date getScheduleEndDate() {
return scheduleEndDate;
@@ -233,4 +236,7 @@
public Boolean getLearnerExportAvailable() {
return learnerExportAvailable;
}
+ public Boolean getLockedForEdit() {
+ return locked_for_edit;
+ }
}
Index: lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java,v
diff -u -r1.10 -r1.11
--- lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java 29 Nov 2006 04:02:26 -0000 1.10
+++ lams_common/src/java/org/lamsfoundation/lams/lesson/service/ILessonService.java 9 May 2007 01:07:27 -0000 1.11
@@ -27,6 +27,7 @@
import java.util.Collection;
import java.util.List;
+import org.lamsfoundation.lams.learningdesign.Activity;
import org.lamsfoundation.lams.learningdesign.GroupingActivity;
import org.lamsfoundation.lams.lesson.Lesson;
import org.lamsfoundation.lams.lesson.dto.LessonDTO;
@@ -199,4 +200,20 @@
* @param users the users to add as learners
*/
public void addStaffMembers(Lesson lesson, Collection users) throws LessonServiceException;
+
+ /**
+ * Remove references to an activity from all learner progress entries.
+ * Used by Live Edit, to remove any references to the system gates
+ * @param activity The activity for which learner progress references should be removed.
+ */
+ public void removeProgressReferencesToActivity(Activity activity) throws LessonServiceException;
+
+ /**
+ * Mark any learner progresses for this lesson as not completed. Called when Live Edit
+ * ends, to ensure that if there were any completed progress records, and the design
+ * was extended, then they are no longer marked as completed.
+ * @param lessonId The lesson for which learner progress entries should be updated.
+ */
+ public void performMarkLessonUncompleted(Long lessonId) throws LessonServiceException;
+
}
\ No newline at end of file
Index: lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java,v
diff -u -r1.13 -r1.14
--- lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java 29 Nov 2006 04:02:26 -0000 1.13
+++ lams_common/src/java/org/lamsfoundation/lams/lesson/service/LessonService.java 9 May 2007 01:07:27 -0000 1.14
@@ -26,19 +26,23 @@
import java.util.Collection;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.apache.log4j.Logger;
import org.lamsfoundation.lams.dao.IBaseDAO;
+import org.lamsfoundation.lams.learningdesign.Activity;
import org.lamsfoundation.lams.learningdesign.Group;
import org.lamsfoundation.lams.learningdesign.Grouper;
import org.lamsfoundation.lams.learningdesign.Grouping;
import org.lamsfoundation.lams.learningdesign.GroupingActivity;
import org.lamsfoundation.lams.learningdesign.dao.IGroupingDAO;
import org.lamsfoundation.lams.learningdesign.exception.GroupingException;
+import org.lamsfoundation.lams.lesson.LearnerProgress;
import org.lamsfoundation.lams.lesson.Lesson;
import org.lamsfoundation.lams.lesson.LessonClass;
+import org.lamsfoundation.lams.lesson.dao.ILearnerProgressDAO;
import org.lamsfoundation.lams.lesson.dao.ILessonClassDAO;
import org.lamsfoundation.lams.lesson.dao.ILessonDAO;
import org.lamsfoundation.lams.lesson.dto.LessonDTO;
@@ -76,6 +80,7 @@
private IGroupingDAO groupingDAO;
private MessageService messageService;
private IBaseDAO baseDAO;
+ private ILearnerProgressDAO learnerProgressDAO;
/* ******* Spring injection methods ***************************************/
public void setLessonDAO(ILessonDAO lessonDAO) {
@@ -90,6 +95,9 @@
this.groupingDAO = groupingDAO;
}
+ public void setLearnerProgressDAO(ILearnerProgressDAO learnerProgressDAO) {
+ this.learnerProgressDAO = learnerProgressDAO;
+ }
public void setMessageService(MessageService messageService) {
this.messageService = messageService;
@@ -488,4 +496,91 @@
}
}
+ /**
+ * Remove references to an activity from all learner progress entries.
+ * Used by Live Edit, to remove any references to the system gates
+ * @param activity The activity for which learner progress references should be removed.
+ */
+ public void removeProgressReferencesToActivity(Activity activity) throws LessonServiceException {
+ if ( activity != null ) {
+ log.debug("Processing learner progress for activity "+activity.getActivityId());
+
+ List progresses = learnerProgressDAO.getLearnerProgressReferringToActivity(activity);
+ if ( progresses != null && progresses.size()>0) {
+ Iterator iter = progresses.iterator();
+ while ( iter.hasNext() ) {
+ LearnerProgress progress = (LearnerProgress) iter.next();
+ if ( removeActivityReference(activity, progress) );
+ learnerProgressDAO.updateLearnerProgress(progress);
+ }
+ }
+ }
+ }
+
+ private boolean removeActivityReference(Activity activity, LearnerProgress progress) {
+
+ if ( log.isDebugEnabled() ) {
+ log.debug("Processing learner progress learner "+progress.getUser().getUserId());
+ }
+
+ boolean recordUpdated = false;
+
+ boolean removed = progress.getAttemptedActivities().remove(activity);
+ if ( removed ) {
+ recordUpdated = true;
+ log.debug("Removed activity from attempted activities");
+ }
+
+ removed = progress.getCompletedActivities().remove(activity);
+ if ( removed ) {
+ recordUpdated = true;
+ log.debug("Removed activity from completed activities");
+ }
+
+ if ( progress.getCurrentActivity() != null && progress.getCurrentActivity().equals(activity) ) {
+ progress.setCurrentActivity(null);
+ recordUpdated = true;
+ log.debug("Removed activity as current activity");
+ }
+
+ if ( progress.getNextActivity() != null && progress.getNextActivity().equals(activity) ) {
+ progress.setNextActivity(null);
+ recordUpdated = true;
+ log.debug("Removed activity as next activity");
+ }
+
+ if ( progress.getPreviousActivity() != null && progress.getPreviousActivity().equals(activity) ) {
+ progress.setPreviousActivity(null);
+ recordUpdated = true;
+ log.debug("Removed activity as previous activity");
+ }
+
+ return recordUpdated;
+ }
+
+ /**
+ * Mark any learner progresses for this lesson as not completed. Called when Live Edit
+ * ends, to ensure that if there were any completed progress records, and the design
+ * was extended, then they are no longer marked as completed.
+ * @param lessonId The lesson for which learner progress entries should be updated.
+ */
+ public void performMarkLessonUncompleted(Long lessonId) throws LessonServiceException {
+ int count = 0;
+ if ( lessonId != null ) {
+ log.debug("Setting learner progress to uncompleted for lesson "+lessonId);
+
+ List progresses = learnerProgressDAO.getCompletedLearnerProgressForLesson(lessonId);
+ if ( progresses != null && progresses.size()>0) {
+ Iterator iter = progresses.iterator();
+ while ( iter.hasNext() ) {
+ LearnerProgress progress = (LearnerProgress) iter.next();
+ progress.setLessonComplete(false);
+ count++;
+ }
+ }
+ }
+ if ( log.isDebugEnabled() )
+ log.debug("Reset completed flag for "+count+" learners for lesson "+lessonId);
+ }
+
}
Index: lams_common/src/java/org/lamsfoundation/lams/tool/SystemTool.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/SystemTool.java,v
diff -u -r1.5 -r1.6
--- lams_common/src/java/org/lamsfoundation/lams/tool/SystemTool.java 17 Sep 2006 06:14:16 -0000 1.5
+++ lams_common/src/java/org/lamsfoundation/lams/tool/SystemTool.java 9 May 2007 01:07:24 -0000 1.6
@@ -45,6 +45,7 @@
public static final Long SYNC_GATE = new Long(2);
public static final Long SCHEDULE_GATE = new Long(3);
public static final Long PERMISSION_GATE = new Long(4);
+ public static final Long SYSTEM_GATE = new Long(5);
/** identifier field */
private Long systemToolId;
Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java,v
diff -u -r1.16 -r1.17
--- lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java 18 Oct 2006 02:22:12 -0000 1.16
+++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java 9 May 2007 01:07:24 -0000 1.17
@@ -55,22 +55,24 @@
* should already exist in the tool. This method will normally be
* called after copyToolContent.
* @param toolContentId the tool content id of the tool content to be changed.
+ * @param value whether to set or unset define later.
* @throws DataMissingException if no tool content matches the toolContentId
* @throws ToolException if any other error occurs
*/
- public void setAsDefineLater(Long toolContentId)
+ public void setAsDefineLater(Long toolContentId, boolean value)
throws DataMissingException, ToolException;
- /** This tool content should be setup to run offline, that is, the
+ /** This tool content should be setup to run offline, that is, the
* activity will be done offline. The toolContentId
* should already exist in the tool. This method will normally be
* called after copyToolContent.
* @param toolContentId the tool content id of the tool content to be changed.
+ * @param value whether to set or unset run offline.
* @throws DataMissingException if no tool content matches the toolContentId
* @throws ToolException if any other error occurs
*/
- public void setAsRunOffline(Long toolContentId)
+ public void setAsRunOffline(Long toolContentId, boolean value)
throws DataMissingException, ToolException;
/**
Index: lams_common/src/java/org/lamsfoundation/lams/tool/dao/IToolSessionDAO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/dao/IToolSessionDAO.java,v
diff -u -r1.12 -r1.13
--- lams_common/src/java/org/lamsfoundation/lams/tool/dao/IToolSessionDAO.java 17 Sep 2006 06:14:17 -0000 1.12
+++ lams_common/src/java/org/lamsfoundation/lams/tool/dao/IToolSessionDAO.java 9 May 2007 01:07:27 -0000 1.13
@@ -66,6 +66,14 @@
*/
public List getToolSessionsByLesson(final Lesson lesson);
+ /**
+ * Get the tool session by activity. A class-grouped activity should have only one tool session,
+ * per activity but a proper grouped activity or an individial activity may have more
+ * than one tool sesssion.
+ * @see org.lamsfoundation.lams.tool.dao.IToolSessionDAO#getToolSessionByActivity(org.lamsfoundation.lams.learningdesign.Activity)
+ * @returns List of toolSessions, may be of subclass NonGroupedToolSession or GroupedToolSession
+ */
+ public List getToolSessionByActivity(final Activity activity);
public void updateToolSession(ToolSession toolSession);
}
Index: lams_common/src/java/org/lamsfoundation/lams/tool/dao/hibernate/ToolSessionDAO.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/dao/hibernate/ToolSessionDAO.java,v
diff -u -r1.15 -r1.16
--- lams_common/src/java/org/lamsfoundation/lams/tool/dao/hibernate/ToolSessionDAO.java 17 Sep 2006 06:14:22 -0000 1.15
+++ lams_common/src/java/org/lamsfoundation/lams/tool/dao/hibernate/ToolSessionDAO.java 9 May 2007 01:07:25 -0000 1.16
@@ -49,6 +49,8 @@
protected static final String LOAD_GROUPED_TOOL_SESSION_BY_GROUP2 =
"select s from GroupedToolSession as s inner join s.sessionGroup as sg inner join sg.users as u "
+" where :learner = u and s.toolActivity = :activity";
+ protected static final String LOAD_TOOL_SESSION_BY_ACTIVITY =
+ "from ToolSession s where s.toolActivity = :activity";
protected static final String LOAD_TOOL_SESSION_BY_LESSON =
"from ToolSession s where s.lesson = :lesson";
@@ -88,6 +90,21 @@
}
+ /**
+ * Get the tool session by activity. A class-grouped activity should have only one tool session,
+ * per activity but a proper grouped activity or an individial activity may have more
+ * than one tool sesssion.
+ * @see org.lamsfoundation.lams.tool.dao.IToolSessionDAO#getToolSessionByActivity(org.lamsfoundation.lams.learningdesign.Activity)
+ * @returns List of toolSessions, may be of subclass NonGroupedToolSession or GroupedToolSession
+ */
+ public List getToolSessionByActivity(final Activity activity)
+ {
+ Query query = this.getSession().createQuery(LOAD_TOOL_SESSION_BY_ACTIVITY);
+ query.setParameter("activity",activity);
+ return (List) query.list();
+ }
+
+
public void saveToolSession(ToolSession toolSession)
{
getHibernateTemplate().save(toolSession);
Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java,v
diff -u -r1.17 -r1.18
--- lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java 17 Sep 2006 06:14:22 -0000 1.17
+++ lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java 9 May 2007 01:07:26 -0000 1.18
@@ -120,24 +120,39 @@
throws ToolException;
/**
- * Notify a tool to make a copy of its own content. Lams needs to dynamically
- * load tool's service by request and invoke the copy method from tool
- * content manager.
- *
+ * Calls the tool to copy the content for an activity. Used when copying a learning design.
* If it is a preview lesson, we don't want to set define later - we will sidestep this in the progress engine.
- * @param toolActivity the requested tool activity.
- * @param setDefineLater do we tell the tool to set its define later flag?
- * @return new tool content id.
+ *
+ * @param toolActivity the tool activity defined in the design.
+ * @param setDefineLater whether or not to set the define later flag.
+ * @throws DataMissingException, ToolException
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#notifyToolToCopyContent(org.lamsfoundation.lams.learningdesign.ToolActivity)
*/
- public Long notifyToolToCopyContent(ToolActivity toolActivity, boolean setDefineLater)
- throws DataMissingException, ToolException;
+ public Long notifyToolToCopyContent(ToolActivity toolActivity, boolean setDefineLater)
+ throws DataMissingException, ToolException;
/**
+ * Calls the tool to set up the define later and run offline flags.
+ *
+ * This method is a subset of the functionality of notifyToolToCopyContent(ToolActivity toolActivity, boolean setDefineLater);
+ * so if you call notifyToolToCopyContent then you don't need to call this method. It is a separate method used by Live Edit.
+ *
+ * @param toolActivity the tool activity defined in the design.
+ * @throws DataMissingException, ToolException
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#notifyToolToCopyContent(org.lamsfoundation.lams.learningdesign.ToolActivity)
+ */
+ public Long notifyToolOfStatusFlags(ToolActivity toolActivity)
+ throws DataMissingException, ToolException;
+
+ /**
* Calls the tool to copy the content for an activity. Used when copying an activity in authoring. Can't
* use the notifyToolToCopyContent(ToolActivity, boolean) version in authoring as the tool activity won't
* exist if the user hasn't saved the sequence yet. But the tool content (as that is saved by the
* tool) may already exist.
*
+ * This doesn't set the define later and run offline flags from the design - it only copies the content
+ * stored in the tool.
+ *
* @param toolContentId the content to be copied.
* @throws DataMissingException, ToolException
* @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#notifyToolToCopyContent(org.lamsfoundation.lams.learningdesign.ToolActivity)
Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java,v
diff -u -r1.30 -r1.31
--- lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java 17 Sep 2006 06:14:22 -0000 1.30
+++ lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java 9 May 2007 01:07:25 -0000 1.31
@@ -205,39 +205,62 @@
}
/**
* Calls the tool to copy the content for an activity. Used when copying a learning design.
- * If it is a preview lesson, we don't want to set define later - we will sidestep this in the progress engine.
+ * If it is a preview lesson, we don't want to set define later to true - we will sidestep this in the progress engine.
*
* @param toolActivity the tool activity defined in the design.
+ * @param setDefineLater whether or not to set the define later flag based on the activity in the design. If set to true
+ * then will take the value fro the activity. If set to false, then define later will always be set to false.
* @throws DataMissingException, ToolException
* @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#notifyToolToCopyContent(org.lamsfoundation.lams.learningdesign.ToolActivity)
*/
public Long notifyToolToCopyContent(ToolActivity toolActivity, boolean setDefineLater)
throws DataMissingException, ToolException
{
- Long newToolcontentID = contentIDGenerator.getNextToolContentIDFor(toolActivity.getTool());
+ return notifyToToolAboutContent(toolActivity, setDefineLater, true);
+ }
+
+ private Long notifyToToolAboutContent(ToolActivity toolActivity, boolean setDefineLater, boolean copyToolContent) {
+ Long toolcontentID = toolActivity.getToolContentId();
try {
ToolContentManager contentManager = (ToolContentManager) findToolService(toolActivity.getTool());
- contentManager.copyToolContent(toolActivity.getToolContentId(),
- newToolcontentID);
-
- if ( setDefineLater && toolActivity.getDefineLater() != null &&
- toolActivity.getDefineLater().booleanValue() ) {
- contentManager.setAsDefineLater(newToolcontentID);
- }
- if ( toolActivity.getRunOffline() != null &&
- toolActivity.getRunOffline().booleanValue() ) {
- contentManager.setAsRunOffline(newToolcontentID);
+
+ if ( copyToolContent ) {
+ toolcontentID = contentIDGenerator.getNextToolContentIDFor(toolActivity.getTool());
+ contentManager.copyToolContent(toolActivity.getToolContentId(), toolcontentID);
}
+
+ contentManager.setAsDefineLater(toolcontentID,
+ setDefineLater && toolActivity.getDefineLater() != null && toolActivity.getDefineLater().booleanValue());
+
+ contentManager.setAsRunOffline(toolcontentID,
+ toolActivity.getRunOffline() != null && toolActivity.getRunOffline().booleanValue());
+
} catch ( NoSuchBeanDefinitionException e ) {
- String message = "A tool which is defined in the database appears to missing from the classpath. Unable to copy the tool content. ToolActivity "+toolActivity;
+ String message = "A tool which is defined in the database appears to missing from the classpath. Unable to copy/update the tool content. ToolActivity "+toolActivity;
log.error(message,e);
throw new ToolException(message,e);
}
- return newToolcontentID;
+ return toolcontentID;
}
/**
+ * Calls the tool to set up the define later and run offline flags.
+ *
+ * This method is a subset of the functionality of notifyToolToCopyContent(ToolActivity toolActivity, boolean setDefineLater);
+ * so if you call notifyToolToCopyContent then you don't need to call this method. It is a separate method used by Live Edit.
+ *
+ * @param toolActivity the tool activity defined in the design.
+ * @throws DataMissingException, ToolException
+ * @see org.lamsfoundation.lams.tool.service.ILamsCoreToolService#notifyToolToCopyContent(org.lamsfoundation.lams.learningdesign.ToolActivity)
+ */
+ public Long notifyToolOfStatusFlags(ToolActivity toolActivity)
+ throws DataMissingException, ToolException
+ {
+ return notifyToToolAboutContent(toolActivity, true, false);
+ }
+
+ /**
* Calls the tool to copy the content for an activity. Used when copying an activity in authoring. Can't
* use the notifyToolToCopyContent(ToolActivity, boolean) version in authoring as the tool activity won't
* exist if the user hasn't saved the sequence yet. But the tool content (as that is saved by the
Index: lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationKeys.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationKeys.java,v
diff -u -r1.23 -r1.24
--- lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationKeys.java 17 Nov 2006 03:11:25 -0000 1.23
+++ lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationKeys.java 9 May 2007 01:07:22 -0000 1.24
@@ -34,6 +34,7 @@
public static String ROOT = "Lams";
public static String SERVER_URL = "ServerURL";
+ public static String SERVER_URL_CONTEXT_PATH = "ServerURLContextPath";
public static String VERSION = "Version";
@@ -131,4 +132,6 @@
public static String ALLOW_DIRECT_LESSON_LAUNCH = "AllowDirectLessonLaunch";
public static String LAMS_COMMUNITY_ENABLE = "LAMS_Community_enable";
+
+ public static String ALLOW_EDIT_ON_FLY = "AllowLiveEdit";
}
\ No newline at end of file
Index: lams_common/src/java/org/lamsfoundation/lams/util/wddx/FlashMessage.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/wddx/FlashMessage.java,v
diff -u -r1.15 -r1.16
--- lams_common/src/java/org/lamsfoundation/lams/util/wddx/FlashMessage.java 17 Jan 2007 01:16:51 -0000 1.15
+++ lams_common/src/java/org/lamsfoundation/lams/util/wddx/FlashMessage.java 9 May 2007 01:07:25 -0000 1.16
@@ -186,5 +186,9 @@
return new FlashMessage(methodName, str, FlashMessage.ERROR);
}
-
+ public static FlashMessage getUnavailableLearningDesign(String methodName, Long designID, Integer userID){
+ return new FlashMessage(methodName,
+ "The design with learning_design_id: " + designID + " is unavailable for edit by User with user_id of :" + userID,
+ ERROR);
+ }
}
Index: lams_common/src/java/org/lamsfoundation/lams/util/wddx/WDDXTAGS.java
===================================================================
RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/wddx/WDDXTAGS.java,v
diff -u -r1.15 -r1.16
--- lams_common/src/java/org/lamsfoundation/lams/util/wddx/WDDXTAGS.java 17 Sep 2006 06:14:17 -0000 1.15
+++ lams_common/src/java/org/lamsfoundation/lams/util/wddx/WDDXTAGS.java 9 May 2007 01:07:25 -0000 1.16
@@ -150,8 +150,10 @@
public static final String MAX_ID ="maxID";
public static final String VALID_DESIGN ="validDesign";
public static final String READ_ONLY ="readOnly";
+ public static final String EDIT_OVERRIDE_LOCK ="editOverrideLock";
public static final String DATE_READ_ONLY ="dateReadOnly";
public static final String USER_ID="userID";
+ public static final String EDIT_OVERRIDE_USER_ID="editOverrideUserID";
public static final String COPY_TYPE="copyTypeID";
public static final String CREATION_DATE ="createDateTime";
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/monitoringApplicationContext.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/monitoringApplicationContext.xml,v
diff -u -r1.24 -r1.25
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/monitoringApplicationContext.xml 16 Nov 2006 01:09:25 -0000 1.24
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/monitoringApplicationContext.xml 9 May 2007 01:01:27 -0000 1.25
@@ -64,6 +64,7 @@
PROPAGATION_REQUIREDPROPAGATION_REQUIREDPROPAGATION_REQUIRED
+ PROPAGATION_REQUIREDPROPAGATION_REQUIREDPROPAGATION_REQUIREDPROPAGATION_REQUIRES_NEW
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java,v
diff -u -r1.15 -r1.16
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java 17 Sep 2006 06:19:29 -0000 1.15
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java 9 May 2007 01:01:27 -0000 1.16
@@ -236,7 +236,7 @@
return viewSynchGate(mapping,gateForm,(SynchGateActivity)gate);
else if(gate.isScheduleGate())
return viewScheduleGate(mapping,gateForm,(ScheduleGateActivity)gate);
- else if(gate.isPermissionGate())
+ else if(gate.isPermissionGate() || gate.isSystemGate())
return viewPermissionGate(mapping,gateForm,(PermissionGateActivity)gate);
else
throw new MonitoringServiceException("Invalid gate activity. " +
Index: lams_monitoring/web/monitorLesson.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_monitoring/web/Attic/monitorLesson.jsp,v
diff -u -r1.14 -r1.15
--- lams_monitoring/web/monitorLesson.jsp 21 Dec 2006 04:49:47 -0000 1.14
+++ lams_monitoring/web/monitorLesson.jsp 9 May 2007 01:01:46 -0000 1.15
@@ -51,6 +51,8 @@
openURL(args);
}else if(command == "closeWindowRefresh") {
closeWindowRefresh();
+ }else if(command == "openAuthorForEditOnFly") {
+ openAuthorForEditOnFly(args);
}
}
@@ -108,6 +110,10 @@
closeWindow();
}
+ function openAuthorForEditOnFly(learningDesignID) {
+ window.opener.openAuthorForEditOnFly(learningDesignID);
+ }
+
function openURL(args){
window.open(args, "_blank");
}
@@ -124,10 +130,11 @@
String languageDate = Configuration.get(ConfigurationKeys.DICTIONARY_DATE_CREATED);
String actColour = Configuration.get(ConfigurationKeys.AUTHORING_ACTS_COLOUR);
String allowDirectLessonLaunch = Configuration.get(ConfigurationKeys.ALLOW_DIRECT_LESSON_LAUNCH);
+String allowEditOnFly = Configuration.get(ConfigurationKeys.ALLOW_EDIT_ON_FLY);
%>
<%-- lessonID is passed in as request parameters by addLesson.jsp in lams_central. --%>
- ?loadFile=monitoring/lams_monitoring.swf&loadLibrary=monitoring/lams_monitoring_library.swf&userID=&serverURL=&build=<%=clientVersion%>&lang=&country=&langDate=<%=languageDate%>&theme=&lessonID=&actColour=<%= actColour %>&lessonLaunch=<%=allowDirectLessonLaunch%>
+ ?loadFile=monitoring/lams_monitoring.swf&loadLibrary=monitoring/lams_monitoring_library.swf&userID=&serverURL=&build=<%=clientVersion%>&lang=&country=&langDate=<%=languageDate%>&theme=&lessonID=&actColour=<%= actColour %>&lessonLaunch=<%=allowDirectLessonLaunch%>&editOnFly=<%=allowEditOnFly%>../lams_preloader../lams_preloader.swf
Index: lams_monitoring/web/WEB-INF/lams.tld
===================================================================
RCS file: /usr/local/cvsroot/lams_monitoring/web/WEB-INF/Attic/lams.tld,v
diff -u -r1.10 -r1.11
--- lams_monitoring/web/WEB-INF/lams.tld 6 Dec 2006 03:54:14 -0000 1.10
+++ lams_monitoring/web/WEB-INF/lams.tld 9 May 2007 01:01:39 -0000 1.11
@@ -434,5 +434,35 @@
ImgButtonWrapper/WEB-INF/tags/ImgButtonWrapper.tag
+
+ textarea
+ org.lamsfoundation.lams.web.tag.LAMSMultiLinesTextareaTag
+ JSP
+ true
+
+ Render text exactly same as original input, which even won't escape the input HTML tag.
+
+
+
+
+ name
+ true
+ true
+
+
+
+
+ id
+ false
+ true
+
+
+
+
+ onchange
+ false
+ true
+
+