Index: lams_common/build.xml =================================================================== RCS file: /usr/local/cvsroot/lams_common/build.xml,v diff -u -r1.28 -r1.29 --- lams_common/build.xml 26 May 2005 06:32:11 -0000 1.28 +++ lams_common/build.xml 21 Aug 2005 23:56:24 -0000 1.29 @@ -47,7 +47,7 @@ - + @@ -203,6 +203,7 @@ + @@ -330,7 +331,7 @@ - + Index: lams_common/conf/create_lams_11_tables.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/conf/Attic/create_lams_11_tables.sql,v diff -u Binary files differ Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml,v diff -u -r1.19 -r1.20 --- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml 6 Apr 2005 05:02:57 -0000 1.19 +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/Activity.hbm.xml 21 Aug 2005 23:47:24 -0000 1.20 @@ -59,15 +59,6 @@ @hibernate.property column="create_date_time" length="19" not-null="true" - - @hibernate.property column="offline_instructions" length="65535" - - - - @hibernate.property column="online_instructions" length="65535" - - - @hibernate.property column="run_offline_flag" length="4" not-null="true" 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.8 -r1.9 --- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml 17 Apr 2005 23:11:18 -0000 1.8 +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/learningdesign/LearningDesign.hbm.xml 21 Aug 2005 23:47:24 -0000 1.9 @@ -154,6 +154,15 @@ @hibernate.property column ="last_modified_date_time" + + @hibernate.property column="offline_instructions" length="65535" + + + + @hibernate.property column="online_instructions" length="65535" + + + Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSProperty.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/Attic/CSSProperty.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSProperty.hbm.xml 21 Aug 2005 23:47:24 -0000 1.1 @@ -0,0 +1,99 @@ + + + + + + + + + @hibernate.class + table="lams_css_property" + + + + + @hibernate.id + generator-class="native" + type="java.lang.Long" + column="property_id" + + + + + + + + + @hibernate.property + column="name" + length="255" + not-null="true" + + + + + @hibernate.property + column="value" + length="100" + not-null="true" + + + + + @hibernate.property + column="type" + length="4" + not-null="true" + + + + + @hibernate.property + column="style_subset" + length="20" + not-null="true" + + + + + + + Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSStyle.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/Attic/CSSStyle.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSStyle.hbm.xml 21 Aug 2005 23:47:24 -0000 1.1 @@ -0,0 +1,93 @@ + + + + + + + + + + @hibernate.class + table="lams_css_style" + + + + + @hibernate.id + generator-class="native" + type="java.lang.Long" + column="style_id" + + + + true + + + + + + + + + + @hibernate.set + lazy="false" + inverse="true" + cascade="all-delete-orphan" + + @hibernate.collection-key + column="style_id" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.themes.CSSProperty" + + + + + + + + + + + + @hibernate.many-to-one + not-null="true" + cascade="none" + update="true" + insert="true" + @hibernate.column name="theme_ve_id" + + + + + + + + + Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSThemeVisualElement.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/Attic/CSSThemeVisualElement.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/themes/CSSThemeVisualElement.hbm.xml 21 Aug 2005 23:47:24 -0000 1.1 @@ -0,0 +1,183 @@ + + + + + + + + + + @hibernate.class + table="lams_css_theme_ve" + + + + + @hibernate.id + generator-class="native" + type="java.lang.Long" + column="theme_ve_id" + + + + true + + + + + true + + @hibernate.property + column="name" + length="100" + not-null="true" + + + + true + + @hibernate.property + column="description" + length="100" + + + + true + + @hibernate.property + column="theme_flag" + length="1" + not-null="true" + + + + + + + + + @hibernate.set + lazy="true" + inverse="true" + cascade="none" + @hibernate.collection-key + column="theme_id" + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.usermanagement.User" + + + + + + + + + + + + @hibernate.set + lazy="true" + inverse="true" + cascade="all-delete-orphan" + + @hibernate.collection-key + column="theme_ve_id" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.themes.CSSStyle" + + + + + + + + + + @hibernate.set + lazy="true" + inverse="true" + cascade="all-delete-orphan" + + @hibernate.collection-key + column="parent_id" + + @hibernate.collection-one-to-many + class="org.lamsfoundation.lams.themes.CSSThemeVisualElement" + + + + + + + + + + @hibernate.many-to-one + not-null="true" + cascade="none" + update="true" + insert="true" + @hibernate.column name="parent_id" + + + + + + Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/Tool.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/Tool.hbm.xml,v diff -u -r1.5 -r1.6 --- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/Tool.hbm.xml 6 Apr 2005 03:50:09 -0000 1.5 +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/tool/Tool.hbm.xml 21 Aug 2005 23:47:24 -0000 1.6 @@ -38,6 +38,36 @@ + + @hibernate.property + column="tool_identifier" + length="64" + not-null="true" + + + + + + @hibernate.property + column="tool_version" + length="10" + not-null="true" + + + + + + + + @hibernate.many-to-one + not-null="true" + @hibernate.column name="theme_id" + + + + - + @@ -77,7 +77,7 @@
- + @@ -115,7 +115,7 @@
- + @@ -153,7 +153,7 @@
- + @@ -191,7 +191,7 @@
- + @@ -426,18 +426,6 @@ - - - - - - - - - - - - @@ -733,7 +721,7 @@
- + @@ -771,7 +759,7 @@
- + @@ -889,6 +877,18 @@ + + + + + + + + + + + + @@ -1089,7 +1089,7 @@
- + @@ -1158,7 +1158,7 @@
- + @@ -1279,7 +1279,7 @@
- + @@ -1342,7 +1342,7 @@
- + @@ -1504,7 +1504,7 @@
- + @@ -1628,7 +1628,7 @@
- + @@ -1677,7 +1677,7 @@
- + @@ -1731,7 +1731,7 @@
- + @@ -1916,6 +1916,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1944,6 +1973,13 @@ + + + + + + + @@ -1970,7 +2006,7 @@
- + @@ -2050,7 +2086,7 @@
- + @@ -2130,7 +2166,7 @@
- + @@ -2193,7 +2229,7 @@
- + @@ -2314,7 +2350,7 @@
- + @@ -2484,7 +2520,7 @@
- + @@ -2662,7 +2698,7 @@
- + @@ -2678,7 +2714,7 @@ - +Unique signature for each version of a tool. <organisation><tool><version> @@ -2704,6 +2740,21 @@ + +Unique identifier for the tool. This should remain the same for every version of the tool. +It will be used for the IMS LD import/export. + + + + + + +Version of tool. Expected to be in format [major version.minor version] eg 1.2 + + + + + @@ -2891,7 +2942,7 @@
- + @@ -3009,27 +3060,13 @@ - - - - - - - - - - - - - - @@ -3051,12 +3088,19 @@ + + + + + + +
- + @@ -3111,7 +3155,7 @@
- + @@ -3166,7 +3210,7 @@
- + @@ -3199,7 +3243,7 @@
- + @@ -3254,7 +3298,7 @@
- + @@ -3287,7 +3331,7 @@
- + @@ -3334,7 +3378,7 @@
- + @@ -3387,7 +3431,7 @@
- + @@ -3440,7 +3484,7 @@
- + @@ -3473,7 +3517,7 @@
- + @@ -3540,7 +3584,7 @@
- + @@ -3573,7 +3617,7 @@
- + @@ -3609,7 +3653,7 @@ The main lookup is done on name, but given the small number of rows a complete table scan should be fine. A name index would probably be about the same size as the table anyway. - + @@ -3644,7 +3688,7 @@ Like lams_cr_workspace, there will usually be 0 or 1 workspace for each tool in LAMS, so this should be a pretty small table. The main lookup is done on name, but given the small number of rows a complete table scan should be fine. - + @@ -3673,19 +3717,6 @@ - - - - - - - - - - - - - @@ -3697,7 +3728,7 @@
- + @@ -3767,7 +3798,7 @@ It is the node_id and version_id combination that is the "real" key for this table. - + @@ -3846,7 +3877,7 @@
- + @@ -3920,7 +3951,7 @@
A node can only belong to one parent - so each time a new version of a package is created, all the nodes are recreated. - + @@ -4026,7 +4057,7 @@
- + @@ -4059,7 +4090,7 @@
- + @@ -4092,7 +4123,7 @@
- + @@ -4178,7 +4209,7 @@
- + @@ -4211,7 +4242,7 @@
- + @@ -4316,7 +4347,20 @@ - + + + + + + + + + + + + + + @@ -4337,7 +4381,7 @@
- + @@ -4368,6 +4412,210 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +All the lams_css_property values matching this lams_css_style make up the CSSStyleDeclaration for this +style. It may be a "base" style for a theme, or it may be for a named visual element. +Each style may have a subset of properties, such as "_tf" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index: lams_common/db/sql/create_lams_11_tables.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/db/sql/create_lams_11_tables.sql,v diff -u -r1.47 -r1.48 --- lams_common/db/sql/create_lams_11_tables.sql 17 Jun 2005 01:53:18 -0000 1.47 +++ lams_common/db/sql/create_lams_11_tables.sql 21 Aug 2005 23:47:24 -0000 1.48 @@ -93,7 +93,6 @@ credential_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT , name VARCHAR(255) NOT NULL , password VARCHAR(255) NOT NULL - , wc_id BIGINT(20) UNSIGNED NOT NULL , PRIMARY KEY (credential_id) )TYPE=InnoDB; ALTER TABLE lams_cr_credential COMMENT='Records the identification properties for a tool.'; @@ -116,6 +115,12 @@ , PRIMARY KEY (log_event_type_id) )TYPE=InnoDB; +CREATE TABLE lams_workspace_folder_content_type ( + content_type_id INT(3) NOT NULL AUTO_INCREMENT + , description VARCHAR(64) NOT NULL + , PRIMARY KEY (content_type_id) +)TYPE=InnoDB; + CREATE TABLE lams_authentication_method_type ( authentication_method_type_id INT(3) NOT NULL , description VARCHAR(64) NOT NULL @@ -181,6 +186,42 @@ REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION )TYPE=InnoDB; +CREATE TABLE lams_css_theme_ve ( + theme_ve_id BIGINT(20) NOT NULL AUTO_INCREMENT + , name VARCHAR(100) NOT NULL + , description VARCHAR(100) + , parent_id BIGINT(20) + , theme_flag TINYINT(1) NOT NULL DEFAULT 0 + , PRIMARY KEY (theme_ve_id) + , INDEX (parent_id) + , CONSTRAINT FK_lams_css_theme_ve_2 FOREIGN KEY (parent_id) + REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; +ALTER TABLE lams_css_theme_ve COMMENT='Stores both the Flash theme and visual element'; + +CREATE TABLE lams_css_style ( + style_id BIGINT(20) NOT NULL AUTO_INCREMENT + , theme_ve_id BIGINT(20) NOT NULL + , PRIMARY KEY (style_id) + , INDEX (theme_ve_id) + , CONSTRAINT FK_lams_css_style_1 FOREIGN KEY (theme_ve_id) + REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; +ALTER TABLE lams_css_style COMMENT='Groups lams_css_property into a CSSStyleDeclaration.'; + +CREATE TABLE lams_css_property ( + property_id BIGINT(20) NOT NULL AUTO_INCREMENT + , style_id BIGINT(20) NOT NULL + , name VARCHAR(255) NOT NULL + , value VARCHAR(100) NOT NULL + , style_subset VARCHAR(20) + , type TINYINT NOT NULL + , PRIMARY KEY (property_id) + -- , INDEX (style_id) + -- , CONSTRAINT FK_lams_css_property_1 FOREIGN KEY (style_id) + -- REFERENCES lams_css_style (style_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + CREATE TABLE lams_user ( user_id BIGINT(20) NOT NULL AUTO_INCREMENT , login VARCHAR(20) NOT NULL @@ -204,6 +245,9 @@ , authentication_method_id BIGINT(20) NOT NULL DEFAULT 0 , workspace_id BIGINT(20) , base_organisation_id BIGINT(20) NOT NULL DEFAULT 0 + , locale_language CHAR(2) NOT NULL DEFAULT 'en' + , locale_country CHAR(2) + , theme_id BIGINT(20) , PRIMARY KEY (user_id) , INDEX (authentication_method_id) , CONSTRAINT FK_lams_user_1 FOREIGN KEY (authentication_method_id) @@ -213,7 +257,10 @@ REFERENCES lams_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION , INDEX (base_organisation_id) , CONSTRAINT FK_lams_user_3 FOREIGN KEY (base_organisation_id) - REFERENCES lams_organisation (organisation_id) + REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (theme_id) + , CONSTRAINT FK_lams_user_4 FOREIGN KEY (theme_id) + REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION )TYPE=InnoDB; CREATE UNIQUE INDEX UQ_lams_user_login ON lams_user (login ASC); CREATE INDEX login ON lams_user (login ASC); @@ -230,6 +277,8 @@ , date_read_only DATETIME , user_id BIGINT(20) NOT NULL , help_text TEXT + , online_instructions TEXT + , offline_instructions TEXT , copy_type_id TINYINT(4) NOT NULL , create_date_time DATETIME NOT NULL , version VARCHAR(56) @@ -287,57 +336,14 @@ REFERENCES lams_grouping (grouping_id) ON DELETE NO ACTION ON UPDATE NO ACTION )TYPE=InnoDB; -CREATE TABLE lams_user_organisation ( - user_organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT - , organisation_id BIGINT(20) NOT NULL - , user_id BIGINT(20) NOT NULL - , PRIMARY KEY (user_organisation_id) - , INDEX (organisation_id) - , CONSTRAINT FK_lams_user_organisation_1 FOREIGN KEY (organisation_id) - REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION - , INDEX (user_id) - , CONSTRAINT FK_lams_user_organisation_2 FOREIGN KEY (user_id) - REFERENCES lams_user (user_id) ON DELETE NO ACTION ON UPDATE NO ACTION -)TYPE=InnoDB; - -CREATE TABLE lams_lesson ( - lesson_id BIGINT(20) NOT NULL AUTO_INCREMENT - , learning_design_id BIGINT(20) NOT NULL - , user_id BIGINT(20) NOT NULL - , name VARCHAR(255) NOT NULL - , description TEXT - , create_date_time DATETIME NOT NULL - , organisation_id BIGINT(20) - , class_grouping_id BIGINT(20) - , lesson_state_id INT(3) NOT NULL - , start_date_time DATETIME - , schedule_start_date_time DATETIME - , end_date_time DATETIME - , schedule_end_date_time DATETIME - , PRIMARY KEY (lesson_id) - , INDEX (learning_design_id) - , CONSTRAINT FK_lams_lesson_1_1 FOREIGN KEY (learning_design_id) - REFERENCES lams_learning_design (learning_design_id) - , INDEX (user_id) - , CONSTRAINT FK_lams_lesson_2 FOREIGN KEY (user_id) - REFERENCES lams_user (user_id) - , INDEX (organisation_id) - , CONSTRAINT FK_lams_lesson_3 FOREIGN KEY (organisation_id) - REFERENCES lams_organisation (organisation_id) - , INDEX (lesson_state_id) - , CONSTRAINT FK_lams_lesson_4 FOREIGN KEY (lesson_state_id) - REFERENCES lams_lesson_state (lesson_state_id) - , INDEX (class_grouping_id) - , CONSTRAINT FK_lams_lesson_5 FOREIGN KEY (class_grouping_id) - REFERENCES lams_grouping (grouping_id) -)TYPE=InnoDB; - CREATE TABLE lams_tool ( tool_id BIGINT(20) NOT NULL AUTO_INCREMENT , tool_signature VARCHAR(64) NOT NULL , service_name VARCHAR(255) NOT NULL , tool_display_name VARCHAR(255) NOT NULL , description TEXT + , tool_identifier VARCHAR(64) NOT NULL + , tool_version VARCHAR(10) NOT NULL , learning_library_id BIGINT(20) , default_tool_content_id BIGINT(20) , valid_flag TINYINT(1) NOT NULL DEFAULT 1 @@ -386,8 +392,6 @@ , learning_library_id BIGINT(20) , create_date_time DATETIME NOT NULL , run_offline_flag TINYINT(1) NOT NULL - , offline_instructions TEXT - , online_instructions TEXT , max_number_of_options INT(5) , min_number_of_options INT(5) , options_instructions TEXT @@ -440,6 +444,52 @@ REFERENCES lams_grouping_support_type (grouping_support_type_id) )TYPE=InnoDB; +CREATE TABLE lams_lesson ( + lesson_id BIGINT(20) NOT NULL AUTO_INCREMENT + , learning_design_id BIGINT(20) NOT NULL + , user_id BIGINT(20) NOT NULL + , name VARCHAR(255) NOT NULL + , description TEXT + , create_date_time DATETIME NOT NULL + , organisation_id BIGINT(20) + , class_grouping_id BIGINT(20) + , lesson_state_id INT(3) NOT NULL + , start_date_time DATETIME + , schedule_start_date_time DATETIME + , end_date_time DATETIME + , schedule_end_date_time DATETIME + , PRIMARY KEY (lesson_id) + , INDEX (learning_design_id) + , CONSTRAINT FK_lams_lesson_1_1 FOREIGN KEY (learning_design_id) + REFERENCES lams_learning_design (learning_design_id) + , INDEX (user_id) + , CONSTRAINT FK_lams_lesson_2 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) + , INDEX (organisation_id) + , CONSTRAINT FK_lams_lesson_3 FOREIGN KEY (organisation_id) + REFERENCES lams_organisation (organisation_id) + , INDEX (lesson_state_id) + , CONSTRAINT FK_lams_lesson_4 FOREIGN KEY (lesson_state_id) + REFERENCES lams_lesson_state (lesson_state_id) + , INDEX (class_grouping_id) + , CONSTRAINT FK_lams_lesson_5 FOREIGN KEY (class_grouping_id) + REFERENCES lams_grouping (grouping_id) +)TYPE=InnoDB; + + +CREATE TABLE lams_user_organisation ( + user_organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT + , organisation_id BIGINT(20) NOT NULL + , user_id BIGINT(20) NOT NULL + , PRIMARY KEY (user_organisation_id) + , INDEX (organisation_id) + , CONSTRAINT FK_lams_user_organisation_1 FOREIGN KEY (organisation_id) + REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (user_id) + , CONSTRAINT FK_lams_user_organisation_2 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + CREATE TABLE lams_learner_progress ( learner_progress_id BIGINT(20) NOT NULL AUTO_INCREMENT , user_id BIGINT(20) NOT NULL @@ -499,6 +549,7 @@ )TYPE=InnoDB; ALTER TABLE lams_cr_node_version COMMENT='Represents a version of a node'; + CREATE TABLE lams_user_organisation_role ( user_organisation_role_id BIGINT(20) NOT NULL AUTO_INCREMENT , user_organisation_id BIGINT(20) NOT NULL @@ -524,15 +575,9 @@ , unique_key VARCHAR(128) NOT NULL , UNIQUE UQ_lams_tool_session_1 (unique_key) , PRIMARY KEY (tool_session_id) - , INDEX (group_id) - , CONSTRAINT FK_lams_tool_session_1 FOREIGN KEY (group_id) - REFERENCES lams_group (group_id) , INDEX (tool_session_state_id) , CONSTRAINT FK_lams_tool_session_4 FOREIGN KEY (tool_session_state_id) REFERENCES lams_tool_session_state (tool_session_state_id) - , INDEX (group_id) - , CONSTRAINT FK_lams_tool_session_3 FOREIGN KEY (group_id) - REFERENCES lams_group (group_id) , INDEX (user_id) , CONSTRAINT FK_lams_tool_session_5 FOREIGN KEY (user_id) REFERENCES lams_user (user_id) @@ -542,6 +587,9 @@ , INDEX (activity_id) , CONSTRAINT FK_lams_tool_session_8 FOREIGN KEY (activity_id) REFERENCES lams_learning_activity (activity_id) + , INDEX (group_id) + , CONSTRAINT FK_lams_tool_session_1 FOREIGN KEY (group_id) + REFERENCES lams_group (group_id) )TYPE=InnoDB; CREATE TABLE lams_progress_completed ( @@ -650,6 +698,28 @@ REFERENCES lams_log_event_type (log_event_type_id) )TYPE=InnoDB; +CREATE TABLE lams_workspace_folder_content ( + folder_content_id BIGINT(20) NOT NULL AUTO_INCREMENT + , content_type_id INT(3) NOT NULL + , name VARCHAR(64) NOT NULL + , description VARCHAR(64) NOT NULL + , create_date_time DATETIME NOT NULL + , last_modified_date DATETIME NOT NULL + , workspace_folder_id BIGINT(20) NOT NULL + , uuid BIGINT(20) + , version_id BIGINT(20) + , mime_type VARCHAR(10) NOT NULL + , UNIQUE unique_content_name (name, workspace_folder_id, mime_type) + , UNIQUE unique_node_version (workspace_folder_id, uuid, version_id) + , PRIMARY KEY (folder_content_id) + , INDEX (workspace_folder_id) + , CONSTRAINT FK_lams_workspace_folder_content_1 FOREIGN KEY (workspace_folder_id) + REFERENCES lams_workspace_folder (workspace_folder_id) + , INDEX (content_type_id) + , CONSTRAINT FK_lams_workspace_folder_content_2 FOREIGN KEY (content_type_id) + REFERENCES lams_workspace_folder_content_type (content_type_id) +)TYPE=InnoDB; + CREATE TABLE lams_learning_transition ( transition_id BIGINT(20) NOT NULL AUTO_INCREMENT , transition_ui_id INT(11) @@ -673,30 +743,3 @@ REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION )TYPE=InnoDB; -CREATE TABLE lams_workspace_folder_content_type ( - content_type_id INT(3) NOT NULL AUTO_INCREMENT - , description VARCHAR(64) NOT NULL - , PRIMARY KEY (content_type_id) -)TYPE=InnoDB; - -CREATE TABLE lams_workspace_folder_content ( - folder_content_id BIGINT(20) NOT NULL AUTO_INCREMENT - , content_type_id INT(3) NOT NULL - , name VARCHAR(64) NOT NULL - , description VARCHAR(64) NOT NULL - , create_date_time DATETIME NOT NULL - , last_modified_date DATETIME NOT NULL - , workspace_folder_id BIGINT(20) NOT NULL - , uuid BIGINT(20) - , version_id BIGINT(20) - , mime_type VARCHAR(10)NOT NULL - , UNIQUE unique_content_name (name,workspace_folder_id,mime_type) - , UNIQUE unique_node_version (workspace_folder_id,uuid,version_id) - , PRIMARY KEY (folder_content_id) - , INDEX (workspace_folder_id) - , CONSTRAINT FK_lams_workspace_folder_content_1 FOREIGN KEY (workspace_folder_id) - REFERENCES lams_workspace_folder (workspace_folder_id) - , INDEX (content_type_id) - , CONSTRAINT FK_lams_workspace_folder_content_2 FOREIGN KEY (content_type_id) - REFERENCES lams_workspace_folder_content_type (content_type_id) -)TYPE=InnoDB; \ No newline at end of file Index: lams_common/db/sql/drop_lams_11_tables.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/db/sql/drop_lams_11_tables.sql,v diff -u -r1.24 -r1.25 --- lams_common/db/sql/drop_lams_11_tables.sql 5 May 2005 03:21:46 -0000 1.24 +++ lams_common/db/sql/drop_lams_11_tables.sql 21 Aug 2005 23:47:24 -0000 1.25 @@ -11,6 +11,9 @@ DROP TABLE IF EXISTS lams_cr_node_version_property; DROP TABLE IF EXISTS lams_cr_workspace; DROP TABLE IF EXISTS lams_cr_workspace_credential; +DROP TABLE IF EXISTS lams_css_property; +DROP TABLE IF EXISTS lams_css_style; +DROP TABLE IF EXISTS lams_css_theme_ve; DROP TABLE IF EXISTS lams_gate_activity_level; DROP TABLE IF EXISTS lams_group; DROP TABLE IF EXISTS lams_grouping; @@ -42,6 +45,7 @@ DROP TABLE IF EXISTS lams_user_group; DROP TABLE IF EXISTS lams_user_organisation; DROP TABLE IF EXISTS lams_user_organisation_role; +DROP TABLE IF EXISTS lams_user_preference; DROP TABLE IF EXISTS lams_workspace; DROP TABLE IF EXISTS lams_workspace_folder; DROP TABLE IF EXISTS lams_workspace_folder_type; Index: lams_common/db/sql/insert_survey_design.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/db/sql/Attic/insert_survey_design.sql,v diff -u -r1.2 -r1.3 --- lams_common/db/sql/insert_survey_design.sql 27 Apr 2005 01:29:33 -0000 1.2 +++ lams_common/db/sql/insert_survey_design.sql 21 Aug 2005 23:47:24 -0000 1.3 @@ -7,15 +7,15 @@ insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (100,6,'Survey Template','Survey',10,20,null,'Help Text for Activity', 1,null,0,0, -2,6,'20050101','Offline Instructions ',0, +2,6,'20050101',0, null,null,6,17, null,null,null,'SurveyImage', -1,0,'Online Instructions',1); +1,0,1); Index: lams_common/db/sql/insert_test_data.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/db/sql/Attic/insert_test_data.sql,v diff -u -r1.45 -r1.46 --- lams_common/db/sql/insert_test_data.sql 21 Jun 2005 22:46:15 -0000 1.45 +++ lams_common/db/sql/insert_test_data.sql 21 Aug 2005 23:47:24 -0000 1.46 @@ -48,21 +48,34 @@ INSERT INTO lams_user_organisation_role VALUES (17, 9, 3); INSERT INTO lams_user_organisation_role VALUES (18, 10,3); -INSERT INTO lams_user VALUES(1, 'sysadmin','sysadmin','Mr','Fei','Yang',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'fyang@melcoe.mq.edu.au',0,NOW(),1,null,1); -INSERT INTO lams_user VALUES(2, 'test','test','Mr','Kevin','Han',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'khan@melcoe.mq.edu.au',0,NOW(),3,null,2); -INSERT INTO lams_user VALUES(3, 'lamskh01','dummy','Mr','Jacky','Fang',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'jfang@melcoe.mq.edu.au',0,NOW(),2,null,3); +-- themes and styles +INSERT INTO lams_css_style (style_id, theme_ve_id) VALUES (1,1); +INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (1, 1, "borderStyle", "outset", NULL, 1); +INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (2, 1, "color", "12452097", "_tf", 3); +INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (3, 1, "rollOverColor", "16711680", NULL, 2); +INSERT INTO lams_css_style (style_id,theme_ve_id) VALUES (2,2); +INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (4, 2, "display", "block", "_tf", 1); +INSERT INTO lams_css_property (property_id, style_id, name, value, style_subset, type) VALUES (5, 2, "selectionColor", "16711681", NULL, 3); + +INSERT INTO lams_css_theme_ve (theme_ve_id, name, description, parent_id, theme_flag) VALUES (1, "ruby", "cut down ruby theme for testing", null, 1); +INSERT INTO lams_css_theme_ve (theme_ve_id, name, description, parent_id, theme_flag) VALUES (2, "button", null, 1, 0); + +-- users +INSERT INTO lams_user VALUES(1, 'sysadmin','sysadmin','Mr','Fei','Yang',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'fyang@melcoe.mq.edu.au',0,NOW(),1,null,1,'en','au',1); +INSERT INTO lams_user VALUES(2, 'test','test','Mr','Kevin','Han',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'khan@melcoe.mq.edu.au',0,NOW(),3,null,2,'mi','nz',1); +INSERT INTO lams_user VALUES(3, 'lamskh01','dummy','Mr','Jacky','Fang',null,null,null,'Sydney','NSW','Australia',null,null,null,null,'jfang@melcoe.mq.edu.au',0,NOW(),2,null,3,'en','nz',1); + insert into lams_user (user_id,login,password,title,first_name,last_name,address_line_1,address_line_2,address_line_3, city,state,country,day_phone,evening_phone,mobile_phone, fax,email, disabled_flag,create_date,authentication_method_id,workspace_id, base_organisation_id) values -(4,'mminhas','mminhas','Ms','Manpreet','Minhas','170-22','Great Western Highway',null, -'Parramatta','NSW','Australia','029509061','0298938052','0405651097', -'0209509062','mminhas@melcoe.mq.edu.au', -0,'20041223',1,6, -4); +(4,'mmmmmmm','mmmmmmm','Ms','Mary','Morgan','99','First Ave',null, +'Parramatta','NSW','Australia','0295099999','0298939999','0499999999', +'0299999999','mmmmmmm@xx.os', +0,'20041223',1,6,4); insert into lams_workspace_folder (workspace_folder_id,parent_folder_id,name,workspace_id,user_id,create_date_time,last_modified_date_time,lams_workspace_folder_type_id) values(1,null,'ROOT',1,1,'20041223','20041223',1); @@ -125,105 +138,105 @@ -- Populates the lams_tool table with default tools corresponding to each of the above libraries -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(1,'notebook_signature','notebookService','Notebook','Notebook Description',1, +values(1,'notebook_signature','notebookService','Notebook','Notebook Description','notebook','1.1',1, 2,0,1,0,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,1); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(2,'noticeboard_signature','noticeboardService','Noticeboard','Noticeboard Description',2, +values(2,'noticeboard_signature','noticeboardService','Noticeboard','Noticeboard Description','noticeboard','1.1',2, 2,1,1,0,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,2); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(3,'multiple_choice_signature','multipleChoiceService','Multiple Choice','Multiple Coice Description',3, +values(3,'multiple_choice_signature','multipleChoiceService','Multiple Choice','Multiple Coice Description','multiple choice','1.1',3, 2,1,1,1,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,3); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(4,'question_answer_signature','questionAnswerService','Question and Answers','Question and Answers Description',4, +values(4,'question_answer_signature','questionAnswerService','Question and Answers','Question and Answers Description','q & a','1.1',4, 2,1,1,1,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,4); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(5,'message_board_signature','messageBoardService','Message Board','Message Board Description',5, +values(5,'message_board_signature','messageBoardService','Message Board','Message Board Description','forum','1.1',5, 2,1,1,1,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,5); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(6,'survey_signature','surveyService','Survey','Survey Description',6, +values(6,'survey_signature','surveyService','Survey','Survey Description','survey','1.1',6, 2,1,1,1,1, '/lams_tool_survey/tool/survey/survey.do?method=loadQuestionnaire','/lams_tool_survey/tool/survey/authoring.do?method=loadSurvey','define_later_url','export_portfolio_url', '/lams_tool_survey/tool/survey/report.do?method=loadMonitorReport','contribute_url','moderation_url', 1,6); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(7,'chat_signature','chatService','Chat','Chat Description',7, +values(7,'chat_signature','chatService','Chat','Chat Description','chat','1.1',7, 2,1,1,1,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,7); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(8,'shared_resources_signature','sharedResourcesService','Shared Resources','Shared Resources Description',8, +values(8,'shared_resources_signature','sharedResourcesService','Shared Resources','Shared Resources Description','shared resources','1.1',8, 2,1,0,1,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,8); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(9,'voting_signature','votingService','Voting','Voting Description',9, +values(9,'voting_signature','votingService','Voting','Voting Description','voting','1.1',9, 2,1,1,1,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,9); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(10,'submit_files_signature','submitFilesService','Submit Files','Submit Files Description',10, +values(10,'submit_files_signature','submitFilesService','Submit Files','Submit Files Description','submit files','1.1',10, 2,1,1,1,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,10); -insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,default_tool_content_id, +insert into lams_tool (tool_id,tool_signature,service_name,tool_display_name,description,tool_identifier,tool_version,default_tool_content_id, grouping_support_type_id,supports_define_later_flag,supports_run_offline_flag,supports_moderation_flag,supports_contribute_flag, learner_url,author_url,define_later_url,export_portfolio_url,monitor_url,contribute_url,moderation_url, valid_flag,learning_library_id) -values(11,'instant_messaging_signature','instantMessagingService','Instant Messaging','Instant Messaging Description',11, +values(11,'instant_messaging_signature','instantMessagingService','Instant Messaging','Instant Messaging Description','instant messaging','1.1',11, 2,1,1,1,1, 'learner_url','author_url','define_later_url','export_portfolio_url','monitor_url','contribute_url','moderation_url', 1,11); @@ -280,292 +293,292 @@ insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (1,1,'Notebook Template','Notebook',10,20,null,'Help Text for Activity', 1,null,0,0, -null,1,'20050101','Offline Instructions ',0, +null,1,'20050101',0, null,null,1,1, null,null,null,'/lams/images/icon_journal.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (2,2,'NoticeBoard Template','NoticeBoard',10,20,null,'Help Text for Activity', 1,null,0,0, -null,2,'20050101','Offline Instructions ',0, +null,2,'20050101',0, null,null,2,2, null,null,null,'/lams/images/icon_noticeboard.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (3,3,'Multiple Choice Template','Multiple Choice',10,20,null,'Help Text for Activity', 1,null,0,0, -null,3,'20050101','Offline Instructions ',0, +null,3,'20050101',0, null,null,3,3, null,null,null,'missing.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (4,4,'Question and Answer Template','Question and Answer',10,20,null,'Help Text for Activity', 1,null,0,0, -null,4,'20050101','Offline Instructions ',0, +null,4,'20050101',0, null,null,4,4, null,null,null,'/lams/tool/laqa/images/icon_questionanswer.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (5,5,'MessageBoard Template','MessageBoard',10,20,null,'Help Text for Activity', 1,null,0,0, -null,5,'20050101','Offline Instructions ',0, +null,5,'20050101',0, null,null,5,5, null,null,null,'/lams/images/icon_messageboard.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (6,6,'Survey Template','Survey',10,20,null,'Help Text for Activity', 1,null,0,0, -null,6,'20050101','Offline Instructions ',0, +null,6,'20050101',0, null,null,6,6, null,null,null,'/lams/images/icon_survey.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (7,7,'Chat Template','Chat',10,20,null,'Help Text for Activity', 1,null,0,0, -null,7,'20050101','Offline Instructions ',0, +null,7,'20050101',0, null,null,7,7, null,null,null,'/lams/images/icon_chat.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (8,8,'Shared Resources Template','Shared Resources',10,20,null,'Help Text for Activity', 1,null,0,0, -null,8,'20050101','Offline Instructions ',0, +null,8,'20050101',0, null,null,8,8, null,null,null,'/lams/images/icon_singleresource.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (9,9,'Voting Template','Voting',10,20,null,'Help Text for Activity', 1,null,0,0, -null,9,'20050101','Offline Instructions ',0, +null,9,'20050101',0, null,null,9,9, null,null,null,'/lams/images/icon_ranking.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (10,10,'Submit Files Template','Submit Files',10,20,null,'Help Text for Activity', 1,null,0,0, -null,10,'20050101','Offline Instructions ',0, +null,10,'20050101',0, null,null,10,10, null,null,null,'/lams/images/icon_reportsubmission.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (11,11,'Instant Messaging Template','Instant Messaging',10,20,null,'Help Text for Activity', 1,null,0,0, -null,11,'20050101','Offline Instructions ',0, +null,11,'20050101',0, null,null,11,11, null,null,null,'missing.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (12,12,'Optional Activity Description','Optional Activity Title',10,20,null,'Help Text for Activity', 7,null,1,0, -1,null,'20050101','Offline Instructions ',0, +1,null,'20050101',0, 1,1,null,null, null,'20050101','20050101','missing.swf', -3,1,'Online Instructions',1); +3,1,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (13,13,'Parallel Activity Description','Parallel Activity Title',10,20,null,'Help Text for Activity', 6,null,1,0, -1,null,'20050101','Parallel Activity Offline Instructions ',0, +1,null,'20050101',0, null,null,null,null, null,null,null,'missing.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (14,14,'Sequence Activity Description','Sequence Activity Title',10,20,null,'Help Text for Activity', 8,null,1,0, -1,null,'20050101','Sequence Activity Offline Instructions ',0, +1,null,'20050101',0, null,null,null,null, null,null,null,'missing.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (15,1,'Notebook Activity Description','Notebook Activity Title',10,20,null,'Help Text for Activity', 1,null,1,0, -1,1,'20050101','Notebook Activity Offline Instructions ',0, +1,1,'20050101',0, null,null,1,12, null,null,null,'/lams/images/icon_journal.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (16,2,'NoticeBoard Activity','NoticeBoard Activity',10,20,12,'Help Text for Activity', 1,null,0,0, -1,2,'20050101','NoticeBoard Activity Offline Instructions ',0, +1,2,'20050101',0, null,null,2,13, null,null,null,'/lams/images/icon_noticeboard.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (17,3,'Multiple Choice Activity ','Multiple Choice',10,20,12,'Help Text for Activity', 1,null,1,0, -1,3,'20050101','Tool Activity Offline Instructions ',0, +1,3,'20050101',0, null,null,3,14, null,null,null,'missing.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (18,4,'Question and Answer Activity','Question and Answer',10,20,13,'Help Text for Activity', 1,null,0,1, -1,4,'20050101','Tool Activity Offline Instructions ',0, +1,4,'20050101',0, null,null,4,15, null,null,null,'/lams/tool/laqa/images/icon_questionanswer.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (19,5,'Message Board Activity','Message Board',10,20,13,'Help Text for Activity', 1,100,1,0, -1,5,'20050101','Tool Activity Offline Instructions ',0, +1,5,'20050101',0, null,null,5,16, null,null,null,'/lams/images/icon_messageboard.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (20,6,'Survey Activity','Survey Title',10,20,null,'Help Text for Activity', 1,null,0,1, -1,6,'20050101','Tool Activity Offline Instructions ',0, +1,6,'20050101',0, null,null,6,17, null,null,null,'/lams/images/icon_survey.swf', -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id, @@ -574,7 +587,7 @@ parent_activity_id,parent_ui_id,learning_activity_type_id, grouping_id,grouping_ui_id,order_id,define_later_flag, learning_design_id,learning_library_id,create_date_time, -run_offline_flag,offline_instructions, +run_offline_flag, max_number_of_options,min_number_of_options,options_instructions, tool_id,tool_content_id, gate_activity_level_id,gate_open_flag, @@ -583,15 +596,15 @@ library_activity_ui_image, create_grouping_id,create_grouping_ui_id, library_activity_id, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (21,7, 'Chat Activity Description','Chat Title','Help Text for Chat Activity', 10,20, null,null,1, 99,99,0,0, 1,7,'20050101', -1,'Tool Activity Offline Instructions ', +1, null,null,null, 7,18, null,null, @@ -600,22 +613,22 @@ '/lams/images/icon_chat.swf', null,null, 7, -2,1,'Online Instructions',1); +2,1,1); insert into lams_learning_activity (activity_id,activity_ui_id,description,title,xcoord,ycoord,parent_activity_id,help_text, learning_activity_type_id,grouping_id,order_id,define_later_flag, -learning_design_id,learning_library_id,create_date_time,offline_instructions,run_offline_flag, +learning_design_id,learning_library_id,create_date_time,run_offline_flag, max_number_of_options,min_number_of_options,tool_id,tool_content_id, gate_activity_level_id,gate_start_time_offset,gate_end_time_offset,library_activity_ui_image, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (22,8,'Shared Resources Activity','Shared Resources',10,20,14,'Help Text for Activity', 1,null,0,0, -1,8,'20050101','Tool Activity Offline Instructions ',0, +1,8,'20050101',0, null,null,8,19, null,null,null,'/lams/images/icon_singleresource.swf', -1,0,'Online Instructions',1); +1,0,1); -- Sample GroupingActivity with RandomGrouping @@ -626,7 +639,7 @@ parent_activity_id,parent_ui_id,learning_activity_type_id, grouping_id,grouping_ui_id,order_id,define_later_flag, learning_design_id,learning_library_id,create_date_time, -run_offline_flag,offline_instructions, +run_offline_flag, max_number_of_options,min_number_of_options,options_instructions, tool_id,tool_content_id, gate_activity_level_id,gate_open_flag, @@ -635,15 +648,15 @@ library_activity_ui_image, create_grouping_id,create_grouping_ui_id, library_activity_id, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (23,23, 'Random Grouping Activity Description','RandomGroupingActivity Title','Help Text for RandomGroupingActivity', 10,20, null,null,2, null,null,0,0, 1,null,'20050101', -0,null, +0, null,null,null, null,null, null,null, @@ -652,7 +665,7 @@ 'missing.swf', 99,99, null, -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id, @@ -661,7 +674,7 @@ parent_activity_id,parent_ui_id,learning_activity_type_id, grouping_id,grouping_ui_id,order_id,define_later_flag, learning_design_id,learning_library_id,create_date_time, -run_offline_flag,offline_instructions, +run_offline_flag, max_number_of_options,min_number_of_options,options_instructions, tool_id,tool_content_id, gate_activity_level_id,gate_open_flag, @@ -670,15 +683,15 @@ library_activity_ui_image, create_grouping_id,create_grouping_ui_id, library_activity_id, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (24,24, 'QNA Activity Description','QNA Activity Title','Help Text for QNA Activity', 10,20, null,null,1, 99,99,0,1, 1,4,'20050101', -1,'QNA Activity Offline Instructions ', +1, null,null,null, 4,20, null,null, @@ -687,7 +700,7 @@ '/lams/tool/laqa/images/icon_questionanswer.swf', null,null, 4, -2,1,'Online Instructions',1); +2,1,1); insert into lams_learning_activity (activity_id,activity_ui_id, @@ -696,7 +709,7 @@ parent_activity_id,parent_ui_id,learning_activity_type_id, grouping_id,grouping_ui_id,order_id,define_later_flag, learning_design_id,learning_library_id,create_date_time, -run_offline_flag,offline_instructions, +run_offline_flag, max_number_of_options,min_number_of_options,options_instructions, tool_id,tool_content_id, gate_activity_level_id,gate_open_flag, @@ -705,15 +718,15 @@ library_activity_ui_image, create_grouping_id,create_grouping_ui_id, library_activity_id, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (25,25, 'QNA Activity Description','QNA Activity Title','Help Text for QNA Activity', 10,20, 14,14,1, null,null,1,1, 1,4,'20050101', -1,'QNA Activity Offline Instructions ', +1, null,null,null, 4,21, null,null, @@ -722,7 +735,7 @@ '/lams/tool/laqa/images/icon_questionanswer.swf', null,null, 4, -1,0,'Online Instructions',1); +1,0,1); @@ -733,7 +746,7 @@ parent_activity_id,parent_ui_id,learning_activity_type_id, grouping_id,grouping_ui_id,order_id,define_later_flag, learning_design_id,learning_library_id,create_date_time, -run_offline_flag,offline_instructions, +run_offline_flag, max_number_of_options,min_number_of_options,options_instructions, tool_id,tool_content_id, gate_activity_level_id,gate_open_flag, @@ -742,15 +755,15 @@ library_activity_ui_image, create_grouping_id,create_grouping_ui_id, library_activity_id, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (26,26, 'Synch Gate','Synch Gate Activity','Help Text for Synch Gate', 10,20, null,null,3, null,null,0,0, 1,null,'20050101', -0,null, +0, null,null,null, null,null, 3,0, @@ -759,7 +772,7 @@ 'missing.swf', null,null, null, -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id, @@ -768,7 +781,7 @@ parent_activity_id,parent_ui_id,learning_activity_type_id, grouping_id,grouping_ui_id,order_id,define_later_flag, learning_design_id,learning_library_id,create_date_time, -run_offline_flag,offline_instructions, +run_offline_flag, max_number_of_options,min_number_of_options,options_instructions, tool_id,tool_content_id, gate_activity_level_id,gate_open_flag, @@ -777,15 +790,15 @@ library_activity_ui_image, create_grouping_id,create_grouping_ui_id, library_activity_id, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (27,27, 'Schedule Gate','Schedule Gate Activity','Help Text for Schedule Gate', 10,20, null,null,4, null,null,0,0, 1,null,'20050101', -0,null, +0, null,null,null, null,null, 3,0, @@ -794,7 +807,7 @@ 'missing.swf', null,null, null, -1,0,'Online Instructions',1); +1,0,1); insert into lams_learning_activity (activity_id,activity_ui_id, @@ -803,7 +816,7 @@ parent_activity_id,parent_ui_id,learning_activity_type_id, grouping_id,grouping_ui_id,order_id,define_later_flag, learning_design_id,learning_library_id,create_date_time, -run_offline_flag,offline_instructions, +run_offline_flag, max_number_of_options,min_number_of_options,options_instructions, tool_id,tool_content_id, gate_activity_level_id,gate_open_flag, @@ -812,15 +825,15 @@ library_activity_ui_image, create_grouping_id,create_grouping_ui_id, library_activity_id, -grouping_support_type_id, apply_grouping_flag,online_instructions,activity_category_id) +grouping_support_type_id, apply_grouping_flag,activity_category_id) values (28,28, 'Permission Gate','Permission Gate Activity','Help Text for Permission Gate', 10,20, null,null,5, null,null,0,0, 1,null,'20050101', -0,null, +0, null,null,null, null,null, 3,0, @@ -829,7 +842,7 @@ 'missing.swf', null,null, null, -1,0,'Online Instructions',1); +1,0,1); -- Populates the lams_learning_transition table with various transitions for the dummy design @@ -887,10 +900,12 @@ insert into lams_learning_design(learning_design_ui_id,description,title,first_activity_id,max_id,valid_design_flag, read_only_flag,user_id,help_text,copy_type_id,create_date_time,version, - parent_learning_design_id,workspace_folder_id) + parent_learning_design_id,workspace_folder_id, + online_instructions,offline_instructions) values (1,'Test Learning Design','Test Learning Design title',20,1,1,0,1, - 'Help Text',1,'20041223','1.0',null,2); + 'Help Text',1,'20041223','1.0',null,2, + 'Online instructions', 'Offline instructions'); -- insert the test data for the content repository INSERT INTO lams_cr_credential (credential_id, name, password) VALUES (1, 'atool','atool'); Index: lams_common/db/sql/lams_11.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/db/sql/Attic/lams_11.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/db/sql/lams_11.sql 21 Aug 2005 23:47:24 -0000 1.1 @@ -0,0 +1,743 @@ +CREATE TABLE lams_gate_activity_level ( + gate_activity_level_id INT(11) NOT NULL DEFAULT 0 + , description VARCHAR(128) NOT NULL + , PRIMARY KEY (gate_activity_level_id) +)TYPE=InnoDB; + +CREATE TABLE lams_grouping_type ( + grouping_type_id INT(11) NOT NULL + , description VARCHAR(128) NOT NULL + , PRIMARY KEY (grouping_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_learning_activity_type ( + learning_activity_type_id INT(11) NOT NULL DEFAULT 0 + , description VARCHAR(255) NOT NULL + , PRIMARY KEY (learning_activity_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_learning_library ( + learning_library_id BIGINT(20) NOT NULL AUTO_INCREMENT + , description TEXT + , title VARCHAR(255) + , valid_flag TINYINT(1) NOT NULL DEFAULT 1 + , create_date_time DATETIME NOT NULL + , PRIMARY KEY (learning_library_id) +)TYPE=InnoDB; + +CREATE TABLE lams_organisation_type ( + organisation_type_id INT(3) NOT NULL + , name VARCHAR(64) NOT NULL + , description VARCHAR(255) NOT NULL + , PRIMARY KEY (organisation_type_id) +)TYPE=InnoDB; +CREATE UNIQUE INDEX UQ_lams_organisation_type_name ON lams_organisation_type (name ASC); + +CREATE TABLE lams_role ( + role_id INT(6) NOT NULL DEFAULT 0 + , name VARCHAR(64) NOT NULL + , description TEXT + , create_date DATETIME NOT NULL + , PRIMARY KEY (role_id) +)TYPE=InnoDB; +CREATE INDEX gname ON lams_role (name ASC); + +CREATE TABLE lams_tool_session_state ( + tool_session_state_id INT(3) NOT NULL + , description VARCHAR(255) NOT NULL + , PRIMARY KEY (tool_session_state_id) +)TYPE=InnoDB; + +CREATE TABLE lams_lesson_state ( + lesson_state_id INT(3) NOT NULL + , description VARCHAR(255) NOT NULL + , PRIMARY KEY (lesson_state_id) +)TYPE=InnoDB; + +CREATE TABLE lams_tool_session_type ( + tool_session_type_id INT(3) NOT NULL + , description VARCHAR(255) NOT NULL + , PRIMARY KEY (tool_session_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_license ( + license_id BIGINT(20) NOT NULL + , name VARCHAR(200) NOT NULL + , code VARCHAR(20) NOT NULL + , url VARCHAR(256) + , default_flag TINYINT(1) NOT NULL DEFAULT 0 + , picture_url VARCHAR(256) + , PRIMARY KEY (license_id) +)TYPE=InnoDB; + +CREATE TABLE lams_copy_type ( + copy_type_id TINYINT(4) NOT NULL + , description VARCHAR(255) NOT NULL + , PRIMARY KEY (copy_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_activity_category ( + activity_category_id INT(3) NOT NULL + , description VARCHAR(255) NOT NULL + , PRIMARY KEY (activity_category_id) +)TYPE=InnoDB; + +CREATE TABLE lams_cr_workspace ( + workspace_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT + , name VARCHAR(255) NOT NULL + , PRIMARY KEY (workspace_id) +)TYPE=InnoDB; +ALTER TABLE lams_cr_workspace COMMENT='Content repository workspace'; + +CREATE TABLE lams_cr_credential ( + credential_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT + , name VARCHAR(255) NOT NULL + , password VARCHAR(255) NOT NULL + , PRIMARY KEY (credential_id) +)TYPE=InnoDB; +ALTER TABLE lams_cr_credential COMMENT='Records the identification properties for a tool.'; + +CREATE TABLE lams_workspace_folder_type ( + lams_workspace_folder_type_id INT(3) NOT NULL + , description VARCHAR(255) NOT NULL + , PRIMARY KEY (lams_workspace_folder_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_grouping_support_type ( + grouping_support_type_id INT(3) NOT NULL + , description VARCHAR(64) NOT NULL + , PRIMARY KEY (grouping_support_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_log_event_type ( + log_event_type_id INT(5) NOT NULL + , description VARCHAR(255) NOT NULL + , PRIMARY KEY (log_event_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_workspace_folder_content_type ( + content_type_id INT(3) NOT NULL AUTO_INCREMENT + , description VARCHAR(64) NOT NULL + , PRIMARY KEY (content_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_authentication_method_type ( + authentication_method_type_id INT(3) NOT NULL + , description VARCHAR(64) NOT NULL + , PRIMARY KEY (authentication_method_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_authentication_method ( + authentication_method_id BIGINT(20) NOT NULL + , authentication_method_type_id INT(3) NOT NULL DEFAULT 0 + , authentication_method_name VARCHAR(255) NOT NULL + , UNIQUE UQ_lams_authentication_method_1 (authentication_method_name) + , PRIMARY KEY (authentication_method_id) + , INDEX (authentication_method_type_id) + , CONSTRAINT FK_lams_authorization_method_1 FOREIGN KEY (authentication_method_type_id) + REFERENCES lams_authentication_method_type (authentication_method_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + +CREATE TABLE lams_workspace_folder ( + workspace_folder_id BIGINT(20) NOT NULL AUTO_INCREMENT + , parent_folder_id BIGINT(20) + , name VARCHAR(64) NOT NULL + , workspace_id BIGINT(20) NOT NULL + , user_id BIGINT(20) NOT NULL + , create_date_time DATETIME NOT NULL + , last_modified_date_time DATETIME + , lams_workspace_folder_type_id INT(3) NOT NULL + , PRIMARY KEY (workspace_folder_id) + , INDEX (parent_folder_id) + , CONSTRAINT FK_lams_workspace_folder_2 FOREIGN KEY (parent_folder_id) + REFERENCES lams_workspace_folder (workspace_folder_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (lams_workspace_folder_type_id) + , CONSTRAINT FK_lams_workspace_folder_4 FOREIGN KEY (lams_workspace_folder_type_id) + REFERENCES lams_workspace_folder_type (lams_workspace_folder_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_workspace ( + workspace_id BIGINT(20) NOT NULL AUTO_INCREMENT + , root_folder_id BIGINT(20) + , name VARCHAR(255) + , PRIMARY KEY (workspace_id) + , INDEX (root_folder_id) + , CONSTRAINT FK_lams_workspace_1 FOREIGN KEY (root_folder_id) + REFERENCES lams_workspace_folder (workspace_folder_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + +CREATE TABLE lams_user ( + user_id BIGINT(20) NOT NULL AUTO_INCREMENT + , login VARCHAR(20) NOT NULL + , password VARCHAR(50) NOT NULL + , title VARCHAR(32) + , first_name VARCHAR(64) + , last_name VARCHAR(128) + , address_line_1 VARCHAR(64) + , address_line_2 VARCHAR(64) + , address_line_3 VARCHAR(64) + , city VARCHAR(64) + , state VARCHAR(64) + , country VARCHAR(64) + , day_phone VARCHAR(64) + , evening_phone VARCHAR(64) + , mobile_phone VARCHAR(64) + , fax VARCHAR(64) + , email VARCHAR(128) + , disabled_flag TINYINT(1) NOT NULL DEFAULT 0 + , create_date DATETIME NOT NULL + , authentication_method_id BIGINT(20) NOT NULL DEFAULT 0 + , workspace_id BIGINT(20) + , base_organisation_id BIGINT(20) NOT NULL DEFAULT 0 + , locale_language CHAR(2) NOT NULL DEFAULT 'en' + , locale_country CHAR(2) + , theme_id BIGINT(20) + , PRIMARY KEY (user_id) + , INDEX (authentication_method_id) + , CONSTRAINT FK_lams_user_1 FOREIGN KEY (authentication_method_id) + REFERENCES lams_authentication_method (authentication_method_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (workspace_id) + , CONSTRAINT FK_lams_user_2 FOREIGN KEY (workspace_id) + REFERENCES lams_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (base_organisation_id) + , CONSTRAINT FK_lams_user_3 FOREIGN KEY (base_organisation_id) + REFERENCES lams_organisation (organisation_id) + , INDEX (theme_id) + , CONSTRAINT FK_lams_user_4 FOREIGN KEY (theme_id) + REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; +CREATE UNIQUE INDEX UQ_lams_user_login ON lams_user (login ASC); +CREATE INDEX login ON lams_user (login ASC); + +CREATE TABLE lams_learning_design ( + learning_design_id BIGINT(20) NOT NULL AUTO_INCREMENT + , learning_design_ui_id INT(11) + , description TEXT + , title VARCHAR(255) + , first_activity_id BIGINT(20) + , max_id INT(11) + , valid_design_flag TINYINT(4) NOT NULL + , read_only_flag TINYINT(4) NOT NULL + , date_read_only DATETIME + , user_id BIGINT(20) NOT NULL + , help_text TEXT + , online_instructions TEXT + , offline_instructions TEXT + , copy_type_id TINYINT(4) NOT NULL + , create_date_time DATETIME NOT NULL + , version VARCHAR(56) + , parent_learning_design_id BIGINT(20) + , workspace_folder_id BIGINT(20) + , duration BIGINT(38) + , license_id BIGINT(20) + , license_text TEXT + , lesson_org_id BIGINT(20) + , lesson_org_name VARCHAR(255) + , lesson_id BIGINT(20) + , lesson_start_date_time DATETIME + , lesson_name VARCHAR(255) + , last_modified_date_time DATETIME + , PRIMARY KEY (learning_design_id) + , INDEX (parent_learning_design_id) + , CONSTRAINT FK_lams_learning_design_2 FOREIGN KEY (parent_learning_design_id) + REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (user_id) + , CONSTRAINT FK_lams_learning_design_3 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) + , INDEX (workspace_folder_id) + , CONSTRAINT FK_lams_learning_design_4 FOREIGN KEY (workspace_folder_id) + REFERENCES lams_workspace_folder (workspace_folder_id) + , INDEX (license_id) + , CONSTRAINT FK_lams_learning_design_5 FOREIGN KEY (license_id) + REFERENCES lams_license (license_id) + , INDEX (copy_type_id) + , CONSTRAINT FK_lams_learning_design_6 FOREIGN KEY (copy_type_id) + REFERENCES lams_copy_type (copy_type_id) +)TYPE=InnoDB; +CREATE INDEX idx_design_first_act ON lams_learning_design (first_activity_id ASC); + +CREATE TABLE lams_grouping ( + grouping_id BIGINT(20) NOT NULL AUTO_INCREMENT + , grouping_ui_id INT(11) + , grouping_type_id INT(11) NOT NULL + , number_of_groups INT(11) + , learners_per_group INT(11) + , staff_group_id BIGINT(20) DEFAULT 0 + , max_number_of_groups INT(3) + , PRIMARY KEY (grouping_id) + , INDEX (grouping_type_id) + , CONSTRAINT FK_lams_learning_grouping_1 FOREIGN KEY (grouping_type_id) + REFERENCES lams_grouping_type (grouping_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + +CREATE TABLE lams_group ( + group_id BIGINT(20) NOT NULL AUTO_INCREMENT + , grouping_id BIGINT(20) NOT NULL + , order_id INT(6) NOT NULL DEFAULT 1 + , PRIMARY KEY (group_id) + , INDEX (grouping_id) + , CONSTRAINT FK_lams_learning_group_1 FOREIGN KEY (grouping_id) + REFERENCES lams_grouping (grouping_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + +CREATE TABLE lams_organisation ( + organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT + , name VARCHAR(250) + , description VARCHAR(250) + , parent_organisation_id BIGINT(20) + , organisation_type_id INT(3) NOT NULL DEFAULT 0 + , create_date DATETIME NOT NULL + , workspace_id BIGINT(20) + , PRIMARY KEY (organisation_id) + , INDEX (organisation_type_id) + , CONSTRAINT FK_lams_organisation_1 FOREIGN KEY (organisation_type_id) + REFERENCES lams_organisation_type (organisation_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (workspace_id) + , CONSTRAINT FK_lams_organisation_2 FOREIGN KEY (workspace_id) + REFERENCES lams_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (parent_organisation_id) + , CONSTRAINT FK_lams_organisation_3 FOREIGN KEY (parent_organisation_id) + REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + +CREATE TABLE lams_learning_activity ( + activity_id BIGINT(20) NOT NULL AUTO_INCREMENT + , activity_ui_id INT(11) + , description TEXT + , title VARCHAR(255) + , help_text TEXT + , xcoord INT(11) + , ycoord INT(11) + , parent_activity_id BIGINT(20) + , parent_ui_id INT(11) + , learning_activity_type_id INT(11) NOT NULL DEFAULT 0 + , grouping_support_type_id INT(3) NOT NULL + , apply_grouping_flag TINYINT(1) NOT NULL + , grouping_id BIGINT(20) + , grouping_ui_id INT(11) + , order_id INT(11) + , define_later_flag TINYINT(4) NOT NULL DEFAULT 0 + , learning_design_id BIGINT(20) + , learning_library_id BIGINT(20) + , create_date_time DATETIME NOT NULL + , run_offline_flag TINYINT(1) NOT NULL + , max_number_of_options INT(5) + , min_number_of_options INT(5) + , options_instructions TEXT + , tool_id BIGINT(20) + , tool_content_id BIGINT(20) + , activity_category_id INT(3) NOT NULL + , gate_activity_level_id INT(11) + , gate_open_flag TINYINT(1) + , gate_start_time_offset BIGINT(38) + , gate_end_time_offset BIGINT(38) + , gate_start_date_time DATETIME + , gate_end_date_time DATETIME + , library_activity_ui_image VARCHAR(255) + , create_grouping_id BIGINT(20) + , create_grouping_ui_id INT(11) + , library_activity_id BIGINT(20) + , PRIMARY KEY (activity_id) + , INDEX (learning_library_id) + , CONSTRAINT FK_lams_learning_activity_7 FOREIGN KEY (learning_library_id) + REFERENCES lams_learning_library (learning_library_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (learning_design_id) + , CONSTRAINT FK_lams_learning_activity_6 FOREIGN KEY (learning_design_id) + REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (parent_activity_id) + , CONSTRAINT FK_learning_activity_2 FOREIGN KEY (parent_activity_id) + REFERENCES lams_learning_activity (activity_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (learning_activity_type_id) + , CONSTRAINT FK_learning_activity_3 FOREIGN KEY (learning_activity_type_id) + REFERENCES lams_learning_activity_type (learning_activity_type_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (grouping_id) + , CONSTRAINT FK_learning_activity_6 FOREIGN KEY (grouping_id) + REFERENCES lams_grouping (grouping_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (tool_id) + , CONSTRAINT FK_lams_learning_activity_8 FOREIGN KEY (tool_id) + REFERENCES lams_tool (tool_id) + , INDEX (gate_activity_level_id) + , CONSTRAINT FK_lams_learning_activity_10 FOREIGN KEY (gate_activity_level_id) + REFERENCES lams_gate_activity_level (gate_activity_level_id) + , INDEX (create_grouping_id) + , CONSTRAINT FK_lams_learning_activity_9 FOREIGN KEY (create_grouping_id) + REFERENCES lams_grouping (grouping_id) + , INDEX (library_activity_id) + , CONSTRAINT FK_lams_learning_activity_11 FOREIGN KEY (library_activity_id) + REFERENCES lams_learning_activity (activity_id) + , INDEX (activity_category_id) + , CONSTRAINT FK_lams_learning_activity_12 FOREIGN KEY (activity_category_id) + REFERENCES lams_activity_category (activity_category_id) + , INDEX (grouping_support_type_id) + , CONSTRAINT FK_lams_learning_activity_13 FOREIGN KEY (grouping_support_type_id) + REFERENCES lams_grouping_support_type (grouping_support_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_lesson ( + lesson_id BIGINT(20) NOT NULL AUTO_INCREMENT + , learning_design_id BIGINT(20) NOT NULL + , user_id BIGINT(20) NOT NULL + , name VARCHAR(255) NOT NULL + , description TEXT + , create_date_time DATETIME NOT NULL + , organisation_id BIGINT(20) + , class_grouping_id BIGINT(20) + , lesson_state_id INT(3) NOT NULL + , start_date_time DATETIME + , schedule_start_date_time DATETIME + , end_date_time DATETIME + , schedule_end_date_time DATETIME + , PRIMARY KEY (lesson_id) + , INDEX (learning_design_id) + , CONSTRAINT FK_lams_lesson_1_1 FOREIGN KEY (learning_design_id) + REFERENCES lams_learning_design (learning_design_id) + , INDEX (user_id) + , CONSTRAINT FK_lams_lesson_2 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) + , INDEX (organisation_id) + , CONSTRAINT FK_lams_lesson_3 FOREIGN KEY (organisation_id) + REFERENCES lams_organisation (organisation_id) + , INDEX (lesson_state_id) + , CONSTRAINT FK_lams_lesson_4 FOREIGN KEY (lesson_state_id) + REFERENCES lams_lesson_state (lesson_state_id) + , INDEX (class_grouping_id) + , CONSTRAINT FK_lams_lesson_5 FOREIGN KEY (class_grouping_id) + REFERENCES lams_grouping (grouping_id) +)TYPE=InnoDB; + +CREATE TABLE lams_tool ( + tool_id BIGINT(20) NOT NULL AUTO_INCREMENT + , tool_signature VARCHAR(64) NOT NULL + , service_name VARCHAR(255) NOT NULL + , tool_display_name VARCHAR(255) NOT NULL + , description TEXT + , tool_identifier VARCHAR(64) NOT NULL + , tool_version VARCHAR(10) NOT NULL + , learning_library_id BIGINT(20) + , default_tool_content_id BIGINT(20) + , valid_flag TINYINT(1) NOT NULL DEFAULT 1 + , grouping_support_type_id INT(3) NOT NULL + , supports_define_later_flag TINYINT(1) NOT NULL DEFAULT 0 + , supports_run_offline_flag TINYINT(1) NOT NULL + , supports_moderation_flag TINYINT(1) NOT NULL + , supports_contribute_flag TINYINT(1) NOT NULL + , learner_url TEXT NOT NULL + , author_url TEXT NOT NULL + , define_later_url TEXT + , export_portfolio_url TEXT NOT NULL + , monitor_url TEXT NOT NULL + , contribute_url TEXT + , moderation_url TEXT + , create_date_time DATETIME NOT NULL + , UNIQUE UQ_lams_tool_sig (tool_signature) + , UNIQUE UQ_lams_tool_class_name (service_name) + , PRIMARY KEY (tool_id) + , INDEX (learning_library_id) + , CONSTRAINT FK_lams_tool_1 FOREIGN KEY (learning_library_id) + REFERENCES lams_learning_library (learning_library_id) + , INDEX (grouping_support_type_id) + , CONSTRAINT FK_lams_tool_2 FOREIGN KEY (grouping_support_type_id) + REFERENCES lams_grouping_support_type (grouping_support_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_user_organisation ( + user_organisation_id BIGINT(20) NOT NULL AUTO_INCREMENT + , organisation_id BIGINT(20) NOT NULL + , user_id BIGINT(20) NOT NULL + , PRIMARY KEY (user_organisation_id) + , INDEX (organisation_id) + , CONSTRAINT FK_lams_user_organisation_1 FOREIGN KEY (organisation_id) + REFERENCES lams_organisation (organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (user_id) + , CONSTRAINT FK_lams_user_organisation_2 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + +CREATE TABLE lams_learner_progress ( + learner_progress_id BIGINT(20) NOT NULL AUTO_INCREMENT + , user_id BIGINT(20) NOT NULL + , lesson_id BIGINT(20) NOT NULL + , lesson_completed_flag TINYINT(1) NOT NULL DEFAULT 0 + , waiting_flag TINYINT(1) NOT NULL + , start_date_time DATETIME NOT NULL + , finish_date_time DATETIME + , current_activity_id BIGINT(20) + , next_activity_id BIGINT(20) + , previous_activity_id BIGINT(20) + , requires_restart_flag TINYINT(1) NOT NULL + , PRIMARY KEY (learner_progress_id) + , INDEX (user_id) + , CONSTRAINT FK_lams_learner_progress_1 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) + , INDEX (lesson_id) + , CONSTRAINT FK_lams_learner_progress_2 FOREIGN KEY (lesson_id) + REFERENCES lams_lesson (lesson_id) + , INDEX (current_activity_id) + , CONSTRAINT FK_lams_learner_progress_3 FOREIGN KEY (current_activity_id) + REFERENCES lams_learning_activity (activity_id) + , INDEX (next_activity_id) + , CONSTRAINT FK_lams_learner_progress_4 FOREIGN KEY (next_activity_id) + REFERENCES lams_learning_activity (activity_id) + , INDEX (previous_activity_id) + , CONSTRAINT FK_lams_learner_progress_5 FOREIGN KEY (previous_activity_id) + REFERENCES lams_learning_activity (activity_id) +)TYPE=InnoDB; + +CREATE TABLE lams_cr_node ( + node_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT + , workspace_id BIGINT(20) UNSIGNED NOT NULL + , path VARCHAR(255) + , type VARCHAR(255) NOT NULL + , created_date_time DATETIME NOT NULL + , next_version_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 1 + , parent_nv_id BIGINT(20) UNSIGNED + , nv_id BIGINT(20) UNSIGNED NOT NULL + , PRIMARY KEY (node_id) + , INDEX (workspace_id) + , CONSTRAINT FK_lams_cr_node_1 FOREIGN KEY (workspace_id) + REFERENCES lams_cr_workspace (workspace_id) +)TYPE=InnoDB; +ALTER TABLE lams_cr_node COMMENT='The main table containing the node definition'; + +CREATE TABLE lams_cr_node_version ( + nv_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT + , node_id BIGINT(20) UNSIGNED NOT NULL + , version_id BIGINT(20) UNSIGNED NOT NULL + , created_date_time DATETIME NOT NULL + , id BIGINT(20) UNSIGNED NOT NULL + , PRIMARY KEY (nv_id) + , INDEX (node_id) + , CONSTRAINT FK_lams_cr_node_version_2 FOREIGN KEY (node_id) + REFERENCES lams_cr_node (node_id) +)TYPE=InnoDB; +ALTER TABLE lams_cr_node_version COMMENT='Represents a version of a node'; + +CREATE TABLE lams_css_theme_ve ( + theme_ve_id BIGINT(20) NOT NULL AUTO_INCREMENT + , name VARCHAR(100) NOT NULL + , description VARCHAR(100) + , parent_id BIGINT(20) + , theme_flag TINYINT(1) NOT NULL DEFAULT 0 + , PRIMARY KEY (theme_ve_id) + , INDEX (parent_id) + , CONSTRAINT FK_lams_css_theme_ve_2 FOREIGN KEY (parent_id) + REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; +ALTER TABLE lams_css_theme_ve COMMENT='Stores both the Flash theme and visual element'; + +CREATE TABLE lams_css_style ( + style_id BIGINT(20) NOT NULL AUTO_INCREMENT + , theme_ve_id BIGINT(20) NOT NULL + , PRIMARY KEY (style_id) + , INDEX (theme_ve_id) + , CONSTRAINT FK_lams_css_style_1 FOREIGN KEY (theme_ve_id) + REFERENCES lams_css_theme_ve (theme_ve_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; +ALTER TABLE lams_css_style COMMENT='Groups lams_css_property into a CSSStyleDeclaration.'; + +CREATE TABLE lams_user_organisation_role ( + user_organisation_role_id BIGINT(20) NOT NULL AUTO_INCREMENT + , user_organisation_id BIGINT(20) NOT NULL + , role_id INT(6) NOT NULL + , PRIMARY KEY (user_organisation_role_id) + , INDEX (role_id) + , CONSTRAINT FK_lams_user_organisation_role_2 FOREIGN KEY (role_id) + REFERENCES lams_role (role_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (user_organisation_id) + , CONSTRAINT FK_lams_user_organisation_role_3 FOREIGN KEY (user_organisation_id) + REFERENCES lams_user_organisation (user_organisation_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + +CREATE TABLE lams_tool_session ( + tool_session_id BIGINT(20) NOT NULL AUTO_INCREMENT + , tool_session_type_id INT(3) NOT NULL + , lesson_id BIGINT(20) NOT NULL + , activity_id BIGINT(20) NOT NULL + , tool_session_state_id INT(3) NOT NULL + , create_date_time DATETIME NOT NULL + , group_id BIGINT(20) + , user_id BIGINT(20) + , unique_key VARCHAR(128) NOT NULL + , UNIQUE UQ_lams_tool_session_1 (unique_key) + , PRIMARY KEY (tool_session_id) + , INDEX (tool_session_state_id) + , CONSTRAINT FK_lams_tool_session_4 FOREIGN KEY (tool_session_state_id) + REFERENCES lams_tool_session_state (tool_session_state_id) + , INDEX (user_id) + , CONSTRAINT FK_lams_tool_session_5 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) + , INDEX (tool_session_type_id) + , CONSTRAINT FK_lams_tool_session_7 FOREIGN KEY (tool_session_type_id) + REFERENCES lams_tool_session_type (tool_session_type_id) + , INDEX (activity_id) + , CONSTRAINT FK_lams_tool_session_8 FOREIGN KEY (activity_id) + REFERENCES lams_learning_activity (activity_id) + , INDEX (group_id) + , CONSTRAINT FK_lams_tool_session_1 FOREIGN KEY (group_id) + REFERENCES lams_group (group_id) +)TYPE=InnoDB; + +CREATE TABLE lams_progress_completed ( + learner_progress_id BIGINT(20) NOT NULL + , activity_id BIGINT(20) NOT NULL + , PRIMARY KEY (learner_progress_id, activity_id) + , INDEX (learner_progress_id) + , CONSTRAINT FK_lams_progress_completed_1 FOREIGN KEY (learner_progress_id) + REFERENCES lams_learner_progress (learner_progress_id) + , INDEX (activity_id) + , CONSTRAINT FK_lams_progress_completed_2 FOREIGN KEY (activity_id) + REFERENCES lams_learning_activity (activity_id) +)TYPE=InnoDB; + +CREATE TABLE lams_progress_attempted ( + learner_progress_id BIGINT(20) NOT NULL + , activity_id BIGINT(20) NOT NULL + , PRIMARY KEY (learner_progress_id, activity_id) + , INDEX (learner_progress_id) + , CONSTRAINT FK_lams_progress_current_1 FOREIGN KEY (learner_progress_id) + REFERENCES lams_learner_progress (learner_progress_id) + , INDEX (activity_id) + , CONSTRAINT FK_lams_progress_current_2 FOREIGN KEY (activity_id) + REFERENCES lams_learning_activity (activity_id) +)TYPE=InnoDB; + +CREATE TABLE lams_user_group ( + user_id BIGINT(20) NOT NULL + , group_id BIGINT(20) NOT NULL + , PRIMARY KEY (user_id, group_id) + , INDEX (user_id) + , CONSTRAINT FK_lams_user_group_1 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) + , INDEX (group_id) + , CONSTRAINT FK_lams_user_group_2 FOREIGN KEY (group_id) + REFERENCES lams_group (group_id) +)TYPE=InnoDB; + +CREATE TABLE lams_tool_content ( + tool_content_id BIGINT(20) NOT NULL AUTO_INCREMENT + , tool_id BIGINT(20) NOT NULL + , PRIMARY KEY (tool_content_id) + , INDEX (tool_id) + , CONSTRAINT FK_lams_tool_content_1 FOREIGN KEY (tool_id) + REFERENCES lams_tool (tool_id) +)TYPE=InnoDB; + +CREATE TABLE lams_activity_learners ( + user_id BIGINT(20) NOT NULL DEFAULT 0 + , activity_id BIGINT(20) NOT NULL DEFAULT 0 + , INDEX (user_id) + , CONSTRAINT FK_TABLE_32_1 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) + , INDEX (activity_id) + , CONSTRAINT FK_TABLE_32_2 FOREIGN KEY (activity_id) + REFERENCES lams_learning_activity (activity_id) +)TYPE=InnoDB; + +CREATE TABLE lams_lesson_learner ( + lesson_id BIGINT(20) NOT NULL + , user_id BIGINT(20) NOT NULL + , INDEX (lesson_id) + , CONSTRAINT FK_lams_lesson_learner_1 FOREIGN KEY (lesson_id) + REFERENCES lams_lesson (lesson_id) + , INDEX (user_id) + , CONSTRAINT FK_lams_lesson_learner_2 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) +)TYPE=InnoDB; + +CREATE TABLE lams_cr_workspace_credential ( + wc_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT + , workspace_id BIGINT(20) UNSIGNED NOT NULL + , credential_id BIGINT(20) UNSIGNED NOT NULL + , PRIMARY KEY (wc_id) + , INDEX (workspace_id) + , CONSTRAINT FK_lams_cr_workspace_credential_1 FOREIGN KEY (workspace_id) + REFERENCES lams_cr_workspace (workspace_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (credential_id) + , CONSTRAINT FK_lams_cr_workspace_credential_2 FOREIGN KEY (credential_id) + REFERENCES lams_cr_credential (credential_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; +ALTER TABLE lams_cr_workspace_credential COMMENT='Maps tools access to workspaces'; + +CREATE TABLE lams_cr_node_version_property ( + id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT + , nv_id BIGINT(20) UNSIGNED NOT NULL + , name VARCHAR(255) NOT NULL + , value VARCHAR(255) NOT NULL + , type TINYINT NOT NULL + , PRIMARY KEY (id) + , INDEX (nv_id) + , CONSTRAINT FK_lams_cr_node_version_property_1 FOREIGN KEY (nv_id) + REFERENCES lams_cr_node_version (nv_id) +)TYPE=InnoDB; + +CREATE TABLE lams_log_event ( + log_event_id BIGINT(20) NOT NULL AUTO_INCREMENT + , log_event_type_id INT(5) NOT NULL + , user_id BIGINT(20) + , timestamp DATETIME NOT NULL + , ref_id BIGINT(20) + , message VARCHAR(255) + , PRIMARY KEY (log_event_id) + , INDEX (log_event_type_id) + , CONSTRAINT FK_lams_event_log_1 FOREIGN KEY (log_event_type_id) + REFERENCES lams_log_event_type (log_event_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_workspace_folder_content ( + folder_content_id BIGINT(20) NOT NULL AUTO_INCREMENT + , content_type_id INT(3) NOT NULL + , name VARCHAR(64) NOT NULL + , description VARCHAR(64) NOT NULL + , create_date_time DATETIME NOT NULL + , last_modified_date DATETIME NOT NULL + , workspace_folder_id BIGINT(20) NOT NULL + , uuid BIGINT(20) + , version_id BIGINT(20) + , mime_type VARCHAR(10) NOT NULL + , UNIQUE unique_content_name (name, workspace_folder_id, mime_type) + , UNIQUE unique_node_version (workspace_folder_id, uuid, version_id) + , PRIMARY KEY (folder_content_id) + , INDEX (workspace_folder_id) + , CONSTRAINT FK_lams_workspace_folder_content_1 FOREIGN KEY (workspace_folder_id) + REFERENCES lams_workspace_folder (workspace_folder_id) + , INDEX (content_type_id) + , CONSTRAINT FK_lams_workspace_folder_content_2 FOREIGN KEY (content_type_id) + REFERENCES lams_workspace_folder_content_type (content_type_id) +)TYPE=InnoDB; + +CREATE TABLE lams_css_property ( + property_id BIGINT(20) NOT NULL AUTO_INCREMENT + , style_id BIGINT(20) NOT NULL + , name VARCHAR(255) NOT NULL + , value VARCHAR(100) NOT NULL + , style_subset VARCHAR(20) + , type TINYINT NOT NULL + , PRIMARY KEY (property_id) + , INDEX (style_id) + , CONSTRAINT FK_lams_css_property_1 FOREIGN KEY (style_id) + REFERENCES lams_css_style (style_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + +CREATE TABLE lams_learning_transition ( + transition_id BIGINT(20) NOT NULL AUTO_INCREMENT + , transition_ui_id INT(11) + , description TEXT + , title VARCHAR(255) + , to_activity_id BIGINT(20) NOT NULL + , from_activity_id BIGINT(20) NOT NULL + , learning_design_id BIGINT(20) NOT NULL DEFAULT 0 + , create_date_time DATETIME NOT NULL + , to_ui_id INT(11) + , from_ui_id INT(11) + , PRIMARY KEY (transition_id) + , INDEX (from_activity_id) + , CONSTRAINT FK_learning_transition_3 FOREIGN KEY (from_activity_id) + REFERENCES lams_learning_activity (activity_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (to_activity_id) + , CONSTRAINT FK_learning_transition_2 FOREIGN KEY (to_activity_id) + REFERENCES lams_learning_activity (activity_id) ON DELETE NO ACTION ON UPDATE NO ACTION + , INDEX (learning_design_id) + , CONSTRAINT lddefn_transition_ibfk_1 FOREIGN KEY (learning_design_id) + REFERENCES lams_learning_design (learning_design_id) ON DELETE NO ACTION ON UPDATE NO ACTION +)TYPE=InnoDB; + Index: lams_common/src/java/org/lamsfoundation/lams/applicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/applicationContext.xml,v diff -u -r1.1 -r1.2 --- lams_common/src/java/org/lamsfoundation/lams/applicationContext.xml 10 May 2005 23:53:31 -0000 1.1 +++ lams_common/src/java/org/lamsfoundation/lams/applicationContext.xml 21 Aug 2005 23:55:20 -0000 1.2 @@ -72,6 +72,10 @@ org/lamsfoundation/lams/workspace/WorkspaceFolderContent.hbm.xml + + org/lamsfoundation/lams/themes/CSSProperty.hbm.xml + org/lamsfoundation/lams/themes/CSSStyle.hbm.xml + org/lamsfoundation/lams/themes/CSSThemeVisualElement.hbm.xml
@@ -198,4 +202,10 @@ + + + + + + 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.29 -r1.30 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/Activity.java 1 Jun 2005 02:38:54 -0000 1.29 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/Activity.java 21 Aug 2005 23:55:20 -0000 1.30 @@ -126,12 +126,6 @@ /** Date this activity was created */ private Date createDateTime; - /** Offline Instruction for this activity*/ - private String offlineInstructions; - - /** Online Instructions for this activity*/ - private String onlineInstructions; - /** The image that represents the icon of this * activity in the UI*/ private String libraryActivityUiImage; @@ -196,7 +190,6 @@ Integer orderId, Boolean defineLater, Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -215,7 +208,6 @@ this.orderId = orderId; this.defineLater = defineLater; this.createDateTime = createDateTime; - this.offlineInstructions = offlineInstructions; this.learningLibrary = learningLibrary; this.parentActivity = parentActivity; this.parentUIID = parentUIID; @@ -381,17 +373,6 @@ } /** - * @hibernate.property column="offline_instructions" length="65535" - */ - public String getOfflineInstructions() { - return this.offlineInstructions; - } - - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - /** * @hibernate.many-to-one not-null="true" * @hibernate.column name="learning_library_id" * @@ -591,19 +572,6 @@ this.runOffline = runOffline; } - /** - * @return Returns the onlineInstructions. - */ - public String getOnlineInstructions() { - return onlineInstructions; - } - /** - * @param onlineInstructions The onlineInstructions to set. - */ - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - public Integer getActivityCategoryID() { return activityCategoryID; Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ComplexActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/ComplexActivity.java,v diff -u -r1.10 -r1.11 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ComplexActivity.java 7 Jun 2005 05:40:34 -0000 1.10 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ComplexActivity.java 21 Aug 2005 23:55:20 -0000 1.11 @@ -53,7 +53,6 @@ Integer orderId, Boolean defineLater, Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -65,7 +64,7 @@ Transition transitionFrom, Set activities) { super(activityId, id, description, title, xcoord, ycoord, orderId, - defineLater, createDateTime, offlineInstructions, + defineLater, createDateTime, learningLibrary, parentActivity, libraryActivity,parentUIID,learningDesign, grouping, activityTypeId, transitionTo,transitionFrom); this.activities = activities; Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/GateActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/GateActivity.java,v diff -u -r1.8 -r1.9 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/GateActivity.java 7 Jun 2005 05:40:34 -0000 1.8 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/GateActivity.java 21 Aug 2005 23:55:20 -0000 1.9 @@ -65,7 +65,6 @@ Integer orderId, Boolean defineLater, java.util.Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -87,7 +86,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupingActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupingActivity.java,v diff -u -r1.10 -r1.11 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupingActivity.java 7 Jun 2005 05:40:34 -0000 1.10 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupingActivity.java 21 Aug 2005 23:55:20 -0000 1.11 @@ -52,7 +52,6 @@ Integer orderId, Boolean defineLater, java.util.Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -75,7 +74,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, @@ -147,9 +145,6 @@ groupingActivity.setApplyGrouping(originalActivity.getApplyGrouping()); groupingActivity.setActivityCategoryID(originalActivity.getActivityCategoryID()); - groupingActivity.setOfflineInstructions(originalActivity.getOfflineInstructions()); - groupingActivity.setOnlineInstructions(originalActivity.getOnlineInstructions()); - groupingActivity.setDefineLater(originalActivity.getDefineLater()); groupingActivity.setCreateDateTime(new Date()); groupingActivity.setRunOffline(originalActivity.getRunOffline()); 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.15 -r1.16 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/LearningDesign.java 7 Jun 2005 05:40:34 -0000 1.15 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/LearningDesign.java 21 Aug 2005 23:55:20 -0000 1.16 @@ -150,6 +150,13 @@ /** persistent field*/ private Date lastModifiedDateTime; + /** Offline Instruction for this activity*/ + private String offlineInstructions; + + /** Online Instructions for this activity*/ + private String onlineInstructions; + + /** full constructor */ public LearningDesign( Long learningDesignId, @@ -171,7 +178,9 @@ Set activities, Long duration, String licenseText, - License license) { + License license, + String offlineInstructions, + String onlineInstructions) { this.learningDesignId = learningDesignId; this.learningDesignUIID = ui_id; this.description = description; @@ -194,6 +203,8 @@ this.duration = duration; this.licenseText = licenseText; this.license = license; + this.offlineInstructions = offlineInstructions; + this.onlineInstructions = onlineInstructions; } /** default constructor */ @@ -492,6 +503,21 @@ public void setLastModifiedDateTime(Date lastModifiedDateTime) { this.lastModifiedDateTime = lastModifiedDateTime; } + + public String getOfflineInstructions() { + return this.offlineInstructions; + } + public void setOfflineInstructions(String offlineInstructions) { + this.offlineInstructions = offlineInstructions; + } + public String getOnlineInstructions() { + return onlineInstructions; + } + public void setOnlineInstructions(String onlineInstructions) { + this.onlineInstructions = onlineInstructions; + } + + public LearningDesignDTO getLearningDesignDTO(){ return new LearningDesignDTO(this); } Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/OptionsActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/OptionsActivity.java,v diff -u -r1.13 -r1.14 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/OptionsActivity.java 7 Jun 2005 05:40:34 -0000 1.13 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/OptionsActivity.java 21 Aug 2005 23:55:20 -0000 1.14 @@ -53,7 +53,6 @@ Integer orderId, Boolean defineLater, java.util.Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -76,7 +75,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, @@ -150,10 +148,6 @@ newOptionsActivity.setLearningLibrary(originalActivity.getLearningLibrary()); newOptionsActivity.setCreateDateTime(new Date()); newOptionsActivity.setRunOffline(originalActivity.getRunOffline()); - - newOptionsActivity.setOfflineInstructions(originalActivity.getOfflineInstructions()); - newOptionsActivity.setOnlineInstructions(originalActivity.getOnlineInstructions()); - newOptionsActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage()); newOptionsActivity.setLibraryActivity(originalActivity.getLibraryActivity()); return newOptionsActivity; Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ParallelActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/ParallelActivity.java,v diff -u -r1.14 -r1.15 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ParallelActivity.java 7 Jun 2005 05:40:35 -0000 1.14 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ParallelActivity.java 21 Aug 2005 23:55:20 -0000 1.15 @@ -44,7 +44,6 @@ Integer orderId, Boolean defineLater, java.util.Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -64,7 +63,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, @@ -138,9 +136,6 @@ newParallelActivity.setCreateDateTime(new Date()); newParallelActivity.setRunOffline(originalActivity.getRunOffline()); - newParallelActivity.setOfflineInstructions(originalActivity.getOfflineInstructions()); - newParallelActivity.setOnlineInstructions(originalActivity.getOnlineInstructions()); - newParallelActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage()); newParallelActivity.setLibraryActivity(originalActivity.getLibraryActivity()); Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/PermissionGateActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/PermissionGateActivity.java,v diff -u -r1.12 -r1.13 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/PermissionGateActivity.java 7 Jun 2005 05:40:34 -0000 1.12 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/PermissionGateActivity.java 21 Aug 2005 23:55:20 -0000 1.13 @@ -47,7 +47,6 @@ Integer orderId, Boolean defineLater, java.util.Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -69,7 +68,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, @@ -148,10 +146,6 @@ newPermissionGateActivity.setDefineLater(originalActivity.getDefineLater()); newPermissionGateActivity.setCreateDateTime(new Date()); newPermissionGateActivity.setRunOffline(originalActivity.getRunOffline()); - - newPermissionGateActivity.setOfflineInstructions(originalActivity.getOfflineInstructions()); - newPermissionGateActivity.setOnlineInstructions(originalActivity.getOnlineInstructions()); - newPermissionGateActivity.setLibraryActivity(originalActivity.getLibraryActivity()); newPermissionGateActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage()); return newPermissionGateActivity; Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ScheduleGateActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/ScheduleGateActivity.java,v diff -u -r1.16 -r1.17 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ScheduleGateActivity.java 7 Jun 2005 05:40:35 -0000 1.16 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ScheduleGateActivity.java 21 Aug 2005 23:55:20 -0000 1.17 @@ -92,7 +92,6 @@ Integer orderId, Boolean defineLater, java.util.Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -115,7 +114,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, @@ -211,10 +209,6 @@ newScheduleGateActivity.setDefineLater(originalActivity.getDefineLater()); newScheduleGateActivity.setCreateDateTime(new Date()); newScheduleGateActivity.setRunOffline(originalActivity.getRunOffline()); - - newScheduleGateActivity.setOfflineInstructions(originalActivity.getOfflineInstructions()); - newScheduleGateActivity.setOnlineInstructions(originalActivity.getOnlineInstructions()); - newScheduleGateActivity.setLibraryActivity(originalActivity.getLibraryActivity()); newScheduleGateActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage()); Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/SequenceActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/SequenceActivity.java,v diff -u -r1.14 -r1.15 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/SequenceActivity.java 7 Jun 2005 05:40:34 -0000 1.14 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/SequenceActivity.java 21 Aug 2005 23:55:20 -0000 1.15 @@ -45,7 +45,6 @@ Integer orderId, Boolean defineLater, java.util.Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -65,7 +64,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, @@ -139,9 +137,6 @@ newSequenceActivity.setCreateDateTime(new Date()); newSequenceActivity.setRunOffline(originalActivity.getRunOffline()); - newSequenceActivity.setOfflineInstructions(originalActivity.getOfflineInstructions()); - newSequenceActivity.setOnlineInstructions(originalActivity.getOnlineInstructions()); - newSequenceActivity.setLibraryActivity(originalActivity.getLibraryActivity()); newSequenceActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage()); Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/SimpleActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/SimpleActivity.java,v diff -u -r1.6 -r1.7 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/SimpleActivity.java 7 Jun 2005 05:40:34 -0000 1.6 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/SimpleActivity.java 21 Aug 2005 23:55:20 -0000 1.7 @@ -46,7 +46,6 @@ Integer orderId, Boolean defineLater, Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -64,7 +63,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/SynchGateActivity.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/SynchGateActivity.java,v diff -u -r1.12 -r1.13 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/SynchGateActivity.java 7 Jun 2005 05:40:34 -0000 1.12 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/SynchGateActivity.java 21 Aug 2005 23:55:20 -0000 1.13 @@ -46,7 +46,6 @@ Integer orderId, Boolean defineLater, java.util.Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -67,7 +66,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, @@ -146,10 +144,6 @@ newSynchGateActivity.setDefineLater(originalActivity.getDefineLater()); newSynchGateActivity.setCreateDateTime(new Date()); newSynchGateActivity.setRunOffline(originalActivity.getRunOffline()); - - newSynchGateActivity.setOfflineInstructions(originalActivity.getOfflineInstructions()); - newSynchGateActivity.setOnlineInstructions(originalActivity.getOnlineInstructions()); - newSynchGateActivity.setLibraryActivity(originalActivity.getLibraryActivity()); newSynchGateActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage()); 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.15 -r1.16 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolActivity.java 7 Jun 2005 05:40:35 -0000 1.15 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolActivity.java 21 Aug 2005 23:55:20 -0000 1.16 @@ -63,7 +63,6 @@ Integer orderId, Boolean defineLater, java.util.Date createDateTime, - String offlineInstructions, LearningLibrary learningLibrary, Activity parentActivity, Activity libraryActivity, @@ -85,7 +84,6 @@ orderId, defineLater, createDateTime, - offlineInstructions, learningLibrary, parentActivity, libraryActivity, @@ -163,10 +161,6 @@ newToolActivity.setLearningLibrary(originalActivity.getLearningLibrary()); newToolActivity.setCreateDateTime(new Date()); newToolActivity.setRunOffline(originalActivity.getRunOffline()); - - newToolActivity.setOfflineInstructions(originalActivity.getOfflineInstructions()); - newToolActivity.setOnlineInstructions(originalActivity.getOnlineInstructions()); - newToolActivity.setActivityCategoryID(originalActivity.getActivityCategoryID()); newToolActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage()); newToolActivity.setLibraryActivity(originalActivity.getLibraryActivity()); 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.5 -r1.6 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java 5 Jun 2005 23:33:51 -0000 1.5 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java 21 Aug 2005 23:55:20 -0000 1.6 @@ -111,12 +111,6 @@ /** Indicates whether this activity is available offline*/ private Boolean runOffline; - /** Offline Instruction for this activity*/ - private String offlineInstructions; - - /** Online Instruction for this activity*/ - private String onlineInstructions; - /** Maximum number of activities to be attempted */ private Integer maxOptions; @@ -179,7 +173,6 @@ Integer activityTypeId, Long groupingID, Integer groupingUIID, Integer orderID, Boolean defineLater, Long learningDesignID, Long learningLibraryID, Date createDateTime, Boolean runOffline, - String offlineInstructions, String onlineInstructions, Integer maxOptions, Integer minOptions, String optionsInstructions, Long toolID, Long toolContentID, Integer activityCategoryID, Integer gateActivityLevelID, @@ -208,8 +201,6 @@ this.learningLibraryID = learningLibraryID; this.createDateTime = createDateTime; this.runOffline = runOffline; - this.offlineInstructions = offlineInstructions; - this.onlineInstructions = onlineInstructions; this.maxOptions = maxOptions; this.minOptions = minOptions; this.optionsInstructions = optionsInstructions; @@ -262,8 +253,6 @@ WDDXTAGS.NUMERIC_NULL_VALUE_LONG; this.createDateTime = activity.getCreateDateTime(); this.runOffline = activity.getRunOffline(); - this.offlineInstructions = activity.getOfflineInstructions(); - this.onlineInstructions = activity.getOnlineInstructions(); this.activityCategoryID = activity.getActivityCategoryID(); this.libraryActivityUiImage = activity.getLibraryActivityUiImage(); this.libraryActivityID = activity.getLibraryActivity()!=null? @@ -310,10 +299,6 @@ this.createDateTime = (Date)activityDetails.get("createDateTime"); if(activityDetails.containsKey("runOffline")) this.runOffline = (Boolean) activityDetails.get("runOffline"); - if(activityDetails.containsKey("offlineInstructions")) - this.offlineInstructions= (String) activityDetails.get("offlineInstructions"); - if(activityDetails.containsKey("onlineInstructions")) - this.onlineInstructions =(String) activityDetails.get("onlineInstructions"); if(activityDetails.containsKey("maxOptions")) this.maxOptions = convertToInteger(activityDetails.get("maxOptions")); if(activityDetails.containsKey("minOptions")) @@ -572,12 +557,6 @@ return minOptions!=null?minOptions:WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER; } /** - * @return Returns the offlineInstructions. - */ - public String getOfflineInstructions() { - return offlineInstructions!=null?offlineInstructions:WDDXTAGS.STRING_NULL_VALUE; - } - /** * @return Returns the optionsInstructions. */ public String getOptionsInstructions() { @@ -807,13 +786,6 @@ this.minOptions = minOptions; } /** - * @param offlineInstructions The offlineInstructions to set. - */ - public void setOfflineInstructions(String offlineInstructions) { - if(!offlineInstructions.equals(WDDXTAGS.STRING_NULL_VALUE)) - this.offlineInstructions = offlineInstructions; - } - /** * @param optionsInstructions The optionsInstructions to set. */ public void setOptionsInstructions(String optionsInstructions) { @@ -883,19 +855,6 @@ this.ycoord = ycoord; } /** - * @return Returns the onlineInstructions. - */ - public String getOnlineInstructions() { - return onlineInstructions!=null?onlineInstructions:WDDXTAGS.STRING_NULL_VALUE; - } - /** - * @param onlineInstructions The onlineInstructions to set. - */ - public void setOnlineInstructions(String onlineInstructions) { - if(!onlineInstructions.equals(WDDXTAGS.STRING_NULL_VALUE)) - this.onlineInstructions = onlineInstructions; - } - /** * @return Returns the applyGrouping. */ public Boolean getApplyGrouping() { Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/BaseDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/BaseDTO.java,v diff -u -r1.2 -r1.3 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/BaseDTO.java 2 Jun 2005 02:00:00 -0000 1.2 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/BaseDTO.java 21 Aug 2005 23:55:20 -0000 1.3 @@ -54,12 +54,13 @@ * @return Integer The required value */ public Integer convertToInteger(Object ob){ - Double doub = (Double)ob; - Integer integer = new Integer(doub.intValue()); - if(!integer.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER)) - return integer; - else - return null; + if ( ob != null ) { + Double doub = (Double)ob; + Integer integer = new Integer(doub.intValue()); + if(!integer.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER)) + return integer; + } + return null; } /** * This method converts the passed @@ -69,11 +70,12 @@ * @return Long The required value */ public Long convertToLong(Object ob){ - Double doub = (Double)ob; - Long longValue = new Long(doub.longValue()); - if(!longValue.equals(WDDXTAGS.NUMERIC_NULL_VALUE_LONG)) - return longValue; - else - return null; + if ( ob != null ) { + Double doub = (Double)ob; + Long longValue = new Long(doub.longValue()); + if(!longValue.equals(WDDXTAGS.NUMERIC_NULL_VALUE_LONG)) + return longValue; + } + return null; } } 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.6 -r1.7 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/LearningDesignDTO.java 5 Jun 2005 23:30:58 -0000 1.6 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/LearningDesignDTO.java 21 Aug 2005 23:55:20 -0000 1.7 @@ -66,6 +66,8 @@ private String lessonName; private Date lessonStartDateTime; private Date lastModifiedDateTime; + private String offlineInstructions; + private String onlineInstructions; private ArrayList activities; private ArrayList transitions; @@ -97,7 +99,9 @@ Long lessonID, String lessonName, Date lessonStartDateTime, - Date lastModifiedDateTime) { + Date lastModifiedDateTime, + String offlineInstructions, + String onlineInstructions) { super(); this.learningDesignID = learningDesignId; this.learningDesignUIID = learningDesignUIID; @@ -109,6 +113,8 @@ this.validDesign = validDesign; this.readOnly = readOnly; this.dateReadOnly = dateReadOnly; + this.offlineInstructions = offlineInstructions; + this.onlineInstructions = onlineInstructions; this.userID = userID; this.helpText = helpText; this.copyTypeID = copyTypeID; @@ -144,6 +150,9 @@ this.readOnly = learningDesign.getReadOnly(); this.dateReadOnly = learningDesign.getDateReadOnly(); + this.offlineInstructions = learningDesign.getOfflineInstructions(); + this.onlineInstructions = learningDesign.getOnlineInstructions(); + this.userID = learningDesign.getUser()!=null? learningDesign.getUser().getUserId(): WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER; @@ -188,6 +197,8 @@ this.validDesign = (Boolean)table.get("validDesign"); this.readOnly = (Boolean)table.get("readOnly");; this.dateReadOnly = (Date)table.get("dateReadOnly"); + this.offlineInstructions= (String) table.get("offlineInstructions"); + this.onlineInstructions =(String) table.get("onlineInstructions"); this.userID = convertToInteger(table.get("userID")); this.helpText = (String)table.get("helpText"); this.copyTypeID = convertToInteger(table.get("copyTypeID")); @@ -601,6 +612,33 @@ if(!firstActivityUIID.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER)) this.firstActivityUIID = firstActivityUIID; } + /** + * @return Returns the onlineInstructions. + */ + public String getOnlineInstructions() { + return onlineInstructions!=null?onlineInstructions:WDDXTAGS.STRING_NULL_VALUE; + } + /** + * @param onlineInstructions The onlineInstructions to set. + */ + public void setOnlineInstructions(String onlineInstructions) { + if(!onlineInstructions.equals(WDDXTAGS.STRING_NULL_VALUE)) + this.onlineInstructions = onlineInstructions; + } + /** + * @param offlineInstructions The offlineInstructions to set. + */ + public void setOfflineInstructions(String offlineInstructions) { + if(!offlineInstructions.equals(WDDXTAGS.STRING_NULL_VALUE)) + this.offlineInstructions = offlineInstructions; + } + /** + * @return Returns the offlineInstructions. + */ + public String getOfflineInstructions() { + return offlineInstructions!=null?offlineInstructions:WDDXTAGS.STRING_NULL_VALUE; + } + public static LearningDesign extractLearningDesign(LearningDesignDTO learningDesignDTO){ LearningDesign learningDesign = new LearningDesign(); if(!learningDesignDTO.getLearningDesignUIID().equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER)) @@ -619,6 +657,10 @@ learningDesign.setCopyTypeID(learningDesignDTO.getCopyTypeID()); if(!learningDesignDTO.getHelpText().equals(WDDXTAGS.STRING_NULL_VALUE)) learningDesign.setHelpText(learningDesignDTO.getHelpText()); + if(!learningDesignDTO.getOfflineInstructions().equals(WDDXTAGS.STRING_NULL_VALUE)) + learningDesign.setHelpText(learningDesignDTO.getOfflineInstructions()); + if(!learningDesignDTO.getOnlineInstructions().equals(WDDXTAGS.STRING_NULL_VALUE)) + learningDesign.setHelpText(learningDesignDTO.getOnlineInstructions()); if(!learningDesignDTO.getVersion().equals(WDDXTAGS.STRING_NULL_VALUE)) learningDesign.setVersion(learningDesignDTO.getVersion()); if(!learningDesignDTO.getLicenseText().equals(WDDXTAGS.STRING_NULL_VALUE)) Index: lams_common/src/java/org/lamsfoundation/lams/themes/CSSProperty.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/Attic/CSSProperty.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/CSSProperty.java 21 Aug 2005 23:55:20 -0000 1.1 @@ -0,0 +1,223 @@ +package org.lamsfoundation.lams.themes; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; + +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + * @hibernate.class + * table="lams_css_property" + * +*/ +public class CSSProperty implements Serializable { + + /** identifier field */ + private Long propertyId; + + /** persistent field */ + private String name; + + /** persistent field */ + private String value; + + /** persistent field */ + private byte type; + + /** persistent field */ + private String styleSubset; + + /** persistent field */ + private CSSStyle style; + + /** full constructor */ + public CSSProperty(Long propertyId, String name, String value, byte type, String styleSubset, CSSStyle style) { + this.propertyId = propertyId; + this.name = name; + this.value = value; + this.type = type; + this.styleSubset = styleSubset; + this.style = style; + } + + /** Create a property using just the name and the value (and any style subset e.g. _tf). + * Generates the appropriate type. */ + public CSSProperty(String name, Object value, String styleSubset) { + this.name = name; + this.value = value != null ? value.toString() : null; + this.type = getValueType(value); + this.styleSubset = styleSubset; + } + + /** default constructor */ + public CSSProperty() { + } + + /** + * @hibernate.id + * generator-class="assigned" + * type="java.lang.Long" + * column="property_id" + * + */ + public Long getPropertyId() { + return this.propertyId; + } + + public void setPropertyId(Long propertyId) { + this.propertyId = propertyId; + } + + /** + * @hibernate.property + * column="name" + * length="255" + * not-null="true" + * + */ + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @hibernate.property + * column="value" + * length="100" + * not-null="true" + * + */ + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + /** + * Should be a value in PropertyType. + * + * @hibernate.property + * column="type" + * length="4" + * not-null="true" + * + */ + public byte getType() { + return this.type; + } + + public void setType(byte type) { + this.type = type; + } + + /** + * @hibernate.property + * column="style_subset" + * length="20" + * not-null="true" + * + */ + public String getStyleSubset() { + return this.styleSubset; + } + + public void setStyleSubset(String styleSubset) { + this.styleSubset = styleSubset; + } + + /** + * @hibernate.many-to-one + * not-null="true" + * cascade="none" + * update="true" + * insert="true" + * @hibernate.column name="style_id" + * + */ + public CSSStyle getStyle() { + return this.style; + } + + public void setStyle(CSSStyle style) { + this.style = style; + } + + public String toString() { + return new ToStringBuilder(this) + .append("propertyId", getPropertyId()) + .append("name", name) + .append("value", value) + .append("type", type) + .append("styleSubset",styleSubset) + .toString(); + } + + /** Get the value of the property as its correct type e.g. Integer */ + public Object getValueAsObject() throws NumberFormatException, ParseException { + if ( value != null ) { + switch ( getType() ) { + case PropertyType.BOOLEAN: + return Boolean.valueOf(value); + case PropertyType.DATE: + return getDate(); + case PropertyType.DOUBLE: + return Double.valueOf(value); + case PropertyType.LONG: + return Long.valueOf(value); + default: + return (String) value; + } + } else { + return null; + } + } + + /** Determines the object's appropriate type. Coded in order of most expected to least expected. */ + protected byte getValueType(Object value) { + if ( value != null ) { + if ( String.class.isInstance(value)) { + return PropertyType.STRING; + } + if ( Boolean.class.isInstance(value) ) { + return PropertyType.BOOLEAN; + } + if ( Integer.class.isInstance(value) || Long.class.isInstance(value) || + Short.class.isInstance(value) || BigInteger.class.isInstance(value)) { + return PropertyType.LONG; + } + if ( Double.class.isInstance(value) || Float.class.isInstance(value) || + BigDecimal.class.isInstance(value) ) { + return PropertyType.DOUBLE; + } + if ( Calendar.class.isInstance(value) || Date.class.isInstance(value)) { + return PropertyType.DATE; + } + } + return PropertyType.STRING; + } + /** + * Returns a Calendar representation of the value. + * + * @throws ValueFormatException If able to convert the value to a Calendar. + */ + private Calendar getDate() throws ParseException { + SimpleDateFormat df = new SimpleDateFormat(); + Date date = df.parse(value); + Calendar calendar = new GregorianCalendar(); + calendar.setTime(date); + return calendar; + } + +} Index: lams_common/src/java/org/lamsfoundation/lams/themes/CSSStyle.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/Attic/CSSStyle.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/CSSStyle.java 21 Aug 2005 23:55:20 -0000 1.1 @@ -0,0 +1,113 @@ +package org.lamsfoundation.lams.themes; + +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; +import org.apache.commons.lang.builder.ToStringBuilder; + + +/** + * @hibernate.class + * table="lams_css_style" + * +*/ +public class CSSStyle implements Serializable { + + /** identifier field */ + private Long styleId; + + /** persistent field */ + private CSSThemeVisualElement themeElement; + + /** persistent field */ + private Set properties; + + /** full constructor */ + public CSSStyle(Long styleId, CSSThemeVisualElement themeElement, Set properties) { + this.styleId = styleId; + this.themeElement = themeElement; + this.properties = properties; + } + + /** default constructor */ + public CSSStyle() { + } + + /** + * @hibernate.id + * generator-class="native" + * type="java.lang.Long" + * column="style_id" + * + */ + public Long getStyleId() { + return this.styleId; + } + + public void setStyleId(Long styleId) { + this.styleId = styleId; + } + + /** + * @hibernate.set + * lazy="true" + * inverse="true" + * cascade="all" + * @hibernate.collection-key + * column="style_id" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.themes.CSSProperty" + * + */ + public Set getProperties() { + return this.properties; + } + + private void setProperties(Set properties) { + this.properties = properties; + } + + /** Clear all the current properties of this style */ + public void clearProperties() { + if ( getProperties() != null ) { + getProperties().clear(); + } + } + + /** Add a property to this style */ + public void addProperty(CSSProperty property) { + if ( getProperties() == null ) { + Set set = new HashSet(); + set.add(property); + setProperties(set); + } else { + getProperties().add(property); + } + property.setStyle(this); + } + + /** + * @hibernate.many-to-one + * not-null="true" + * cascade="none" + * update="true" + * insert="true" + * @hibernate.column name="theme_ve_id" + * + */ + public CSSThemeVisualElement getThemeElement() { + return this.themeElement; + } + + public void setThemeElement(CSSThemeVisualElement themeElement) { + this.themeElement = themeElement; + } + + public String toString() { + return new ToStringBuilder(this) + .append("styleId", getStyleId()) + .append("properties", getProperties()) + .toString(); + } + +} Index: lams_common/src/java/org/lamsfoundation/lams/themes/CSSThemeVisualElement.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/Attic/CSSThemeVisualElement.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/CSSThemeVisualElement.java 21 Aug 2005 23:55:20 -0000 1.1 @@ -0,0 +1,297 @@ +package org.lamsfoundation.lams.themes; + +import java.io.Serializable; +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.usermanagement.User; + + +/** + * @hibernate.class + * table="lams_css_theme_ve" + * + * Models both a theme, and the visual elements that make up a theme. If we ever have + * themes within themes then this data structure will support that too! + * + * The isTheme() call will tell you if this is a theme or a visual element. + * +*/ +public class CSSThemeVisualElement implements Serializable { + + protected Logger log = Logger.getLogger(CSSThemeVisualElement.class); + + /** identifier field */ + private Long id; + + /** persistent field */ + private String name; + + /** nullable persistent field */ + private String description; + + /** persistent field */ + private boolean theme; + + /** nullable persistent field */ + private CSSThemeVisualElement parentTheme; + + /** persistent field */ + private Set users; + + /** persistent field */ + private Set styles; + + /** persistent field */ + private Set elements; + + /** full constructor */ + public CSSThemeVisualElement(Long id, String name, String description, boolean theme, CSSThemeVisualElement parentTheme, Set styles, Set users, Set elements) { + this.id = id; + this.name = name; + this.description = description; + this.theme = theme; + this.parentTheme = parentTheme; + this.styles = styles; + this.users = users; + this.elements = elements; + } + + /** default constructor */ + public CSSThemeVisualElement() { + } + + /** minimal constructor */ + public CSSThemeVisualElement(Long id, String name, boolean theme) { + this.id = id; + this.name = name; + this.theme = theme; + } + + /** + * @hibernate.id + * generator-class="assigned" + * type="java.lang.Long" + * column="theme_ve_id" + * + */ + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + /** + * @hibernate.property + * column="name" + * length="100" + * not-null="true" + * + */ + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * @hibernate.property + * column="description" + * length="100" + * + */ + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * @hibernate.property + * column="theme_flag" + * length="1" + * not-null="true" + * + */ + public boolean isTheme() { + return this.theme; + } + + public void setTheme(boolean theme) { + this.theme = theme; + } + + /** + * If a theme, then this is the base style. If a visual element, then + * it is the style for this element. + */ + public CSSStyle getStyle() { + Set styleSet = getStyles(); + if ( styleSet != null ) + if ( styleSet.size() > 1 ) { + log.warn("Theme/Visual element has more than one style - only one can be used. "+this); + } + if ( styleSet.size() > 0 ) { + return (CSSStyle) styleSet.iterator().next(); + } + return null; + } + + /** + * If a theme, then this is the base style. If a visual element, then + * it is the style for this element. + */ + public void setStyle(CSSStyle style) { + if ( getStyles() != null ) { + getStyles().clear(); + getStyles().add(style); + } else { + Set styleSet = new HashSet(); + styleSet.add(style); + setStyles(styleSet); + } + style.setThemeElement(this); + } + + /** + * + * This is really a 1-1 as each theme/visual element has style should only be for one theme. Even if the + * values are the same, two styles should have different baseStyle records. + * But its easier with Hibernate to make it a uni-directional many to one. + * + * @hibernate.set + * lazy="true" + * inverse="true" + * cascade="all-delete-orphan" + * + * @hibernate.collection-key + * column="theme_ve_id" + * + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.themes.CSSStyle" + * + */ + private Set getStyles() { + return this.styles; + } + + private void setStyles(Set styles) { + this.styles = styles; + } + + /** + * + * Users who have this theme as their style. + * + * @hibernate.set + * lazy="true" + * inverse="true" + * cascade="none" + * @hibernate.collection-key + * column="theme_id" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.usermanagement.User" + * + */ + private Set getUsers() { + return this.users; + } + + private void setUsers(Set users) { + this.users = users; + } + + public void clearUsers() { + if ( getUsers() != null ) { + getUsers().clear(); + } + } + + public void addUser(User user) { + if ( getUsers() == null ) { + Set set = new HashSet(); + set.add(user); + setUsers(set); + } else { + getUsers().add(user); + } + user.setTheme(this); + } + + /** + * + * The visual elements (or in the future sub-themes) that make up this theme + * + * @hibernate.set + * lazy="true" + * inverse="true" + * cascade="all-delete-orphan" + * @hibernate.collection-key + * column="parent_id" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.themes.CSSThemeVisualElement" + * + */ + public Set getElements() { + return this.elements; + } + + private void setElements(Set elements) { + this.elements = elements; + } + + public void clearElements() { + if ( getElements() != null ) { + getElements().clear(); + } + } + + public void addElement(CSSThemeVisualElement element) { + if ( getElements() == null ) { + Set set = new HashSet(); + set.add(element); + setElements(set); + } else { + getElements().add(element); + } + element.setParentTheme(this); + } + + /** + * @hibernate.many-to-one + * not-null="true" + * cascade="none" + * update="true" + * insert="true" + * @hibernate.column name="parent_id" + * + */ + public CSSThemeVisualElement getParentTheme() { + return this.parentTheme; + } + + public void setParentTheme(CSSThemeVisualElement parentTheme) { + this.parentTheme = parentTheme; + } + + public String toString() { + return new ToStringBuilder(this) + .append("id", getId()) + .append("name", getName()) + .append("description", getDescription()) + .append("is theme?", isTheme()) + .append("style", getStyle()) + .append("visual elements", getElements()) + .append("parent theme", getParentTheme()) + .toString(); + } + +} Index: lams_common/src/java/org/lamsfoundation/lams/themes/PropertyType.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/Attic/PropertyType.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/PropertyType.java 21 Aug 2005 23:55:20 -0000 1.1 @@ -0,0 +1,96 @@ +/* + Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA + + http://www.gnu.org/licenses/gpl.txt +*/ + +package org.lamsfoundation.lams.themes; + +/** + * LAMS property types. + */ +public final class PropertyType { + /** String property type */ + public static final int STRING = 1; + /** Long property type */ + public static final int LONG = 2; + /** Double property type */ + public static final int DOUBLE = 3; + /** Date property type */ + public static final int DATE = 4; + /** Boolean property type */ + public static final int BOOLEAN = 5; + + /** + * The names of the supported property types, + * as used to convert to . + */ + public static final String TYPENAME_STRING = "String"; + public static final String TYPENAME_LONG = "Long"; + public static final String TYPENAME_DOUBLE = "Double"; + public static final String TYPENAME_DATE = "Date"; + public static final String TYPENAME_BOOLEAN = "Boolean"; + + /** + * Returns the name of the specified type. + * @param type the property type + * @return the name of the specified type, defaults to String if no match. + */ + public static String nameFromValue(int type) { + switch (type) { + case STRING: + return TYPENAME_STRING; + case BOOLEAN: + return TYPENAME_BOOLEAN; + case LONG: + return TYPENAME_LONG; + case DOUBLE: + return TYPENAME_DOUBLE; + case DATE: + return TYPENAME_DATE; + default: + return TYPENAME_STRING; + } + } + + /** + * Returns the numeric constant value of the type with the specified name. + * @param name the name of the property type + * @return the numeric constant value, defaulting to String if name not recognised. + */ + public static int valueFromName(String name) { + if (name.equals(TYPENAME_STRING)) { + return STRING; + } else if (name.equals(TYPENAME_BOOLEAN)) { + return BOOLEAN; + } else if (name.equals(TYPENAME_LONG)) { + return LONG; + } else if (name.equals(TYPENAME_DOUBLE)) { + return DOUBLE; + } else if (name.equals(TYPENAME_DATE)) { + return DATE; + } else { + return STRING; + } + } + + /** private constructor to prevent instantiation */ + private PropertyType() { + } +} + Index: lams_common/src/java/org/lamsfoundation/lams/themes/dao/ICSSThemeDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/dao/ICSSThemeDAO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/dao/ICSSThemeDAO.java 21 Aug 2005 23:55:21 -0000 1.1 @@ -0,0 +1,45 @@ +/* + Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA + + http://www.gnu.org/licenses/gpl.txt + */ +package org.lamsfoundation.lams.themes.dao; + +import java.util.List; + +import org.lamsfoundation.lams.themes.CSSThemeVisualElement; + +/** + * This class interacts with Spring's HibernateTemplate to save/delete and + * retrieve CSSTheme and other related objects. + * + * @author Fiona Malikoff + */ +public interface ICSSThemeDAO { + public abstract List getAllThemes(); + + public abstract CSSThemeVisualElement getThemeById(Long themeId); + + public abstract List getThemeByName(String name); + + public abstract void saveOrUpdateTheme(CSSThemeVisualElement theme); + + public abstract void deleteTheme(CSSThemeVisualElement theme); + + public abstract void deleteThemeById(Long themeId); +} \ No newline at end of file Index: lams_common/src/java/org/lamsfoundation/lams/themes/dao/hibernate/CSSThemeDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/dao/hibernate/CSSThemeDAO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/dao/hibernate/CSSThemeDAO.java 21 Aug 2005 23:55:20 -0000 1.1 @@ -0,0 +1,70 @@ +/* + * Created on Nov 20, 2004 + * + * Last modified on 20 Nov, 2004 + */ +package org.lamsfoundation.lams.themes.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.themes.CSSThemeVisualElement; +import org.lamsfoundation.lams.themes.dao.ICSSThemeDAO; +import org.springframework.orm.hibernate.support.HibernateDaoSupport; + +/** + * This class interacts with Spring's HibernateTemplate to save/delete and + * retrieve CSSThemeVisualElement and other related objects. + * + * @author Fiona Malikoff +*/ +public class CSSThemeDAO extends HibernateDaoSupport implements ICSSThemeDAO { + + /** + * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#getAllThemes() + */ + public List getAllThemes() { + return getHibernateTemplate().find("from CSSThemeVisualElement c where c.theme=true"); + } + + /** + * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#getThemeById(java.lang.Long) + */ + public CSSThemeVisualElement getThemeById(Long themeId) { + String queryString = "from CSSThemeVisualElement c where c.id=?"; + List list = getHibernateTemplate().find(queryString,themeId); + if ( list != null && list.size() > 0 ) + return (CSSThemeVisualElement) list.get(0); + else + return null; + } + + /** + * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#getThemeByName(java.lang.String) + */ + public List getThemeByName(String name) { + String queryString = "from CSSThemeVisualElement c where c.name=? and c.theme=true"; + return getHibernateTemplate().find(queryString,name); + } + + /** + * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#saveOrUpdateTheme(org.lamsfoundation.lams.usermanagement.User) + */ + public void saveOrUpdateTheme(CSSThemeVisualElement theme) { + getHibernateTemplate().saveOrUpdate(theme); + } + + /** + * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#deleteTheme(org.lamsfoundation.lams.usermanagement.User) + */ + public void deleteTheme(CSSThemeVisualElement theme) { + getHibernateTemplate().delete(theme); + } + + /** + * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#deleteUserById(java.lang.Integer) + */ + public void deleteThemeById(Long themeId) { + getHibernateTemplate().delete(getThemeById(themeId)); + } + +} Index: lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSStyleDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/dto/Attic/CSSStyleDTO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSStyleDTO.java 21 Aug 2005 23:55:21 -0000 1.1 @@ -0,0 +1,156 @@ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ +package org.lamsfoundation.lams.themes.dto; + +import java.text.ParseException; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.themes.CSSProperty; +import org.lamsfoundation.lams.themes.CSSStyle; + +/** + * Models the Theme structure that is used to communicate with Flash. + * Includes all the information from Theme down to each individual property. + * Based on the native Flash structure for Style objects. + * + * This class extends Hashtable to make it look like the normal Flash object + * structure in a wddx packet. This class does not implement the Map interface. + * + * @author Fiona Malikoff + */ +public class CSSStyleDTO extends Hashtable { + + protected Logger log = Logger.getLogger(CSSStyleDTO.class); + + /** + * Create the DTO using the data from Flash + * + * @param styleHashtable + */ + public CSSStyleDTO(Hashtable styleHashtable) { + super(styleHashtable); + } + + /** + * Create the DTO from a database object. + * + * @param styleObject + * @throws ParseException + */ + public CSSStyleDTO(CSSStyle styleObject) { + super.put(CSSThemeDTO.TEXT_FORMAT_TAG, new Hashtable()); + Set properties = styleObject.getProperties(); + if ( properties != null && properties.size() > 0 ) { + Iterator iter = properties.iterator(); + while (iter.hasNext()) { + CSSProperty element = (CSSProperty) iter.next(); + add(element); + } + } + } + + /** + * Create the database object from this DTO. Can only create + * a whole new object as the id isn't stored in the DTO. + * + * Don't call it getCSSStyle, or CSSStyle will be be written out in the + * WDDX packet created from the DTO! + */ + public CSSStyle createNewCSSStyle() { + CSSStyle style = new CSSStyle(); + if ( this.size() > 0 ) { + Iterator iter= this.entrySet().iterator(); + while (iter.hasNext()) { + Map.Entry element = (Map.Entry) iter.next(); + String key = (String) element.getKey(); + Object value = element.getValue(); + if ( CSSThemeDTO.TEXT_FORMAT_TAG.equals(key) && Map.class.isInstance(value) ) { + processTF((Map)value, style); + } else { + CSSProperty property = new CSSProperty(key, value, null); + style.addProperty(property); + } + } + } + return style; + } + + /** Flatten the _tf entries, marking them using the styleSubset field */ + private void processTF(Map tfMap, CSSStyle style) { + Iterator iter = tfMap.entrySet().iterator(); + while (iter.hasNext()) { + Map.Entry element = (Map.Entry) iter.next(); + String key = (String) element.getKey(); + Object value = element.getValue(); + CSSProperty property = new CSSProperty(key, value, CSSThemeDTO.TEXT_FORMAT_TAG); + style.addProperty(property); + } + } + + /** Can't do a putAll on this special class */ + public void putAll(Map m) { + return; + } + + /** Can't put any arbitrary object in this special class */ + public Object put(Object key, Object value) { + return null; + } + + /** + * Add a database property object to this style object, doing the necessary conversions. + * + * @param property + * @throws NumberFormatException + * @throws ParseException + */ + public void add(CSSProperty property) { + try { + if ( CSSThemeDTO.TEXT_FORMAT_TAG.equals(property.getStyleSubset()) ) { + Hashtable tf = (Hashtable) this.get(CSSThemeDTO.TEXT_FORMAT_TAG); + tf.put(property.getName(), property.getValueAsObject() ); + } else { + super.put(property.getName(), property.getValueAsObject() ); + } + } catch ( NumberFormatException e ) { + log.error("NumberFormatException thrown processing property "+property+". Skipping this property",e); + } catch ( ParseException e ) { + log.error("ParseException thrown processing property "+property+". Skipping this property",e); + } + } + + public String toString() { + StringBuffer buf = new StringBuffer(1000); + buf.append("[CSSStyleDTO: "); + Iterator iter = this.entrySet().iterator(); + while (iter.hasNext()) { + Map.Entry element = (Map.Entry) iter.next(); + buf.append(element.getKey()+"="+element.getValue()); + } + buf.append("]"); + return buf.toString(); + } + +} Index: lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeBriefDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeBriefDTO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeBriefDTO.java 21 Aug 2005 23:55:21 -0000 1.1 @@ -0,0 +1,77 @@ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ +package org.lamsfoundation.lams.themes.dto; + +import org.lamsfoundation.lams.learningdesign.dto.BaseDTO; +import org.lamsfoundation.lams.themes.CSSThemeVisualElement; + +/** + * Contains only the basic details for a theme - name, id, etc. Does not + * contain any of the style details. Designed for returning the list + * of all themes to Flash. + * + * @author Fiona Malikoff + */ +public class CSSThemeBriefDTO extends BaseDTO { + + public final static String ID_TAG = "id"; + public final static String NAME_TAG = "name"; + public final static String DESCRIPTION_TAG = "description"; + + /* The variables must have the same names as the tags above, or the WDDX packet will have the + * wrong tag names when sent to Flash. We can model the visual elements as CSSVisualElementDTO + * any arbitrary Java class to a hashtable. There is no point modelling the style objects + * as anything but a hashtable, as all they contain are properties. + */ + private Long id; + private String name; + private String description; + + /** + * Create the DTO from a database object. + */ + public CSSThemeBriefDTO(CSSThemeVisualElement theme) { + if ( theme != null ) { + this.id = theme.getId(); + this.name = theme.getName(); + this.description = theme.getDescription(); + } + } + + /** + * @return Returns the description. + */ + public String getDescription() { + return description; + } + /** + * @return Returns the id. + */ + public Long getId() { + return id; + } + /** + * @return Returns the name. + */ + public String getName() { + return name; + } +} Index: lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeDTO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeDTO.java 21 Aug 2005 23:55:21 -0000 1.1 @@ -0,0 +1,217 @@ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ +package org.lamsfoundation.lams.themes.dto; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.learningdesign.dto.BaseDTO; +import org.lamsfoundation.lams.themes.CSSThemeVisualElement; + +/** + * Models the Theme structure that is used to communicate with Flash. + * Includes all the information from Theme down to each individual property. + * Based on the native Flash structure for Style objects. + * + * @author Fiona Malikoff + */ +public class CSSThemeDTO extends BaseDTO { + + protected Logger log = Logger.getLogger(CSSThemeDTO.class); + + public final static String ID_TAG = "id"; + public final static String NAME_TAG = "name"; + public final static String DESCRIPTION_TAG = "description"; + public final static String BASE_STYLE_OBJECT_TAG = "baseStyleObject"; + public final static String VISUAL_ELEMENTS_TAG = "visualElements"; + public final static String TEXT_FORMAT_TAG = "_tf"; + public final static String STYLE_OBJECT_TAG = "styleObject"; + + /* The variables must have the same names as the tags above, or the WDDX packet will have the + * wrong tag names when sent to Flash. We can model the visual elements as CSSVisualElementDTO + * any arbitrary Java class to a hashtable. There is no point modelling the style objects + * as anything but a hashtable, as all they contain are properties. + */ + private Long id; + private String name; + private String description; + private CSSStyleDTO baseStyleObject; + private List visualElements; + + /** + * Create the DTO using the data from Flash + */ + public CSSThemeDTO(Hashtable wddxData) { + if ( wddxData != null ) { + this.id = convertToLong(wddxData.get(ID_TAG)); + this.name = (String) wddxData.get(NAME_TAG); + this.description = (String) wddxData.get(DESCRIPTION_TAG); + Hashtable so = (Hashtable) wddxData.get(BASE_STYLE_OBJECT_TAG); + if ( so != null ) { + baseStyleObject = new CSSStyleDTO(so); + } + List ve = (List) wddxData.get(VISUAL_ELEMENTS_TAG); + if ( ve != null ) { + int numElements = ve.size(); + visualElements = new ArrayList(numElements); + Iterator iter = ve.iterator(); + while ( iter.hasNext() ) { + visualElements.add(new CSSVisualElementDTO((Hashtable) iter.next())); + } + } + } + } + + /** + * Create the DTO from a database object. + * + * @throws ParseException + * + */ + public CSSThemeDTO (CSSThemeVisualElement theme){ + if ( theme != null ) { + this.id = theme.getId(); + this.name = theme.getName(); + this.description = theme.getDescription(); + if ( theme.getStyle()!= null ) { + this.baseStyleObject = new CSSStyleDTO(theme.getStyle()); + } + if ( theme.getElements() != null ) { + int numElements = theme.getElements().size(); + if ( numElements > 0 ) { + this.visualElements = new ArrayList(numElements); + Iterator iter = theme.getElements().iterator(); + while ( iter.hasNext() ) { + CSSThemeVisualElement element = (CSSThemeVisualElement) iter.next(); + if ( element.isTheme() ) { + log.error("Theme found within another theme. Flash packet currently doesn't support this format. " + +" Theme being skipped. "+element); + } else { + this.visualElements.add(new CSSVisualElementDTO(element)); + } + } + } + } + } + } + + /** + * Creates the database format object from this DTO. Does not look up any + * existing entries in the database. Does not set the users field. + * + * Don't call it getCSSTheme, or CSSTheme will be be written out in the + * WDDX packet created from the DTO! + */ + public CSSThemeVisualElement createCSSThemeVisualElement() { + CSSThemeVisualElement theme = new CSSThemeVisualElement(); + if ( baseStyleObject != null ) { + theme.setStyle(baseStyleObject.createNewCSSStyle()); + } + theme.setDescription(description); + theme.setName(name); + theme.setId(id); + theme.setTheme(true); + if ( visualElements != null && visualElements.size() > 0 ) { + Iterator iter = visualElements.iterator(); + while (iter.hasNext()) { + CSSVisualElementDTO element = (CSSVisualElementDTO) iter.next(); + theme.addElement(element.createCSSThemeVisualElement()); + } + } + return theme; + } + + /** + * Update an existing CSSTheme object ( probably from the database) with the + * current values. Arguably this functionality belongs in the CSSTheme object but + * that would confused matters as some of the field copying code would be in + * this object, and other bits would be in the CSSTheme object. Does not + * change the user's field. + * + * Changes the parameter object (currentTheme) and returns the modified object. + */ + public CSSThemeVisualElement updateCSSTheme(CSSThemeVisualElement currentTheme) { + if ( baseStyleObject != null ) { + currentTheme.setStyle(baseStyleObject.createNewCSSStyle()); + } else { + currentTheme.setStyle(null); + } + currentTheme.setDescription(description); + currentTheme.setName(name); + currentTheme.setId(id); + currentTheme.clearElements(); + if ( visualElements != null && visualElements.size() > 0 ) { + Iterator iter = visualElements.iterator(); + while (iter.hasNext()) { + CSSVisualElementDTO element = (CSSVisualElementDTO) iter.next(); + currentTheme.addElement(element.createCSSThemeVisualElement()); + } + } + return currentTheme; + } + + /** + * @return Returns the baseStyleObject. + */ + public CSSStyleDTO getBaseStyleObject() { + return baseStyleObject; + } + /** + * @return Returns the description. + */ + public String getDescription() { + return description; + } + /** + * @return Returns the id. + */ + public Long getId() { + return id; + } + /** + * @return Returns the name. + */ + public String getName() { + return name; + } + /** + * @return Returns the visualElements. + */ + public List getVisualElements() { + return visualElements; + } + + public String toString() { + return new ToStringBuilder(this) + .append("id", id) + .append("name", name) + .append("description", description) + .append("baseStyleObject", baseStyleObject) + .append("visualElements", visualElements) + .toString(); + } + +} Index: lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSVisualElementDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/themes/dto/Attic/CSSVisualElementDTO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSVisualElementDTO.java 21 Aug 2005 23:55:21 -0000 1.1 @@ -0,0 +1,119 @@ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ +package org.lamsfoundation.lams.themes.dto; + +import java.text.ParseException; +import java.util.Hashtable; + +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.learningdesign.dto.BaseDTO; +import org.lamsfoundation.lams.themes.CSSStyle; +import org.lamsfoundation.lams.themes.CSSThemeVisualElement; + +/** + * Models the Theme structure that is used to communicate with Flash. + * Includes all the information from Theme down to each individual property. + * Based on the native Flash structure for Style objects. + * + * Can't resue the ThemeDTO as that has more fields, which would may be output + * in the Flash packet. Also the name of the style field is different. + * + * @author Fiona Malikoff + */ +public class CSSVisualElementDTO extends BaseDTO { + + protected Logger log = Logger.getLogger(CSSVisualElementDTO.class); + + /* The variables must have the same names as the tags in CSSThemeDTO, or the WDDX packet will have the + * wrong tag names when sent to Flash. We can model the style objects as CSSStyleDTO and + * CSSVisualElementDTO any arbitrary Java class to a hashtable. Note: the baseStyleObject + */ + private String name; + private CSSStyleDTO styleObject; // contains _tf if needed + + /** + * Create the DTO using the data from Flash + */ + public CSSVisualElementDTO(Hashtable wddxData) { + if ( wddxData != null ) { + this.name = (String) wddxData.get(CSSThemeDTO.NAME_TAG); + Hashtable so = (Hashtable) wddxData.get(CSSThemeDTO.STYLE_OBJECT_TAG); + if ( so != null ) { + styleObject = new CSSStyleDTO(so); + } + } + } + + /** + * Create the DTO from a database object. + * + * @throws ParseException + * + */ + public CSSVisualElementDTO(CSSThemeVisualElement visualElement) { + + if ( visualElement != null ) { + this.name = visualElement.getName(); + CSSStyle style = visualElement.getStyle(); + if ( style != null ) { + styleObject = new CSSStyleDTO(style); + } + + } + } + + /** + * Create the database object from this DTO. Can only create + * a whole new object as the id isn't stored in the DTO. + * + * Don't call it getCSSVisualElement, or CSSVisualElement will be be + * written out in the WDDX packet created from the DTO! + * + */ + public CSSThemeVisualElement createCSSThemeVisualElement() { + CSSThemeVisualElement visualElement = new CSSThemeVisualElement(); + visualElement.setName(name); + visualElement.setStyle(styleObject.createNewCSSStyle()); + visualElement.setTheme(false); + return visualElement; + } + + public String toString() { + return new ToStringBuilder(this) + .append("name", name) + .append("styleObject", styleObject) + .toString(); + } + + /** + * @return Returns the name. + */ + public String getName() { + return name; + } + /** + * @return Returns the styleObject. + */ + public CSSStyleDTO getStyleObject() { + return styleObject; + } +} Index: lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java,v diff -u -r1.9 -r1.10 --- lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java 28 Jun 2005 01:35:31 -0000 1.9 +++ lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java 21 Aug 2005 23:55:20 -0000 1.10 @@ -103,6 +103,12 @@ /** persistent field */ private Integer groupingSupportTypeId; + /** persistent field */ + private String toolIdentifier; + + /** persistent field */ + private String toolVersion; + /** full constructor */ public Tool(Long toolId, String learnerUrl, @@ -124,7 +130,9 @@ Date createDateTime, String monitorUrl, String contributeUrl, - String moderationUrl) + String moderationUrl, + String toolIdentifier, + String toolVersion) { this.toolId = toolId; this.learnerUrl = learnerUrl; @@ -147,6 +155,8 @@ this.monitorUrl = monitorUrl; this.contributeUrl = contributeUrl; this.moderationUrl = moderationUrl; + this.toolIdentifier = toolIdentifier; + this.toolVersion = toolVersion; } /** default constructor */ @@ -169,7 +179,9 @@ Set activities, Integer groupingSupportTypeId, Date createDateTime, - String monitorUrl) + String monitorUrl, + String toolIdentifier, + String toolVersion) { this.toolId = toolId; this.learnerUrl = learnerUrl; @@ -187,6 +199,8 @@ this.groupingSupportTypeId = groupingSupportTypeId; this.createDateTime = createDateTime; this.monitorUrl = monitorUrl; + this.toolIdentifier = toolIdentifier; + this.toolVersion = toolVersion; } /** @@ -479,6 +493,30 @@ { this.monitorUrl = monitorUrl; } + + + /** + * @hibernate.property column="tool_identifier" length="64" + */ + public String getToolIdentifier() { + return this.toolIdentifier; + } + + public void setToolIdentifier(String toolIdentifier) { + this.toolIdentifier = toolIdentifier; + } + + /** + * @hibernate.property column="tool_version" length="10" + */ + public String getToolVersion() { + return this.toolVersion; + } + + public void setToolVersion(String toolVersion) { + this.toolVersion = toolVersion; + } + public String toString() { return new ToStringBuilder(this) .append("toolId", getToolId()) Index: lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java,v diff -u -r1.4 -r1.5 --- lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java 28 Apr 2005 06:36:30 -0000 1.4 +++ lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java 21 Aug 2005 23:55:21 -0000 1.5 @@ -9,6 +9,7 @@ import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; +import org.lamsfoundation.lams.themes.CSSThemeVisualElement; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; /** @@ -90,6 +91,9 @@ private Organisation baseOrganisation; /** persistent field */ + private CSSThemeVisualElement theme; + + /** persistent field */ private Set learnerProgresses; /** persistent field */ @@ -106,7 +110,7 @@ private String fullName; /** full constructor */ - public User(String login, String password, String title, String firstName, String lastName, String addressLine1, String addressLine2, String addressLine3, String city, String state, String country, String dayPhone, String eveningPhone, String mobilePhone, String fax, String email, Boolean disabledFlag, Date createDate, Workspace workspace, AuthenticationMethod authenticationMethod, Set userOrganisations, Organisation baseOrganisation, Set learnerProgresses, Set userToolSessions, Set userGroups, Set learningDesigns, Set lessons) { + public User(String login, String password, String title, String firstName, String lastName, String addressLine1, String addressLine2, String addressLine3, String city, String state, String country, String dayPhone, String eveningPhone, String mobilePhone, String fax, String email, Boolean disabledFlag, Date createDate, Workspace workspace, AuthenticationMethod authenticationMethod, CSSThemeVisualElement theme, Set userOrganisations, Organisation baseOrganisation, Set learnerProgresses, Set userToolSessions, Set userGroups, Set learningDesigns, Set lessons) { this.login = login; this.password = password; this.title = title; @@ -127,6 +131,7 @@ this.createDate = createDate; this.workspace = workspace; this.authenticationMethod = authenticationMethod; + this.theme = theme; this.userOrganisations = userOrganisations; this.baseOrganisation = baseOrganisation; this.learnerProgresses = learnerProgresses; @@ -463,6 +468,20 @@ /** * @hibernate.many-to-one + * not-null="false" + * @hibernate.column name="theme_id" + * + */ + public CSSThemeVisualElement getTheme() { + return this.theme; + } + + public void setTheme(CSSThemeVisualElement theme) { + this.theme = theme; + } + + /** + * @hibernate.many-to-one * not-null="true" * @hibernate.column name="base_organisation_id" * Index: lams_common/src/java/org/lamsfoundation/lams/util/LanguageUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/LanguageUtil.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_common/src/java/org/lamsfoundation/lams/util/LanguageUtil.java 21 Aug 2005 23:55:20 -0000 1.1 @@ -0,0 +1,73 @@ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ +package org.lamsfoundation.lams.util; + +import java.util.Locale; + +/** + * Various internationalisation (internationalization) utilities. + * + * @author Fiona Malikoff + * + */ +public class LanguageUtil { + + /** + * + */ + public LanguageUtil() { + super(); + // TODO Auto-generated constructor stub + } + + public static void main(String[] args) { + + String[] arr = null; + + Locale defaultLocale = Locale.getDefault(); + if ( defaultLocale != null ) { + System.out.println("Default locale "+defaultLocale.getCountry() + +":"+defaultLocale.getISO3Country() + +":"+defaultLocale.getDisplayCountry() + +":"+defaultLocale.getLanguage() + +":"+defaultLocale.getISO3Language()); + } + printArray(Locale.getISOCountries(), "2 code countries: "); + printArray(Locale.getISOLanguages(), "2 code lamguages: "); + } + + /** + * @param arr + * @param comment + */ + private static void printArray(String[] arr, String comment) { + System.out.println(comment); + int i=0; + while ( i 0 ); + } + + public void testGetThemeById() { + CSSThemeVisualElement theme = themeDAO.getThemeById(RUBY_THEME_ID); + assertTrue("Theme returned is Ruby theme", + theme!=null && RUBY_THEME_NAME.equals(theme.getName())); + } + + public void testGetThemeByName() { + List list = themeDAO.getThemeByName(RUBY_THEME_NAME); + assertTrue("At least one theme returned", list != null && list.size() > 0 ); + Iterator iter = list.iterator(); + while (iter.hasNext()) { + CSSThemeVisualElement element = (CSSThemeVisualElement) iter.next(); + assertEquals("Theme has correct name (ruby)",RUBY_THEME_NAME,element.getName()); + } + } + + public void testSaveOrUpdateTheme() { + try { + // create a new theme + CSSThemeVisualElement theme = saveTheme("testSaveOrUpdateTheme", "testSaveOrUpdateTheme description"); + Long themeId = theme.getId(); + CSSStyle baseStyle = theme.getStyle(); + Set elements = theme.getElements(); + Iterator iter = elements.iterator(); + CSSThemeVisualElement element = (CSSThemeVisualElement) iter.next(); + + // update the theme and check the changes + theme.setName("testSaveOrUpdateTheme2"); + theme.setDescription("testSaveOrUpdateTheme2 description"); + element.setName("extendingButton"); + themeDAO.saveOrUpdateTheme(theme); + CSSThemeVisualElement dbTheme = themeDAO.getThemeById(themeId); + checkTheme("testSaveOrUpdateTheme2", themeId, "testSaveOrUpdateTheme2 description", + "extendingButton", dbTheme); + + } catch (ParseException e) { + fail("ParseException thrown"+e.getMessage()); + } + } + + + public void testDeleteTheme() { + CSSThemeVisualElement theme = null; + try { + theme = saveTheme("testDeleteTheme", "testDeleteTheme description"); + } catch (ParseException e) { + fail("ParseException thrown"+e.getMessage()); + } + Long themeId = theme.getId(); + + themeDAO.deleteTheme(theme); + themeDAO.getHibernateTemplate().flush(); + CSSThemeVisualElement dbTheme = themeDAO.getThemeById(themeId); + assertNull("Saved theme cannot be retrieved after deletion",dbTheme); + } + + public void testDeleteThemeById() { + CSSThemeVisualElement theme = null; + try { + theme = saveTheme("testDeleteThemeById", "testDeleteThemeById description"); + } catch (ParseException e) { + fail("ParseException thrown"+e.getMessage()); + } + Long themeId = theme.getId(); + + themeDAO.deleteThemeById(themeId); + themeDAO.getHibernateTemplate().flush(); + CSSThemeVisualElement dbTheme = themeDAO.getThemeById(themeId); + assertNull("Saved theme cannot be retrieved after deletion",dbTheme); + } + + /* ************* End of tests ***********************************/ + + private CSSThemeVisualElement saveTheme(String themeName, String description) throws ParseException { + + CSSThemeVisualElement theme = createNewTheme(themeName, description, "button"); + themeDAO.saveOrUpdateTheme(theme); + Long themeId = theme.getId(); + themeDAO.getHibernateTemplate().flush(); + + CSSThemeVisualElement dbTheme = themeDAO.getThemeById(themeId); + assertNotNull("Saved theme can be retrieved",dbTheme); + checkTheme(themeName, themeId, description, "button", dbTheme); + assertEquals(themeName, dbTheme.getName()); + return dbTheme; + } + + /* if you change any of the values in the new theme, please change checkTheme to match */ + private CSSThemeVisualElement createNewTheme(String themeName, String description, String elementName) { + + CSSThemeVisualElement theme = new CSSThemeVisualElement(); + + theme.setDescription(description); + theme.setName(themeName); + theme.setTheme(true); + + CSSStyle baseStyle = new CSSStyle(); + CSSProperty property = new CSSProperty("borderStyle", "outset", null); + baseStyle.addProperty(property); + property = new CSSProperty("rollOverColor", new Long(16711680), null); + baseStyle.addProperty(property); + // try it as a double, as that is what WDDX creates + property = new CSSProperty("color", new Double(12452097), CSSThemeDTO.TEXT_FORMAT_TAG); + baseStyle.addProperty(property); + + theme.setStyle(baseStyle); + + CSSStyle elementStyle = new CSSStyle(); + property = new CSSProperty("selectionColor", new Double(16711681), null); + elementStyle.addProperty(property); + property = new CSSProperty("display", "block", CSSThemeDTO.TEXT_FORMAT_TAG); + elementStyle.addProperty(property); + + CSSThemeVisualElement element = new CSSThemeVisualElement(); + element.setName(elementName); + element.setStyle(elementStyle); + element.setTheme(false); + + theme.addElement(element); + + return theme; + } + + /* This attempts to check that the correct values have been written to the database. Doesn't really work + * as it isn't the db object that it is returned - it is the cached Hibernate object. e.g. if the cascades + * fail and no CSSThemeVisualElement are written to the database, the tested object contains them anyway!!!! + * + * @param themeName + * @param themeId + * @param description + * @param elementName + * @param theme + * @throws ParseException + */ + private void checkTheme(String themeName, Long themeId, String description, String elementName, CSSThemeVisualElement theme) throws ParseException { + + assertEquals(theme.getDescription(), description); + assertEquals(theme.getName(),themeName); + assertTrue("Theme flag for theme is true", theme.isTheme()); + + CSSStyle baseStyle = theme.getStyle(); + assertNotNull(baseStyle); + Set bsproperties = baseStyle.getProperties(); + assertNotNull(bsproperties); + Iterator iter = bsproperties.iterator(); + while (iter.hasNext()) { + CSSProperty property = (CSSProperty) iter.next(); + if ( "borderStyle".equals(property.getName()) ) { + assertEquals(property.getValueAsObject(), "outset"); + assertNull(property.getStyleSubset()); + } else if ( "rollOverColor".equals(property.getName()) ) { + assertEquals(property.getValueAsObject(), new Long(16711680)); + assertNull(property.getStyleSubset()); + } else if ( "color".equals(property.getName()) ) { + assertEquals(property.getValueAsObject(), new Double(12452097)); + assertEquals(property.getStyleSubset(), CSSThemeDTO.TEXT_FORMAT_TAG); + } else { + fail("Unexpected property in baseStyle "+property); + } + } + + Set elements = theme.getElements(); + assertNotNull(elements); + iter = elements.iterator(); + while (iter.hasNext()) { + CSSThemeVisualElement element = (CSSThemeVisualElement) iter.next(); + assertEquals(element.getName(), elementName); + assertNull("Description is null",element.getDescription()); + assertFalse("Theme flag for element is false", element.isTheme()); + assertNotNull(element.getStyle()); + assertNotNull(element.getStyle().getProperties()); + Iterator iter2 = element.getStyle().getProperties().iterator(); + while (iter2.hasNext()) { + CSSProperty property= (CSSProperty) iter2.next(); + if ( "selectionColor".equals(property.getName()) ) { + assertEquals(property.getValueAsObject(), new Double(16711681)); + assertNull(property.getStyleSubset()); + } else if ( "display".equals(property.getName()) ) { + assertEquals(property.getValueAsObject(), "block"); + assertEquals(property.getStyleSubset(), CSSThemeDTO.TEXT_FORMAT_TAG); + } else { + fail("Unexpected property in baseStyle "+property); + } + } + } + + } + + +} Index: lams_common/test/java/org/lamsfoundation/lams/tool/ToolDataAccessTestCase.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/test/java/org/lamsfoundation/lams/tool/Attic/ToolDataAccessTestCase.java,v diff -u -r1.15 -r1.16 --- lams_common/test/java/org/lamsfoundation/lams/tool/ToolDataAccessTestCase.java 5 Jul 2005 06:16:51 -0000 1.15 +++ lams_common/test/java/org/lamsfoundation/lams/tool/ToolDataAccessTestCase.java 21 Aug 2005 23:55:39 -0000 1.16 @@ -55,6 +55,8 @@ protected final Long TEST_TOOL_ID = new Long(6); protected final String TEST_TOOL_SIG = "survey_signature"; protected final String TEST_TOOL_SERVICE_NAME = "surveyService"; + protected final String TEST_TOOL_IDENTIFIER = "survey"; + protected final String TEST_TOOL_VERSION = "1.1"; protected final String TEST_TOOL_DISPLAY_NAME = "Survey"; protected final long TEST_TOOL_DEFAULT_CONTENT_ID = 6; Index: lams_common/test/java/org/lamsfoundation/lams/tool/dao/TestToolDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/test/java/org/lamsfoundation/lams/tool/dao/Attic/TestToolDAO.java,v diff -u -r1.9 -r1.10 --- lams_common/test/java/org/lamsfoundation/lams/tool/dao/TestToolDAO.java 5 Jul 2005 06:14:16 -0000 1.9 +++ lams_common/test/java/org/lamsfoundation/lams/tool/dao/TestToolDAO.java 21 Aug 2005 23:55:39 -0000 1.10 @@ -63,6 +63,8 @@ assertEquals("verify display name",TEST_TOOL_DISPLAY_NAME,testTool.getToolDisplayName()); assertEquals("verify default content id",TEST_TOOL_DEFAULT_CONTENT_ID,testTool.getDefaultToolContentId()); assertTrue("verify support define later",testTool.getSupportsDefineLater()); + assertEquals("verify identifier",TEST_TOOL_IDENTIFIER,testTool.getToolIdentifier()); + assertEquals("verify version",TEST_TOOL_VERSION,testTool.getToolVersion()); } public void testGetAllTools(){