Index: lams_tool_daco/.classpath =================================================================== diff -u --- lams_tool_daco/.classpath (revision 0) +++ lams_tool_daco/.classpath (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + Index: lams_tool_daco/.cvsignore =================================================================== diff -u --- lams_tool_daco/.cvsignore (revision 0) +++ lams_tool_daco/.cvsignore (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,4 @@ +.myeclipse +.mymetadata +build +test.html Index: lams_tool_daco/.project =================================================================== diff -u --- lams_tool_daco/.project (revision 0) +++ lams_tool_daco/.project (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,24 @@ + + + lams_tool_daco + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + + + exploded + 2 + D:/jboss/server/default/deploy/lams.ear/lams-tool-ladaco10.war/WEB-INF/classes + + + Index: lams_tool_daco/build.properties =================================================================== diff -u --- lams_tool_daco/build.properties (revision 0) +++ lams_tool_daco/build.properties (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,25 @@ +######################################################################################################################## +### 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=ladaco10 +project.displayname = lams daco tool +weblib=lib + +#project version +tool.version=20080611 + +# hide tool option +hideTool=false + +# Minimum compatible version +min.server.version.number=2.0 + +# Language files package +language.files.package=org.lamsfoundation.lams.tool.daco \ No newline at end of file Index: lams_tool_daco/build.xml =================================================================== diff -u --- lams_tool_daco/build.xml (revision 0) +++ lams_tool_daco/build.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,499 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +------------------------------------------+ + | 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 Daco tool + + + + + + + + + + + + + + +------------------------------------------+ + | built war file | + +------------------------------------------+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/conf/hibernate/mappings/.cvsignore =================================================================== diff -u --- lams_tool_daco/conf/hibernate/mappings/.cvsignore (revision 0) +++ lams_tool_daco/conf/hibernate/mappings/.cvsignore (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1 @@ +org Index: lams_tool_daco/conf/hibernate/mappings/hibernate.properties =================================================================== diff -u --- lams_tool_daco/conf/hibernate/mappings/hibernate.properties (revision 0) +++ lams_tool_daco/conf/hibernate/mappings/hibernate.properties (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/conf/jar/META-INF/MANIFEST.MF =================================================================== diff -u --- lams_tool_daco/conf/jar/META-INF/MANIFEST.MF (revision 0) +++ lams_tool_daco/conf/jar/META-INF/MANIFEST.MF (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,3 @@ +Implementation-Title: LAMS - Daco Tool +Implementation-Version: 2.1 +Implementation-Vendor: LAMS Foundation (http://lamsfoundation.org) Index: lams_tool_daco/conf/language/lams/ApplicationResources.properties =================================================================== diff -u --- lams_tool_daco/conf/language/lams/ApplicationResources.properties (revision 0) +++ lams_tool_daco/conf/language/lams/ApplicationResources.properties (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,286 @@ +appName = datacollection +#language code: en +#locale code: AU + + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Fri May 09 05:37:00 BST 2008 + +#=================== labels for ShareResources =================# + +activity.title =Data Collection +activity.description =Collecting data with custom structure. +activity.helptext =Asking questions with custom, limited answers. +tool.display.name =Data Collection Tool +tool.description =Tool for collecting data. +appName =Data Collection +errorPage.title =Error page +errorPage.heading =Some error occurs when handling your request + + +label.author.title =Data Collection Authoring +label.authoring.heading =Data Collection +label.authoring.heading.instructions =Instructions +label.authoring.heading.instructions.desc =Please input online and offline instructions +label.authoring.heading.advance.description =Please input advanced options for data collection +label.authoring.heading.basic.description =Basic input information for data collection +label.authoring.heading.basic =Basic +label.authoring.heading.advance =Advanced + +label.authoring.basic.title =Title +label.authoring.basic.instruction=Instructions +label.authoring.basic.answeroption =Answer options +label.authoring.basic.answeroption.add =Add option +label.authoring.basic.answeroption.ordinal=ABCDEFGHIJKLMNOPQRSTUVWXYZ + +label.authoring.basic.question.add=Add question +label.authoring.basic.textfield=Text field +label.authoring.basic.textfield.add =Add text field question +label.authoring.basic.textfield.help=Learner enters a single line of text as an answer. +label.authoring.basic.textarea=Text area +label.authoring.basic.textarea.add =Add text area question +label.authoring.basic.textarea.help=Learner enters a multi line text as an answer. +label.authoring.basic.number=Number +label.authoring.basic.number.add =Add number question +label.authoring.basic.number.help=Learner enters a number as an answer. +label.authoring.basic.number.digitsdecimal=Digits after decimal point +label.authoring.basic.date=Date +label.authoring.basic.date.add =Add date question +label.authoring.basic.date.help=Learner enters a date as an answer. +label.authoring.basic.file=File +label.authoring.basic.file.add =Add single file +label.authoring.basic.file.help=Learner uploads a file as an answer. +label.authoring.basic.image=Image +label.authoring.basic.image.add=Add image +label.authoring.basic.image.help=Learner uploads an image as an answer. +label.authoring.basic.radio=Radio buttons +label.authoring.basic.radio.add=Add radio buttons question +label.authoring.basic.radio.help=Learner chooses one answer from the given options. +label.authoring.basic.dropdown=Dropdown menu +label.authoring.basic.dropdown.add=Add dropdown menu question +label.authoring.basic.dropdown.help=Learner chooses one answer from the given options. +label.authoring.basic.checkbox=Checkbox +label.authoring.basic.checkbox.add=Add checkbox question +label.authoring.basic.checkbox.help=Learner chooses multiple answers from the given options. +label.authoring.basic.longlat=Longitude/Latitude +label.authoring.basic.longlat.add=Add longitude/latitude question +label.authoring.basic.longlat.maps=Choose the maps +label.authoring.basic.longlat.help=Learner enters longitude and latitude as an answer. +label.authoring.basic.description=Question +label.authoring.basic.min=Minimum +label.authoring.basic.min.select=Min selected +label.authoring.basic.max=Maximum +label.authoring.basic.max.select=Max selected +label.authoring.basic.max.char=Max characters +label.authoring.basic.max.word=Max words +label.authoring.basic.list.title =Question list +label.authoring.basic.list.header.type=Type +label.authoring.basic.list.header.question=Question +label.authoring.basic.textfield =Text field +label.authoring.basic.file =File +label.authoring.basic.edit =Edit +label.authoring.basic.delete =Delete +label.authoring.basic.textfield.input =Text field +label.authoring.basic.file.input =File +label.authoring.basic.description.input =Description +label.authoring.basic.zip.file.input =Zip file: +label.authoring.basic.required =Question is required +label.authoring.basic.additionaloptions.show=Show additional options +label.authoring.basic.additionaloptions.hide=Hide additional options +label.authoring.basic.summary=Summary +label.authoring.basic.summary.sum=Sum +label.authoring.basic.summary.average=Average +label.authoring.basic.summary.count=Count + +label.authoring.online.instruction =Online Instructions +label.authoring.online.file =Upload online file +label.authoring.online.filelist =Online file list +label.authoring.upload.online.button =Upload Online +label.authoring.online.delete =Delete +label.authoring.advanced.reflectOnActivity =Add Notebook at end of Data Collection with the following instructions: +label.authoring.advanced.record=Limit number of records +label.authoring.advanced.record.min=Minimum +label.authoring.advanced.record.max=Maximum +label.authoring.advanced.record.nolimit=No limit +label.authoring.advanced.lock.on.finished =Lock when finished +label.authoring.advanced.run.content.auto =Run content automatically (only available if there is exactly one question) + +label.authoring.offline.file =Upload offline file +label.authoring.offline.instruction =Offline Instructions +label.authoring.offline.filelist =Offline file list +label.authoring.offline.delete =Delete +label.authoring.upload.offline.button =Upload Offline + +label.authoring.choosefile.button =Choose file +label.authoring.cancel.button =Cancel +label.authoring.save.button =Save +message.authoring.cancel.save =Do you want to close this window without saving? + +label.learning.title =Data Collection Learning +label.learning.heading=Data Collection +label.learning.heading.add=Add +label.learning.heading.list=List +label.learning.heading.recordnumber =Record number: +label.learning.heading.norecords=No records added. +label.learning.add=Add record +label.learning.textfield.hint=Enter a single line of text +label.learning.textarea.hint=Enter text +label.learning.number.hint=Enter a number +label.learning.date.hint=Enter a date +label.learning.date.day=Day: +label.learning.date.month=Month: +label.learning.date.year=Year: +label.learning.file.hint=Choose a file +label.learning.file.uploaded=Uploaded file: +label.learning.file.notuploaded=No file uploaded. +label.learning.image.hint=Choose an image +label.learning.radio.hint=Choose an option +label.learning.dropdown.hint=Choose an option +label.learning.dropdown.select=SELECT +label.learning.dropdown.noneselected=No answer was selected. +label.learning.dropdown.selected=Selected answer: +label.learning.checkbox.hint=Choose options +label.learning.longlat.hint=Enter two real numbers +label.learning.longlat.longitude=Longitude: +label.learning.longlat.longitude.unit=�N +label.learning.longlat.latitude=Latitude: +label.learning.longlat.latitude.unit=�E +label.learning.view.change=Change view + +tab.monitoring.summary =Summary +tab.monitoring.statistics =Statistic +tab.monitoring.instructions =Instruction +tab.monitoring.edit.activity =Edit Activity +label.monitoring.group =Group +label.monitoring.type =Type +label.monitoring.title =Title +label.monitoring.suggest =Suggested By +label.monitoring.number.learners =Number of Learners +label.monitoring.hide =Hide +label.monitoring.show =Show +label.monitoring.user.loginname =Login name +label.monitoring.user.name =Name +label.monitoring.hidden =Hidden +label.monitoring.edit.activity.cancel =Cancel +label.monitoring.edit.activity.update =Update +label.monitoring.edit.activity.edit =Edit +label.monitoring.attachments =Attachments +label.monitoring.user.fullname =Name +label.monitoring.heading.access =Learners list +label.monitoring.access.time =Access time + +message.monitoring.edit.activity.not.editable =This Activity is no longer editable +message.monitoring.summary.no.session =No Session Available +message.monitoring.summary.no.question.for.group =No question available for this group. +note.monitoring.summary =Note: number of learners is the number of learners who have viewed the question. + +export.label.question =Question +export.title =Export portfolio of Data Collection +export.init.question =Initial Questions + +message.alertContentEdit =Warning: One of more students have accessed this activity. Changing this content will result in students getting different information. +message.step.of =Step {0} of {1} +message.warnLockOnFinish =Note: After you click on "Next Activity" and you come back to this Data Collection, you won't be able to view questions +message.learning.addrecordsuccess =The record was added successfully. +message.learning.editrecordsuccess =The record was updated successfully. +message.activityLocked =The instructor has set this activity not to allow you to view any more questions after you have finished it. +message.maxFileSize =Max 250K + +label.open =Open +label.delete =Delete +label.download =Download +label.view =View +label.edit =Edit +label.completed =Completed +label.show =Show +label.hide =Hide +label.save =Save +label.cancel =Cancel + +button.upload =Upload +button.add =Add +button.cancel =Cancel +button.try.again =Try again +button.close =Close + +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. + + +open.in.new.window =Open textfield in pop-up +page.title.monitoring.view.reflection =View Notebook Entries +button.edit =Edit +message.no.reflection.available =No notebook available +title.reflection =Notebook Entry +monitoring.user.reflection =Notebook Entry + + +label.up =Move Up +label.down =Move down +label.continue =Continue +label.finished =Next Activity +label.finish =Finished + + + +errors.header = +errors.footer = +error.valueReqd =Value Required +error.inputFileTooLarge =Input File size is too large! +error.uploading =error uploading +error.title.empty =Title can not be blank +error.reflection.emtpy =Please input Notebook Entry +errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes +error.attachment.executable =The uploaded file is executable, please zip it before uploading. +error.msg.repository =A repository error occurred while trying to upload the file. + +error.question.desc.blank =Description can not be blank +error.question.file.blank =File can not be blank. +error.question.max.blank=The maximum constraint must not be blank. +error.question.max.number.int=The maximum constraint must be an integer number. +error.question.max.number.float=The maximum constraint must be a real number. +error.question.max.negative=The maximum constraint must be a nonnegative number. +error.question.max.toohigh=The maximum constraint must be less than {0}. +error.question.max.toohigh.answeroption=The maximum constraint must be less or equal to the answer option count. +error.question.max.toolow=The maximum constraint must be more than {0}. +error.question.min.blank=The minimum constraint must not be blank. +error.question.min.number.int=The minimum constraint must be an integer number. +error.question.min.number.float=The minimum constraint must be a real number. +error.question.min.negative=The minimum constraint must be a nonnegative number. +error.question.min.toohigh=The minimum constraint must be less than {0}. +error.question.min.toohigh.answeroption=The minimum constraint must be less or equal to the answer option count. +error.question.min.toolow=The minimum constraint must be more than {0}. +error.question.min.toohigh.max=The minimum constraint must be less than the maximum constraint. +error.question.answeroption.repeat=The answer options {0} and {1} are the same. +error.question.answeroption.notenough =You should provide at least {0} answer options. +error.recordlimit.min.toohigh.max=The minimum number of records must be less or equal to the maximum. + +error.record.blank=An answer for question {0} is required. +error.record.textarea.long=The maximum number of words in question {0} is {1}. +error.record.number.min=The number in question {0} should be no less than {1}. +error.record.number.max=The number in question {0} should be no more than {1}. +error.record.number.float=The answer in question {0} must be a real number. +error.record.date.day.blank=The day field in question {0} is blank. +error.record.date.day.int=The day field in question {0} must be an integer number. +error.record.date.day.limit=The day field in question {0} must be between 1 and {1}. +error.record.date.month.blank=The month field in question {0} is blank. +error.record.date.month.int=The month field in question {0} must be an integer number. +error.record.date.month.limit=The month field in question {0} must be between 1 and 12. +error.record.date.year.blank=The year field in question {0} is blank. +error.record.date.year.int=The year field in question {0} must be an integer number. +error.record.image.format=The file in question {0} must be an image (extensions: JPG, GIF or PNG). +error.record.checkbox.min=The number of answers in question {0} must be no less than {1}. +error.record.checkbox.max=The number of answers in question {0} must be no more than {1}. +error.record.longlat.longitude.blank=The longitude in question {0} must not be blank. +error.record.longlat.longitude.float=The longitude in question {0} must be an real number. +error.record.longlat.latitude.blank=The latitude in question {0} must not be blank. +error.record.longlat.latitude.float=The latitude in question {0} must be an real number. +error.record.notenough=You should enter at leat {0} records. + +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.io.exception =IOException occurs when uploading file. +error.msg.invaid.param.upload =InvalidParameterException occured while trying to upload File. +error.msg.default.content.not.find =Could not retrieve default content record for this tool. + +#======= End labels: Exported 159 labels for en AU ===== Index: lams_tool_daco/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u --- lams_tool_daco/conf/language/lams/ApplicationResources_en_AU.properties (revision 0) +++ lams_tool_daco/conf/language/lams/ApplicationResources_en_AU.properties (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,286 @@ +appName = datacollection +#language code: en +#locale code: AU + + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Fri May 09 05:37:00 BST 2008 + +#=================== labels for Data Collection =================# + +activity.title =Data Collection +activity.description =Collecting data with custom structure. +activity.helptext =Asking questions with custom, limited answers. +tool.display.name =Data Collection Tool +tool.description =Tool for collecting data. +appName =Data Collection +errorPage.title =Error page +errorPage.heading =Some error occurs when handling your request + + +label.author.title =Data Collection Authoring +label.authoring.heading =Data Collection +label.authoring.heading.instructions =Instructions +label.authoring.heading.instructions.desc =Please input online and offline instructions +label.authoring.heading.advance.description =Please input advanced options for data collection +label.authoring.heading.basic.description =Basic input information for data collection +label.authoring.heading.basic =Basic +label.authoring.heading.advance =Advanced + +label.authoring.basic.title =Title +label.authoring.basic.instruction=Instructions +label.authoring.basic.answeroption =Answer options +label.authoring.basic.answeroption.add =Add option +label.authoring.basic.answeroption.ordinal=ABCDEFGHIJKLMNOPQRSTUVWXYZ + +label.authoring.basic.question.add=Add question +label.authoring.basic.textfield=Text field +label.authoring.basic.textfield.add =Add text field question +label.authoring.basic.textfield.help=Learner enters a single line of text as an answer. +label.authoring.basic.textarea=Text area +label.authoring.basic.textarea.add =Add text area question +label.authoring.basic.textarea.help=Learner enters a multi line text as an answer. +label.authoring.basic.number=Number +label.authoring.basic.number.add =Add number question +label.authoring.basic.number.help=Learner enters a number as an answer. +label.authoring.basic.number.digitsdecimal=Digits after decimal point +label.authoring.basic.date=Date +label.authoring.basic.date.add =Add date question +label.authoring.basic.date.help=Learner enters a date as an answer. +label.authoring.basic.file=File +label.authoring.basic.file.add =Add single file +label.authoring.basic.file.help=Learner uploads a file as an answer. +label.authoring.basic.image=Image +label.authoring.basic.image.add=Add image +label.authoring.basic.image.help=Learner uploads an image as an answer. +label.authoring.basic.radio=Radio buttons +label.authoring.basic.radio.add=Add radio buttons question +label.authoring.basic.radio.help=Learner chooses one answer from the given options. +label.authoring.basic.dropdown=Dropdown menu +label.authoring.basic.dropdown.add=Add dropdown menu question +label.authoring.basic.dropdown.help=Learner chooses one answer from the given options. +label.authoring.basic.checkbox=Checkbox +label.authoring.basic.checkbox.add=Add checkbox question +label.authoring.basic.checkbox.help=Learner chooses multiple answers from the given options. +label.authoring.basic.longlat=Longitude/Latitude +label.authoring.basic.longlat.add=Add longitude/latitude question +label.authoring.basic.longlat.maps=Choose the maps +label.authoring.basic.longlat.help=Learner enters longitude and latitude as an answer. +label.authoring.basic.description=Question +label.authoring.basic.min=Minimum +label.authoring.basic.min.select=Min selected +label.authoring.basic.max=Maximum +label.authoring.basic.max.select=Max selected +label.authoring.basic.max.char=Max characters +label.authoring.basic.max.word=Max words +label.authoring.basic.list.title =Question list +label.authoring.basic.list.header.type=Type +label.authoring.basic.list.header.question=Question +label.authoring.basic.textfield =Text field +label.authoring.basic.file =File +label.authoring.basic.edit =Edit +label.authoring.basic.delete =Delete +label.authoring.basic.textfield.input =Text field +label.authoring.basic.file.input =File +label.authoring.basic.description.input =Description +label.authoring.basic.zip.file.input =Zip file: +label.authoring.basic.required =Question is required +label.authoring.basic.additionaloptions.show=Show additional options +label.authoring.basic.additionaloptions.hide=Hide additional options +label.authoring.basic.summary=Summary +label.authoring.basic.summary.sum=Sum +label.authoring.basic.summary.average=Average +label.authoring.basic.summary.count=Count + +label.authoring.online.instruction =Online Instructions +label.authoring.online.file =Upload online file +label.authoring.online.filelist =Online file list +label.authoring.upload.online.button =Upload Online +label.authoring.online.delete =Delete +label.authoring.advanced.reflectOnActivity =Add Notebook at end of Data Collection with the following instructions: +label.authoring.advanced.record=Limit number of records +label.authoring.advanced.record.min=Minimum +label.authoring.advanced.record.max=Maximum +label.authoring.advanced.record.nolimit=No limit +label.authoring.advanced.lock.on.finished =Lock when finished +label.authoring.advanced.run.content.auto =Run content automatically (only available if there is exactly one question) + +label.authoring.offline.file =Upload offline file +label.authoring.offline.instruction =Offline Instructions +label.authoring.offline.filelist =Offline file list +label.authoring.offline.delete =Delete +label.authoring.upload.offline.button =Upload Offline + +label.authoring.choosefile.button =Choose file +label.authoring.cancel.button =Cancel +label.authoring.save.button =Save +message.authoring.cancel.save =Do you want to close this window without saving? + +label.learning.title =Data Collection Learning +label.learning.heading=Data Collection +label.learning.heading.add=Add +label.learning.heading.list=List +label.learning.heading.recordnumber =Record number: +label.learning.heading.norecords=No records added. +label.learning.add=Add record +label.learning.textfield.hint=Enter a single line of text +label.learning.textarea.hint=Enter text +label.learning.number.hint=Enter a number +label.learning.date.hint=Enter a date +label.learning.date.day=Day: +label.learning.date.month=Month: +label.learning.date.year=Year: +label.learning.file.hint=Choose a file +label.learning.file.uploaded=Uploaded file: +label.learning.file.notuploaded=No file uploaded. +label.learning.image.hint=Choose an image +label.learning.radio.hint=Choose an option +label.learning.dropdown.hint=Choose an option +label.learning.dropdown.select=SELECT +label.learning.dropdown.noneselected=No answer was selected. +label.learning.dropdown.selected=Selected answer: +label.learning.checkbox.hint=Choose options +label.learning.longlat.hint=Enter two real numbers +label.learning.longlat.longitude=Longitude: +label.learning.longlat.longitude.unit=�N +label.learning.longlat.latitude=Latitude: +label.learning.longlat.latitude.unit=�E +label.learning.view.change=Change view + +tab.monitoring.summary =Summary +tab.monitoring.statistics =Statistic +tab.monitoring.instructions =Instruction +tab.monitoring.edit.activity =Edit Activity +label.monitoring.group =Group +label.monitoring.type =Type +label.monitoring.title =Title +label.monitoring.suggest =Suggested By +label.monitoring.number.learners =Number of Learners +label.monitoring.hide =Hide +label.monitoring.show =Show +label.monitoring.user.loginname =Login name +label.monitoring.user.name =Name +label.monitoring.hidden =Hidden +label.monitoring.edit.activity.cancel =Cancel +label.monitoring.edit.activity.update =Update +label.monitoring.edit.activity.edit =Edit +label.monitoring.attachments =Attachments +label.monitoring.user.fullname =Name +label.monitoring.heading.access =Learners list +label.monitoring.access.time =Access time + +message.monitoring.edit.activity.not.editable =This Activity is no longer editable +message.monitoring.summary.no.session =No Session Available +message.monitoring.summary.no.question.for.group =No question available for this group. +note.monitoring.summary =Note: number of learners is the number of learners who have viewed the question. + +export.label.question =Question +export.title =Export portfolio of Data Collection +export.init.question =Initial Questions + +message.alertContentEdit =Warning: One of more students have accessed this activity. Changing this content will result in students getting different information. +message.step.of =Step {0} of {1} +message.warnLockOnFinish =Note: After you click on "Next Activity" and you come back to this Data Collection, you won't be able to view questions +message.learning.addrecordsuccess =The record was added successfully. +message.learning.editrecordsuccess =The record was updated successfully. +message.activityLocked =The instructor has set this activity not to allow you to view any more questions after you have finished it. +message.maxFileSize =Max 250K + +label.open =Open +label.delete =Delete +label.download =Download +label.view =View +label.edit =Edit +label.completed =Completed +label.show =Show +label.hide =Hide +label.save =Save +label.cancel =Cancel + +button.upload =Upload +button.add =Add +button.cancel =Cancel +button.try.again =Try again +button.close =Close + +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. + + +open.in.new.window =Open textfield in pop-up +page.title.monitoring.view.reflection =View Notebook Entries +button.edit =Edit +message.no.reflection.available =No notebook available +title.reflection =Notebook Entry +monitoring.user.reflection =Notebook Entry + + +label.up =Move Up +label.down =Move down +label.continue =Continue +label.finished =Next Activity +label.finish =Finished + + + +errors.header = +errors.footer = +error.valueReqd =Value Required +error.inputFileTooLarge =Input File size is too large! +error.uploading =error uploading +error.title.empty =Title can not be blank +error.reflection.emtpy =Please input Notebook Entry +errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes +error.attachment.executable =The uploaded file is executable, please zip it before uploading. +error.msg.repository =A repository error occurred while trying to upload the file. + +error.question.desc.blank =Description can not be blank +error.question.file.blank =File can not be blank. +error.question.max.blank=The maximum constraint must not be blank. +error.question.max.number.int=The maximum constraint must be an integer number. +error.question.max.number.float=The maximum constraint must be a real number. +error.question.max.negative=The maximum constraint must be a nonnegative number. +error.question.max.toohigh=The maximum constraint must be less than {0}. +error.question.max.toohigh.answeroption=The maximum constraint must be less or equal to the answer option count. +error.question.max.toolow=The maximum constraint must be more than {0}. +error.question.min.blank=The minimum constraint must not be blank. +error.question.min.number.int=The minimum constraint must be an integer number. +error.question.min.number.float=The minimum constraint must be a real number. +error.question.min.negative=The minimum constraint must be a nonnegative number. +error.question.min.toohigh=The minimum constraint must be less than {0}. +error.question.min.toohigh.answeroption=The minimum constraint must be less or equal to the answer option count. +error.question.min.toolow=The minimum constraint must be more than {0}. +error.question.min.toohigh.max=The minimum constraint must be less than the maximum constraint. +error.question.answeroption.repeat=The answer options {0} and {1} are the same. +error.question.answeroption.notenough =You should provide at least {0} answer options. +error.recordlimit.min.toohigh.max=The minimum number of records must be less or equal to the maximum. + +error.record.blank=An answer for question {0} is required. +error.record.textarea.long=The maximum number of words in question {0} is {1}. +error.record.number.min=The number in question {0} should be no less than {1}. +error.record.number.max=The number in question {0} should be no more than {1}. +error.record.number.float=The answer in question {0} must be a real number. +error.record.date.day.blank=The day field in question {0} is blank. +error.record.date.day.int=The day field in question {0} must be an integer number. +error.record.date.day.limit=The day field in question {0} must be between 1 and {1}. +error.record.date.month.blank=The month field in question {0} is blank. +error.record.date.month.int=The month field in question {0} must be an integer number. +error.record.date.month.limit=The month field in question {0} must be between 1 and 12. +error.record.date.year.blank=The year field in question {0} is blank. +error.record.date.year.int=The year field in question {0} must be an integer number. +error.record.image.format=The file in question {0} must be an image (extensions: JPG, GIF or PNG). +error.record.checkbox.min=The number of answers in question {0} must be no less than {1}. +error.record.checkbox.max=The number of answers in question {0} must be no more than {1}. +error.record.longlat.longitude.blank=The longitude in question {0} must not be blank. +error.record.longlat.longitude.float=The longitude in question {0} must be an real number. +error.record.longlat.latitude.blank=The latitude in question {0} must not be blank. +error.record.longlat.latitude.float=The latitude in question {0} must be an real number. +error.record.notenough=You should enter at leat {0} records. + +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.io.exception =IOException occurs when uploading file. +error.msg.invaid.param.upload =InvalidParameterException occured while trying to upload File. +error.msg.default.content.not.find =Could not retrieve default content record for this tool. + +#======= End labels: Exported 159 labels for en AU ===== Index: lams_tool_daco/conf/war/META-INF/MANIFEST.MF =================================================================== diff -u --- lams_tool_daco/conf/war/META-INF/MANIFEST.MF (revision 0) +++ lams_tool_daco/conf/war/META-INF/MANIFEST.MF (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,4 @@ +Implementation-Title: LAMS - Daco Tool +Implementation-Version: 2.1 +Implementation-Vendor: LAMS Foundation (http://lamsfoundation.org) +Class-Path: ./lams.jar ./lams-tool-ladaco10.jar ./lams-contentrepository.jar Index: lams_tool_daco/conf/xdoclet/global-exceptions.xml =================================================================== diff -u --- lams_tool_daco/conf/xdoclet/global-exceptions.xml (revision 0) +++ lams_tool_daco/conf/xdoclet/global-exceptions.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,8 @@ + + + Index: lams_tool_daco/conf/xdoclet/global-forwards.xml =================================================================== diff -u --- lams_tool_daco/conf/xdoclet/global-forwards.xml (revision 0) +++ lams_tool_daco/conf/xdoclet/global-forwards.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1 @@ + \ No newline at end of file Index: lams_tool_daco/conf/xdoclet/struts-actions.xml =================================================================== diff -u --- lams_tool_daco/conf/xdoclet/struts-actions.xml (revision 0) +++ lams_tool_daco/conf/xdoclet/struts-actions.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/conf/xdoclet/struts-forms.xml =================================================================== diff -u --- lams_tool_daco/conf/xdoclet/struts-forms.xml (revision 0) +++ lams_tool_daco/conf/xdoclet/struts-forms.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1 @@ + Index: lams_tool_daco/conf/xdoclet/struts-message-resources.xml =================================================================== diff -u --- lams_tool_daco/conf/xdoclet/struts-message-resources.xml (revision 0) +++ lams_tool_daco/conf/xdoclet/struts-message-resources.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1 @@ + Index: lams_tool_daco/conf/xdoclet/struts-plugins.xml =================================================================== diff -u --- lams_tool_daco/conf/xdoclet/struts-plugins.xml (revision 0) +++ lams_tool_daco/conf/xdoclet/struts-plugins.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,5 @@ + + + + + Index: lams_tool_daco/conf/xdoclet/validation-forms.xml =================================================================== diff -u --- lams_tool_daco/conf/xdoclet/validation-forms.xml (revision 0) +++ lams_tool_daco/conf/xdoclet/validation-forms.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1 @@ \ No newline at end of file Index: lams_tool_daco/conf/xdoclet/validation-global.xml =================================================================== diff -u --- lams_tool_daco/conf/xdoclet/validation-global.xml (revision 0) +++ lams_tool_daco/conf/xdoclet/validation-global.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,6 @@ + + + datePattern + yyyy-MM-dd + + Index: lams_tool_daco/db/clear_old_learning_session.sql =================================================================== diff -u --- lams_tool_daco/db/clear_old_learning_session.sql (revision 0) +++ lams_tool_daco/db/clear_old_learning_session.sql (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,4 @@ +delete from lams_progress_attempted; +delete from lams_progress_completed; +delete from lams_learner_progress; +delete from lams_tool_session; \ No newline at end of file Index: lams_tool_daco/db/model/daco.clay =================================================================== diff -u --- lams_tool_daco/db/model/daco.clay (revision 0) +++ lams_tool_daco/db/model/daco.clay (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,949 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
Index: lams_tool_daco/db/model/targetModel.clay =================================================================== diff -u --- lams_tool_daco/db/model/targetModel.clay (revision 0) +++ lams_tool_daco/db/model/targetModel.clay (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,664 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
Index: lams_tool_daco/db/sql/activity_insert.sql =================================================================== diff -u --- lams_tool_daco/db/sql/activity_insert.sql (revision 0) +++ lams_tool_daco/db/sql/activity_insert.sql (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 +, 'Daco' +, 'Daco' +, '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/ladaco10/images/icon_daco.swf' +, NULL +, NULL +, NULL +, 'org.lamsfoundation.lams.tool.daco.ApplicationResources' +) Index: lams_tool_daco/db/sql/create_lams_tool_daco.sql =================================================================== diff -u --- lams_tool_daco/db/sql/create_lams_tool_daco.sql (revision 0) +++ lams_tool_daco/db/sql/create_lams_tool_daco.sql (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,127 @@ +SET FOREIGN_KEY_CHECKS=0; +drop table if exists tl_ladaco10_attachment; +drop table if exists tl_ladaco10_contents; +drop table if exists tl_ladaco10_questions; +drop table if exists tl_ladaco10_answer_options; +drop table if exists tl_ladaco10_session; +drop table if exists tl_ladaco10_user; +drop table if exists tl_ladaco10_answers; +create table tl_ladaco10_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, + content_uid bigint, + primary key (uid) +)type=innodb; +create table tl_ladaco10_contents ( + 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, + min_records smallint, + max_records smallint, + instructions text, + online_instructions text, + offline_instructions text, + content_in_use tinyint, + define_later tinyint, + content_id bigint unique, + reflect_instructions varchar(255), + reflect_on_activity smallint, + primary key (uid) +)type=innodb; +create table tl_ladaco10_questions ( + uid bigint not null auto_increment, + description text, + organization_xml text, + create_by bigint, + create_date datetime, + create_by_author tinyint, + is_hide tinyint, + is_required tinyint, + question_type smallint, + min_constraint float, + max_constraint float, + digits_decimal smallint default 0, + summary smallint, + content_uid bigint, + session_uid bigint, + primary key (uid) +)type=innodb; +create table tl_ladaco10_answer_options +(uid bigint not null auto_increment, +question_uid bigint, +sequence_num smallint unsigned not null, +answer_option varchar(255), +primary key (uid)) +type=innodb; + +create table tl_ladaco10_question_log ( + uid bigint not null auto_increment, + access_date datetime, + question_uid bigint, + user_uid bigint, + complete tinyint, + session_id bigint, + primary key (uid) +)type=innodb; +create table tl_ladaco10_session ( + uid bigint not null auto_increment, + session_end_date datetime, + session_start_date datetime, + status integer, + content_uid bigint, + session_id bigint, + session_name varchar(250), + primary key (uid) +)type=innodb; +create table tl_ladaco10_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, + content_uid bigint, + primary key (uid) +)type=innodb; +create table tl_ladaco10_answers +(uid bigint not null auto_increment, +user_uid bigint, +question_uid bigint, +record_id smallint unsigned not null, +answer text, + file_type varchar(255), + file_name varchar(255), + file_uuid bigint, + file_version_id bigint, +primary key (uid)) type=innodb; + +alter table tl_ladaco10_attachment add index FK_NEW_1728979407_1E7009430E79035 (content_uid), add constraint FK_NEW_1728979407_1E7009430E79035 foreign key (content_uid) references tl_ladaco10_contents (uid); +alter table tl_ladaco10_contents add index FK_NEW_1728979407_89093BF758092FB (create_by), add constraint FK_NEW_1728979407_89093BF758092FB foreign key (create_by) references tl_ladaco10_user (uid); +alter table tl_ladaco10_questions add index FK_NEW_1728979407_F52D1F93758092FB (create_by), add constraint FK_NEW_1728979407_F52D1F93758092FB foreign key (create_by) references tl_ladaco10_user (uid); +alter table tl_ladaco10_questions add index FK_NEW_1728979407_F52D1F9330E79035 (content_uid), add constraint FK_NEW_1728979407_F52D1F9330E79035 foreign key (content_uid) references tl_ladaco10_contents (uid); +alter table tl_ladaco10_questions add index FK_NEW_1728979407_F52D1F93EC0D3147 (session_uid), add constraint FK_NEW_1728979407_F52D1F93EC0D3147 foreign key (session_uid) references tl_ladaco10_session (uid); +alter table tl_ladaco10_answer_options add index FK_NEW_1728979407_30113BFCEC0D1113 (question_uid), add constraint FK_NEW_1728979407_30113BFCEC0D1113 foreign key (question_uid) references tl_ladaco10_questions (uid); +alter table tl_ladaco10_question_log add index FK_NEW_1728979407_693580A438BF8DFE (question_uid), add constraint FK_NEW_1728979407_693580A438BF8DFE foreign key (question_uid) references tl_ladaco10_questions (uid); +alter table tl_ladaco10_question_log add index FK_NEW_1728979407_693580A441F9365D (user_uid), add constraint FK_NEW_1728979407_693580A441F9365D foreign key (user_uid) references tl_ladaco10_user (uid); +alter table tl_ladaco10_session add index FK_NEW_1728979407_24AA78C530E79035 (content_uid), add constraint FK_NEW_1728979407_24AA78C530E79035 foreign key (content_uid) references tl_ladaco10_contents (uid); +alter table tl_ladaco10_user add index FK_NEW_1728979407_30113BFCEC0D3147 (session_uid), add constraint FK_NEW_1728979407_30113BFCEC0D3147 foreign key (session_uid) references tl_ladaco10_session (uid); +alter table tl_ladaco10_user add index FK_NEW_1728979407_30113BFC309ED320 (content_uid), add constraint FK_NEW_1728979407_30113BFC309ED320 foreign key (content_uid) references tl_ladaco10_contents (uid); +alter table tl_ladaco10_answers add index FK_NEW_1728979407_30113BFCEC0D1111 (user_uid), add constraint FK_NEW_1728979407_30113BFCEC0D1111 foreign key (user_uid) references tl_ladaco10_user (uid); +alter table tl_ladaco10_answers add index FK_NEW_1728979407_30113BFCEC0D1112 (question_uid), add constraint FK_NEW_1728979407_30113BFCEC0D1112 foreign key (question_uid) references tl_ladaco10_questions (uid); + +INSERT INTO `tl_ladaco10_contents` (`uid`, `create_date`, `update_date`, `create_by`, `title`, `run_offline`, `lock_on_finished`,`min_records`,`max_records`, `instructions`, `online_instructions`, `offline_instructions`, `content_in_use`, `define_later`, `content_id`,`reflect_on_activity`) VALUES + (1,NULL,NULL,NULL,'Daco','0','0',0,0,'Instructions ',null,null,0,0,${default_content_id},0); + +INSERT INTO `tl_ladaco10_questions` (`uid`, `description`, `organization_xml`, `create_by`, `create_date`, `create_by_author`, `is_hide`, `is_required`, `question_type`, `min_constraint`, `max_constraint`,`digits_decimal`,`summary`, `content_uid`, `session_uid`) VALUES + (1,'
Web Search
',NULL,null,NOW(),1,0,1,1,NULL,NULL,NULL,NULL,1,NULL); + +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_daco/db/sql/drop_lams_tool_daco.sql =================================================================== diff -u --- lams_tool_daco/db/sql/drop_lams_tool_daco.sql (revision 0) +++ lams_tool_daco/db/sql/drop_lams_tool_daco.sql (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,10 @@ +SET FOREIGN_KEY_CHECKS=0; +drop table if exists tl_ladaco10_attachment; +drop table if exists tl_ladaco10_contents; +drop table if exists tl_ladaco10_questions; +drop table if exists tl_ladaco10_answer_options; +drop table if exists tl_ladaco10_question_log; +drop table if exists tl_ladaco10_session; +drop table if exists tl_ladaco10_user; +drop table if exists tl_ladaco10_answers; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_daco/db/sql/library_insert.sql =================================================================== diff -u --- lams_tool_daco/db/sql/library_insert.sql (revision 0) +++ lams_tool_daco/db/sql/library_insert.sql (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 +( +'Data Collection', +'Data Collection', +0, +NOW() +) Index: lams_tool_daco/db/sql/tool_insert.sql =================================================================== diff -u --- lams_tool_daco/db/sql/tool_insert.sql (revision 0) +++ lams_tool_daco/db/sql/tool_insert.sql (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,64 @@ +# 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, +help_url, +language_file, +classpath_addition, +context_file, +create_date_time, +modified_date_time +) +VALUES +( +'ladaco10', +'dacoService', +'Data Collection', +'Data Collection', +'shareddaco', +'@tool_version@', +NULL, +NULL, +0, +2, +1, +'tool/ladaco10/learning/start.do?mode=learner', +'tool/ladaco10/learning/start.do?mode=author', +'tool/ladaco10/learning/start.do?mode=teacher', +'tool/ladaco10/authoring/start.do', +'tool/ladaco10/monitoring/summary.do', +'tool/ladaco10/definelater.do', +'tool/ladaco10/exportPortfolio?mode=learner', +'tool/ladaco10/exportPortfolio?mode=teacher', +'tool/ladaco10/contribute.do', +'tool/ladaco10/moderate.do', +'http://wiki.lamsfoundation.org/display/lamsdocs/ladaco10', +'org.lamsfoundation.lams.tool.daco.ApplicationResources', +'lams-tool-ladaco10.jar', +'/org/lamsfoundation/lams/tool/daco/dacoApplicationContext.xml', +NOW(), +NOW() +) Index: lams_tool_daco/lib/reload_2_0_1/reload-jdom.jar =================================================================== diff -u Binary files differ Index: lams_tool_daco/lib/reload_2_0_1/reload-moonunit.jar =================================================================== diff -u Binary files differ Index: lams_tool_daco/licenses/Jaxen LICENSE.txt =================================================================== diff -u --- lams_tool_daco/licenses/Jaxen LICENSE.txt (revision 0) +++ lams_tool_daco/licenses/Jaxen LICENSE.txt (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,33 @@ +/* + $Id$ + + Copyright 2003-2006 The Werken Company. All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the Jaxen Project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + */ Index: lams_tool_daco/licenses/castor license.txt =================================================================== diff -u --- lams_tool_daco/licenses/castor license.txt (revision 0) +++ lams_tool_daco/licenses/castor license.txt (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,38 @@ +Copyright 2000-2002 (C) Intalio Inc. All Rights Reserved. + +Redistribution and use of this software and associated documentation +("Software"), with or without modification, are permitted provided +that the following conditions are met: + +1. Redistributions of source code must retain copyright statements + and notices. Redistributions must also contain a copy of this + document. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. The name "ExoLab" must not be used to endorse or promote products + derived from this Software without prior written permission of + Intalio Inc. For written permission, please contact info@exolab.org. + +4. Products derived from this Software may not be called "Castor" + nor may "Castor" appear in their names without prior written + permission of Intalio Inc. Exolab, Castor and Intalio are + trademarks of Intalio Inc. + +5. Due credit should be given to the ExoLab Project + (http://www.exolab.org/). + +THIS SOFTWARE IS PROVIDED BY INTALIO AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTALIO OR ITS +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. Index: lams_tool_daco/licenses/jdom licence.txt =================================================================== diff -u --- lams_tool_daco/licenses/jdom licence.txt (revision 0) +++ lams_tool_daco/licenses/jdom licence.txt (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,54 @@ +/*-- + + Copyright (C) 2000-2002 Brett McLaughlin & Jason Hunter. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the disclaimer that follows + these conditions in the documentation and/or other materials + provided with the distribution. + + 3. The name "JDOM" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact license@jdom.org. + + 4. Products derived from this software may not be called "JDOM", nor + may "JDOM" appear in their name, without prior written permission + from the JDOM Project Management (pm@jdom.org). + + In addition, we request (but do not require) that you include in the + end-user documentation provided with the redistribution and/or in the + software itself an acknowledgement equivalent to the following: + "This product includes software developed by the + JDOM Project (http://www.jdom.org/)." + Alternatively, the acknowledgment may be graphical using the logos + available at http://www.jdom.org/images/logos. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + This software consists of voluntary contributions made by many + individuals on behalf of the JDOM Project and was originally + created by Brett McLaughlin and + Jason Hunter . For more information on the + JDOM Project, please see . + + */ + Index: lams_tool_daco/licenses/library_licenses.txt =================================================================== diff -u --- lams_tool_daco/licenses/library_licenses.txt (revision 0) +++ lams_tool_daco/licenses/library_licenses.txt (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,16 @@ +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/ + +Library/Package License + +jaxen-full.jar Jaxen Jar License (The Werken Company) +sax.jar Public Domain +saxpath.jar Jaxen Jar License (The Werken Company) \ No newline at end of file Index: lams_tool_daco/licenses/reload licence.txt =================================================================== diff -u --- lams_tool_daco/licenses/reload licence.txt (revision 0) +++ lams_tool_daco/licenses/reload licence.txt (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,45 @@ +RELOAD Tools and Libraries + +Copyright (c) 2002-2004 Oleg Liber, Bill Olivier, Phillip Beauvoir + +This licence covers: + +The Reload "jdom" library +The Reload "diva" library +The Reload "dweezil" library +The Reload "jdom" library +The Reload "moonunit" library +The Reload "xindice" library +The Reload Editor +The Reload SCORM Player +The Reload Schema Viewer Eclipse Plugin + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Project Management Contact: + +Oleg Liber +Bolton Institute of Higher Education +Deane Road +Bolton BL3 5AB +UK + +e-mail: o.liber@bolton.ac.uk + + +Technical Contact: + +Phillip Beauvoir +Bolton Institute of Higher Education +Deane Road +Bolton BL3 5AB +UK + +e-mail: p.beauvoir@bolton.ac.uk + + +Web: http://www.reload.ac.uk Index: lams_tool_daco/licenses/xerces licence.txt =================================================================== diff -u --- lams_tool_daco/licenses/xerces licence.txt (revision 0) +++ lams_tool_daco/licenses/xerces licence.txt (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,56 @@ +/* + * The Apache Software License, Version 1.1 + * + * + * Copyright (c) 1999-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Xerces" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was + * originally based on software copyright (c) 1999, International + * Business Machines, Inc., http://www.ibm.com. For more + * information on the Apache Software Foundation, please see + * . + */ Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/DacoConstants.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/DacoConstants.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/DacoConstants.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,169 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $Id$ */ +package org.lamsfoundation.lams.tool.daco; + +public class DacoConstants { + public static final String TOOL_SIGNATURE = "ladaco10"; + public static final String DACO_SERVICE = "dacoService"; + public static final String TOOL_CONTENT_HANDLER_NAME = "dacoToolContentHandler"; + + public static final int COMPLETED = 1; + + // daco type; + public static final String QUESTION_TYPE = "questionType"; + public static final short QUESTION_TYPE_TEXTFIELD = 1; + public static final short QUESTION_TYPE_TEXTAREA = 2; + public static final short QUESTION_TYPE_NUMBER = 3; + public static final short QUESTION_TYPE_DATE = 4; + public static final short QUESTION_TYPE_FILE = 5; + public static final short QUESTION_TYPE_IMAGE = 6; + public static final short QUESTION_TYPE_RADIO = 7; + public static final short QUESTION_TYPE_DROPDOWN = 8; + public static final short QUESTION_TYPE_CHECKBOX = 9; + public static final short QUESTION_TYPE_LONGLAT = 10; + + // longitude/latitude maps + public static final String[] LONGLAT_MAPS_LIST = new String[] { "Google Maps", "Google Earth", "Geabios", "Open Street Map", + "Multimap" }; + + // answer options + public static final int INIT_ANSWER_OPTION_COUNT = 3; + public static final int ANSWER_OPTION_MINIMUM_COUNT = 2; + public static final String ANSWER_OPTION_DESC_PREFIX = "answerOptionItemDesc"; + public static final String ANSWER_OPTION_COUNT = "answerOptionCount"; + public static final String ANSWER_OPTION_SELECT = "label.authoring.basic.answeroption.select"; + + // image extensions + public static final String[] IMAGE_EXTENSIONS = new String[] { "GIF", "JPG", "PNG" }; + + // format for the date question + public static final String DATE_FORMAT = "dd-MM-yyyy"; + + // for action forward name + public static final String SUCCESS = "success"; + public static final String ERROR = "error"; + public static final String DEFINE_LATER = "definelater"; + public static final String RUN_OFFLINE = "runOffline"; + + // record operations + public static final String RECORD_OPERATION_ADD = "add"; + public static final String RECORD_OPERATION_EDIT = "edit"; + + // learning views + public static final String LEARNING_VIEW_HORIZONTAL = "horizontal"; + public static final String LEARNING_VIEW_VERTICAL = "vertical"; + // for parameters' name + public static final String PARAM_TOOL_CONTENT_ID = "toolContentID"; + public static final String PARAM_TOOL_SESSION_ID = "toolSessionID"; + public static final String PARAM_FILE_VERSION_ID = "fileVersionId"; + public static final String PARAM_FILE_UUID = "fileUuid"; + public static final String PARAM_QUESTION_INDEX = "questionIndex"; + public static final String PARAM_RECORD_INDEX = "recordIndex"; + public static final String PARAM_DACO_QUESTION_UID = "questionUid"; + public static final String PARAM_RUN_OFFLINE = "runOffline"; + public static final String PARAM_TITLE = "title"; + public static final String PARAM_QUESTION_REQUIRED = "questionRequired"; + public static final String PARAM_LONGLAT_MAPS_SELECTED = "longlatMapsSelected"; + public static final String PARAM_REMOVE_INDEX = "removeIndex"; + + // for request attribute name + public static final String ATTR_LEARNING_CURRENT_TAB = "learningCurrentTab"; + public static final String ATTR_TOOL_CONTENT_ID = "toolContentID"; + public static final String ATTR_TOOL_SESSION_ID = "toolSessionID"; + public static final String ATTR_QUESTION_LIST = "questionList"; + public static final String ATTR_RECORD_LIST = "recordList"; + public static final String ATT_ATTACHMENT_LIST = "instructionAttachmentList"; + public static final String ATTR_DELETED_QUESTION_LIST = "deleteDacoList"; + public static final String ATTR_DELETED_ATTACHMENT_LIST = "deletedAttachmmentList"; + public static final String ATTR_DELETED_QUESTION_ATTACHMENT_LIST = "deletedQuestionAttachmmentList"; + public static final String ATTR_QUESTION_REVIEW_URL = "dacoQuestionReviewUrl"; + public static final String ATTR_DACO = "daco"; + public static final String ATTR_NEXT_ACTIVITY_URL = "nextActivityUrl"; + public static final String ATTR_SUMMARY_LIST = "summaryList"; + public static final String ATTR_USER_LIST = "userList"; + public static final String ATTR_FINISH_LOCK = "finishedLock"; + public static final String ATTR_SESSION_MAP_ID = "sessionMapID"; + public static final String ATTR_DACO_FORM = "dacoForm"; + public static final String ATTR_ADD_QUESTION_TYPE = "addType"; + public static final String ATTR_FILE_TYPE_FLAG = "fileTypeFlag"; + public static final String ATTR_TITLE = "title"; + public static final String ATTR_USER_FINISHED = "userFinished"; + public static final String ATTR_ANSWER_OPTION_LIST = "answerOptionList"; + public static final String ATTR_REFLECTION_ON = "reflectOn"; + public static final String ATTR_REFLECTION_INSTRUCTION = "reflectInstructions"; + public static final String ATTR_REFLECTION_ENTRY = "reflectEntry"; + public static final String ATTR_REFLECT_LIST = "reflectList"; + public static final String ATTR_USER_UID = "userUid"; + public static final String ATTR_RECORD_OPERATION_SUCCESS = "recordOperationSuccess"; + public static final String ATTR_DISPLAYED_RECORD_NUMBER = "displayedRecordNumber"; + public static final String ATTR_LEARNING_VIEW = "learningView"; + + // error message keys + public static final String ERROR_MSG_DESC_BLANK = "error.question.desc.blank"; + public static final String ERROR_MSG_FILE_BLANK = "error.question.file.blank"; + public static final String ERROR_MSG_UPLOAD_FAILED = "error.upload.failed"; + public static final String ERROR_MSG_MAX_BLANK = "error.question.max.blank"; + public static final String ERROR_MSG_MAX_NUMBER_INT = "error.question.max.number.int"; + public static final String ERROR_MSG_MAX_NUMBER_FLOAT = "error.question.max.number.float"; + public static final String ERROR_MSG_MAX_NEGATIVE = "error.question.max.negative"; + public static final String ERROR_MSG_MAX_TOOHIGH = "error.question.max.toohigh"; + public static final String ERROR_MSG_MAX_TOOHIGH_ANSWEROPTION = "error.question.max.toohigh.answeroption"; + public static final String ERROR_MSG_MAX_TOOLOW = "error.question.max.toolow"; + public static final String ERROR_MSG_MIN_BLANK = "error.question.min.blank"; + public static final String ERROR_MSG_MIN_NUMBER_INT = "error.question.min.number.int"; + public static final String ERROR_MSG_MIN_NUMBER_FLOAT = "error.question.min.number.float"; + public static final String ERROR_MSG_MIN_NEGATIVE = "error.question.min.negative"; + public static final String ERROR_MSG_MIN_TOOHIGH = "error.question.min.toohigh"; + public static final String ERROR_MSG_MIN_TOOHIGH_ANSWEROPTION = "error.question.min.toohigh.answeroption"; + public static final String ERROR_MSG_MIN_TOOLOW = "error.question.min.toolow"; + public static final String ERROR_MSG_MIN_TOOHIGH_MAX = "error.question.min.toohigh.max"; + public static final String ERROR_MSG_ANSWEROPTION_REPEAT = "error.question.answeroption.repeat"; + public static final String ERROR_MSG_ANSWEROPTION_NOTENOUGH = "error.question.answeroption.notenough"; + public static final String ERROR_MSG_RECORDLIMIT_MIN_TOOHIGH_MAX = "error.recordlimit.min.toohigh.max"; + + public static final String ERROR_MSG_RECORD_BLANK = "error.record.blank"; + public static final String ERROR_MSG_RECORD_TEXTAREA_LONG = "error.record.textarea.long"; + public static final String ERROR_MSG_RECORD_NUMBER_MIN = "error.record.number.min"; + public static final String ERROR_MSG_RECORD_NUMBER_MAX = "error.record.number.max"; + public static final String ERROR_MSG_RECORD_NUMBER_FLOAT = "error.record.number.float"; + public static final String ERROR_MSG_RECORD_DATE_DAY_BLANK = "error.record.date.day.blank"; + public static final String ERROR_MSG_RECORD_DATE_DAY_INT = "error.record.date.day.int"; + public static final String ERROR_MSG_RECORD_DATE_DAY_LIMIT = "error.record.date.day.limit"; + public static final String ERROR_MSG_RECORD_DATE_MONTH_BLANK = "error.record.date.month.blank"; + public static final String ERROR_MSG_RECORD_DATE_MONTH_INT = "error.record.date.month.int"; + public static final String ERROR_MSG_RECORD_DATE_MONTH_LIMIT = "error.record.date.month.limit"; + public static final String ERROR_MSG_RECORD_DATE_YEAR_BLANK = "error.record.date.year.blank"; + public static final String ERROR_MSG_RECORD_DATE_YEAR_INT = "error.record.date.year.int"; + public static final String ERROR_MSG_RECORD_IMAGE_FORMAT = "error.record.image.format"; + public static final String ERROR_MSG_RECORD_CHECKBOX_MIN = "error.record.checkbox.min"; + public static final String ERROR_MSG_RECORD_CHECKBOX_MAX = "error.record.checkbox.max"; + public static final String ERROR_MSG_RECORD_LONGITUDE_BLANK = "error.record.longlat.longitude.blank"; + public static final String ERROR_MSG_RECORD_LONGITUDE_FLOAT = "error.record.longlat.longitude.float"; + public static final String ERROR_MSG_RECORD_LATITUDE_BLANK = "error.record.longlat.latitude.blank"; + public static final String ERROR_MSG_RECORD_LATITUDE_FLOAT = "error.record.longlat.latitude.float"; + public static final String ERROR_MSG_RECORD_NOTENOUGH = "error.record.notenough"; + + public static final String PAGE_EDITABLE = "isPageEditable"; + public static final String MODE_AUTHOR_SESSION = "author_session"; +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dacoApplicationContext.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dacoApplicationContext.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dacoApplicationContext.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,164 @@ + + + + + + + + + org.lamsfoundation.lams.tool.daco.ApplicationResources + + + + + + + + + + + + org/lamsfoundation/lams/tool/daco/model/DacoUser.hbm.xml + org/lamsfoundation/lams/tool/daco/model/Daco.hbm.xml + org/lamsfoundation/lams/tool/daco/model/DacoQuestion.hbm.xml + org/lamsfoundation/lams/tool/daco/model/DacoQuestionVisitLog.hbm.xml + org/lamsfoundation/lams/tool/daco/model/DacoAttachment.hbm.xml + org/lamsfoundation/lams/tool/daco/model/DacoSession.hbm.xml + org/lamsfoundation/lams/tool/daco/model/DacoAnswer.hbm.xml + org/lamsfoundation/lams/tool/daco/model/DacoAnswerOption.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_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DAO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DAO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DAO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.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_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoAnswerDAO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoAnswerDAO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoAnswerDAO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,16 @@ +package org.lamsfoundation.lams.tool.daco.dao; + +import java.util.List; + +import org.lamsfoundation.lams.tool.daco.model.Daco; +import org.lamsfoundation.lams.tool.daco.model.DacoAnswer; + +public interface DacoAnswerDAO extends DAO { + List> getRecordsByUserUid(Long userUid); + + List getRecord(Long userUid, Integer recordId); + + List> getAnswersByQuestionUid(Long questionUid); + + List> getRecordsByUserUidAndDaco(Long userUid, Daco daco); +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoAnswerOptionDAO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoAnswerOptionDAO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoAnswerOptionDAO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,7 @@ +package org.lamsfoundation.lams.tool.daco.dao; + +import java.util.List; + +public interface DacoAnswerOptionDAO extends DAO { + List getOptionsByQuestionUid(Long questionUid); +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoAttachmentDAO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoAttachmentDAO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoAttachmentDAO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao; + +public interface DacoAttachmentDAO extends DAO { + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoDAO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoDAO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoDAO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao; + +import org.lamsfoundation.lams.tool.daco.model.Daco; + +public interface DacoDAO extends DAO { + + Daco getByContentId(Long contentId); + + Daco getByUid(Long dacoUid); + + void delete(Daco daco); + +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoQuestionDAO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoQuestionDAO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoQuestionDAO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao; + +import java.util.List; + +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; + +public interface DacoQuestionDAO extends DAO { + + /** + * Return all daco questions which is uploaded by author in given dacoUid. + * + * @param dacoUid + * @return + */ + List getAuthoringQuestions(Long dacoUid); + + DacoQuestion getByUid(Long dacoQuestionUid); +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoQuestionVisitDAO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoQuestionVisitDAO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoQuestionVisitDAO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,47 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao; + +import java.util.List; +import java.util.Map; + +import org.lamsfoundation.lams.tool.daco.model.DacoQuestionVisitLog; + +public interface DacoQuestionVisitDAO extends DAO { + + + public DacoQuestionVisitLog getDacoQuestionLog(Long questionUid,Long userId); + + public int getUserViewLogCount(Long sessionId, Long userUid); + /** + * Return list which contains key pair which key is daco question uid, value is number view. + * + * @param contentId + * @return + */ + public Map getSummary(Long contentId); + + public List getDacoQuestionLogBySession(Long sessionId,Long questionUid); + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoSessionDAO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoSessionDAO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoSessionDAO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao; + +import java.util.List; + +import org.lamsfoundation.lams.tool.daco.model.DacoSession; + +public interface DacoSessionDAO extends DAO { + + DacoSession getSessionBySessionId(Long sessionId); + + List getByContentId(Long toolContentId); + + void delete(DacoSession session); + + void deleteBySessionId(Long toolSessionId); + + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoUserDAO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoUserDAO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/DacoUserDAO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao; + +import java.util.List; + +import org.lamsfoundation.lams.tool.daco.model.DacoUser; + +public interface DacoUserDAO extends DAO { + + DacoUser getUserByUserIDAndSessionID(Long userID, Long sessionId); + + DacoUser getUserByUserIDAndContentID(Long userId, Long contentId); + + List getBySessionID(Long sessionId); +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/BaseDAOHibernate.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/BaseDAOHibernate.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/BaseDAOHibernate.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.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.daco.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_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoAnswerDAOHibernate.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoAnswerDAOHibernate.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoAnswerDAOHibernate.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,94 @@ +package org.lamsfoundation.lams.tool.daco.dao.hibernate; + +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import org.lamsfoundation.lams.tool.daco.dao.DacoAnswerDAO; +import org.lamsfoundation.lams.tool.daco.model.Daco; +import org.lamsfoundation.lams.tool.daco.model.DacoAnswer; +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; + +public class DacoAnswerDAOHibernate extends BaseDAOHibernate implements DacoAnswerDAO { + private static final String FIND_BY_USER_UID = "from " + DacoAnswer.class.getName() + + " as p where p.user.uid=? order by record_id,question_uid"; + private static final String FIND_BY_QUESTION_UID = "from " + DacoAnswer.class.getName() + + " as p where p.question.uid=? order by user.uid,record_id"; + + private static final String FIND_BY_USER_UID_AND_DACO = "from " + DacoAnswer.class.getName() + + " as p where p.user.uid=? and p.question.uid in (?) order by record_id,question_uid"; + + public List> getRecordsByUserUid(Long userUid) { + List list = getHibernateTemplate().find(DacoAnswerDAOHibernate.FIND_BY_USER_UID, userUid); + if (list == null || list.size() == 0) { + return null; + } + int recordId = 1; + List> result = new LinkedList>(); + List record = new LinkedList(); + for (DacoAnswer answer : list) { + if (recordId != answer.getRecordId()) { + result.add(record); + record = new LinkedList(); + } + record.add(answer); + } + + result.add(record); + return result; + } + + public List getRecord(Long userUid, Integer recordId) { + List list = getRecordsByUserUid(userUid); + if (list == null) { + return null; + } + return (List) list.get(recordId); + } + + public List> getAnswersByQuestionUid(Long questionUid) { + List list = getHibernateTemplate().find(DacoAnswerDAOHibernate.FIND_BY_QUESTION_UID, questionUid); + if (list == null || list.size() == 0) { + return null; + } + int userUid = 1; + List> result = new LinkedList>(); + List user = new LinkedList(); + for (DacoAnswer answer : list) { + if (userUid != answer.getUser().getUid()) { + result.add(user); + user = new LinkedList(); + } + user.add(answer); + } + result.add(user); + return result; + } + + public List> getRecordsByUserUidAndDaco(Long userUid, Daco daco) { + StringBuilder set = new StringBuilder(); + List> result = new LinkedList>(); + for (DacoQuestion question : (Set) daco.getDacoQuestions()) { + set.append(question.getUid()).append(','); + } + set.deleteCharAt(set.length() - 1); + List list = getHibernateTemplate().find(DacoAnswerDAOHibernate.FIND_BY_USER_UID_AND_DACO, + new Object[] { userUid, set.toString() }); + if (list != null && list.size() > 0) { + int recordNumber = -1; + List record = null; + for (DacoAnswer answer : list) { + if (answer.getRecordId() != recordNumber) { + if (record != null) { + result.add(record); + } + record = new LinkedList(); + recordNumber = answer.getRecordId(); + } + record.add(answer); + } + result.add(record); + } + return result; + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoAnswerOptionDAOHibernate.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoAnswerOptionDAOHibernate.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoAnswerOptionDAOHibernate.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,17 @@ +package org.lamsfoundation.lams.tool.daco.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.tool.daco.dao.DacoAnswerOptionDAO; +import org.lamsfoundation.lams.tool.daco.model.DacoAnswerOption; + +public class DacoAnswerOptionDAOHibernate extends BaseDAOHibernate implements + DacoAnswerOptionDAO { + private static final String FIND_BY_QUESTION_UID = "from " + + DacoAnswerOption.class.getName() + + " as p where p.question_uid=? order by sequence_num"; + + public List getOptionsByQuestionUid(Long questionUid) { + return getHibernateTemplate().find(FIND_BY_QUESTION_UID, questionUid); + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoAttachmentDAOHibernate.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoAttachmentDAOHibernate.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoAttachmentDAOHibernate.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao.hibernate; + +import org.lamsfoundation.lams.tool.daco.dao.DacoAttachmentDAO; + +public class DacoAttachmentDAOHibernate extends BaseDAOHibernate implements DacoAttachmentDAO{ + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoDAOHibernate.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoDAOHibernate.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoDAOHibernate.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.tool.daco.dao.DacoDAO; +import org.lamsfoundation.lams.tool.daco.model.Daco; + +/** + * + * @author Steve.Ni + * + * @version $Revision$ + */ +public class DacoDAOHibernate extends BaseDAOHibernate implements DacoDAO{ + private static final String GET_QUESTION_BY_CONTENTID = "from "+Daco.class.getName()+" as r where r.contentId=?"; + + public Daco getByContentId(Long contentId) { + List list = getHibernateTemplate().find(GET_QUESTION_BY_CONTENTID,contentId); + if(list.size() > 0) + return (Daco) list.get(0); + else + return null; + } + + public Daco getByUid(Long dacoUid) { + return (Daco) getObject(Daco.class,dacoUid); + } + + public void delete(Daco daco) { + this.getHibernateTemplate().delete(daco); + } + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoQuestionDAOHibernate.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoQuestionDAOHibernate.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoQuestionDAOHibernate.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,44 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.tool.daco.dao.DacoQuestionDAO; +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; + +public class DacoQuestionDAOHibernate extends BaseDAOHibernate implements DacoQuestionDAO{ + + private static final String FIND_AUTHORING_QUESTIONS = "from " + DacoQuestion.class.getName() + " where content_uid = ? order by create_date asc"; + + public List getAuthoringQuestions(Long dacoUid) { + + return this.getHibernateTemplate().find(FIND_AUTHORING_QUESTIONS,dacoUid); + } + + public DacoQuestion getByUid(Long dacoQuestionUid) { + return (DacoQuestion) this.getObject(DacoQuestion.class,dacoQuestionUid); + } + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoQuestionVisitDAOHibernate.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoQuestionVisitDAOHibernate.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoQuestionVisitDAOHibernate.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,88 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao.hibernate; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.lamsfoundation.lams.tool.daco.dao.DacoQuestionVisitDAO; +import org.lamsfoundation.lams.tool.daco.model.Daco; +import org.lamsfoundation.lams.tool.daco.model.DacoQuestionVisitLog; +import org.lamsfoundation.lams.tool.daco.model.DacoSession; + +public class DacoQuestionVisitDAOHibernate extends BaseDAOHibernate implements DacoQuestionVisitDAO{ + + private static final String FIND_BY_QUESTION_AND_USER = "from " + DacoQuestionVisitLog.class.getName() + + " as r where r.user.userId = ? and r.dacoQuestion.uid=?"; + + private static final String FIND_BY_QUESTION_BYSESSION = "from " + DacoQuestionVisitLog.class.getName() + + " as r where r.sessionId = ? and r.dacoQuestion.uid=?"; + + private static final String FIND_VIEW_COUNT_BY_USER = "select count(*) from " + DacoQuestionVisitLog.class.getName() + + " as r where r.sessionId=? and r.user.userId =?"; + + private static final String FIND_SUMMARY = "select v.dacoQuestion.uid, count(v.dacoQuestion) from " + + DacoQuestionVisitLog.class.getName() + " as v , " + + DacoSession.class.getName() + " as s, " + + Daco.class.getName() + " as r " + +" where v.sessionId = s.sessionId " + +" and s.daco.uid = r.uid " + +" and r.contentId =? " + +" group by v.sessionId, v.dacoQuestion.uid "; + + public DacoQuestionVisitLog getDacoQuestionLog(Long questionUid,Long userId){ + List list = getHibernateTemplate().find(FIND_BY_QUESTION_AND_USER,new Object[]{userId,questionUid}); + if(list == null || list.size() ==0) + return null; + return (DacoQuestionVisitLog) list.get(0); + } + + public int getUserViewLogCount(Long toolSessionId ,Long userUid) { + List list = getHibernateTemplate().find(FIND_VIEW_COUNT_BY_USER,new Object[]{toolSessionId, userUid}); + if(list == null || list.size() ==0) + return 0; + return ((Number) list.get(0)).intValue(); + } + + public Map getSummary(Long contentId) { + + // Note: Hibernate 3.1 query.uniqueResult() returns Integer, Hibernate 3.2 query.uniqueResult() returns Long + List result = getHibernateTemplate().find(FIND_SUMMARY,contentId); + Map summaryList = new HashMap (result.size()); + for(Object[] list : result){ + if ( list[1] != null ) { + summaryList.put((Long)list[0],new Integer(((Number)list[1]).intValue())); + } + } + return summaryList; + + } + + public List getDacoQuestionLogBySession(Long sessionId, Long questionUid) { + + return getHibernateTemplate().find(FIND_BY_QUESTION_BYSESSION,new Object[]{sessionId,questionUid}); + } + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoSessionDAOHibernate.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoSessionDAOHibernate.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoSessionDAOHibernate.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.tool.daco.dao.DacoSessionDAO; +import org.lamsfoundation.lams.tool.daco.model.DacoSession; + + +public class DacoSessionDAOHibernate extends BaseDAOHibernate implements DacoSessionDAO{ + + private static final String FIND_BY_SESSION_ID = "from " + DacoSession.class.getName() + " as p where p.sessionId=?"; + private static final String FIND_BY_CONTENT_ID = "from " + DacoSession.class.getName() + " as p where p.daco.contentId=?"; + + public DacoSession getSessionBySessionId(Long sessionId) { + List list = getHibernateTemplate().find(FIND_BY_SESSION_ID,sessionId); + if(list == null || list.size() == 0) + return null; + return (DacoSession) list.get(0); + } + public List getByContentId(Long toolContentId) { + return getHibernateTemplate().find(FIND_BY_CONTENT_ID,toolContentId); + } + + public void delete(DacoSession session) { + this.getHibernateTemplate().delete(session); + } + public void deleteBySessionId(Long toolSessionId) { + this.removeObject(DacoSession.class,toolSessionId); + } + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoUserDAOHibernate.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoUserDAOHibernate.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dao/hibernate/DacoUserDAOHibernate.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.tool.daco.dao.DacoUserDAO; +import org.lamsfoundation.lams.tool.daco.model.DacoUser; + + +public class DacoUserDAOHibernate extends BaseDAOHibernate implements DacoUserDAO{ + + private static final String FIND_BY_USER_ID_CONTENT_ID = "from " + DacoUser.class.getName() + " as u where u.userId =? and u.daco.contentId=?"; + private static final String FIND_BY_USER_ID_SESSION_ID = "from " + DacoUser.class.getName() + " as u where u.userId =? and u.session.sessionId=?"; + private static final String FIND_BY_SESSION_ID = "from " + DacoUser.class.getName() + " as u where u.session.sessionId=?"; + + public DacoUser 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 (DacoUser) list.get(0); + } + + public DacoUser 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 (DacoUser) list.get(0); + } + + public List getBySessionID(Long sessionId) { + return this.getHibernateTemplate().find(FIND_BY_SESSION_ID,sessionId); + } + + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dto/ReflectDTO.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dto/ReflectDTO.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dto/ReflectDTO.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,67 @@ +package org.lamsfoundation.lams.tool.daco.dto; + +import org.lamsfoundation.lams.tool.daco.model.DacoUser; + +/** + * + * @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(DacoUser 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_daco/src/java/org/lamsfoundation/lams/tool/daco/dto/Summary.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dto/Summary.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/dto/Summary.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,203 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.daco.dto; + +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; + +/** + * List contains following element:
+ * + *
  • session_id
  • + *
  • session_name
  • + *
  • DacoQuestion.uid
  • + *
  • DacoQuestion.question_type
  • + *
  • DacoQuestion.create_by_author
  • + *
  • DacoQuestion.is_hide
  • + *
  • DacoQuestion.title
  • + *
  • User.login_name
  • + *
  • count(question_uid)
  • + * + * @author Steve.Ni + * + * @version $Revision$ + */ +public class Summary { + + private Long sessionId; + private String sessionName; + private Long questionUid; + private short questionType; + private boolean questionCreateByAuthor; + private boolean questionHide; + private String questionTitle; + private String username; + private int viewNumber; + + // following is used for export portfolio programs: + private String attachmentLocalUrl; + + // true: initial group question, false, belong to some group. + private boolean isInitGroup; + + public Summary() { + } + + /** + * Contruction method for monitoring summary function. + * + * Don't not set isInitGroup and viewNumber fields + * + * @param sessionName + * @param question + * @param isInitGroup + */ + public Summary(Long sessionId, String sessionName, DacoQuestion question) { + this.sessionId = sessionId; + this.sessionName = sessionName; + if (question != null) { + questionUid = question.getUid(); + questionType = question.getType(); + questionCreateByAuthor = question.isCreateByAuthor(); + questionHide = question.isHide(); + username = question.getCreateBy() == null ? "" : question.getCreateBy().getLoginName(); + } + else { + questionUid = new Long(-1); + } + } + + /** + * Contruction method for export profolio function. + * + * Don't not set sessionId and viewNumber fields + * + * @param sessionName + * @param question + * @param isInitGroup + */ + public Summary(String sessionName, DacoQuestion question, boolean isInitGroup) { + this.sessionName = sessionName; + if (question != null) { + questionUid = question.getUid(); + questionType = question.getType(); + questionCreateByAuthor = question.isCreateByAuthor(); + questionHide = question.isHide(); + username = question.getCreateBy() == null ? "" : question.getCreateBy().getLoginName(); + } + else { + questionUid = new Long(-1); + } + this.isInitGroup = isInitGroup; + } + + public boolean isQuestionCreateByAuthor() { + return questionCreateByAuthor; + } + + public void setQuestionCreateByAuthor(boolean questionCreateByAuthor) { + this.questionCreateByAuthor = questionCreateByAuthor; + } + + public boolean isQuestionHide() { + return questionHide; + } + + public void setQuestionHide(boolean questionHide) { + this.questionHide = questionHide; + } + + public String getQuestionTitle() { + return questionTitle; + } + + public void setQuestionTitle(String questionTitle) { + this.questionTitle = questionTitle; + } + + public short getQuestionType() { + return questionType; + } + + public void setQuestionType(short questionType) { + this.questionType = questionType; + } + + public Long getQuestionUid() { + return questionUid; + } + + public void setQuestionUid(Long questionUid) { + this.questionUid = questionUid; + } + + public Long getSessionId() { + return sessionId; + } + + public void setSessionId(Long sessionId) { + this.sessionId = sessionId; + } + + public String getSessionName() { + return sessionName; + } + + public void setSessionName(String sessionName) { + this.sessionName = sessionName; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public int getViewNumber() { + return viewNumber; + } + + public void setViewNumber(int viewNumber) { + this.viewNumber = viewNumber; + } + + public boolean isInitGroup() { + return isInitGroup; + } + + public void setInitGroup(boolean isInitGroup) { + this.isInitGroup = isInitGroup; + } + + public String getAttachmentLocalUrl() { + return attachmentLocalUrl; + } + + public void setAttachmentLocalUrl(String attachmentLocalUrl) { + this.attachmentLocalUrl = attachmentLocalUrl; + } + +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/Daco.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/Daco.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/Daco.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/Daco.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/Daco.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/Daco.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,518 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $Id$ */ +package org.lamsfoundation.lams.tool.daco.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +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.client.IToolContentHandler; +import org.lamsfoundation.lams.tool.daco.util.DacoToolContentHandler; + +/** + * Daco + * + * @author Dapeng Ni + * + * @hibernate.class table="tl_ladaco10_contents" + * + */ +public class Daco implements Cloneable { + + private static final Logger log = Logger.getLogger(Daco.class); + + // key + private Long uid; + // tool contentID + private Long contentId; + private String title; + private String instructions; + // advance + private boolean runOffline; + private boolean lockWhenFinished; + private boolean defineLater; + private boolean contentInUse; + private Short minRecords; + private Short maxRecords; + + // instructions + private String onlineInstructions; + private String offlineInstructions; + private Set attachments; + + // general infomation + private Date created; + private Date updated; + private DacoUser createdBy; + + // daco Questions + private Set dacoQuestions; + + private boolean reflectOnActivity; + private String reflectInstructions; + + // *************** NON Persist Fields ******************** + private IToolContentHandler toolContentHandler; + + private List onlineFileList; + private List offlineFileList; + + /** + * Default contruction method. + * + */ + public Daco() { + attachments = new HashSet(); + dacoQuestions = new HashSet(); + } + + // ********************************************************** + // Function method for Daco + // ********************************************************** + public static Daco newInstance(Daco defaultContent, Long contentId, DacoToolContentHandler dacoToolContentHandler) { + Daco toContent = new Daco(); + defaultContent.toolContentHandler = dacoToolContentHandler; + toContent = (Daco) defaultContent.clone(); + toContent.setContentId(contentId); + + // reset user info as well + if (toContent.getCreatedBy() != null) { + toContent.getCreatedBy().setDaco(toContent); + Set questions = toContent.getDacoQuestions(); + for (DacoQuestion question : questions) { + question.setCreateBy(toContent.getCreatedBy()); + } + } + return toContent; + } + + @Override + public Object clone() { + + Daco daco = null; + try { + daco = (Daco) super.clone(); + daco.setUid(null); + if (dacoQuestions != null) { + Iterator iter = dacoQuestions.iterator(); + Set set = new LinkedHashSet(); + while (iter.hasNext()) { + DacoQuestion question = (DacoQuestion) iter.next(); + DacoQuestion newQuestion = (DacoQuestion) question.clone(); + // just clone old file without duplicate it in repository + set.add(newQuestion); + } + daco.dacoQuestions = set; + } + // clone attachment + if (attachments != null) { + Iterator iter = attachments.iterator(); + Set set = new LinkedHashSet(); + while (iter.hasNext()) { + DacoAttachment file = (DacoAttachment) iter.next(); + DacoAttachment newFile = (DacoAttachment) file.clone(); + // just clone old file without duplicate it in repository + + set.add(newFile); + } + daco.attachments = set; + } + // clone ReourceUser as well + if (createdBy != null) { + daco.setCreatedBy((DacoUser) createdBy.clone()); + } + } + catch (CloneNotSupportedException e) { + Daco.log.error("When clone " + Daco.class + " failed"); + } + + return daco; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Daco)) { + return false; + } + + final Daco genericEntity = (Daco) o; + + return new EqualsBuilder().append(uid, genericEntity.uid).append(title, genericEntity.title).append(instructions, + genericEntity.instructions).append(onlineInstructions, genericEntity.onlineInstructions).append( + offlineInstructions, genericEntity.offlineInstructions).append(created, genericEntity.created).append(updated, + genericEntity.updated).append(createdBy, genericEntity.createdBy).isEquals(); + } + + @Override + 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 (DacoAttachment 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 daco. + * + * @hibernate.many-to-one cascade="save-update" column="create_by" + * + */ + public DacoUser getCreatedBy() { + return createdBy; + } + + /** + * @param createdBy + * The userid of the user who created this Share daco. + */ + public void setCreatedBy(DacoUser 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) { + 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 daco 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="content_uid" + * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.daco.model.DacoAttachment" + * + * @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="uid asc" + * @hibernate.collection-key column="content_uid" + * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.daco.model.DacoQuestion" + * + * @return + */ + public Set getDacoQuestions() { + return dacoQuestions; + } + + public void setDacoQuestions(Set dacoQuestions) { + this.dacoQuestions = dacoQuestions; + } + + /** + * @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; + } + + /** + * @return Returns the instructions set by the teacher. + * + * @hibernate.property column="min_records" + */ + public Short getMinRecords() { + return minRecords; + } + + public void setMinRecords(Short minRecords) { + this.minRecords = minRecords; + } + + /** + * @return Returns the instructions set by the teacher. + * + * @hibernate.property column="max_records" + */ + public Short getMaxRecords() { + return maxRecords; + } + + public void setMaxRecords(Short maxRecords) { + this.maxRecords = maxRecords; + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswer.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswer.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswer.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswer.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswer.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswer.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,180 @@ +/**************************************************************** + * Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +package org.lamsfoundation.lams.tool.daco.model; + +import org.apache.log4j.Logger; + +/** + * DacoAnswer + * + * @author Marcin Cieslak + * + * @hibernate.class table="tl_ladaco10_answers" + * + */ +public class DacoAnswer implements Cloneable { + private static final Logger log = Logger.getLogger(DacoQuestion.class); + + private Long uid; + + private DacoUser user; + + private Integer recordId; + + private String answer; + + private DacoQuestion question; + + private Long fileUuid; + + private Long fileVersionId; + + private String fileName; + + private String fileType; + + @Override + public Object clone() { + DacoAnswer cloned = null; + try { + cloned = (DacoAnswer) super.clone(); + cloned.setUid(null); + } + catch (CloneNotSupportedException e) { + DacoAnswer.log.error("Cloning " + DacoQuestion.class + " failed"); + } + + return cloned; + } + + // ********************************************************** + // Get/Set methods + // ********************************************************** + + /** + * @hibernate.id generator-class="native" type="java.lang.Long" column="uid" + * @return Returns the answer ID. + */ + public Long getUid() { + return uid; + } + + public void setUid(Long uuid) { + uid = uuid; + } + + /** + * @hibernate.many-to-one column="user_uid" cascade="none" + * @return + */ + public DacoUser getUser() { + return user; + } + + public void setUser(DacoUser user) { + this.user = user; + } + + /** + * @hibernate.property column="record_id" + * @return Returns the record ID. + */ + public Integer getRecordId() { + return recordId; + } + + public void setRecordId(Integer recordId) { + this.recordId = recordId; + } + + /** + * @hibernate.property column="answer" + * @return Returns the answer. + */ + public String getAnswer() { + return answer; + } + + public void setAnswer(String answer) { + this.answer = answer; + } + + /** + * @hibernate.many-to-one column="question_uid" cascade="none" + * @return + */ + public DacoQuestion getQuestion() { + return question; + } + + public void setQuestion(DacoQuestion question) { + this.question = question; + } + + /** + * @hibernate.property column="file_uuid" + * + * @return + */ + public Long getFileUuid() { + return fileUuid; + } + + public void setFileUuid(Long crUuid) { + fileUuid = crUuid; + } + + /** + * @hibernate.property column="file_version_id" + * @return + */ + public Long getFileVersionId() { + return fileVersionId; + } + + public void setFileVersionId(Long crVersionId) { + fileVersionId = crVersionId; + } + + /** + * @hibernate.property column="file_type" + */ + public String getFileType() { + return fileType; + } + + public void setFileType(String type) { + fileType = type; + } + + /** + * @hibernate.property column="file_name" + */ + public String getFileName() { + return fileName; + } + + public void setFileName(String name) { + fileName = name; + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswerOption.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswerOption.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswerOption.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswerOption.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswerOption.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAnswerOption.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,95 @@ +/**************************************************************** + * Copyright (C) 2008 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +package org.lamsfoundation.lams.tool.daco.model; + +import org.apache.log4j.Logger; + +/** + * DacoAnswerOption + * + * @author Marcin Cieslak + * + * @hibernate.class table="tl_ladaco10_answer_options" + * + */ +public class DacoAnswerOption implements Cloneable { + private static final Logger log = Logger.getLogger(DacoQuestion.class); + + private Long uid; + + private Integer sequenceNumber; + + private String answerOption; + + // ********************************************************** + // Get/Set methods + // ********************************************************** + + /** + * @hibernate.id generator-class="native" type="java.lang.Long" column="uid" + * @return Returns the answer ID. + */ + public Long getUid() { + return uid; + } + + public void setUid(Long uuid) { + this.uid = uuid; + } + + /** + * @hibernate.property column="sequence_num" + * @return Returns the sequence number. + */ + public Integer getSequenceNumber() { + return sequenceNumber; + } + + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * @hibernate.property column="answer_option" + * @return Returns the possible answer. + */ + public String getAnswerOption() { + return answerOption; + } + + public void setAnswerOption(String answerOption) { + this.answerOption = answerOption; + } + + public Object clone() { + Object obj = null; + try { + obj = super.clone(); + ((DacoAnswerOption) obj).setUid(null); + } catch (CloneNotSupportedException e) { + log.error("When clone " + DacoAnswerOption.class + " failed"); + } + + return obj; + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAttachment.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAttachment.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAttachment.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAttachment.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAttachment.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoAttachment.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.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 Daco. + * + * + * @hibernate.class table="tl_ladaco10_attachment" + * + */ +public class DacoAttachment implements Cloneable{ + private static final Logger log = Logger.getLogger(DacoAttachment.class); + + private Long uid; + private Long fileUuid; + private Long fileVersionId; + private String fileType; + private String fileName; + private Date created; + + //Default contruction method + public DacoAttachment(){ + + } +// ********************************************************** + // Function method for Attachment +// ********************************************************** + public Object clone(){ + Object obj = null; + try { + obj = super.clone(); + ((DacoAttachment)obj).setUid(null); + } catch (CloneNotSupportedException e) { + log.error("When clone " + DacoAttachment.class + " failed"); + } + + return obj; + } + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof DacoAttachment)) + return false; + + final DacoAttachment genericEntity = (DacoAttachment) 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_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoItemVisitLog.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoItemVisitLog.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoItemVisitLog.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoOption.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoOption.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoOption.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestion.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestion.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestion.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestion.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestion.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestion.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,278 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.model; + +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.apache.log4j.Logger; + +/** + * DacoQuestion + * + * @author Marcin Cieslak + * + * @hibernate.class table="tl_ladaco10_questions" + * + */ +public class DacoQuestion implements Cloneable { + private static final Logger log = Logger.getLogger(DacoQuestion.class); + + private Long uid; + + private short type; + + private Float min; + + private Float max; + + private Short digitsDecimal; + + private Short summary; + + private String description; + + private String initialQuestion; + + private String organizationXml; + + private Set answerOptions; + + private boolean isHide; + private boolean isCreateByAuthor; + private boolean isRequired; + + private Date createDate; + private DacoUser createBy; + + @Override + public Object clone() { + DacoQuestion obj = null; + try { + obj = (DacoQuestion) super.clone(); + // clone attachment + if (answerOptions != null) { + Iterator iter = answerOptions.iterator(); + Set set = new HashSet(); + while (iter.hasNext()) { + DacoAnswerOption answerOption = (DacoAnswerOption) iter.next(); + DacoAnswerOption newAnswerOption = (DacoAnswerOption) answerOption.clone(); + set.add(newAnswerOption); + } + obj.answerOptions = set; + } + obj.setUid(null); + // clone ReourceUser as well + if (createBy != null) { + obj.setCreateBy((DacoUser) createBy.clone()); + } + + } + catch (CloneNotSupportedException e) { + DacoQuestion.log.error("When clone " + DacoQuestion.class + " failed"); + } + + return obj; + } + + // ********************************************************** + // Get/Set methods + // ********************************************************** + /** + * @hibernate.id generator-class="native" 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) { + uid = userID; + } + + /** + * @hibernate.property column="description" + * @return + */ + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * @hibernate.property column="organization_xml" length="65535" + * @return + */ + public String getOrganizationXml() { + return organizationXml; + } + + public void setOrganizationXml(String organizationXml) { + this.organizationXml = organizationXml; + } + + /** + * @hibernate.many-to-one cascade="none" column="create_by" + * + * @return + */ + public DacoUser getCreateBy() { + return createBy; + } + + public void setCreateBy(DacoUser 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="create_by_author" + * @return + */ + public boolean isCreateByAuthor() { + return isCreateByAuthor; + } + + public void setCreateByAuthor(boolean isCreateByAuthor) { + this.isCreateByAuthor = isCreateByAuthor; + } + + /** + * @hibernate.property column="is_hide" + * @return + */ + public boolean isHide() { + return isHide; + } + + public void setHide(boolean isHide) { + this.isHide = isHide; + } + + /** + * @hibernate.property column="is_required" + * @return + */ + public boolean isRequired() { + return isRequired; + } + + public void setRequired(boolean isRequired) { + this.isRequired = isRequired; + } + + /** + * @hibernate.property column="question_type" + * @return + */ + public short getType() { + return type; + } + + public void setType(short type) { + this.type = type; + } + + /** + * @hibernate.property column="min_constraint" + * @return + */ + public Float getMin() { + return min; + } + + public void setMin(Float min) { + this.min = min; + } + + /** + * @hibernate.property column="max_constraint" + * @return + */ + public Float getMax() { + return max; + } + + public void setMax(Float max) { + this.max = max; + } + + /** + * @hibernate.property column="digits_decimal" + * @return + */ + public Short getDigitsDecimal() { + return digitsDecimal; + } + + public void setDigitsDecimal(Short digitsDecimal) { + this.digitsDecimal = digitsDecimal; + } + + /** + * @hibernate.property column="summary" + * @return + */ + public Short getSummary() { + return summary; + } + + public void setSummary(Short summary) { + this.summary = summary; + } + + /** + * @hibernate.set lazy="false" cascade="all-delete-orphan" inverse="false" order-by="sequence_num asc" + * @hibernate.collection-key column="question_uid" + * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.daco.model.DacoAnswerOption" + * @return + */ + public Set getAnswerOptions() { + return answerOptions; + } + + public void setAnswerOptions(Set options) { + answerOptions = options; + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestionVisitLog.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestionVisitLog.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestionVisitLog.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestionVisitLog.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestionVisitLog.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoQuestionVisitLog.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,111 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.daco.model; + +import java.util.Date; +/** + * Daco + * @author Dapeng Ni + * + * @hibernate.class table="tl_ladaco10_question_log" + * + */ +public class DacoQuestionVisitLog { + + private Long uid; + private DacoUser user; + private DacoQuestion dacoQuestion; + private boolean complete; + private Date accessDate; + private Long sessionId; + + /** + * @hibernate.property column="access_date" + * @return + */ + public Date getAccessDate() { + return accessDate; + } + public void setAccessDate(Date accessDate) { + this.accessDate = accessDate; + } + /** + * @hibernate.many-to-one column="question_uid" + * cascade="none" + * @return + */ + public DacoQuestion getDacoQuestion() { + return dacoQuestion; + } + public void setDacoQuestion(DacoQuestion question) { + this.dacoQuestion = question; + } + + /** + * @hibernate.id generator-class="native" 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 DacoUser getUser() { + return user; + } + public void setUser(DacoUser user) { + this.user = user; + } + /** + * @hibernate.property column="complete" + * @return + */ + public boolean isComplete() { + return complete; + } + public void setComplete(boolean complete) { + this.complete = complete; + } + /** + * @hibernate.property column="session_id" + * @return + */ + public Long getSessionId() { + return sessionId; + } + public void setSessionId(Long sessionId) { + this.sessionId = sessionId; + } + + + + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoSession.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoSession.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoSession.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoSession.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoSession.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoSession.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,158 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.model; + +import java.util.Date; +import java.util.Set; + +import org.apache.log4j.Logger; + +/** + * Daco + * @author Dapeng Ni + * + * @hibernate.class table="tl_ladaco10_session" + * + */ +public class DacoSession{ + + private static Logger log = Logger.getLogger(DacoSession.class); + + private Long uid; + private Long sessionId; + private String sessionName; + private Daco daco; + private Date sessionStartDate; + private Date sessionEndDate; + //finish or not + private int status; + //daco Questions + private Set dacoQuestions; + + +// ********************************************************** + // Get/Set methods +// ********************************************************** + /** + * @hibernate.id generator-class="native" 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.property + * @return + */ + public int getStatus() { + return status; + } + public void setStatus(int status) { + this.status = status; + } + + /** + * @hibernate.many-to-one column="content_uid" + * cascade="none" + * @return + */ + public Daco getDaco() { + return daco; + } + public void setDaco(Daco daco) { + this.daco = daco; + } + /** + * @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.daco.model.DacoQuestion" + * + * @return + */ + public Set getDacoQuestions() { + return dacoQuestions; + } + public void setDacoQuestions(Set dacoQuestions) { + this.dacoQuestions= dacoQuestions; + } + + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoUser.hbm.xml =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoUser.hbm.xml (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoUser.hbm.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoUser.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoUser.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/model/DacoUser.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.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; +/** + * Daco + * @author Dapeng Ni + * + * @hibernate.class table="tl_ladaco10_user" + * + */ +public class DacoUser implements Cloneable{ + private static final long serialVersionUID = -7043502180037866257L; + private static Logger log = Logger.getLogger(DacoUser.class); + + private Long uid; + private Long userId; + private String firstName; + private String lastName; + private String loginName; + private boolean sessionFinished; + + private DacoSession session; + private Daco daco; + + //=============== NON Persisit value: for display use =========== + //the user access some reousrce question date time. Use in monitoring summary page + private Date accessDate; + + public DacoUser(){ + } + public DacoUser(UserDTO user, DacoSession session){ + this.userId = new Long(user.getUserID().intValue()); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.loginName = user.getLogin(); + this.session = session; + this.daco = null; + this.sessionFinished = false; + } + public DacoUser(UserDTO user, Daco content){ + this.userId = new Long(user.getUserID().intValue()); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.loginName = user.getLogin(); + this.session = null; + this.daco = content; + this.sessionFinished = false; + } + /** + * Clone method from java.lang.Object + */ + public Object clone(){ + + DacoUser user = null; + try{ + user = (DacoUser) super.clone(); + user.setUid(null); + //never clone session + user.setSession(null); + } catch (CloneNotSupportedException e) { + log.error("When clone " + DacoUser.class + " failed"); + } + + return user; + } +// ********************************************************** + // Get/Set methods +// ********************************************************** + /** + * @hibernate.id generator-class="native" 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 DacoSession getSession() { + return session; + } + + public void setSession(DacoSession session) { + this.session = session; + } + /** + * @hibernate.many-to-one column="content_uid" + * cascade="none" + * @return + */ + public Daco getDaco() { + return daco; + } + public void setDaco(Daco content) { + this.daco = 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 DacoUser)) + return false; + + final DacoUser user = (DacoUser) 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_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoApplicationException.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoApplicationException.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoApplicationException.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.service; + +public class DacoApplicationException extends Exception{ + + public DacoApplicationException() { + super(); + + } + + public DacoApplicationException(String message, Throwable cause) { + super(message, cause); + + } + + public DacoApplicationException(String message) { + super(message); + + } + + public DacoApplicationException(Throwable cause) { + super(cause); + + } + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,1028 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.service; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.TreeSet; + +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.client.IToolContentHandler; +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.ToolContentManager; +import org.lamsfoundation.lams.tool.ToolOutput; +import org.lamsfoundation.lams.tool.ToolOutputDefinition; +import org.lamsfoundation.lams.tool.ToolSessionExportOutputData; +import org.lamsfoundation.lams.tool.ToolSessionManager; +import org.lamsfoundation.lams.tool.daco.DacoConstants; +import org.lamsfoundation.lams.tool.daco.dao.DacoAnswerDAO; +import org.lamsfoundation.lams.tool.daco.dao.DacoAnswerOptionDAO; +import org.lamsfoundation.lams.tool.daco.dao.DacoAttachmentDAO; +import org.lamsfoundation.lams.tool.daco.dao.DacoDAO; +import org.lamsfoundation.lams.tool.daco.dao.DacoQuestionDAO; +import org.lamsfoundation.lams.tool.daco.dao.DacoQuestionVisitDAO; +import org.lamsfoundation.lams.tool.daco.dao.DacoSessionDAO; +import org.lamsfoundation.lams.tool.daco.dao.DacoUserDAO; +import org.lamsfoundation.lams.tool.daco.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.daco.dto.Summary; +import org.lamsfoundation.lams.tool.daco.model.Daco; +import org.lamsfoundation.lams.tool.daco.model.DacoAnswer; +import org.lamsfoundation.lams.tool.daco.model.DacoAttachment; +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; +import org.lamsfoundation.lams.tool.daco.model.DacoQuestionVisitLog; +import org.lamsfoundation.lams.tool.daco.model.DacoSession; +import org.lamsfoundation.lams.tool.daco.model.DacoUser; +import org.lamsfoundation.lams.tool.daco.util.DacoToolContentHandler; +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.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; + +/** + * + * @author Dapeng.Ni + * + */ +public class DacoServiceImpl implements IDacoService, ToolContentManager, ToolSessionManager + +{ + static Logger log = Logger.getLogger(DacoServiceImpl.class.getName()); + private DacoDAO dacoDao; + private DacoQuestionDAO dacoQuestionDao; + private DacoAttachmentDAO dacoAttachmentDao; + private DacoUserDAO dacoUserDao; + private DacoSessionDAO dacoSessionDao; + private DacoAnswerDAO dacoAnswerDao; + private DacoAnswerOptionDAO dacoAnswerOptionDao; + private DacoQuestionVisitDAO dacoQuestionVisitDao; + // tool service + private DacoToolContentHandler dacoToolContentHandler; + 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; + } + } + } + + public IVersionedNode getFileNode(Long answerUid, String relPathString) throws DacoApplicationException { + DacoAnswer answer = (DacoAnswer) dacoAnswerDao.getObject(DacoQuestion.class, answerUid); + if (answer == null) { + throw new DacoApplicationException("Reource question " + answerUid + " not found."); + } + + return getFile(answer.getFileUuid(), answer.getFileVersionId(), relPathString); + } + + // ******************************************************************************* + // 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 DacoApplicationException { + + 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."; + DacoServiceImpl.log.error(error); + throw new DacoApplicationException(error, e); + + } + catch (Exception e) { + + String error = "Unable to access repository to get file uuid " + uuid + " version id " + versionId + " path " + + relativePath + "." + " Exception: " + e.getMessage(); + DacoServiceImpl.log.error(error); + throw new DacoApplicationException(error, e); + + } + } + + /** + * This method verifies the credentials of the Daco 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 DacoApplicationException + */ + private ITicket getRepositoryLoginTicket() throws DacoApplicationException { + ICredentials credentials = new SimpleCredentials(dacoToolContentHandler.getRepositoryUser(), dacoToolContentHandler + .getRepositoryId()); + try { + ITicket ticket = repositoryService.login(credentials, dacoToolContentHandler.getRepositoryWorkspaceName()); + return ticket; + } + catch (AccessDeniedException ae) { + throw new DacoApplicationException("Access Denied to repository." + ae.getMessage()); + } + catch (WorkspaceNotFoundException we) { + throw new DacoApplicationException("Workspace not found." + we.getMessage()); + } + catch (LoginException e) { + throw new DacoApplicationException("Login failed." + e.getMessage()); + } + } + + public Daco getDacoByContentId(Long contentId) { + Daco rs = dacoDao.getByContentId(contentId); + if (rs == null) { + DacoServiceImpl.log.error("Could not find the content by given ID:" + contentId); + } + return rs; + } + + public Daco getDefaultContent(Long contentId) throws DacoApplicationException { + if (contentId == null) { + String error = messageService.getMessage("error.msg.default.content.not.find"); + DacoServiceImpl.log.error(error); + throw new DacoApplicationException(error); + } + + Daco defaultContent = getDefaultDaco(); + // save default content by given ID. + Daco content = new Daco(); + content = Daco.newInstance(defaultContent, contentId, dacoToolContentHandler); + return content; + } + + public List getAuthoredQuestions(Long dacoUid) { + return dacoQuestionDao.getAuthoringQuestions(dacoUid); + } + + public DacoAttachment uploadInstructionFile(FormFile uploadFile, String fileType) throws UploadDacoFileException { + if (uploadFile == null || StringUtils.isEmpty(uploadFile.getFileName())) { + throw new UploadDacoFileException(messageService.getMessage("error.msg.upload.file.not.found", + new Object[] { uploadFile })); + } + + // upload file to repository + NodeKey nodeKey = processFile(uploadFile, fileType); + + // create new attachement + DacoAttachment file = new DacoAttachment(); + file.setFileType(fileType); + file.setFileUuid(nodeKey.getUuid()); + file.setFileVersionId(nodeKey.getVersion()); + file.setFileName(uploadFile.getFileName()); + file.setCreated(new Date()); + + return file; + } + + public void createUser(DacoUser dacoUser) { + dacoUserDao.saveObject(dacoUser); + } + + public DacoUser getUserByIDAndContent(Long userId, Long contentId) { + + return dacoUserDao.getUserByUserIDAndContentID(userId, contentId); + + } + + public DacoUser getUserByIDAndSession(Long userId, Long sessionId) { + + return dacoUserDao.getUserByUserIDAndSessionID(userId, sessionId); + + } + + public void deleteFromRepository(Long fileUuid, Long fileVersionId) throws DacoApplicationException { + ITicket ticket = getRepositoryLoginTicket(); + try { + repositoryService.deleteVersion(ticket, fileUuid, fileVersionId); + } + catch (Exception e) { + throw new DacoApplicationException("Exception occured while deleting files from" + " the repository " + + e.getMessage()); + } + } + + public void saveOrUpdateDaco(Daco daco) { + dacoDao.saveObject(daco); + } + + public void deleteDacoAttachment(Long attachmentUid) { + dacoAttachmentDao.removeObject(DacoAttachment.class, attachmentUid); + + } + + public void saveOrUpdateDacoQuestion(DacoQuestion question) { + dacoQuestionDao.saveObject(question); + } + + public void deleteDacoQuestion(Long uid) { + dacoQuestionDao.removeObject(DacoQuestion.class, uid); + } + + public void deleteDacoAnswer(Long uid) { + dacoAnswerDao.removeObject(DacoAnswer.class, uid); + } + + public List> getDacoAnswersByUserAndDaco(Long userUid, Daco daco) { + return dacoAnswerDao.getRecordsByUserUidAndDaco(userUid, daco); + } + + public List exportBySessionId(Long sessionId, boolean skipHide) { + DacoSession session = dacoSessionDao.getSessionBySessionId(sessionId); + if (session == null) { + DacoServiceImpl.log.error("Failed get DacoSession by ID [" + sessionId + "]"); + return null; + } + // initial daco questions list + List questionList = new ArrayList(); + Set resList = session.getDaco().getDacoQuestions(); + for (DacoQuestion question : resList) { + if (skipHide && question.isHide()) { + continue; + } + // if question is create by author + if (question.isCreateByAuthor()) { + Summary sum = new Summary(session.getSessionName(), question, false); + questionList.add(sum); + } + } + + // get this session's all daco questions + Set sessList = session.getDacoQuestions(); + for (DacoQuestion question : sessList) { + if (skipHide && question.isHide()) { + continue; + } + + // to skip all question create by author + if (!question.isCreateByAuthor()) { + Summary sum = new Summary(session.getSessionName(), question, false); + questionList.add(sum); + } + } + + return questionList; + } + + public List> exportByContentId(Long contentId) { + Daco daco = dacoDao.getByContentId(contentId); + List> groupList = new ArrayList(); + + // create init daco questions list + List initList = new ArrayList(); + groupList.add(initList); + Set resList = daco.getDacoQuestions(); + for (DacoQuestion question : resList) { + if (question.isCreateByAuthor()) { + Summary sum = new Summary(null, question, true); + initList.add(sum); + } + } + + // session by session + List sessionList = dacoSessionDao.getByContentId(contentId); + for (DacoSession session : sessionList) { + List group = new ArrayList(); + // get this session's all daco questions + Set sessList = session.getDacoQuestions(); + for (DacoQuestion question : sessList) { + // to skip all question create by author + if (!question.isCreateByAuthor()) { + Summary sum = new Summary(session.getSessionName(), question, false); + group.add(sum); + } + } + if (group.size() == 0) { + group.add(new Summary(session.getSessionName(), null, false)); + } + groupList.add(group); + } + + return groupList; + } + + public Daco getDacoBySessionId(Long sessionId) { + DacoSession session = dacoSessionDao.getSessionBySessionId(sessionId); + // to skip CGLib problem + Long contentId = session.getDaco().getContentId(); + Daco res = dacoDao.getByContentId(contentId); + // construct dto fields; + return res; + } + + public DacoSession getDacoSessionBySessionId(Long sessionId) { + return dacoSessionDao.getSessionBySessionId(sessionId); + } + + public void saveOrUpdateDacoSession(DacoSession resSession) { + dacoSessionDao.saveObject(resSession); + } + + public void setQuestionComplete(Long dacoQuestionUid, Long userId, Long sessionId) { + DacoQuestionVisitLog log = dacoQuestionVisitDao.getDacoQuestionLog(dacoQuestionUid, userId); + if (log == null) { + log = new DacoQuestionVisitLog(); + DacoQuestion question = dacoQuestionDao.getByUid(dacoQuestionUid); + log.setDacoQuestion(question); + DacoUser user = dacoUserDao.getUserByUserIDAndSessionID(userId, sessionId); + log.setUser(user); + log.setSessionId(sessionId); + log.setAccessDate(new Timestamp(new Date().getTime())); + } + log.setComplete(true); + dacoQuestionVisitDao.saveObject(log); + } + + public void setQuestionAccess(Long dacoQuestionUid, Long userId, Long sessionId) { + DacoQuestionVisitLog log = dacoQuestionVisitDao.getDacoQuestionLog(dacoQuestionUid, userId); + if (log == null) { + log = new DacoQuestionVisitLog(); + DacoQuestion question = dacoQuestionDao.getByUid(dacoQuestionUid); + log.setDacoQuestion(question); + DacoUser user = dacoUserDao.getUserByUserIDAndSessionID(userId, sessionId); + log.setUser(user); + log.setComplete(false); + log.setSessionId(sessionId); + log.setAccessDate(new Timestamp(new Date().getTime())); + dacoQuestionVisitDao.saveObject(log); + } + } + + public String finishToolSession(Long toolSessionId, Long userId) throws DacoApplicationException { + DacoUser user = dacoUserDao.getUserByUserIDAndSessionID(userId, toolSessionId); + user.setSessionFinished(true); + dacoUserDao.saveObject(user); + + String nextUrl = null; + try { + nextUrl = this.leaveToolSession(toolSessionId, userId); + } + catch (DataMissingException e) { + throw new DacoApplicationException(e); + } + catch (ToolException e) { + throw new DacoApplicationException(e); + } + return nextUrl; + } + + public int checkMiniView(Long toolSessionId, Long userUid) { + int miniView = dacoQuestionVisitDao.getUserViewLogCount(toolSessionId, userUid); + DacoSession session = dacoSessionDao.getSessionBySessionId(toolSessionId); + if (session == null) { + DacoServiceImpl.log.error("Failed get session by ID [" + toolSessionId + "]"); + return 0; + } + // MARCIN: changed from "session.getDaco().getMiniViewDacoNumber()" to 0 + int reqView = 0; + + return reqView - miniView; + } + + public DacoQuestion getDacoQuestionByUid(Long questionUid) { + return dacoQuestionDao.getByUid(questionUid); + } + + public List> getSummary(Long contentId) { + List> groupList = new ArrayList>(); + List group = new ArrayList(); + + // get all question which is accessed by user + Map visitCountMap = dacoQuestionVisitDao.getSummary(contentId); + + Daco daco = dacoDao.getByContentId(contentId); + Set resQuestionList = daco.getDacoQuestions(); + + // get all sessions in a daco and retrieve all daco questions under this + // session + // plus initial daco questions by author creating (resQuestionList) + List sessionList = dacoSessionDao.getByContentId(contentId); + for (DacoSession session : sessionList) { + // one new group for one session. + group = new ArrayList(); + // firstly, put all initial daco question into this group. + for (DacoQuestion question : resQuestionList) { + Summary sum = new Summary(session.getSessionId(), session.getSessionName(), question); + // set viewNumber according visit log + if (visitCountMap.containsKey(question.getUid())) { + sum.setViewNumber(visitCountMap.get(question.getUid()).intValue()); + } + group.add(sum); + } + // get this session's all daco questions + Set sessQuestionList = session.getDacoQuestions(); + for (DacoQuestion question : sessQuestionList) { + // to skip all question create by author + if (!question.isCreateByAuthor()) { + Summary sum = new Summary(session.getSessionId(), session.getSessionName(), question); + // set viewNumber according visit log + if (visitCountMap.containsKey(question.getUid())) { + sum.setViewNumber(visitCountMap.get(question.getUid()).intValue()); + } + group.add(sum); + } + } + // so far no any question available, so just put session name info + // to Summary + if (group.size() == 0) { + group.add(new Summary(session.getSessionId(), session.getSessionName(), null)); + } + groupList.add(group); + } + + return groupList; + + } + + public Map> getReflectList(Long contentId) { + Map> map = new HashMap>(); + + List sessionList = dacoSessionDao.getByContentId(contentId); + for (DacoSession session : sessionList) { + Long sessionId = session.getSessionId(); + boolean hasRefection = session.getDaco().isReflectOnActivity(); + Set list = new TreeSet(this.new ReflectDTOComparator()); + // get all users in this session + List users = dacoUserDao.getBySessionID(sessionId); + for (DacoUser user : users) { + ReflectDTO ref = new ReflectDTO(user); + ref.setHasRefection(hasRefection); + list.add(ref); + } + map.put(sessionId, list); + } + + return map; + } + + public List getUserListBySessionQuestion(Long sessionId, Long questionUid) { + List logList = dacoQuestionVisitDao.getDacoQuestionLogBySession(sessionId, questionUid); + List userList = new ArrayList(logList.size()); + for (DacoQuestionVisitLog visit : logList) { + DacoUser user = visit.getUser(); + user.setAccessDate(visit.getAccessDate()); + userList.add(user); + } + return userList; + } + + public void setQuestionVisible(Long questionUid, boolean visible) { + DacoQuestion question = dacoQuestionDao.getByUid(questionUid); + if (question != null) { + // createBy should be null for system default value. + Long userId = 0L; + String loginName = "No user"; + if (question.getCreateBy() != null) { + userId = question.getCreateBy().getUserId(); + loginName = question.getCreateBy().getLoginName(); + } + if (visible) { + auditService.logShowEntry(DacoConstants.TOOL_SIGNATURE, userId, loginName, question.toString()); + } + else { + auditService.logHideEntry(DacoConstants.TOOL_SIGNATURE, userId, loginName, question.toString()); + } + question.setHide(!visible); + dacoQuestionDao.saveObject(question); + } + } + + 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); + } + } + + /** + * @param notebookEntry + */ + public void updateEntry(NotebookEntry notebookEntry) { + coreNotebookService.updateEntry(notebookEntry); + } + + public DacoUser getUser(Long uid) { + return (DacoUser) dacoUserDao.getObject(DacoUser.class, uid); + } + + // ***************************************************************************** + // private methods + // ***************************************************************************** + private Daco getDefaultDaco() throws DacoApplicationException { + Long defaultDacoId = getToolDefaultContentIdBySignature(DacoConstants.TOOL_SIGNATURE); + Daco defaultDaco = getDacoByContentId(defaultDacoId); + if (defaultDaco == null) { + String error = messageService.getMessage("error.msg.default.content.not.find"); + DacoServiceImpl.log.error(error); + throw new DacoApplicationException(error); + } + + defaultDaco.setLockWhenFinished(true); + + return defaultDaco; + } + + private Long getToolDefaultContentIdBySignature(String toolSignature) throws DacoApplicationException { + Long contentId = null; + contentId = new Long(toolService.getToolDefaultContentIdBySignature(toolSignature)); + if (contentId == null) { + String error = messageService.getMessage("error.msg.default.content.not.find"); + DacoServiceImpl.log.error(error); + throw new DacoApplicationException(error); + } + return contentId; + } + + /** + * Process an uploaded file. + * + * @throws DacoApplicationException + * @throws FileNotFoundException + * @throws IOException + * @throws RepositoryCheckedException + * @throws InvalidParameterException + */ + private NodeKey processFile(FormFile file, String fileType) throws UploadDacoFileException { + NodeKey node = null; + if (file != null && !StringUtils.isEmpty(file.getFileName())) { + String fileName = file.getFileName(); + try { + node = dacoToolContentHandler.uploadFile(file.getInputStream(), fileName, file.getContentType(), fileType); + } + catch (InvalidParameterException e) { + throw new UploadDacoFileException(messageService.getMessage("error.msg.invaid.param.upload")); + } + catch (FileNotFoundException e) { + throw new UploadDacoFileException(messageService.getMessage("error.msg.file.not.found")); + } + catch (RepositoryCheckedException e) { + throw new UploadDacoFileException(messageService.getMessage("error.msg.repository")); + } + catch (IOException e) { + throw new UploadDacoFileException(messageService.getMessage("error.msg.io.exception")); + } + } + return node; + } + + private NodeKey processPackage(String packageDirectory, String initFile) throws UploadDacoFileException { + NodeKey node = null; + try { + node = dacoToolContentHandler.uploadPackage(packageDirectory, initFile); + } + catch (InvalidParameterException e) { + throw new UploadDacoFileException(messageService.getMessage("error.msg.invaid.param.upload")); + } + catch (RepositoryCheckedException e) { + throw new UploadDacoFileException(messageService.getMessage("error.msg.repository")); + } + return node; + } + + public void uploadDacoAnswerFile(DacoAnswer answer, FormFile file) throws UploadDacoFileException { + try { + InputStream is = file.getInputStream(); + String fileName = file.getFileName(); + String fileType = file.getContentType(); + // For file only upload one sigle file + if (answer.getQuestion().getType() == DacoConstants.QUESTION_TYPE_FILE + || answer.getQuestion().getType() == DacoConstants.QUESTION_TYPE_IMAGE) { + NodeKey nodeKey = processFile(file, IToolContentHandler.TYPE_ONLINE); + answer.setFileUuid(nodeKey.getUuid()); + answer.setFileVersionId(nodeKey.getVersion()); + } + + // create the package from the directory contents + answer.setFileType(fileType); + answer.setFileName(fileName); + } + catch (FileNotFoundException e) { + DacoServiceImpl.log.error(messageService.getMessage("error.msg.file.not.found") + ":" + e.toString()); + throw new UploadDacoFileException(messageService.getMessage("error.msg.file.not.found")); + } + catch (IOException e) { + DacoServiceImpl.log.error(messageService.getMessage("error.msg.io.exception") + ":" + e.toString()); + throw new UploadDacoFileException(messageService.getMessage("error.msg.io.exception")); + } + } + + // ***************************************************************************** + // 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 setDacoAttachmentDao(DacoAttachmentDAO dacoAttachmentDao) { + this.dacoAttachmentDao = dacoAttachmentDao; + } + + public void setDacoDao(DacoDAO dacoDao) { + this.dacoDao = dacoDao; + } + + public void setDacoQuestionDao(DacoQuestionDAO dacoQuestionDao) { + this.dacoQuestionDao = dacoQuestionDao; + } + + public void setDacoSessionDao(DacoSessionDAO dacoSessionDao) { + this.dacoSessionDao = dacoSessionDao; + } + + public void setDacoAnswerDao(DacoAnswerDAO dacoAnswerDao) { + this.dacoAnswerDao = dacoAnswerDao; + } + + public void setDacoAnswerOptionDao(DacoAnswerOptionDAO dacoOptionDao) { + dacoAnswerOptionDao = dacoOptionDao; + } + + public void setDacoToolContentHandler(DacoToolContentHandler dacoToolContentHandler) { + this.dacoToolContentHandler = dacoToolContentHandler; + } + + public void setDacoUserDao(DacoUserDAO dacoUserDao) { + this.dacoUserDao = dacoUserDao; + } + + public void setToolService(ILamsToolService toolService) { + this.toolService = toolService; + } + + public DacoQuestionVisitDAO getDacoQuestionVisitDao() { + return dacoQuestionVisitDao; + } + + public void setDacoQuestionVisitDao(DacoQuestionVisitDAO dacoQuestionVisitDao) { + this.dacoQuestionVisitDao = dacoQuestionVisitDao; + } + + // ******************************************************************************* + // ToolContentManager, ToolSessionManager methods + // ******************************************************************************* + + public void exportToolContent(Long toolContentId, String rootPath) throws DataMissingException, ToolException { + Daco toolContentObj = dacoDao.getByContentId(toolContentId); + if (toolContentObj == null) { + try { + toolContentObj = getDefaultDaco(); + } + catch (DacoApplicationException e) { + throw new DataMissingException(e.getMessage()); + } + } + if (toolContentObj == null) { + throw new DataMissingException("Unable to find default content for the daco tool"); + } + + // set DacoToolContentHandler as null to avoid copy file node in + // repository again. + toolContentObj = Daco.newInstance(toolContentObj, toolContentId, null); + toolContentObj.setToolContentHandler(null); + toolContentObj.setOfflineFileList(null); + toolContentObj.setOnlineFileList(null); + try { + exportContentService.registerFileClassForExport(DacoAttachment.class.getName(), "fileUuid", "fileVersionId"); + exportContentService.registerFileClassForExport(DacoQuestion.class.getName(), "fileUuid", "fileVersionId"); + exportContentService.exportToolContent(toolContentId, toolContentObj, dacoToolContentHandler, rootPath); + } + catch (ExportToolContentException e) { + throw new ToolException(e); + } + } + + public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, + String toVersion) throws ToolException { + + try { + exportContentService.registerFileClassForImport(DacoAttachment.class.getName(), "fileUuid", "fileVersionId", + "fileName", "fileType", null, null); + exportContentService.registerFileClassForImport(DacoQuestion.class.getName(), "fileUuid", "fileVersionId", + "fileName", "fileType", null, "initialQuestion"); + + Object toolPOJO = exportContentService.importToolContent(toolContentPath, dacoToolContentHandler, fromVersion, + toVersion); + if (!(toolPOJO instanceof Daco)) { + throw new ImportToolContentException("Import Share daco tool content failed. Deserialized object is " + toolPOJO); + } + Daco toolContentObj = (Daco) toolPOJO; + + // reset it to new toolContentId + toolContentObj.setContentId(toolContentId); + DacoUser user = dacoUserDao.getUserByUserIDAndContentID(new Long(newUserUid.longValue()), toolContentId); + if (user == null) { + user = new DacoUser(); + 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.setDaco(toolContentObj); + } + toolContentObj.setCreatedBy(user); + + // reset all dacoQuestion createBy user + Set questions = toolContentObj.getDacoQuestions(); + for (DacoQuestion question : questions) { + question.setCreateBy(user); + } + dacoDao.saveObject(toolContentObj); + } + catch (ImportToolContentException e) { + throw new ToolException(e); + } + } + + /** + * Get the definitions for possible output for an activity, based on the toolContentId. These may be definitions that are + * always available for the tool (e.g. number of marks for Multiple Choice) or a custom definition created for a particular + * activity such as the answer to the third question contains the word Koala and hence the need for the toolContentId + * + * @return SortedMap of ToolOutputDefinitions with the key being the name of each definition + */ + public SortedMap getToolOutputDefinitions(Long toolContentId) throws ToolException { + return new TreeMap(); + } + + public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { + if (toContentId == null) { + throw new ToolException("Failed to create the SharedDacoFiles tool seession"); + } + + Daco daco = null; + if (fromContentId != null) { + daco = dacoDao.getByContentId(fromContentId); + } + if (daco == null) { + try { + daco = getDefaultDaco(); + } + catch (DacoApplicationException e) { + throw new ToolException(e); + } + } + + Daco toContent = Daco.newInstance(daco, toContentId, dacoToolContentHandler); + dacoDao.saveObject(toContent); + + // save daco questions as well + Set questions = toContent.getDacoQuestions(); + if (questions != null) { + Iterator iter = questions.iterator(); + while (iter.hasNext()) { + DacoQuestion question = (DacoQuestion) iter.next(); + // createRootTopic(toContent.getUid(),null,msg); + } + } + } + + public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { + Daco daco = dacoDao.getByContentId(toolContentId); + if (daco == null) { + throw new ToolException("No found tool content by given content ID:" + toolContentId); + } + daco.setDefineLater(value); + } + + public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { + Daco daco = dacoDao.getByContentId(toolContentId); + if (daco == null) { + throw new ToolException("No found tool content by given content ID:" + toolContentId); + } + daco.setRunOffline(value); + } + + public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { + Daco daco = dacoDao.getByContentId(toolContentId); + if (removeSessionData) { + List list = dacoSessionDao.getByContentId(toolContentId); + Iterator iter = list.iterator(); + while (iter.hasNext()) { + DacoSession session = (DacoSession) iter.next(); + dacoSessionDao.delete(session); + } + } + dacoDao.delete(daco); + } + + public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException { + DacoSession session = new DacoSession(); + session.setSessionId(toolSessionId); + session.setSessionName(toolSessionName); + Daco daco = dacoDao.getByContentId(toolContentId); + session.setDaco(daco); + dacoSessionDao.saveObject(session); + } + + public String leaveToolSession(Long toolSessionId, Long learnerId) throws DataMissingException, ToolException { + if (toolSessionId == null) { + DacoServiceImpl.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) { + DacoServiceImpl.log.error("Fail to leave tool Session based on null learner."); + throw new ToolException("Fail to remove tool Session based on null learner."); + } + + DacoSession session = dacoSessionDao.getSessionBySessionId(toolSessionId); + if (session != null) { + session.setStatus(DacoConstants.COMPLETED); + dacoSessionDao.saveObject(session); + } + else { + DacoServiceImpl.log.error("Fail to leave tool Session.Could not find shared daco " + "session by given session id: " + + toolSessionId); + throw new DataMissingException("Fail to leave tool Session." + + "Could not find shared daco session by given session id: " + toolSessionId); + } + 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 { + dacoSessionDao.deleteBySessionId(toolSessionId); + } + + /** + * Get the tool output for the given tool output names. + * + * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.util.List, java.lang.Long, java.lang.Long) + */ + public SortedMap getToolOutput(List names, Long toolSessionId, Long learnerId) { + return new TreeMap(); + } + + /** + * Get the tool output for the given tool output name. + * + * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.lang.String, java.lang.Long, java.lang.Long) + */ + public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) { + return null; + } + + /* + * ===============Methods implemented from ToolContentImport102Manager =============== + */ + + /** + * 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 { + + Daco toolContentObj = getDacoByContentId(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."); + } + + 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; + } + + public void saveOrUpdateAnswer(DacoAnswer answer) { + dacoAnswerDao.saveObject(answer); + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceProxy.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceProxy.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceProxy.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,75 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.service; + +import javax.servlet.ServletContext; + +import org.lamsfoundation.lams.tool.ToolContentManager; +import org.lamsfoundation.lams.tool.ToolSessionManager; +import org.lamsfoundation.lams.tool.daco.DacoConstants; +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 DacoServiceProxy +{ + /** + * 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 daco service object. + */ + public static final IDacoService getDacoService(ServletContext servletContext) + { + return (IDacoService)getDacoDomainService(servletContext); + } + + public static final ToolSessionManager getSessionManager(ServletContext servletContext) + { + return (ToolSessionManager)getDacoDomainService(servletContext); + } + + public static final ToolContentManager getContentManager(ServletContext servletContext) + { + return (ToolContentManager)getDacoDomainService(servletContext); + } + + private static Object getDacoDomainService(ServletContext servletContext) + { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); + return wac.getBean(DacoConstants.DACO_SERVICE); + } + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/IDacoService.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/IDacoService.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/IDacoService.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,285 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.service; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.contentrepository.IVersionedNode; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.tool.daco.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.daco.dto.Summary; +import org.lamsfoundation.lams.tool.daco.model.Daco; +import org.lamsfoundation.lams.tool.daco.model.DacoAnswer; +import org.lamsfoundation.lams.tool.daco.model.DacoAttachment; +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; +import org.lamsfoundation.lams.tool.daco.model.DacoSession; +import org.lamsfoundation.lams.tool.daco.model.DacoUser; + +/** + * @author Dapeng.Ni + * + * Interface that defines the contract that all ShareDaco service provider must follow. + */ +public interface IDacoService { + + /** + * Get file IVersiondNode by given package id and path. + * + * @param packageId + * @param relPathString + * @return + * @throws DacoApplicationException + */ + IVersionedNode getFileNode(Long packageId, String relPathString) throws DacoApplicationException; + + /** + * Get Daco by toolContentID. + * + * @param contentId + * @return + */ + Daco getDacoByContentId(Long contentId); + + /** + * Get a cloned copy of tool default tool content (Daco) and assign the toolContentId of that copy as the given + * contentId + * + * @param contentId + * @return + * @throws DacoApplicationException + */ + Daco getDefaultContent(Long contentId) throws DacoApplicationException; + + /** + * Get list of daco questions by given dacoUid. These daco questions must be created by author. + * + * @param dacoUid + * @return + */ + List getAuthoredQuestions(Long dacoUid); + + /** + * Upload instruciton file into repository. + * + * @param file + * @param type + * @return + * @throws UploadDacoFileException + */ + DacoAttachment uploadInstructionFile(FormFile file, String type) throws UploadDacoFileException; + + /** + * Upload daco answer file to repository + * + * @param answer + * @param file + * @throws UploadDacoFileException + */ + void uploadDacoAnswerFile(DacoAnswer answer, FormFile file) throws UploadDacoFileException; + + // ********** for user methods ************* + /** + * Create a new user in database. + */ + void createUser(DacoUser dacoUser); + + /** + * Get user by given userID and toolContentID. + * + * @param long1 + * @return + */ + DacoUser getUserByIDAndContent(Long userID, Long contentId); + + /** + * Get user by sessionID and UserID + * + * @param long1 + * @param sessionId + * @return + */ + DacoUser getUserByIDAndSession(Long long1, Long sessionId); + + // ********** Repository methods *********************** + /** + * Delete file from repository. + */ + void deleteFromRepository(Long fileUuid, Long fileVersionId) throws DacoApplicationException; + + /** + * Save or update daco into database. + * + * @param Daco + */ + void saveOrUpdateDaco(Daco Daco); + + void saveOrUpdateAnswer(DacoAnswer answer); + + /** + * Delete reource attachment(i.e., offline/online instruction file) from database. This method does not delete the file from + * repository. + * + * @param attachmentUid + */ + void deleteDacoAttachment(Long attachmentUid); + + /** + * Delete question from database. + * + * @param uid + */ + void deleteDacoQuestion(Long uid); + + void deleteDacoAnswer(Long uid); + + /** + * Return all reource questions within the given toolSessionID. + * + * @param sessionId + * @return + */ + List> getDacoAnswersByUserAndDaco(Long userUid, Daco daco); + + /** + * Get daco which is relative with the special toolSession. + * + * @param sessionId + * @return + */ + Daco getDacoBySessionId(Long sessionId); + + /** + * Get daco toolSession by toolSessionId + * + * @param sessionId + * @return + */ + DacoSession getDacoSessionBySessionId(Long sessionId); + + /** + * Save or update daco session. + * + * @param resSession + */ + void saveOrUpdateDacoSession(DacoSession resSession); + + void setQuestionAccess(Long dacoQuestionUid, Long userId, Long sessionId); + + /** + * the reqired number minus the count of view of the given user. + * + * @param userUid + * @return + */ + int checkMiniView(Long toolSessionId, Long userId); + + /** + * If success return next activity's url, otherwise return null. + * + * @param toolSessionId + * @param userId + * @return + */ + String finishToolSession(Long toolSessionId, Long userId) throws DacoApplicationException; + + DacoQuestion getDacoQuestionByUid(Long questionUid); + + /** + * Return monitoring summary list. The return value is list of daco summaries for each groups. + * + * @param contentId + * @return + */ + List> getSummary(Long contentId); + + List getUserListBySessionQuestion(Long sessionId, Long questionUid); + + /** + * Set a daco question visible or not. + * + * @param questionUid + * @param visible + * true, question is visible. False, question is invisible. + */ + void setQuestionVisible(Long questionUid, boolean visible); + + /** + * Get daco question Summary list according to sessionId and skipHide flag. + * + * @param sessionId + * @param skipHide + * true, don't get daco question if its isHide flag is true. Otherwise, get all daco question + * @return + */ + public List exportBySessionId(Long sessionId, boolean skipHide); + + public List> exportByContentId(Long contentId); + + /** + * 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); + + /** + * @param notebookEntry + */ + public void updateEntry(NotebookEntry notebookEntry); + + /** + * Get Reflect DTO list grouped by sessionID. + * + * @param contentId + * @return + */ + Map> getReflectList(Long contentId); + + /** + * Get user by UID + * + * @param uid + * @return + */ + DacoUser getUser(Long uid); +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/UploadDacoFileException.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/UploadDacoFileException.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/UploadDacoFileException.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.service; + +public class UploadDacoFileException extends Exception{ + + public UploadDacoFileException() { + super(); + + } + + public UploadDacoFileException(String message, Throwable cause) { + super(message, cause); + + } + + public UploadDacoFileException(String message) { + super(message); + + } + + public UploadDacoFileException(Throwable cause) { + super(cause); + + } + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/util/DacoQuestionComparator.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/util/DacoQuestionComparator.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/util/DacoQuestionComparator.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,24 @@ +package org.lamsfoundation.lams.tool.daco.util; + +import java.util.Comparator; + +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; + +/** + * + * @author steven + * + */ +public class DacoQuestionComparator implements Comparator { + public int compare(DacoQuestion o1, DacoQuestion 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; + } + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/util/DacoToolContentHandler.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/util/DacoToolContentHandler.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/util/DacoToolContentHandler.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.util; + +import org.lamsfoundation.lams.contentrepository.client.ToolContentHandler; + +/** + * Simple client for accessing the content repository. + * + * @author Fiona Malikoff + */ +public class DacoToolContentHandler extends ToolContentHandler { + + private static String repositoryWorkspaceName = "shareddacoworkspace"; + private static String repositoryUser = "shareddaco"; + //shareddaco + private static char[] repositoryId = {'l','a','m','s','-','s','h','a','r','e','d','r','e','s','o','u','r','c','e','s'}; + + /** + * + */ + public DacoToolContentHandler() { + 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_daco/src/java/org/lamsfoundation/lams/tool/daco/util/DacoWebUtils.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/util/DacoWebUtils.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/util/DacoWebUtils.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,39 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.util; + + + + +/** + * Contains helper methods used by the Action Servlets + * + * @author Anthony Sukkar + * + */ +public class DacoWebUtils { + +// We leave this blank for future use +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/AuthoringAction.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/AuthoringAction.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/AuthoringAction.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,1242 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.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.daco.DacoConstants; +import org.lamsfoundation.lams.tool.daco.model.Daco; +import org.lamsfoundation.lams.tool.daco.model.DacoAnswerOption; +import org.lamsfoundation.lams.tool.daco.model.DacoAttachment; +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; +import org.lamsfoundation.lams.tool.daco.model.DacoUser; +import org.lamsfoundation.lams.tool.daco.service.DacoApplicationException; +import org.lamsfoundation.lams.tool.daco.service.IDacoService; +import org.lamsfoundation.lams.tool.daco.service.UploadDacoFileException; +import org.lamsfoundation.lams.tool.daco.util.DacoQuestionComparator; +import org.lamsfoundation.lams.tool.daco.web.form.DacoForm; +import org.lamsfoundation.lams.tool.daco.web.form.DacoQuestionForm; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.FileValidatorUtil; +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$ + */ +public class AuthoringAction extends Action { + + private static Logger log = Logger.getLogger(AuthoringAction.class); + + /** + * Delete offline instruction file from current Daco authoring page. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected 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 Daco authoring page. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward deleteOnlineFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + return deleteFile(mapping, request, response, form, IToolContentHandler.TYPE_ONLINE); + } + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws Exception { + + String param = mapping.getParameter(); + // -----------------------Daco 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); + } + if (param.equals("definelater")) { + // update define later flag to true + Long contentId = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + IDacoService service = getDacoService(); + Daco daco = service.getDacoByContentId(contentId); + + daco.setDefineLater(true); + service.saveOrUpdateDaco(daco); + + request.setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.TEACHER.toString()); + return start(mapping, form, request); + } + 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 daco question function + // --------------------------- + if (param.equals("newQuestionInit")) { + return newQuestionlInit(mapping, form, request); + } + if (param.equals("editQuestionInit")) { + return editQuestionInit(mapping, form, request); + } + if (param.equals("saveOrUpdateQuestion")) { + return saveOrUpdateQuestion(mapping, form, request); + } + if (param.equals("removeQuestion")) { + return removeQuestion(mapping, form, request); + } + if (param.equals("newAnswerOption")) { + return newAnswerOption(mapping, form, request); + } + if (param.equals("removeAnswerOption")) { + return removeAnswerOption(mapping, form, request); + } + + if (param.equals("removeQuestionAttachment")) { + return removeQuestionAttachment(mapping, form, request, response); + } + + return mapping.findForward(DacoConstants.ERROR); + } + + /** + * Handle upload offline instruction files request. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws UploadDacoFileException + */ + public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws UploadDacoFileException { + return uploadFile(mapping, form, IToolContentHandler.TYPE_OFFLINE, request); + } + + /** + * Handle upload online instruction files request. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws UploadDacoFileException + */ + public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws UploadDacoFileException { + return uploadFile(mapping, form, IToolContentHandler.TYPE_ONLINE, request); + } + + /** + * General method to delete file (online or offline) + * + * @param mapping + * @param request + * @param response + * @param form + * @param type + * @return + */ + protected ActionForward deleteFile(ActionMapping mapping, HttpServletRequest request, HttpServletResponse response, + ActionForm form, String type) { + Long versionID = new Long(WebUtil.readLongParam(request, DacoConstants.PARAM_FILE_VERSION_ID)); + Long uuID = new Long(WebUtil.readLongParam(request, DacoConstants.PARAM_FILE_UUID)); + + // get back sessionMAP + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.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(); + DacoAttachment existAtt; + while (iter.hasNext()) { + existAtt = (DacoAttachment) 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(DacoConstants.ATTR_FILE_TYPE_FLAG, type); + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMapID); + return mapping.findForward(DacoConstants.SUCCESS); + + } + + /** + * Display edit page for existed daco question. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward editQuestionInit(ActionMapping mapping, ActionForm form, HttpServletRequest request) { + + // get back sessionMAP + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + int questionIndex = NumberUtils.stringToInt(request.getParameter(DacoConstants.PARAM_QUESTION_INDEX), -1); + DacoQuestion question = null; + DacoQuestionForm questionForm = (DacoQuestionForm) form; + if (questionIndex != -1) { + SortedSet questionSet = getQuestionList(sessionMap); + List questionList = new ArrayList(questionSet); + question = questionList.get(questionIndex); + if (question != null) { + populateQuestionToForm(questionIndex, question, questionForm, request); + } + } + return findForward(question == null ? -1 : question.getType(), mapping); + } + + /** + * Extract web from content to daco question. + * + * @param request + * @param questionForm + * @param answerOptionList + * @throws DacoApplicationException + */ + protected void extractFormToDacoQuestion(HttpServletRequest request, List answerOptionList, + DacoQuestionForm questionForm) throws Exception { + /* + * BE CAREFUL: This method will copy nessary info from request form to a old or new DacoQuestion instance. It gets all + * info EXCEPT DacoQuestion.createDate and DacoQuestion.createBy, which need be set when persisting this daco question. + */ + + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(questionForm.getSessionMapID()); + // check whether it is "edit(old question)" or "add(new question)" + SortedSet questionSet = getQuestionList(sessionMap); + int questionIndex = NumberUtils.stringToInt(questionForm.getQuestionIndex(), -1); + DacoQuestion question = null; + + if (questionIndex == -1) { // add + question = new DacoQuestion(); + question.setCreateDate(new Timestamp(new Date().getTime())); + questionSet.add(question); + } + else { // edit + List questionList = new ArrayList(questionSet); + question = questionList.get(questionIndex); + } + + question.setType(questionForm.getQuestionType()); + + String constraint = questionForm.getMax(); + if (!StringUtils.isBlank(constraint)) { + question.setMax(Float.parseFloat(constraint)); + } + constraint = questionForm.getMin(); + if (!StringUtils.isBlank(constraint)) { + question.setMin(Float.parseFloat(constraint)); + } + question.setCreateByAuthor(true); + question.setHide(false); + + Set answerOptions = new LinkedHashSet(); + if (answerOptionList != null) { + int index = 1; + for (String ins : answerOptionList) { + DacoAnswerOption answerOption = new DacoAnswerOption(); + answerOption.setAnswerOption(ins.trim()); + answerOption.setSequenceNumber(index++); + answerOptions.add(answerOption); + } + } + question.setRequired(questionForm.isQuestionRequired()); + question.setAnswerOptions(answerOptions); + question.setSummary(questionForm.getSummary()); + + question.setDescription(StringUtils.isBlank(questionForm.getDescription()) ? null : questionForm.getDescription().trim()); + + question.setDigitsDecimal(questionForm.getDigitsDecimal()); + } + + /** + * Get back relative ActionForward from request. + * + * @param type + * @param mapping + * @return + */ + protected ActionForward findForward(short type, ActionMapping mapping) { + ActionForward forward; + switch (type) { + case DacoConstants.QUESTION_TYPE_TEXTFIELD: + forward = mapping.findForward("textfield"); + break; + case DacoConstants.QUESTION_TYPE_TEXTAREA: + forward = mapping.findForward("textarea"); + break; + case DacoConstants.QUESTION_TYPE_NUMBER: + forward = mapping.findForward("number"); + break; + case DacoConstants.QUESTION_TYPE_DATE: + forward = mapping.findForward("date"); + break; + case DacoConstants.QUESTION_TYPE_FILE: + forward = mapping.findForward("file"); + break; + case DacoConstants.QUESTION_TYPE_IMAGE: + forward = mapping.findForward("image"); + break; + case DacoConstants.QUESTION_TYPE_RADIO: + forward = mapping.findForward("radio"); + break; + case DacoConstants.QUESTION_TYPE_DROPDOWN: + forward = mapping.findForward("dropdown"); + break; + case DacoConstants.QUESTION_TYPE_CHECKBOX: + forward = mapping.findForward("checkbox"); + break; + case DacoConstants.QUESTION_TYPE_LONGLAT: + forward = mapping.findForward("longlat"); + break; + default: + forward = null; + break; + } + return forward; + } + + /** + * Get ToolAccessMode from HttpRequest parameters. Default value is AUTHOR mode. + * + * @param request + * @return + */ + protected 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; + } + + /** + * Get answer options from HttpRequest + * + * @param request + */ + protected List getAnswerOptionsFromRequest(HttpServletRequest request) { + String list = request.getParameter(DacoConstants.ATTR_ANSWER_OPTION_LIST); + if (list == null) { + return null; + } + 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) { + AuthoringAction.log.error("Error occurs when decode answer options string:" + e.toString()); + } + } + + int count = NumberUtils.stringToInt(paramMap.get(DacoConstants.ANSWER_OPTION_COUNT)); + List answerOptionList = new ArrayList(); + for (int index = 1; index <= count; index++) { + String item = paramMap.get(DacoConstants.ANSWER_OPTION_DESC_PREFIX + index); + if (item != null) { + answerOptionList.add(item); + } + } + return answerOptionList; + } + + /** + * @param request + * @return + */ + protected List getAttachmentList(SessionMap sessionMap) { + return getListFromSession(sessionMap, DacoConstants.ATT_ATTACHMENT_LIST); + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + /** + * Return DacoService bean. + */ + protected IDacoService getDacoService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); + return (IDacoService) wac.getBean(DacoConstants.DACO_SERVICE); + } + + /** + * @param request + * @return + */ + protected List getDeletedAttachmentList(SessionMap sessionMap) { + return getListFromSession(sessionMap, DacoConstants.ATTR_DELETED_ATTACHMENT_LIST); + } + + /** + * List save deleted daco questions, which could be persisted or non-persisted questions. + * + * @param request + * @return + */ + protected List getDeletedDacoQuestionList(SessionMap sessionMap) { + return getListFromSession(sessionMap, DacoConstants.ATTR_DELETED_QUESTION_LIST); + } + + /** + * Get java.util.List from HttpSession by given name. + * + * @param request + * @param name + * @return + */ + protected 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 longitude/latitude maps from HttpRequest + * + * @param request + */ + protected List geSelectedMapsFromRequest(HttpServletRequest request) { + String list = request.getParameter(DacoConstants.PARAM_LONGLAT_MAPS_SELECTED); + if (list == null) { + return null; + } + String[] params = list.split("&"); + List longlatMaps = new ArrayList(); + for (String item : params) { + longlatMaps.add(item); + } + return longlatMaps; + } + + /** + * List save current daco questions. + * + * @param request + * @return + */ + protected SortedSet getQuestionList(SessionMap sessionMap) { + + SortedSet list = (SortedSet) sessionMap.get(DacoConstants.ATTR_QUESTION_LIST); + if (list == null) { + list = new TreeSet(new DacoQuestionComparator()); + sessionMap.put(DacoConstants.ATTR_QUESTION_LIST, list); + } + return list; + } + + /** + * Display same entire authoring page content from HttpSession variable. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ServletException + */ + protected ActionForward initPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws ServletException { + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + DacoForm existForm = (DacoForm) sessionMap.get(DacoConstants.ATTR_DACO_FORM); + + DacoForm dacoForm = (DacoForm) form; + try { + PropertyUtils.copyProperties(dacoForm, existForm); + } + catch (Exception e) { + throw new ServletException(e); + } + + ToolAccessMode mode = getAccessMode(request); + if (mode.isAuthor()) { + return mapping.findForward(DacoConstants.SUCCESS); + } + else { + return mapping.findForward(DacoConstants.DEFINE_LATER); + } + } + + /** + * Ajax call, will add one more input line for new answer option. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward newAnswerOption(ActionMapping mapping, ActionForm form, HttpServletRequest request) { + int count = NumberUtils.stringToInt(request.getParameter(DacoConstants.ANSWER_OPTION_COUNT), 0); + + List answerOptionList = new ArrayList(++count); + for (int index = 1; index <= count; index++) { + String answerOption = request.getParameter(DacoConstants.ANSWER_OPTION_DESC_PREFIX + index); + answerOptionList.add(answerOption == null ? "" : answerOption); + } + request.setAttribute(DacoConstants.ATTR_ANSWER_OPTION_LIST, answerOptionList); + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Display empty page for new daco question. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward newQuestionlInit(ActionMapping mapping, ActionForm form, HttpServletRequest request) { + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + DacoQuestionForm questionForm = (DacoQuestionForm) form; + questionForm.setSessionMapID(sessionMapID); + + short type = (short) NumberUtils.stringToInt(request.getParameter(DacoConstants.QUESTION_TYPE)); + if (type == DacoConstants.QUESTION_TYPE_RADIO || type == DacoConstants.QUESTION_TYPE_DROPDOWN + || type == DacoConstants.QUESTION_TYPE_CHECKBOX) { + List answerOptionList = new ArrayList(DacoConstants.INIT_ANSWER_OPTION_COUNT); + for (int index = 0; index < DacoConstants.INIT_ANSWER_OPTION_COUNT; index++) { + answerOptionList.add(""); + } + request.setAttribute(DacoConstants.ATTR_ANSWER_OPTION_LIST, answerOptionList); + } + return findForward(type, mapping); + } + + /** + * This method will populate daco question information to its form for edit use. + * + * @param questionIndex + * @param question + * @param form + * @param request + */ + protected void populateQuestionToForm(int questionIndex, DacoQuestion question, DacoQuestionForm form, + HttpServletRequest request) { + form.setDescription(question.getDescription()); + form.setQuestionRequired(question.isRequired()); + form.setSummary(question.getSummary()); + form.setDigitsDecimal(question.getDigitsDecimal()); + if (questionIndex >= 0) { + form.setQuestionIndex(new Integer(questionIndex).toString()); + } + + Float min = question.getMin(); + Float max = question.getMax(); + short questionType = question.getType(); + + if (questionType == DacoConstants.QUESTION_TYPE_NUMBER) { + Short digitsDecimal = question.getDigitsDecimal(); + if (digitsDecimal != null) { + if (digitsDecimal == 0) { + form.setMin(min == null ? null : String.valueOf(Math.round(min))); + form.setMax(max == null ? null : String.valueOf(Math.round(max))); + } + else { + form.setMin(min == null ? null : String.valueOf(round(min, digitsDecimal))); + form.setMax(max == null ? null : String.valueOf(round(max, digitsDecimal))); + } + } + } + else { + form.setMin(min == null ? null : min.toString()); + if (max != null) { + form.setMax(String.valueOf((int) max.floatValue())); + } + } + + if (questionType == DacoConstants.QUESTION_TYPE_RADIO || questionType == DacoConstants.QUESTION_TYPE_DROPDOWN + || questionType == DacoConstants.QUESTION_TYPE_CHECKBOX) { + Set answerOptionList = question.getAnswerOptions(); + List answerOptions = new ArrayList(); + for (DacoAnswerOption in : answerOptionList) { + answerOptions.add(in.getAnswerOption()); + } + request.setAttribute(DacoConstants.ATTR_ANSWER_OPTION_LIST, answerOptions); + } + else if (questionType == DacoConstants.QUESTION_TYPE_LONGLAT) { + + Set answerOptionList = question.getAnswerOptions(); + List selectedMaps = new ArrayList(); + for (DacoAnswerOption in : answerOptionList) { + selectedMaps.add(in.getAnswerOption()); + } + request.setAttribute(DacoConstants.PARAM_LONGLAT_MAPS_SELECTED, selectedMaps); + } + } + + /** + * Ajax call, remove the given line of instruction of resource item. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward removeAnswerOption(ActionMapping mapping, ActionForm form, HttpServletRequest request) { + int count = NumberUtils.stringToInt(request.getParameter(DacoConstants.ANSWER_OPTION_COUNT), 0); + int removeIndex = NumberUtils.stringToInt(request.getParameter(DacoConstants.PARAM_REMOVE_INDEX), -1); + List answerOptionList = new ArrayList(count - 1); + for (int index = 1; index <= count; index++) { + if (index != removeIndex) { + String answerOption = request.getParameter(DacoConstants.ANSWER_OPTION_DESC_PREFIX + index); + answerOptionList.add(answerOption == null ? "" : answerOption); + } + } + request.setAttribute(DacoConstants.ATTR_ANSWER_OPTION_LIST, answerOptionList); + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Remove daco question 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 + */ + protected ActionForward removeQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request) { + + // get back sessionMAP + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + + int questionIndex = NumberUtils.stringToInt(request.getParameter(DacoConstants.PARAM_QUESTION_INDEX), -1); + if (questionIndex != -1) { + SortedSet questionSet = getQuestionList(sessionMap); + List questionList = new ArrayList(questionSet); + DacoQuestion question = questionList.remove(questionIndex); + questionSet.clear(); + questionSet.addAll(questionList); + // add to delList + List deletedList = getDeletedDacoQuestionList(sessionMap); + deletedList.add(question); + } + + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMapID); + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Remove daco question attachment, such as single file, learning object ect. It is a ajax call and just temporarily remove + * from page, all permenant change will happen only when user sumbit this daco question again. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward removeQuestionAttachment(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + request.setAttribute("questionAttachment", null); + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * This method will get necessary information from daco question form and save or update into HttpSession + * DacoQuestionList. 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 + */ + protected ActionForward saveOrUpdateQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request) { + List answerOptionList = getAnswerOptionsFromRequest(request); + List longlatMaps = geSelectedMapsFromRequest(request); + DacoQuestionForm questionForm = (DacoQuestionForm) form; + ActionErrors errors = validateDacoQuestionForm(questionForm, answerOptionList); + + if (!errors.isEmpty()) { + this.addErrors(request, errors); + ensureMinimumAnswerOptions(answerOptionList); + request.setAttribute(DacoConstants.ATTR_ANSWER_OPTION_LIST, answerOptionList); + request.setAttribute(DacoConstants.PARAM_LONGLAT_MAPS_SELECTED, longlatMaps); + return findForward(questionForm.getQuestionType(), mapping); + } + + try { + List listToSave = answerOptionList == null ? longlatMaps : answerOptionList; + extractFormToDacoQuestion(request, listToSave, questionForm); + } + catch (Exception e) { + e.printStackTrace(); + // any upload exception will display as normal error message rather + // then throw exception directly + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_UPLOAD_FAILED, e.getMessage())); + if (!errors.isEmpty()) { + this.addErrors(request, errors); + request.setAttribute(DacoConstants.ATTR_ANSWER_OPTION_LIST, answerOptionList); + request.setAttribute(DacoConstants.PARAM_LONGLAT_MAPS_SELECTED, longlatMaps); + return findForward(questionForm.getQuestionType(), mapping); + } + } + // set session map ID so that questionlist.jsp can get sessionMAP + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, questionForm.getSessionMapID()); + // return null to close this window + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Read daco 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 question lost when user "refresh page", + * + * @throws ServletException + * + */ + protected ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request) throws ServletException { + + // save toolContentID into HTTPSession + Long contentId = new Long(WebUtil.readLongParam(request, DacoConstants.PARAM_TOOL_CONTENT_ID)); + + // get back the daco and question list and display them on page + IDacoService service = getDacoService(); + + List questions = null; + Daco daco = null; + DacoForm dacoForm = (DacoForm) form; + + // initial Session Map + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + dacoForm.setSessionMapID(sessionMap.getSessionID()); + + // Get contentFolderID and save to form. + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + dacoForm.setContentFolderID(contentFolderID); + sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID, contentFolderID); + + try { + daco = service.getDacoByContentId(contentId); + // if daco does not exist, try to use default content instead. + if (daco == null) { + daco = service.getDefaultContent(contentId); + if (daco.getDacoQuestions() != null) { + questions = new ArrayList(daco.getDacoQuestions()); + } + else { + questions = null; + } + } + else { + questions = service.getAuthoredQuestions(daco.getUid()); + } + + dacoForm.setDaco(daco); + + // initialize instruction attachment list + List attachmentList = getAttachmentList(sessionMap); + attachmentList.clear(); + attachmentList.addAll(daco.getAttachments()); + } + catch (Exception e) { + AuthoringAction.log.error(e); + throw new ServletException(e); + } + + // init it to avoid null exception in following handling + if (questions == null) { + questions = new ArrayList(); + } + else { + DacoUser dacoUser = null; + // handle system default question: createBy is null, now set it to + // current user + for (DacoQuestion question : questions) { + if (question.getCreateBy() == null) { + if (dacoUser == null) { + // get back login user DTO + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + dacoUser = new DacoUser(user, daco); + } + question.setCreateBy(dacoUser); + } + } + } + // init daco question list + SortedSet dacoQuestionList = getQuestionList(sessionMap); + dacoQuestionList.clear(); + dacoQuestionList.addAll(questions); + + sessionMap.put(DacoConstants.ATTR_DACO_FORM, dacoForm); + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * This method will persist all inforamtion in this authoring page, include all daco question, information etc. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ServletException + */ + protected ActionForward updateContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + DacoForm dacoForm = (DacoForm) form; + + // get back sessionMAP + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(dacoForm.getSessionMapID()); + + ToolAccessMode mode = getAccessMode(request); + + ActionMessages errors = validateDacoForm(dacoForm, mapping, request); + if (!errors.isEmpty()) { + saveErrors(request, errors); + if (mode.isAuthor()) { + return mapping.findForward("author"); + } + else { + return mapping.findForward("monitor"); + } + } + + Daco daco = dacoForm.getDaco(); + IDacoService service = getDacoService(); + + // **********************************Get Daco PO********************* + Daco dacoPO = service.getDacoByContentId(dacoForm.getDaco().getContentId()); + if (dacoPO == null) { + // new Daco, create it. + dacoPO = daco; + dacoPO.setCreated(new Timestamp(new Date().getTime())); + dacoPO.setUpdated(new Timestamp(new Date().getTime())); + } + else { + if (mode.isAuthor()) { + Long uid = dacoPO.getUid(); + PropertyUtils.copyProperties(dacoPO, daco); + // get back UID + dacoPO.setUid(uid); + } + else { // if it is Teacher, then just update basic tab content + // (definelater) + dacoPO.setInstructions(daco.getInstructions()); + dacoPO.setTitle(daco.getTitle()); + // change define later status + dacoPO.setDefineLater(false); + } + dacoPO.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); + DacoUser dacoUser = service.getUserByIDAndContent(new Long(user.getUserID().intValue()), dacoForm.getDaco() + .getContentId()); + if (dacoUser == null) { + dacoUser = new DacoUser(user, dacoPO); + } + + dacoPO.setCreatedBy(dacoUser); + + // **********************************Handle Authoring Instruction + // Attachement ********************* + // merge attachment info + // so far, attPOSet will be empty if content is existed. because + // PropertyUtils.copyProperties() is executed + Set attPOSet = dacoPO.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()) { + DacoAttachment newAtt = (DacoAttachment) 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()) { + DacoAttachment delAtt = (DacoAttachment) iter.next(); + iter.remove(); + // it is an existed att, then delete it from current attachmentPO + if (delAtt.getUid() != null) { + Iterator attIter = attPOSet.iterator(); + while (attIter.hasNext()) { + DacoAttachment att = (DacoAttachment) attIter.next(); + if (delAtt.getUid().equals(att.getUid())) { + attIter.remove(); + break; + } + } + service.deleteDacoAttachment(delAtt.getUid()); + }// end remove from persist value + } + + // copy back + dacoPO.setAttachments(attPOSet); + // ************************* Handle daco questions ******************* + // Handle daco questions + Set questionList = new LinkedHashSet(); + SortedSet topics = getQuestionList(sessionMap); + iter = topics.iterator(); + while (iter.hasNext()) { + DacoQuestion question = (DacoQuestion) iter.next(); + if (question != null) { + // This flushs user UID info to message if this user is a new + // user. + question.setCreateBy(dacoUser); + questionList.add(question); + } + } + dacoPO.setDacoQuestions(questionList); + // delete instructino file from database. + List delDacoQuestionList = getDeletedDacoQuestionList(sessionMap); + iter = delDacoQuestionList.iterator(); + while (iter.hasNext()) { + DacoQuestion question = (DacoQuestion) iter.next(); + iter.remove(); + if (question.getUid() != null) { + service.deleteDacoQuestion(question.getUid()); + } + } + + service.saveOrUpdateDaco(dacoPO); + + // initialize attachmentList again + attachmentList = getAttachmentList(sessionMap); + attachmentList.addAll(daco.getAttachments()); + dacoForm.setDaco(dacoPO); + + request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); + if (mode.isAuthor()) { + return mapping.findForward("author"); + } + else { + return mapping.findForward("monitor"); + } + } + + /** + * Common method to upload online or offline instruction files request. + * + * @param mapping + * @param form + * @param type + * @param request + * @return + * @throws UploadDacoFileException + */ + protected ActionForward uploadFile(ActionMapping mapping, ActionForm form, String type, HttpServletRequest request) + throws UploadDacoFileException { + + DacoForm dacoForm = (DacoForm) form; + // get back sessionMAP + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(dacoForm.getSessionMapID()); + + FormFile file; + if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { + file = dacoForm.getOfflineFile(); + } + else { + file = dacoForm.getOnlineFile(); + } + + if (file == null || StringUtils.isBlank(file.getFileName())) { + return mapping.findForward(DacoConstants.SUCCESS); + } + + // validate file size + ActionMessages errors = new ActionMessages(); + FileValidatorUtil.validateFileSize(file, true, errors); + if (!errors.isEmpty()) { + this.saveErrors(request, errors); + return mapping.findForward(DacoConstants.SUCCESS); + } + + IDacoService service = getDacoService(); + // upload to repository + DacoAttachment 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(); + DacoAttachment existAtt; + while (iter.hasNext()) { + existAtt = (DacoAttachment) iter.next(); + if (StringUtils.equals(existAtt.getFileName(), att.getFileName()) + && StringUtils.equals(existAtt.getFileType(), att.getFileType())) { + // if there is same name attachment, delete old one + deleteAttachmentList.add(existAtt); + iter.remove(); + break; + } + } + // add to attachmentList + attachmentList.add(att); + + return mapping.findForward(DacoConstants.SUCCESS); + + } + + protected ActionMessages validateDacoForm(DacoForm dacoForm, ActionMapping mapping, HttpServletRequest request) { + ActionMessages errors = new ActionMessages(); + if (dacoForm.getDaco().getMinRecords() > 0 && dacoForm.getDaco().getMaxRecords() > 0 + && dacoForm.getDaco().getMinRecords() > dacoForm.getDaco().getMaxRecords()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORDLIMIT_MIN_TOOHIGH_MAX)); + } + + String modeStr = request.getParameter(AttributeNames.ATTR_MODE); + if (StringUtils.equals(modeStr, ToolAccessMode.TEACHER.toString())) { + return errors; + } + + // Some other validation outside basic Tab. + + return errors; + } + + /** + * Vaidate daco question regards to their type (textfield/textarea/number/date/file/image/radio/dropdown/checkbox/longlat) + * + * @param questionForm + * @return + */ + protected ActionErrors validateDacoQuestionForm(DacoQuestionForm questionForm, List answerOptionList) { + ActionErrors errors = new ActionErrors(); + if (StringUtils.isBlank(questionForm.getDescription())) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_DESC_BLANK)); + } + + String constraint = questionForm.getMax(); + Float max = null; + if (!StringUtils.isBlank(constraint)) { + if (questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_TEXTFIELD + || questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_TEXTAREA + || questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_CHECKBOX) { + try { + max = (float) Integer.parseInt(constraint); + if (max < 0) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_MAX_NEGATIVE)); + } + else if (questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_CHECKBOX + && max > answerOptionList.size()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_MAX_TOOHIGH_ANSWEROPTION)); + } + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_MAX_NUMBER_INT)); + } + } + else if (questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_NUMBER) { + try { + max = Float.parseFloat(constraint); + + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_MAX_NUMBER_FLOAT)); + } + } + } + + constraint = questionForm.getMin(); + if (!StringUtils.isBlank(constraint)) { + Float min = null; + if (questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_TEXTFIELD + || questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_TEXTAREA + || questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_CHECKBOX) { + try { + min = (float) Integer.parseInt(constraint); + if (min < 0) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_MIN_NEGATIVE)); + } + else if (questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_CHECKBOX + && min > answerOptionList.size()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_MIN_TOOHIGH_ANSWEROPTION)); + } + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_MIN_NUMBER_INT)); + } + } + if (questionForm.getQuestionType() == DacoConstants.QUESTION_TYPE_NUMBER) { + try { + min = Float.parseFloat(constraint); + + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_MIN_NUMBER_FLOAT)); + } + } + if (min != null && max != null && min > max) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_MIN_TOOHIGH_MAX)); + } + } + + if (answerOptionList != null) { + if (answerOptionList.size() < DacoConstants.ANSWER_OPTION_MINIMUM_COUNT) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_ANSWEROPTION_NOTENOUGH, + DacoConstants.ANSWER_OPTION_MINIMUM_COUNT)); + } + for (int firstOptionNumber = 0; firstOptionNumber < answerOptionList.size(); firstOptionNumber++) { + String firstOption = answerOptionList.get(firstOptionNumber); + for (int secondOptionNumber = firstOptionNumber + 1; secondOptionNumber < answerOptionList.size(); secondOptionNumber++) { + String secondOption = answerOptionList.get(secondOptionNumber); + if (firstOption.trim().equals(secondOption.trim())) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_ANSWEROPTION_REPEAT, + firstOptionNumber + 1, secondOptionNumber + 1)); + } + } + } + } + + return errors; + } + + protected void ensureMinimumAnswerOptions(List answerOptionList) { + if (answerOptionList != null) { + while (answerOptionList.size() < DacoConstants.ANSWER_OPTION_MINIMUM_COUNT) { + answerOptionList.add(""); + } + } + } + + public final double round(double number, int positions) { + double shift = Math.pow(10, positions); + shift = Math.round(number * shift) / shift; + return shift; + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/ClearSessionAction.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/ClearSessionAction.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/ClearSessionAction.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.daco.web.action; + +import javax.servlet.http.HttpSession; + +import org.lamsfoundation.lams.authoring.web.LamsAuthoringFinishAction; +import org.lamsfoundation.lams.tool.ToolAccessMode; + +/** + * This class give a chance to clear HttpSession when user save/close authoring page. + * @author Steve.Ni + * + * @version $Revision$ + */ +public class ClearSessionAction extends LamsAuthoringFinishAction { + + @Override + public void clearSession(String customiseSessionID, HttpSession session, ToolAccessMode mode) { + if(mode.isAuthor()){ + session.removeAttribute(customiseSessionID); + } + } + + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/LearningAction.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/LearningAction.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/LearningAction.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,954 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.daco.web.action; + +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +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.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.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.daco.DacoConstants; +import org.lamsfoundation.lams.tool.daco.model.Daco; +import org.lamsfoundation.lams.tool.daco.model.DacoAnswer; +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; +import org.lamsfoundation.lams.tool.daco.model.DacoSession; +import org.lamsfoundation.lams.tool.daco.model.DacoUser; +import org.lamsfoundation.lams.tool.daco.service.DacoApplicationException; +import org.lamsfoundation.lams.tool.daco.service.IDacoService; +import org.lamsfoundation.lams.tool.daco.service.UploadDacoFileException; +import org.lamsfoundation.lams.tool.daco.util.DacoQuestionComparator; +import org.lamsfoundation.lams.tool.daco.web.form.RecordForm; +import org.lamsfoundation.lams.tool.daco.web.form.ReflectionForm; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.FileValidatorUtil; +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$ + */ +public class LearningAction extends Action { + + private static Logger log = Logger.getLogger(LearningAction.class); + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + String param = mapping.getParameter(); + // -----------------------Daco Learner function + // --------------------------- + if (param.equals("start")) { + return start(mapping, form, request, response); + } + + if (param.equals("finish")) { + return finish(mapping, form, request, response); + } + + if (param.equals("saveOrUpdateRecord")) { + return saveOrUpdateRecord(mapping, form, request, response); + } + + if (param.equals("editRecord")) { + return editRecord(mapping, form, request); + } + + if (param.equals("removeRecord")) { + return removeRecord(mapping, request); + } + + if (param.equals("diplayHorizontalRecordList")) { + return diplayHorizontalRecordList(mapping, request); + } + + if (param.equals("changeView")) { + return changeView(mapping, request); + } + + // ================ Reflection ======================= + if (param.equals("newReflection")) { + return newReflection(mapping, form, request, response); + } + if (param.equals("submitReflection")) { + return submitReflection(mapping, form, request, response); + } + + return mapping.findForward(DacoConstants.ERROR); + } + + /** + * @param mapping + * @param request + * @return + */ + protected ActionForward diplayHorizontalRecordList(ActionMapping mapping, HttpServletRequest request) { + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, request.getParameter(DacoConstants.ATTR_SESSION_MAP_ID)); + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Read daco 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 question lost when user "refresh page", + * + */ + protected ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + + // initial Session Map + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + + // save toolContentID into HTTPSession + ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, true); + + Long sessionId = new Long(request.getParameter(DacoConstants.PARAM_TOOL_SESSION_ID)); + + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId); + request.setAttribute(DacoConstants.ATTR_DISPLAYED_RECORD_NUMBER, 1); + + // get back the daco and question list and display them on page + IDacoService service = getDacoService(); + DacoUser dacoUser = null; + if (mode != null && mode.isTeacher()) { + // monitoring mode - user is specified in URL + // dacoUser may be null if the user was force completed. + dacoUser = getSpecifiedUser(service, sessionId, WebUtil.readIntParam(request, AttributeNames.PARAM_USER_ID, false)); + } + else { + dacoUser = getCurrentUser(service, sessionId); + } + + Daco daco = service.getDacoBySessionId(sessionId); + + // check whehter finish lock is on/off + boolean lock = daco.getLockWhenFinished() && dacoUser != null && dacoUser.isSessionFinished(); + + // get notebook entry + String entryText = new String(); + if (dacoUser != null) { + NotebookEntry notebookEntry = service.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + DacoConstants.TOOL_SIGNATURE, dacoUser.getUserId().intValue()); + if (notebookEntry != null) { + entryText = notebookEntry.getEntry(); + } + } + + sessionMap.put(DacoConstants.ATTR_FINISH_LOCK, lock); + sessionMap.put(DacoConstants.ATTR_USER_FINISHED, dacoUser != null && dacoUser.isSessionFinished()); + sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, sessionId); + sessionMap.put(AttributeNames.ATTR_MODE, mode); + sessionMap.put(DacoConstants.ATTR_REFLECTION_ENTRY, entryText); + sessionMap.put(DacoConstants.ATTR_DACO, daco); + sessionMap.put(DacoConstants.ATTR_LEARNING_VIEW, DacoConstants.LEARNING_VIEW_VERTICAL); + + List> records = service.getDacoAnswersByUserAndDaco(dacoUser.getUid(), daco); + sessionMap.put(DacoConstants.ATTR_RECORD_LIST, records); + + // add define later support + if (daco.isDefineLater()) { + return mapping.findForward(DacoConstants.DEFINE_LATER); + } + + // set contentInUse flag to true! + daco.setContentInUse(true); + daco.setDefineLater(false); + service.saveOrUpdateDaco(daco); + + // add run offline support + if (daco.getRunOffline()) { + sessionMap.put(DacoConstants.PARAM_RUN_OFFLINE, true); + return mapping.findForward(DacoConstants.RUN_OFFLINE); + } + else { + sessionMap.put(DacoConstants.PARAM_RUN_OFFLINE, false); + } + + sessionMap.put(DacoConstants.ATTR_DACO, daco); + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Finish learning session. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + // get back SessionMap + String sessionMapID = request.getParameter(DacoConstants.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); + + if (!validateBeforeFinish(request, sessionMapID)) { + return mapping.getInputForward(); + } + + IDacoService service = getDacoService(); + // 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(DacoConstants.ATTR_NEXT_ACTIVITY_URL, nextActivityUrl); + } + catch (DacoApplicationException e) { + LearningAction.log.error("Failed get next activity url:" + e.getMessage()); + } + + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Save file or textfield daco question into database. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward saveOrUpdateRecord(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + RecordForm recordForm = (RecordForm) form; + String sessionMapID = request.getParameter(DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + Set questionList = ((Daco) sessionMap.get(DacoConstants.ATTR_DACO)).getDacoQuestions(); + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMapID); + sessionMap.put(DacoConstants.ATTR_LEARNING_CURRENT_TAB, 1); + + ActionErrors errors = validateRecordForm(recordForm, questionList); + if (!errors.isEmpty()) { + this.addErrors(request, errors); + return mapping.findForward(DacoConstants.SUCCESS); + } + + Long sessionId = (Long) sessionMap.get(DacoConstants.ATTR_TOOL_SESSION_ID); + IDacoService service = getDacoService(); + DacoUser user = getCurrentUser(service, sessionId); + + List record = null; + + List> records = (List>) sessionMap.get(DacoConstants.ATTR_RECORD_LIST); + int displayedRecordNumber = recordForm.getDisplayedRecordNumber(); + boolean isEdit = false; + if (displayedRecordNumber <= records.size()) { + record = records.get(displayedRecordNumber - 1); + isEdit = true; + } + else { + record = new LinkedList(); + } + + Iterator questionIterator = questionList.iterator(); + DacoQuestion question = null; + int formAnswerNumber = 0; + int answerNumber = 0; + int fileNumber = 0; + DacoAnswer answer = null; + + while (questionIterator.hasNext()) { + question = questionIterator.next(); + if (isEdit) { + answer = record.get(answerNumber++); + } + else { + answer = new DacoAnswer(); + answer.setQuestion(question); + answer.setRecordId(displayedRecordNumber); + answer.setUser(user); + } + + switch (question.getType()) { + case DacoConstants.QUESTION_TYPE_DATE: { + int day = Integer.parseInt(recordForm.getAnswer(formAnswerNumber++)); + int month = Integer.parseInt(recordForm.getAnswer(formAnswerNumber++)); + int year = Integer.parseInt(recordForm.getAnswer(formAnswerNumber)); + DateFormat dateFormat = new SimpleDateFormat(DacoConstants.DATE_FORMAT); + Calendar calendar = Calendar.getInstance(); + calendar.set(year, month, day); + answer.setAnswer(dateFormat.format(calendar.getTime())); + } + formAnswerNumber++; + break; + case DacoConstants.QUESTION_TYPE_CHECKBOX: { + String formAnswer = recordForm.getAnswer(formAnswerNumber); + String[] checkboxes = formAnswer.split("&"); + if (isEdit) { + DacoAnswer localAnswer = answer; + do { + service.deleteDacoAnswer(localAnswer.getUid()); + record.remove(answerNumber - 1); + if (answerNumber <= record.size()) { + localAnswer = record.get(answerNumber - 1); + if (localAnswer.getQuestion().getType() != DacoConstants.QUESTION_TYPE_CHECKBOX) { + localAnswer = null; + } + } + else { + localAnswer = null; + } + } + while (localAnswer != null); + answer = (DacoAnswer) answer.clone(); + + } + if (StringUtils.isBlank(formAnswer)) { + answer.setAnswer(null); + } + else { + for (int checkboxNumber = 0; checkboxNumber < checkboxes.length; checkboxNumber++) { + answer.setAnswer(checkboxes[checkboxNumber]); + if (checkboxNumber < checkboxes.length) { + service.saveOrUpdateAnswer(answer); + record.add(answer); + answer = (DacoAnswer) answer.clone(); + } + } + } + if (isEdit) { + record.add(answer); + } + } + formAnswerNumber++; + break; + case DacoConstants.QUESTION_TYPE_LONGLAT: { + answer.setAnswer(recordForm.getAnswer(formAnswerNumber++)); + service.saveOrUpdateAnswer(answer); + record.add(answer); + answer = (DacoAnswer) answer.clone(); + answer.setAnswer(recordForm.getAnswer(formAnswerNumber)); + } + formAnswerNumber++; + break; + case DacoConstants.QUESTION_TYPE_FILE: + case DacoConstants.QUESTION_TYPE_IMAGE: { + FormFile file = recordForm.getFile(fileNumber); + if (file != null) { + try { + service.uploadDacoAnswerFile(answer, file); + } + catch (UploadDacoFileException e) { + LearningAction.log.error("Failed upload Resource File " + e.toString()); + e.printStackTrace(); + } + } + } + fileNumber++; + break; + case DacoConstants.QUESTION_TYPE_DROPDOWN: { + String formAnswer = recordForm.getAnswer(formAnswerNumber); + answer.setAnswer("0".equals(formAnswer) ? null : formAnswer); + } + formAnswerNumber++; + break; + default: + answer.setAnswer(recordForm.getAnswer(formAnswerNumber)); + formAnswerNumber++; + break; + } + + service.saveOrUpdateAnswer(answer); + if (!isEdit) { + record.add(answer); + } + } + + form.reset(mapping, request); + if (isEdit) { + request.setAttribute(DacoConstants.ATTR_RECORD_OPERATION_SUCCESS, DacoConstants.RECORD_OPERATION_EDIT); + } + else { + + records.add(record); + request.setAttribute(DacoConstants.ATTR_RECORD_OPERATION_SUCCESS, DacoConstants.RECORD_OPERATION_ADD); + } + sessionMap.put(DacoConstants.ATTR_RECORD_LIST, records); + request.setAttribute(DacoConstants.ATTR_DISPLAYED_RECORD_NUMBER, records.size() + 1); + + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Display empty reflection form. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward newReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + // get session value + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.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); + + // get the existing reflection entry + IDacoService submitFilesService = getDacoService(); + + SessionMap map = (SessionMap) request.getSession().getAttribute(sessionMapID); + Long toolSessionID = (Long) map.get(AttributeNames.PARAM_TOOL_SESSION_ID); + NotebookEntry entry = submitFilesService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + DacoConstants.TOOL_SIGNATURE, user.getUserID()); + + if (entry != null) { + refForm.setEntryText(entry.getEntry()); + } + + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Submit reflection form input database. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + protected ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + ReflectionForm refForm = (ReflectionForm) form; + Integer userId = refForm.getUserID(); + + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + + IDacoService service = getDacoService(); + + // check for existing notebook entry + NotebookEntry entry = service.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, DacoConstants.TOOL_SIGNATURE, + userId); + + if (entry == null) { + // create new entry + service.createNotebookEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, DacoConstants.TOOL_SIGNATURE, userId, + refForm.getEntryText()); + } + else { + // update existing entry + entry.setEntry(refForm.getEntryText()); + entry.setLastModified(new Date()); + service.updateEntry(entry); + } + + return finish(mapping, form, request, response); + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + protected boolean validateBeforeFinish(HttpServletRequest request, String sessionMapID) { + return true; + } + + protected IDacoService getDacoService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); + return (IDacoService) wac.getBean(DacoConstants.DACO_SERVICE); + } + + /** + * List save current daco questions. + * + * @param request + * @return + */ + protected SortedSet getDacoQuestionList(SessionMap sessionMap) { + SortedSet list = (SortedSet) sessionMap.get(DacoConstants.ATTR_QUESTION_LIST); + if (list == null) { + list = new TreeSet(new DacoQuestionComparator()); + sessionMap.put(DacoConstants.ATTR_QUESTION_LIST, list); + } + return list; + } + + /** + * Get java.util.List from HttpSession by given name. + * + * @param request + * @param name + * @return + */ + protected List getListFromSession(SessionMap sessionMap, String name) { + List list = (List) sessionMap.get(name); + if (list == null) { + list = new ArrayList(); + sessionMap.put(name, list); + } + return list; + } + + protected DacoUser getCurrentUser(IDacoService 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); + DacoUser dacoUser = service.getUserByIDAndSession(new Long(user.getUserID().intValue()), sessionId); + + if (dacoUser == null) { + DacoSession session = service.getDacoSessionBySessionId(sessionId); + dacoUser = new DacoUser(user, session); + service.createUser(dacoUser); + } + return dacoUser; + } + + protected DacoUser getSpecifiedUser(IDacoService service, Long sessionId, Integer userId) { + DacoUser dacoUser = service.getUserByIDAndSession(new Long(userId.intValue()), sessionId); + if (dacoUser == null) { + LearningAction.log.error("Unable to find specified user for daco activity. Screens are likely to fail. SessionId=" + + sessionId + " UserId=" + userId); + } + return dacoUser; + } + + protected ActionErrors validateRecordForm(RecordForm recordForm, Set questionList) { + ActionErrors errors = new ActionErrors(); + Iterator questionIterator = questionList.iterator(); + DacoQuestion question = null; + int answerNumber = 0; + int fileNumber = 0; + int questionNumber = 1; + while (questionIterator.hasNext()) { + question = questionIterator.next(); + switch (question.getType()) { + case DacoConstants.QUESTION_TYPE_TEXTFIELD: + case DacoConstants.QUESTION_TYPE_RADIO: + if (question.isRequired() && StringUtils.isBlank(recordForm.getAnswer(answerNumber))) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORD_BLANK, + questionNumber)); + + } + answerNumber++; + break; + case DacoConstants.QUESTION_TYPE_TEXTAREA: { + if (StringUtils.isBlank(recordForm.getAnswer(answerNumber))) { + if (question.isRequired()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORD_BLANK, + questionNumber)); + } + } + else if (question.getMax() != null) { + long words = 0; + int index = 0; + boolean prevWhiteSpace = true; + while (index < recordForm.getAnswer(answerNumber).length()) { + char c = recordForm.getAnswer(answerNumber).charAt(index++); + boolean currWhiteSpace = Character.isWhitespace(c); + if (prevWhiteSpace && !currWhiteSpace) { + words++; + } + prevWhiteSpace = currWhiteSpace; + } + int max = question.getMax().intValue(); + if (words > max) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_TEXTAREA_LONG, questionNumber, max)); + } + } + } + answerNumber++; + break; + case DacoConstants.QUESTION_TYPE_NUMBER: { + if (StringUtils.isBlank(recordForm.getAnswer(answerNumber))) { + if (question.isRequired()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORD_BLANK, + questionNumber)); + } + } + else { + try { + float number = Float.parseFloat(recordForm.getAnswer(answerNumber)); + Float min = question.getMin(); + Float max = question.getMax(); + if (min != null && number < min) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_NUMBER_MIN, questionNumber, min)); + } + else if (max != null && number > max) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_NUMBER_MAX, questionNumber, max)); + } + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_NUMBER_FLOAT, questionNumber)); + } + } + } + answerNumber++; + break; + case DacoConstants.QUESTION_TYPE_DATE: { + String day = recordForm.getAnswer(answerNumber++); + String month = recordForm.getAnswer(answerNumber++); + String year = recordForm.getAnswer(answerNumber); + if (StringUtils.isBlank(day) && StringUtils.isBlank(month) && StringUtils.isBlank(year)) { + if (question.isRequired()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORD_BLANK, + questionNumber)); + } + } + else { + Integer yearNum = null; + Integer monthNum = null; + if (StringUtils.isBlank(year)) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_DATE_YEAR_BLANK, questionNumber)); + } + else { + try { + yearNum = Integer.parseInt(year); + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_DATE_YEAR_INT, questionNumber)); + } + } + + if (StringUtils.isBlank(month)) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_DATE_MONTH_BLANK, questionNumber)); + } + else { + try { + monthNum = Integer.parseInt(month); + if (monthNum < 1 || monthNum > 12) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_DATE_MONTH_LIMIT, questionNumber)); + } + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_DATE_MONTH_INT, questionNumber)); + } + } + + if (StringUtils.isBlank(day)) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_DATE_DAY_BLANK, questionNumber)); + } + else { + try { + + int dayNum = Integer.parseInt(day); + Integer maxDays = yearNum == null || monthNum == null ? null : getMaxDays(monthNum, yearNum); + if (dayNum < 1 || maxDays != null && dayNum > maxDays) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_DATE_DAY_LIMIT, questionNumber, maxDays)); + } + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_DATE_DAY_INT, questionNumber)); + } + } + } + } + answerNumber++; + break; + case DacoConstants.QUESTION_TYPE_FILE: { + FormFile file = recordForm.getFile(fileNumber); + if (file == null || file.getFileSize() == 0) { + if (question.isRequired()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORD_BLANK, + questionNumber)); + } + } + else { + FileValidatorUtil.validateFileSize(file, true, errors); + } + fileNumber++; + } + break; + case DacoConstants.QUESTION_TYPE_IMAGE: { + FormFile file = recordForm.getFile(fileNumber); + if (file == null || file.getFileSize() == 0) { + if (question.isRequired()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORD_BLANK, + questionNumber)); + } + } + else { + String fileName = file.getFileName(); + boolean isImage = false; + if (fileName.length() > 5) { + + String extension = fileName.substring(fileName.length() - 3); + for (String acceptedExtension : DacoConstants.IMAGE_EXTENSIONS) { + if (extension.equalsIgnoreCase(acceptedExtension)) { + isImage = true; + break; + } + } + } + if (!isImage) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_IMAGE_FORMAT, questionNumber)); + } + else { + FileValidatorUtil.validateFileSize(file, true, errors); + } + } + fileNumber++; + } + break; + case DacoConstants.QUESTION_TYPE_DROPDOWN: { + if (question.isRequired() && "0".equals(recordForm.getAnswer(answerNumber))) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORD_BLANK, + questionNumber)); + + } + } + answerNumber++; + break; + case DacoConstants.QUESTION_TYPE_CHECKBOX: { + if (StringUtils.isBlank(recordForm.getAnswer(answerNumber))) { + if (question.isRequired()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORD_BLANK, + questionNumber)); + } + } + else { + int count = recordForm.getAnswer(answerNumber).split("&").length; + Float min = question.getMin(); + Float max = question.getMax(); + if (min != null && count < min) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_CHECKBOX_MIN, questionNumber, min.intValue())); + } + else if (max != null && count > max) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_CHECKBOX_MAX, questionNumber, max.intValue())); + } + } + } + answerNumber++; + break; + case DacoConstants.QUESTION_TYPE_LONGLAT: { + String longitude = recordForm.getAnswer(answerNumber++); + String latitude = recordForm.getAnswer(answerNumber); + if (StringUtils.isBlank(longitude)) { + if (StringUtils.isBlank(latitude)) { + if (question.isRequired()) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(DacoConstants.ERROR_MSG_RECORD_BLANK, + questionNumber)); + } + } + else { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_LONGITUDE_BLANK, questionNumber)); + } + + } + else if (StringUtils.isBlank(latitude)) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_LATITUDE_BLANK, questionNumber)); + } + else { + try { + Float.parseFloat(longitude); + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_LONGITUDE_FLOAT, questionNumber)); + } + try { + Float.parseFloat(latitude); + } + catch (NumberFormatException e) { + errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( + DacoConstants.ERROR_MSG_RECORD_LATITUDE_FLOAT, questionNumber)); + } + } + } + answerNumber++; + break; + } + questionNumber++; + } + return errors; + } + + protected final int getMaxDays(int month, int year) { + if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) { + return 31; + } + if (month == 2) { + return isLeapYear(year) ? 29 : 28; + } + return 30; + } + + protected final boolean isLeapYear(int year) { + if (year % 4 == 0) { + + if (year % 100 != 0) { + return true; + } + else if (year % 400 == 0) { + return false; + } + else { + return false; + } + } + else { + return false; + } + } + + protected ActionForward editRecord(ActionMapping mapping, ActionForm form, HttpServletRequest request) { + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + int recordIndex = NumberUtils.stringToInt(request.getParameter(DacoConstants.PARAM_RECORD_INDEX), -1); + List> records = (List>) sessionMap.get(DacoConstants.ATTR_RECORD_LIST); + if (recordIndex != -1 && records != null && records.size() >= recordIndex) { + List record = records.get(recordIndex - 1); + RecordForm recordForm = (RecordForm) form; + recordForm.setDisplayedRecordNumber(recordIndex); + recordForm.setSessionMapID(sessionMapID); + StringBuilder checkboxes = null; + int checkboxQuestionNumber = 0; + for (int answerNumber = 0; answerNumber < record.size(); answerNumber++) { + DacoAnswer answer = record.get(answerNumber); + if (answer.getQuestion().getType() == DacoConstants.QUESTION_TYPE_CHECKBOX) { + if (checkboxes == null) { + checkboxes = new StringBuilder(record.size() * 3); + checkboxQuestionNumber = answerNumber; + } + checkboxes.append(answer.getAnswer()).append('&'); + } + else { + if (checkboxes != null) { + recordForm.setAnswer(checkboxQuestionNumber, checkboxes.toString()); + checkboxes = null; + } + recordForm.setAnswer(answerNumber, answer.getAnswer()); + } + } + if (checkboxes != null) { + recordForm.setAnswer(checkboxQuestionNumber, checkboxes.toString()); + } + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMapID); + sessionMap.put(DacoConstants.ATTR_LEARNING_CURRENT_TAB, 1); + request.setAttribute(DacoConstants.ATTR_DISPLAYED_RECORD_NUMBER, recordIndex); + return mapping.findForward(DacoConstants.SUCCESS); + } + else { + return null; + } + } + + protected ActionForward removeRecord(ActionMapping mapping, HttpServletRequest request) { + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + int recordIndex = NumberUtils.stringToInt(request.getParameter(DacoConstants.PARAM_RECORD_INDEX), -1); + List> records = (List>) sessionMap.get(DacoConstants.ATTR_RECORD_LIST); + if (recordIndex != -1 && records != null && records.size() >= recordIndex) { + records.remove(recordIndex - 1); + sessionMap.put(DacoConstants.ATTR_RECORD_LIST, records); + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMapID); + return mapping.findForward(DacoConstants.SUCCESS); + } + else { + return null; + } + } + + protected ActionForward changeView(ActionMapping mapping, HttpServletRequest request) { + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMapID); + request.setAttribute(DacoConstants.ATTR_DISPLAYED_RECORD_NUMBER, WebUtil.readIntParam(request, + DacoConstants.ATTR_DISPLAYED_RECORD_NUMBER)); + String currentView = (String) sessionMap.get(DacoConstants.ATTR_LEARNING_VIEW); + if (DacoConstants.LEARNING_VIEW_HORIZONTAL.equals(currentView)) { + sessionMap.put(DacoConstants.ATTR_LEARNING_VIEW, DacoConstants.LEARNING_VIEW_VERTICAL); + } + else { + sessionMap.put(DacoConstants.ATTR_LEARNING_VIEW, DacoConstants.LEARNING_VIEW_HORIZONTAL); + } + return mapping.findForward(DacoConstants.SUCCESS); + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/MonitoringAction.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/MonitoringAction.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/MonitoringAction.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,218 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.daco.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.daco.DacoConstants; +import org.lamsfoundation.lams.tool.daco.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.daco.dto.Summary; +import org.lamsfoundation.lams.tool.daco.model.Daco; +import org.lamsfoundation.lams.tool.daco.model.DacoSession; +import org.lamsfoundation.lams.tool.daco.model.DacoUser; +import org.lamsfoundation.lams.tool.daco.service.IDacoService; +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(); + + request.setAttribute("initialTabId",WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB,true)); + + if (param.equals("summary")) { + return summary(mapping, form, request, response); + } + + if (param.equals("listuser")) { + return listuser(mapping, form, request, response); + } + if (param.equals("showquestion")) { + return showquestion(mapping, form, request, response); + } + if (param.equals("hidequestion")) { + return hidequestion(mapping, form, request, response); + } + if (param.equals("viewReflection")) { + return viewReflection(mapping, form, request, response); + } + + + return mapping.findForward(DacoConstants.ERROR); + } + + + private ActionForward hidequestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + Long questionUid = WebUtil.readLongParam(request, DacoConstants.PARAM_DACO_QUESTION_UID); + IDacoService service = getDacoService(); + service.setQuestionVisible(questionUid,false); + + //get back SessionMap + String sessionMapID = request.getParameter(DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + + //update session value + List groupList = (List) sessionMap.get(DacoConstants.ATTR_SUMMARY_LIST); + if(groupList != null) + for(List group : groupList){ + for(Summary sum: group){ + if(questionUid.equals(sum.getQuestionUid())){ + sum.setQuestionHide(true); + break; + } + } + } + + return mapping.findForward(DacoConstants.SUCCESS); + } + + private ActionForward showquestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long questionUid = WebUtil.readLongParam(request, DacoConstants.PARAM_DACO_QUESTION_UID); + IDacoService service = getDacoService(); + service.setQuestionVisible(questionUid,true); + + //get back SessionMap + String sessionMapID = request.getParameter(DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + + //update session value + List groupList = (List) sessionMap.get(DacoConstants.ATTR_SUMMARY_LIST); + if(groupList != null) + for(List group : groupList){ + for(Summary sum: group){ + if(questionUid.equals(sum.getQuestionUid())){ + sum.setQuestionHide(false); + break; + } + } + } + return mapping.findForward(DacoConstants.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(DacoConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); +// save contentFolderID into session + sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID,WebUtil.readStrParam(request,AttributeNames.PARAM_CONTENT_FOLDER_ID)); + + Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + IDacoService service = getDacoService(); + List> groupList = service.getSummary(contentId); + + Daco daco = service.getDacoByContentId(contentId); + daco.toDTO(); + + Map >relectList = service.getReflectList(contentId); + + //cache into sessionMap + sessionMap.put(DacoConstants.ATTR_SUMMARY_LIST, groupList); + sessionMap.put(DacoConstants.PAGE_EDITABLE, daco.isContentInUse()); + sessionMap.put(DacoConstants.ATTR_DACO, daco); + sessionMap.put(DacoConstants.ATTR_TOOL_CONTENT_ID, contentId); + sessionMap.put(DacoConstants.ATTR_REFLECT_LIST, relectList); + + return mapping.findForward(DacoConstants.SUCCESS); + } + + private ActionForward listuser(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + Long sessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + Long questionUid = WebUtil.readLongParam(request, DacoConstants.PARAM_DACO_QUESTION_UID); + + //get user list by given question uid + IDacoService service = getDacoService(); + List list = service.getUserListBySessionQuestion(sessionId, questionUid); + + //set to request + request.setAttribute(DacoConstants.ATTR_USER_LIST, list); + return mapping.findForward(DacoConstants.SUCCESS); + } + + private ActionForward viewReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + Long uid = WebUtil.readLongParam(request, DacoConstants.ATTR_USER_UID); + Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + + IDacoService service = getDacoService(); + DacoUser user = service.getUser(uid); + NotebookEntry notebookEntry = service.getEntry(sessionID, + CoreNotebookConstants.NOTEBOOK_TOOL, + DacoConstants.TOOL_SIGNATURE, user.getUserId().intValue()); + + DacoSession session = service.getDacoSessionBySessionId(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.getDaco().getReflectInstructions()); + + request.setAttribute("userDTO", refDTO); + return mapping.findForward("success"); + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + private IDacoService getDacoService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + return (IDacoService) wac.getBean(DacoConstants.DACO_SERVICE); + } +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/ViewQuestionAction.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/ViewQuestionAction.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/action/ViewQuestionAction.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,206 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.daco.web.action; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +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.lang.math.NumberUtils; +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.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.daco.DacoConstants; +import org.lamsfoundation.lams.tool.daco.model.DacoQuestion; +import org.lamsfoundation.lams.tool.daco.service.IDacoService; +import org.lamsfoundation.lams.tool.daco.util.DacoQuestionComparator; +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; + +public class ViewQuestionAction extends Action { + + private static final Logger log = Logger.getLogger(ViewQuestionAction.class); + private static final String DEFUALT_PROTOCOL_REFIX = "http://"; + private static final String ALLOW_PROTOCOL_REFIX = new String("[http://|https://|ftp://|nntp://]"); + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + + String param = mapping.getParameter(); + // -----------------------Display Learning Object function + // --------------------------- + if (param.equals("reviewQuestion")) { + return reviewQuestion(mapping, form, request, response); + } + // for preview top frame html page use: + if (param.equals("nextInstruction")) { + return nextInstruction(mapping, form, request, response); + } + return mapping.findForward(DacoConstants.ERROR); + } + + /** + * Return next instrucion to page. It need four input parameters, mode, questionIndex or questionUid, and insIndex. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward nextInstruction(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + String mode = request.getParameter(AttributeNames.ATTR_MODE); + + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sesionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + + DacoQuestion question = getDacoQuestion(request, sesionMap, mode); + if (question == null) { + return mapping.findForward(DacoConstants.ERROR); + } + + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMapID); + return mapping.findForward(DacoConstants.SUCCESS); + } + + /** + * Display main frame to display instrcution and question content. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward reviewQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + String mode = request.getParameter(AttributeNames.ATTR_MODE); + + String sessionMapID = WebUtil.readStrParam(request, DacoConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + + DacoQuestion question = getDacoQuestion(request, sessionMap, mode); + + String idStr = request.getParameter(DacoConstants.ATTR_TOOL_SESSION_ID); + Long sessionId = NumberUtils.createLong(idStr); + // mark this question access flag if it is learner + if (ToolAccessMode.LEARNER.toString().equals(mode)) { + IDacoService service = getDacoService(); + HttpSession ss = SessionManager.getSession(); + // get back login user DTO + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + service.setQuestionAccess(question.getUid(), new Long(user.getUserID().intValue()), sessionId); + } + + if (question == null) { + return mapping.findForward(DacoConstants.ERROR); + } + // set url to content frame + request.setAttribute(DacoConstants.ATTR_QUESTION_REVIEW_URL, getReviewUrl(question, sessionMapID)); + + // these attribute will be use to instruction navigator page + request.setAttribute(AttributeNames.ATTR_MODE, mode); + int questionIndex = NumberUtils.stringToInt(request.getParameter(DacoConstants.PARAM_QUESTION_INDEX)); + request.setAttribute(DacoConstants.PARAM_QUESTION_INDEX, questionIndex); + Long questionUid = NumberUtils.createLong(request.getParameter(DacoConstants.PARAM_DACO_QUESTION_UID)); + request.setAttribute(DacoConstants.PARAM_DACO_QUESTION_UID, questionUid); + request.setAttribute(DacoConstants.ATTR_TOOL_SESSION_ID, sessionId); + request.setAttribute(DacoConstants.ATTR_SESSION_MAP_ID, sessionMapID); + + return mapping.findForward(DacoConstants.SUCCESS); + + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + /** + * Return question according to ToolAccessMode. + * + * @param request + * @param sessionMap + * @param mode + * @return + */ + private DacoQuestion getDacoQuestion(HttpServletRequest request, SessionMap sessionMap, String mode) { + DacoQuestion question = null; + if (DacoConstants.MODE_AUTHOR_SESSION.equals(mode)) { + int questionIndex = NumberUtils.stringToInt(request.getParameter(DacoConstants.PARAM_QUESTION_INDEX), 0); + // authoring: does not save question yet, so only has QuestionList + // from session and identity by Index + List dacoList = new ArrayList(getDacoQuestionList(sessionMap)); + question = dacoList.get(questionIndex); + } + else { + Long questionUid = NumberUtils.createLong(request.getParameter(DacoConstants.PARAM_DACO_QUESTION_UID)); + // get back the daco and question list and display them on page + IDacoService service = getDacoService(); + question = service.getDacoQuestionByUid(questionUid); + } + return question; + } + + private IDacoService getDacoService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); + return (IDacoService) wac.getBean(DacoConstants.DACO_SERVICE); + } + + private Object getReviewUrl(DacoQuestion question, String sessionMapID) { + return ""; + } + + /** + * List save current daco questions. + * + * @param request + * @return + */ + private SortedSet getDacoQuestionList(SessionMap sessionMap) { + SortedSet list = (SortedSet) sessionMap.get(DacoConstants.ATTR_QUESTION_LIST); + if (list == null) { + list = new TreeSet(new DacoQuestionComparator()); + sessionMap.put(DacoConstants.ATTR_QUESTION_LIST, list); + } + return list; + } + +} Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/DacoForm.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/DacoForm.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/DacoForm.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,130 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.web.form; + +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.tool.daco.model.Daco; + +/** + * + * Daco Form. + * + * @struts.form name="dacoForm" + * + * User: Dapeng.Ni + */ +public class DacoForm extends ActionForm { + private static final long serialVersionUID = 3599879328307492312L; + + private static Logger logger = Logger.getLogger(DacoForm.class.getName()); + + // Forum fields + private String sessionMapID; + private String contentFolderID; + private int currentTab; + private FormFile offlineFile; + private FormFile onlineFile; + + private Daco daco; + + public DacoForm() { + daco = new Daco(); + daco.setTitle("Data Collection"); + currentTab = 1; + } + + public void setDaco(Daco daco) { + this.daco = daco; + // set Form special varaible from given forum + if (daco == null) { + DacoForm.logger.error("Initial Data Collection failed by null value of Daco."); + } + } + + @Override + 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")) { + + daco.setLockWhenFinished(true); + daco.setDefineLater(false); + + daco.setRunOffline(false); + daco.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 Daco getDaco() { + return daco; + } + + 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; + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/DacoQuestionForm.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/DacoQuestionForm.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/DacoQuestionForm.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,120 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.web.form; + +import org.apache.struts.action.ActionForm; + +/** + * Daco Question Form. + * + * @struts.form name="dacoQuestionForm" + * @author Marcin Cieslak + * + * @version $Revision$ + */ +public class DacoQuestionForm extends ActionForm { + private String questionIndex; + private String sessionMapID; + + private short questionType; + private String min; + private String max; + private Short digitsDecimal; + private Short summary; + private String description; + + private boolean questionRequired; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getQuestionIndex() { + return questionIndex; + } + + public void setQuestionIndex(String questionIndex) { + this.questionIndex = questionIndex; + } + + public short getQuestionType() { + return questionType; + } + + public void setQuestionType(short type) { + questionType = type; + } + + public String getMin() { + return min; + } + + public void setMin(String min) { + this.min = min; + } + + public String getMax() { + return max; + } + + public void setMax(String max) { + this.max = max; + } + + public boolean isQuestionRequired() { + return questionRequired; + } + + public void setQuestionRequired(boolean isRequired) { + questionRequired = isRequired; + } + + public String getSessionMapID() { + return sessionMapID; + } + + public void setSessionMapID(String sessionMapID) { + this.sessionMapID = sessionMapID; + } + + public Short getSummary() { + return summary; + } + + public void setSummary(Short summary) { + this.summary = summary; + } + + public Short getDigitsDecimal() { + return digitsDecimal; + } + + public void setDigitsDecimal(Short digitsDecimal) { + this.digitsDecimal = digitsDecimal; + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/RecordForm.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/RecordForm.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/RecordForm.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,110 @@ +/**************************************************************** + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.web.form; + +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.upload.FormFile; + +/** + * + * Record Form. + * + * @struts.form name="recordForm" + * @author Marcin Cieslak + */ +public class RecordForm extends ActionForm { + + private static Logger logger = Logger.getLogger(RecordForm.class.getName()); + private String sessionMapID; + + private List answer; + private List file; + private int displayedRecordNumber = 1; + + public void setAnswer(int number, String answer) { + if (this.answer == null) { + this.answer = new ArrayList(); + } + while (number >= this.answer.size()) { + this.answer.add(null); + } + this.answer.set(number, answer); + } + + public String getAnswer(int number) { + if (answer == null || number >= answer.size()) { + return null; + } + return answer.get(number); + } + + public void setFile(int number, FormFile file) { + if (file.getFileSize() > 0) { + if (this.file == null) { + this.file = new ArrayList(); + } + while (number >= this.file.size()) { + this.file.add(null); + } + this.file.set(number, file); + } + } + + public FormFile getFile(int number) { + if (file == null || number >= file.size()) { + return null; + } + return file.get(number); + } + + @Override + public void reset(ActionMapping mapping, HttpServletRequest request) { + answer = null; + file = null; + displayedRecordNumber = 1; + } + + public String getSessionMapID() { + return sessionMapID; + } + + public void setSessionMapID(String sessionMapID) { + this.sessionMapID = sessionMapID; + } + + public int getDisplayedRecordNumber() { + return displayedRecordNumber; + } + + public void setDisplayedRecordNumber(int displayedRecordNumber) { + this.displayedRecordNumber = displayedRecordNumber; + } +} \ No newline at end of file Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/ReflectionForm.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/ReflectionForm.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/form/ReflectionForm.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id$$ */ +package org.lamsfoundation.lams.tool.daco.web.form; + +import org.apache.log4j.Logger; +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; + + 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_daco/src/java/org/lamsfoundation/lams/tool/daco/web/servlet/ExportServlet.java =================================================================== diff -u --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/servlet/ExportServlet.java (revision 0) +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/web/servlet/ExportServlet.java (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,229 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $$Id$$ */ + +package org.lamsfoundation.lams.tool.daco.web.servlet; + +import java.io.File; +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.daco.DacoConstants; +import org.lamsfoundation.lams.tool.daco.dto.Summary; +import org.lamsfoundation.lams.tool.daco.model.Daco; +import org.lamsfoundation.lams.tool.daco.model.DacoSession; +import org.lamsfoundation.lams.tool.daco.model.DacoUser; +import org.lamsfoundation.lams.tool.daco.service.DacoApplicationException; +import org.lamsfoundation.lams.tool.daco.service.DacoServiceProxy; +import org.lamsfoundation.lams.tool.daco.service.IDacoService; +import org.lamsfoundation.lams.tool.daco.util.DacoToolContentHandler; +import org.lamsfoundation.lams.util.FileUtil; +import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet; +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; + +/** + * Export portfolio servlet to export all shared daco into offline HTML package. + * + * @author Steve.Ni + * + * @version $Revision$ + */ +public class ExportServlet extends AbstractExportPortfolioServlet { + private static final long serialVersionUID = -4529093489007108143L; + + private static Logger logger = Logger.getLogger(ExportServlet.class); + + private final String FILENAME = "shared_daco_main.html"; + + private DacoToolContentHandler handler; + + @Override + 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 (DacoApplicationException e) { + ExportServlet.logger.error("Cannot perform export for daco 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; + } + + @Override + protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, + Cookie[] cookies) { + if (toolContentID == null && toolSessionID == null) { + ExportServlet.logger.error("Tool content Id or and session Id are null. Unable to activity title"); + } + else { + IDacoService service = DacoServiceProxy.getDacoService(getServletContext()); + Daco content = null; + if (toolContentID != null) { + content = service.getDacoByContentId(toolContentID); + } + else { + DacoSession session = service.getDacoSessionBySessionId(toolSessionID); + if (session != null) { + content = session.getDaco(); + } + } + if (content != null) { + activityTitle = content.getTitle(); + } + } + return super.doOfflineExport(request, response, directoryName, cookies); + } + + public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies, + HashMap sessionMap) throws DacoApplicationException { + + IDacoService service = DacoServiceProxy.getDacoService(getServletContext()); + + if (userID == null || toolSessionID == null) { + String error = "Tool session Id or user Id is null. Unable to continue"; + ExportServlet.logger.error(error); + throw new DacoApplicationException(error); + } + + DacoUser learner = service.getUserByIDAndSession(userID, toolSessionID); + + if (learner == null) { + String error = "The user with user id " + userID + " does not exist."; + ExportServlet.logger.error(error); + throw new DacoApplicationException(error); + } + + Daco content = service.getDacoBySessionId(toolSessionID); + + if (content == null) { + String error = "The content for this activity has not been defined yet."; + ExportServlet.logger.error(error); + throw new DacoApplicationException(error); + } + + List group = service.exportBySessionId(toolSessionID, true); + saveFileToLocal(group, directoryName); + + List groupList = new ArrayList(); + if (group.size() > 0) { + groupList.add(group); + } + sessionMap.put(DacoConstants.ATTR_TITLE, content.getTitle()); + sessionMap.put(DacoConstants.ATTR_SUMMARY_LIST, groupList); + } + + public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies, + HashMap sessionMap) throws DacoApplicationException { + IDacoService service = DacoServiceProxy.getDacoService(getServletContext()); + + // check if toolContentId exists in db or not + if (toolContentID == null) { + String error = "Tool Content Id is missing. Unable to continue"; + ExportServlet.logger.error(error); + throw new DacoApplicationException(error); + } + + Daco content = service.getDacoByContentId(toolContentID); + + if (content == null) { + String error = "Data is missing from the database. Unable to Continue"; + ExportServlet.logger.error(error); + throw new DacoApplicationException(error); + } + List> groupList = service.exportByContentId(toolContentID); + if (groupList != null) { + for (List list : groupList) { + saveFileToLocal(list, directoryName); + } + } + // put it into HTTPSession + sessionMap.put(DacoConstants.ATTR_TITLE, content.getTitle()); + sessionMap.put(DacoConstants.ATTR_SUMMARY_LIST, groupList); + } + + private void saveFileToLocal(List list, String directoryName) { + handler = getToolContentHandler(); + for (Summary summary : list) { + // for learning object, it just display "No offlice pakcage avaliable" information. + if (summary.getQuestionType() == DacoConstants.QUESTION_TYPE_TEXTFIELD) { + continue; + } + try { + int index = 1; + String userName = summary.getUsername(); + String localDir; + while (true) { + localDir = FileUtil.getFullPath(directoryName, userName + "/" + index); + File local = new File(localDir); + if (!local.exists()) { + local.mkdirs(); + break; + } + index++; + } + // REMOVED!! + } + catch (Exception e) { + ExportServlet.logger.error("Export forum topic attachment failed: " + e.toString()); + } + } + + } + + private DacoToolContentHandler getToolContentHandler() { + if (handler == null) { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext()); + handler = (DacoToolContentHandler) wac.getBean(DacoConstants.TOOL_CONTENT_HANDLER_NAME); + } + return handler; + } +} Index: lams_tool_daco/web/403.jsp =================================================================== diff -u --- lams_tool_daco/web/403.jsp (revision 0) +++ lams_tool_daco/web/403.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/404.jsp =================================================================== diff -u --- lams_tool_daco/web/404.jsp (revision 0) +++ lams_tool_daco/web/404.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/WEB-INF/.cvsignore =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/.cvsignore (revision 0) +++ lams_tool_daco/web/WEB-INF/.cvsignore (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,4 @@ +lib +struts-config.xml +validation.xml +classes Index: lams_tool_daco/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/AuthoringButton.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/AuthoringButton.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * 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_daco/web/WEB-INF/tags/Date.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/Date.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/Date.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * 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" %> +<%@ attribute name="style" required="false" rtexprvalue="true"%> +<%@ attribute name="type" required="false" rtexprvalue="true"%> + +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-core" prefix="c" %> + + + + + + + + + + + + + Index: lams_tool_daco/web/WEB-INF/tags/DefineLater.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/DefineLater.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/DefineLater.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,58 @@ + +<% + /**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * 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_daco/web/WEB-INF/tags/ExportPortOutput.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/ExportPortOutput.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/ExportPortOutput.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * 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" %> + +
  • + + + " target="_blank"/> + + + + + + + + +
      + + + +
    +
    +
    + +
  • + Index: lams_tool_daco/web/WEB-INF/tags/FCKEditor.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/FCKEditor.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/FCKEditor.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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="false" rtexprvalue="true"%> + + + + + + + + + +/fckeditor/ + + + + + ${value} + + + + + Index: lams_tool_daco/web/WEB-INF/tags/Head.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/Head.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/Head.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/** + * Head.tag + * Author: Fiona Malikoff + * Description: Sets up the non-cache pragma statements and the UTF-8 + * encoding. Use in place of the normal head tag. + */ +%> + +<%@ tag body-content="scriptless"%> + + + + + + + + + Index: lams_tool_daco/web/WEB-INF/tags/ImgButtonWrapper.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/ImgButtonWrapper.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/ImgButtonWrapper.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * ImgButtonWrapper.tag + * Author: Mitchell Seaton + * Description: Simple wrapper that will display buttons correctly when RTL page rendering is used. + */ + + %> +<%@ tag body-content="scriptless" %> +
    +
    + +
    +
    Index: lams_tool_daco/web/WEB-INF/tags/LearnerFlashEnabled.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/LearnerFlashEnabled.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/LearnerFlashEnabled.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,45 @@ +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Learner Flash Enabled + * Author: Fiona Malikoff + * Description: Is Flash enabled for learner? + * + */ + + %> +<%@ tag body-content="empty" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + true + false + + + Index: lams_tool_daco/web/WEB-INF/tags/Passon.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/Passon.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/Passon.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,86 @@ +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Passon + * Author: Mitchell Seaton + * Description: Passes on progress data to the Flash Learner to update the progress bar. + * + */ + + %> +<%@ tag body-content="empty" %> +<%@ attribute name="progress" required="true" rtexprvalue="true" type="java.lang.String" %> +<%@ attribute name="version" required="false" rtexprvalue="true" %> +<%@ attribute name="id" required="true" rtexprvalue="true" %> +<%@ attribute name="redirect" required="false" rtexprvalue="true" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/web/WEB-INF/tags/ProgressOutput.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/ProgressOutput.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/ProgressOutput.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,79 @@ +<% +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Progress Output + * Author: Fiona Malikoff + * Description: Outputs the Activity details on the jsp progress page. Recursive tag + * + */ + + /** Need to add current ! */ + + %> +<%@ tag body-content="empty" %> +<%@ attribute name="activity" required="true" rtexprvalue="true" type="org.lamsfoundation.lams.learning.web.bean.ActivityURL" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + +
  • + + + + + + + + + + + + + + + + + + + + + + + + ${activity.title} + + + + + +
      + + + +
    +
    +
    + +
  • + Index: lams_tool_daco/web/WEB-INF/tags/Tab.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/Tab.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/Tab.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,85 @@ +<% + /**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + /** + * Tab.tag + * Author: Mitchell Seaton + * Description: Creates a tab element. + * Wiki: + */ +%> +<%@ tag body-content="empty"%> +<%@ attribute name="id" required="true" rtexprvalue="true"%> +<%@ attribute name="value" required="false" rtexprvalue="true"%> +<%@ attribute name="key" required="false" rtexprvalue="true"%> +<%@ attribute name="inactive" required="false" rtexprvalue="true"%> +<%@ attribute name="methodCall" required="false" rtexprvalue="true"%> + +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + +<%-- Check if bundle is set --%> + + + + + + + + + + +<%-- + 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_daco/web/WEB-INF/tags/TabBody.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/TabBody.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/TabBody.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/** + * TabBody.tag + * Author: Mitchell Seaton + * Description: Creates the body container for a tab element + * Wiki: + */ + + %> +<%@ tag body-content="scriptless"%> +<%@ attribute name="id" required="true" rtexprvalue="true"%> +<%@ attribute name="tabTitle" required="false" rtexprvalue="true"%> +<%@ attribute name="titleKey" required="false" rtexprvalue="true"%> +<%@ attribute name="page" required="false" rtexprvalue="true"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-bean" prefix="bean"%> + + +
    + + + + + + + + + +
    + Index: lams_tool_daco/web/WEB-INF/tags/TabName.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/TabName.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/TabName.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,60 @@ +<%/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/** + * TabName Tag + * Author: Mitchell Seaton + * Description: Shortens name that are too long to fit inside a tab + */ + + %> +<%@ tag body-content="scriptless" %> + +<%@ attribute name="url" required="true" rtexprvalue="true"%> +<%@ attribute name="highlight" required="false" rtexprvalue="true" %> + +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-function" prefix="fn"%> + +12 + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/web/WEB-INF/tags/Tabs.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/Tabs.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/Tabs.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/** + * Tabs.tag + * Author: Mitchell Seaton + * Description: Create a tab list from a input collection or nested Tab tags. + * Wiki: + */ + + %> +<%@ tag body-content="scriptless"%> +<%@ attribute name="collection" type="java.util.Collection" required="false" rtexprvalue="true"%> +<%@ attribute name="control" required="false" rtexprvalue="true"%> +<%@ attribute name="useKey" required="false" rtexprvalue="true"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + + + + + + + + + + + + Index: lams_tool_daco/web/WEB-INF/tags/headItems.tag =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tags/headItems.tag (revision 0) +++ lams_tool_daco/web/WEB-INF/tags/headItems.tag (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * 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_daco/web/WEB-INF/tiles-defs.xml =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tiles-defs.xml (revision 0) +++ lams_tool_daco/web/WEB-INF/tiles-defs.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_daco/web/WEB-INF/tlds/fckeditor/FCKeditor.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/fckeditor/FCKeditor.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/fckeditor/FCKeditor.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/WEB-INF/tlds/jstl/c.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/jstl/c.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/jstl/c.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 daco to import. + + url + true + true + + + +Name of the exported scoped variable for the +daco'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 +daco's content. The type of the scoped +variable is Reader. + + varReader + false + false + + + +Name of the context when accessing a relative +URL daco that belongs to a foreign +context. + + context + false + true + + + +Character encoding of the content at the input +daco. + + 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 questions 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 daco to redirect to. + + url + false + true + + + +Name of the context when redirecting to a relative URL +daco 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 +daco 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_daco/web/WEB-INF/tlds/jstl/fmt.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/jstl/fmt.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/jstl/fmt.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 daco bundle to be used by its tag body + + bundle + org.apache.taglibs.standard.tag.rt.fmt.BundleTag + JSP + + +Daco bundle base name. This is the bundle's +fully-qualified daco 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 daco bundle and stores it in the named scoped variable or + the bundle configuration variable + + setBundle + org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag + empty + + +Daco bundle base name. This is the bundle's +fully-qualified daco 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 daco +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_daco/web/WEB-INF/tlds/jstl/fn.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/jstl/fn.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/jstl/fn.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/WEB-INF/tlds/jstl/x.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/jstl/x.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/jstl/x.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/WEB-INF/tlds/lams/lams.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/lams/lams.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/lams/lams.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,508 @@ + + + + + 1.0 + lams + + LAMSTags + + + + + 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 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 + + + + + + + Get the configuration value for the specified key + Configuration value + + + Configuration + org.lamsfoundation.lams.web.tag.ConfigurationTag + empty + + + Get the configuration value for the specified key + key + false + + true + + + + + + + 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 + + + + + + + Converts text from \n or \r\n to <BR> before rendering + Converts text from \n or \r\n to <BR> before rendering + + + out + org.lamsfoundation.lams.web.tag.MultiLinesOutputTag + empty + + + Converts text from \n or \r\n to <BR> before rendering + value + true + + true + + + + Converts text from \n or \r\n to <BR> before rendering + escapeHtml + false + + true + + + + + + + Help tag + Help tag + + + help + org.lamsfoundation.lams.web.tag.HelpTag + empty + + + Help tag + module + false + + true + + + + Help tag + toolSignature + false + + true + + + + Help tag + page + false + + true + + + + Help tag + style + false + + true + + + + + + + Converts role name into form usable as message daco key + Converts role name into form usable as message daco key + + + role + org.lamsfoundation.lams.web.tag.RoleTag + empty + + + Converts role name into form usable as message daco key + role + true + + true + + + + + + + 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 + + + + Output stylesheet based on the user preferences. + style + 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 + + + + + + + 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 + + + TabName + /WEB-INF/tags/TabName.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 + + + ImgButtonWrapper + /WEB-INF/tags/ImgButtonWrapper.tag + + + textarea + org.lamsfoundation.lams.web.tag.LAMSMultiLinesTextareaTag + JSP + true + + Render text exactly same as original input, which even won't escape the input HTML tag. + + + + + name + true + true + + + + + id + false + true + + + + + onchange + false + true + + + + head + /WEB-INF/tags/Head.tag + + + ProgressOutput + /WEB-INF/tags/ProgressOutput.tag + + + LearnerFlashEnabled + /WEB-INF/tags/LearnerFlashEnabled.tag + + + Index: lams_tool_daco/web/WEB-INF/tlds/struts/struts-bean.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/struts/struts-bean.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/struts/struts-bean.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 + + + +resource +org.apache.struts.taglib.bean.ResourceTag +org.apache.struts.taglib.bean.ResourceTei +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_daco/web/WEB-INF/tlds/struts/struts-html.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/struts/struts-html.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/struts/struts-html.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/WEB-INF/tlds/struts/struts-logic.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/struts/struts-logic.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/struts/struts-logic.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/WEB-INF/tlds/struts/struts-nested.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/struts/struts-nested.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/struts/struts-nested.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/WEB-INF/tlds/struts/struts-tiles.tld =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/tlds/struts/struts-tiles.tld (revision 0) +++ lams_tool_daco/web/WEB-INF/tlds/struts/struts-tiles.tld (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/WEB-INF/web.xml =================================================================== diff -u --- lams_tool_daco/web/WEB-INF/web.xml (revision 0) +++ lams_tool_daco/web/WEB-INF/web.xml (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,351 @@ + + + + Shared Daco + + Shared Daco tool + + + javax.servlet.jsp.jstl.fmt.localizationContext + org.lamsfoundation.lams.tool.daco.ApplicationResources + + + 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/daco/dacoApplicationContext.xml + + + + + + org.springframework.web.context.ContextLoaderListener + + + + + hibernateFilter + + org.springframework.orm.hibernate3.support.OpenSessionInViewFilter + + + sessionFactoryBeanName + dacoSessionFactory + + + + + 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.daco.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 + dacoToolContentHandler + + 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 + AUTHOR ADMIN + + + + + + Authoring Update + /authoring/* + + + AUTHOR + AUTHOR ADMIN + SYSADMIN + + + + + 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/ + + + LEARNER + AUTHOR + MONITOR + TEACHER + ADMIN + SYSADMIN + AUTHOR ADMIN + + + + + + + + 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 + + + + Can create/modify a learning design and edit default tool content + AUTHOR ADMIN + + + + + FORM + LAMS + + /login.jsp + /login.jsp?failed=y + + + + + 500 + /error.jsp + + + 403 + /403.jsp + + + 404 + /404.jsp + + + Index: lams_tool_daco/web/common/fckeditorheader.jsp =================================================================== diff -u --- lams_tool_daco/web/common/fckeditorheader.jsp (revision 0) +++ lams_tool_daco/web/common/fckeditorheader.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,5 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + Index: lams_tool_daco/web/common/footer.jsp =================================================================== diff -u --- lams_tool_daco/web/common/footer.jsp (revision 0) +++ lams_tool_daco/web/common/footer.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1 @@ +
    Index: lams_tool_daco/web/common/header.jsp =================================================================== diff -u --- lams_tool_daco/web/common/header.jsp (revision 0) +++ lams_tool_daco/web/common/header.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,17 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + Index: lams_tool_daco/web/common/messages.jsp =================================================================== diff -u --- lams_tool_daco/web/common/messages.jsp (revision 0) +++ lams_tool_daco/web/common/messages.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,8 @@ +<%-- Error Messages --%> + +

    + +
    +
    +

    +
    Index: lams_tool_daco/web/common/tabbedheader.jsp =================================================================== diff -u --- lams_tool_daco/web/common/tabbedheader.jsp (revision 0) +++ lams_tool_daco/web/common/tabbedheader.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,17 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + Index: lams_tool_daco/web/common/taglibs.jsp =================================================================== diff -u --- lams_tool_daco/web/common/taglibs.jsp (revision 0) +++ lams_tool_daco/web/common/taglibs.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,11 @@ +<%@ 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"%> \ No newline at end of file Index: lams_tool_daco/web/error.jsp =================================================================== diff -u --- lams_tool_daco/web/error.jsp (revision 0) +++ lams_tool_daco/web/error.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/images/icon_daco.swf =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/css/daco.css =================================================================== diff -u --- lams_tool_daco/web/includes/css/daco.css (revision 0) +++ lams_tool_daco/web/includes/css/daco.css (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,95 @@ +.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; +} + +div.info { + color: #000000; + padding:8px 10px 10px 40px; + margin-top: 25px; + margin-left: auto; + margin-right: auto; + text-align: left; + font-weight: normal; + background: url('../images/css/edit.gif') no-repeat #d8e4f1 10px 8px; + width: 70%; + border: 1px solid #3c78b5; + float: none; +} + +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; +} +.hint { + font-style: italic; +} +table.recordList { + border-bottom: thin black solid; +} + + +form#recordForm input, form#recordForm textarea, form#recordForm select{ + margin-top: 6px; +} +.button-add-div { + padding-left: 30px; +} +div.bigNumber{ + font-weight: bold; + font-size: larger; + padding-top: 5px; +} +table#horizontalListTable { + margin: 0px; + padding: 0px; + height: 100%; +} + +table#horizontalListTable td { + border-left: 1px black solid; +} + +table#recordListTable td.fixedCellHeight, table#horizontalListTable td.fixedCellHeight { + padding-left: 20px; + height: 90px; + vertical-align: middle; +} + +table#horizontalListTable td#lastHorizontalQuestion{ + padding-left: 20px; + height: 75px; + vertical-align: middle; +} + +form#recordForm table.alternative-color-inner-table td, table.recordList table.alternative-color-inner-table td, table#horizontalListTable table.alternative-color-inner-table td { + margin: 0px; + padding: 0px; + border: none; + background: transparent; + vertical-align: middle; +} \ No newline at end of file Index: lams_tool_daco/web/includes/images/.cvsignore =================================================================== diff -u --- lams_tool_daco/web/includes/images/.cvsignore (revision 0) +++ lams_tool_daco/web/includes/images/.cvsignore (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1 @@ +Thumbs.db Index: lams_tool_daco/web/includes/images/cross.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/images/downarrow.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/images/downarrow_disabled.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/images/edit.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/images/indicator.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/images/spacer.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/images/tick.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/images/uparrow.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/images/uparrow_disabled.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/includes/javascript/dacoLearning.js =================================================================== diff -u --- lams_tool_daco/web/includes/javascript/dacoLearning.js (revision 0) +++ lams_tool_daco/web/includes/javascript/dacoLearning.js (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,164 @@ + function init(){ + doSelectTab(currentTab); + readCheckboxQuestionsValues(); + } + + function doSelectTab(tabId) { + selectTab(tabId); + currentTab = tabId; + } + + function finishSession(){ + document.getElementById("finishButton").disabled = true; + document.location.href =''; + return false; + } + + function continueReflect(){ + document.location.href=''; + } + + function saveOrUpdateRecord() { + setCheckboxQuestionsValues(); + document.getElementById("recordForm").submit(); + } + + function setCheckboxQuestionsValues(){ + var elementCount = document.getElementById("recordForm").elements.length; + for (var checkboxQuestionNumber=1;checkboxQuestionNumber<=elementCount;checkboxQuestionNumber++){ + var checkboxQuestion=document.getElementById("checkbox-"+checkboxQuestionNumber); + if (checkboxQuestion!=null){ + var checkboxQuestionValue = ""; + var checkboxNumber = 1; + var checkbox = document.getElementById("checkbox-"+checkboxQuestionNumber+"-"+checkboxNumber); + while (checkbox!=null){ + if (checkbox.checked){ + checkboxQuestionValue += checkboxNumber + "&"; + } + checkboxNumber++; + checkbox = document.getElementById("checkbox-"+checkboxQuestionNumber+"-"+checkboxNumber); + } + checkboxQuestion.value=checkboxQuestionValue; + } + } + } + + function readCheckboxQuestionsValues(){ + var elementCount = document.getElementById("recordForm").elements.length; + for (var checkboxQuestionNumber=1;checkboxQuestionNumber<=elementCount;checkboxQuestionNumber++){ + var checkboxQuestion=document.getElementById("checkbox-"+checkboxQuestionNumber); + if (checkboxQuestion!=null){ + var checkboxValues = checkboxQuestion.value.split("&"); + var checkboxNumber = 1; + var checkbox = document.getElementById("checkbox-"+checkboxQuestionNumber+"-"+checkboxNumber); + while (checkbox!=null){ + for (var index = 0; index recordIndex){ + displayedRecordNumber--; + } + document.getElementById("displayedRecordNumber").value=displayedRecordNumber; + document.getElementById("displayedRecordNumberSpan").innerHTML=displayedRecordNumber; + }, + evalScripts:true + } + ); + } + + function changeView(sessionMapID,displayedRecordNumber){ + var param = "sessionMapID="+sessionMapID+"&reqID="+((new Date()).getTime())+"&displayedRecordNumber="+displayedRecordNumber; + var previousCurrentTab = currentTab; + new Ajax.Updater( + "body", + changeViewUrl, + { + method:'post', + parameters:param, + onComplete: function(){ + var tabNumber = 1; + while (document.getElementById("tabbody"+tabNumber)!=null){ + doSelectTab(tabNumber++); + } + doSelectTab(previousCurrentTab); + }, + evalScripts: true + } + ); + } + + + function resizeHorizontalRecordListFrame(){ + var horizontalRecordListFrame = document.getElementById('horizontalRecordListFrame'); + if (horizontalRecordListFrame!=null){ + horizontalRecordListFrame.style.height=((questionListLength+1)*111)+'px'; + } + } \ No newline at end of file Index: lams_tool_daco/web/includes/javascript/dacoQuestion.js =================================================================== diff -u --- lams_tool_daco/web/includes/javascript/dacoQuestion.js (revision 0) +++ lams_tool_daco/web/includes/javascript/dacoQuestion.js (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,126 @@ + //"Div" area that holds the answer options + var answerOptionTargetDiv = "#answerOptionsArea"; + + //Initial behavior + $(document).ready(function() { + defaultShowAdditionaOptionsArea(); + resizeQuestionInputArea (); + }); + + //Checks if the element exists and has an empty value + function checkNonDefaultValue(elementName){ + var elem = document.getElementById(elementName); + return (elem!=null && elem.value!=""); + } + + //Resizes the question input area so it is visible on the screen. + function resizeQuestionInputArea (){ + var questionInputArea = window.top.document.getElementById('questionInputArea'); + questionInputArea.style.height=questionInputArea.contentWindow.document.body.scrollHeight+'px'; + } + + //Checks if the additional options area has all the default values, so it may stay hidden + function defaultShowAdditionaOptionsArea(){ + if (checkNonDefaultValue("max") + || checkNonDefaultValue("min") + || checkNonDefaultValue("digitsDecimal") + || $('#questionRequired').attr('checked')){ + toggleAdditionalOptionsArea(); + } + } + + //Shows or hides the additional options area + function toggleAdditionalOptionsArea(){ + $("#additionalOptionsArea").toggle("slow",function(){ + if ($('#additionalOptionsArea').is(':visible')){ + $('#toggleAdditionalOptionsAreaLink').text(msgHideAdditionalOptions); + } + else { + $('#toggleAdditionalOptionsAreaLink').text(msgShowAdditionalOptions); + } + resizeQuestionInputArea(); + }); + } + + //Creates an additional blank answer option + function addAnswerOption(){ + var reqIDVar = new Date(); + var param = $("#answerOptionsForm").serializeArray(); + + addToJSON(param,'reqID',reqIDVar.getTime()); + + answerOperationStarted(); + $(answerOptionTargetDiv).load(addAnswerOptionUrl,param,answerOperationComplete); + } + + //Removes the chosen answer option + function removeAnswerOption(index){ + var reqIDVar = new Date(); + var param = $("#answerOptionsForm").serializeArray(); + + addToJSON(param,'reqID',reqIDVar.getTime()); + addToJSON(param,'removeIndex',index); + + answerOperationStarted(); + $(answerOptionTargetDiv).load(removeAnswerOptionUrl,param,answerOperationComplete); + } + + //Moves the chosen answer option one place up + function upItem(itemIndex){digitsDecimal + if(itemIndex == 0) + return; + var currId = "#answerOptionItemDesc" + itemIndex; + var repId = "#answerOptionItemDesc" + (--itemIndex); + switchValue(currId,repId); + } + + //Moves the chosen answer option one place down + function downItem(itemIndex,maxSize){ + if(itemIndex == (maxSize -1)) + return; + var currId = "#answerOptionItemDesc" + itemIndex; + var repId = "#answerOptionItemDesc" + (++itemIndex); + switchValue(currId,repId); + } + + //Switches the value of two elements + function switchValue(currId,repId){ + var temp = $(repId).val(); + $(repId).val($(currId).val()); + $(currId).val(temp); + } + + //Displays the busy status of the answer option operation + function answerOperationStarted(){ + showBusy(answerOptionTargetDiv); + } + + //Hides the busy status of the answer option operation + function answerOperationComplete(){ + hideBusy(answerOptionTargetDiv); + } + + //Packs additional elements and submits the question form + function submitDacoQuestion(){ + + var questionType = $("#questionType").val(); + + if(questionType==7 || questionType==8 || questionType==9){ + $("#answerOptionList").val($("#answerOptionsForm").serialize()); + } + + else if (questionType == 10){ + var longlatMapsString = ""; + $("#longlatMaps option:selected").each(function (){ + longlatMapsString += this.value + "&"; + }); + $("#longlatMapsSelected").val(longlatMapsString); + } + + $("#dacoQuestionForm").submit(); + } + + //Cancels a question adding procedure + function cancelDacoQuestion(){ + window.top.hideQuestionInputArea(); + } \ No newline at end of file Index: lams_tool_daco/web/includes/javascript/dacocommon.js =================================================================== diff -u --- lams_tool_daco/web/includes/javascript/dacocommon.js (revision 0) +++ lams_tool_daco/web/includes/javascript/dacocommon.js (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,32 @@ + + // Finds a corresponding image and shows it + function showBusy(targetDiv){ + if($(targetDiv+"_Busy") != null){ + $(targetDiv+"_Busy").show(); + } + } + + // Finds a corresponding image and hides it + function hideBusy(targetDiv){ + if($(targetDiv+"_Busy") != null){ + $(targetDiv+"_Busy").hide(); + } + } + + // Creates an hidden element and adds it to a JSON structure + function addToJSON (arr, name, value){ + var elem = document.createElement('hidden'); + elem.value=value; + elem.name=name; + arr[arr.length]=elem; + } + + function checkCheckbox(checkboxName){ + var checkbox = document.getElementById(checkboxName); + checkbox.checked=true; + } + + function setValue(elementName,value){ + var element = document.getElementById(elementName); + element.value=value; + } \ No newline at end of file Index: lams_tool_daco/web/includes/javascript/jquery-1.2.6.pack.js =================================================================== diff -u --- lams_tool_daco/web/includes/javascript/jquery-1.2.6.pack.js (revision 0) +++ lams_tool_daco/web/includes/javascript/jquery-1.2.6.pack.js (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,11 @@ +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date$ + * $Rev: 5685 $ + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(H(){J w=1b.4M,3m$=1b.$;J D=1b.4M=1b.$=H(a,b){I 2B D.17.5j(a,b)};J u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/,62=/^.[^:#\\[\\.]*$/,12;D.17=D.44={5j:H(d,b){d=d||S;G(d.16){7[0]=d;7.K=1;I 7}G(1j d=="23"){J c=u.2D(d);G(c&&(c[1]||!b)){G(c[1])d=D.4h([c[1]],b);N{J a=S.61(c[3]);G(a){G(a.2v!=c[3])I D().2q(d);I D(a)}d=[]}}N I D(b).2q(d)}N G(D.1D(d))I D(S)[D.17.27?"27":"43"](d);I 7.6Y(D.2d(d))},5w:"1.2.6",8G:H(){I 7.K},K:0,3p:H(a){I a==12?D.2d(7):7[a]},2I:H(b){J a=D(b);a.5n=7;I a},6Y:H(a){7.K=0;2p.44.1p.1w(7,a);I 7},P:H(a,b){I D.P(7,a,b)},5i:H(b){J a=-1;I D.2L(b&&b.5w?b[0]:b,7)},1K:H(c,a,b){J d=c;G(c.1q==56)G(a===12)I 7[0]&&D[b||"1K"](7[0],c);N{d={};d[c]=a}I 7.P(H(i){R(c 1n d)D.1K(b?7.V:7,c,D.1i(7,d[c],b,i,c))})},1g:H(b,a){G((b==\'2h\'||b==\'1Z\')&&3d(a)<0)a=12;I 7.1K(b,a,"2a")},1r:H(b){G(1j b!="49"&&b!=U)I 7.4E().3v((7[0]&&7[0].2z||S).5F(b));J a="";D.P(b||7,H(){D.P(7.3t,H(){G(7.16!=8)a+=7.16!=1?7.76:D.17.1r([7])})});I a},5z:H(b){G(7[0])D(b,7[0].2z).5y().39(7[0]).2l(H(){J a=7;1B(a.1x)a=a.1x;I a}).3v(7);I 7},8Y:H(a){I 7.P(H(){D(7).6Q().5z(a)})},8R:H(a){I 7.P(H(){D(7).5z(a)})},3v:H(){I 7.3W(19,M,Q,H(a){G(7.16==1)7.3U(a)})},6F:H(){I 7.3W(19,M,M,H(a){G(7.16==1)7.39(a,7.1x)})},6E:H(){I 7.3W(19,Q,Q,H(a){7.1d.39(a,7)})},5q:H(){I 7.3W(19,Q,M,H(a){7.1d.39(a,7.2H)})},3l:H(){I 7.5n||D([])},2q:H(b){J c=D.2l(7,H(a){I D.2q(b,a)});I 7.2I(/[^+>] [^+>]/.11(b)||b.1h("..")>-1?D.4r(c):c)},5y:H(e){J f=7.2l(H(){G(D.14.1f&&!D.4n(7)){J a=7.6o(M),5h=S.3h("1v");5h.3U(a);I D.4h([5h.4H])[0]}N I 7.6o(M)});J d=f.2q("*").5c().P(H(){G(7[E]!=12)7[E]=U});G(e===M)7.2q("*").5c().P(H(i){G(7.16==3)I;J c=D.L(7,"3w");R(J a 1n c)R(J b 1n c[a])D.W.1e(d[i],a,c[a][b],c[a][b].L)});I f},1E:H(b){I 7.2I(D.1D(b)&&D.3C(7,H(a,i){I b.1k(a,i)})||D.3g(b,7))},4Y:H(b){G(b.1q==56)G(62.11(b))I 7.2I(D.3g(b,7,M));N b=D.3g(b,7);J a=b.K&&b[b.K-1]!==12&&!b.16;I 7.1E(H(){I a?D.2L(7,b)<0:7!=b})},1e:H(a){I 7.2I(D.4r(D.2R(7.3p(),1j a==\'23\'?D(a):D.2d(a))))},3F:H(a){I!!a&&D.3g(a,7).K>0},7T:H(a){I 7.3F("."+a)},6e:H(b){G(b==12){G(7.K){J c=7[0];G(D.Y(c,"2A")){J e=c.64,63=[],15=c.15,2V=c.O=="2A-2V";G(e<0)I U;R(J i=2V?e:0,2f=2V?e+1:15.K;i<2f;i++){J d=15[i];G(d.2W){b=D.14.1f&&!d.at.2x.an?d.1r:d.2x;G(2V)I b;63.1p(b)}}I 63}N I(7[0].2x||"").1o(/\\r/g,"")}I 12}G(b.1q==4L)b+=\'\';I 7.P(H(){G(7.16!=1)I;G(b.1q==2p&&/5O|5L/.11(7.O))7.4J=(D.2L(7.2x,b)>=0||D.2L(7.34,b)>=0);N G(D.Y(7,"2A")){J a=D.2d(b);D("9R",7).P(H(){7.2W=(D.2L(7.2x,a)>=0||D.2L(7.1r,a)>=0)});G(!a.K)7.64=-1}N 7.2x=b})},2K:H(a){I a==12?(7[0]?7[0].4H:U):7.4E().3v(a)},7b:H(a){I 7.5q(a).21()},79:H(i){I 7.3s(i,i+1)},3s:H(){I 7.2I(2p.44.3s.1w(7,19))},2l:H(b){I 7.2I(D.2l(7,H(a,i){I b.1k(a,i,a)}))},5c:H(){I 7.1e(7.5n)},L:H(d,b){J a=d.1R(".");a[1]=a[1]?"."+a[1]:"";G(b===12){J c=7.5C("9z"+a[1]+"!",[a[0]]);G(c===12&&7.K)c=D.L(7[0],d);I c===12&&a[1]?7.L(a[0]):c}N I 7.1P("9u"+a[1]+"!",[a[0],b]).P(H(){D.L(7,d,b)})},3b:H(a){I 7.P(H(){D.3b(7,a)})},3W:H(g,f,h,d){J e=7.K>1,3x;I 7.P(H(){G(!3x){3x=D.4h(g,7.2z);G(h)3x.9o()}J b=7;G(f&&D.Y(7,"1T")&&D.Y(3x[0],"4F"))b=7.3H("22")[0]||7.3U(7.2z.3h("22"));J c=D([]);D.P(3x,H(){J a=e?D(7).5y(M)[0]:7;G(D.Y(a,"1m"))c=c.1e(a);N{G(a.16==1)c=c.1e(D("1m",a).21());d.1k(b,a)}});c.P(6T)})}};D.17.5j.44=D.17;H 6T(i,a){G(a.4d)D.3Y({1a:a.4d,31:Q,1O:"1m"});N D.5u(a.1r||a.6O||a.4H||"");G(a.1d)a.1d.37(a)}H 1z(){I+2B 8J}D.1l=D.17.1l=H(){J b=19[0]||{},i=1,K=19.K,4x=Q,15;G(b.1q==8I){4x=b;b=19[1]||{};i=2}G(1j b!="49"&&1j b!="H")b={};G(K==i){b=7;--i}R(;i-1}},6q:H(b,c,a){J e={};R(J d 1n c){e[d]=b.V[d];b.V[d]=c[d]}a.1k(b);R(J d 1n c)b.V[d]=e[d]},1g:H(d,e,c){G(e=="2h"||e=="1Z"){J b,3X={30:"5x",5g:"1G",18:"3I"},35=e=="2h"?["5e","6k"]:["5G","6i"];H 5b(){b=e=="2h"?d.8f:d.8c;J a=0,2C=0;D.P(35,H(){a+=3d(D.2a(d,"57"+7,M))||0;2C+=3d(D.2a(d,"2C"+7+"4b",M))||0});b-=29.83(a+2C)}G(D(d).3F(":4j"))5b();N D.6q(d,3X,5b);I 29.2f(0,b)}I D.2a(d,e,c)},2a:H(f,l,k){J e,V=f.V;H 3E(b){G(!D.14.2k)I Q;J a=3P.54(b,U);I!a||a.52("3E")==""}G(l=="1y"&&D.14.1f){e=D.1K(V,"1y");I e==""?"1":e}G(D.14.2G&&l=="18"){J d=V.50;V.50="0 7Y 7W";V.50=d}G(l.1I(/4i/i))l=y;G(!k&&V&&V[l])e=V[l];N G(3P.54){G(l.1I(/4i/i))l="4i";l=l.1o(/([A-Z])/g,"-$1").3y();J c=3P.54(f,U);G(c&&!3E(f))e=c.52(l);N{J g=[],2E=[],a=f,i=0;R(;a&&3E(a);a=a.1d)2E.6h(a);R(;i<2E.K;i++)G(3E(2E[i])){g[i]=2E[i].V.18;2E[i].V.18="3I"}e=l=="18"&&g[2E.K-1]!=U?"2F":(c&&c.52(l))||"";R(i=0;i]*?)\\/>/g,H(b,a,c){I c.1I(/^(aK|4f|7E|aG|4T|7A|aB|3n|az|ay|av)$/i)?b:a+">"});J f=D.3k(d).3y(),1v=h.3h("1v");J e=!f.1h("",""]||!f.1h("",""]||f.1I(/^<(aq|22|am|ak|ai)/)&&[1,"<1T>",""]||!f.1h("<4F")&&[2,"<1T><22>",""]||(!f.1h("<22><4F>",""]||!f.1h("<7E")&&[2,"<1T><22><7q>",""]||D.14.1f&&[1,"1v<1v>",""]||[0,"",""];1v.4H=e[1]+d+e[2];1B(e[0]--)1v=1v.5T;G(D.14.1f){J g=!f.1h("<1T")&&f.1h("<22")<0?1v.1x&&1v.1x.3t:e[1]=="<1T>"&&f.1h("<22")<0?1v.3t:[];R(J j=g.K-1;j>=0;--j)G(D.Y(g[j],"22")&&!g[j].3t.K)g[j].1d.37(g[j]);G(/^\\s/.11(d))1v.39(h.5F(d.1I(/^\\s*/)[0]),1v.1x)}d=D.2d(1v.3t)}G(d.K===0&&(!D.Y(d,"3V")&&!D.Y(d,"2A")))I;G(d[0]==12||D.Y(d,"3V")||d.15)k.1p(d);N k=D.2R(k,d)});I k},1K:H(d,f,c){G(!d||d.16==3||d.16==8)I 12;J e=!D.4n(d),40=c!==12,1f=D.14.1f;f=e&&D.3X[f]||f;G(d.2j){J g=/5Q|4d|V/.11(f);G(f=="2W"&&D.14.2k)d.1d.64;G(f 1n d&&e&&!g){G(40){G(f=="O"&&D.Y(d,"4T")&&d.1d)7p"O a3 a1\'t 9V 9U";d[f]=c}G(D.Y(d,"3V")&&d.7i(f))I d.7i(f).76;I d[f]}G(1f&&e&&f=="V")I D.1K(d.V,"9T",c);G(40)d.9Q(f,""+c);J h=1f&&e&&g?d.4G(f,2):d.4G(f);I h===U?12:h}G(1f&&f=="1y"){G(40){d.6B=1;d.1E=(d.1E||"").1o(/7f\\([^)]*\\)/,"")+(3r(c)+\'\'=="9L"?"":"7f(1y="+c*7a+")")}I d.1E&&d.1E.1h("1y=")>=0?(3d(d.1E.1I(/1y=([^)]*)/)[1])/7a)+\'\':""}f=f.1o(/-([a-z])/9H,H(a,b){I b.2r()});G(40)d[f]=c;I d[f]},3k:H(a){I(a||"").1o(/^\\s+|\\s+$/g,"")},2d:H(b){J a=[];G(b!=U){J i=b.K;G(i==U||b.1R||b.4I||b.1k)a[0]=b;N 1B(i)a[--i]=b[i]}I a},2L:H(b,a){R(J i=0,K=a.K;i*",7).21();1B(7.1x)7.37(7.1x)}},H(a,b){D.17[a]=H(){I 7.P(b,19)}});D.P(["6N","4b"],H(i,c){J b=c.3y();D.17[b]=H(a){I 7[0]==1b?D.14.2G&&S.1c["5t"+c]||D.14.2k&&1b["5s"+c]||S.70=="6Z"&&S.1C["5t"+c]||S.1c["5t"+c]:7[0]==S?29.2f(29.2f(S.1c["4y"+c],S.1C["4y"+c]),29.2f(S.1c["2i"+c],S.1C["2i"+c])):a==12?(7.K?D.1g(7[0],b):U):7.1g(b,a.1q==56?a:a+"2X")}});H 25(a,b){I a[0]&&3r(D.2a(a[0],b,M),10)||0}J C=D.14.2k&&3r(D.14.5B)<8H?"(?:[\\\\w*3m-]|\\\\\\\\.)":"(?:[\\\\w\\8F-\\8E*3m-]|\\\\\\\\.)",6L=2B 4v("^>\\\\s*("+C+"+)"),6J=2B 4v("^("+C+"+)(#)("+C+"+)"),6I=2B 4v("^([#.]?)("+C+"*)");D.1l({6H:{"":H(a,i,m){I m[2]=="*"||D.Y(a,m[2])},"#":H(a,i,m){I a.4G("2v")==m[2]},":":{8D:H(a,i,m){I im[3]-0},3a:H(a,i,m){I m[3]-0==i},79:H(a,i,m){I m[3]-0==i},3o:H(a,i){I i==0},3S:H(a,i,m,r){I i==r.K-1},6D:H(a,i){I i%2==0},6C:H(a,i){I i%2},"3o-4u":H(a){I a.1d.3H("*")[0]==a},"3S-4u":H(a){I D.3a(a.1d.5T,1,"4l")==a},"8z-4u":H(a){I!D.3a(a.1d.5T,2,"4l")},6W:H(a){I a.1x},4E:H(a){I!a.1x},8y:H(a,i,m){I(a.6O||a.8x||D(a).1r()||"").1h(m[3])>=0},4j:H(a){I"1G"!=a.O&&D.1g(a,"18")!="2F"&&D.1g(a,"5g")!="1G"},1G:H(a){I"1G"==a.O||D.1g(a,"18")=="2F"||D.1g(a,"5g")=="1G"},8w:H(a){I!a.3R},3R:H(a){I a.3R},4J:H(a){I a.4J},2W:H(a){I a.2W||D.1K(a,"2W")},1r:H(a){I"1r"==a.O},5O:H(a){I"5O"==a.O},5L:H(a){I"5L"==a.O},5p:H(a){I"5p"==a.O},3Q:H(a){I"3Q"==a.O},5o:H(a){I"5o"==a.O},6A:H(a){I"6A"==a.O},6z:H(a){I"6z"==a.O},2s:H(a){I"2s"==a.O||D.Y(a,"2s")},4T:H(a){I/4T|2A|6y|2s/i.11(a.Y)},3T:H(a,i,m){I D.2q(m[3],a).K},8t:H(a){I/h\\d/i.11(a.Y)},8s:H(a){I D.3C(D.3O,H(b){I a==b.T}).K}}},6x:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,2B 4v("^([:.#]*)("+C+"+)")],3g:H(a,c,b){J d,1t=[];1B(a&&a!=d){d=a;J f=D.1E(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1t=b?c=f.r:D.2R(1t,f.r)}I 1t},2q:H(t,o){G(1j t!="23")I[t];G(o&&o.16!=1&&o.16!=9)I[];o=o||S;J d=[o],2o=[],3S,Y;1B(t&&3S!=t){J r=[];3S=t;t=D.3k(t);J l=Q,3j=6L,m=3j.2D(t);G(m){Y=m[1].2r();R(J i=0;d[i];i++)R(J c=d[i].1x;c;c=c.2H)G(c.16==1&&(Y=="*"||c.Y.2r()==Y))r.1p(c);d=r;t=t.1o(3j,"");G(t.1h(" ")==0)6M;l=M}N{3j=/^([>+~])\\s*(\\w*)/i;G((m=3j.2D(t))!=U){r=[];J k={};Y=m[2].2r();m=m[1];R(J j=0,3i=d.K;j<3i;j++){J n=m=="~"||m=="+"?d[j].2H:d[j].1x;R(;n;n=n.2H)G(n.16==1){J g=D.L(n);G(m=="~"&&k[g])1X;G(!Y||n.Y.2r()==Y){G(m=="~")k[g]=M;r.1p(n)}G(m=="+")1X}}d=r;t=D.3k(t.1o(3j,""));l=M}}G(t&&!l){G(!t.1h(",")){G(o==d[0])d.4s();2o=D.2R(2o,d);r=d=[o];t=" "+t.6v(1,t.K)}N{J h=6J;J m=h.2D(t);G(m){m=[0,m[2],m[3],m[1]]}N{h=6I;m=h.2D(t)}m[2]=m[2].1o(/\\\\/g,"");J f=d[d.K-1];G(m[1]=="#"&&f&&f.61&&!D.4n(f)){J p=f.61(m[2]);G((D.14.1f||D.14.2G)&&p&&1j p.2v=="23"&&p.2v!=m[2])p=D(\'[@2v="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||D.Y(p,m[3]))?[p]:[]}N{R(J i=0;d[i];i++){J a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];G(a=="*"&&d[i].Y.3y()=="49")a="3n";r=D.2R(r,d[i].3H(a))}G(m[1]==".")r=D.5m(r,m[2]);G(m[1]=="#"){J e=[];R(J i=0;r[i];i++)G(r[i].4G("2v")==m[2]){e=[r[i]];1X}r=e}d=r}t=t.1o(h,"")}}G(t){J b=D.1E(t,r);d=r=b.r;t=D.3k(b.t)}}G(t)d=[];G(d&&o==d[0])d.4s();2o=D.2R(2o,d);I 2o},5m:H(r,m,a){m=" "+m+" ";J c=[];R(J i=0;r[i];i++){J b=(" "+r[i].1F+" ").1h(m)>=0;G(!a&&b||a&&!b)c.1p(r[i])}I c},1E:H(t,r,h){J d;1B(t&&t!=d){d=t;J p=D.6x,m;R(J i=0;p[i];i++){m=p[i].2D(t);G(m){t=t.8r(m[0].K);m[2]=m[2].1o(/\\\\/g,"");1X}}G(!m)1X;G(m[1]==":"&&m[2]=="4Y")r=62.11(m[3])?D.1E(m[3],r,M).r:D(r).4Y(m[3]);N G(m[1]==".")r=D.5m(r,m[2],h);N G(m[1]=="["){J g=[],O=m[3];R(J i=0,3i=r.K;i<3i;i++){J a=r[i],z=a[D.3X[m[2]]||m[2]];G(z==U||/5Q|4d|2W/.11(m[2]))z=D.1K(a,m[2])||\'\';G((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1h(m[5])||O=="$="&&z.6v(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1h(m[5])>=0)^h)g.1p(a)}r=g}N G(m[1]==":"&&m[2]=="3a-4u"){J e={},g=[],11=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2D(m[3]=="6D"&&"2n"||m[3]=="6C"&&"2n+1"||!/\\D/.11(m[3])&&"8q+"+m[3]||m[3]),3o=(11[1]+(11[2]||1))-0,d=11[3]-0;R(J i=0,3i=r.K;i<3i;i++){J j=r[i],1d=j.1d,2v=D.L(1d);G(!e[2v]){J c=1;R(J n=1d.1x;n;n=n.2H)G(n.16==1)n.4q=c++;e[2v]=M}J b=Q;G(3o==0){G(j.4q==d)b=M}N G((j.4q-d)%3o==0&&(j.4q-d)/3o>=0)b=M;G(b^h)g.1p(j)}r=g}N{J f=D.6H[m[1]];G(1j f=="49")f=f[m[2]];G(1j f=="23")f=6u("Q||H(a,i){I "+f+";}");r=D.3C(r,H(a,i){I f(a,i,m,r)},h)}}I{r:r,t:t}},4S:H(b,c){J a=[],1t=b[c];1B(1t&&1t!=S){G(1t.16==1)a.1p(1t);1t=1t[c]}I a},3a:H(a,e,c,b){e=e||1;J d=0;R(;a;a=a[c])G(a.16==1&&++d==e)1X;I a},5v:H(n,a){J r=[];R(;n;n=n.2H){G(n.16==1&&n!=a)r.1p(n)}I r}});D.W={1e:H(f,i,g,e){G(f.16==3||f.16==8)I;G(D.14.1f&&f.4I)f=1b;G(!g.24)g.24=7.24++;G(e!=12){J h=g;g=7.3M(h,H(){I h.1w(7,19)});g.L=e}J j=D.L(f,"3w")||D.L(f,"3w",{}),1H=D.L(f,"1H")||D.L(f,"1H",H(){G(1j D!="12"&&!D.W.5k)I D.W.1H.1w(19.3L.T,19)});1H.T=f;D.P(i.1R(/\\s+/),H(c,b){J a=b.1R(".");b=a[0];g.O=a[1];J d=j[b];G(!d){d=j[b]={};G(!D.W.2t[b]||D.W.2t[b].4p.1k(f)===Q){G(f.3K)f.3K(b,1H,Q);N G(f.6t)f.6t("4o"+b,1H)}}d[g.24]=g;D.W.26[b]=M});f=U},24:1,26:{},21:H(e,h,f){G(e.16==3||e.16==8)I;J i=D.L(e,"3w"),1L,5i;G(i){G(h==12||(1j h=="23"&&h.8p(0)=="."))R(J g 1n i)7.21(e,g+(h||""));N{G(h.O){f=h.2y;h=h.O}D.P(h.1R(/\\s+/),H(b,a){J c=a.1R(".");a=c[0];G(i[a]){G(f)2U i[a][f.24];N R(f 1n i[a])G(!c[1]||i[a][f].O==c[1])2U i[a][f];R(1L 1n i[a])1X;G(!1L){G(!D.W.2t[a]||D.W.2t[a].4A.1k(e)===Q){G(e.6p)e.6p(a,D.L(e,"1H"),Q);N G(e.6n)e.6n("4o"+a,D.L(e,"1H"))}1L=U;2U i[a]}}})}R(1L 1n i)1X;G(!1L){J d=D.L(e,"1H");G(d)d.T=U;D.3b(e,"3w");D.3b(e,"1H")}}},1P:H(h,c,f,g,i){c=D.2d(c);G(h.1h("!")>=0){h=h.3s(0,-1);J a=M}G(!f){G(7.26[h])D("*").1e([1b,S]).1P(h,c)}N{G(f.16==3||f.16==8)I 12;J b,1L,17=D.1D(f[h]||U),W=!c[0]||!c[0].32;G(W){c.6h({O:h,2J:f,32:H(){},3J:H(){},4C:1z()});c[0][E]=M}c[0].O=h;G(a)c[0].6m=M;J d=D.L(f,"1H");G(d)b=d.1w(f,c);G((!17||(D.Y(f,\'a\')&&h=="4V"))&&f["4o"+h]&&f["4o"+h].1w(f,c)===Q)b=Q;G(W)c.4s();G(i&&D.1D(i)){1L=i.1w(f,b==U?c:c.7d(b));G(1L!==12)b=1L}G(17&&g!==Q&&b!==Q&&!(D.Y(f,\'a\')&&h=="4V")){7.5k=M;1U{f[h]()}1V(e){}}7.5k=Q}I b},1H:H(b){J a,1L,38,5f,4m;b=19[0]=D.W.6l(b||1b.W);38=b.O.1R(".");b.O=38[0];38=38[1];5f=!38&&!b.6m;4m=(D.L(7,"3w")||{})[b.O];R(J j 1n 4m){J c=4m[j];G(5f||c.O==38){b.2y=c;b.L=c.L;1L=c.1w(7,19);G(a!==Q)a=1L;G(1L===Q){b.32();b.3J()}}}I a},6l:H(b){G(b[E]==M)I b;J d=b;b={8o:d};J c="8n 8m 8l 8k 2s 8j 47 5d 6j 5E 8i L 8h 8g 4K 2y 5a 59 8e 8b 58 6f 8a 88 4k 87 86 84 6d 2J 4C 6c O 82 81 35".1R(" ");R(J i=c.K;i;i--)b[c[i]]=d[c[i]];b[E]=M;b.32=H(){G(d.32)d.32();d.80=Q};b.3J=H(){G(d.3J)d.3J();d.7Z=M};b.4C=b.4C||1z();G(!b.2J)b.2J=b.6d||S;G(b.2J.16==3)b.2J=b.2J.1d;G(!b.4k&&b.4K)b.4k=b.4K==b.2J?b.6c:b.4K;G(b.58==U&&b.5d!=U){J a=S.1C,1c=S.1c;b.58=b.5d+(a&&a.2e||1c&&1c.2e||0)-(a.6b||0);b.6f=b.6j+(a&&a.2c||1c&&1c.2c||0)-(a.6a||0)}G(!b.35&&((b.47||b.47===0)?b.47:b.5a))b.35=b.47||b.5a;G(!b.59&&b.5E)b.59=b.5E;G(!b.35&&b.2s)b.35=(b.2s&1?1:(b.2s&2?3:(b.2s&4?2:0)));I b},3M:H(a,b){b.24=a.24=a.24||b.24||7.24++;I b},2t:{27:{4p:H(){55();I},4A:H(){I}},3D:{4p:H(){G(D.14.1f)I Q;D(7).2O("53",D.W.2t.3D.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("53",D.W.2t.3D.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3D";I D.W.1H.1w(7,19)}},3N:{4p:H(){G(D.14.1f)I Q;D(7).2O("51",D.W.2t.3N.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("51",D.W.2t.3N.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3N";I D.W.1H.1w(7,19)}}}};D.17.1l({2O:H(c,a,b){I c=="4X"?7.2V(c,a,b):7.P(H(){D.W.1e(7,c,b||a,b&&a)})},2V:H(d,b,c){J e=D.W.3M(c||b,H(a){D(7).4e(a,e);I(c||b).1w(7,19)});I 7.P(H(){D.W.1e(7,d,e,c&&b)})},4e:H(a,b){I 7.P(H(){D.W.21(7,a,b)})},1P:H(c,a,b){I 7.P(H(){D.W.1P(c,a,7,M,b)})},5C:H(c,a,b){I 7[0]&&D.W.1P(c,a,7[0],Q,b)},2m:H(b){J c=19,i=1;1B(i=0){J i=g.3s(e,g.K);g=g.3s(0,e)}c=c||H(){};J f="2P";G(d)G(D.1D(d)){c=d;d=U}N{d=D.3n(d);f="6g"}J h=7;D.3Y({1a:g,O:f,1O:"2K",L:d,1J:H(a,b){G(b=="1W"||b=="7J")h.2K(i?D("<1v/>").3v(a.4U.1o(/<1m(.|\\s)*?\\/1m>/g,"")).2q(i):a.4U);h.P(c,[a.4U,b,a])}});I 7},aL:H(){I D.3n(7.7I())},7I:H(){I 7.2l(H(){I D.Y(7,"3V")?D.2d(7.aH):7}).1E(H(){I 7.34&&!7.3R&&(7.4J||/2A|6y/i.11(7.Y)||/1r|1G|3Q/i.11(7.O))}).2l(H(i,c){J b=D(7).6e();I b==U?U:b.1q==2p?D.2l(b,H(a,i){I{34:c.34,2x:a}}):{34:c.34,2x:b}}).3p()}});D.P("7H,7G,7F,7D,7C,7B".1R(","),H(i,o){D.17[o]=H(f){I 7.2O(o,f)}});J B=1z();D.1l({3p:H(d,b,a,c){G(D.1D(b)){a=b;b=U}I D.3Y({O:"2P",1a:d,L:b,1W:a,1O:c})},aE:H(b,a){I D.3p(b,U,a,"1m")},aD:H(c,b,a){I D.3p(c,b,a,"3z")},aC:H(d,b,a,c){G(D.1D(b)){a=b;b={}}I D.3Y({O:"6g",1a:d,L:b,1W:a,1O:c})},aA:H(a){D.1l(D.60,a)},60:{1a:5Z.5Q,26:M,O:"2P",2T:0,7z:"4R/x-ax-3V-aw",7x:M,31:M,L:U,5Y:U,3Q:U,4Q:{2N:"4R/2N, 1r/2N",2K:"1r/2K",1m:"1r/4t, 4R/4t",3z:"4R/3z, 1r/4t",1r:"1r/as",4w:"*/*"}},4z:{},3Y:H(s){s=D.1l(M,s,D.1l(M,{},D.60,s));J g,2Z=/=\\?(&|$)/g,1u,L,O=s.O.2r();G(s.L&&s.7x&&1j s.L!="23")s.L=D.3n(s.L);G(s.1O=="4P"){G(O=="2P"){G(!s.1a.1I(2Z))s.1a+=(s.1a.1I(/\\?/)?"&":"?")+(s.4P||"7u")+"=?"}N G(!s.L||!s.L.1I(2Z))s.L=(s.L?s.L+"&":"")+(s.4P||"7u")+"=?";s.1O="3z"}G(s.1O=="3z"&&(s.L&&s.L.1I(2Z)||s.1a.1I(2Z))){g="4P"+B++;G(s.L)s.L=(s.L+"").1o(2Z,"="+g+"$1");s.1a=s.1a.1o(2Z,"="+g+"$1");s.1O="1m";1b[g]=H(a){L=a;1W();1J();1b[g]=12;1U{2U 1b[g]}1V(e){}G(i)i.37(h)}}G(s.1O=="1m"&&s.1Y==U)s.1Y=Q;G(s.1Y===Q&&O=="2P"){J j=1z();J k=s.1a.1o(/(\\?|&)3m=.*?(&|$)/,"$ap="+j+"$2");s.1a=k+((k==s.1a)?(s.1a.1I(/\\?/)?"&":"?")+"3m="+j:"")}G(s.L&&O=="2P"){s.1a+=(s.1a.1I(/\\?/)?"&":"?")+s.L;s.L=U}G(s.26&&!D.4O++)D.W.1P("7H");J n=/^(?:\\w+:)?\\/\\/([^\\/?#]+)/;G(s.1O=="1m"&&O=="2P"&&n.11(s.1a)&&n.2D(s.1a)[1]!=5Z.al){J i=S.3H("6w")[0];J h=S.3h("1m");h.4d=s.1a;G(s.7t)h.aj=s.7t;G(!g){J l=Q;h.ah=h.ag=H(){G(!l&&(!7.3f||7.3f=="68"||7.3f=="1J")){l=M;1W();1J();i.37(h)}}}i.3U(h);I 12}J m=Q;J c=1b.7s?2B 7s("ae.ac"):2B 7r();G(s.5Y)c.6R(O,s.1a,s.31,s.5Y,s.3Q);N c.6R(O,s.1a,s.31);1U{G(s.L)c.4B("ab-aa",s.7z);G(s.5S)c.4B("a9-5R-a8",D.4z[s.1a]||"a7, a6 a5 a4 5N:5N:5N a2");c.4B("X-9Z-9Y","7r");c.4B("9W",s.1O&&s.4Q[s.1O]?s.4Q[s.1O]+", */*":s.4Q.4w)}1V(e){}G(s.7m&&s.7m(c,s)===Q){s.26&&D.4O--;c.7l();I Q}G(s.26)D.W.1P("7B",[c,s]);J d=H(a){G(!m&&c&&(c.3f==4||a=="2T")){m=M;G(f){7k(f);f=U}1u=a=="2T"&&"2T"||!D.7j(c)&&"3e"||s.5S&&D.7h(c,s.1a)&&"7J"||"1W";G(1u=="1W"){1U{L=D.6X(c,s.1O,s.9S)}1V(e){1u="5J"}}G(1u=="1W"){J b;1U{b=c.5I("7g-5R")}1V(e){}G(s.5S&&b)D.4z[s.1a]=b;G(!g)1W()}N D.5H(s,c,1u);1J();G(s.31)c=U}};G(s.31){J f=4I(d,13);G(s.2T>0)3B(H(){G(c){c.7l();G(!m)d("2T")}},s.2T)}1U{c.9P(s.L)}1V(e){D.5H(s,c,U,e)}G(!s.31)d();H 1W(){G(s.1W)s.1W(L,1u);G(s.26)D.W.1P("7C",[c,s])}H 1J(){G(s.1J)s.1J(c,1u);G(s.26)D.W.1P("7F",[c,s]);G(s.26&&!--D.4O)D.W.1P("7G")}I c},5H:H(s,a,b,e){G(s.3e)s.3e(a,b,e);G(s.26)D.W.1P("7D",[a,s,e])},4O:0,7j:H(a){1U{I!a.1u&&5Z.9O=="5p:"||(a.1u>=7e&&a.1u<9N)||a.1u==7c||a.1u==9K||D.14.2k&&a.1u==12}1V(e){}I Q},7h:H(a,c){1U{J b=a.5I("7g-5R");I a.1u==7c||b==D.4z[c]||D.14.2k&&a.1u==12}1V(e){}I Q},6X:H(a,c,b){J d=a.5I("9J-O"),2N=c=="2N"||!c&&d&&d.1h("2N")>=0,L=2N?a.9I:a.4U;G(2N&&L.1C.2j=="5J")7p"5J";G(b)L=b(L,c);G(c=="1m")D.5u(L);G(c=="3z")L=6u("("+L+")");I L},3n:H(a){J s=[];G(a.1q==2p||a.5w)D.P(a,H(){s.1p(3u(7.34)+"="+3u(7.2x))});N R(J j 1n a)G(a[j]&&a[j].1q==2p)D.P(a[j],H(){s.1p(3u(j)+"="+3u(7))});N s.1p(3u(j)+"="+3u(D.1D(a[j])?a[j]():a[j]));I s.6s("&").1o(/%20/g,"+")}});D.17.1l({1N:H(c,b){I c?7.2g({1Z:"1N",2h:"1N",1y:"1N"},c,b):7.1E(":1G").P(H(){7.V.18=7.5D||"";G(D.1g(7,"18")=="2F"){J a=D("<"+7.2j+" />").6P("1c");7.V.18=a.1g("18");G(7.V.18=="2F")7.V.18="3I";a.21()}}).3l()},1M:H(b,a){I b?7.2g({1Z:"1M",2h:"1M",1y:"1M"},b,a):7.1E(":4j").P(H(){7.5D=7.5D||D.1g(7,"18");7.V.18="2F"}).3l()},78:D.17.2m,2m:H(a,b){I D.1D(a)&&D.1D(b)?7.78.1w(7,19):a?7.2g({1Z:"2m",2h:"2m",1y:"2m"},a,b):7.P(H(){D(7)[D(7).3F(":1G")?"1N":"1M"]()})},9G:H(b,a){I 7.2g({1Z:"1N"},b,a)},9F:H(b,a){I 7.2g({1Z:"1M"},b,a)},9E:H(b,a){I 7.2g({1Z:"2m"},b,a)},9D:H(b,a){I 7.2g({1y:"1N"},b,a)},9M:H(b,a){I 7.2g({1y:"1M"},b,a)},9C:H(c,a,b){I 7.2g({1y:a},c,b)},2g:H(k,j,i,g){J h=D.77(j,i,g);I 7[h.36===Q?"P":"36"](H(){G(7.16!=1)I Q;J f=D.1l({},h),p,1G=D(7).3F(":1G"),46=7;R(p 1n k){G(k[p]=="1M"&&1G||k[p]=="1N"&&!1G)I f.1J.1k(7);G(p=="1Z"||p=="2h"){f.18=D.1g(7,"18");f.33=7.V.33}}G(f.33!=U)7.V.33="1G";f.45=D.1l({},k);D.P(k,H(c,a){J e=2B D.28(46,f,c);G(/2m|1N|1M/.11(a))e[a=="2m"?1G?"1N":"1M":a](k);N{J b=a.6r().1I(/^([+-]=)?([\\d+-.]+)(.*)$/),2b=e.1t(M)||0;G(b){J d=3d(b[2]),2M=b[3]||"2X";G(2M!="2X"){46.V[c]=(d||1)+2M;2b=((d||1)/e.1t(M))*2b;46.V[c]=2b+2M}G(b[1])d=((b[1]=="-="?-1:1)*d)+2b;e.3G(2b,d,2M)}N e.3G(2b,a,"")}});I M})},36:H(a,b){G(D.1D(a)||(a&&a.1q==2p)){b=a;a="28"}G(!a||(1j a=="23"&&!b))I A(7[0],a);I 7.P(H(){G(b.1q==2p)A(7,a,b);N{A(7,a).1p(b);G(A(7,a).K==1)b.1k(7)}})},9X:H(b,c){J a=D.3O;G(b)7.36([]);7.P(H(){R(J i=a.K-1;i>=0;i--)G(a[i].T==7){G(c)a[i](M);a.7n(i,1)}});G(!c)7.5A();I 7}});J A=H(b,c,a){G(b){c=c||"28";J q=D.L(b,c+"36");G(!q||a)q=D.L(b,c+"36",D.2d(a))}I q};D.17.5A=H(a){a=a||"28";I 7.P(H(){J q=A(7,a);q.4s();G(q.K)q[0].1k(7)})};D.1l({77:H(b,a,c){J d=b&&b.1q==a0?b:{1J:c||!c&&a||D.1D(b)&&b,2u:b,41:c&&a||a&&a.1q!=9t&&a};d.2u=(d.2u&&d.2u.1q==4L?d.2u:D.28.5K[d.2u])||D.28.5K.74;d.5M=d.1J;d.1J=H(){G(d.36!==Q)D(7).5A();G(D.1D(d.5M))d.5M.1k(7)};I d},41:{73:H(p,n,b,a){I b+a*p},5P:H(p,n,b,a){I((-29.9r(p*29.9q)/2)+0.5)*a+b}},3O:[],48:U,28:H(b,c,a){7.15=c;7.T=b;7.1i=a;G(!c.3Z)c.3Z={}}});D.28.44={4D:H(){G(7.15.2Y)7.15.2Y.1k(7.T,7.1z,7);(D.28.2Y[7.1i]||D.28.2Y.4w)(7);G(7.1i=="1Z"||7.1i=="2h")7.T.V.18="3I"},1t:H(a){G(7.T[7.1i]!=U&&7.T.V[7.1i]==U)I 7.T[7.1i];J r=3d(D.1g(7.T,7.1i,a));I r&&r>-9p?r:3d(D.2a(7.T,7.1i))||0},3G:H(c,b,d){7.5V=1z();7.2b=c;7.3l=b;7.2M=d||7.2M||"2X";7.1z=7.2b;7.2S=7.4N=0;7.4D();J e=7;H t(a){I e.2Y(a)}t.T=7.T;D.3O.1p(t);G(D.48==U){D.48=4I(H(){J a=D.3O;R(J i=0;i7.15.2u+7.5V){7.1z=7.3l;7.2S=7.4N=1;7.4D();7.15.45[7.1i]=M;J b=M;R(J i 1n 7.15.45)G(7.15.45[i]!==M)b=Q;G(b){G(7.15.18!=U){7.T.V.33=7.15.33;7.T.V.18=7.15.18;G(D.1g(7.T,"18")=="2F")7.T.V.18="3I"}G(7.15.1M)7.T.V.18="2F";G(7.15.1M||7.15.1N)R(J p 1n 7.15.45)D.1K(7.T.V,p,7.15.3Z[p])}G(b)7.15.1J.1k(7.T);I Q}N{J n=t-7.5V;7.4N=n/7.15.2u;7.2S=D.41[7.15.41||(D.41.5P?"5P":"73")](7.4N,n,0,1,7.15.2u);7.1z=7.2b+((7.3l-7.2b)*7.2S);7.4D()}I M}};D.1l(D.28,{5K:{9l:9j,9i:7e,74:9g},2Y:{2e:H(a){a.T.2e=a.1z},2c:H(a){a.T.2c=a.1z},1y:H(a){D.1K(a.T.V,"1y",a.1z)},4w:H(a){a.T.V[a.1i]=a.1z+a.2M}}});D.17.2i=H(){J b=0,1S=0,T=7[0],3q;G(T)ao(D.14){J d=T.1d,4a=T,1s=T.1s,1Q=T.2z,5U=2k&&3r(5B)<9c&&!/9a/i.11(v),1g=D.2a,3c=1g(T,"30")=="3c";G(T.7y){J c=T.7y();1e(c.1A+29.2f(1Q.1C.2e,1Q.1c.2e),c.1S+29.2f(1Q.1C.2c,1Q.1c.2c));1e(-1Q.1C.6b,-1Q.1C.6a)}N{1e(T.5X,T.5W);1B(1s){1e(1s.5X,1s.5W);G(42&&!/^t(98|d|h)$/i.11(1s.2j)||2k&&!5U)2C(1s);G(!3c&&1g(1s,"30")=="3c")3c=M;4a=/^1c$/i.11(1s.2j)?4a:1s;1s=1s.1s}1B(d&&d.2j&&!/^1c|2K$/i.11(d.2j)){G(!/^96|1T.*$/i.11(1g(d,"18")))1e(-d.2e,-d.2c);G(42&&1g(d,"33")!="4j")2C(d);d=d.1d}G((5U&&(3c||1g(4a,"30")=="5x"))||(42&&1g(4a,"30")!="5x"))1e(-1Q.1c.5X,-1Q.1c.5W);G(3c)1e(29.2f(1Q.1C.2e,1Q.1c.2e),29.2f(1Q.1C.2c,1Q.1c.2c))}3q={1S:1S,1A:b}}H 2C(a){1e(D.2a(a,"6V",M),D.2a(a,"6U",M))}H 1e(l,t){b+=3r(l,10)||0;1S+=3r(t,10)||0}I 3q};D.17.1l({30:H(){J a=0,1S=0,3q;G(7[0]){J b=7.1s(),2i=7.2i(),4c=/^1c|2K$/i.11(b[0].2j)?{1S:0,1A:0}:b.2i();2i.1S-=25(7,\'94\');2i.1A-=25(7,\'aF\');4c.1S+=25(b,\'6U\');4c.1A+=25(b,\'6V\');3q={1S:2i.1S-4c.1S,1A:2i.1A-4c.1A}}I 3q},1s:H(){J a=7[0].1s;1B(a&&(!/^1c|2K$/i.11(a.2j)&&D.1g(a,\'30\')==\'93\'))a=a.1s;I D(a)}});D.P([\'5e\',\'5G\'],H(i,b){J c=\'4y\'+b;D.17[c]=H(a){G(!7[0])I;I a!=12?7.P(H(){7==1b||7==S?1b.92(!i?a:D(1b).2e(),i?a:D(1b).2c()):7[c]=a}):7[0]==1b||7[0]==S?46[i?\'aI\':\'aJ\']||D.71&&S.1C[c]||S.1c[c]:7[0][c]}});D.P(["6N","4b"],H(i,b){J c=i?"5e":"5G",4f=i?"6k":"6i";D.17["5s"+b]=H(){I 7[b.3y()]()+25(7,"57"+c)+25(7,"57"+4f)};D.17["90"+b]=H(a){I 7["5s"+b]()+25(7,"2C"+c+"4b")+25(7,"2C"+4f+"4b")+(a?25(7,"6S"+c)+25(7,"6S"+4f):0)}})})();',62,669,'|||||||this|||||||||||||||||||||||||||||||||||if|function|return|var|length|data|true|else|type|each|false|for|document|elem|null|style|event||nodeName|||test|undefined||browser|options|nodeType|fn|display|arguments|url|window|body|parentNode|add|msie|css|indexOf|prop|typeof|call|extend|script|in|replace|push|constructor|text|offsetParent|cur|status|div|apply|firstChild|opacity|now|left|while|documentElement|isFunction|filter|className|hidden|handle|match|complete|attr|ret|hide|show|dataType|trigger|doc|split|top|table|try|catch|success|break|cache|height||remove|tbody|string|guid|num|global|ready|fx|Math|curCSS|start|scrollTop|makeArray|scrollLeft|max|animate|width|offset|tagName|safari|map|toggle||done|Array|find|toUpperCase|button|special|duration|id|copy|value|handler|ownerDocument|select|new|border|exec|stack|none|opera|nextSibling|pushStack|target|html|inArray|unit|xml|bind|GET|isReady|merge|pos|timeout|delete|one|selected|px|step|jsre|position|async|preventDefault|overflow|name|which|queue|removeChild|namespace|insertBefore|nth|removeData|fixed|parseFloat|error|readyState|multiFilter|createElement|rl|re|trim|end|_|param|first|get|results|parseInt|slice|childNodes|encodeURIComponent|append|events|elems|toLowerCase|json|readyList|setTimeout|grep|mouseenter|color|is|custom|getElementsByTagName|block|stopPropagation|addEventListener|callee|proxy|mouseleave|timers|defaultView|password|disabled|last|has|appendChild|form|domManip|props|ajax|orig|set|easing|mozilla|load|prototype|curAnim|self|charCode|timerId|object|offsetChild|Width|parentOffset|src|unbind|br|currentStyle|clean|float|visible|relatedTarget|previousSibling|handlers|isXMLDoc|on|setup|nodeIndex|unique|shift|javascript|child|RegExp|_default|deep|scroll|lastModified|teardown|setRequestHeader|timeStamp|update|empty|tr|getAttribute|innerHTML|setInterval|checked|fromElement|Number|jQuery|state|active|jsonp|accepts|application|dir|input|responseText|click|styleSheets|unload|not|lastToggle|outline|mouseout|getPropertyValue|mouseover|getComputedStyle|bindReady|String|padding|pageX|metaKey|keyCode|getWH|andSelf|clientX|Left|all|visibility|container|index|init|triggered|removeAttribute|classFilter|prevObject|submit|file|after|windowData|inner|client|globalEval|sibling|jquery|absolute|clone|wrapAll|dequeue|version|triggerHandler|oldblock|ctrlKey|createTextNode|Top|handleError|getResponseHeader|parsererror|speeds|checkbox|old|00|radio|swing|href|Modified|ifModified|lastChild|safari2|startTime|offsetTop|offsetLeft|username|location|ajaxSettings|getElementById|isSimple|values|selectedIndex|runtimeStyle|rsLeft|_load|loaded|DOMContentLoaded|clientTop|clientLeft|toElement|srcElement|val|pageY|POST|unshift|Bottom|clientY|Right|fix|exclusive|detachEvent|cloneNode|removeEventListener|swap|toString|join|attachEvent|eval|substr|head|parse|textarea|reset|image|zoom|odd|even|before|prepend|exclude|expr|quickClass|quickID|uuid|quickChild|continue|Height|textContent|appendTo|contents|open|margin|evalScript|borderTopWidth|borderLeftWidth|parent|httpData|setArray|CSS1Compat|compatMode|boxModel|cssFloat|linear|def|webkit|nodeValue|speed|_toggle|eq|100|replaceWith|304|concat|200|alpha|Last|httpNotModified|getAttributeNode|httpSuccess|clearInterval|abort|beforeSend|splice|styleFloat|throw|colgroup|XMLHttpRequest|ActiveXObject|scriptCharset|callback|fieldset|multiple|processData|getBoundingClientRect|contentType|link|ajaxSend|ajaxSuccess|ajaxError|col|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|keypress|keydown|change|mouseup|mousedown|dblclick|focus|blur|stylesheet|hasClass|rel|doScroll|black|hover|solid|cancelBubble|returnValue|wheelDelta|view|round|shiftKey|resize|screenY|screenX|relatedNode|mousemove|prevValue|originalTarget|offsetHeight|keyup|newValue|offsetWidth|eventPhase|detail|currentTarget|cancelable|bubbles|attrName|attrChange|altKey|originalEvent|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|size|417|Boolean|Date|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|wrap|contentWindow|contentDocument|iframe|children|siblings|prevAll|wrapInner|nextAll|outer|prev|scrollTo|static|marginTop|next|inline|parents|able|cellSpacing|adobeair|cellspacing|522|maxLength|maxlength|readOnly|400|readonly|fast|600|class|slow|1px|htmlFor|reverse|10000|PI|cos|compatible|Function|setData|ie|ra|it|rv|getData|userAgent|navigator|fadeTo|fadeIn|slideToggle|slideUp|slideDown|ig|responseXML|content|1223|NaN|fadeOut|300|protocol|send|setAttribute|option|dataFilter|cssText|changed|be|Accept|stop|With|Requested|Object|can|GMT|property|1970|Jan|01|Thu|Since|If|Type|Content|XMLHTTP|th|Microsoft|td|onreadystatechange|onload|cap|charset|colg|host|tfoot|specified|with|1_|thead|leg|plain|attributes|opt|embed|urlencoded|www|area|hr|ajaxSetup|meta|post|getJSON|getScript|marginLeft|img|elements|pageYOffset|pageXOffset|abbr|serialize|pixelLeft'.split('|'),0,{})) \ No newline at end of file Index: lams_tool_daco/web/includes/javascript/tree.js =================================================================== diff -u --- lams_tool_daco/web/includes/javascript/tree.js (revision 0) +++ lams_tool_daco/web/includes/javascript/tree.js (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/includes/javascript/tree_tpl.js =================================================================== diff -u --- lams_tool_daco/web/includes/javascript/tree_tpl.js (revision 0) +++ lams_tool_daco/web/includes/javascript/tree_tpl.js (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/layout/ frame.jsp =================================================================== diff -u --- lams_tool_daco/web/layout/ frame.jsp (revision 0) +++ lams_tool_daco/web/layout/ frame.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <body class="stripes"> + This tool requires the support of frames. Your browser does not support frames. + </body> + + + Index: lams_tool_daco/web/layout/default.jsp =================================================================== diff -u --- lams_tool_daco/web/layout/default.jsp (revision 0) +++ lams_tool_daco/web/layout/default.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,20 @@ +<%@ include file="/common/taglibs.jsp"%> +<%@ taglib uri="tags-tiles" prefix="tiles"%> + + + + + + + + +

    + +

    +
    + + + + +
    Index: lams_tool_daco/web/login.jsp =================================================================== diff -u --- lams_tool_daco/web/login.jsp (revision 0) +++ lams_tool_daco/web/login.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/pages/authoring/advanced.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/advanced.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/advanced.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,45 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + +

    +

    + + + + + + ${index} + + + + + + + ${index} + + + +

    + +

    +

    + +

    +

    + +

    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/authoring.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/authoring.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/authoring.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,108 @@ + + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.tool.daco.DacoConstants"%> + + + + + <fmt:message key="label.author.title" /> + + <%@ include file="/common/tabbedheader.jsp"%> + <%@ include file="/common/fckeditorheader.jsp"%> + + + + + + + +
    +

    + +

    + + +
    + + + <%@ include file="/common/messages.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + <%-- Default value + cancelButtonLabelKey="label.authoring.cancel.button" + saveButtonLabelKey="label.authoring.save.button" + cancelConfirmMsgKey="message.authoring.cancel.save" + accessMode="author" + --%> + + + +
    + + + +
    + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/basic.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/basic.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/basic.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,117 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    + +
    +<%@ include file="/pages/authoring/parts/questionlist.jsp"%>
    +

    + +

    +

    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/definelater.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/definelater.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/definelater.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,85 @@ + + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="java.util.HashSet"%> +<%@ page import="org.lamsfoundation.lams.tool.daco.DacoConstants"%> +<%@ 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/tabbedheader.jsp"%> + <%@ include file="/common/fckeditorheader.jsp"%> + + + + + + + +
    + + + + + + + +

    + +

    + +
    + <%@ include file="/common/messages.jsp"%> + + +
    + + + + + + + +
    + + + + +
    + +
    + +
    Index: lams_tool_daco/web/pages/authoring/definelaterforbid.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/definelaterforbid.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/definelaterforbid.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,21 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + <fmt:message key="label.author.title" /> + + <%@ include file="/common/header.jsp"%> + + +
    +
    +

    + +

    + + +
    +
    + +
    Index: lams_tool_daco/web/pages/authoring/instructions.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/instructions.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/instructions.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,129 @@ +<%@ include file="/common/taglibs.jsp"%> +<%@ page + import="org.lamsfoundation.lams.contentrepository.client.IToolContentHandler"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + +
    + +
    + <%@ include file="parts/instructionfilelist.jsp"%> +
    +
    +
    + +
    + + + + + +
    + +
    +
    +
    + +
    + +
    + +
    + <%@ include file="parts/instructionfilelist.jsp"%> +
    +
    +
    + +
    + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/addcheckbox.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/addcheckbox.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/addcheckbox.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,68 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + + +

    +
    + +
    + + + + +

    +
    + + +
    + + + +<%@ include file="answeroptions.jsp"%> + + + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/adddate.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/adddate.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/adddate.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,49 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + +

    +
    +
    + + + + +

    +
    + + +
    + + + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/adddropdown.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/adddropdown.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/adddropdown.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,63 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + + +

    +
    + +
    + + + + +

    +
    + + +
    + + + +<%@ include file="answeroptions.jsp"%> + + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/addfile.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/addfile.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/addfile.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,49 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + +

    +
    + +
    + + + + +

    +
    + + +
    + + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/addimage.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/addimage.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/addimage.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,50 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + +

    +
    + +
    + + + + +

    +
    + + +
    + + + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/addlonglat.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/addlonglat.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/addlonglat.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,64 @@ + + +<%@ include file="/common/taglibs.jsp"%> +<%@page import="org.lamsfoundation.lams.tool.daco.DacoConstants;"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + + +

    +
    + +
    + + + + +

    +
    + +
    +
    +
    + + +
    + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/addnumber.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/addnumber.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/addnumber.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,61 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + +

    +
    +
    + + + + +

    +
    + + +
    + + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/addradio.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/addradio.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/addradio.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,63 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + + +

    +
    + +
    + + + + +

    +
    + + +
    + + + +<%@ include file="answeroptions.jsp"%> + + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/addtextarea.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/addtextarea.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/addtextarea.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,57 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + +

    +
    + +
    + + + + + + + + +
    + + + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/addtextfield.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/addtextfield.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/addtextfield.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,57 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + + + + + +

    +
    + +
    + + + + + +

    +
    + + +
    + + + + + + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/answeroptions.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/answeroptions.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/answeroptions.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,54 @@ +<%@ include file="/common/taglibs.jsp"%> + + + +
    +
    +
    + + + + + + + + + + + + + + +
    ${fn:substring(ordinal,status.index,status.index+1)})<%-- Don't display down icon if last line --%> + + + " onclick="javascript:upItem('${status.index+1}')"> + + + "> + + + + + " onclick="javascript:downItem('${status.index+1}','${listSize}')"> + + + "> + + + <%-- Don't display remove icon if less than 2 question answers --%>" onclick="javascript:removeAnswerOption('${status.index+1}')">
    +
    +
    + +<%-- This script will adjust question input area height according to the new answer option count. --%> + \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/parts/instructionfilelist.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/instructionfilelist.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/instructionfilelist.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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_daco/web/pages/authoring/parts/questionattachment.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/questionattachment.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/questionattachment.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,27 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + +
    + + + + + +
    +
    + + + +
    Index: lams_tool_daco/web/pages/authoring/parts/questionlist.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/parts/questionlist.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/parts/questionlist.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,139 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + +
    +

    + + + + + + + + + + + + <%-- Questions type:1=textfield,2=textarea,3=number,4=date,5=File,6=image,7=radio,8=dropdown,9=checkbox,10=longitude/latitude --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" /> + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" /> + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" /> + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" /> + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" /> + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" /> + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" /> + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" /> + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" /> + ${question.description}" + onclick="editQuestion(${status.index},'${sessionMapID}')" />" + onclick="deleteQuestion(${status.index},'${sessionMapID}')" />
    +
    + +<%-- This script will work when a new question submit in order to refresh "Question List" panel. --%> + \ No newline at end of file Index: lams_tool_daco/web/pages/authoring/start.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/authoring/start.jsp (revision 0) +++ lams_tool_daco/web/pages/authoring/start.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,16 @@ + + +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + Index: lams_tool_daco/web/pages/export/exportportfolio.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/export/exportportfolio.jsp (revision 0) +++ lams_tool_daco/web/pages/export/exportportfolio.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,149 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + <fmt:message key="export.title" /> + + + + + + + + + +
    + +

    ${title}

    + + + + + + <%-- display group name on first row--%> + + + + + + + + + + +
    + + + + + + ${question.sessionName} + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${question.questionTitle}${question.username} + + It + was preview... + + + + + + + +
    +
    + +
    + + + + + + + +
    Index: lams_tool_daco/web/pages/learning/addRecord.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/addRecord.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/addRecord.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,197 @@ +<%@ include file="/common/taglibs.jsp"%> +
    + + + + + + + + + + + + + +<%@ include file="/common/messages.jsp"%> + + +
    +
    + +
    +
    + + + + + + + +
    +

    ${daco.title}

    +
    ${daco.instructions}
    + +

    + + ${displayedRecordNumber} +

    + + + + + + + + + + + + + + + +
    +
    ${questionStatus.index+1}
    + ${question.description} + + +
    + +
    + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + ${fn:substring(ordinal,status.index,status.index+1)}) ${answerOption.answerOption}
    +
    + + + +
    + +
    + + + + + ${answerOption.answerOption} + + + + + +
    + +
    + + + + ${fn:substring(ordinal,status.index,status.index+1)}) + + ${answerOption.answerOption} +
    +
    + + + +
    + +
    + + + + + + + + + + + +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    + + + + +
    +
    +
    \ No newline at end of file Index: lams_tool_daco/web/pages/learning/definelater.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/definelater.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/definelater.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,21 @@ + + +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + +
    +

    + +

    + +
    + + +
    Index: lams_tool_daco/web/pages/learning/finish.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/finish.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/finish.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,14 @@ + + +<%@ include file="/common/taglibs.jsp"%> +<%-- This page just for : redir finish page to parent rather that part of the frame --%> + + + + + \ No newline at end of file Index: lams_tool_daco/web/pages/learning/learning.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/learning.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/learning.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,115 @@ + + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.tool.daco.DacoConstants"%> + + + <fmt:message key="label.learning.title" /> + + <%@ include file="/common/tabbedheader.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    + + +
    +
    + " + onclick="javascript:changeView('${sessionMapID}',${displayedRecordNumber})" /> +
    + + + + + +
    + + + + + + +
    +
    + + + + + + +
    +

    ${sessionMap.reflectInstructions}

    + + + +

    +
    + +

    +
    +
    + + + + + +
    +
    + + +
    + + + + + + + + + + +
    +
    + +
    + + +
    + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/learning/listRecords.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/listRecords.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/listRecords.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,187 @@ +
    + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + + + + +
    +

    ${daco.title}

    +
    ${daco.instructions}
    + + +

    + +

    +
    + + + + + + + + + + + + + + + + + + +
    QuestionsRecords
    Record number + +
    +
    ${questionStatus.index+1}
    + ${question.description} +
    +
    + + + + + + + + +
    + ${recordStatus.index+1} + + " + onclick="javascript:editRecord('${sessionMapID}',${recordStatus.index+1})" /> + + " + onclick="javascript:removeRecord('${sessionMapID}',${recordStatus.index+1})" />
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    ${questionStatus.index+1}
    + ${question.description} + + + + + + + + + + + + + + + + + ${answer.fileName} + + + + + + + checked="checked" + + > + ${answerOption.answerOption}
    +
    +
    + + + + + + + ${answer.answer} + + + + + + ${answerOption.answerOption}
    +
    +
    + + + + + + + + + + +
    + + + +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    \ No newline at end of file Index: lams_tool_daco/web/pages/learning/listRecordsHorizontalPart.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/listRecordsHorizontalPart.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/listRecordsHorizontalPart.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,168 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + ${recordStatus.index+1} +
    +
    + " + onclick="javascript:parent.editRecord('${sessionMapID}',${recordStatus.index+1})" /> + " + onclick="javascript:parent.removeRecord('${sessionMapID}',${recordStatus.index+1})" /> +
    +
    + id="lastHorizontalQuestion" + + > + + + + + + + + + + + + + + + + + + ${answer.fileName} + + + + + + + checked="checked" + + > + ${answerOption.answerOption}
    +
    +
    + + + + + + + ${answer.answer} + + + + + + + + + +
    + + + + + ${answerOption.answerOption}
    + +
    +
    + + + + + + + + + + +
    + + + +
    +
    + + + +
    +
    +
    +
    +
    + + +
    \ No newline at end of file Index: lams_tool_daco/web/pages/learning/notebook.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/notebook.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/notebook.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,53 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + <fmt:message key="label.learning.title" /> + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + +
    +

    + ${sessionMap.title} +

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

    + +

    + + + +
    + + + +
    +
    +
    + + + + + +
    Index: lams_tool_daco/web/pages/learning/runoffline.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/runoffline.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/runoffline.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,85 @@ + + +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + +
    +

    + ${sessionMap.title} +

    + +

    + +

    + + +
    +

    + ${sessionMap.reflectInstructions} +

    + + + +

    + + +

    +
    + +

    + +

    +
    +
    + + + + +
    +
    + +
    + + + + + + + + + + + + +
    +
    + + + + +
    Index: lams_tool_daco/web/pages/learning/start.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/start.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/start.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,13 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + \ No newline at end of file Index: lams_tool_daco/web/pages/learning/success.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learning/success.jsp (revision 0) +++ lams_tool_daco/web/pages/learning/success.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,21 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + <%@ include file="/common/header.jsp"%> + + + + + \ No newline at end of file Index: lams_tool_daco/web/pages/learningobj/defaultcontent.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learningobj/defaultcontent.jsp (revision 0) +++ lams_tool_daco/web/pages/learningobj/defaultcontent.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + 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_daco/web/pages/learningobj/icons/.cvsignore =================================================================== diff -u --- lams_tool_daco/web/pages/learningobj/icons/.cvsignore (revision 0) +++ lams_tool_daco/web/pages/learningobj/icons/.cvsignore (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1 @@ +Thumbs.db Index: lams_tool_daco/web/pages/learningobj/icons/base.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/empty.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/folder.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/folderopen.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/join.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/joinbottom.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/line.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/minus.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/minusbottom.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/page.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/plus.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/icons/plusbottom.gif =================================================================== diff -u Binary files differ Index: lams_tool_daco/web/pages/learningobj/mainframe.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learningobj/mainframe.jsp (revision 0) +++ lams_tool_daco/web/pages/learningobj/mainframe.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> + +<%@ include file="/common/taglibs.jsp" %> + + + + + + + Index: lams_tool_daco/web/pages/learningobj/navigatortree.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/learningobj/navigatortree.jsp (revision 0) +++ lams_tool_daco/web/pages/learningobj/navigatortree.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + 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_daco/web/pages/learningobj/xmltree.xsl =================================================================== diff -u --- lams_tool_daco/web/pages/learningobj/xmltree.xsl (revision 0) +++ lams_tool_daco/web/pages/learningobj/xmltree.xsl (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + +var TREE_ITEMS = [ + +]; + + + + + + + ['','', + + ], + + + ['',0, + + ], + + + + + \ No newline at end of file Index: lams_tool_daco/web/pages/monitoring/editactivity.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/monitoring/editactivity.jsp (revision 0) +++ lams_tool_daco/web/pages/monitoring/editactivity.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,43 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + +

    + +

    +
    + + + + + + + + + + + + + + + +
    + + : + + +
    + + : + + +
    + + + + + + + +
    Index: lams_tool_daco/web/pages/monitoring/instructions.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/monitoring/instructions.jsp (revision 0) +++ lams_tool_daco/web/pages/monitoring/instructions.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,96 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + +
    +
    + +
    +
    + +
    + + + + + +   + + + + + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    + + + + + +   + + + + + +
    Index: lams_tool_daco/web/pages/monitoring/monitoring.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/monitoring/monitoring.jsp (revision 0) +++ lams_tool_daco/web/pages/monitoring/monitoring.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,57 @@ + + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.tool.daco.DacoConstants"%> + + + + <%@ include file="/common/tabbedheader.jsp" %> + + + +
    +

    + +

    + +
    + + + + + + +
    + + +
    + +
    Index: lams_tool_daco/web/pages/monitoring/notebook.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/monitoring/notebook.jsp (revision 0) +++ lams_tool_daco/web/pages/monitoring/notebook.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,48 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + <fmt:message key="label.learning.title" /> + <%@ include file="/common/header.jsp"%> + + + +
    +

    + +

    + ${userDTO.fullName}

    + + + + + + + +
    + +
    + + + + + + + + +
    + + + + +
    + +
    +
    + + + +
    Index: lams_tool_daco/web/pages/monitoring/statistic.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/monitoring/statistic.jsp (revision 0) +++ lams_tool_daco/web/pages/monitoring/statistic.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,98 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + +
    +
    + + + + <%-- display group name on first row--%> + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ${question.sessionName} + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${question.questionTitle} + ${question.username} + + + + + + + ${question.viewNumber} + + + 0 + +
    Index: lams_tool_daco/web/pages/monitoring/summary.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/monitoring/summary.jsp (revision 0) +++ lams_tool_daco/web/pages/monitoring/summary.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,150 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + +
    +
    + + + + + + <%-- display group name on first row--%> + + + + + + + + + + + + <%-- End group title display --%> + + + + + + + + + + + + + + + + + <%-- Reflection list --%> + + + + + + + + + + + + + + + + + + + + + + + + +
    ${question.sessionName} + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${question.questionTitle} + + ${question.username} + + + + + + + ${question.viewNumber} + + + 0 + + + + + + + + + + +
    +

    +
    ${user.fullName}${user.loginName} + + + +
    Index: lams_tool_daco/web/pages/monitoring/userlist.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/monitoring/userlist.jsp (revision 0) +++ lams_tool_daco/web/pages/monitoring/userlist.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,54 @@ + + + +<%@ include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp" %> + + + + +
    + +

    + +

    + + + + + + + + + + + + + + + + + +
    + + + + + +
    + ${user.loginName} + + + + ${user.firstName},${user.lastName} +
    + Close +
    +
    + + + +
    Index: lams_tool_daco/web/pages/questionreview/initnav.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/questionreview/initnav.jsp (revision 0) +++ lams_tool_daco/web/pages/questionreview/initnav.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,24 @@ +<%-- +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_daco/web/pages/questionreview/instructionsnav.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/questionreview/instructionsnav.jsp (revision 0) +++ lams_tool_daco/web/pages/questionreview/instructionsnav.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -0,0 +1,18 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + + + Nothing here + + <%@ include file="/common/header.jsp"%> + + + + + Nothing here + + Index: lams_tool_daco/web/pages/questionreview/mainframe.jsp =================================================================== diff -u --- lams_tool_daco/web/pages/questionreview/mainframe.jsp (revision 0) +++ lams_tool_daco/web/pages/questionreview/mainframe.jsp (revision be03cfbba16a388e85d82cb8986f63d6b2ad568b) @@ -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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> +<%@ include file="/common/taglibs.jsp" %> + + ?mode=${mode}&questionIndex=${questionIndex}&questionUid=${questionUid}&toolSessionID=${toolSessionID}&sessionMapID=${sessionMapID}" + name=headerFrame" marginheight="0" scrolling="YES"> + +