Index: lams_tool_survey/.classpath =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/.classpath,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/.classpath 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + Index: lams_tool_survey/.cvsignore =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/.cvsignore,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/.cvsignore 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,3 @@ +.myeclipse +.mymetadata +build Index: lams_tool_survey/.project =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/.project,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/.project 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,43 @@ + + + lams_tool_lasurvey + + + + + + com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator + + + + + com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator + + + + + com.ibm.etools.validation.validationbuilder + + + + + com.ibm.sse.model.structuredbuilder + + + + + + com.genuitec.eclipse.j2eedt.core.webnature + org.eclipse.jdt.core.javanature + + Index: lams_tool_survey/build.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/build.properties,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/build.properties 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,13 @@ +######################################################################################################################## +### BUILD PROPERTIES ### +### 1) Do *NOT* use backslashes in paths unless you are sure the ANT task treats them properly. ### +### 2) Use only ant variables (${foo}) that You declared above or make *SURE* You derive them from the right place. ### +### 3) Comment out boolean style build settings instead of setting false. Set to false may fail. ### +### 4) Uncommenting the forceClean attribute *WILL* delete your sourcecode to make place for vcs controlled builds. ### +### +######################################################################################################################## + +### project properties ### +signature=lasurv11 +project.displayname = lams share surveys tool +weblib=lib Index: lams_tool_survey/build.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/build.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/build.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,466 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +------------------------------------------+ + | creating directory structure | + +------------------------------------------+ + + + + + + + + + + + + + + +------------------------------------------+ + | clean | + +------------------------------------------+ + + + + + + + + + + + + + + + + + + + + + +------------------------------------------+ + | generating hibernate metadata | + +------------------------------------------+ + + + + Building hbm.xml files using XDoclet to ${conf.hibernate.mapping.dir} from ${src.java.dir} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +------------------------------------------+ + | create jar file | + +------------------------------------------+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +------------------------------------------+ + | build jar file | + +------------------------------------------+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +------------------------------------------+ + | Generate the deployment package. | + +------------------------------------------+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Deploying the Share Surveys tool + + + + + + + + + + + +------------------------------------------+ + | built war file | + +------------------------------------------+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/library_licenses.txt =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/library_licenses.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/library_licenses.txt 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,10 @@ +Tigra Tree Javascript license description: +There is no license fee or royalty fee to be paid at any time for using the Tigra Tree Menu v1.x +You may include the source code or modified source code within your own projects for either personal or commercial use but excluding the restrictions outlined below. The following restrictions apply to all parts of the component, including all source code, samples and documentation. + + * Header block of script file (tree.js) CAN NOT be modified or removed. + * The above items CAN NOT be sold as are, either individually or together. + * The above items CAN NOT be modified and then sold as a library component, either individually or together. + + +For more detail, http://www.softcomplex.com/products/tigra_tree_menu/docs/ Index: lams_tool_survey/WebRoot/META-INF/MANIFEST.MF =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/WebRoot/META-INF/Attic/MANIFEST.MF,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/WebRoot/META-INF/MANIFEST.MF 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + Index: lams_tool_survey/WebRoot/WEB-INF/web.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/WebRoot/WEB-INF/Attic/web.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/WebRoot/WEB-INF/web.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,8 @@ + + + + Index: lams_tool_survey/conf/hibernate/mappings/.cvsignore =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/hibernate/mappings/Attic/.cvsignore,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/hibernate/mappings/.cvsignore 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1 @@ +org Index: lams_tool_survey/conf/hibernate/mappings/hibernate.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/hibernate/mappings/Attic/hibernate.properties,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/hibernate/mappings/hibernate.properties 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,7 @@ +hibernate.connection.username=lams +hibernate.connection.password=lamsdemo +hibernate.connection.url=jdbc:mysql://localhost/lams +hibernate.connection.driver_class=com.mysql.jdbc.Driver +hibernate.dialect=org.hibernate.dialect.MySQLDialect + + Index: lams_tool_survey/conf/language/ApplicationSurveys.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/language/Attic/ApplicationSurveys.properties,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/language/ApplicationSurveys.properties 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,156 @@ +appName = survey +#language code: en +#locale code: AU + + # CVS ID: $Id: ApplicationSurveys.properties,v 1.1 2006/09/12 04:15:20 steven Exp $ + +#=================== labels for ShareSurveys =================# + +activity.title =Survey +activity.description =Survey. +activity.helptext =Answer surveys to share with others. +tool.display.name =Share Surveys Tool +tool.description =Tool for sharing surveys. +appName =Share Surveys +errorPage.title =Error page +errorPage.heading =Some error occurs when handling your request +label.authoring.heading =Share Surveys +label.author.title =Share Surveys Authoring +label.authoring.heading.basic =Basic +label.authoring.heading.advance =Advanced +label.authoring.heading.instructions =Instructions +label.authoring.heading.basic.desc =Basic input information for shared surveys +label.authoring.heading.instructions.desc =Please input online and offline instructions +label.authoring.heading.advance.desc =Please input advance options for shared surveys +label.authoring.basic.title =Title +label.authoring.basic.instruction =Instruction +label.authoring.basic.add.url =Add URL +label.authoring.basic.add.file =Add Single File +label.authoring.basic.add.website =Add Shared Website +label.authoring.basic.add.learning.object =Add Learning Object +label.authoring.basic.survey.list.title =Survey List +label.authoring.basic.survey.url =URL +label.authoring.basic.survey.file =File +label.authoring.basic.survey.website =Website +label.authoring.basic.survey.learning.object =Learning object +label.authoring.basic.survey.verify.url =Verify URL +label.authoring.basic.survey.preview =Preview +label.authoring.basic.survey.edit =Edit +label.authoring.basic.survey.delete =Delete +label.authoring.basic.survey.add.instruction =Add Instruction +label.authoring.basic.survey.instructions =Instructions +label.authoring.basic.survey.title.input =Title +label.authoring.basic.survey.url.input =URL +label.authoring.basic.survey.file.input =File +label.authoring.basic.survey.description.input =Description +label.authoring.basic.survey.zip.file.input =Zip file: +label.authoring.online.instruction =Online Instructions +label.authoring.offline.instruction =Offline Instructions +label.authoring.online.file =Upload online file +label.authoring.offline.file =Upload offline file +label.authoring.choosefile.button =Choose file +label.authoring.upload.online.button =Upload Online +label.authoring.upload.offline.button =Upload Offline +label.authoring.online.filelist =Online file list +label.authoring.offline.filelist =Offline file list +label.authoring.online.delete =Delete +label.authoring.offline.delete =Delete +label.authoring.advance.lock.on.finished =Lock when finished +label.authoring.advance.run.content.auto =Run content automatically (only available if there is exactly one survey) +label.authoring.advance.mini.number.surveys.view =Minimum number of surveys to view +label.authoring.advance.allow.learner.add.urls =Allow learners to add URLs +label.authoring.advance.allow.learner.add.files =Allow learners to add Files +label.next.instruction =Next Instruction +label.authoring.save.button =Save +label.authoring.cancel.button =Cancel +label.description =Description: +authoring.exception =There is a problem in shared surveys authoring page, the reason is {0} +error.survey.item.title.blank =Title can not be blank. +error.survey.item.url.blank =URL can not be blank. +error.survey.item.file.blank =File can not be blank. +error.survey.item.desc.blank =Comment/Instruction can not be blank +error.survey.item.invalid.url =Invalid URL format. +error.upload.failed =Upload file failed: {0} +error.msg.upload.file.not.found =Could not find upload file {0}. +error.msg.zip.file.exception =Could not handle zip file when uploading file. +error.msg.file.not.found =File not found exception occurs when uploading file. +error.msg.ims.package =Invalid IMS package format. +error.msg.ims.application =ImscpApplicationException occurs when uploading survey item file. +error.msg.website.no.initial.file =Website zip can not find out initial file (index.htm/html or default.htm/html). +error.msg.io.exception =IOException occurs when uploading file. +error.msg.invaid.param.upload =InvalidParameterException occured while trying to upload File. +error.msg.repository =Repository occurs exception while trying to upload file. +error.msg.default.content.not.find =Could not retrieve default content record for this tool. +msg.no.instruction =No instruction available. +authoring.msg.cancel.save =Do you want to close this window without saving? +label.learning.title =Share Survey Learning +label.learning.heading =Share Surveys +label.resoruce.to.review =Surveys to view +label.learning.minimum.review =You must view at least {0} of the surveys. +lable.learning.minimum.view.number.less =You at least view another {0} of the surveys. +label.check.for.new =Check for new +label.suggest.new =Suggest a new +label.learning.new.file =New file details: +label.learning.new.url =New URL details: +label.learning.comment.or.instruction =Comment/Instruction +monitoring.tab.summary =Summary +monitoring.tab.statistics =Statistic +monitoring.tab.instructions =Instruction +monitoring.tab.edit.activity =Edit Activity +monitoring.label.group =Group +monitoring.summary.note =Note: number of learners is the number of learners who have viewed the survey. +monitoring.label.type =Type +monitoring.label.title =Title +monitoring.label.suggest =Suggested By +monitoring.label.number.learners =Number of Learners +monitoring.label.hide =Hide +monitoring.label.show =Show +monitoring.label.user.loginname =Login name +monitoring.label.user.name =Name +monitoring.label.hidden =Hidden +label.monitoring.edit.activity.cancel =Cancel +label.monitoring.edit.activity.update =Update +label.monitoring.edit.activity.edit =Edit +message.monitoring.edit.activity.not.editable =This Activity is no longer editable +export.label.survey =Survey +export.label.no.learning.object =No offline package available +export.title =Export portfolio of Survey +error.inputFileTooLarge =Input File size is too large! +error.uploading =error uploading +error.title.empty =Title can not be blank +label.open =Open +label.delete =Delete +label.download =Download +label.view =View +label.edit =Edit +label.finished =Finished +label.completed =Completed +label.finish =Finish +button.upload =Upload +button.add =Add +button.cancel =Cancel +message.monitoring.summary.no.session =No Session Available +label.show =Show +label.hide =Hide +label.save =Save +label.cancel =Cancel +monitoring.label.access.time =Access time +define.later.message =Please wait for the teacher to complete the contents of this activity. +run.offline.message =This activity is not being done on the computer. Please see your instructor for details. +message.monitoring.summary.no.survey.for.group =No survey available for this group. +button.try.again =Try again +open.in.new.window =Open URL in pop-up +label.up =Move Up +label.down =Move down + + +#======= End labels: Exported 141 labels for en AU ===== +label.monitoring.heading.access=Learners list +label.authoring.advanced.reflectOnActivity=Reflect on share surveys +error.reflection.emtpy=Please input reflection +title.reflection=Reflection +label.continue=Continue +monitoring.user.fullname=Name +monitoring.user.reflection=Refection +page.title.monitoring.view.reflection=View Reflection +button.close=Close Index: lams_tool_survey/conf/war/META-INF/MANIFEST.MF =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/war/META-INF/Attic/MANIFEST.MF,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/war/META-INF/MANIFEST.MF 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1 @@ +Class-Path: ./lams.jar ./lams-tool-lasurv11.jar ./lams-contentrepository.jar Index: lams_tool_survey/conf/xdoclet/global-exceptions.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/xdoclet/global-exceptions.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/xdoclet/global-exceptions.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,8 @@ + + + Index: lams_tool_survey/conf/xdoclet/global-forwards.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/xdoclet/global-forwards.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/xdoclet/global-forwards.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,6 @@ + + + + + + Index: lams_tool_survey/conf/xdoclet/struts-actions.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/xdoclet/struts-actions.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/xdoclet/struts-actions.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/conf/xdoclet/struts-forms.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/xdoclet/struts-forms.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/xdoclet/struts-forms.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1 @@ + Index: lams_tool_survey/conf/xdoclet/struts-message-surveys.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/xdoclet/Attic/struts-message-surveys.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/xdoclet/struts-message-surveys.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1 @@ + Index: lams_tool_survey/conf/xdoclet/struts-plugins.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/xdoclet/struts-plugins.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/xdoclet/struts-plugins.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,15 @@ + + + + + + Index: lams_tool_survey/conf/xdoclet/validation-forms.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/xdoclet/validation-forms.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/xdoclet/validation-forms.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,29 @@ + Index: lams_tool_survey/conf/xdoclet/validation-global.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/conf/xdoclet/validation-global.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/conf/xdoclet/validation-global.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,6 @@ + + + datePattern + yyyy-MM-dd + + Index: lams_tool_survey/db/model/survey.clay =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/db/model/survey.clay,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/db/model/survey.clay 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,860 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
Index: lams_tool_survey/db/sql/activity_insert.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/db/sql/activity_insert.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/db/sql/activity_insert.sql 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,82 @@ +# Connection: ROOT LOCAL +# Host: localhost +# Saved: 2005-04-07 11:08:32 +# +INSERT INTO lams_learning_activity +( +activity_ui_id +, description +, title +, help_text +, xcoord +, ycoord +, parent_activity_id +, parent_ui_id +, learning_activity_type_id +, grouping_support_type_id +, apply_grouping_flag +, grouping_id +, grouping_ui_id +, order_id +, define_later_flag +, learning_design_id +, learning_library_id +, create_date_time +, run_offline_flag +, max_number_of_options +, min_number_of_options +, options_instructions +, tool_id +, tool_content_id +, activity_category_id +, gate_activity_level_id +, gate_open_flag +, gate_start_time_offset +, gate_end_time_offset +, gate_start_date_time +, gate_end_date_time +, library_activity_ui_image +, create_grouping_id +, create_grouping_ui_id +, library_activity_id +, language_file +) +VALUES +( +NULL +, 'Share Surveys' +, 'Share Surveys' +, 'Put some help text here.' +, NULL +, NULL +, NULL +, NULL +, 1 +, 2 +, 0 +, NULL +, NULL +, NULL +, 0 +, NULL +, ${learning_library_id} +, NOW() +, 0 +, NULL +, NULL +, NULL +, ${tool_id} +, NULL +, 4 +, NULL +, NULL +, NULL +, NULL +, NULL +, NULL +, 'tool/lasurv11/images/icon_survey.swf' +, NULL +, NULL +, NULL +, 'org.lamsfoundation.lams.tool.survey.ApplicationSurveys' +) Index: lams_tool_survey/db/sql/create_lams_tool_survey.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/db/sql/create_lams_tool_survey.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/db/sql/create_lams_tool_survey.sql 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,116 @@ +SET FOREIGN_KEY_CHECKS=0; +drop table if exists tl_lasurv11_attachment; +drop table if exists tl_lasurv11_item_instruction; +drop table if exists tl_lasurv11_survey; +drop table if exists tl_lasurv11_survey_item; +drop table if exists tl_lasurv11_survey_item_visit_log; +drop table if exists tl_lasurv11_session; +drop table if exists tl_lasurv11_user; +create table tl_lasurv11_attachment ( + uid bigint not null auto_increment, + file_version_id bigint, + file_type varchar(255), + file_name varchar(255), + file_uuid bigint, + create_date datetime, + survey_uid bigint, + primary key (uid) +); +create table tl_lasurv11_item_instruction ( + uid bigint not null auto_increment, + description varchar(255), + sequence_id integer, + item_uid bigint, + primary key (uid) +); +create table tl_lasurv11_survey ( + uid bigint not null auto_increment, + create_date datetime, + update_date datetime, + create_by bigint, + title varchar(255), + run_offline tinyint, + lock_on_finished tinyint, + instructions text, + online_instructions text, + offline_instructions text, + content_in_use tinyint, + define_later tinyint, + content_id bigint unique, + allow_add_files tinyint, + allow_add_urls tinyint, + mini_view_survey_number integer, + allow_auto_run tinyint, + reflect_instructions varchar(255), + reflect_on_activity smallint, + primary key (uid) +); +create table tl_lasurv11_survey_item ( + uid bigint not null auto_increment, + file_uuid bigint, + file_version_id bigint, + description varchar(255), + ims_schema varchar(255), + init_item varchar(255), + organization_xml text, + title varchar(255), + url text, + create_by bigint, + create_date datetime, + create_by_author tinyint, + is_hide tinyint, + item_type smallint, + file_type varchar(255), + file_name varchar(255), + open_url_new_window tinyint, + survey_uid bigint, + session_uid bigint, + primary key (uid) +); +create table tl_lasurv11_item_log ( + uid bigint not null auto_increment, + access_date datetime, + survey_item_uid bigint, + user_uid bigint, + complete tinyint, + session_id bigint, + primary key (uid) +); +create table tl_lasurv11_session ( + uid bigint not null auto_increment, + session_end_date datetime, + session_start_date datetime, + status integer, + survey_uid bigint, + session_id bigint, + session_name varchar(250), + primary key (uid) +); +create table tl_lasurv11_user ( + uid bigint not null auto_increment, + user_id bigint, + last_name varchar(255), + first_name varchar(255), + login_name varchar(255), + session_finished smallint, + session_uid bigint, + survey_uid bigint, + primary key (uid) +); +alter table tl_lasurv11_attachment add index FK1E7009430E79035 (survey_uid), add constraint FK1E7009430E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid); +alter table tl_lasurv11_item_instruction add index FKA5665013980570ED (item_uid), add constraint FKA5665013980570ED foreign key (item_uid) references tl_lasurv11_survey_item (uid); +alter table tl_lasurv11_survey add index FK89093BF758092FB (create_by), add constraint FK89093BF758092FB foreign key (create_by) references tl_lasurv11_user (uid); +alter table tl_lasurv11_survey_item add index FKF52D1F93758092FB (create_by), add constraint FKF52D1F93758092FB foreign key (create_by) references tl_lasurv11_user (uid); +alter table tl_lasurv11_survey_item add index FKF52D1F9330E79035 (survey_uid), add constraint FKF52D1F9330E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid); +alter table tl_lasurv11_survey_item add index FKF52D1F93EC0D3147 (session_uid), add constraint FKF52D1F93EC0D3147 foreign key (session_uid) references tl_lasurv11_session (uid); +alter table tl_lasurv11_item_log add index FK693580A438BF8DFE (survey_item_uid), add constraint FK693580A438BF8DFE foreign key (survey_item_uid) references tl_lasurv11_survey_item (uid); +alter table tl_lasurv11_item_log add index FK693580A441F9365D (user_uid), add constraint FK693580A441F9365D foreign key (user_uid) references tl_lasurv11_user (uid); +alter table tl_lasurv11_session add index FK24AA78C530E79035 (survey_uid), add constraint FK24AA78C530E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid); +alter table tl_lasurv11_user add index FK30113BFCEC0D3147 (session_uid), add constraint FK30113BFCEC0D3147 foreign key (session_uid) references tl_lasurv11_session (uid); +alter table tl_lasurv11_user add index FK30113BFC309ED320 (survey_uid), add constraint FK30113BFC309ED320 foreign key (survey_uid) references tl_lasurv11_survey (uid); + + + +INSERT INTO `tl_lasurv11_survey` (`uid`, `create_date`, `update_date`, `create_by`, `title`, `run_offline`, `lock_on_finished`, `instructions`, `online_instructions`, `offline_instructions`, `content_in_use`, `define_later`, `content_id`, `allow_add_files`, `allow_add_urls`, `mini_view_survey_number`, `allow_auto_run`,`reflect_on_activity`) VALUES + (2,NULL,NULL,NULL,'Shared Surveys','0','0','Instruction','Online instruction','Offline instruction',0,0,${default_content_id},1,1,0,0,0); +SET FOREIGN_KEY_CHECKS=1; Index: lams_tool_survey/db/sql/drop_lams_tool_survey.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/db/sql/drop_lams_tool_survey.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/db/sql/drop_lams_tool_survey.sql 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,14 @@ +SET FOREIGN_KEY_CHECKS=0; +drop table if exists tl_lasurv11_attachment; +drop table if exists tl_lasurv11_item_instruction; +drop table if exists tl_lasurv11_survey; +drop table if exists tl_lasurv11_survey_item; +drop table if exists tl_lasurv11_item_log; +drop table if exists tl_lasurv11_session; +drop table if exists tl_lasurv11_user; +SET FOREIGN_KEY_CHECKS=1; + + + + + Index: lams_tool_survey/db/sql/library_insert.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/db/sql/library_insert.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/db/sql/library_insert.sql 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,18 @@ +# Connection: ROOT LOCAL +# Host: localhost +# Saved: 2005-04-07 10:50:55 +# +INSERT INTO lams_learning_library +( +description, +title, +valid_flag, +create_date_time +) +VALUES +( +'Share surveys', +'Share surveys', +0, +NOW() +) Index: lams_tool_survey/db/sql/table-schema.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/db/sql/table-schema.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/db/sql/table-schema.sql 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,36 @@ +alter table tl_lasurv11_attachment drop foreign key FK1E7009430E79035; +alter table tl_lasurv11_item_instruction drop foreign key FKA5665013980570ED; +alter table tl_lasurv11_item_log drop foreign key FK63195BC938BF8DFE; +alter table tl_lasurv11_item_log drop foreign key FK63195BC941F9365D; +alter table tl_lasurv11_survey drop foreign key FK89093BF758092FB; +alter table tl_lasurv11_survey_item drop foreign key FKF52D1F9330E79035; +alter table tl_lasurv11_survey_item drop foreign key FKF52D1F93EC0D3147; +alter table tl_lasurv11_survey_item drop foreign key FKF52D1F93758092FB; +alter table tl_lasurv11_session drop foreign key FK24AA78C530E79035; +alter table tl_lasurv11_user drop foreign key FK30113BFC30E79035; +alter table tl_lasurv11_user drop foreign key FK30113BFCEC0D3147; +drop table if exists tl_lasurv11_attachment; +drop table if exists tl_lasurv11_item_instruction; +drop table if exists tl_lasurv11_item_log; +drop table if exists tl_lasurv11_survey; +drop table if exists tl_lasurv11_survey_item; +drop table if exists tl_lasurv11_session; +drop table if exists tl_lasurv11_user; +create table tl_lasurv11_attachment (uid bigint not null auto_increment, file_version_id bigint, file_type varchar(255), file_name varchar(255), file_uuid bigint, create_date datetime, survey_uid bigint, primary key (uid)); +create table tl_lasurv11_item_instruction (uid bigint not null auto_increment, description varchar(255), sequence_id integer, item_uid bigint, primary key (uid)); +create table tl_lasurv11_item_log (uid bigint not null auto_increment, access_date datetime, survey_item_uid bigint, user_uid bigint, complete bit, session_id bigint, primary key (uid)); +create table tl_lasurv11_survey (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), run_offline bit, lock_on_finished bit, instructions text, online_instructions text, offline_instructions text, content_in_use bit, define_later bit, content_id bigint unique, allow_add_files bit, allow_add_urls bit, mini_view_survey_number integer, allow_auto_run bit, reflect_instructions varchar(255), reflect_on_activity bit, primary key (uid)); +create table tl_lasurv11_survey_item (uid bigint not null auto_increment, file_uuid bigint, file_version_id bigint, description varchar(255), ims_schema varchar(255), init_item varchar(255), organization_xml text, title varchar(255), url text, create_by bigint, create_date datetime, create_by_author bit, is_hide bit, item_type smallint, file_type varchar(255), file_name varchar(255), open_url_new_window bit, survey_uid bigint, session_uid bigint, primary key (uid)); +create table tl_lasurv11_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, status integer, survey_uid bigint, session_id bigint, session_name varchar(250), primary key (uid)); +create table tl_lasurv11_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), first_name varchar(255), login_name varchar(255), session_uid bigint, survey_uid bigint, session_finished bit, primary key (uid)); +alter table tl_lasurv11_attachment add index FK1E7009430E79035 (survey_uid), add constraint FK1E7009430E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid); +alter table tl_lasurv11_item_instruction add index FKA5665013980570ED (item_uid), add constraint FKA5665013980570ED foreign key (item_uid) references tl_lasurv11_survey_item (uid); +alter table tl_lasurv11_item_log add index FK63195BC938BF8DFE (survey_item_uid), add constraint FK63195BC938BF8DFE foreign key (survey_item_uid) references tl_lasurv11_survey_item (uid); +alter table tl_lasurv11_item_log add index FK63195BC941F9365D (user_uid), add constraint FK63195BC941F9365D foreign key (user_uid) references tl_lasurv11_user (uid); +alter table tl_lasurv11_survey add index FK89093BF758092FB (create_by), add constraint FK89093BF758092FB foreign key (create_by) references tl_lasurv11_user (uid); +alter table tl_lasurv11_survey_item add index FKF52D1F9330E79035 (survey_uid), add constraint FKF52D1F9330E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid); +alter table tl_lasurv11_survey_item add index FKF52D1F93EC0D3147 (session_uid), add constraint FKF52D1F93EC0D3147 foreign key (session_uid) references tl_lasurv11_session (uid); +alter table tl_lasurv11_survey_item add index FKF52D1F93758092FB (create_by), add constraint FKF52D1F93758092FB foreign key (create_by) references tl_lasurv11_user (uid); +alter table tl_lasurv11_session add index FK24AA78C530E79035 (survey_uid), add constraint FK24AA78C530E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid); +alter table tl_lasurv11_user add index FK30113BFC30E79035 (survey_uid), add constraint FK30113BFC30E79035 foreign key (survey_uid) references tl_lasurv11_survey (uid); +alter table tl_lasurv11_user add index FK30113BFCEC0D3147 (session_uid), add constraint FK30113BFCEC0D3147 foreign key (session_uid) references tl_lasurv11_session (uid); Index: lams_tool_survey/db/sql/tool_insert.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/db/sql/tool_insert.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/db/sql/tool_insert.sql 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,56 @@ +# Connection: ROOT LOCAL +# Host: localhost +# Saved: 2005-04-07 10:42:43 +# +INSERT INTO lams_tool +( +tool_signature, +service_name, +tool_display_name, +description, +tool_identifier, +tool_version, +learning_library_id, +default_tool_content_id, +valid_flag, +grouping_support_type_id, +supports_run_offline_flag, +learner_url, +learner_preview_url, +learner_progress_url, +author_url, +monitor_url, +define_later_url, +export_pfolio_learner_url, +export_pfolio_class_url, +contribute_url, +moderation_url, +language_file, +create_date_time +) +VALUES +( +'lasurv11', +'surveyService', +'Shared Surveys', +'Shared Surveys', +'sharedsurveys', +'1.1', +NULL, +NULL, +0, +2, +1, +'tool/lasurv11/learning/start.do?mode=learner', +'tool/lasurv11/learning/start.do?mode=author', +'tool/lasurv11/learning/start.do?mode=teacher', +'tool/lasurv11/authoring/start.do', +'tool/lasurv11/monitoring/summary.do', +'tool/lasurv11/definelater.do', +'tool/lasurv11/exportPortfolio?mode=learner', +'tool/lasurv11/exportPortfolio?mode=teacher', +'tool/lasurv11/contribute.do', +'tool/lasurv11/moderate.do', +'org.lamsfoundation.lams.tool.survey.ApplicationSurveys', +NOW() +) Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/SurveyConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/SurveyConstants.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/SurveyConstants.java 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1,68 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $Id: SurveyConstants.java,v 1.1 2006/09/12 04:15:17 steven Exp $ */ +package org.lamsfoundation.lams.tool.survey; + +public class SurveyConstants { + public static final String TOOL_SIGNATURE = "lasurv11"; + public static final String RESOURCE_SERVICE = "lasurvSurveyService"; + + public static final int COMPLETED = 1; + + //survey type; + public static final short QUESTION_TYPE_SINGLE_CHOICE = 1; + public static final short QUESTION_TYPE_MUTLIPLE_CHOICE = 2; + public static final short QUESTION_TYPE_TEXT_ENTRY = 3; + + //for action forward name + public static final String SUCCESS = "success"; + public static final String ERROR = "error"; + public static final String DEFINE_LATER = "definelater"; + + //for parameters' name + public static final String PARAM_FILE_VERSION_ID = "fileVersionId"; + public static final String PARAM_FILE_UUID = "fileUuid"; + public static final String PARAM_ITEM_INDEX = "itemIndex"; + public static final String PARAM_RESOURCE_ITEM_UID = "itemUid"; + public static final String PARAM_RUN_OFFLINE = "runOffline"; + public static final String PARAM_TITLE = "title"; + public static final String ATTR_USER_UID = "userUid"; + + + //error message keys + public static final String ERROR_MSG_TITLE_BLANK = "error.survey.item.title.blank"; + public static final String ERROR_MSG_URL_BLANK = "error.survey.item.url.blank"; + public static final String ERROR_MSG_DESC_BLANK = "error.survey.item.desc.blank"; + public static final String ERROR_MSG_FILE_BLANK = "error.survey.item.file.blank"; + public static final String ERROR_MSG_INVALID_URL = "error.survey.item.invalid.url"; + public static final String ERROR_MSG_UPLOAD_FAILED = "error.upload.failed"; + + + public static final String ATTR_REFLECTION_ON = "reflectOn"; + public static final String ATTR_REFLECTION_INSTRUCTION = "reflectInstructions"; + public static final String ATTR_REFLECT_LIST = "reflectList"; + public static final String ATTR_SESSION_MAP_ID = "sessionMapID"; + public static final String PAGE_EDITABLE = "isPageEditable"; + public static final String ATTR_FILE_TYPE_FLAG = "fileTypeFlag"; + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/surveyApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/surveyApplicationContext.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/surveyApplicationContext.xml 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1,147 @@ + + + + + + + org.lamsfoundation.lams.tool.survey.ApplicationSurveys + + + + + + + + + + + + + org/lamsfoundation/lams/tool/survey/model/SurveyUser.hbm.xml + org/lamsfoundation/lams/tool/survey/model/Survey.hbm.xml + org/lamsfoundation/lams/tool/survey/model/SurveyItem.hbm.xml + org/lamsfoundation/lams/tool/survey/model/SurveyItemInstruction.hbm.xml + org/lamsfoundation/lams/tool/survey/model/SurveyItemVisitLog.hbm.xml + org/lamsfoundation/lams/tool/survey/model/SurveyAttachment.hbm.xml + org/lamsfoundation/lams/tool/survey/model/SurveySession.hbm.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,+java.lang.Exception + PROPAGATION_REQUIRED,+java.lang.Exception + PROPAGATION_REQUIRED,+java.lang.Exception + PROPAGATION_REQUIRED,+java.lang.Exception + + + + + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/DAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/DAO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/DAO.java 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1,70 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: DAO.java,v 1.1 2006/09/12 04:15:17 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao; + +import java.io.Serializable; +import java.util.List; + + +/** + * Data Access Object (DAO) interface. This is an interface + * used to tag our DAO classes and to provide common methods to all DAOs. + * + * @author Dapeng.Ni + */ +public interface DAO { + + /** + * Generic method used to get all objects of a particular type. This + * is the same as lookup up all rows in a table. + * @param clazz the type of objects (a.k.a. while table) to get data from + * @return List of populated objects + */ + public List getObjects(Class clazz); + + /** + * Generic method to get an object based on class and identifier. An + * ObjectRetrievalFailureException Runtime Exception is thrown if + * nothing is found. + * + * @param clazz model class to lookup + * @param id the identifier (primary key) of the class + * @return a populated object + * @see org.springframework.orm.ObjectRetrievalFailureException + */ + public Object getObject(Class clazz, Serializable id); + + /** + * Generic method to save an object - handles both update and insert. + * @param o the object to save + */ + public void saveObject(Object o); + + /** + * Generic method to delete an object based on class and id + * @param clazz model class to lookup + * @param id the identifier (primary key) of the class + */ + public void removeObject(Class clazz, Serializable id); +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyAttachmentDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/Attic/SurveyAttachmentDAO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyAttachmentDAO.java 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1,28 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyAttachmentDAO.java,v 1.1 2006/09/12 04:15:17 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao; + +public interface SurveyAttachmentDAO extends DAO { + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyDAO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyDAO.java 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1,36 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyDAO.java,v 1.1 2006/09/12 04:15:17 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao; + +import org.lamsfoundation.lams.tool.survey.model.Survey; + +public interface SurveyDAO extends DAO { + + Survey getByContentId(Long contentId); + + Survey getByUid(Long surveyUid); + + void delete(Survey survey); + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyQuestionDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyQuestionDAO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyQuestionDAO.java 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1,32 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyQuestionDAO.java,v 1.1 2006/09/12 04:15:17 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao; + +import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion; + +public interface SurveyQuestionDAO extends DAO { + + SurveyQuestion getByUid(Long surveyItemUid); + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveySessionDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveySessionDAO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveySessionDAO.java 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1,41 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveySessionDAO.java,v 1.1 2006/09/12 04:15:17 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao; + +import java.util.List; + +import org.lamsfoundation.lams.tool.survey.model.SurveySession; + +public interface SurveySessionDAO extends DAO { + + SurveySession getSessionBySessionId(Long sessionId); + + List getByContentId(Long toolContentId); + + void delete(SurveySession session); + + void deleteBySessionId(Long toolSessionId); + + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyUserDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyUserDAO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyUserDAO.java 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1,37 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyUserDAO.java,v 1.1 2006/09/12 04:15:17 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao; + +import java.util.List; + +import org.lamsfoundation.lams.tool.survey.model.SurveyUser; + +public interface SurveyUserDAO extends DAO { + + SurveyUser getUserByUserIDAndSessionID(Long userID, Long sessionId); + + SurveyUser getUserByUserIDAndContentID(Long userId, Long contentId); + + List getBySessionID(Long sessionId); +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/BaseDAOHibernate.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/BaseDAOHibernate.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/BaseDAOHibernate.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,72 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: BaseDAOHibernate.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao.hibernate; + +import java.io.Serializable; +import java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.lamsfoundation.lams.tool.survey.dao.DAO; +import org.springframework.orm.hibernate3.support.HibernateDaoSupport; + +/** + * This class serves as the Base class for all other DAOs - namely to hold + * common methods that they might all use. Can be used for standard CRUD + * operations.

+ * + * @author Dapeng.Ni + */ +public class BaseDAOHibernate extends HibernateDaoSupport implements DAO { + protected final Log log = LogFactory.getLog(getClass()); + + /** + * @see com.edgenius.paradise.dao.DAO#saveObject(java.lang.Object) + */ + public void saveObject(Object o) { + getHibernateTemplate().saveOrUpdate(o); + } + + /** + * @see com.edgenius.paradise.dao.DAO#getObject(java.lang.Class, java.io.Serializable) + */ + public Object getObject(Class clazz, Serializable id) { + Object o = getHibernateTemplate().get(clazz, id); + return o; + } + + /** + * @see com.edgenius.paradise.dao.DAO#getObjects(java.lang.Class) + */ + public List getObjects(Class clazz) { + return getHibernateTemplate().loadAll(clazz); + } + + /** + * @see com.edgenius.paradise.dao.DAO#removeObject(java.lang.Class, java.io.Serializable) + */ + public void removeObject(Class clazz, Serializable id) { + getHibernateTemplate().delete(getObject(clazz, id)); + } +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyAttachmentDAOHibernate.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/Attic/SurveyAttachmentDAOHibernate.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyAttachmentDAOHibernate.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,30 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyAttachmentDAOHibernate.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao.hibernate; + +import org.lamsfoundation.lams.tool.survey.dao.SurveyAttachmentDAO; + +public class SurveyAttachmentDAOHibernate extends BaseDAOHibernate implements SurveyAttachmentDAO{ + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyDAOHibernate.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyDAOHibernate.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyDAOHibernate.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,56 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyDAOHibernate.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.tool.survey.dao.SurveyDAO; +import org.lamsfoundation.lams.tool.survey.model.Survey; + +/** + * + * @author Steve.Ni + * + * @version $Revision: 1.1 $ + */ +public class SurveyDAOHibernate extends BaseDAOHibernate implements SurveyDAO{ + private static final String GET_RESOURCE_BY_CONTENTID = "from "+Survey.class.getName()+" as r where r.contentId=?"; + + public Survey getByContentId(Long contentId) { + List list = getHibernateTemplate().find(GET_RESOURCE_BY_CONTENTID,contentId); + if(list.size() > 0) + return (Survey) list.get(0); + else + return null; + } + + public Survey getByUid(Long surveyUid) { + return (Survey) getObject(Survey.class,surveyUid); + } + + public void delete(Survey survey) { + this.getHibernateTemplate().delete(survey); + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyItemDAOHibernate.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/Attic/SurveyItemDAOHibernate.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyItemDAOHibernate.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,35 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyItemDAOHibernate.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao.hibernate; + +import org.lamsfoundation.lams.tool.survey.dao.SurveyQuestionDAO; +import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion; + +public class SurveyItemDAOHibernate extends BaseDAOHibernate implements SurveyQuestionDAO{ + + public SurveyQuestion getByUid(Long surveyItemUid) { + return (SurveyQuestion) this.getObject(SurveyQuestion.class,surveyItemUid); + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveySessionDAOHibernate.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveySessionDAOHibernate.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveySessionDAOHibernate.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,54 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveySessionDAOHibernate.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.tool.survey.dao.SurveySessionDAO; +import org.lamsfoundation.lams.tool.survey.model.SurveySession; + + +public class SurveySessionDAOHibernate extends BaseDAOHibernate implements SurveySessionDAO{ + + private static final String FIND_BY_SESSION_ID = "from " + SurveySession.class.getName() + " as p where p.sessionId=?"; + private static final String FIND_BY_CONTENT_ID = "from " + SurveySession.class.getName() + " as p where p.survey.contentId=?"; + + public SurveySession getSessionBySessionId(Long sessionId) { + List list = getHibernateTemplate().find(FIND_BY_SESSION_ID,sessionId); + if(list == null || list.size() == 0) + return null; + return (SurveySession) list.get(0); + } + public List getByContentId(Long toolContentId) { + return getHibernateTemplate().find(FIND_BY_CONTENT_ID,toolContentId); + } + + public void delete(SurveySession session) { + this.getHibernateTemplate().delete(session); + } + public void deleteBySessionId(Long toolSessionId) { + this.removeObject(SurveySession.class,toolSessionId); + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyUserDAOHibernate.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyUserDAOHibernate.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyUserDAOHibernate.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,57 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyUserDAOHibernate.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.tool.survey.dao.SurveyUserDAO; +import org.lamsfoundation.lams.tool.survey.model.SurveyUser; + + +public class SurveyUserDAOHibernate extends BaseDAOHibernate implements SurveyUserDAO{ + + private static final String FIND_BY_USER_ID_CONTENT_ID = "from " + SurveyUser.class.getName() + " as u where u.userId =? and u.survey.contentId=?"; + private static final String FIND_BY_USER_ID_SESSION_ID = "from " + SurveyUser.class.getName() + " as u where u.userId =? and u.session.sessionId=?"; + private static final String FIND_BY_SESSION_ID = "from " + SurveyUser.class.getName() + " as u where u.session.sessionId=?"; + + public SurveyUser getUserByUserIDAndSessionID(Long userID, Long sessionId) { + List list = this.getHibernateTemplate().find(FIND_BY_USER_ID_SESSION_ID,new Object[]{userID,sessionId}); + if(list == null || list.size() == 0) + return null; + return (SurveyUser) list.get(0); + } + + public SurveyUser getUserByUserIDAndContentID(Long userId, Long contentId) { + List list = this.getHibernateTemplate().find(FIND_BY_USER_ID_CONTENT_ID,new Object[]{userId,contentId}); + if(list == null || list.size() == 0) + return null; + return (SurveyUser) list.get(0); + } + + public List getBySessionID(Long sessionId) { + return this.getHibernateTemplate().find(FIND_BY_SESSION_ID,sessionId); + } + + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dto/ReflectDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dto/ReflectDTO.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dto/ReflectDTO.java 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,67 @@ +package org.lamsfoundation.lams.tool.survey.dto; + +import org.lamsfoundation.lams.tool.survey.model.SurveyUser; + +/** + * + * @author Dapeng Ni + * + */ +public class ReflectDTO { + private Long userUid; + private String fullName; + private String loginName; + private boolean hasRefection; + private String reflectInstrctions; + private boolean finishReflection; + private String reflect; + + public ReflectDTO(SurveyUser user) { + this.setLoginName(user.getLoginName()); + this.setFullName(user.getFirstName()+" "+user.getLastName()); + this.setUserUid(user.getUid()); + } + + public boolean isFinishReflection() { + return finishReflection; + } + public void setFinishReflection(boolean finishReflection) { + this.finishReflection = finishReflection; + } + public String getFullName() { + return fullName; + } + public void setFullName(String fullName) { + this.fullName = fullName; + } + public boolean isHasRefection() { + return hasRefection; + } + public void setHasRefection(boolean hasRefection) { + this.hasRefection = hasRefection; + } + public String getLoginName() { + return loginName; + } + public void setLoginName(String loginName) { + this.loginName = loginName; + } + public String getReflect() { + return reflect; + } + public void setReflect(String reflect) { + this.reflect = reflect; + } + public String getReflectInstrctions() { + return reflectInstrctions; + } + public void setReflectInstrctions(String reflectInstrctions) { + this.reflectInstrctions = reflectInstrctions; + } + public Long getUserUid() { + return userUid; + } + public void setUserUid(Long userUid) { + this.userUid = userUid; + } +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Attic/Survey.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.hbm.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,501 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $Id: Survey.java,v 1.1 2006/09/12 04:15:19 steven Exp $ */ +package org.lamsfoundation.lams.tool.survey.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; +import org.lamsfoundation.lams.contentrepository.NodeKey; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; +import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; +import org.lamsfoundation.lams.tool.survey.util.SurveyToolContentHandler; + +/** + * Survey + * @author Dapeng Ni + * + * @hibernate.class table="tl_lasurv11_survey" + * + */ +public class Survey implements Cloneable{ + + private static final Logger log = Logger.getLogger(Survey.class); + + //key + private Long uid; + //tool contentID + private Long contentId; + private String title; + private String instructions; + //advance + + private boolean lockWhenFinished; + private boolean defineLater; + private boolean runOffline; + private boolean contentInUse; + //instructions + private String onlineInstructions; + private String offlineInstructions; + private Set attachments; + + //general infomation + private Date created; + private Date updated; + private SurveyUser createdBy; + + //survey Items + private Set surveyItems; + + private boolean reflectOnActivity; + private String reflectInstructions; + + //*************** NON Persist Fields ******************** + private IToolContentHandler toolContentHandler; + + private List onlineFileList; + private List offlineFileList; + /** + * Default contruction method. + * + */ + public Survey(){ + attachments = new HashSet(); + surveyItems = new HashSet(); + } +// ********************************************************** + // Function method for Survey +// ********************************************************** + public static Survey newInstance(Survey defaultContent, Long contentId, SurveyToolContentHandler surveyToolContentHandler) { + Survey toContent = new Survey(); + defaultContent.toolContentHandler = surveyToolContentHandler; + toContent = (Survey) defaultContent.clone(); + toContent.setContentId(contentId); + + //reset user info as well + if(toContent.getCreatedBy() != null){ + toContent.getCreatedBy().setSurvey(toContent); + Set items = toContent.getSurveyItems(); + for(SurveyQuestion item:items){ + item.setCreateBy(toContent.getCreatedBy()); + } + } + return toContent; + } + public Object clone(){ + + Survey survey = null; + try{ + survey = (Survey) super.clone(); + survey.setUid(null); + if(surveyItems != null){ + Iterator iter = surveyItems.iterator(); + Set set = new HashSet(); + while(iter.hasNext()){ + SurveyQuestion item = (SurveyQuestion)iter.next(); + SurveyQuestion newItem = (SurveyQuestion) item.clone(); + set.add(newItem); + } + survey.surveyItems = set; + } + //clone attachment + if(attachments != null){ + Iterator iter = attachments.iterator(); + Set set = new HashSet(); + while(iter.hasNext()){ + SurveyAttachment file = (SurveyAttachment)iter.next(); + SurveyAttachment newFile = (SurveyAttachment) file.clone(); +// if toolContentHandle is null, just clone old file without duplicate it in repository + if(toolContentHandler != null){ + //duplicate file node in repository + NodeKey keys = toolContentHandler.copyFile(file.getFileUuid()); + newFile.setFileUuid(keys.getUuid()); + newFile.setFileVersionId(keys.getVersion()); + } + set.add(newFile); + } + survey.attachments = set; + } + //clone ReourceUser as well + if(this.createdBy != null){ + survey.setCreatedBy((SurveyUser) this.createdBy.clone()); + } + } catch (CloneNotSupportedException e) { + log.error("When clone " + Survey.class + " failed"); + } catch (ItemNotFoundException e) { + log.error("When clone " + Survey.class + " failed"); + } catch (RepositoryCheckedException e) { + log.error("When clone " + Survey.class + " failed"); + } + + return survey; + } + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof Survey)) + return false; + + final Survey genericEntity = (Survey) o; + + return new EqualsBuilder() + .append(this.uid,genericEntity.uid) + .append(this.title,genericEntity.title) + .append(this.instructions,genericEntity.instructions) + .append(this.onlineInstructions,genericEntity.onlineInstructions) + .append(this.offlineInstructions,genericEntity.offlineInstructions) + .append(this.created,genericEntity.created) + .append(this.updated,genericEntity.updated) + .append(this.createdBy,genericEntity.createdBy) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder().append(uid).append(title) + .append(instructions).append(onlineInstructions) + .append(offlineInstructions).append(created) + .append(updated).append(createdBy) + .toHashCode(); + } + + /** + * Updates the modification data for this entity. + */ + public void updateModificationData() { + + long now = System.currentTimeMillis(); + if (created == null) { + this.setCreated (new Date(now)); + } + this.setUpdated(new Date(now)); + } + + public void toDTO(){ + onlineFileList = new ArrayList(); + offlineFileList = new ArrayList(); + Set fileSet = this.getAttachments(); + if(fileSet != null){ + for(SurveyAttachment file:fileSet){ + if(StringUtils.equalsIgnoreCase(file.getFileType(),IToolContentHandler.TYPE_OFFLINE)) + offlineFileList.add(file); + else + onlineFileList.add(file); + } + } + } + //********************************************************** + // get/set methods + //********************************************************** + /** + * Returns the object's creation date + * + * @return date + * @hibernate.property column="create_date" + */ + public Date getCreated() { + return created; + } + + /** + * Sets the object's creation date + * + * @param created + */ + public void setCreated(Date created) { + this.created = created; + } + + /** + * Returns the object's date of last update + * + * @return date updated + * @hibernate.property column="update_date" + */ + public Date getUpdated() { + return updated; + } + + /** + * Sets the object's date of last update + * + * @param updated + */ + public void setUpdated(Date updated) { + this.updated = updated; + } + + /** + * @return Returns the userid of the user who created the Share surveys. + * + * @hibernate.many-to-one + * cascade="save-update" + * column="create_by" + * + */ + public SurveyUser getCreatedBy() { + return createdBy; + } + + /** + * @param createdBy The userid of the user who created this Share surveys. + */ + public void setCreatedBy(SurveyUser createdBy) { + this.createdBy = createdBy; + } + + /** + * @hibernate.id column="uid" generator-class="native" + */ + public Long getUid() { + return uid; + } + + public void setUid(Long uid) { + this.uid = uid; + } + + /** + * @return Returns the title. + * + * @hibernate.property + * column="title" + * + */ + public String getTitle() { + return title; + } + + /** + * @param title The title to set. + */ + public void setTitle(String title) { + this.title = title; + } + + + + /** + * @return Returns the runOffline. + * + * @hibernate.property + * column="run_offline" + * + */ + public boolean getRunOffline() { + return runOffline; + } + + /** + * @param runOffline The forceOffLine to set. + * + * + */ + public void setRunOffline(boolean forceOffline) { + this.runOffline = forceOffline; + } + + /** + * @return Returns the lockWhenFinish. + * + * @hibernate.property + * column="lock_on_finished" + * + */ + public boolean getLockWhenFinished() { + return lockWhenFinished; + } + + /** + * @param lockWhenFinished Set to true to lock the survey for finished users. + */ + public void setLockWhenFinished(boolean lockWhenFinished) { + this.lockWhenFinished = lockWhenFinished; + } + + /** + * @return Returns the instructions set by the teacher. + * + * @hibernate.property + * column="instructions" + * type="text" + */ + public String getInstructions() { + return instructions; + } + + public void setInstructions(String instructions) { + this.instructions = instructions; + } + + /** + * @return Returns the onlineInstructions set by the teacher. + * + * @hibernate.property + * column="online_instructions" + * type="text" + */ + public String getOnlineInstructions() { + return onlineInstructions; + } + + public void setOnlineInstructions(String onlineInstructions) { + this.onlineInstructions = onlineInstructions; + } + + /** + * @return Returns the onlineInstructions set by the teacher. + * + * @hibernate.property + * column="offline_instructions" + * type="text" + */ + public String getOfflineInstructions() { + return offlineInstructions; + } + + public void setOfflineInstructions(String offlineInstructions) { + this.offlineInstructions = offlineInstructions; + } + + /** + * + * @hibernate.set lazy="true" + * cascade="all" + * inverse="false" + * order-by="create_date desc" + * @hibernate.collection-key column="survey_uid" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.tool.survey.model.SurveyAttachment" + * + * @return a set of Attachments to this Message. + */ + public Set getAttachments() { + return attachments; + } + + /* + * @param attachments The attachments to set. + */ + public void setAttachments(Set attachments) { + this.attachments = attachments; + } + + /** + * + * + * @hibernate.set lazy="true" + * inverse="false" + * cascade="all" + * order-by="create_date desc" + * @hibernate.collection-key column="survey_uid" + * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.survey.model.SurveyItem" + * + * @return + */ + public Set getSurveyItems() { + return surveyItems; + } + public void setSurveyItems(Set surveyItems) { + this.surveyItems= surveyItems; + } + + + /** + * @hibernate.property column="content_in_use" + * @return + */ + public boolean isContentInUse() { + return contentInUse; + } + + public void setContentInUse(boolean contentInUse) { + this.contentInUse = contentInUse; + } + /** + * @hibernate.property column="define_later" + * @return + */ + public boolean isDefineLater() { + return defineLater; + } + + public void setDefineLater(boolean defineLater) { + this.defineLater = defineLater; + } + /** + * @hibernate.property column="content_id" unique="true" + * @return + */ + public Long getContentId() { + return contentId; + } + + public void setContentId(Long contentId) { + this.contentId = contentId; + } + public List getOfflineFileList() { + return offlineFileList; + } + public void setOfflineFileList(List offlineFileList) { + this.offlineFileList = offlineFileList; + } + public List getOnlineFileList() { + return onlineFileList; + } + public void setOnlineFileList(List onlineFileList) { + this.onlineFileList = onlineFileList; + } + public void setToolContentHandler(IToolContentHandler toolContentHandler) { + this.toolContentHandler = toolContentHandler; + } + + /** + * @hibernate.property column="reflect_instructions" + * @return + */ + public String getReflectInstructions() { + return reflectInstructions; + } + public void setReflectInstructions(String reflectInstructions) { + this.reflectInstructions = reflectInstructions; + } + /** + * @hibernate.property column="reflect_on_activity" + * @return + */ + public boolean isReflectOnActivity() { + return reflectOnActivity; + } + public void setReflectOnActivity(boolean reflectOnActivity) { + this.reflectOnActivity = reflectOnActivity; + } +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyAnswer.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyAnswer.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyAnswer.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,108 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id: SurveyAnswer.java,v 1.1 2006/09/12 04:15:19 steven Exp $ */ +package org.lamsfoundation.lams.tool.survey.model; + +import java.util.Date; +import java.util.Set; +/** + * Survey + * @author Dapeng Ni + * + * @hibernate.class table="tl_lasurv11_answer" + * + */ +public class SurveyAnswer { + + private Long uid; + private Long sessionId; + private SurveyUser user; + private SurveyQuestion surveyQuestion; + private Set surveyOptions; + private Date accessDate; + + /** + * @hibernate.property column="access_date" + * @return + */ + public Date getAccessDate() { + return accessDate; + } + public void setAccessDate(Date accessDate) { + this.accessDate = accessDate; + } + /** + * @hibernate.many-to-one column="survey_item_uid" + * cascade="none" + * @return + */ + public SurveyQuestion getSurveyQuestion() { + return surveyQuestion; + } + public void setSurveyQuestion(SurveyQuestion item) { + this.surveyQuestion = item; + } + + /** + * @hibernate.id generator-class="identity" type="java.lang.Long" column="uid" + * @return Returns the log Uid. + */ + public Long getUid() { + return uid; + } + public void setUid(Long uid) { + this.uid = uid; + } + /** + * @hibernate.many-to-one column="user_uid" + * cascade="none" + * @return + */ + public SurveyUser getUser() { + return user; + } + public void setUser(SurveyUser user) { + this.user = user; + } + /** + * @hibernate.property column="session_id" + * @return + */ + public Long getSessionId() { + return sessionId; + } + public void setSessionId(Long sessionId) { + this.sessionId = sessionId; + } + public Set getSurveyOptions() { + return surveyOptions; + } + public void setSurveyOptions(Set surveyOptions) { + this.surveyOptions = surveyOptions; + } + + + + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyAttachment.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Attic/SurveyAttachment.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyAttachment.hbm.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyAttachment.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Attic/SurveyAttachment.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyAttachment.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,163 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyAttachment.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.model; + +import java.util.Date; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.log4j.Logger; + +/** + * @author Dapeng Ni + * + * A Wrapper class for uploaded files. An Attachment cannot exist independently + * and must belong to a Survey. + * + * + * @hibernate.class table="tl_lasurv11_attachment" + * + */ +public class SurveyAttachment implements Cloneable{ + private static final Logger log = Logger.getLogger(SurveyAttachment.class); + + private Long uid; + private Long fileUuid; + private Long fileVersionId; + private String fileType; + private String fileName; + private Date created; + + //Default contruction method + public SurveyAttachment(){ + + } +// ********************************************************** + // Function method for Attachment +// ********************************************************** + public Object clone(){ + Object obj = null; + try { + obj = super.clone(); + ((SurveyAttachment)obj).setUid(null); + } catch (CloneNotSupportedException e) { + log.error("When clone " + SurveyAttachment.class + " failed"); + } + + return obj; + } + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof SurveyAttachment)) + return false; + + final SurveyAttachment genericEntity = (SurveyAttachment) o; + + return new EqualsBuilder() + .append(this.uid,genericEntity.uid) + .append(this.fileVersionId,genericEntity.fileVersionId) + .append(this.fileName,genericEntity.fileName) + .append(this.fileType,genericEntity.fileType) + .append(this.created,genericEntity.created) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder().append(uid).append(fileVersionId).append(fileName).append(fileType).append(created) + .toHashCode(); + } + +// ********************************************************** + // get/set methods +// ********************************************************** + /** + * @hibernate.id column="uid" generator-class="native" + */ + public Long getUid() { + return uid; + } + + public void setUid(Long uid) { + this.uid = uid; + } + + /** + * @hibernate.property column="file_version_id" + * + */ + public Long getFileVersionId() { + return fileVersionId; + } + + public void setFileVersionId(Long version) { + this.fileVersionId = version; + } + + /** + * @hibernate.property column="file_type" + */ + public String getFileType() { + return fileType; + } + + public void setFileType(String type) { + this.fileType = type; + } + + /** + * @hibernate.property column="file_name" + */ + public String getFileName() { + return fileName; + } + + public void setFileName(String name) { + this.fileName = name; + } + + + /** + * @hibernate.property column="file_uuid" + * @return + */ + public Long getFileUuid() { + return fileUuid; + } + + public void setFileUuid(Long uuid) { + this.fileUuid = uuid; + } + /** + * @hibernate.property column="create_date" + * @return + */ + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyItem.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Attic/SurveyItem.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyItem.hbm.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyItemInstruction.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Attic/SurveyItemInstruction.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyItemInstruction.hbm.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyItemVisitLog.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Attic/SurveyItemVisitLog.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyItemVisitLog.hbm.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyOption.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyOption.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyOption.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,90 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyOption.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.model; + +import java.util.Set; + +import org.apache.log4j.Logger; +/** + * @hibernate.class table="tl_lasurv11_option" + * @author Steve.Ni + * + * @version $Revision: 1.1 $ + */ +public class SurveyOption implements Cloneable{ + private static final Logger log = Logger.getLogger(SurveyOption.class); + + private Long uid; + private int sequenceId; + private String description; + + public Object clone(){ + Object obj = null; + try { + obj = super.clone(); + ((SurveyOption)obj).setUid(null); + } catch (CloneNotSupportedException e) { + log.error("When clone " + SurveyOption.class + " failed"); + } + + return obj; + } +// ********************************************************** + // Get/Set methods +// ********************************************************** + /** + * @hibernate.id generator-class="identity" type="java.lang.Long" column="uid" + * @return Returns the uid. + */ + public Long getUid() { + return uid; + } + /** + * @param uid The uid to set. + */ + public void setUid(Long userID) { + this.uid = userID; + } + /** + * @hibernate.property column="description" + * @return + */ + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + /** + * @hibernate.property column="sequence_id" + * @return + */ + public int getSequenceId() { + return sequenceId; + } + public void setSequenceId(int sequenceId) { + this.sequenceId = sequenceId; + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyQuestion.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyQuestion.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyQuestion.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,200 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyQuestion.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.model; + +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.contentrepository.NodeKey; + +/** + * Survey + * @author Dapeng Ni + * + * @hibernate.class table="tl_lasurv11_question" + * + */ +public class SurveyQuestion implements Cloneable{ + private static final Logger log = Logger.getLogger(SurveyQuestion.class); + + private Long uid; + //Survey Type:1=Single Choice,2=Multiple Choice,3=Test Entry + private short type; + + private String description; + + private boolean appendText; + private boolean compulsory; + private int maxAnswsers; + + private Set options; + + private Date createDate; + private SurveyUser createBy; + + //*********************************************** + //DTO fields: + private boolean complete; + + public Object clone(){ + SurveyQuestion obj = null; + try { + obj = (SurveyQuestion) super.clone(); +// clone attachment + if(options != null){ + Iterator iter = options.iterator(); + Set set = new HashSet(); + while(iter.hasNext()){ + SurveyOption instruct = (SurveyOption)iter.next(); + SurveyOption newInsruct = (SurveyOption) instruct.clone(); + set.add(newInsruct); + } + obj.options = set; + } + ((SurveyQuestion)obj).setUid(null); + //clone ReourceUser as well + if(this.createBy != null) + ((SurveyQuestion)obj).setCreateBy((SurveyUser) this.createBy.clone()); + + } catch (CloneNotSupportedException e) { + log.error("When clone " + SurveyQuestion.class + " failed"); + } + + return obj; + } +// ********************************************************** + // Get/Set methods +// ********************************************************** + /** + * @hibernate.id generator-class="identity" type="java.lang.Long" column="uid" + * @return Returns the uid. + */ + public Long getUid() { + return uid; + } + /** + * @param uid The uid to set. + */ + public void setUid(Long userID) { + this.uid = userID; + } + + /** + * @hibernate.property column="description" + * @return + */ + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + /** + * @hibernate.set lazy="false" + * cascade="all-delete-orphan" + * inverse="false" + * order-by="sequence_id asc" + * @hibernate.collection-key column="option_uid" + * @hibernate.collection-one-to-many + * class="org.lamsfoundation.lams.tool.survey.model.SurveyOption" + * @return + */ + public Set getOptions() { + return options; + } + public void setOptions(Set itemInstructions) { + this.options = itemInstructions; + } + + /** + * @hibernate.many-to-one + * cascade="none" + * column="create_by" + * + * @return + */ + public SurveyUser getCreateBy() { + return createBy; + } + public void setCreateBy(SurveyUser createBy) { + this.createBy = createBy; + } + /** + * @hibernate.property column="create_date" + * @return + */ + public Date getCreateDate() { + return createDate; + } + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + /** + * @hibernate.property column="question_type" + * @return + */ + public short getType() { + return type; + } + public void setType(short type) { + this.type = type; + } + /** + * @hibernate.property column="append_text" + * @return + */ + public boolean isAppendText() { + return appendText; + } + public void setAppendText(boolean appendText) { + this.appendText = appendText; + } + + /** + * @hibernate.property column="compulsory" + * @return + */ + public boolean isCompulsory() { + return compulsory; + } + public void setCompulsory(boolean compulsory) { + this.compulsory = compulsory; + } + + /** + * @hibernate.property column="max_answers" + * @return + */ + public int getMaxAnswsers() { + return maxAnswsers; + } + public void setMaxAnswsers(int maxAnswsers) { + this.maxAnswsers = maxAnswsers; + } +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveySession.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Attic/SurveySession.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveySession.hbm.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveySession.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveySession.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveySession.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,147 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveySession.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.model; + +import java.util.Date; +import java.util.Set; + +import org.apache.log4j.Logger; + +/** + * Survey + * @author Dapeng Ni + * + * @hibernate.class table="tl_lasurv11_session" + * + */ +public class SurveySession{ + + private static Logger log = Logger.getLogger(SurveySession.class); + + private Long uid; + private Long sessionId; + private String sessionName; + private Survey survey; + private Date sessionStartDate; + private Date sessionEndDate; + //survey question + private Set surveyQuestions; + + +// ********************************************************** + // Get/Set methods +// ********************************************************** + /** + * @hibernate.id generator-class="identity" type="java.lang.Long" column="uid" + * @return Returns the learnerID. + */ + public Long getUid() { + return uid; + } + public void setUid(Long uuid) { + this.uid = uuid; + } + + /** + * @hibernate.property column="session_end_date" + * @return + */ + public Date getSessionEndDate() { + return sessionEndDate; + } + public void setSessionEndDate(Date sessionEndDate) { + this.sessionEndDate = sessionEndDate; + } + /** + * @hibernate.property column="session_start_date" + * + * @return + */ + public Date getSessionStartDate() { + return sessionStartDate; + } + public void setSessionStartDate(Date sessionStartDate) { + this.sessionStartDate = sessionStartDate; + } + + + /** + * @hibernate.many-to-one column="survey_uid" + * cascade="none" + * @return + */ + public Survey getSurvey() { + return survey; + } + public void setSurvey(Survey survey) { + this.survey = survey; + } + /** + * @hibernate.property column="session_id" + * @return + */ + public Long getSessionId() { + return sessionId; + } + public void setSessionId(Long sessionId) { + this.sessionId = sessionId; + } + + /** + * @hibernate.property column="session_name" length="250" + * @return Returns the session name + */ + public String getSessionName() { + return sessionName; + } + + /** + * + * @param sessionName The session name to set. + */ + public void setSessionName(String sessionName) { + this.sessionName = sessionName; + } + + /** + * + * + * @hibernate.set lazy="true" + * inverse="false" + * cascade="all" + * order-by="create_date desc" + * @hibernate.collection-key column="session_uid" + * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.survey.model.SurveyQuestion" + * + * @return + */ + public Set getSurveyQuestions() { + return surveyQuestions; + } + public void setSurveyQuestions(Set surveyItems) { + this.surveyQuestions= surveyItems; + } + + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyUser.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Attic/SurveyUser.hbm.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyUser.hbm.xml 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyUser.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyUser.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyUser.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,220 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyUser.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.model; + +import java.util.Date; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +/** + * Survey + * @author Dapeng Ni + * + * @hibernate.class table="tl_lasurv11_user" + * + */ +public class SurveyUser implements Cloneable{ + private static final long serialVersionUID = -7043502180037866257L; + private static Logger log = Logger.getLogger(SurveyUser.class); + + private Long uid; + private Long userId; + private String firstName; + private String lastName; + private String loginName; + private boolean sessionFinished; + + private SurveySession session; + private Survey survey; + + //=============== NON Persisit value: for display use =========== + //the user access some reousrce item date time. Use in monitoring summary page + private Date accessDate; + + public SurveyUser(){ + } + public SurveyUser(UserDTO user, SurveySession session){ + this.userId = new Long(user.getUserID().intValue()); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.loginName = user.getLogin(); + this.session = session; + this.survey = null; + this.sessionFinished = false; + } + public SurveyUser(UserDTO user, Survey content){ + this.userId = new Long(user.getUserID().intValue()); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.loginName = user.getLogin(); + this.session = null; + this.survey = content; + this.sessionFinished = false; + } + /** + * Clone method from java.lang.Object + */ + public Object clone(){ + + SurveyUser user = null; + try{ + user = (SurveyUser) super.clone(); + user.setUid(null); + //never clone session + user.setSession(null); + } catch (CloneNotSupportedException e) { + log.error("When clone " + SurveyUser.class + " failed"); + } + + return user; + } +// ********************************************************** + // Get/Set methods +// ********************************************************** + /** + * @hibernate.id generator-class="identity" type="java.lang.Long" column="uid" + * @return Returns the uid. + */ + public Long getUid() { + return uid; + } + /** + * @param uid The uid to set. + */ + public void setUid(Long userID) { + this.uid = userID; + } + + /** + * @hibernate.property column="user_id" length="20" + * @return Returns the userId. + */ + public Long getUserId() { + return userId; + } + /** + * @param userId + * The userId to set. + */ + public void setUserId(Long userID) { + this.userId = userID; + } + + /** + * @hibernate.property length="255" column="last_name" + * @return + */ + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + /** + * @hibernate.property length="255" column="first_name" + * @return + */ + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + /** + * @hibernate.property column="login_name" + * @return + */ + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + /** + * @hibernate.many-to-one column="session_uid" + * cascade="none" + * @return + */ + public SurveySession getSession() { + return session; + } + + public void setSession(SurveySession session) { + this.session = session; + } + /** + * @hibernate.many-to-one column="survey_uid" + * cascade="none" + * @return + */ + public Survey getSurvey() { + return survey; + } + public void setSurvey(Survey content) { + this.survey = content; + } + /** + * @hibernate.property column="session_finished" + * @return + */ + public boolean isSessionFinished() { + return sessionFinished; + } + + public void setSessionFinished(boolean sessionFinished) { + this.sessionFinished = sessionFinished; + } + + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!(obj instanceof SurveyUser)) + return false; + + final SurveyUser user = (SurveyUser) obj; + + return new EqualsBuilder().append(this.uid, user.uid).append(this.firstName, user.firstName) + .append(this.lastName,user.lastName).append(this.loginName, user.loginName).isEquals(); + + } + + public int hashCode() { + return new HashCodeBuilder().append(uid).append(firstName) + .append(lastName).append(loginName) + .toHashCode(); + } + public Date getAccessDate() { + return accessDate; + } + public void setAccessDate(Date accessDate) { + this.accessDate = accessDate; + } + + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/ISurveyService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/ISurveyService.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/ISurveyService.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,201 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: ISurveyService.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.service; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.tool.survey.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.survey.model.Survey; +import org.lamsfoundation.lams.tool.survey.model.SurveyAttachment; +import org.lamsfoundation.lams.tool.survey.model.SurveySession; +import org.lamsfoundation.lams.tool.survey.model.SurveyUser; + +/** + * @author Dapeng.Ni + * + * Interface that defines the contract that all Survey service provider must follow. + */ +public interface ISurveyService +{ + + /** + * Get Survey by toolContentID. + * @param contentId + * @return + */ + Survey getSurveyByContentId(Long contentId); + /** + * Get a cloned copy of tool default tool content (Survey) and assign the toolContentId of that copy as the + * given contentId + * @param contentId + * @return + * @throws SurveyApplicationException + */ + Survey getDefaultContent(Long contentId) throws SurveyApplicationException; + + + /** + * Upload instruciton file into repository. + * @param file + * @param type + * @return + * @throws UploadSurveyFileException + */ + SurveyAttachment uploadInstructionFile(FormFile file, String type) throws UploadSurveyFileException; + + + //********** for user methods ************* + /** + * Create a new user in database. + */ + void createUser(SurveyUser surveyUser); + /** + * Get user by given userID and toolContentID. + * @param long1 + * @return + */ + SurveyUser getUserByIDAndContent(Long userID, Long contentId); + + /** + * Get user by sessionID and UserID + * @param long1 + * @param sessionId + * @return + */ + SurveyUser getUserByIDAndSession(Long long1, Long sessionId); + + + //********** Repository methods *********************** + /** + * Delete file from repository. + */ + void deleteFromRepository(Long fileUuid, Long fileVersionId) throws SurveyApplicationException ; + + /** + * Save or update survey into database. + * @param Survey + */ + void saveOrUpdateSurvey(Survey Survey); + /** + * Delete reource attachment(i.e., offline/online instruction file) from database. This method does not + * delete the file from repository. + * + * @param attachmentUid + */ + void deleteSurveyAttachment(Long attachmentUid); + /** + * Delete resoruce item from database. + * @param uid + */ + void deleteSurveyItem(Long uid); + + /** + * Get survey which is relative with the special toolSession. + * @param sessionId + * @return + */ + Survey getSurveyBySessionId(Long sessionId); + /** + * Get survey toolSession by toolSessionId + * @param sessionId + * @return + */ + SurveySession getSurveySessionBySessionId(Long sessionId); + + /** + * Save or update survey session. + * @param resSession + */ + void saveOrUpdateSurveySession(SurveySession resSession); + + /** + * If success return next activity's url, otherwise return null. + * @param toolSessionId + * @param userId + * @return + */ + String finishToolSession(Long toolSessionId, Long userId) throws SurveyApplicationException; + +// +// /** +// * Return monitoring summary list. The return value is list of survey summaries for each groups. +// * @param contentId +// * @return +// */ +// List> getSummary(Long contentId); +// /** +// * Get survey item Summary list according to sessionId and skipHide flag. +// * +// * @param sessionId +// * @param skipHide true, don't get survey item if its isHide flag is true. +// * Otherwise, get all survey item +// * @return +// */ +// public List exportBySessionId(Long sessionId, boolean skipHide); +// public List> exportByContentId(Long contentId); +// +// List getUserListBySessionItem(Long sessionId, Long itemUid); + + //****************************************************************************************** + // NOTEBOOK Functions + //****************************************************************************************** + + /** + * Create refection entry into notebook tool. + * @param sessionId + * @param notebook_tool + * @param tool_signature + * @param userId + * @param entryText + */ + public Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId, String entryText); + /** + * Get reflection entry from notebook tool. + * @param sessionId + * @param idType + * @param signature + * @param userID + * @return + */ + public NotebookEntry getEntry(Long sessionId, Integer idType, String signature, Integer userID); + + /** + * Get Reflect DTO list grouped by sessionID. + * @param contentId + * @return + */ + Map> getReflectList(Long contentId); + + /** + * Get user by UID + * @param uid + * @return + */ + SurveyUser getUser(Long uid); +} + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyApplicationException.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyApplicationException.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyApplicationException.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,48 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyApplicationException.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.service; + +public class SurveyApplicationException extends Exception{ + + public SurveyApplicationException() { + super(); + + } + + public SurveyApplicationException(String message, Throwable cause) { + super(message, cause); + + } + + public SurveyApplicationException(String message) { + super(message); + + } + + public SurveyApplicationException(Throwable cause) { + super(cause); + + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,816 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyServiceImpl.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.service; +import java.io.File; +import java.io.FileFilter; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import java.util.Vector; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.ICredentials; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.IVersionedNode; +import org.lamsfoundation.lams.contentrepository.InvalidParameterException; +import org.lamsfoundation.lams.contentrepository.LoginException; +import org.lamsfoundation.lams.contentrepository.NodeKey; +import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; +import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; +import org.lamsfoundation.lams.contentrepository.service.IRepositoryService; +import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; +import org.lamsfoundation.lams.learning.service.ILearnerService; +import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; +import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; +import org.lamsfoundation.lams.learningdesign.service.ImportToolContentException; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.ICoreNotebookService; +import org.lamsfoundation.lams.tool.ToolContentImport102Manager; +import org.lamsfoundation.lams.tool.ToolContentManager; +import org.lamsfoundation.lams.tool.ToolSessionExportOutputData; +import org.lamsfoundation.lams.tool.ToolSessionManager; +import org.lamsfoundation.lams.tool.exception.DataMissingException; +import org.lamsfoundation.lams.tool.exception.SessionDataExistsException; +import org.lamsfoundation.lams.tool.exception.ToolException; +import org.lamsfoundation.lams.tool.service.ILamsToolService; +import org.lamsfoundation.lams.tool.survey.SurveyConstants; +import org.lamsfoundation.lams.tool.survey.dao.SurveyAttachmentDAO; +import org.lamsfoundation.lams.tool.survey.dao.SurveyDAO; +import org.lamsfoundation.lams.tool.survey.dao.SurveyQuestionDAO; +import org.lamsfoundation.lams.tool.survey.dao.SurveySessionDAO; +import org.lamsfoundation.lams.tool.survey.dao.SurveyUserDAO; +import org.lamsfoundation.lams.tool.survey.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.survey.model.Survey; +import org.lamsfoundation.lams.tool.survey.model.SurveyAttachment; +import org.lamsfoundation.lams.tool.survey.model.SurveyOption; +import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion; +import org.lamsfoundation.lams.tool.survey.model.SurveySession; +import org.lamsfoundation.lams.tool.survey.model.SurveyUser; +import org.lamsfoundation.lams.tool.survey.util.SurveyToolContentHandler; +import org.lamsfoundation.lams.usermanagement.User; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.MessageService; +import org.lamsfoundation.lams.util.audit.IAuditService; +import org.lamsfoundation.lams.util.wddx.WDDXProcessor; +import org.lamsfoundation.lams.util.wddx.WDDXProcessorConversionException; + +/** + * + * @author Dapeng.Ni + * + */ +public class SurveyServiceImpl implements + ISurveyService,ToolContentManager, ToolSessionManager, ToolContentImport102Manager + +{ + static Logger log = Logger.getLogger(SurveyServiceImpl.class.getName()); + private SurveyDAO surveyDao; + private SurveyQuestionDAO surveyItemDao; + private SurveyAttachmentDAO surveyAttachmentDao; + private SurveyUserDAO surveyUserDao; + private SurveySessionDAO surveySessionDao; + //tool service + private SurveyToolContentHandler surveyToolContentHandler; + private MessageService messageService; + //system services + private IRepositoryService repositoryService; + private ILamsToolService toolService; + private ILearnerService learnerService; + private IAuditService auditService; + private IUserManagementService userManagementService; + private IExportToolContentService exportContentService; + private ICoreNotebookService coreNotebookService; + + + private class ReflectDTOComparator implements Comparator{ + public int compare(ReflectDTO o1, ReflectDTO o2) { + if(o1 != null && o2 != null){ + return o1.getFullName().compareTo(o2.getFullName()); + }else if(o1 != null) + return 1; + else + return -1; + } + } + + //******************************************************************************* + // Service method + //******************************************************************************* + /** Try to get the file. If forceLogin = false and an access denied exception occurs, call this method + * again to get a new ticket and retry file lookup. If forceLogin = true and it then fails + * then throw exception. + * @param uuid + * @param versionId + * @param relativePath + * @param attemptCount + * @return file node + * @throws ImscpApplicationException + */ + private IVersionedNode getFile(Long uuid, Long versionId, String relativePath) throws SurveyApplicationException { + + ITicket tic = getRepositoryLoginTicket(); + + try { + + return repositoryService.getFileItem(tic, uuid, versionId, relativePath); + + } catch (AccessDeniedException e) { + + String error = "Unable to access repository to get file uuid "+uuid + +" version id "+versionId + +" path " + relativePath+"."; + + error = error+"AccessDeniedException: "+e.getMessage()+" Unable to retry further."; + log.error(error); + throw new SurveyApplicationException(error,e); + + } catch (Exception e) { + + String error = "Unable to access repository to get file uuid "+uuid + +" version id "+versionId + +" path " + relativePath+"." + +" Exception: "+e.getMessage(); + log.error(error); + throw new SurveyApplicationException(error,e); + + } + } + /** + * This method verifies the credentials of the Share Survey Tool and gives it + * the Ticket to login and access the Content Repository. + * + * A valid ticket is needed in order to access the content from the + * repository. This method would be called evertime the tool needs to + * upload/download files from the content repository. + * + * @return ITicket The ticket for repostory access + * @throws SurveyApplicationException + */ + private ITicket getRepositoryLoginTicket() throws SurveyApplicationException { + ICredentials credentials = new SimpleCredentials( + surveyToolContentHandler.getRepositoryUser(), + surveyToolContentHandler.getRepositoryId()); + try { + ITicket ticket = repositoryService.login(credentials, + surveyToolContentHandler.getRepositoryWorkspaceName()); + return ticket; + } catch (AccessDeniedException ae) { + throw new SurveyApplicationException("Access Denied to repository." + + ae.getMessage()); + } catch (WorkspaceNotFoundException we) { + throw new SurveyApplicationException("Workspace not found." + + we.getMessage()); + } catch (LoginException e) { + throw new SurveyApplicationException("Login failed." + e.getMessage()); + } + } + + + public Survey getSurveyByContentId(Long contentId) { + Survey rs = surveyDao.getByContentId(contentId); + if(rs == null){ + log.error("Could not find the content by given ID:"+contentId); + } + return rs; + } + + + public Survey getDefaultContent(Long contentId) throws SurveyApplicationException { + if (contentId == null) + { + String error=messageService.getMessage("error.msg.default.content.not.find"); + log.error(error); + throw new SurveyApplicationException(error); + } + + Survey defaultContent = getDefaultSurvey(); + //save default content by given ID. + Survey content = new Survey(); + content = Survey.newInstance(defaultContent,contentId,surveyToolContentHandler); + return content; + } + + + public SurveyAttachment uploadInstructionFile(FormFile uploadFile, String fileType) throws UploadSurveyFileException { + if(uploadFile == null || StringUtils.isEmpty(uploadFile.getFileName())) + throw new UploadSurveyFileException(messageService.getMessage("error.msg.upload.file.not.found",new Object[]{uploadFile})); + + //upload file to repository + NodeKey nodeKey = processFile(uploadFile,fileType); + + //create new attachement + SurveyAttachment file = new SurveyAttachment(); + file.setFileType(fileType); + file.setFileUuid(nodeKey.getUuid()); + file.setFileVersionId(nodeKey.getVersion()); + file.setFileName(uploadFile.getFileName()); + + return file; + } + + + public void createUser(SurveyUser surveyUser) { + surveyUserDao.saveObject(surveyUser); + } + + + public SurveyUser getUserByIDAndContent(Long userId, Long contentId) { + + return (SurveyUser) surveyUserDao.getUserByUserIDAndContentID(userId,contentId); + + } + public SurveyUser getUserByIDAndSession(Long userId, Long sessionId) { + + return (SurveyUser) surveyUserDao.getUserByUserIDAndSessionID(userId,sessionId); + + } + + + public void deleteFromRepository(Long fileUuid, Long fileVersionId) throws SurveyApplicationException { + ITicket ticket = getRepositoryLoginTicket(); + try { + repositoryService.deleteVersion(ticket, fileUuid,fileVersionId); + } catch (Exception e) { + throw new SurveyApplicationException( + "Exception occured while deleting files from" + + " the repository " + e.getMessage()); + } + } + + + public void saveOrUpdateSurvey(Survey survey) { + surveyDao.saveObject(survey); + } + + + public void deleteSurveyAttachment(Long attachmentUid) { + surveyAttachmentDao.removeObject(SurveyAttachment.class, attachmentUid); + + } + + + public void saveOrUpdateSurveyItem(SurveyQuestion item) { + surveyItemDao.saveObject(item); + } + + + public void deleteSurveyItem(Long uid) { + surveyItemDao.removeObject(SurveyQuestion.class,uid); + } + + public List getSurveyItemsBySessionId(Long sessionId) { + SurveySession session = surveySessionDao.getSessionBySessionId(sessionId); + if(session == null){ + log.error("Failed get SurveySession by ID [" +sessionId + "]"); + return null; + } + //add survey items from Authoring + Survey survey = session.getSurvey(); + List items = new ArrayList(); + items.addAll(survey.getSurveyItems()); + + //add survey items from SurveySession + items.addAll(session.getSurveyQuestions()); + + return items; + } + + public Survey getSurveyBySessionId(Long sessionId){ + SurveySession session = surveySessionDao.getSessionBySessionId(sessionId); + //to skip CGLib problem + Long contentId = session.getSurvey().getContentId(); + Survey res = surveyDao.getByContentId(contentId); + return res; + } + public SurveySession getSurveySessionBySessionId(Long sessionId) { + return surveySessionDao.getSessionBySessionId(sessionId); + } + + + public void saveOrUpdateSurveySession(SurveySession resSession) { + surveySessionDao.saveObject(resSession); + } + + public String finishToolSession(Long toolSessionId, Long userId) throws SurveyApplicationException { + SurveyUser user = surveyUserDao.getUserByUserIDAndSessionID(userId, toolSessionId); + user.setSessionFinished(true); + surveyUserDao.saveObject(user); + +// SurveySession session = surveySessionDao.getSessionBySessionId(toolSessionId); +// session.setStatus(SurveyConstants.COMPLETED); +// surveySessionDao.saveObject(session); + + String nextUrl = null; + try { + nextUrl = this.leaveToolSession(toolSessionId,userId); + } catch (DataMissingException e) { + throw new SurveyApplicationException(e); + } catch (ToolException e) { + throw new SurveyApplicationException(e); + } + return nextUrl; + } + + + public SurveyQuestion getSurveyItemByUid(Long itemUid) { + return surveyItemDao.getByUid(itemUid); + } + public Map> getReflectList(Long contentId){ + Map> map = new HashMap>(); + + List sessionList = surveySessionDao.getByContentId(contentId); + for(SurveySession session:sessionList){ + Long sessionId = session.getSessionId(); + boolean hasRefection = session.getSurvey().isReflectOnActivity(); + Set list = new TreeSet(this.new ReflectDTOComparator()); + //get all users in this session + List users = surveyUserDao.getBySessionID(sessionId); + for(SurveyUser user : users){ + ReflectDTO ref = new ReflectDTO(user); + ref.setHasRefection(hasRefection); + list.add(ref); + } + map.put(sessionId, list); + } + + return map; + } + + public Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId, String entryText) { + return coreNotebookService.createNotebookEntry(sessionId, notebookToolType, toolSignature, userId, "", entryText); + } + public NotebookEntry getEntry(Long sessionId, Integer idType, String signature, Integer userID){ + List list = coreNotebookService.getEntry(sessionId, idType, signature, userID); + if (list == null || list.isEmpty()) { + return null; + } else { + return list.get(0); + } + } + + public SurveyUser getUser(Long uid){ + return (SurveyUser) surveyUserDao.getObject(SurveyUser.class, uid); + } + //***************************************************************************** + // private methods + //***************************************************************************** + private Survey getDefaultSurvey() throws SurveyApplicationException { + Long defaultSurveyId = getToolDefaultContentIdBySignature(SurveyConstants.TOOL_SIGNATURE); + Survey defaultSurvey = getSurveyByContentId(defaultSurveyId); + if(defaultSurvey == null) + { + String error=messageService.getMessage("error.msg.default.content.not.find"); + log.error(error); + throw new SurveyApplicationException(error); + } + + return defaultSurvey; + } + private Long getToolDefaultContentIdBySignature(String toolSignature) throws SurveyApplicationException + { + Long contentId = null; + contentId=new Long(toolService.getToolDefaultContentIdBySignature(toolSignature)); + if (contentId == null) + { + String error=messageService.getMessage("error.msg.default.content.not.find"); + log.error(error); + throw new SurveyApplicationException(error); + } + return contentId; + } + /** + * Process an uploaded file. + * + * @throws SurveyApplicationException + * @throws FileNotFoundException + * @throws IOException + * @throws RepositoryCheckedException + * @throws InvalidParameterException + */ + private NodeKey processFile(FormFile file, String fileType) throws UploadSurveyFileException { + NodeKey node = null; + if (file!= null && !StringUtils.isEmpty(file.getFileName())) { + String fileName = file.getFileName(); + try { + node = surveyToolContentHandler.uploadFile(file.getInputStream(), fileName, + file.getContentType(), fileType); + } catch (InvalidParameterException e) { + throw new UploadSurveyFileException (messageService.getMessage("error.msg.invaid.param.upload")); + } catch (FileNotFoundException e) { + throw new UploadSurveyFileException (messageService.getMessage("error.msg.file.not.found")); + } catch (RepositoryCheckedException e) { + throw new UploadSurveyFileException (messageService.getMessage("error.msg.repository")); + } catch (IOException e) { + throw new UploadSurveyFileException (messageService.getMessage("error.msg.io.exception")); + } + } + return node; + } + private NodeKey processPackage(String packageDirectory, String initFile) throws UploadSurveyFileException { + NodeKey node = null; + try { + node = surveyToolContentHandler.uploadPackage(packageDirectory, initFile); + } catch (InvalidParameterException e) { + throw new UploadSurveyFileException (messageService.getMessage("error.msg.invaid.param.upload")); + } catch (RepositoryCheckedException e) { + throw new UploadSurveyFileException (messageService.getMessage("error.msg.repository")); + } + return node; + } + + + + /** + * Find out default.htm/html or index.htm/html in the given directory folder + * @param packageDirectory + * @return + */ + private String findWebsiteInitialItem(String packageDirectory) { + File file = new File(packageDirectory); + if(!file.isDirectory()) + return null; + + File[] initFiles = file.listFiles(new FileFilter(){ + public boolean accept(File pathname) { + if(pathname == null || pathname.getName() == null) + return false; + String name = pathname.getName(); + if(name.endsWith("default.html") + ||name.endsWith("default.htm") + ||name.endsWith("index.html") + ||name.endsWith("index.htm")) + return true; + return false; + } + }); + if(initFiles != null && initFiles.length > 0) + return initFiles[0].getName(); + else + return null; + } + + + //***************************************************************************** + // set methods for Spring Bean + //***************************************************************************** + public void setAuditService(IAuditService auditService) { + this.auditService = auditService; + } + public void setLearnerService(ILearnerService learnerService) { + this.learnerService = learnerService; + } + public void setMessageService(MessageService messageService) { + this.messageService = messageService; + } + public void setRepositoryService(IRepositoryService repositoryService) { + this.repositoryService = repositoryService; + } + public void setSurveyAttachmentDao(SurveyAttachmentDAO surveyAttachmentDao) { + this.surveyAttachmentDao = surveyAttachmentDao; + } + public void setSurveyDao(SurveyDAO surveyDao) { + this.surveyDao = surveyDao; + } + public void setSurveyItemDao(SurveyQuestionDAO surveyItemDao) { + this.surveyItemDao = surveyItemDao; + } + public void setSurveySessionDao(SurveySessionDAO surveySessionDao) { + this.surveySessionDao = surveySessionDao; + } + public void setSurveyToolContentHandler(SurveyToolContentHandler surveyToolContentHandler) { + this.surveyToolContentHandler = surveyToolContentHandler; + } + public void setSurveyUserDao(SurveyUserDAO surveyUserDao) { + this.surveyUserDao = surveyUserDao; + } + public void setToolService(ILamsToolService toolService) { + this.toolService = toolService; + } + + + //******************************************************************************* + //ToolContentManager, ToolSessionManager methods + //******************************************************************************* + + public void exportToolContent(Long toolContentId, String rootPath) throws DataMissingException, ToolException { + Survey toolContentObj = surveyDao.getByContentId(toolContentId); + if(toolContentObj == null) + throw new DataMissingException("Unable to find tool content by given id :" + toolContentId); + + //set SurveyToolContentHandler as null to avoid copy file node in repository again. + toolContentObj = Survey.newInstance(toolContentObj,toolContentId,null); + toolContentObj.setToolContentHandler(null); + toolContentObj.setOfflineFileList(null); + toolContentObj.setOnlineFileList(null); + try { + exportContentService.registerFileClassForExport(SurveyAttachment.class.getName(),"fileUuid","fileVersionId"); + exportContentService.registerFileClassForExport(SurveyQuestion.class.getName(),"fileUuid","fileVersionId"); + exportContentService.exportToolContent( toolContentId, toolContentObj,surveyToolContentHandler, rootPath); + } catch (ExportToolContentException e) { + throw new ToolException(e); + } + } + + + public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath) throws ToolException { + + try { + exportContentService.registerFileClassForImport(SurveyAttachment.class.getName() + ,"fileUuid","fileVersionId","fileName","fileType",null,null); + exportContentService.registerFileClassForImport(SurveyQuestion.class.getName() + ,"fileUuid","fileVersionId","fileName","fileType",null,"initialItem"); + + Object toolPOJO = exportContentService.importToolContent(toolContentPath,surveyToolContentHandler); + if(!(toolPOJO instanceof Survey)) + throw new ImportToolContentException("Import Share surveys tool content failed. Deserialized object is " + toolPOJO); + Survey toolContentObj = (Survey) toolPOJO; + +// reset it to new toolContentId + toolContentObj.setContentId(toolContentId); + SurveyUser user = surveyUserDao.getUserByUserIDAndSessionID(new Long(newUserUid.longValue()), toolContentId); + if(user == null){ + user = new SurveyUser(); + UserDTO sysUser = ((User)userManagementService.findById(User.class,newUserUid)).getUserDTO(); + user.setFirstName(sysUser.getFirstName()); + user.setLastName(sysUser.getLastName()); + user.setLoginName(sysUser.getLogin()); + user.setUserId(new Long(newUserUid.longValue())); + user.setSurvey(toolContentObj); + } + toolContentObj.setCreatedBy(user); + + //reset all surveyItem createBy user + Set items = toolContentObj.getSurveyItems(); + for(SurveyQuestion item:items){ + item.setCreateBy(user); + } + surveyDao.saveObject(toolContentObj); + } catch (ImportToolContentException e) { + throw new ToolException(e); + } + } + + public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { + if (toContentId == null) + throw new ToolException( + "Failed to create the SharedSurveyFiles tool seession"); + + Survey survey = null; + if ( fromContentId != null ) { + survey = surveyDao.getByContentId(fromContentId); + } + if ( survey == null ) { + try { + survey = getDefaultSurvey(); + } catch (SurveyApplicationException e) { + throw new ToolException(e); + } + } + + Survey toContent = Survey.newInstance(survey,toContentId,surveyToolContentHandler); + surveyDao.saveObject(toContent); + + //save survey items as well + Set items = toContent.getSurveyItems(); + if(items != null){ + Iterator iter = items.iterator(); + while(iter.hasNext()){ + SurveyQuestion item = (SurveyQuestion) iter.next(); +// createRootTopic(toContent.getUid(),null,msg); + } + } + } + + + public void setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException { + Survey survey = surveyDao.getByContentId(toolContentId); + if(survey == null){ + throw new ToolException("No found tool content by given content ID:" + toolContentId); + } + survey.setDefineLater(true); + } + + + public void setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException { + Survey survey = surveyDao.getByContentId(toolContentId); + if(survey == null){ + throw new ToolException("No found tool content by given content ID:" + toolContentId); + } + survey.setRunOffline(true); + } + + + public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { + Survey survey = surveyDao.getByContentId(toolContentId); + if(removeSessionData){ + List list = surveySessionDao.getByContentId(toolContentId); + Iterator iter = list.iterator(); + while(iter.hasNext()){ + SurveySession session = (SurveySession ) iter.next(); + surveySessionDao.delete(session); + } + } + surveyDao.delete(survey); + } + + + public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException { + SurveySession session = new SurveySession(); + session.setSessionId(toolSessionId); + session.setSessionName(toolSessionName); + Survey survey = surveyDao.getByContentId(toolContentId); + session.setSurvey(survey); + surveySessionDao.saveObject(session); + } + + + public String leaveToolSession(Long toolSessionId, Long learnerId) throws DataMissingException, ToolException { + if(toolSessionId == null){ + log.error("Fail to leave tool Session based on null tool session id."); + throw new ToolException("Fail to remove tool Session based on null tool session id."); + } + if(learnerId == null){ + log.error("Fail to leave tool Session based on null learner."); + throw new ToolException("Fail to remove tool Session based on null learner."); + } + return learnerService.completeToolSession(toolSessionId,learnerId); + } + + + public ToolSessionExportOutputData exportToolSession(Long toolSessionId) throws DataMissingException, ToolException { + return null; + } + + + public ToolSessionExportOutputData exportToolSession(List toolSessionIds) throws DataMissingException, ToolException { + return null; + } + + + public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException { + surveySessionDao.deleteBySessionId(toolSessionId); + } + + /* ===============Methods implemented from ToolContentImport102Manager =============== */ + + + /** + * Import the data for a 1.0.2 Noticeboard or HTMLNoticeboard + */ + public void import102ToolContent(Long toolContentId, UserDTO user, Hashtable importValues) + { + Date now = new Date(); + Survey toolContentObj = new Survey(); + + try { + toolContentObj.setTitle((String)importValues.get(ToolContentImport102Manager.CONTENT_TITLE)); + toolContentObj.setContentId(toolContentId); + toolContentObj.setContentInUse(Boolean.FALSE); + toolContentObj.setCreated(now); + toolContentObj.setDefineLater(Boolean.FALSE); + toolContentObj.setInstructions((String)importValues.get(ToolContentImport102Manager.CONTENT_BODY)); + toolContentObj.setOfflineInstructions(null); + toolContentObj.setOnlineInstructions(null); + toolContentObj.setRunOffline(Boolean.FALSE); + toolContentObj.setUpdated(now); + + toolContentObj.setLockWhenFinished(Boolean.FALSE); + + SurveyUser ruser = new SurveyUser(); + ruser.setUserId(new Long(user.getUserID().longValue())); + ruser.setFirstName(user.getFirstName()); + ruser.setLastName(user.getLastName()); + ruser.setLoginName(user.getLogin()); + createUser(ruser); + toolContentObj.setCreatedBy(ruser); + + //survey questions + Vector urls = (Vector) importValues.get(ToolContentImport102Manager.CONTENT_URL_URLS); + if ( urls != null ) { + Iterator iter = urls.iterator(); + while ( iter.hasNext() ) { + Hashtable urlMap = (Hashtable) iter.next(); + + SurveyQuestion item = new SurveyQuestion(); + item.setCreateDate(now); + item.setCreateBy(ruser); + + Vector instructions = (Vector) urlMap.get(ToolContentImport102Manager.CONTENT_URL_URL_INSTRUCTION_ARRAY); + if ( instructions != null && instructions.size() > 0 ) { + item.setOptions(new HashSet()); + Iterator insIter = instructions.iterator(); + while (insIter.hasNext()) { + Hashtable instructionEntry = (Hashtable) insIter.next(); + String instructionText = (String) instructionEntry.get(ToolContentImport102Manager.CONTENT_URL_INSTRUCTION); + Integer order = WDDXProcessor.convertToInteger(instructionEntry, ToolContentImport102Manager.CONTENT_URL_URL_VIEW_ORDER); + SurveyOption instruction = new SurveyOption(); + instruction.setDescription(instructionText); + instruction.setSequenceId(order); + item.getOptions().add(instruction); + } + } + + String surveyType = (String) urlMap.get(ToolContentImport102Manager.CONTENT_URL_URL_TYPE); + + // TODO add the order field - no support for it in forum at present. + // public static final String CONTENT_URL_URL_VIEW_ORDER = "order"; + toolContentObj.getSurveyItems().add(item); + } + } + + } catch (WDDXProcessorConversionException e) { + log.error("Unable to content for activity "+toolContentObj.getTitle()+"properly due to a WDDXProcessorConversionException.",e); + throw new ToolException("Invalid import data format for activity "+toolContentObj.getTitle()+"- WDDX caused an exception. Some data from the design will have been lost. See log for more details."); + } + + surveyDao.saveObject(toolContentObj); + + + } + + /** Set the description, throws away the title value as this is not supported in 2.0 */ + public void setReflectiveData(Long toolContentId, String title, String description) + throws ToolException, DataMissingException { + + Survey toolContentObj = getSurveyByContentId(toolContentId); + if ( toolContentObj == null ) { + throw new DataMissingException("Unable to set reflective data titled "+title + +" on activity toolContentId "+toolContentId + +" as the tool content does not exist."); + } + + // TODO Share Surveys doesn't support reflection yet! + // toolContentObj.setReflectOnActivity(Boolean.TRUE); + // toolContentObj.setReflectInstructions(description); + } + + + /* =================================================================================== */ + + public IExportToolContentService getExportContentService() { + return exportContentService; + } + + + public void setExportContentService(IExportToolContentService exportContentService) { + this.exportContentService = exportContentService; + } + + + public IUserManagementService getUserManagementService() { + return userManagementService; + } + + + public void setUserManagementService(IUserManagementService userManagementService) { + this.userManagementService = userManagementService; + } + + + public ICoreNotebookService getCoreNotebookService() { + return coreNotebookService; + } + + + public void setCoreNotebookService(ICoreNotebookService coreNotebookService) { + this.coreNotebookService = coreNotebookService; + } + + + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceProxy.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceProxy.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceProxy.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,74 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyServiceProxy.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.service; + +import javax.servlet.ServletContext; + +import org.lamsfoundation.lams.tool.ToolContentManager; +import org.lamsfoundation.lams.tool.ToolSessionManager; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + + + + +/** + * @author Dapeng.Ni + * + *

This class act as the proxy between web layer and service layer. It is + * designed to decouple the presentation logic and business logic completely. + * In this way, the presentation tier will no longer be aware of the changes in + * service layer. Therefore we can feel free to switch the business logic + * implementation.

+ */ +public class SurveyServiceProxy +{ + /** + * Return the domain service object. It will delegate to the Spring + * helper method to retrieve the proper bean from Spring bean factory. + * @param servletContext the servletContext for current application + * @return Shared survey service object. + */ + public static final ISurveyService getSurveyService(ServletContext servletContext) + { + return (ISurveyService)getSurveyDomainService(servletContext); + } + + public static final ToolSessionManager getSessionManager(ServletContext servletContext) + { + return (ToolSessionManager)getSurveyDomainService(servletContext); + } + + public static final ToolContentManager getContentManager(ServletContext servletContext) + { + return (ToolContentManager)getSurveyDomainService(servletContext); + } + + private static Object getSurveyDomainService(ServletContext servletContext) + { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); + return wac.getBean("surveyService"); + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/UploadSurveyFileException.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/UploadSurveyFileException.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/UploadSurveyFileException.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,48 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: UploadSurveyFileException.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.service; + +public class UploadSurveyFileException extends Exception{ + + public UploadSurveyFileException() { + super(); + + } + + public UploadSurveyFileException(String message, Throwable cause) { + super(message, cause); + + } + + public UploadSurveyFileException(String message) { + super(message); + + } + + public UploadSurveyFileException(Throwable cause) { + super(cause); + + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/util/SurveyItemComparator.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/util/Attic/SurveyItemComparator.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/util/SurveyItemComparator.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,22 @@ +package org.lamsfoundation.lams.tool.survey.util; + +import java.util.Comparator; + +import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion; +/** + * + * @author steven + * + */ +public class SurveyItemComparator implements Comparator { + + public int compare(SurveyQuestion o1, SurveyQuestion o2) { + if(o1 != null && o2 != null & o1.getCreateDate() !=null && o2.getCreateDate() != null){ + return (o1.getCreateDate().getTime() - o2.getCreateDate().getTime()) > 0?1:-1; + }else if(o1 != null) + return 1; + else + return -1; + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/util/SurveyToolContentHandler.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/util/SurveyToolContentHandler.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/util/SurveyToolContentHandler.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,68 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyToolContentHandler.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.util; + +import org.lamsfoundation.lams.contentrepository.client.ToolContentHandler; + +/** + * Simple client for accessing the content repository. + * + * @author Fiona Malikoff + */ +public class SurveyToolContentHandler extends ToolContentHandler { + + private static String repositoryWorkspaceName = "sharedsurveysworkspace"; + private static String repositoryUser = "sharedsurveys"; + //sharedsurveys + private static char[] repositoryId = {'l','a','m','s','-','s','h','a','r','e','d','r','e','s','o','u','r','c','e','s'}; + + /** + * + */ + public SurveyToolContentHandler() { + super(); + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryWorkspaceName() + */ + public String getRepositoryWorkspaceName() { + return repositoryWorkspaceName; + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryUser() + */ + public String getRepositoryUser() { + return repositoryUser; + } + + /* (non-Javadoc) + * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryId() + */ + public char[] getRepositoryId() { + return repositoryId; + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/util/SurveyWebUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/util/SurveyWebUtils.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/util/SurveyWebUtils.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,55 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id: SurveyWebUtils.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.util; + +import org.lamsfoundation.lams.tool.survey.model.Survey; +import org.lamsfoundation.lams.tool.survey.web.action.MonitoringAction; + + + +/** + * Contains helper methods used by the Action Servlets + * + * @author Anthony Sukkar + * + */ +public class SurveyWebUtils { + + public static boolean isSurveyEditable(Survey survey) { + if ( (survey.isDefineLater() == true) && (survey.isContentInUse()==true) ) + { + // throw new SurveyApplicationException("An exception has occurred: There is a bug in this tool, conflicting flags are set"); + MonitoringAction.log.error("An exception has occurred: There is a bug in this tool, conflicting flags are set"); + return false; + } + else if ( (survey.isDefineLater() == true) && (survey.isContentInUse() == false)) + return true; + else if ( (survey.isDefineLater() == false) && (survey.isContentInUse() == false)) + return true; + else // (content.isContentInUse()==true && content.isDefineLater() == false) + return false; + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,1056 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: AuthoringAction.java,v 1.1 2006/09/12 04:15:19 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.web.action; + +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.commons.beanutils.PropertyUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.NumberUtils; +import org.apache.log4j.Logger; +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.authoring.web.AuthoringConstants; +import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.survey.SurveyConstants; +import org.lamsfoundation.lams.tool.survey.model.Survey; +import org.lamsfoundation.lams.tool.survey.model.SurveyAttachment; +import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion; +import org.lamsfoundation.lams.tool.survey.model.SurveyOption; +import org.lamsfoundation.lams.tool.survey.model.SurveyUser; +import org.lamsfoundation.lams.tool.survey.service.ISurveyService; +import org.lamsfoundation.lams.tool.survey.service.SurveyApplicationException; +import org.lamsfoundation.lams.tool.survey.service.UploadSurveyFileException; +import org.lamsfoundation.lams.tool.survey.util.SurveyItemComparator; +import org.lamsfoundation.lams.tool.survey.util.SurveyWebUtils; +import org.lamsfoundation.lams.tool.survey.web.form.SurveyForm; +import org.lamsfoundation.lams.tool.survey.web.form.SurveyItemForm; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + + +/** + * @author Steve.Ni + * @version $Revision: 1.1 $ + */ +public class AuthoringAction extends Action { + private static final int INIT_INSTRUCTION_COUNT = 2; + private static final String INSTRUCTION_ITEM_DESC_PREFIX = "instructionItemDesc"; + private static final String INSTRUCTION_ITEM_COUNT = "instructionCount"; + private static final String ITEM_TYPE = "itemType"; + + private static Logger log = Logger.getLogger(AuthoringAction.class); + + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws Exception{ + + String param = mapping.getParameter(); + //-----------------------Survey Author function --------------------------- + if(param.equals("start")){ + ToolAccessMode mode = getAccessMode(request); + //teacher mode "check for new" button enter. + if(mode != null) + request.setAttribute(AttributeNames.ATTR_MODE,mode.toString()); + else + request.setAttribute(AttributeNames.ATTR_MODE,ToolAccessMode.AUTHOR.toString()); + return start(mapping, form, request, response); + } + if (param.equals("definelater")) { + //update define later flag to true + Long contentId = new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID)); + ISurveyService service = getSurveyService(); + Survey survey = service.getSurveyByContentId(contentId); + + boolean isEditable = SurveyWebUtils.isSurveyEditable(survey); + if(!isEditable){ + request.setAttribute(SurveyConstants.PAGE_EDITABLE, new Boolean(isEditable)); + return mapping.findForward("forbidden"); + } + + if(!survey.isContentInUse()){ + survey.setDefineLater(true); + service.saveOrUpdateSurvey(survey); + } + + request.setAttribute(AttributeNames.ATTR_MODE,ToolAccessMode.TEACHER.toString()); + return start(mapping, form, request, response); + } + if (param.equals("initPage")) { + return initPage(mapping, form, request, response); + } + + if (param.equals("updateContent")) { + return updateContent(mapping, form, request, response); + } + if (param.equals("uploadOnlineFile")) { + return uploadOnline(mapping, form, request, response); + } + if (param.equals("uploadOfflineFile")) { + return uploadOffline(mapping, form, request, response); + } + if (param.equals("deleteOnlineFile")) { + return deleteOnlineFile(mapping, form, request, response); + } + if (param.equals("deleteOfflineFile")) { + return deleteOfflineFile(mapping, form, request, response); + } + //----------------------- Add survey item function --------------------------- + if (param.equals("newItemInit")) { + return newItemlInit(mapping, form, request, response); + } + if (param.equals("editItemInit")) { + return editItemInit(mapping, form, request, response); + } + if (param.equals("saveOrUpdateItem")) { + return saveOrUpdateItem(mapping, form, request, response); + } + if (param.equals("removeItem")) { + return removeItem(mapping, form, request, response); + } + //-----------------------Survey Item Instruction function --------------------------- + if (param.equals("newInstruction")) { + return newInstruction(mapping, form, request, response); + } + if (param.equals("removeInstruction")) { + return removeInstruction(mapping, form, request, response); + } + return mapping.findForward(SurveyConstants.ERROR); + } + + + /** + * Remove survey item from HttpSession list and update page display. As authoring rule, all persist only happen when + * user submit whole page. So this remove is just impact HttpSession values. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward removeItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + +// get back sessionMAP + String sessionMapID = WebUtil.readStrParam(request, SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(sessionMapID); + + int itemIdx = NumberUtils.stringToInt(request.getParameter(SurveyConstants.PARAM_ITEM_INDEX),-1); + if(itemIdx != -1){ + SortedSet surveyList = getSurveyItemList(sessionMap); + List rList = new ArrayList(surveyList); + SurveyQuestion item = rList.remove(itemIdx); + surveyList.clear(); + surveyList.addAll(rList); + //add to delList + List delList = getDeletedSurveyItemList(sessionMap); + delList.add(item); + } + + request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, sessionMapID); + return mapping.findForward(SurveyConstants.SUCCESS); + } + + /** + * Display edit page for existed survey item. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward editItemInit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + +// get back sessionMAP + String sessionMapID = WebUtil.readStrParam(request, SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(sessionMapID); + + int itemIdx = NumberUtils.stringToInt(request.getParameter(SurveyConstants.PARAM_ITEM_INDEX),-1); + SurveyQuestion item = null; + if(itemIdx != -1){ + SortedSet surveyList = getSurveyItemList(sessionMap); + List rList = new ArrayList(surveyList); + item = rList.get(itemIdx); + if(item != null){ + populateItemToForm(itemIdx, item,(SurveyItemForm) form,request); + } + } + return findForward(item==null?-1:item.getType(),mapping); + } + /** + * Display empty page for new survey item. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward newItemlInit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + String sessionMapID = WebUtil.readStrParam(request, SurveyConstants.ATTR_SESSION_MAP_ID); + ((SurveyItemForm)form).setSessionMapID(sessionMapID); + + short type = (short) NumberUtils.stringToInt(request.getParameter(ITEM_TYPE)); + List instructionList = new ArrayList(INIT_INSTRUCTION_COUNT); + for(int idx=0;idxHttpSession SurveyItemList. Notice, this save is not persist them into database, + * just save HttpSession temporarily. Only they will be persist when the entire authoring + * page is being persisted. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ServletException + */ + private ActionForward saveOrUpdateItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws Exception { + //get instructions: + List instructionList = getInstructionsFromRequest(request); + + SurveyItemForm itemForm = (SurveyItemForm)form; + ActionErrors errors = validateSurveyItem(itemForm); + + if(!errors.isEmpty()){ + this.addErrors(request,errors); +// request.setAttribute(SurveyConstants.ATTR_INSTRUCTION_LIST,instructionList); + return findForward(itemForm.getItemType(),mapping); + } + + try { + extractFormToSurveyItem(request, instructionList, itemForm); + } catch (Exception e) { + log.error("Uploading failed. The exception is " + e.toString()); + throw e; + } + //set session map ID so that itemlist.jsp can get sessionMAP + request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, itemForm.getSessionMapID()); + //return null to close this window + return mapping.findForward(SurveyConstants.SUCCESS); + } + + + /** + * Read survey data from database and put them into HttpSession. It will redirect to init.do directly after this + * method run successfully. + * + * This method will avoid read database again and lost un-saved resouce item lost when user "refresh page", + * @throws ServletException + * + */ + private ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException { + + //save toolContentID into HTTPSession + Long contentId = new Long(WebUtil.readLongParam(request,SurveyConstants.PARAM_TOOL_CONTENT_ID)); + +// get back the survey and item list and display them on page + ISurveyService service = getSurveyService(); + + List items = null; + Survey survey = null; + SurveyForm surveyForm = (SurveyForm)form; + + // Get contentFolderID and save to form. + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + surveyForm.setContentFolderID(contentFolderID); + + //initial Session Map + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + surveyForm.setSessionMapID(sessionMap.getSessionID()); + + try { + survey = service.getSurveyByContentId(contentId); + //if survey does not exist, try to use default content instead. + if(survey == null){ + survey = service.getDefaultContent(contentId); + if(survey.getSurveyItems() != null){ + items = new ArrayList(survey.getSurveyItems()); + }else + items = null; + }else + items = service.getAuthoredItems(survey.getUid()); + + surveyForm.setSurvey(survey); + + //initialize instruction attachment list + List attachmentList = getAttachmentList(sessionMap); + attachmentList.clear(); + attachmentList.addAll(survey.getAttachments()); + } catch (Exception e) { + log.error(e); + throw new ServletException(e); + } + + //init it to avoid null exception in following handling + if(items == null) + items = new ArrayList(); + + //init survey item list + SortedSet surveyItemList = getSurveyItemList(sessionMap); + surveyItemList.clear(); + surveyItemList.addAll(items); + + sessionMap.put(SurveyConstants.ATTR_RESOURCE_FORM, surveyForm); + return mapping.findForward(SurveyConstants.SUCCESS); + } + + + /** + * Display same entire authoring page content from HttpSession variable. + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ServletException + */ + private ActionForward initPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws ServletException { + String sessionMapID = WebUtil.readStrParam(request, SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(sessionMapID); + SurveyForm existForm = (SurveyForm) sessionMap.get(SurveyConstants.ATTR_RESOURCE_FORM); + + SurveyForm surveyForm = (SurveyForm )form; + try { + PropertyUtils.copyProperties(surveyForm, existForm); + } catch (Exception e) { + throw new ServletException(e); + } + + ToolAccessMode mode = getAccessMode(request); + if(mode.isAuthor()) + return mapping.findForward(SurveyConstants.SUCCESS); + else + return mapping.findForward(SurveyConstants.DEFINE_LATER); + } + /** + * This method will persist all inforamtion in this authoring page, include all survey item, information etc. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ServletException + */ + private ActionForward updateContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + SurveyForm surveyForm = (SurveyForm)(form); + + //get back sessionMAP + SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(surveyForm.getSessionMapID()); + + ToolAccessMode mode = getAccessMode(request); + + ActionMessages errors = validate(surveyForm, mapping, request); + if(!errors.isEmpty()){ + saveErrors(request, errors); + if(mode.isAuthor()) + return mapping.findForward("author"); + else + return mapping.findForward("monitor"); + } + + + Survey survey = surveyForm.getSurvey(); + ISurveyService service = getSurveyService(); + + //**********************************Get Survey PO********************* + Survey surveyPO = service.getSurveyByContentId(surveyForm.getSurvey().getContentId()); + if(surveyPO == null){ + //new Survey, create it. + surveyPO = survey; + surveyPO.setCreated(new Timestamp(new Date().getTime())); + surveyPO.setUpdated(new Timestamp(new Date().getTime())); + }else{ + if(mode.isAuthor()){ + Long uid = surveyPO.getUid(); + PropertyUtils.copyProperties(surveyPO,survey); + //get back UID + surveyPO.setUid(uid); + }else{ //if it is Teacher, then just update basic tab content (definelater) + surveyPO.setInstructions(survey.getInstructions()); + surveyPO.setTitle(survey.getTitle()); +// change define later status + surveyPO.setDefineLater(false); + } + surveyPO.setUpdated(new Timestamp(new Date().getTime())); + } + + //*******************************Handle user******************* + //try to get form system session + HttpSession ss = SessionManager.getSession(); + //get back login user DTO + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + SurveyUser surveyUser = service.getUserByIDAndContent(new Long(user.getUserID().intValue()) + ,surveyForm.getSurvey().getContentId()); + if(surveyUser == null){ + surveyUser = new SurveyUser(user,surveyPO); + } + + surveyPO.setCreatedBy(surveyUser); + + //**********************************Handle Authoring Instruction Attachement ********************* + //merge attachment info + //so far, attPOSet will be empty if content is existed. because PropertyUtils.copyProperties() is executed + Set attPOSet = surveyPO.getAttachments(); + if(attPOSet == null) + attPOSet = new HashSet(); + List attachmentList = getAttachmentList(sessionMap); + List deleteAttachmentList = getDeletedAttachmentList(sessionMap); + + //current attachemnt in authoring instruction tab. + Iterator iter = attachmentList.iterator(); + while(iter.hasNext()){ + SurveyAttachment newAtt = (SurveyAttachment) iter.next(); + attPOSet.add(newAtt); + } + attachmentList.clear(); + + //deleted attachment. 2 possible types: one is persist another is non-persist before. + iter = deleteAttachmentList.iterator(); + while(iter.hasNext()){ + SurveyAttachment delAtt = (SurveyAttachment) iter.next(); + iter.remove(); + //delete from repository + service.deleteFromRepository(delAtt.getFileUuid(),delAtt.getFileVersionId()); + //it is an existed att, then delete it from current attachmentPO + if(delAtt.getUid() != null){ + Iterator attIter = attPOSet.iterator(); + while(attIter.hasNext()){ + SurveyAttachment att = (SurveyAttachment) attIter.next(); + if(delAtt.getUid().equals(att.getUid())){ + attIter.remove(); + break; + } + } + service.deleteSurveyAttachment(delAtt.getUid()); + }//end remove from persist value + } + + //copy back + surveyPO.setAttachments(attPOSet); + //************************* Handle survey items ******************* + //Handle survey items + Set itemList = new LinkedHashSet(); + SortedSet topics = getSurveyItemList(sessionMap); + iter = topics.iterator(); + while(iter.hasNext()){ + SurveyQuestion item = (SurveyQuestion) iter.next(); + if(item != null){ + //This flushs user UID info to message if this user is a new user. + item.setCreateBy(surveyUser); + itemList.add(item); + } + } + surveyPO.setSurveyItems(itemList); + //delete instructino file from database. + List delSurveyItemList = getDeletedSurveyItemList(sessionMap); + iter = delSurveyItemList.iterator(); + while(iter.hasNext()){ + SurveyQuestion item = (SurveyQuestion) iter.next(); + iter.remove(); + if(item.getUid() != null) + service.deleteSurveyItem(item.getUid()); + if(item.getFileUuid() != null && item.getFileVersionId() != null) + service.deleteFromRepository(item.getFileUuid(),item.getFileVersionId()); + } + //handle survey item attachment file: + List delItemAttList = getDeletedItemAttachmentList(sessionMap); + iter = delItemAttList.iterator(); + while(iter.hasNext()){ + SurveyQuestion delAtt = (SurveyQuestion) iter.next(); + iter.remove(); + //delete from repository + service.deleteFromRepository(delAtt.getFileUuid(),delAtt.getFileVersionId()); + } + + //if miniview number is bigger than available items, then set it topics size + if(surveyPO.getMiniViewSurveyNumber() > topics.size()) + surveyPO.setMiniViewSurveyNumber((topics.size())); + //********************************************** + //finally persist surveyPO again + service.saveOrUpdateSurvey(surveyPO); + + //initialize attachmentList again + attachmentList = getAttachmentList(sessionMap); + attachmentList.addAll(survey.getAttachments()); + surveyForm.setSurvey(surveyPO); + + request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG,Boolean.TRUE); + if(mode.isAuthor()) + return mapping.findForward("author"); + else + return mapping.findForward("monitor"); + } + + /** + * Handle upload online instruction files request. + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws UploadSurveyFileException + */ + public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws UploadSurveyFileException { + return uploadFile(mapping, form, IToolContentHandler.TYPE_ONLINE,request); + } + /** + * Handle upload offline instruction files request. + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws UploadSurveyFileException + */ + public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws UploadSurveyFileException { + return uploadFile(mapping, form, IToolContentHandler.TYPE_OFFLINE,request); + } + /** + * Common method to upload online or offline instruction files request. + * @param mapping + * @param form + * @param type + * @param request + * @return + * @throws UploadSurveyFileException + */ + private ActionForward uploadFile(ActionMapping mapping, ActionForm form, + String type,HttpServletRequest request) throws UploadSurveyFileException { + + SurveyForm surveyForm = (SurveyForm) form; + //get back sessionMAP + SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(surveyForm.getSessionMapID()); + + FormFile file; + if(StringUtils.equals(IToolContentHandler.TYPE_OFFLINE,type)) + file = (FormFile) surveyForm.getOfflineFile(); + else + file = (FormFile) surveyForm.getOnlineFile(); + + ISurveyService service = getSurveyService(); + //upload to repository + SurveyAttachment att = service.uploadInstructionFile(file, type); + //handle session value + List attachmentList = getAttachmentList(sessionMap); + List deleteAttachmentList = getDeletedAttachmentList(sessionMap); + //first check exist attachment and delete old one (if exist) to deletedAttachmentList + Iterator iter = attachmentList.iterator(); + SurveyAttachment existAtt; + while(iter.hasNext()){ + existAtt = (SurveyAttachment) iter.next(); + if(StringUtils.equals(existAtt.getFileName(),att.getFileName())){ + //if there is same name attachment, delete old one + deleteAttachmentList.add(existAtt); + iter.remove(); + break; + } + } + //add to attachmentList + attachmentList.add(att); + + return mapping.findForward(SurveyConstants.SUCCESS); + + } + /** + * Delete offline instruction file from current Survey authoring page. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + public ActionForward deleteOfflineFile(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + return deleteFile(mapping,request, response,form, IToolContentHandler.TYPE_OFFLINE); + } + /** + * Delete online instruction file from current Survey authoring page. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + public ActionForward deleteOnlineFile(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + return deleteFile(mapping, request, response,form, IToolContentHandler.TYPE_ONLINE); + } + + /** + * General method to delete file (online or offline) + * @param mapping + * @param request + * @param response + * @param form + * @param type + * @return + */ + private ActionForward deleteFile(ActionMapping mapping, HttpServletRequest request, HttpServletResponse response, ActionForm form, String type) { + Long versionID = new Long(WebUtil.readLongParam(request,SurveyConstants.PARAM_FILE_VERSION_ID)); + Long uuID = new Long(WebUtil.readLongParam(request,SurveyConstants.PARAM_FILE_UUID)); + + //get back sessionMAP + String sessionMapID = WebUtil.readStrParam(request, SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(sessionMapID); + + //handle session value + List attachmentList = getAttachmentList(sessionMap); + List deleteAttachmentList = getDeletedAttachmentList(sessionMap); + //first check exist attachment and delete old one (if exist) to deletedAttachmentList + Iterator iter = attachmentList.iterator(); + SurveyAttachment existAtt; + while(iter.hasNext()){ + existAtt = (SurveyAttachment) iter.next(); + if(existAtt.getFileUuid().equals(uuID) && existAtt.getFileVersionId().equals(versionID)){ + //if there is same name attachment, delete old one + deleteAttachmentList.add(existAtt); + iter.remove(); + } + } + + request.setAttribute(SurveyConstants.ATTR_FILE_TYPE_FLAG, type); + request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, sessionMapID); + return mapping.findForward(SurveyConstants.SUCCESS); + + } + //************************************************************************************* + // Private method + //************************************************************************************* + /** + * Return SurveyService bean. + */ + private ISurveyService getSurveyService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); + return (ISurveyService) wac.getBean(SurveyConstants.RESOURCE_SERVICE); + } + /** + * @param request + * @return + */ + private List getAttachmentList(SessionMap sessionMap) { + return getListFromSession(sessionMap,SurveyConstants.ATT_ATTACHMENT_LIST); + } + /** + * @param request + * @return + */ + private List getDeletedAttachmentList(SessionMap sessionMap) { + return getListFromSession(sessionMap,SurveyConstants.ATTR_DELETED_ATTACHMENT_LIST); + } + /** + * List save current survey items. + * @param request + * @return + */ + private SortedSet getSurveyItemList(SessionMap sessionMap) { + SortedSet list = (SortedSet) sessionMap.get(SurveyConstants.ATTR_RESOURCE_ITEM_LIST); + if(list == null){ + list = new TreeSet(new SurveyItemComparator()); + sessionMap.put(SurveyConstants.ATTR_RESOURCE_ITEM_LIST,list); + } + return list; + } + /** + * List save deleted survey items, which could be persisted or non-persisted items. + * @param request + * @return + */ + private List getDeletedSurveyItemList(SessionMap sessionMap) { + return getListFromSession(sessionMap,SurveyConstants.ATTR_DELETED_RESOURCE_ITEM_LIST); + } + /** + * If a survey item has attahment file, and the user edit this item and change the attachment + * to new file, then the old file need be deleted when submitting the whole authoring page. + * Save the file uuid and version id into SurveyItem object for temporarily use. + * @param request + * @return + */ + private List getDeletedItemAttachmentList(SessionMap sessionMap) { + return getListFromSession(sessionMap,SurveyConstants.ATTR_DELETED_RESOURCE_ITEM_ATTACHMENT_LIST); + } + + + /** + * Get java.util.List from HttpSession by given name. + * + * @param request + * @param name + * @return + */ + private List getListFromSession(SessionMap sessionMap,String name) { + List list = (List) sessionMap.get(name); + if(list == null){ + list = new ArrayList(); + sessionMap.put(name,list); + } + return list; + } + + + /** + * Get survey items instruction from HttpRequest + * @param request + */ + private List getInstructionsFromRequest(HttpServletRequest request) { + String list = request.getParameter("instructionList"); + String[] params = list.split("&"); + Map paramMap = new HashMap(); + String[] pair; + for (String item: params) { + pair = item.split("="); + if(pair == null || pair.length != 2) + continue; + try { + paramMap.put(pair[0],URLDecoder.decode(pair[1],"UTF-8")); + } catch (UnsupportedEncodingException e) { + log.error("Error occurs when decode instruction string:" + e.toString()); + } + } + + int count = NumberUtils.stringToInt(paramMap.get(INSTRUCTION_ITEM_COUNT)); + List instructionList = new ArrayList(); + for(int idx=0;idxActionForward from request. + * @param type + * @param mapping + * @return + */ + private ActionForward findForward(short type, ActionMapping mapping) { + ActionForward forward; + switch (type) { + case SurveyConstants.RESOURCE_TYPE_URL: + forward = mapping.findForward("url"); + break; + case SurveyConstants.RESOURCE_TYPE_FILE: + forward = mapping.findForward("file"); + break; + case SurveyConstants.RESOURCE_TYPE_WEBSITE: + forward = mapping.findForward("website"); + break; + case SurveyConstants.RESOURCE_TYPE_LEARNING_OBJECT: + forward = mapping.findForward("learningobject"); + break; + default: + forward = null; + break; + } + return forward; + } + + + /** + * This method will populate survey item information to its form for edit use. + * @param itemIdx + * @param item + * @param form + * @param request + */ + private void populateItemToForm(int itemIdx, SurveyQuestion item, SurveyItemForm form, HttpServletRequest request) { + form.setDescription(item.getDescription()); + form.setTitle(item.getTitle()); + form.setUrl(item.getUrl()); + form.setOpenUrlNewWindow(item.isAppendText()); + if(itemIdx >=0) + form.setItemIndex(new Integer(itemIdx).toString()); + + Set instructionList = item.getOptions(); + List instructions = new ArrayList(); + for(SurveyOption in : instructionList){ + instructions.add(in.getDescription()); + } + //add extra blank line for instructions + for(int idx=0;idx instructionList, SurveyItemForm itemForm) + throws Exception { + /* BE CAREFUL: This method will copy nessary info from request form to a old or new SurveyItem instance. + * It gets all info EXCEPT SurveyItem.createDate and SurveyItem.createBy, which need be set when persisting + * this survey item. + */ + + SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(itemForm.getSessionMapID()); + //check whether it is "edit(old item)" or "add(new item)" + SortedSet surveyList = getSurveyItemList(sessionMap); + int itemIdx = NumberUtils.stringToInt(itemForm.getItemIndex(),-1); + SurveyQuestion item = null; + + if(itemIdx == -1){ //add + item = new SurveyQuestion(); + item.setCreateDate(new Timestamp(new Date().getTime())); + surveyList.add(item); + }else{ //edit + List rList = new ArrayList(surveyList); + item = rList.get(itemIdx); + } + short type = itemForm.getItemType(); + item.setType(itemForm.getItemType()); + /* Set following fields regards to the type: + item.setFileUuid(); + item.setFileVersionId(); + item.setFileType(); + item.setFileName(); + + item.getInitialItem() + item.setImsSchema() + item.setOrganizationXml() + */ + //if the item is edit (not new add) then the getFile may return null + //it may throw exception, so put it as first, to avoid other invlidate update: + if(itemForm.getFile() != null){ + if(type == SurveyConstants.RESOURCE_TYPE_WEBSITE + ||type == SurveyConstants.RESOURCE_TYPE_LEARNING_OBJECT + ||type == SurveyConstants.RESOURCE_TYPE_FILE){ + //if it has old file, and upload a new, then save old to deleteList + SurveyQuestion delAttItem = new SurveyQuestion(); + boolean hasOld = false; + if(item.getFileUuid() != null){ + hasOld = true; + //be careful, This new SurveyItem object never be save into database + //just temporarily use for saving fileUuid and versionID use: + delAttItem.setFileUuid(item.getFileUuid()); + delAttItem.setFileVersionId(item.getFileVersionId()); + } + ISurveyService service = getSurveyService(); + try { + service.uploadSurveyItemFile(item, itemForm.getFile()); + } catch (UploadSurveyFileException e) { + //if it is new add , then remove it! + if(itemIdx == -1){ + surveyList.remove(item); + } + throw e; + } + //put it after "upload" to ensure deleted file added into list only no exception happens during upload + if(hasOld){ + List delAtt = getDeletedItemAttachmentList(sessionMap); + delAtt.add(delAttItem); + } + } + } + item.setTitle(itemForm.getTitle()); + item.setCreateByAuthor(true); + item.setHide(false); + //set instrcutions + Set instructions = new LinkedHashSet(); + int idx=0; + for (String ins : instructionList) { + SurveyOption rii = new SurveyOption(); + rii.setDescription(ins); + rii.setSequenceId(idx++); + instructions.add(rii); + } + item.setOptions(instructions); + + if(type == SurveyConstants.RESOURCE_TYPE_URL){ + item.setUrl(itemForm.getUrl()); + item.setAppendText(itemForm.isOpenUrlNewWindow()); + } +// if(type == SurveyConstants.RESOURCE_TYPE_WEBSITE +// ||itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_LEARNING_OBJECT){ + item.setDescription(itemForm.getDescription()); +// } + + } + + /** + * Vaidate survey item regards to their type (url/file/learning object/website zip file) + * @param itemForm + * @return + */ + private ActionErrors validateSurveyItem(SurveyItemForm itemForm) { + ActionErrors errors = new ActionErrors(); + if(StringUtils.isBlank(itemForm.getTitle())) + errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_TITLE_BLANK)); + + if(itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_URL){ + if(StringUtils.isBlank(itemForm.getUrl())) + errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_URL_BLANK)); + //URL validation: Commom URL validate(1.3.0) work not very well: it can not support http://address:port format!!! +// UrlValidator validator = new UrlValidator(); +// if(!validator.isValid(itemForm.getUrl())) +// errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_INVALID_URL)); + } +// if(itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_WEBSITE +// ||itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_LEARNING_OBJECT){ +// if(StringUtils.isBlank(itemForm.getDescription())) +// errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_DESC_BLANK)); +// } + if(itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_WEBSITE + ||itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_LEARNING_OBJECT + ||itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_FILE){ + //for edit validate: file already exist + if(!itemForm.isHasFile() && + (itemForm.getFile() == null || StringUtils.isEmpty(itemForm.getFile().getFileName()))) + errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_FILE_BLANK)); + } + return errors; + } + + /** + * Get ToolAccessMode from HttpRequest parameters. Default value is AUTHOR mode. + * @param request + * @return + */ + private ToolAccessMode getAccessMode(HttpServletRequest request) { + ToolAccessMode mode; + String modeStr = request.getParameter(AttributeNames.ATTR_MODE); + if(StringUtils.equalsIgnoreCase(modeStr,ToolAccessMode.TEACHER.toString())) + mode = ToolAccessMode.TEACHER; + else + mode = ToolAccessMode.AUTHOR; + return mode; + } + + + private ActionMessages validate(SurveyForm surveyForm, ActionMapping mapping, HttpServletRequest request) { + ActionMessages errors = new ActionMessages(); + if (StringUtils.isBlank(surveyForm.getSurvey().getTitle())) { + ActionMessage error = new ActionMessage("error.survey.item.title.blank"); + errors.add(ActionMessages.GLOBAL_MESSAGE, error); + } + //define it later mode(TEACHER) skip below validation. + String modeStr = request.getParameter(AttributeNames.ATTR_MODE); + if(StringUtils.equals(modeStr, ToolAccessMode.TEACHER.toString())){ + return errors; + } + + //Some other validation outside basic Tab. + + return errors; + } + /** + * Ajax call, will add one more input line for new survey item instruction. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward newInstruction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + int count = NumberUtils.stringToInt(request.getParameter(INSTRUCTION_ITEM_COUNT),0); + List instructionList = new ArrayList(++count); + for(int idx=0;idx items = null; + Survey survey; + items = service.getSurveyItemsBySessionId(sessionId); + survey = service.getSurveyBySessionId(sessionId); + + //check whehter finish lock is on/off + boolean lock = survey.getLockWhenFinished() && surveyUser.isSessionFinished(); + + + //check whether there is only one survey item and run auto flag is true or not. + boolean runAuto = false; + int itemsNumber = 0; + if(survey.getSurveyItems() != null){ + itemsNumber = survey.getSurveyItems().size(); + if(survey.isRunAuto() && itemsNumber == 1){ + SurveyQuestion item = (SurveyQuestion) survey.getSurveyItems().iterator().next(); + //only visible item can be run auto. + if(!item.isHide()){ + runAuto = true; + request.setAttribute(SurveyConstants.ATTR_RESOURCE_ITEM_UID,item.getUid()); + } + } + } + + //basic information + sessionMap.put(SurveyConstants.ATTR_TITLE,survey.getTitle()); + sessionMap.put(SurveyConstants.ATTR_RESOURCE_INSTRUCTION,survey.getInstructions()); + sessionMap.put(SurveyConstants.ATTR_FINISH_LOCK,lock); + + sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID,sessionId); + sessionMap.put(AttributeNames.ATTR_MODE,mode); + //reflection information + sessionMap.put(SurveyConstants.ATTR_REFLECTION_ON,survey.isReflectOnActivity()); + sessionMap.put(SurveyConstants.ATTR_REFLECTION_INSTRUCTION,survey.getReflectInstructions()); + sessionMap.put(SurveyConstants.ATTR_RUN_AUTO,new Boolean(runAuto)); + + //add define later support + if(survey.isDefineLater()){ + return mapping.findForward("defineLater"); + } + + //set contentInUse flag to true! + survey.setContentInUse(true); + survey.setDefineLater(false); + service.saveOrUpdateSurvey(survey); + + //add run offline support + if(survey.getRunOffline()){ + sessionMap.put(SurveyConstants.PARAM_RUN_OFFLINE, true); + return mapping.findForward("runOffline"); + }else + sessionMap.put(SurveyConstants.PARAM_RUN_OFFLINE, false); + + //init survey item list + SortedSet surveyItemList = getSurveyItemList(sessionMap); + surveyItemList.clear(); + if(items != null){ + //remove hidden items. + for(SurveyQuestion item : items){ + //becuase in webpage will use this login name. Here is just + //initial it to avoid session close error in proxy object. + item.getCreateBy().getLoginName(); + if(!item.isHide()){ + surveyItemList.add(item); + } + } + } + + //set complete flag for display purpose + service.retrieveComplete(surveyItemList, surveyUser); + + sessionMap.put(SurveyConstants.ATTR_RESOURCE,survey); + + return mapping.findForward(SurveyConstants.SUCCESS); + } + /** + * Mark survey item as complete status. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward complete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + String mode = request.getParameter(AttributeNames.ATTR_MODE); + String sessionMapID = request.getParameter(SurveyConstants.ATTR_SESSION_MAP_ID); + + doComplete(request); + + request.setAttribute(AttributeNames.ATTR_MODE,mode); + request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID,sessionMapID); + return mapping.findForward(SurveyConstants.SUCCESS); + } + /** + * Finish learning session. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + + //get back SessionMap + String sessionMapID = request.getParameter(SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + + //get mode and ToolSessionID from sessionMAP + ToolAccessMode mode = (ToolAccessMode) sessionMap.get(AttributeNames.ATTR_MODE); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + + //auto run mode, when use finish the only one survey item, mark it as complete then finish this activity as well. + String surveyItemUid = request.getParameter(SurveyConstants.PARAM_RESOURCE_ITEM_UID); + if(surveyItemUid != null){ + doComplete(request); + //NOTE:So far this flag is useless(31/08/2006). + //set flag, then finish page can know redir target is parent(AUTO_RUN) or self(normal) + request.setAttribute(SurveyConstants.ATTR_RUN_AUTO,true); + }else + request.setAttribute(SurveyConstants.ATTR_RUN_AUTO,false); + + if(!validateBeforeFinish(request, sessionMapID)) + return mapping.getInputForward(); + + ISurveyService service = getSurveyService(); + // get sessionId from HttpServletRequest + String nextActivityUrl = null ; + try { + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + Long userID = new Long(user.getUserID().longValue()); + + nextActivityUrl = service.finishToolSession(sessionId,userID); + request.setAttribute(SurveyConstants.ATTR_NEXT_ACTIVITY_URL,nextActivityUrl); + } catch (SurveyApplicationException e) { + log.error("Failed get next activity url:" + e.getMessage()); + } + + return mapping.findForward(SurveyConstants.SUCCESS); + } + + + /** + * Save file or url survey item into database. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward saveOrUpdateItem(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + //get back SessionMap + String sessionMapID = request.getParameter(SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, sessionMapID); + + Long sessionId = (Long) sessionMap.get(SurveyConstants.ATTR_TOOL_SESSION_ID); + + String mode = request.getParameter(AttributeNames.ATTR_MODE); + SurveyItemForm itemForm = (SurveyItemForm)form; + ActionErrors errors = validateSurveyItem(itemForm); + + if(!errors.isEmpty()){ + this.addErrors(request,errors); + return findForward(itemForm.getItemType(),mapping); + } + short type = itemForm.getItemType(); + + //create a new SurveyItem + SurveyQuestion item = new SurveyQuestion(); + ISurveyService service = getSurveyService(); + SurveyUser surveyUser = getCurrentUser(service,sessionId); + item.setType(type); + item.setTitle(itemForm.getTitle()); + item.setDescription(itemForm.getDescription()); + item.setCreateDate(new Timestamp(new Date().getTime())); + item.setCreateByAuthor(false); + item.setCreateBy(surveyUser); + + //special attribute for URL or FILE + if(type == SurveyConstants.RESOURCE_TYPE_FILE){ + try { + service.uploadSurveyItemFile(item, itemForm.getFile()); + } catch (UploadSurveyFileException e) { + log.error("Failed upload Survey File " + e.toString()); + return mapping.findForward(SurveyConstants.ERROR); + } + }else if(type == SurveyConstants.RESOURCE_TYPE_URL){ + item.setUrl(itemForm.getUrl()); + item.setAppendText(itemForm.isOpenUrlNewWindow()); + } + //save and update session + + SurveySession resSession = service.getSurveySessionBySessionId(sessionId); + if(resSession == null){ + log.error("Failed update SurveySession by ID[" + sessionId + "]"); + return mapping.findForward(SurveyConstants.ERROR); + } + Set items = resSession.getSurveyQuestions(); + if(items == null){ + items = new HashSet(); + resSession.setSurveyQuestions(items); + } + items.add(item); + service.saveOrUpdateSurveySession(resSession); + + //update session value + SortedSet surveyItemList = getSurveyItemList(sessionMap); + surveyItemList.add(item); + + //URL or file upload + request.setAttribute(SurveyConstants.ATTR_ADD_RESOURCE_TYPE,new Short(type)); + request.setAttribute(AttributeNames.ATTR_MODE,mode); + return mapping.findForward(SurveyConstants.SUCCESS); + } + /** + * Display empty reflection form. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward newReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + //get session value + String sessionMapID = WebUtil.readStrParam(request, SurveyConstants.ATTR_SESSION_MAP_ID); + if(!validateBeforeFinish(request, sessionMapID)) + return mapping.getInputForward(); + + ReflectionForm refForm = (ReflectionForm) form; + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + + refForm.setUserID(user.getUserID()); + refForm.setSessionMapID(sessionMapID); + + return mapping.findForward(SurveyConstants.SUCCESS); + } + /** + * Submit reflection form input database. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + ReflectionForm refForm = (ReflectionForm) form; + Integer userId = refForm.getUserID(); + + String sessionMapID = WebUtil.readStrParam(request, SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + + ISurveyService service = getSurveyService(); + service.createNotebookEntry(sessionId, + CoreNotebookConstants.NOTEBOOK_TOOL, + SurveyConstants.TOOL_SIGNATURE, + userId, + refForm.getEntryText()); + + return finish(mapping, form, request, response); + } + + + //************************************************************************************* + // Private method + //************************************************************************************* + private boolean validateBeforeFinish(HttpServletRequest request, String sessionMapID) { + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + Long userID = new Long(user.getUserID().longValue()); + + ISurveyService service = getSurveyService(); + int miniViewFlag = service.checkMiniView(sessionId,userID); + //if current user view less than reqired view count number, then just return error message. + //if it is runOffline content, then need not check minimum view count + Boolean runOffline = (Boolean) sessionMap.get(SurveyConstants.PARAM_RUN_OFFLINE); + if(miniViewFlag > 0 && !runOffline){ + ActionErrors errors = new ActionErrors(); + errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("lable.learning.minimum.view.number.less",miniViewFlag)); + this.addErrors(request,errors); + return false; + } + + return true; + } + private ISurveyService getSurveyService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); + return (ISurveyService) wac.getBean(SurveyConstants.RESOURCE_SERVICE); + } + /** + * List save current survey items. + * @param request + * @return + */ + private SortedSet getSurveyItemList(SessionMap sessionMap) { + SortedSet list = (SortedSet) sessionMap.get(SurveyConstants.ATTR_RESOURCE_ITEM_LIST); + if(list == null){ + list = new TreeSet(new SurveyItemComparator()); + sessionMap.put(SurveyConstants.ATTR_RESOURCE_ITEM_LIST,list); + } + return list; + } + /** + * Get java.util.List from HttpSession by given name. + * + * @param request + * @param name + * @return + */ + private List getListFromSession(SessionMap sessionMap,String name) { + List list = (List) sessionMap.get(name); + if(list == null){ + list = new ArrayList(); + sessionMap.put(name,list); + } + return list; + } + + /** + * Return ActionForward according to survey item type. + * @param type + * @param mapping + * @return + */ + private ActionForward findForward(short type, ActionMapping mapping) { + ActionForward forward; + switch (type) { + case SurveyConstants.RESOURCE_TYPE_URL: + forward = mapping.findForward("url"); + break; + case SurveyConstants.RESOURCE_TYPE_FILE: + forward = mapping.findForward("file"); + break; + case SurveyConstants.RESOURCE_TYPE_WEBSITE: + forward = mapping.findForward("website"); + break; + case SurveyConstants.RESOURCE_TYPE_LEARNING_OBJECT: + forward = mapping.findForward("learningobject"); + break; + default: + forward = null; + break; + } + return forward; + } + + private SurveyUser getCurrentUser(ISurveyService service, Long sessionId) { + //try to get form system session + HttpSession ss = SessionManager.getSession(); + //get back login user DTO + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + SurveyUser surveyUser = service.getUserByIDAndSession(new Long(user.getUserID().intValue()),sessionId); + + if(surveyUser == null){ + SurveySession session = service.getSurveySessionBySessionId(sessionId); + surveyUser = new SurveyUser(user,session); + service.createUser(surveyUser); + } + return surveyUser; + } + /** + * @param itemForm + * @return + */ + private ActionErrors validateSurveyItem(SurveyItemForm itemForm) { + ActionErrors errors = new ActionErrors(); + if(StringUtils.isBlank(itemForm.getTitle())) + errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_TITLE_BLANK)); + + if(itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_URL){ + if(StringUtils.isBlank(itemForm.getUrl())) + errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_URL_BLANK)); + //URL validation: Commom URL validate(1.3.0) work not very well: it can not support http://address:port format!!! +// UrlValidator validator = new UrlValidator(); +// if(!validator.isValid(itemForm.getUrl())) +// errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_INVALID_URL)); + } +// if(itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_WEBSITE +// ||itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_LEARNING_OBJECT){ + if(StringUtils.isBlank(itemForm.getDescription())) + errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_DESC_BLANK)); +// } + if(itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_WEBSITE + ||itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_LEARNING_OBJECT + ||itemForm.getItemType() == SurveyConstants.RESOURCE_TYPE_FILE){ + //for edit validate: file already exist + if(!itemForm.isHasFile() && + (itemForm.getFile() == null || StringUtils.isEmpty(itemForm.getFile().getFileName()))) + errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage(SurveyConstants.ERROR_MSG_FILE_BLANK)); + } + return errors; + } + /** + * Set complete flag for given survey item. + * @param request + * @param sessionId + */ + private void doComplete(HttpServletRequest request) { + //get back sessionMap + String sessionMapID = request.getParameter(SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + + Long surveyItemUid = new Long(request.getParameter(SurveyConstants.PARAM_RESOURCE_ITEM_UID)); + ISurveyService service = getSurveyService(); + HttpSession ss = SessionManager.getSession(); + //get back login user DTO + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + + Long sessionId = (Long) sessionMap.get(SurveyConstants.ATTR_TOOL_SESSION_ID); + service.setItemComplete(surveyItemUid,new Long(user.getUserID().intValue()),sessionId); + + //set survey item complete tag + SortedSet surveyItemList = getSurveyItemList(sessionMap); + for(SurveyQuestion item:surveyItemList){ + if(item.getUid().equals(surveyItemUid)){ + item.setComplete(true); + break; + } + } + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/MonitoringAction.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/MonitoringAction.java 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,214 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id: MonitoringAction.java,v 1.1 2006/09/12 04:15:19 steven Exp $ */ +package org.lamsfoundation.lams.tool.survey.web.action; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; +import org.lamsfoundation.lams.tool.survey.SurveyConstants; +import org.lamsfoundation.lams.tool.survey.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.survey.dto.Summary; +import org.lamsfoundation.lams.tool.survey.model.Survey; +import org.lamsfoundation.lams.tool.survey.model.SurveySession; +import org.lamsfoundation.lams.tool.survey.model.SurveyUser; +import org.lamsfoundation.lams.tool.survey.service.ISurveyService; +import org.lamsfoundation.lams.tool.survey.util.SurveyWebUtils; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +public class MonitoringAction extends Action { + public static Logger log = Logger.getLogger(MonitoringAction.class); + + + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + String param = mapping.getParameter(); + + if (param.equals("summary")) { + return summary(mapping, form, request, response); + } + + if (param.equals("listuser")) { + return listuser(mapping, form, request, response); + } + if (param.equals("showitem")) { + return showitem(mapping, form, request, response); + } + if (param.equals("hideitem")) { + return hideitem(mapping, form, request, response); + } + if (param.equals("viewReflection")) { + return viewReflection(mapping, form, request, response); + } + + + return mapping.findForward(SurveyConstants.ERROR); + } + + + private ActionForward hideitem(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long itemUid = WebUtil.readLongParam(request, SurveyConstants.PARAM_RESOURCE_ITEM_UID); + ISurveyService service = getSurveyService(); + service.setItemVisible(itemUid,false); + + //get back SessionMap + String sessionMapID = request.getParameter(SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + + //update session value + List groupList = (List) sessionMap.get(SurveyConstants.ATTR_SUMMARY_LIST); + if(groupList != null) + for(List group : groupList){ + for(Summary sum: group){ + if(itemUid.equals(sum.getItemUid())){ + sum.setItemHide(true); + break; + } + } + } + + return mapping.findForward(SurveyConstants.SUCCESS); + } + + private ActionForward showitem(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long itemUid = WebUtil.readLongParam(request, SurveyConstants.PARAM_RESOURCE_ITEM_UID); + ISurveyService service = getSurveyService(); + service.setItemVisible(itemUid,true); + + //get back SessionMap + String sessionMapID = request.getParameter(SurveyConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + + //update session value + List groupList = (List) sessionMap.get(SurveyConstants.ATTR_SUMMARY_LIST); + if(groupList != null) + for(List group : groupList){ + for(Summary sum: group){ + if(itemUid.equals(sum.getItemUid())){ + sum.setItemHide(false); + break; + } + } + } + return mapping.findForward(SurveyConstants.SUCCESS); + } + + private ActionForward summary(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + //initial Session Map + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + + Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + ISurveyService service = getSurveyService(); + List> groupList = service.getSummary(contentId); + + Survey survey = service.getSurveyByContentId(contentId); + survey.toDTO(); + + Map >relectList = service.getReflectList(contentId); + + //cache into sessionMap + sessionMap.put(SurveyConstants.ATTR_SUMMARY_LIST, groupList); + sessionMap.put(SurveyConstants.PAGE_EDITABLE, new Boolean(SurveyWebUtils.isSurveyEditable(survey))); + sessionMap.put(SurveyConstants.ATTR_RESOURCE, survey); + sessionMap.put(SurveyConstants.ATTR_TOOL_CONTENT_ID, contentId); + sessionMap.put(SurveyConstants.ATTR_REFLECT_LIST, relectList); + + return mapping.findForward(SurveyConstants.SUCCESS); + } + + private ActionForward listuser(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long sessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + Long itemUid = WebUtil.readLongParam(request, SurveyConstants.PARAM_RESOURCE_ITEM_UID); + + //get user list by given item uid + ISurveyService service = getSurveyService(); + List list = service.getUserListBySessionItem(sessionId, itemUid); + + //set to request + request.setAttribute(SurveyConstants.ATTR_USER_LIST, list); + return mapping.findForward(SurveyConstants.SUCCESS); + } + + private ActionForward viewReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + Long uid = WebUtil.readLongParam(request, SurveyConstants.ATTR_USER_UID); + Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + + ISurveyService service = getSurveyService(); + SurveyUser user = service.getUser(uid); + NotebookEntry notebookEntry = service.getEntry(sessionID, + CoreNotebookConstants.NOTEBOOK_TOOL, + SurveyConstants.TOOL_SIGNATURE, user.getUserId().intValue()); + + SurveySession session = service.getSurveySessionBySessionId(sessionID); + + ReflectDTO refDTO = new ReflectDTO(user); + if(notebookEntry == null){ + refDTO.setFinishReflection(false); + refDTO.setReflect(null); + }else{ + refDTO.setFinishReflection(true); + refDTO.setReflect(notebookEntry.getEntry()); + } + refDTO.setReflectInstrctions(session.getSurvey().getReflectInstructions()); + + request.setAttribute("userDTO", refDTO); + return mapping.findForward("success"); + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + private ISurveyService getSurveyService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + return (ISurveyService) wac.getBean(SurveyConstants.RESOURCE_SERVICE); + } +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/ReflectionForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/ReflectionForm.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/ReflectionForm.java 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,92 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id: ReflectionForm.java,v 1.1 2006/09/12 04:15:18 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.web.form; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.validator.ValidatorForm; + +/** + * + * Reflection Form. + * @struts.form name="reflectionForm" + * + */ +public class ReflectionForm extends ValidatorForm { + private static final long serialVersionUID = -9054365604649146735L; + private static Logger logger = Logger.getLogger(ReflectionForm.class.getName()); + + private Integer userID; + private String sessionMapID; + private String entryText; + + /** + * MessageForm validation method from STRUCT interface. + * + */ + public ActionErrors validate(ActionMapping mapping, + javax.servlet.http.HttpServletRequest request) { + ActionErrors errors = new ActionErrors(); + try{ + if (StringUtils.isBlank(entryText)) { + ActionMessage error = new ActionMessage("error.reflection.emtpy"); + errors.add(ActionMessages.GLOBAL_MESSAGE, error); + } + + } catch (Exception e) { + logger.error(e); + } + return errors; + } + + public String getEntryText() { + return entryText; + } + + public void setEntryText(String entryText) { + this.entryText = entryText; + } + + public Integer getUserID() { + return userID; + } + + public void setUserID(Integer userUid) { + this.userID = userUid; + } + + public String getSessionMapID() { + return sessionMapID; + } + + public void setSessionMapID(String sessionMapID) { + this.sessionMapID = sessionMapID; + } + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/SurveyForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/SurveyForm.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/SurveyForm.java 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,139 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyForm.java,v 1.1 2006/09/12 04:15:18 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.web.form; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; +import org.lamsfoundation.lams.tool.survey.model.Survey; +import org.lamsfoundation.lams.tool.survey.model.SurveyAttachment; + +/** + * + * Survey Form. + * @struts.form name="surveyForm" + * + * User: Dapeng.Ni + */ +public class SurveyForm extends ActionForm { + private static final long serialVersionUID = 3599879328307492312L; + + private static Logger logger = Logger.getLogger(SurveyForm.class.getName()); + + //Forum fields + private String sessionMapID; + private String contentFolderID; + private int currentTab; + private FormFile offlineFile; + private FormFile onlineFile; + + private Survey survey; + + public SurveyForm(){ + survey = new Survey(); + survey.setTitle("Shared Survey"); + currentTab = 1; + } + + public void setSurvey(Survey survey) { + this.survey = survey; + //set Form special varaible from given forum + if(survey == null){ + logger.error("Initial SurveyForum failed by null value of Survey."); + } + } + public void reset(ActionMapping mapping, HttpServletRequest request){ + String param = mapping.getParameter(); + //if it is start page, all data read out from database or current session + //so need not reset checkbox to refresh value! + if(!StringUtils.equals(param,"start") && !StringUtils.equals(param,"initPage")){ + survey.setLockWhenFinished(false); + survey.setDefineLater(false); + survey.setRunOffline(false); + survey.setReflectOnActivity(false); + } + } + + public int getCurrentTab() { + return currentTab; + } + + + public void setCurrentTab(int currentTab) { + this.currentTab = currentTab; + } + + + public FormFile getOfflineFile() { + return offlineFile; + } + + + public void setOfflineFile(FormFile offlineFile) { + this.offlineFile = offlineFile; + } + + + public FormFile getOnlineFile() { + return onlineFile; + } + + + public void setOnlineFile(FormFile onlineFile) { + this.onlineFile = onlineFile; + } + + + public Survey getSurvey() { + return survey; + } + + public String getSessionMapID() { + return sessionMapID; + } + + public void setSessionMapID(String sessionMapID) { + this.sessionMapID = sessionMapID; + } + + public String getContentFolderID() { + return contentFolderID; + } + + public void setContentFolderID(String contentFolderID) { + this.contentFolderID = contentFolderID; + } + + +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/SurveyItemForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/Attic/SurveyItemForm.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/SurveyItemForm.java 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,132 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id: SurveyItemForm.java,v 1.1 2006/09/12 04:15:18 steven Exp $$ */ +package org.lamsfoundation.lams.tool.survey.web.form; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.upload.FormFile; +/** + * Survey Item Form. + * @struts.form name="surveyItemForm" + * @author Steve.Ni + * + * @version $Revision: 1.1 $ + */ +public class SurveyItemForm extends ActionForm { + private String itemIndex; + private String sessionMapID; + + //tool access mode; + private String mode; + + private String title; + private short itemType; + private String description; + private String url; + private boolean openUrlNewWindow; + //flag of this item has attachment or not + private boolean hasFile; + private Long fileUuid; + private Long fileVersionId; + private String fileName; + private FormFile file; + + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public FormFile getFile() { + return file; + } + public void setFile(FormFile file) { + this.file = file; + } + public String getTitle() { + return title; + } + public void setTitle(String title) { + this.title = title; + } + public String getUrl() { + return url; + } + public void setUrl(String url) { + this.url = url; + } + public String getItemIndex() { + return itemIndex; + } + public void setItemIndex(String itemIndex) { + this.itemIndex = itemIndex; + } + public short getItemType() { + return itemType; + } + public void setItemType(short type) { + this.itemType = type; + } + public String getFileName() { + return fileName; + } + public void setFileName(String fileName) { + this.fileName = fileName; + } + public Long getFileUuid() { + return fileUuid; + } + public void setFileUuid(Long fileUuid) { + this.fileUuid = fileUuid; + } + public Long getFileVersionId() { + return fileVersionId; + } + public void setFileVersionId(Long fileVersionId) { + this.fileVersionId = fileVersionId; + } + public boolean isHasFile() { + return hasFile; + } + public void setHasFile(boolean hasFile) { + this.hasFile = hasFile; + } + public boolean isOpenUrlNewWindow() { + return openUrlNewWindow; + } + public void setOpenUrlNewWindow(boolean openUrlNewWindow) { + this.openUrlNewWindow = openUrlNewWindow; + } + public String getSessionMapID() { + return sessionMapID; + } + public void setSessionMapID(String sessionMapID) { + this.sessionMapID = sessionMapID; + } + public String getMode() { + return mode; + } + public void setMode(String mode) { + this.mode = mode; + } +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,153 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id: ExportServlet.java,v 1.1 2006/09/12 04:15:20 steven Exp $$ */ + +package org.lamsfoundation.lams.tool.survey.web.servlet; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.survey.SurveyConstants; +import org.lamsfoundation.lams.tool.survey.dto.Summary; +import org.lamsfoundation.lams.tool.survey.model.Survey; +import org.lamsfoundation.lams.tool.survey.model.SurveyUser; +import org.lamsfoundation.lams.tool.survey.service.ISurveyService; +import org.lamsfoundation.lams.tool.survey.service.SurveyApplicationException; +import org.lamsfoundation.lams.tool.survey.service.SurveyServiceProxy; +import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; + +/** + * Export portfolio servlet to export all shared survey into offline HTML + * package. + * + * @author Steve.Ni + * + * @version $Revision: 1.1 $ + */ +public class ExportServlet extends AbstractExportPortfolioServlet { + private static final long serialVersionUID = -4529093489007108143L; + + private static Logger logger = Logger.getLogger(ExportServlet.class); + + private final String FILENAME = "shared_surveys_main.html"; + + public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { + +// initial sessionMap + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + + try { + if (StringUtils.equals(mode, ToolAccessMode.LEARNER.toString())) { + sessionMap.put(AttributeNames.ATTR_MODE,ToolAccessMode.LEARNER); + learner(request, response, directoryName, cookies,sessionMap); + } else if (StringUtils.equals(mode, ToolAccessMode.TEACHER.toString())) { + sessionMap.put(AttributeNames.ATTR_MODE,ToolAccessMode.TEACHER); + teacher(request, response, directoryName, cookies,sessionMap); + } + } catch (SurveyApplicationException e) { + logger.error("Cannot perform export for share survey tool."); + } + + String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + + request.getContextPath(); + writeResponseToFile(basePath + "/pages/export/exportportfolio.jsp?sessionMapID="+sessionMap.getSessionID() + , directoryName, FILENAME, cookies); + + return FILENAME; + } + + public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies, HashMap sessionMap) + throws SurveyApplicationException { + + ISurveyService service = SurveyServiceProxy.getSurveyService(getServletContext()); + + if (userID == null || toolSessionID == null) { + String error = "Tool session Id or user Id is null. Unable to continue"; + logger.error(error); + throw new SurveyApplicationException(error); + } + + SurveyUser learner = service.getUserByIDAndSession(userID,toolSessionID); + + if (learner == null) { + String error = "The user with user id " + userID + " does not exist."; + logger.error(error); + throw new SurveyApplicationException(error); + } + + Survey content = service.getSurveyBySessionId(toolSessionID); + + if (content == null) { + String error = "The content for this activity has not been defined yet."; + logger.error(error); + throw new SurveyApplicationException(error); + } + + + List group = service.exportBySessionId(toolSessionID,true); + + List groupList = new ArrayList(); + if(group.size() > 0) + groupList.add(group); + sessionMap.put(SurveyConstants.ATTR_TITLE, content.getTitle()); + sessionMap.put(SurveyConstants.ATTR_SUMMARY_LIST, groupList); + } + + public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies, HashMap sessionMap) + throws SurveyApplicationException { + ISurveyService service = SurveyServiceProxy.getSurveyService(getServletContext()); + + // check if toolContentId exists in db or not + if (toolContentID == null) { + String error = "Tool Content Id is missing. Unable to continue"; + logger.error(error); + throw new SurveyApplicationException(error); + } + + Survey content = service.getSurveyByContentId(toolContentID); + + if (content == null) { + String error = "Data is missing from the database. Unable to Continue"; + logger.error(error); + throw new SurveyApplicationException(error); + } + List> groupList = service.exportByContentId(toolContentID); + + // put it into HTTPSession + sessionMap.put(SurveyConstants.ATTR_TITLE, content.getTitle()); + sessionMap.put(SurveyConstants.ATTR_SUMMARY_LIST, groupList); + } + +} Index: lams_tool_survey/web/403.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/403.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/403.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,6 @@ +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c" %> + + + Index: lams_tool_survey/web/404.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/404.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/404.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,8 @@ +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c" %> + + + + + Index: lams_tool_survey/web/error.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/error.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/error.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,69 @@ + + +<%@ page language="java" isErrorPage="true" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> + + + + +<%-- Catch JSP Servlet Exception --%> +<% +if (exception != null) { +%> + + <%=exception.getMessage()%> + + + <%=exception.getClass().getName()%> + +<% + java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); + java.io.PrintStream os = new java.io.PrintStream(bos); + exception.printStackTrace(os); + String stack = new String(bos.toByteArray()); +%> + + <%=stack%> + +<% +} else if ((Exception) request.getAttribute("javax.servlet.error.exception") != null) { +%> + + + <%=((Exception) request.getAttribute("javax.servlet.error.exception")).getMessage()%> + + + <%=((Exception) request.getAttribute("javax.servlet.error.exception")).getMessage() + .getClass().getName()%> + +<% + java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); + java.io.PrintStream os = new java.io.PrintStream(bos); + ((Exception) request.getAttribute("javax.servlet.error.exception")).printStackTrace(os); + String stack = new String(bos.toByteArray()); +%> + + <%=stack%> + +<% +} +%> + +
+ + + +
+ + + + Index: lams_tool_survey/web/login.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/login.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/login.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,12 @@ +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c" %> + + + + Index: lams_tool_survey/web/WEB-INF/.cvsignore =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/Attic/.cvsignore,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/.cvsignore 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,4 @@ +lib +struts-config.xml +validation.xml +classes Index: lams_tool_survey/web/WEB-INF/tiles-defs.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/Attic/tiles-defs.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tiles-defs.xml 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/web/WEB-INF/web.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/web.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/web.xml 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,340 @@ + + + + Shared Surveys + + Shared Surveys tool + + + javax.servlet.jsp.jstl.fmt.localizationContext + org.lamsfoundation.lams.tool.survey.ApplicationSurveys + + + contextConfigLocation + + classpath:/org/lamsfoundation/lams/applicationContext.xml + classpath:/org/lamsfoundation/lams/contentrepository/applicationContext.xml + classpath:/org/lamsfoundation/lams/toolApplicationContext.xml + classpath:/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml + classpath:/org/lamsfoundation/lams/learning/learningApplicationContext.xml + classpath:/org/lamsfoundation/lams/tool/survey/surveyApplicationContext.xml + + + + + + org.springframework.web.context.ContextLoaderListener + + + + + hibernateFilter + + org.lamsfoundation.lams.util.CustomizedOpenSessionInViewFilter + + + sessionFactoryBeanName + surveySessionFactory + + + + + SystemSessionFilter + + org.lamsfoundation.lams.web.session.SystemSessionFilter + + + + LocaleFilter + + org.lamsfoundation.lams.web.filter.LocaleFilter + + + encoding + UTF-8 + + + + + hibernateFilter + /* + + + SystemSessionFilter + /* + + + LocaleFilter + /* + + + + + + exportPortfolio + org.lamsfoundation.lams.tool.survey.web.servlet.ExportServlet + + + + action + org.apache.struts.action.ActionServlet + + config + /WEB-INF/struts-config.xml + + + debug + 999 + + + detail + 1 + + + validate + true + + 2 + + + + Connector + com.fredck.FCKeditor.connector.ConnectorServlet + + baseDir + /UserFiles/ + + + debug + false + + 1 + + + + + Instructions Download + Instructions Download + download + org.lamsfoundation.lams.contentrepository.client.ToolDownload + + toolContentHandlerBeanName + surveyToolContentHandler + + 3 + + + + action + *.do + + + + Connector + /editor/filemanager/browser/default/connectors/jsp/connector + + + + download + /download/* + + + + exportPortfolio + /exportPortfolio + + + + + + + + tags-bean + /WEB-INF/tlds/struts/struts-bean.tld + + + tags-html + /WEB-INF/tlds/struts/struts-html.tld + + + tags-logic + /WEB-INF/tlds/struts/struts-logic.tld + + + tags-tiles + /WEB-INF/tlds/struts/struts-tiles.tld + + + + + + tags-fmt + /WEB-INF/tlds/jstl/fmt.tld + + + tags-core + /WEB-INF/tlds/jstl/c.tld + + + tags-function + /WEB-INF/tlds/jstl/fn.tld + + + tags-xml + /WEB-INF/tlds/jstl/x.tld + + + + + + fck-editor + /WEB-INF/tlds/fckeditor/FCKeditor.tld + + + + + + tags-lams + /WEB-INF/tlds/lams/lams.tld + + + + + + + + Secure Content + /* + + + LEARNER + TEACHER + MONITOR + AUTHOR + ADMIN + SYSADMIN + + + + + + Authoring Update + /authoring.do + + + AUTHOR + + + + + Staff Content + /monitoring.do + + + MONITOR + TEACHER + + + + + Staff Content + /definelater.do + + + MONITOR + TEACHER + + + + + + Adminstrator Content + /admin.do + + + ADMIN + + + + + LAMS System Adminstrator Content + /sysadmin.do + + + SYSADMIN + + + + + + Download Files + /download/ + + + AUTHOR + MONITOR + TEACHER + ADMIN + SYSADMIN + + + + + + + + Student + LEARNER + + + Student + TEACHER + + + + Can create/modify a learning design + AUTHOR + + + + Can running and monitoring a learning session + MONITOR + + + + Can add/remove users to the system, set up classes of users for sessions + ADMIN + + + + Can add/remove users to the system, set up classes of users for sessions + SYSADMIN + + + + FORM + LAMS + + /login.jsp + /login.jsp?failed=y + + + + + 500 + /error.jsp + + + 403 + /403.jsp + + + 404 + /404.jsp + + + Index: lams_tool_survey/web/WEB-INF/tags/AuthoringButton.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/AuthoringButton.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/AuthoringButton.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,93 @@ +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * AuthoringButton.tag + * Author: Dapeng Ni + * Description: Creates the save/cancel button for authoring page + */ + + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-html" prefix="html" %> + +<%@ attribute name="formID" required="true" rtexprvalue="true" %> +<%@ attribute name="toolSignature" required="true" rtexprvalue="true" %> +<%@ attribute name="toolContentID" required="true" rtexprvalue="true" %> +<%@ attribute name="contentFolderID" required="true" rtexprvalue="true" %> +<%@ attribute name="clearSessionActionUrl" required="true" rtexprvalue="true" %> + +<%-- Optional attribute --%> +<%@ attribute name="accessMode" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelConfirmMsgKey" required="false" rtexprvalue="true" %> +<%@ attribute name="defineLater" required="false" rtexprvalue="true" %> +<%@ attribute name="customiseSessionID" required="false" rtexprvalue="true" %> + +<%-- Default value for message key --%> + + + + + + + + + + + + + + + +

+ + + + + + +

+ Index: lams_tool_survey/web/WEB-INF/tags/Date.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/Date.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/Date.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,37 @@ +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Author: Fiona Malikoff + * Description: Format a date, using the locale, based on standard parameters. + * Need to use long for the date otherwise the AU locale comes out as 1/2/06 and + * full is needed to include the timezone. + */ + + %> +<%@ tag body-content="empty" %> +<%@ attribute name="value" required="true" rtexprvalue="true" type="java.util.Date" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> + + Index: lams_tool_survey/web/WEB-INF/tags/DefineLater.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/DefineLater.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/DefineLater.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,55 @@ +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * DefineLater.tag + * Author: Fiona Malikoff + * Description: Layout for "Define Later" screens - to be used in learning. + * A suggested layout - unless the tool has special requirements, this layout should be used. + * Expects to be used inside
+ */ +%> + +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-core" prefix="c" %> + +<%@ attribute name="defineLaterMessageKey" required="false" rtexprvalue="true" %> +<%@ attribute name="buttonTryAgainKey" required="false" rtexprvalue="true" %> + +<%-- Default value for I18N keys --%> + + + + + + + +

 

+ +

+ +

+ +
Index: lams_tool_survey/web/WEB-INF/tags/ExportPortOutput.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/Attic/ExportPortOutput.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/ExportPortOutput.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,59 @@ +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Passon + * Author: Fiona Malikoff + * Description: Outputs the Activity details on the main page in export portfolio. Recursive tag. + * + */ + + %> +<%@ tag body-content="empty" %> +<%@ attribute name="actport" required="true" rtexprvalue="true" type="org.lamsfoundation.lams.learning.export.ActivityPortfolio" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + +
  • + + + "/> + + + + + + + + +
      + + + +
    +
    +
    + +
  • + Index: lams_tool_survey/web/WEB-INF/tags/FCKEditor.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/Attic/FCKEditor.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/FCKEditor.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,57 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="fck-editor" prefix="fck"%> + +<%@ attribute name="id" required="true" rtexprvalue="true"%> +<%@ attribute name="value" required="true" rtexprvalue="true"%> +<%@ attribute name="toolbarSet" required="false" rtexprvalue="true"%> +<%@ attribute name="contentFolderID" required="true" rtexprvalue="true"%> + + + + + + + + + + + + + + + ${value} + + + + + Index: lams_tool_survey/web/WEB-INF/tags/Passon.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/Attic/Passon.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/Passon.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,82 @@ +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Passon + * Author: Mitchell Seaton + * Description: Passes on progress data to the Flash Learner to update the progress bar. + * + */ + + %> +<%@ tag body-content="empty" %> +<%@ attribute name="progress" required="true" rtexprvalue="true" type="java.lang.String" %> +<%@ attribute name="id" required="true" rtexprvalue="true" %> +<%@ attribute name="redirect" required="false" rtexprvalue="true" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + + + + + + + + + + Index: lams_tool_survey/web/WEB-INF/tags/Tab.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/Tab.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/Tab.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,99 @@ +<%/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Tab.tag + * Author: Mitchell Seaton + * Description: Creates a tab element. + * Wiki: + */ + + %> +<%@ tag body-content="empty"%> +<%@ attribute name="id" required="true" rtexprvalue="true"%> +<%@ attribute name="value" required="false" rtexprvalue="true"%> +<%@ attribute name="key" required="false" rtexprvalue="true"%> +<%@ attribute name="inactive" required="false" rtexprvalue="true"%> +<%@ attribute name="methodCall" required="false" rtexprvalue="true"%> + +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + + + + + + + + +<%// Usually methodCall is selectTab, but the calling code can override methodCall if desired. + // this is handy if the page needs different logic on initialisation and user switching tabs %> + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/web/WEB-INF/tags/TabBody.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/TabBody.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/TabBody.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,52 @@ +<%/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * TabBody.tag + * Author: Mitchell Seaton + * Description: Creates the body container for a tab element + * Wiki: + */ + + %> +<%@ tag body-content="scriptless"%> +<%@ attribute name="id" required="true" rtexprvalue="true"%> +<%@ attribute name="tabTitle" required="false" rtexprvalue="true"%> +<%@ attribute name="titleKey" required="false" rtexprvalue="true"%> +<%@ attribute name="page" required="false" rtexprvalue="true"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-bean" prefix="bean"%> + + +
    + + + + + + + + + +
    + Index: lams_tool_survey/web/WEB-INF/tags/Tabs.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/Tabs.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/Tabs.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,69 @@ +<%/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Tabs.tag + * Author: Mitchell Seaton + * Description: Create a tab list from a input collection or nested Tab tags. + * Wiki: + */ + + %> +<%@ tag body-content="scriptless"%> +<%@ attribute name="collection" type="java.util.Collection" required="false" rtexprvalue="true"%> +<%@ attribute name="control" required="false" rtexprvalue="true"%> +<%@ attribute name="useKey" required="false" rtexprvalue="true"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + + + + + + + + + + + + Index: lams_tool_survey/web/WEB-INF/tags/headItems.tag =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tags/headItems.tag,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tags/headItems.tag 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,55 @@ +<%/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Standard Head Items + * Author: Fiona Malikoff + * Description: Includes all the standard head items e.g. the + * lams css files, sets the content type, standard javascript files. + */ + + %> +<%@ tag body-content="empty"%> + +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/web/WEB-INF/tlds/fckeditor/FCKeditor.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/fckeditor/Attic/FCKeditor.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/fckeditor/FCKeditor.tld 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,215 @@ + + + + + 2.3 + 1.1 + FCKeditor + http://fckeditor.net/tags-fckeditor + FCKeditor taglib + + editor + com.fredck.FCKeditor.tags.FCKeditorTag + JSP + + id + true + true + + + basePath + false + true + + + toolbarSet + false + true + + + width + false + true + + + height + false + true + + + customConfigurationsPath + false + true + + + editorAreaCSS + false + true + + + baseHref + false + true + + + skinPath + false + true + + + pluginsPath + false + true + + + fullPage + false + true + + + debug + false + true + + + autoDetectLanguage + false + true + + + defaultLanguage + false + true + + + contentLangDirection + false + true + + + enableXHTML + false + true + + + enableSourceXHTML + false + true + + + fillEmptyBlocks + false + true + + + formatSource + false + true + + + formatOutput + false + true + + + formatIndentator + false + true + + + geckoUseSPAN + false + true + + + startupFocus + false + true + + + forcePasteAsPlainText + false + true + + + forceSimpleAmpersand + false + true + + + tabSpaces + false + true + + + useBROnCarriageReturn + false + true + + + toolbarStartExpanded + false + true + + + toolbarCanCollapse + false + true + + + fontColors + false + true + + + fontNames + false + true + + + fontSizes + false + true + + + fontFormats + false + true + + + stylesXmlPath + false + true + + + linkBrowserURL + false + true + + + imageBrowserURL + false + true + + + flashBrowserURL + false + true + + + linkUploadURL + false + true + + + imageUploadURL + false + true + + + flashUploadURL + false + true + + + Index: lams_tool_survey/web/WEB-INF/tlds/jstl/c.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/jstl/c.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/jstl/c.tld 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,563 @@ + + + + + JSTL 1.1 core library + JSTL core + 1.1 + c + http://java.sun.com/jsp/jstl/core + + + + Provides core validation features for JSTL tags. + + + org.apache.taglibs.standard.tlv.JstlCoreTLV + + + + + + Catches any Throwable that occurs in its body and optionally + exposes it. + + catch + org.apache.taglibs.standard.tag.common.core.CatchTag + JSP + + +Name of the exported scoped variable for the +exception thrown from a nested action. The type of the +scoped variable is the type of the exception thrown. + + var + false + false + + + + + + Simple conditional tag that establishes a context for + mutually exclusive conditional operations, marked by + <when> and <otherwise> + + choose + org.apache.taglibs.standard.tag.common.core.ChooseTag + JSP + + + + + Simple conditional tag, which evalutes its body if the + supplied condition is true and optionally exposes a Boolean + scripting variable representing the evaluation of this condition + + if + org.apache.taglibs.standard.tag.rt.core.IfTag + JSP + + +The test condition that determines whether or +not the body content should be processed. + + test + true + true + boolean + + + +Name of the exported scoped variable for the +resulting value of the test condition. The type +of the scoped variable is Boolean. + + var + false + false + + + +Scope for var. + + scope + false + false + + + + + + Retrieves an absolute or relative URL and exposes its contents + to either the page, a String in 'var', or a Reader in 'varReader'. + + import + org.apache.taglibs.standard.tag.rt.core.ImportTag + org.apache.taglibs.standard.tei.ImportTEI + JSP + + +The URL of the survey to import. + + url + true + true + + + +Name of the exported scoped variable for the +survey's content. The type of the scoped +variable is String. + + var + false + false + + + +Scope for var. + + scope + false + false + + + +Name of the exported scoped variable for the +survey's content. The type of the scoped +variable is Reader. + + varReader + false + false + + + +Name of the context when accessing a relative +URL survey that belongs to a foreign +context. + + context + false + true + + + +Character encoding of the content at the input +survey. + + charEncoding + false + true + + + + + + The basic iteration tag, accepting many different + collection types and supporting subsetting and other + functionality + + forEach + org.apache.taglibs.standard.tag.rt.core.ForEachTag + org.apache.taglibs.standard.tei.ForEachTEI + JSP + + +Collection of items to iterate over. + + items + false + true + java.lang.Object + + + +If items specified: +Iteration begins at the item located at the +specified index. First item of the collection has +index 0. +If items not specified: +Iteration begins with index set at the value +specified. + + begin + false + true + int + + + +If items specified: +Iteration ends at the item located at the +specified index (inclusive). +If items not specified: +Iteration ends when index reaches the value +specified. + + end + false + true + int + + + +Iteration will only process every step items of +the collection, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. Its type depends +on the object of the underlying collection. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of type +javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Iterates over tokens, separated by the supplied delimeters + + forTokens + org.apache.taglibs.standard.tag.rt.core.ForTokensTag + JSP + + +String of tokens to iterate over. + + items + true + true + java.lang.String + + + +The set of delimiters (the characters that +separate the tokens in the string). + + delims + true + true + java.lang.String + + + +Iteration begins at the token located at the +specified index. First token has index 0. + + begin + false + true + int + + + +Iteration ends at the token located at the +specified index (inclusive). + + end + false + true + int + + + +Iteration will only process every step tokens +of the string, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of +type +javax.servlet.jsp.jstl.core.LoopTag +Status. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Like <%= ... >, but for expressions. + + out + org.apache.taglibs.standard.tag.rt.core.OutTag + JSP + + +Expression to be evaluated. + + value + true + true + + + +Default value if the resulting value is null. + + default + false + true + + + +Determines whether characters <,>,&,'," in the +resulting string should be converted to their +corresponding character entity codes. Default value is +true. + + escapeXml + false + true + + + + + + + Subtag of <choose> that follows <when> tags + and runs only if all of the prior conditions evaluated to + 'false' + + otherwise + org.apache.taglibs.standard.tag.common.core.OtherwiseTag + JSP + + + + + Adds a parameter to a containing 'import' tag's URL. + + param + org.apache.taglibs.standard.tag.rt.core.ParamTag + JSP + + +Name of the query string parameter. + + name + true + true + + + +Value of the parameter. + + value + false + true + + + + + + Redirects to a new URL. + + redirect + org.apache.taglibs.standard.tag.rt.core.RedirectTag + JSP + + +The URL of the survey to redirect to. + + url + false + true + + + +Name of the context when redirecting to a relative URL +survey that belongs to a foreign context. + + context + false + true + + + + + + Removes a scoped variable (from a particular scope, if specified). + + remove + org.apache.taglibs.standard.tag.common.core.RemoveTag + empty + + +Name of the scoped variable to be removed. + + var + true + false + + + +Scope for var. + + scope + false + false + + + + + + Sets the result of an expression evaluation in a 'scope' + + set + org.apache.taglibs.standard.tag.rt.core.SetTag + JSP + + +Name of the exported scoped variable to hold the value +specified in the action. The type of the scoped variable is +whatever type the value expression evaluates to. + + var + false + false + + + +Expression to be evaluated. + + value + false + true + + + +Target object whose property will be set. Must evaluate to +a JavaBeans object with setter property property, or to a +java.util.Map object. + + target + false + true + + + +Name of the property to be set in the target object. + + property + false + true + + + +Scope for var. + + scope + false + false + + + + + + Creates a URL with optional query parameters. + + url + org.apache.taglibs.standard.tag.rt.core.UrlTag + JSP + + +Name of the exported scoped variable for the +processed url. The type of the scoped variable is +String. + + var + false + false + + + +Scope for var. + + scope + false + false + + + +URL to be processed. + + value + false + true + + + +Name of the context when specifying a relative URL +survey that belongs to a foreign context. + + context + false + true + + + + + + Subtag of <choose> that includes its body if its + condition evalutes to 'true' + + when + org.apache.taglibs.standard.tag.rt.core.WhenTag + JSP + + +The test condition that determines whether or not the +body content should be processed. + + test + true + true + boolean + + + + Index: lams_tool_survey/web/WEB-INF/tlds/jstl/fmt.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/jstl/fmt.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/jstl/fmt.tld 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,671 @@ + + + + + JSTL 1.1 i18n-capable formatting library + JSTL fmt + 1.1 + fmt + http://java.sun.com/jsp/jstl/fmt + + + + Provides core validation features for JSTL tags. + + + org.apache.taglibs.standard.tlv.JstlFmtTLV + + + + + + Sets the request character encoding + + requestEncoding + org.apache.taglibs.standard.tag.rt.fmt.RequestEncodingTag + empty + + +Name of character encoding to be applied when +decoding request parameters. + + value + false + true + + + + + + Stores the given locale in the locale configuration variable + + setLocale + org.apache.taglibs.standard.tag.rt.fmt.SetLocaleTag + empty + + +A String value is interpreted as the +printable representation of a locale, which +must contain a two-letter (lower-case) +language code (as defined by ISO-639), +and may contain a two-letter (upper-case) +country code (as defined by ISO-3166). +Language and country codes must be +separated by hyphen (-) or underscore +(_). + + value + true + true + + + +Vendor- or browser-specific variant. +See the java.util.Locale javadocs for +more information on variants. + + variant + false + true + + + +Scope of the locale configuration variable. + + scope + false + false + + + + + + Specifies the time zone for any time formatting or parsing actions + nested in its body + + timeZone + org.apache.taglibs.standard.tag.rt.fmt.TimeZoneTag + JSP + + +The time zone. A String value is interpreted as +a time zone ID. This may be one of the time zone +IDs supported by the Java platform (such as +"America/Los_Angeles") or a custom time zone +ID (such as "GMT-8"). See +java.util.TimeZone for more information on +supported time zone formats. + + value + true + true + + + + + + Stores the given time zone in the time zone configuration variable + + setTimeZone + org.apache.taglibs.standard.tag.rt.fmt.SetTimeZoneTag + empty + + +The time zone. A String value is interpreted as +a time zone ID. This may be one of the time zone +IDs supported by the Java platform (such as +"America/Los_Angeles") or a custom time zone +ID (such as "GMT-8"). See java.util.TimeZone for +more information on supported time zone +formats. + + value + true + true + + + +Name of the exported scoped variable which +stores the time zone of type +java.util.TimeZone. + + var + false + false + + + +Scope of var or the time zone configuration +variable. + + scope + false + false + + + + + + Loads a survey bundle to be used by its tag body + + bundle + org.apache.taglibs.standard.tag.rt.fmt.BundleTag + JSP + + +Survey bundle base name. This is the bundle's +fully-qualified survey name, which has the same +form as a fully-qualified class name, that is, it uses +"." as the package component separator and does not +have any file type (such as ".class" or ".properties") +suffix. + + basename + true + true + + + +Prefix to be prepended to the value of the message +key of any nested <fmt:message> action. + + prefix + false + true + + + + + + Loads a survey bundle and stores it in the named scoped variable or + the bundle configuration variable + + setBundle + org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag + empty + + +Survey bundle base name. This is the bundle's +fully-qualified survey name, which has the same +form as a fully-qualified class name, that is, it uses +"." as the package component separator and does not +have any file type (such as ".class" or ".properties") +suffix. + + basename + true + true + + + +Name of the exported scoped variable which stores +the i18n localization context of type +javax.servlet.jsp.jstl.fmt.LocalizationC +ontext. + + var + false + false + + + +Scope of var or the localization context +configuration variable. + + scope + false + false + + + + + + Maps key to localized message and performs parametric replacement + + message + org.apache.taglibs.standard.tag.rt.fmt.MessageTag + JSP + + +Message key to be looked up. + + key + false + true + + + +Localization context in whose survey +bundle the message key is looked up. + + bundle + false + true + + + +Name of the exported scoped variable +which stores the localized message. + + var + false + false + + + +Scope of var. + + scope + false + false + + + + + + Supplies an argument for parametric replacement to a containing + <message> tag + + param + org.apache.taglibs.standard.tag.rt.fmt.ParamTag + JSP + + +Argument used for parametric replacement. + + value + false + true + + + + + + Formats a numeric value as a number, currency, or percentage + + formatNumber + org.apache.taglibs.standard.tag.rt.fmt.FormatNumberTag + JSP + + +Numeric value to be formatted. + + value + false + true + + + +Specifies whether the value is to be +formatted as number, currency, or +percentage. + + type + false + true + + + +Custom formatting pattern. + + pattern + false + true + + + +ISO 4217 currency code. Applied only +when formatting currencies (i.e. if type is +equal to "currency"); ignored otherwise. + + currencyCode + false + true + + + +Currency symbol. Applied only when +formatting currencies (i.e. if type is equal +to "currency"); ignored otherwise. + + currencySymbol + false + true + + + +Specifies whether the formatted output +will contain any grouping separators. + + groupingUsed + false + true + + + +Maximum number of digits in the integer +portion of the formatted output. + + maxIntegerDigits + false + true + + + +Minimum number of digits in the integer +portion of the formatted output. + + minIntegerDigits + false + true + + + +Maximum number of digits in the +fractional portion of the formatted output. + + maxFractionDigits + false + true + + + +Minimum number of digits in the +fractional portion of the formatted output. + + minFractionDigits + false + true + + + +Name of the exported scoped variable +which stores the formatted result as a +String. + + var + false + false + + + +Scope of var. + + scope + false + false + + + + + + Parses the string representation of a number, currency, or percentage + + parseNumber + org.apache.taglibs.standard.tag.rt.fmt.ParseNumberTag + JSP + + +String to be parsed. + + value + false + true + + + +Specifies whether the string in the value +attribute should be parsed as a number, +currency, or percentage. + + type + false + true + + + +Custom formatting pattern that determines +how the string in the value attribute is to be +parsed. + + pattern + false + true + + + +Locale whose default formatting pattern (for +numbers, currencies, or percentages, +respectively) is to be used during the parse +operation, or to which the pattern specified +via the pattern attribute (if present) is +applied. + + parseLocale + false + true + + + +Specifies whether just the integer portion of +the given value should be parsed. + + integerOnly + false + true + + + +Name of the exported scoped variable which +stores the parsed result (of type +java.lang.Number). + + var + false + false + + + +Scope of var. + + scope + false + false + + + + + + Formats a date and/or time using the supplied styles and pattern + + formatDate + org.apache.taglibs.standard.tag.rt.fmt.FormatDateTag + empty + + +Date and/or time to be formatted. + + value + true + true + + + +Specifies whether the time, the date, or both +the time and date components of the given +date are to be formatted. + + type + false + true + + + +Predefined formatting style for dates. Follows +the semantics defined in class +java.text.DateFormat. Applied only +when formatting a date or both a date and +time (i.e. if type is missing or is equal to +"date" or "both"); ignored otherwise. + + dateStyle + false + true + + + +Predefined formatting style for times. Follows +the semantics defined in class +java.text.DateFormat. Applied only +when formatting a time or both a date and +time (i.e. if type is equal to "time" or "both"); +ignored otherwise. + + timeStyle + false + true + + + +Custom formatting style for dates and times. + + pattern + false + true + + + +Time zone in which to represent the formatted +time. + + timeZone + false + true + + + +Name of the exported scoped variable which +stores the formatted result as a String. + + var + false + false + + + +Scope of var. + + scope + false + false + + + + + + Parses the string representation of a date and/or time + + parseDate + org.apache.taglibs.standard.tag.rt.fmt.ParseDateTag + JSP + + +Date string to be parsed. + + value + false + true + + + +Specifies whether the date string in the +value attribute is supposed to contain a +time, a date, or both. + + type + false + true + + + +Predefined formatting style for days +which determines how the date +component of the date string is to be +parsed. Applied only when formatting a +date or both a date and time (i.e. if type +is missing or is equal to "date" or "both"); +ignored otherwise. + + dateStyle + false + true + + + +Predefined formatting styles for times +which determines how the time +component in the date string is to be +parsed. Applied only when formatting a +time or both a date and time (i.e. if type +is equal to "time" or "both"); ignored +otherwise. + + timeStyle + false + true + + + +Custom formatting pattern which +determines how the date string is to be +parsed. + + pattern + false + true + + + +Time zone in which to interpret any time +information in the date string. + + timeZone + false + true + + + +Locale whose predefined formatting styles +for dates and times are to be used during +the parse operation, or to which the +pattern specified via the pattern +attribute (if present) is applied. + + parseLocale + false + true + + + +Name of the exported scoped variable in +which the parsing result (of type +java.util.Date) is stored. + + var + false + false + + + +Scope of var. + + scope + false + false + + + + Index: lams_tool_survey/web/WEB-INF/tlds/jstl/fn.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/jstl/fn.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/jstl/fn.tld 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,207 @@ + + + + + JSTL 1.1 functions library + JSTL functions + 1.1 + fn + http://java.sun.com/jsp/jstl/functions + + + + Tests if an input string contains the specified substring. + + contains + org.apache.taglibs.standard.functions.Functions + boolean contains(java.lang.String, java.lang.String) + + <c:if test="${fn:contains(name, searchString)}"> + + + + + + Tests if an input string contains the specified substring in a case insensitive way. + + containsIgnoreCase + org.apache.taglibs.standard.functions.Functions + boolean containsIgnoreCase(java.lang.String, java.lang.String) + + <c:if test="${fn:containsIgnoreCase(name, searchString)}"> + + + + + + Tests if an input string ends with the specified suffix. + + endsWith + org.apache.taglibs.standard.functions.Functions + boolean endsWith(java.lang.String, java.lang.String) + + <c:if test="${fn:endsWith(filename, ".txt")}"> + + + + + + Escapes characters that could be interpreted as XML markup. + + escapeXml + org.apache.taglibs.standard.functions.Functions + java.lang.String escapeXml(java.lang.String) + + ${fn:escapeXml(param:info)} + + + + + + Returns the index withing a string of the first occurrence of a specified substring. + + indexOf + org.apache.taglibs.standard.functions.Functions + int indexOf(java.lang.String, java.lang.String) + + ${fn:indexOf(name, "-")} + + + + + + Joins all elements of an array into a string. + + join + org.apache.taglibs.standard.functions.Functions + java.lang.String join(java.lang.String[], java.lang.String) + + ${fn:join(array, ";")} + + + + + + Returns the number of items in a collection, or the number of characters in a string. + + length + org.apache.taglibs.standard.functions.Functions + int length(java.lang.Object) + + You have ${fn:length(shoppingCart.products)} in your shopping cart. + + + + + + Returns a string resulting from replacing in an input string all occurrences + of a "before" string into an "after" substring. + + replace + org.apache.taglibs.standard.functions.Functions + java.lang.String replace(java.lang.String, java.lang.String, java.lang.String) + + ${fn:replace(text, "-", "•")} + + + + + + Splits a string into an array of substrings. + + split + org.apache.taglibs.standard.functions.Functions + java.lang.String[] split(java.lang.String, java.lang.String) + + ${fn:split(customerNames, ";")} + + + + + + Tests if an input string starts with the specified prefix. + + startsWith + org.apache.taglibs.standard.functions.Functions + boolean startsWith(java.lang.String, java.lang.String) + + <c:if test="${fn:startsWith(product.id, "100-")}"> + + + + + + Returns a subset of a string. + + substring + org.apache.taglibs.standard.functions.Functions + java.lang.String substring(java.lang.String, int, int) + + P.O. Box: ${fn:substring(zip, 6, -1)} + + + + + + Returns a subset of a string following a specific substring. + + substringAfter + org.apache.taglibs.standard.functions.Functions + java.lang.String substringAfter(java.lang.String, java.lang.String) + + P.O. Box: ${fn:substringAfter(zip, "-")} + + + + + + Returns a subset of a string before a specific substring. + + substringBefore + org.apache.taglibs.standard.functions.Functions + java.lang.String substringBefore(java.lang.String, java.lang.String) + + Zip (without P.O. Box): ${fn:substringBefore(zip, "-")} + + + + + + Converts all of the characters of a string to lower case. + + toLowerCase + org.apache.taglibs.standard.functions.Functions + java.lang.String toLowerCase(java.lang.String) + + Product name: ${fn.toLowerCase(product.name)} + + + + + + Converts all of the characters of a string to upper case. + + toUpperCase + org.apache.taglibs.standard.functions.Functions + java.lang.String toUpperCase(java.lang.String) + + Product name: ${fn.UpperCase(product.name)} + + + + + + Removes white spaces from both ends of a string. + + trim + org.apache.taglibs.standard.functions.Functions + java.lang.String trim(java.lang.String) + + Name: ${fn.trim(name)} + + + + Index: lams_tool_survey/web/WEB-INF/tlds/jstl/x.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/jstl/x.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/jstl/x.tld 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,448 @@ + + + + + JSTL 1.1 XML library + JSTL XML + 1.1 + x + http://java.sun.com/jsp/jstl/xml + + + + Provides validation features for JSTL XML tags. + + + org.apache.taglibs.standard.tlv.JstlXmlTLV + + + + + + Simple conditional tag that establishes a context for + mutually exclusive conditional operations, marked by + <when> and <otherwise> + + choose + org.apache.taglibs.standard.tag.common.core.ChooseTag + JSP + + + + + Like <%= ... >, but for XPath expressions. + + out + org.apache.taglibs.standard.tag.rt.xml.ExprTag + empty + + +XPath expression to be evaluated. + + select + true + false + + + +Determines whether characters <,>,&,'," in the +resulting string should be converted to their +corresponding character entity codes. Default +value is true. + + escapeXml + false + true + + + + + + XML conditional tag, which evalutes its body if the + supplied XPath expression evalutes to 'true' as a boolean + + if + org.apache.taglibs.standard.tag.common.xml.IfTag + JSP + + +The test condition that tells whether or not the +body content should be processed. + + select + true + false + + + +Name of the exported scoped variable for the +resulting value of the test condition. The type +of the scoped variable is Boolean. + + var + false + false + + + +Scope for var. + + scope + false + false + + + + + + XML iteration tag. + + forEach + org.apache.taglibs.standard.tag.common.xml.ForEachTag + JSP + + +Name of the exported scoped variable for the +current item of the iteration. This scoped variable +has nested visibility. Its type depends on the +result of the XPath expression in the select +attribute. + + var + false + false + + + +XPath expression to be evaluated. + + select + true + false + + + +Iteration begins at the item located at the +specified index. First item of the collection has +index 0. + + begin + false + true + int + + + +Iteration ends at the item located at the specified +index (inclusive). + + end + false + true + int + + + +Iteration will only process every step items of +the collection, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of type +javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested visibility. + + varStatus + false + false + + + + + + Subtag of <choose> that follows <when> tags + and runs only if all of the prior conditions evaluated to + 'false' + + otherwise + org.apache.taglibs.standard.tag.common.core.OtherwiseTag + JSP + + + + + Adds a parameter to a containing 'transform' tag's Transformer + + param + org.apache.taglibs.standard.tag.rt.xml.ParamTag + JSP + + +Name of the transformation parameter. + + name + true + true + + + +Value of the parameter. + + value + false + true + + + + + + Parses XML content from 'source' attribute or 'body' + + parse + org.apache.taglibs.standard.tag.rt.xml.ParseTag + org.apache.taglibs.standard.tei.XmlParseTEI + JSP + + +Name of the exported scoped variable for +the parsed XML document. The type of the +scoped variable is implementation +dependent. + + var + false + false + + + +Name of the exported scoped variable for +the parsed XML document. The type of the +scoped variable is +org.w3c.dom.Document. + + varDom + false + false + + + +Scope for var. + + scope + false + false + + + +Scope for varDom. + + scopeDom + false + false + + + +Deprecated. Use attribute 'doc' instead. + + xml + false + true + + + +Source XML document to be parsed. + + doc + false + true + + + +The system identifier (URI) for parsing the +XML document. + + systemId + false + true + + + +Filter to be applied to the source +document. + + filter + false + true + + + + + + Saves the result of an XPath expression evaluation in a 'scope' + + set + org.apache.taglibs.standard.tag.common.xml.SetTag + empty + + +Name of the exported scoped variable to hold +the value specified in the action. The type of the +scoped variable is whatever type the select +expression evaluates to. + + var + true + false + + + +XPath expression to be evaluated. + + select + false + false + + + +Scope for var. + + scope + false + false + + + + + + Conducts a transformation given a source XML document + and an XSLT stylesheet + + transform + org.apache.taglibs.standard.tag.rt.xml.TransformTag + org.apache.taglibs.standard.tei.XmlTransformTEI + JSP + + +Name of the exported +scoped variable for the +transformed XML +document. The type of the +scoped variable is +org.w3c.dom.Document. + + var + false + false + + + +Scope for var. + + scope + false + false + + + +Result +Object that captures or +processes the transformation +result. + + result + false + true + + + +Deprecated. Use attribute +'doc' instead. + + xml + false + true + + + +Source XML document to be +transformed. (If exported by +<x:set>, it must correspond +to a well-formed XML +document, not a partial +document.) + + doc + false + true + + + +Deprecated. Use attribute +'docSystemId' instead. + + xmlSystemId + false + true + + + +The system identifier (URI) +for parsing the XML +document. + + docSystemId + false + true + + + +javax.xml.transform.Source +Transformation stylesheet as +a String, Reader, or +Source object. + + xslt + false + true + + + +The system identifier (URI) +for parsing the XSLT +stylesheet. + + xsltSystemId + false + true + + + + + + Subtag of <choose> that includes its body if its + expression evalutes to 'true' + + when + org.apache.taglibs.standard.tag.common.xml.WhenTag + JSP + + +The test condition that tells whether or +not the body content should be +processed + + select + true + false + + + + Index: lams_tool_survey/web/WEB-INF/tlds/lams/lams.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/lams/lams.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/lams/lams.tld 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,338 @@ + + + + + 1.0 + lams + + LAMSTags + + + + + Output the Server URL as defined in the lams.xml configuration file. + LAMS URL + + + LAMSURL + org.lamsfoundation.lams.web.tag.LAMSURLTag + empty + + + + + Render html tag with direction and language + Render html tag with direction and language + + + html + org.lamsfoundation.lams.web.tag.HtmlTag + JSP + + + Render html tag with direction and language + xhtml + false + + true + + + + + + + Output a random number for the learner and passon flash movies to communicate directly. + generate unique ID + + + generateID + org.lamsfoundation.lams.web.tag.GenerateIDTag + empty + + + Output a random number for the learner and passon flash movies to communicate directly. + id + false + + true + + + + + + + Output details from the shared session UserDTO object + user details + + + user + org.lamsfoundation.lams.web.tag.UserTag + empty + + + Output details from the shared session UserDTO object + property + true + + true + + + + + + + Output the basic URL for the current webapp. e.g. http://server/lams/tool/nb11/ + Base URL for the current web app + + + WebAppURL + org.lamsfoundation.lams.web.tag.WebAppURLTag + empty + + + + + Output stylesheet based on the user preferences. + User's chosen stylesheet + + + css + org.lamsfoundation.lams.web.tag.CssTag + empty + + + Output stylesheet based on the user preferences. + localLinkPath + false + + true + + + + + + + STRUTS-textarea + org.lamsfoundation.lams.web.tag.MultiLinesTextareaTag + empty + + accesskey + false + true + + + alt + false + true + + + altKey + false + true + + + bundle + false + true + + + cols + false + true + + + disabled + false + true + + + errorKey + false + true + + + errorStyle + false + true + + + errorStyleClass + false + true + + + errorStyleId + false + true + + + indexed + false + true + + + name + false + true + + + onblur + false + true + + + onchange + false + true + + + onclick + false + true + + + ondblclick + false + true + + + onfocus + false + true + + + onkeydown + false + true + + + onkeypress + false + true + + + onkeyup + false + true + + + onmousedown + false + true + + + onmousemove + false + true + + + onmouseout + false + true + + + onmouseover + false + true + + + onmouseup + false + true + + + property + true + true + + + readonly + false + true + + + rows + false + true + + + style + false + true + + + styleClass + false + true + + + styleId + false + true + + + tabindex + false + true + + + title + false + true + + + titleKey + false + true + + + value + false + true + + + + Tab + /WEB-INF/tags/Tab.tag + + + Tabs + /WEB-INF/tags/Tabs.tag + + + TabBody + /WEB-INF/tags/TabBody.tag + + + FCKEditor + /WEB-INF/tags/FCKEditor.tag + + + AuthoringButton + /WEB-INF/tags/AuthoringButton.tag + + + headItems + /WEB-INF/tags/headItems.tag + + + Passon + /WEB-INF/tags/Passon.tag + + + ExportPortOutput + /WEB-INF/tags/ExportPortOutput.tag + + + Date + /WEB-INF/tags/Date.tag + + + DefineLater + /WEB-INF/tags/DefineLater.tag + + + Index: lams_tool_survey/web/WEB-INF/tlds/struts/struts-bean.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/struts/struts-bean.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/struts/struts-bean.tld 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,382 @@ + + + + + + + + + + +1.2 +1.1 +bean +http://struts.apache.org/tags-bean + +cookie +org.apache.struts.taglib.bean.CookieTag +org.apache.struts.taglib.bean.CookieTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +define +org.apache.struts.taglib.bean.DefineTag +org.apache.struts.taglib.bean.DefineTei +JSP + +id +true +false + + +name +false +true + + +property +false +true + + +scope +false +true + + +toScope +false +true + + +type +false +true + + +value +false +true + + + +header +org.apache.struts.taglib.bean.HeaderTag +org.apache.struts.taglib.bean.HeaderTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +include +org.apache.struts.taglib.bean.IncludeTag +org.apache.struts.taglib.bean.IncludeTei +empty + +anchor +false +true + + +forward +false +true + + +href +false +true + + +id +true +false + + +name +false +true + + +page +false +true + + +transaction +false +true + + + +message +org.apache.struts.taglib.bean.MessageTag +empty + +arg0 +false +true + + +arg1 +false +true + + +arg2 +false +true + + +arg3 +false +true + + +arg4 +false +true + + +bundle +false +true + + +key +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +page +org.apache.struts.taglib.bean.PageTag +org.apache.struts.taglib.bean.PageTei +empty + +id +true +false + + +property +true +true + + + +parameter +org.apache.struts.taglib.bean.ParameterTag +org.apache.struts.taglib.bean.ParameterTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +survey +org.apache.struts.taglib.bean.SurveyTag +org.apache.struts.taglib.bean.SurveyTei +empty + +id +true +false + + +input +false +true + + +name +true +true + + + +size +org.apache.struts.taglib.bean.SizeTag +org.apache.struts.taglib.bean.SizeTei +empty + +collection +false +true + + +id +true +false + + +name +false +true + + +property +false +true + + +scope +false +true + + + +struts +org.apache.struts.taglib.bean.StrutsTag +org.apache.struts.taglib.bean.StrutsTei +empty + +id +true +false + + +formBean +false +true + + +forward +false +true + + +mapping +false +true + + + +write +org.apache.struts.taglib.bean.WriteTag +empty + +bundle +false +true + + +filter +false +true + + +format +false +true + + +formatKey +false +true + + +ignore +false +true + + +locale +false +true + + +name +true +true + + +property +false +true + + +scope +false +true + + + + + + Index: lams_tool_survey/web/WEB-INF/tlds/struts/struts-html.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/struts/struts-html.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/struts/struts-html.tld 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,3302 @@ + + + + + + + + + + +1.2 +1.1 +html +http://struts.apache.org/tags-html + +base +org.apache.struts.taglib.html.BaseTag +empty + +target +false +true + + +server +false +true + + + +button +org.apache.struts.taglib.html.ButtonTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +cancel +org.apache.struts.taglib.html.CancelTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +checkbox +org.apache.struts.taglib.html.CheckboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +errors +org.apache.struts.taglib.html.ErrorsTag +empty + +bundle +false +true + + +footer +false +true + + +header +false +true + + +locale +false +true + + +name +false +true + + +prefix +false +true + + +property +false +true + + +suffix +false +true + + + +file +org.apache.struts.taglib.html.FileTag + +accesskey +false +true + + +accept +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +form +org.apache.struts.taglib.html.FormTag +JSP + +action +true +true + + +acceptCharset +false +true + + +disabled +false +true + + +enctype +false +true + + +focus +false +true + + +focusIndex +false +true + + +method +false +true + + +onreset +false +true + + +onsubmit +false +true + + +readonly +false +true + + +scriptLanguage +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +target +false +true + + + +frame +org.apache.struts.taglib.html.FrameTag + +bundle +false +true + + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +frameborder +false +true + + +frameName +false +true + + +href +false +true + + +longdesc +false +true + + +marginheight +false +true + + +marginwidth +false +true + + +name +false +true + + +noresize +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +scrolling +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + + +hidden +org.apache.struts.taglib.html.HiddenTag +empty + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + +write +false +true + + + +html +org.apache.struts.taglib.html.HtmlTag +JSP + +lang +false +true + + +locale +false +true + + +xhtml +false +true + + + +image +org.apache.struts.taglib.html.ImageTag + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +locale +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +pageKey +false +true + + +property +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +img +org.apache.struts.taglib.html.ImgTag +empty + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +contextRelative +false +true + + +height +false +true + + +hspace +false +true + + +imageName +false +true + + +ismap +false +true + + +locale +false +true + + +lowsrc +false +true + + +name +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +paramId +false +true + + +page +false +true + + +pageKey +false +true + + +action +false +true + + +module +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +useLocalEncoding +false +true + + +usemap +false +true + + +vspace +false +true + + +width +false +true + + + +javascript +org.apache.struts.taglib.html.JavascriptValidatorTag +empty + +cdata +false +true + + +dynamicJavascript +false +false + + +formName +false +true + + +method +false +true + + +page +false +true + + +scriptLanguage +false +true + + +src +false +true + + +staticJavascript +false +false + + +htmlComment +false +true + + +bundle +false +true + + + +link +org.apache.struts.taglib.html.LinkTag + +accesskey +false +true + + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +indexed +false +true + + +indexId +false +true + + +bundle +false +true + + +linkName +false +true + + +name +false +true + + +onblur +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +target +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +messages +org.apache.struts.taglib.html.MessagesTag +org.apache.struts.taglib.html.MessagesTei +JSP + +id +true +false + + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +header +false +true + + +footer +false +true + + +message +false +true + + + +multibox +org.apache.struts.taglib.html.MultiboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +option +org.apache.struts.taglib.html.OptionTag + +bundle +false +true + + +disabled +false +true + + +key +false +true + + +locale +false +true + + +style +false +true + + +styleId +false +true + + +styleClass +false +true + + +value +true +true + + + +options +org.apache.struts.taglib.html.OptionsTag +empty + +collection +false +true + + +filter +false +true + + +labelName +false +true + + +labelProperty +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + + +optionsCollection +org.apache.struts.taglib.html.OptionsCollectionTag +empty + +filter +false +true + + +label +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +value +false +true + + + +password +org.apache.struts.taglib.html.PasswordTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +redisplay +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +size +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +radio +org.apache.struts.taglib.html.RadioTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +property +true +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +true +true + + +idName +false +true + + + +reset +org.apache.struts.taglib.html.ResetTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +rewrite +org.apache.struts.taglib.html.RewriteTag +empty + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +select +org.apache.struts.taglib.html.SelectTag +JSP + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +multiple +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +size +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +submit +org.apache.struts.taglib.html.SubmitTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +text +org.apache.struts.taglib.html.TextTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +textarea +org.apache.struts.taglib.html.TextareaTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +cols +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +rows +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +xhtml +org.apache.struts.taglib.html.XhtmlTag +empty + + + Index: lams_tool_survey/web/WEB-INF/tlds/struts/struts-logic.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/struts/struts-logic.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/struts/struts-logic.tld 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,652 @@ + + + + + + + + + +1.2 +1.1 +logic +http://struts.apache.org/tags-logic + +empty +org.apache.struts.taglib.logic.EmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +equal +org.apache.struts.taglib.logic.EqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +forward +org.apache.struts.taglib.logic.ForwardTag +empty + +name +true +true + + + +greaterEqual +org.apache.struts.taglib.logic.GreaterEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterThan +org.apache.struts.taglib.logic.GreaterThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +iterate +org.apache.struts.taglib.logic.IterateTag +org.apache.struts.taglib.logic.IterateTei +JSP + +collection +false +true + + +id +true +false + + +indexId +false +false + + +length +false +true + + +name +false +true + + +offset +false +true + + +property +false +true + + +scope +false +true + + +type +false +true + + + +lessEqual +org.apache.struts.taglib.logic.LessEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +lessThan +org.apache.struts.taglib.logic.LessThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +match +org.apache.struts.taglib.logic.MatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +messagesNotPresent +org.apache.struts.taglib.logic.MessagesNotPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +messagesPresent +org.apache.struts.taglib.logic.MessagesPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +notEmpty +org.apache.struts.taglib.logic.NotEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +notEqual +org.apache.struts.taglib.logic.NotEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notMatch +org.apache.struts.taglib.logic.NotMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notPresent +org.apache.struts.taglib.logic.NotPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +present +org.apache.struts.taglib.logic.PresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +redirect +org.apache.struts.taglib.logic.RedirectTag + +action +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + + + + Index: lams_tool_survey/web/WEB-INF/tlds/struts/struts-nested.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/struts/struts-nested.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/struts/struts-nested.tld 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,3171 @@ + + + + + + + + + +1.2 +1.1 +nested +http://struts.apache.org/tags-nested + +nest +org.apache.struts.taglib.nested.NestedPropertyTag +JSP + +property +false +true + + + +writeNesting +org.apache.struts.taglib.nested.NestedWriteNestingTag +org.apache.struts.taglib.nested.NestedWriteNestingTei +JSP + +property +false +true + + +id +false +true + + +filter +false +true + + + +root +org.apache.struts.taglib.nested.NestedRootTag +JSP + +name +false +true + + + +define +org.apache.struts.taglib.nested.bean.NestedDefineTag +org.apache.struts.taglib.nested.bean.NestedDefineTei +empty + +id +true +true + + +name +false +true + + +property +false +true + + +scope +false +true + + +toScope +false +true + + +type +false +true + + +value +false +true + + + +message +org.apache.struts.taglib.nested.bean.NestedMessageTag +empty + +arg0 +false +true + + +arg1 +false +true + + +arg2 +false +true + + +arg3 +false +true + + +arg4 +false +true + + +bundle +false +true + + +key +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +size +org.apache.struts.taglib.nested.bean.NestedSizeTag +org.apache.struts.taglib.bean.SizeTei +empty + +collection +false +true + + +id +true +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +write +org.apache.struts.taglib.nested.bean.NestedWriteTag +empty + +bundle +false +true + + +filter +false +true + + +format +false +true + + +formatKey +false +true + + +ignore +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +checkbox +org.apache.struts.taglib.nested.html.NestedCheckboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +errors +org.apache.struts.taglib.nested.html.NestedErrorsTag +empty + +bundle +false +true + + +footer +false +true + + +header +false +true + + +locale +false +true + + +name +false +true + + +prefix +false +true + + +property +false +true + + +suffix +false +true + + + +file +org.apache.struts.taglib.nested.html.NestedFileTag + +accesskey +false +true + + +accept +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +form +org.apache.struts.taglib.nested.html.NestedFormTag +JSP + +action +true +true + + +acceptCharset +false +true + + +disabled +false +true + + +enctype +false +true + + +focus +false +true + + +focusIndex +false +true + + +method +false +true + + +onreset +false +true + + +onsubmit +false +true + + +readonly +false +true + + +scriptLanguage +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +target +false +true + + + +hidden +org.apache.struts.taglib.nested.html.NestedHiddenTag + +alt +false +true + + +altKey +false +true + + +indexed +false +true + + +name +false +true + + +property +true +true + + +title +false +true + + +titleKey +false +true + + +styleClass +false +true + + +styleId +false +true + + +value +false +true + + +write +false +true + + + +image +org.apache.struts.taglib.nested.html.NestedImageTag + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +locale +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +pageKey +false +true + + +property +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +img +org.apache.struts.taglib.nested.html.NestedImgTag +empty + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +height +false +true + + +hspace +false +true + + +imageName +false +true + + +ismap +false +true + + +locale +false +true + + +lowsrc +false +true + + +name +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +paramId +false +true + + +page +false +true + + +pageKey +false +true + + +action +false +true + + +module +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +useLocalEncoding +false +true + + +usemap +false +true + + +vspace +false +true + + +width +false +true + + + +link +org.apache.struts.taglib.nested.html.NestedLinkTag + +accesskey +false +true + + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +indexed +false +true + + +indexId +false +true + + +bundle +false +true + + +linkName +false +true + + +name +false +true + + +onblur +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +target +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +messages +org.apache.struts.taglib.nested.html.NestedMessagesTag +org.apache.struts.taglib.html.MessagesTei +JSP + +id +true +true + + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +header +false +true + + +footer +false +true + + +message +false +true + + + +multibox +org.apache.struts.taglib.nested.html.NestedMultiboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +options +org.apache.struts.taglib.nested.html.NestedOptionsTag +empty + +collection +false +true + + +filter +false +true + + +labelName +false +true + + +labelProperty +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + + +optionsCollection +org.apache.struts.taglib.nested.html.NestedOptionsCollectionTag +empty + +filter +false +true + + +label +false +true + + +name +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +value +false +true + + + +password +org.apache.struts.taglib.nested.html.NestedPasswordTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +redisplay +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +size +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +radio +org.apache.struts.taglib.nested.html.NestedRadioTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +property +true +true + + +onmousedown +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +true +true + + +idName +false +true + + + +select +org.apache.struts.taglib.nested.html.NestedSelectTag +JSP + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +multiple +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +size +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +submit +org.apache.struts.taglib.nested.html.NestedSubmitTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +text +org.apache.struts.taglib.nested.html.NestedTextTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +textarea +org.apache.struts.taglib.nested.html.NestedTextareaTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +cols +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +rows +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +empty +org.apache.struts.taglib.nested.logic.NestedEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +equal +org.apache.struts.taglib.nested.logic.NestedEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterEqual +org.apache.struts.taglib.nested.logic.NestedGreaterEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterThan +org.apache.struts.taglib.nested.logic.NestedGreaterThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +iterate +org.apache.struts.taglib.nested.logic.NestedIterateTag +org.apache.struts.taglib.nested.logic.NestedIterateTei +JSP + +collection +false +true + + +id +false +true + + +indexId +false +true + + +length +false +true + + +name +false +true + + +offset +false +true + + +property +false +true + + +scope +false +true + + +type +false +true + + + +lessEqual +org.apache.struts.taglib.nested.logic.NestedLessEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +lessThan +org.apache.struts.taglib.nested.logic.NestedLessThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +match +org.apache.struts.taglib.nested.logic.NestedMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +messagesNotPresent +org.apache.struts.taglib.nested.logic.NestedMessagesNotPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +messagesPresent +org.apache.struts.taglib.nested.logic.NestedMessagesPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +notEmpty +org.apache.struts.taglib.nested.logic.NestedNotEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +notEqual +org.apache.struts.taglib.nested.logic.NestedNotEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notMatch +org.apache.struts.taglib.nested.logic.NestedNotMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notPresent +org.apache.struts.taglib.nested.logic.NestedNotPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +present +org.apache.struts.taglib.nested.logic.NestedPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + + + + Index: lams_tool_survey/web/WEB-INF/tlds/struts/struts-tiles.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/WEB-INF/tlds/struts/struts-tiles.tld,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/WEB-INF/tlds/struts/struts-tiles.tld 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,344 @@ + + + + + + + + + + +1.2 +1.1 +tiles +http://struts.apache.org/tags-tiles + +insert +org.apache.struts.taglib.tiles.InsertTag +JSP + +template +false +true + + +component +false +true + + +page +false +true + + +definition +false +true + + +attribute +false +false + + +name +false +true + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +flush +false +false + + +ignore +false +true + + +role +false +true + + +controllerUrl +false +true + + +controllerClass +false +true + + + +definition +org.apache.struts.taglib.tiles.DefinitionTag +JSP + +id +true +false + + +scope +false +false + + +template +false +true + + +page +false +true + + +role +false +true + + +extends +false +true + + + +put +org.apache.struts.taglib.tiles.PutTag +JSP + +name +false +false + + +value +false +true + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +putList +org.apache.struts.taglib.tiles.PutListTag +JSP + +name +true +false + + + +add +org.apache.struts.taglib.tiles.AddTag +JSP + +value +false +false + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +get +org.apache.struts.taglib.tiles.GetTag +empty + +name +true +true + + +ignore +false +true + + +flush +false +false + + +role +false +true + + + +getAsString +org.apache.struts.taglib.tiles.GetAttributeTag +empty + +name +true +true + + +ignore +false +true + + +role +false +true + + + +useAttribute +org.apache.struts.taglib.tiles.UseAttributeTag +org.apache.struts.taglib.tiles.UseAttributeTei +empty + +id +false +false + + +classname +false +false + + +scope +false +false + + +name +true +true + + +ignore +false +true + + + +importAttribute +org.apache.struts.taglib.tiles.ImportAttributeTag +empty + +name +false +true + + +scope +false +false + + +ignore +false +true + + + +initComponentDefinitions +org.apache.struts.taglib.tiles.InitDefinitionsTag +empty + +file +true +false + + +classname +false +false + + + + + + Index: lams_tool_survey/web/common/fckeditorheader.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/common/Attic/fckeditorheader.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/common/fckeditorheader.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,5 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + Index: lams_tool_survey/web/common/footer.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/common/footer.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/common/footer.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1 @@ +
    Index: lams_tool_survey/web/common/header.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/common/header.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/common/header.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,27 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_survey/web/common/messages.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/common/messages.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/common/messages.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,20 @@ +<%-- Error Messages --%> + +
    + + +
    +
    +
    +
    + +<%-- Success Messages --%> + +
    + + +
    +
    +
    +
    Index: lams_tool_survey/web/common/taglibs.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/common/taglibs.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/common/taglibs.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,12 @@ +<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-tiles" prefix="tiles" %> +<%@ taglib uri="tags-bean" prefix="bean" %> +<%@ taglib uri="tags-html" prefix="html" %> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-function" prefix="fn" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-xml" prefix="x" %> +<%@ taglib uri="tags-lams" prefix="lams" %> +<%@ taglib uri="fck-editor" prefix="FCK"%> + Index: lams_tool_survey/web/images/icon_survey.swf =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/images/icon_survey.swf,v diff -u Binary files differ Index: lams_tool_survey/web/includes/css/survey.css =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/css/Attic/survey.css,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/includes/css/survey.css 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,33 @@ +.innerforms { + border: 0px; + font-size: small; + font-style: normal; + width:100%; +} + +div.error, div.message { + background-color: #ffffcc; + border: 1px solid #000; + color: #000000; + font-family: Arial, Helvetica, sans-serif; + font-weight: normal; + margin: 10px auto; + padding: 3px; + text-align: left; + vertical-align: bottom; +} + +/* use a different color for the errors */ +div.error { + border: 2px solid red; +} + +img.validationWarning, div.errors img.icon, div.messages img.icon { + border: 0; + width: 14px; + height: 13px; + vertical-align: top; +} +div.message img.icon { + vertical-align: middle; +} Index: lams_tool_survey/web/includes/images/.cvsignore =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/.cvsignore,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/includes/images/.cvsignore 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1 @@ +Thumbs.db Index: lams_tool_survey/web/includes/images/aqua_tab_centre.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/aqua_tab_centre.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/aqua_tab_i_centre.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/aqua_tab_i_centre.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/aqua_tab_i_left.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/aqua_tab_i_left.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/aqua_tab_i_right.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/aqua_tab_i_right.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/aqua_tab_left.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/aqua_tab_left.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/aqua_tab_right.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/aqua_tab_right.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/aqua_tab_s_centre.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/aqua_tab_s_centre.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/aqua_tab_s_left.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/aqua_tab_s_left.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/aqua_tab_s_right.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/aqua_tab_s_right.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/cross.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/cross.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/downarrow.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/downarrow.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/iconInformation.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/iconInformation.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/iconWarning.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/Attic/iconWarning.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/indicator.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/indicator.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/spacer.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/spacer.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/tick.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/tick.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/images/uparrow.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/images/uparrow.gif,v diff -u Binary files differ Index: lams_tool_survey/web/includes/javascript/surveycommon.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/javascript/Attic/surveycommon.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/includes/javascript/surveycommon.js 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,18 @@ + function launchPopup(url,title) { + var wd = null; + if(wd && wd.open && !wd.closed){ + wd.close(); + } + wd = window.open(url,title,'resizable,width=796,height=570,scrollbars'); + wd.window.focus(); + } + function showBusy(targetDiv){ + if($(targetDiv+"_Busy") != null){ + Element.show(targetDiv+"_Busy"); + } + } + function hideBusy(targetDiv){ + if($(targetDiv+"_Busy") != null){ + Element.hide(targetDiv+"_Busy"); + } + } Index: lams_tool_survey/web/includes/javascript/surveyresourceitem.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/javascript/Attic/surveyresourceitem.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/includes/javascript/surveyresourceitem.js 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,118 @@ + /* + This is Survey Item instrcution area. + */ + var instructionTargetDiv = "instructionArea"; + var itemAttachmentTargetDiv = "itemAttachmentArea"; +// Please set these 2 variables in JSP file for using tag reason: +// var removeInstructionUrl = ""; +// var addInstructionUrl = ""; + function removeInstruction(idx){ + //var id = "instructionItem" + idx; + //Element.remove(id); + var url= removeInstructionUrl; + var reqIDVar = new Date(); + var param = Form.serialize("instructionForm")+"&removeIdx="+idx+"&reqID="+reqIDVar.getTime(); + removeInstructionLoading(); + var myAjax = new Ajax.Updater( + instructionTargetDiv, + url, + { + method:'get', + parameters:param, + onComplete:removeInstructionComplete, + evalScripts:true + } + ); + } + function removeItemAttachment(idx){ + //var id = "instructionItem" + idx; + //Element.remove(id); + var url= removeItemAttachmentUrl; + var reqIDVar = new Date(); + var param = "reqID="+reqIDVar.getTime(); + removeItemAttachmentLoading(); + var myAjax = new Ajax.Updater( + itemAttachmentTargetDiv, + url, + { + method:'get', + parameters:param, + onComplete:removeItemAttachmentComplete, + evalScripts:true + } + ); + } + function addInstruction(){ + var url= addInstructionUrl; + var reqIDVar = new Date(); + var param = Form.serialize("instructionForm")+"&reqID="+reqIDVar.getTime(); + addInstructionLoading(); + var myAjax = new Ajax.Updater( + instructionTargetDiv, + url, + { + method:'get', + parameters:param, + onComplete:addInstructionComplete, + evalScripts:true + } + ); + } + function upItem(itemIdx){ + if(itemIdx == 0) + return; + var currId = "instructionItemDesc" + itemIdx; + var repId = "instructionItemDesc" + (--itemIdx); + switchValue(currId,repId); + } + function downItem(itemIdx,maxSize){ + if(itemIdx == (maxSize -1)) + return; + var currId = "instructionItemDesc" + itemIdx; + var repId = "instructionItemDesc" + (++itemIdx); + switchValue(currId,repId); + } + function switchValue(currId,repId){ + var temp = $(repId).value; + $(repId).value = $(currId).value; + $(currId).value= temp; + } + function removeInstructionLoading(){ + showBusy(instructionTargetDiv); + } + function removeInstructionComplete(){ + hideBusy(instructionTargetDiv); + } + function removeItemAttachmentLoading(){ + showBusy(itemAttachmentTargetDiv); + } + function removeItemAttachmentComplete(){ + hideBusy(itemAttachmentTargetDiv); + } + function addInstructionLoading(){ + showBusy(instructionTargetDiv); + } + function addInstructionComplete(){ + hideBusy(instructionTargetDiv); + + } + function showBusy(targetDiv){ + if($(targetDiv+"_Busy") != null){ + Element.show(targetDiv+"_Busy"); + } + } + function hideBusy(targetDiv){ + if($(targetDiv+"_Busy") != null){ + Element.hide(targetDiv+"_Busy"); + } + } + + function submitSurveyItem(){ + $("instructionList").value = Form.serialize("instructionForm"); + $("surveyItemForm").submit(); + //after submit, it direct to itemlist.jsp, + // then refresh "basic tab" surveylist and close this window. + } + function cancelSurveyItem(){ + window.top.hideMessage(); + } Index: lams_tool_survey/web/includes/javascript/tree.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/javascript/Attic/tree.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/includes/javascript/tree.js 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,139 @@ +// Title: Tigra Tree +// Description: See the demo at url +// URL: http://www.softcomplex.com/products/tigra_menu_tree/ +// Version: 1.1 +// Date: 11-12-2002 (mm-dd-yyyy) +// Notes: This script is free. Visit official site for further details. + +function tree (a_items, a_template) { + + this.a_tpl = a_template; + this.a_config = a_items; + this.o_root = this; + this.a_index = []; + this.o_selected = null; + this.n_depth = -1; + + var o_icone = new Image(), + o_iconl = new Image(); + o_icone.src = a_template['icon_e']; + o_iconl.src = a_template['icon_l']; + a_template['im_e'] = o_icone; + a_template['im_l'] = o_iconl; + for (var i = 0; i < 64; i++) + if (a_template['icon_' + i]) { + var o_icon = new Image(); + a_template['im_' + i] = o_icon; + o_icon.src = a_template['icon_' + i]; + } + + this.toggle = function (n_id) { var o_item = this.a_index[n_id]; o_item.open(o_item.b_opened) }; + this.select = function (n_id) { return this.a_index[n_id].select(); }; + this.mout = function (n_id) { this.a_index[n_id].upstatus(true) }; + this.mover = function (n_id) { this.a_index[n_id].upstatus() }; + + this.a_children = []; + for (var i = 0; i < a_items.length; i++) + new tree_item(this, i); + + this.n_id = trees.length; + trees[this.n_id] = this; + + for (var i = 0; i < this.a_children.length; i++) { + document.write(this.a_children[i].init()); + this.a_children[i].open(); + } +} +function tree_item (o_parent, n_order) { + + this.n_depth = o_parent.n_depth + 1; + this.a_config = o_parent.a_config[n_order + (this.n_depth ? 2 : 0)]; + if (!this.a_config) return; + + this.o_root = o_parent.o_root; + this.o_parent = o_parent; + this.n_order = n_order; + this.b_opened = !this.n_depth; + + this.n_id = this.o_root.a_index.length; + this.o_root.a_index[this.n_id] = this; + o_parent.a_children[n_order] = this; + + this.a_children = []; + for (var i = 0; i < this.a_config.length - 2; i++) + new tree_item(this, i); + + this.get_icon = item_get_icon; + this.open = item_open; + this.select = item_select; + this.init = item_init; + this.upstatus = item_upstatus; + this.is_last = function () { return this.n_order == this.o_parent.a_children.length - 1 }; +} + +function item_open (b_close) { + var o_idiv = get_element('i_div' + this.o_root.n_id + '_' + this.n_id); + if (!o_idiv) return; + + if (!o_idiv.innerHTML) { + var a_children = []; + for (var i = 0; i < this.a_children.length; i++) + a_children[i]= this.a_children[i].init(); + o_idiv.innerHTML = a_children.join(''); + } + o_idiv.style.display = (b_close ? 'none' : 'block'); + + this.b_opened = !b_close; + var o_jicon = document.images['j_img' + this.o_root.n_id + '_' + this.n_id], + o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_jicon) o_jicon.src = this.get_icon(true); + if (o_iicon) o_iicon.src = this.get_icon(); + this.upstatus(); +} + +function item_select (b_deselect) { + if (!b_deselect) { + var o_olditem = this.o_root.o_selected; + this.o_root.o_selected = this; + if (o_olditem) o_olditem.select(true); + } + var o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_iicon) o_iicon.src = this.get_icon(); + get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold'; + + this.upstatus(); + return Boolean(this.a_config[1]); +} + +function item_upstatus (b_clear) { + window.setTimeout('window.status="' + (b_clear ? '' : this.a_config[0] + (this.a_config[1] ? ' ('+ this.a_config[1] + ')' : '')) + '"', 10); +} + +function item_init () { + var a_offset = [], + o_current_item = this.o_parent; + for (var i = this.n_depth; i > 1; i--) { + a_offset[i] = ''; + o_current_item = o_current_item.o_parent; + } + //NDPNDP: if the link href='0', then display non-link fields + return '
    ' + (this.n_depth ? a_offset.join('') + (this.a_children.length + ? '' + : '') : '') + + (this.a_config[1] == 0?'': (''))+'' + this.a_config[0] + (this.a_config[1]== 0?'':'')+'
    ' + (this.a_children.length ? '' : ''); + /** + return '
    ' + (this.n_depth ? a_offset.join('') + (this.a_children.length + ? '' + : '') : '') + + '' + this.a_config[0] + '
    ' + (this.a_children.length ? '' : ''); + **/ +} + +function item_get_icon (b_junction) { + return this.o_root.a_tpl['icon_' + ((this.n_depth ? 0 : 32) + (this.a_children.length ? 16 : 0) + (this.a_children.length && this.b_opened ? 8 : 0) + (!b_junction && this.o_root.o_selected == this ? 4 : 0) + (b_junction ? 2 : 0) + (b_junction && this.is_last() ? 1 : 0))]; +} + +var trees = []; +get_element = document.all ? + function (s_id) { return document.all[s_id] } : + function (s_id) { return document.getElementById(s_id) }; Index: lams_tool_survey/web/includes/javascript/tree_tpl.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/includes/javascript/Attic/tree_tpl.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/includes/javascript/tree_tpl.js 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,36 @@ +/* + Feel free to use your custom icons for the tree. Make sure they are all of the same size. + User icons collections are welcome, we'll publish them giving all regards. +*/ + +var TREE_TPL = { + 'target' : 'contentFrame', // name of the frame links will be opened in + // other possible values are: _blank, _parent, _search, _self and _top + + 'icon_e' : 'icons/empty.gif', // empty image + 'icon_l' : 'icons/line.gif', // vertical line + + 'icon_32' : 'icons/base.gif', // root leaf icon normal + 'icon_36' : 'icons/base.gif', // root leaf icon selected + + 'icon_48' : 'icons/base.gif', // root icon normal + 'icon_52' : 'icons/base.gif', // root icon selected + 'icon_56' : 'icons/base.gif', // root icon opened + 'icon_60' : 'icons/base.gif', // root icon selected + + 'icon_16' : 'icons/folder.gif', // node icon normal + 'icon_20' : 'icons/folderopen.gif', // node icon selected + 'icon_24' : 'icons/folderopen.gif', // node icon opened + 'icon_28' : 'icons/folderopen.gif', // node icon selected opened + + 'icon_0' : 'icons/page.gif', // leaf icon normal + 'icon_4' : 'icons/page.gif', // leaf icon selected + + 'icon_2' : 'icons/joinbottom.gif', // junction for leaf + 'icon_3' : 'icons/join.gif', // junction for last leaf + 'icon_18' : 'icons/plusbottom.gif', // junction for closed node + 'icon_19' : 'icons/plus.gif', // junctioin for last closed node + 'icon_26' : 'icons/minusbottom.gif',// junction for opened node + 'icon_27' : 'icons/minus.gif' // junctioin for last opended node +}; + Index: lams_tool_survey/web/layout/ frame.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/layout/Attic/ frame.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/layout/ frame.jsp 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,57 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +License Information: http://lamsfoundation.org/licensing/lams/2.0/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <body> + This tool requires the support of frames. Your browser does not support frames. + </body> + + + Index: lams_tool_survey/web/layout/default.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/layout/Attic/default.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/layout/default.jsp 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,20 @@ +<%@ include file="/common/taglibs.jsp"%> +<%@ taglib uri="tags-tiles" prefix="tiles"%> + + + + + + + + +

    + +

    +
    + + + + + Index: lams_tool_survey/web/pages/authoring/advance.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/advance.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/advance.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,66 @@ +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + +
    Index: lams_tool_survey/web/pages/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/authoring.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/authoring.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,160 @@ + + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="java.util.HashSet"%> +<%@ page import="java.util.Set"%> +<%@ page import="org.lamsfoundation.lams.tool.survey.SurveyConstants"%> + +<%Set tabs = new HashSet(); + tabs.add("label.authoring.heading.basic"); + tabs.add("label.authoring.heading.advance"); + tabs.add("label.authoring.heading.instructions"); + pageContext.setAttribute("tabs", tabs); + + %> + + + <fmt:message key="label.author.title" /> + + <%@ include file="/common/header.jsp"%> + <%@ include file="/common/fckeditorheader.jsp"%> + + + + + + + +
    +

    + +

    + + +
    + + + +
    + <%@ include file="/common/messages.jsp"%> +
    + + + + + + + + + + + + + + + + + + + + + + <%-- Default value + cancelButtonLabelKey="label.authoring.cancel.button" + saveButtonLabelKey="label.authoring.save.button" + cancelConfirmMsgKey="authoring.msg.cancel.save" + accessMode="author" + --%> + + + +
    + + + +
    + + + +
    Index: lams_tool_survey/web/pages/authoring/basic.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/basic.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/basic.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,128 @@ +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    +
    + +
    + +
    +
    + + <%@ include file="/pages/authoring/parts/itemlist.jsp"%> +
    +
    + + + + + + + +
    + ');"> + + + + ');"> + + + + ');"> + + + + ');"> + + +
    +
    + +
    Index: lams_tool_survey/web/pages/authoring/definelater.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/definelater.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/definelater.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,97 @@ + + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="java.util.HashSet"%> +<%@ page import="org.lamsfoundation.lams.tool.survey.SurveyConstants"%> +<%@ page import="java.util.Set"%> +<%Set tabs = new HashSet(); + tabs.add("label.authoring.heading.basic"); + pageContext.setAttribute("tabs", tabs); + + %> + + + <fmt:message key="label.author.title" /> + + <%@ include file="/common/header.jsp"%> + <%@ include file="/common/fckeditorheader.jsp"%> + + + + + + + +
    + + + + + + + +

    + +

    + +
    + + +
    + <%@ include file="/common/messages.jsp"%> +
    + + +
    + + + + + + + + + +
    + + + + +
    + +
    + +
    Index: lams_tool_survey/web/pages/authoring/definelaterforbid.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/definelaterforbid.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/definelaterforbid.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,18 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + <fmt:message key="label.author.title" /> + + <%@ include file="/common/header.jsp"%> + + +
    +

    + +

    + + +
    + +
    Index: lams_tool_survey/web/pages/authoring/instructions.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/Attic/instructions.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/instructions.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,135 @@ +<%@ include file="/common/taglibs.jsp" %> +<%@ page import=" org.lamsfoundation.lams.contentrepository.client.IToolContentHandler"%> + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    + +
    + <%@ include file="parts/instructionfilelist.jsp"%> +
    +
    +
    + +
    +
    + + + + +
    + +
    + + + + + + + + + + + + + + + +
    +
    + +
    + +
    + +
    + <%@ include file="parts/instructionfilelist.jsp"%> +
    +
    +
    + +
    +
    + + + + +
    + Index: lams_tool_survey/web/pages/authoring/start.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/start.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/start.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,13 @@ +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + Index: lams_tool_survey/web/pages/authoring/parts/addfile.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/Attic/addfile.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/parts/addfile.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,107 @@ +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + + + + + + +
    + <%@ include file="/common/messages.jsp"%> + + + + + + + + + + + + + + <%-- Remove description in as LDEV-617 + + + + + --%> + + + + +
    +

    + +

    +
    + + + +
    + + + +
    + + + +
    + <%@ include file="/pages/authoring/parts/itemattachment.jsp"%> +
    +
    +
    +
    + <%@ include file="instructions.jsp"%> +
    + +
    +   +
    + + + Index: lams_tool_survey/web/pages/authoring/parts/addlearningobject.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/Attic/addlearningobject.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/parts/addlearningobject.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,108 @@ +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + + + + + + + +
    + <%@ include file="/common/messages.jsp"%> + + + + + + + + + + + + + + <%-- Remove description in as LDEV-617 + + + + + --%> + + + + +
    +

    + +

    +
    + + + +
    + + + +
    + + + +
    + <%@ include file="/pages/authoring/parts/itemattachment.jsp"%> +
    +
    +
    +
    + <%@ include file="instructions.jsp"%> +
    + +
    +   +
    + + + Index: lams_tool_survey/web/pages/authoring/parts/addurl.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/Attic/addurl.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/parts/addurl.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,105 @@ +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + <%-- user for surveysurveyitem.js --%> + + + + + + + + + + + + + + + + + + + + + +
    + <%@ include file="/common/messages.jsp"%> + + + + + + + + + + + + + + <%-- Remove description in as LDEV-617 + + + + + --%> + + + + +
    +

    + +

    +
    + + + +
    + + + +
    + + +

    + + + +
    +
    +
    + <%@ include file="instructions.jsp"%> +
    + +
    +   +
    + + Index: lams_tool_survey/web/pages/authoring/parts/addwebsite.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/Attic/addwebsite.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/parts/addwebsite.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,108 @@ +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + + + + + + +
    + <%@ include file="/common/messages.jsp"%> + + + + + + + + + + + + + + <%-- Remove description in as LDEV-617 + + + + + --%> + + + + +
    +

    + +

    +
    + + + +
    + + + +
    + + + +
    + <%@ include file="/pages/authoring/parts/itemattachment.jsp"%> +
    +
    +
    +
    + <%@ include file="instructions.jsp"%> +
    + +
    +   +
    + + + Index: lams_tool_survey/web/pages/authoring/parts/instructionfilelist.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/Attic/instructionfilelist.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/parts/instructionfilelist.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,65 @@ +<%@ include file="/common/taglibs.jsp"%> +<%@ page + import="org.lamsfoundation.lams.contentrepository.client.IToolContentHandler"%> + + + + + + + + + + + + +<%-- check whehter has target file type --%> + + + + + + +<%-- Display target file type --%> + +
      + + +
    • + + + + + + + + + + + + + + + + + + + + + + + + + + +
    • +
      +
      +
    +
    Index: lams_tool_survey/web/pages/authoring/parts/instructions.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/instructions.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/parts/instructions.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,52 @@ +<%@ include file="/common/taglibs.jsp" %> + + +
    +
    + + + + + + + + + + + + + + + +
    + + + +
    ${status.index+1} + <%-- Don't display down icon if last line --%> + + + "> + + + + <%-- Don't display down icon if last line --%> + + + "> + + + + + "> + +
    +
    +
    + +<%-- This script will adjust survey item input area height according to the new instruction item amount. --%> + Index: lams_tool_survey/web/pages/authoring/parts/itemattachment.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/Attic/itemattachment.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/parts/itemattachment.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,24 @@ +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + +
    + + + + + + + +
    +
    + + + +
    Index: lams_tool_survey/web/pages/authoring/parts/itemlist.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/authoring/parts/itemlist.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/authoring/parts/itemlist.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,109 @@ +<%@ include file="/common/taglibs.jsp" %> + +
    +

    +

    + + + + + + + <%-- Survey Type:1=URL,2=File,3=Website,4=Learning Object --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + : + ${survey.title} + + + + + + + + + + + + + : + ${survey.title} + + + + + + + + + + + + + : + ${survey.title} + + + + + + + + + + + + + : + ${survey.title} + + + + + + + + + + + +
    +
    +<%-- This script will works when a new resoruce item submit in order to refresh "Survey List" panel. --%> + Index: lams_tool_survey/web/pages/export/exportportfolio.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/export/exportportfolio.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/export/exportportfolio.jsp 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,160 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + <fmt:message key="export.title" /> + + + + + + + + +
    + +

    ${title}

    +
    +
    + +
    + + + + + + <%-- display group name on first row--%> + + + + + + + + + + +
    + + + + + + ${item.sessionName} + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + ${item.itemTitle} + + ${item.username} + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + + +
    + + +
    Index: lams_tool_survey/web/pages/itemreview/initnav.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/itemreview/Attic/initnav.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/itemreview/initnav.jsp 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,23 @@ +<%-- +To avoid use HttpSession (LDEV-199), try to +use request.setAttribute() transfer value. But this page is embeded into a Frame html page, directly +request can not block on frame page, so use this trick page redirect request, then server side could handle this +request using this page as target +--%> + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + Index: lams_tool_survey/web/pages/itemreview/instructionsnav.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/itemreview/Attic/instructionsnav.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/itemreview/instructionsnav.jsp 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,86 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + + ${instructions.title} + + <%@ include file="/common/header.jsp"%> + + <%-- param has higher level for request attribute --%> + + + + + + + +
    + + + + + +
    +

    + Step ${instructions.current} of ${instructions.total} +

    +

    + + + + + + ${instructions.instruction.description} + + +

    + + + + + + + + + + + + + + + + + +
    +
    + + + Index: lams_tool_survey/web/pages/itemreview/mainframe.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/itemreview/Attic/mainframe.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/itemreview/mainframe.jsp 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,26 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +License Information: http://lamsfoundation.org/licensing/lams/2.0/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> +<%@ include file="/common/taglibs.jsp" %> + + ?mode=${mode}&itemIndex=${itemIndex}&itemUid=${itemUid}&toolSessionID=${toolSessionID}&sessionMapID=${sessionMapID}" + name=headerFrame" marginheight="0" scrolling="YES"> + + Index: lams_tool_survey/web/pages/itemreview/openurl.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/itemreview/Attic/openurl.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/itemreview/openurl.jsp 12 Sep 2006 04:15:20 -0000 1.1 @@ -0,0 +1,15 @@ +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + +
    +
    +

    ${title}

    + + + +
    + + Index: lams_tool_survey/web/pages/learning/addfile.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learning/Attic/addfile.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learning/addfile.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,49 @@ +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + + + + + +
    +

    + +

    +
    + <%@ include file="/common/messages.jsp"%> +
    + +
    + +
    +
    + +
    + +
    + +
    + +
    + +
    +
    + + Index: lams_tool_survey/web/pages/learning/addurl.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learning/Attic/addurl.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learning/addurl.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,57 @@ +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + + + + + + + +
    +

    + +

    +
    + <%@ include file="/common/messages.jsp"%> +
    + +
    + +
    +
    + +
    + +
    + + + + +
    + +
    + +
    + +

    +
    +
    + + Index: lams_tool_survey/web/pages/learning/definelater.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learning/definelater.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learning/definelater.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,30 @@ +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + +
    +

    + ${survey.title} +

    +
    +
    + + +
    + +
    + + + + +
    + + +
    Index: lams_tool_survey/web/pages/learning/finish.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learning/finish.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learning/finish.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,13 @@ +<%@ include file="/common/taglibs.jsp"%> +<%-- This page just for : redir finish page to parent rather that part of the frame --%> + + + + + + + Index: lams_tool_survey/web/pages/learning/learning.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learning/learning.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learning/learning.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,222 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <fmt:message key="label.learning.title" /> + <%@ include file="/common/header.jsp"%> + + <%-- param has higher level for request attribute --%> + + + + + + + + + + + + + + +
    +

    + ${survey.title} +

    +
    +
    + + +
    +

    + ${survey.instructions} +

    + + <%@ include file="/common/messages.jsp"%> + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    + ${item.title} + + [${item.createBy.loginName}] + + + + + + + + + + + + +   + + + + + +
    + ${survey.miniViewNumberStr} +
    +
    + + + +
    + +
    + + + + + + + + + + + + +
    +
    +
    + + + + + + + + + +
    + + + + + | + + + + + + + + + + + + +
    + +
    +
    + + + + + + + + + + + + <%-- end mode != teacher --%> +
    +
    + + + + +
    + +
    + Index: lams_tool_survey/web/pages/learning/notebook.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learning/notebook.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learning/notebook.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,58 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + <fmt:message key="label.learning.title" /> + <%@ include file="/common/header.jsp"%> + + +
    + + + + + + +

    + ${sessionMap.title} +

    +
    +
    + + + + + + + + + + + + + + + +
    + <%@ include file="/common/messages.jsp"%> +
    + ${sessionMap.reflectInstructions} +
    + +
    + + + +
    +
    +
    + + + + +
    + +
    Index: lams_tool_survey/web/pages/learning/runoffline.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learning/Attic/runoffline.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learning/runoffline.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,60 @@ + + +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + +
    +

    + ${sessionMap.title} +

    +
    +
    + + + + +
    +

    + +

    +
    +

    + + + + + + + + + + + + +

    + + + +
    + +
    Index: lams_tool_survey/web/pages/learning/start.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learning/start.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learning/start.jsp 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1,19 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + Index: lams_tool_survey/web/pages/learning/success.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learning/Attic/success.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learning/success.jsp 12 Sep 2006 04:15:18 -0000 1.1 @@ -0,0 +1,22 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + <%@ include file="/common/header.jsp"%> + + + +
    + + Add URL success, click here to return. + + + Add File success, click here to return. + +
    + + Index: lams_tool_survey/web/pages/learningobj/defaultcontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/Attic/defaultcontent.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learningobj/defaultcontent.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,31 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +License Information: http://lamsfoundation.org/licensing/lams/2.0/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> +<%@ include file="/common/taglibs.jsp" %> + + + +
    + + +
    + Please click on a link on the left to start. +
    +
    Index: lams_tool_survey/web/pages/learningobj/mainframe.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/Attic/mainframe.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learningobj/mainframe.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,28 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +License Information: http://lamsfoundation.org/licensing/lams/2.0/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> +<%@ include file="/common/taglibs.jsp" %> + + + + + + + Index: lams_tool_survey/web/pages/learningobj/navigatortree.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/Attic/navigatortree.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learningobj/navigatortree.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,101 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +License Information: http://lamsfoundation.org/licensing/lams/2.0/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> + + + +<%@ include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + + +

    + The content package details are missing. +

    +
    + +

    + +

    + +

    + +
    +
    + +
    Index: lams_tool_survey/web/pages/learningobj/xmltree.xsl =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/Attic/xmltree.xsl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learningobj/xmltree.xsl 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + +var TREE_ITEMS = [ + +]; + + + + + + + ['','', + + ], + + + ['',0, + + ], + + + + + \ No newline at end of file Index: lams_tool_survey/web/pages/learningobj/icons/.cvsignore =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/.cvsignore,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/learningobj/icons/.cvsignore 12 Sep 2006 04:15:17 -0000 1.1 @@ -0,0 +1 @@ +Thumbs.db Index: lams_tool_survey/web/pages/learningobj/icons/base.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/base.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/empty.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/empty.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/folder.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/folder.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/folderopen.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/folderopen.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/join.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/join.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/joinbottom.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/joinbottom.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/line.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/line.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/minus.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/minus.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/minusbottom.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/minusbottom.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/page.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/page.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/plus.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/plus.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/learningobj/icons/plusbottom.gif =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/learningobj/icons/Attic/plusbottom.gif,v diff -u Binary files differ Index: lams_tool_survey/web/pages/monitoring/editactivity.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/monitoring/editactivity.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/monitoring/editactivity.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,46 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + +
    + + : + + +
    + + : + + +
    + + + + + + + + + + + +
    + +
    +
    +
    +
    Index: lams_tool_survey/web/pages/monitoring/instructions.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/monitoring/Attic/instructions.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/monitoring/instructions.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,77 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + + + + + + +
    + + : + + +
    +   + + +
    + +
  • + + + + +   + + + + +
  • +
    +
    +
    + + : + + +
    +   + +
    + +
  • + + + + + + + + + + + + + +
  • +
    +
    +
    + + Index: lams_tool_survey/web/pages/monitoring/monitoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/monitoring/monitoring.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/monitoring/monitoring.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,52 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp" %> + + + +
    +

    + +

    + +
    + + + + +
    + + +
    + + Index: lams_tool_survey/web/pages/monitoring/notebook.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/monitoring/Attic/notebook.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/monitoring/notebook.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,58 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + <fmt:message key="label.learning.title" /> + <%@ include file="/common/header.jsp"%> + + +
    +

    + +

    +
    +
    + + + + + + + + + + +
    +

    + ${userDTO.fullName} +

    +
    +

    + ${userDTO.reflectInstrctions} +

    +
    + + + + + + + + +
    + + + + +
    + +
    +
    + + +
    + +
    Index: lams_tool_survey/web/pages/monitoring/statistic.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/monitoring/statistic.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/monitoring/statistic.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,91 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + +
    + +
    +
    + + + + <%-- display group name on first row--%> + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + ${item.sessionName} + + +
    + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + ${item.itemTitle} + + + ${item.username} + + + + + + + + ${item.viewNumber} + + + 0 + + +
    Index: lams_tool_survey/web/pages/monitoring/summary.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/monitoring/summary.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/monitoring/summary.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,151 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + +
    + +
    +
    + + + + + + <%-- display group name on first row--%> + + + + + + + + + + + + <%-- End group title display --%> + + + + + + + + + + + + + + + + + <%-- Reflection list --%> + + + + + + + + + + + + + + + + + + + + + + + + +
    + ${item.sessionName} + + + + + +
    + + + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + + + + + + + ${item.itemTitle} + + + ${item.username} + + + + + + + + ${item.viewNumber} + + + 0 + + + + + + + + + + + +
    +

    +
    + + + + + +
    + ${user.fullName} + + ${user.loginName} + + + + + + + +
    Index: lams_tool_survey/web/pages/monitoring/userlist.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/web/pages/monitoring/Attic/userlist.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_survey/web/pages/monitoring/userlist.jsp 12 Sep 2006 04:15:19 -0000 1.1 @@ -0,0 +1,54 @@ + + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp" %> + + +
    +

    + +

    +
    +
    +
    + + + + + + + + + + + + + + + + +
    + + + + + +
    + ${user.loginName} + + + + ${user.firstName},${user.lastName} +
    + Close +
    +
    + +
    +
    + +