Index: lams_build/build.xml =================================================================== diff -u -re88830091139dd447cdd6a7f30c129c777104dac -r90e5fd15f6474eb56d0b497d1b73e14bda75e262 --- lams_build/build.xml (.../build.xml) (revision e88830091139dd447cdd6a7f30c129c777104dac) +++ lams_build/build.xml (.../build.xml) (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -91,6 +91,7 @@ + --> @@ -124,6 +125,7 @@ + @@ -287,6 +289,7 @@ + --> @@ -773,6 +776,7 @@ + Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== diff -u -r127e2b2c6cd0b7942d00f122281c2c12ba3e6ebe -r90e5fd15f6474eb56d0b497d1b73e14bda75e262 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 127e2b2c6cd0b7942d00f122281c2c12ba3e6ebe) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -77,6 +77,7 @@ 'Survey' : 6, 'Share taskList' : 4, 'Voting' : 6, + 'Whiteboard' : 2, 'Wiki' : 2, 'Kaltura' : 2, 'Zoom' : 2, Index: lams_tool_whiteboard/.classpath =================================================================== diff -u --- lams_tool_whiteboard/.classpath (revision 0) +++ lams_tool_whiteboard/.classpath (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_whiteboard/.gitignore =================================================================== diff -u --- lams_tool_whiteboard/.gitignore (revision 0) +++ lams_tool_whiteboard/.gitignore (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,2 @@ +/bin/ +/build/ \ No newline at end of file Index: lams_tool_whiteboard/.project =================================================================== diff -u --- lams_tool_whiteboard/.project (revision 0) +++ lams_tool_whiteboard/.project (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,19 @@ + + + lams_tool_whiteboard + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + com.genuitec.eclipse.hibernate.hibernatenature + com.genuitec.eclipse.j2eedt.core.webnature + org.eclipse.jdt.core.javanature + + Index: lams_tool_whiteboard/build.properties =================================================================== diff -u --- lams_tool_whiteboard/build.properties (revision 0) +++ lams_tool_whiteboard/build.properties (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,7 @@ +# Minimum compatible version of server +min.server.version.number=4.0 + +signature=lawhiteboard11 +tool.version=20210426 +tool.hide=false +tool.short.name=whiteboard Index: lams_tool_whiteboard/build.xml =================================================================== diff -u --- lams_tool_whiteboard/build.xml (revision 0) +++ lams_tool_whiteboard/build.xml (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,26 @@ + + + + + + + + + + + ${ant.project.name}: Copying additional Java classes to WAR + + + + Index: lams_tool_whiteboard/conf/language/lams/ApplicationResources.properties =================================================================== diff -u --- lams_tool_whiteboard/conf/language/lams/ApplicationResources.properties (revision 0) +++ lams_tool_whiteboard/conf/language/lams/ApplicationResources.properties (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,137 @@ +activity.title = Whiteboard +activity.description = Whiteboard is a collaborative drawing tool +activity.helptext = Students can create drawings collaboratively in real-time +tool.display.name = Whiteboard Tool +tool.description = Tool for collaborative real-time drawing +appName = whiteboard +label.authoring.heading = Whiteboard Authoring +label.author.title = Whiteboard +label.authoring.heading.basic = Basic +label.authoring.heading.advance = Advanced +label.authoring.heading.basic.desc = Basic input information for Whiteboard +label.authoring.heading.advance.desc = Please add advance options for Whiteboard +label.authoring.basic.title = Title +label.authoring.basic.instruction = Instructions +label.authoring.advance.lock.on.finished = Lock when finished +label.authoring.save.button = Save +label.authoring.cancel.button = Cancel +error.msg.default.content.not.find = Could not retrieve default content record for this tool. +authoring.msg.cancel.save = Do you want to close this window without saving? +label.learning.title = Whiteboard Learning +monitoring.tab.summary = Summary +monitoring.tab.statistics = Analytics +monitoring.tab.edit.activity = Edit activity +monitoring.label.group = Group +label.monitoring.edit.activity.edit = Edit +message.monitoring.edit.activity.not.editable = This activity is no longer editable +label.edit = Edit +label.finished = Next Activity +label.completed = Completed +label.finish = Finished +message.monitoring.summary.no.session = No session available +label.save = Save +define.later.message = Please wait for the instructor to complete the contents of this activity. +button.try.again = Try again +label.authoring.advanced.reflectOnActivity = Add a notebook at end of the activity with the following instructions: +title.reflection = Notebook entry +label.continue = Continue +message.no.reflection.available = No notebook available +message.alertContentEdit = Warning: One of more learners have accessed this activity. Changing this content will result in learners getting different information. +message.warnLockOnFinish = Note: After you click on "Next Activity", if you come back to this activity, you will not be able make any changes. +message.activityLocked = The instructor has set this activity not to allow you to edit it after you have finished it. +label.on = On +label.off = Off +monitor.summary.th.advancedSettings = Advanced settings +monitor.summary.td.addNotebook = Add a notebook at end of activity +monitor.summary.td.notebookInstructions = Notebook instructions +label.submit = Finish +label.resource.options = Advanced options +label.activity.completion = End of activity +pageTitle.admin = Whiteboard settings +label.select.leader = Leader selection +label.use.select.leader.tool.output = Use leaders from Select Leader tool +label.show.chat = Enable chat +label.show.line.numbers = Show the line numbers +admin.formError = Missing values, please make sure all required fields are entered. +admin.whiteboard.url = Whiteboard server URL +admin.success = Configuration successfully saved. +admin.return = Return to maintain LAMS +error.tool.is.not.configured = In order to proceed please set up tool admin settings. +label.group.leader = Team leader: {0} +label.team.leader = Team leader: +label.monitoring.team.leader = team leader +label.waiting.for.leader = Please, wait while somebody will become a group leader and enter this activity. +label.users.from.group = Other learners in your group: +label.refresh = Refresh +label.export.pad.html = Export as HTML +label.time.limit = Time limit (minutes) +label.plus.one.minute = +1 minute +label.start.activity = Start activity +label.started.activity = Activity has been started +label.waiting.for.teacher.launch.activity = Please, wait for a teacher to launch time limit. +label.time.left = Time left +label.time.is.over = Time is over. No more editing is allowed. +label.monitoring.learner.marks.header = Marks +label.monitoring.learner.marks.first.name = First name +label.monitoring.learner.marks.last.name = Last name +label.monitoring.learner.marks.mark = Mark +label.monitoring.learner.marks.mark.tip = (click to edit; max: 100) +messsage.monitoring.learner.marks.no.data = No learner data found +messsage.monitoring.learner.marks.update.fail = Error while updating a learner mark +outcome.authoring.title = Learning outcomes +outcome.authoring.input = Search and select by outcome name or code +outcome.authoring.existing = Added outcomes +outcome.authoring.existing.none = none +outcome.authoring.create.new = [create new] +output.desc.manual.grading = Manual grading +label.authoring.advance.gallery.walk.enabled = Gallery Walk +label.authoring.advance.gallery.walk.read.only = Disable commentary and rating +label.authoring.advance.gallery.walk.info1 = Use Gallery Walk to promote inter- and intra-teams discussion, higher order thinking, cooperative learning and team building. +label.authoring.advance.gallery.walk.info2 = When enabled, after you start Gallery Walk in the lesson, the document created for each team is shared to all other teams. Teams then, can give each others feedback and rate each others' work. +label.authoring.advance.gallery.walk.instructions = Instructions for Gallery Walk (ie: Please review other groups' work and make sure you add your review/comments) +label.authoring.advance.gallery.walk.read.only.tooltip = Students will not be able to neither comment on nor rate other teams' work. +monitoring.summary.gallery.walk.start = Start Gallery Walk +monitoring.summary.gallery.walk.start.confirm = Are you sure you want to finish collaboration phase and start Gallery Walk? +monitoring.summary.gallery.walk.finish = Finish Gallery Walk +monitoring.summary.gallery.walk.finish.confirm = Are you sure you want to finish Gallery Walk? +label.gallery.walk = Gallery Walk +label.gallery.walk.wait.finish = The Gallery Walk activity has not been set as completed by the teacher. If you have completed, please contact the teacher for assistance. +label.rating = Rating +label.pad.rating.title = Other groups' rating +label.average.rating = Average rating {0}/{1} votes +label.your.rating = Your rating {0}, average rating {1}/{2} votes +label.gallery.walk.your.group = (Your group) +label.gallery.walk.ratings.header = Ratings +label.gallery.walk.wait.start = As part of this activity, the teacher has planned for you to view and maybe comment on the work of other teams. The activity of seeing and commenting on others' work is called Gallery Walk. Please wait for the teacher to start the Gallery Walk. If this is taking too long, please contact the teacher for assistance. +label.gallery.walk.wait.start.preview = Continue to Gallery Walk. Since you are in preview mode, you can do it immediately. Regular learners get this message would need to wait for a teacher to start Gallery Walk on monitoring screen. +label.gallery.walk.wait.finish.preview = Continue to Gallery Walk summary. Since you are in preview mode, you can do it immediately. Regular learners get this message would need to wait for a teacher to finish Gallery Walk on monitoring screen. +label.gallery.walk.preview = You are in preview mode. You only see your own group. Regular learners would see other groups' work and would be able to comment on it and rate it. +label.monitoring.change.leader = Change leader +label.monitoring.leader.successfully.changed = Leader changed +label.monitoring.leader.not.changed = Leader was not changed +label.authoring.basic.instructions.tooltip = If you want the students to have a template document to guide them on their collaborative response, add your template here. +label.authoring.basic.description.tooltip = Description or case to be presented to students. +label.attendance = Attendance +label.monitoring.summary.time.limit.individual.placeholder = Type name +label.monitoring.summary.time.limit.finish.now.confirm = Are you sure you want to make all learners finish their work right now? +label.monitoring.summary.time.limit.finish.now = Finish now +label.monitoring.summary.time.limit.minus.minute.5 = Minus 5 minutes +label.monitoring.summary.time.limit.minus.minute.1 = Minus 1 minute +label.monitoring.summary.time.limit.plus.minute.5 = Plus 5 minutes +label.monitoring.summary.time.limit.plus.minute.1 = Plus 1 minute +label.monitoring.summary.time.limit.cancel = Cancel +label.monitoring.summary.time.limit.start = Start +label.monitoring.summary.time.limit.disabled = Disabled +label.monitoring.summary.time.limit.enabled = Enabled +label.monitoring.summary.time.limit.minutes = minutes +label.monitoring.summary.time.limit.individual.desc = Apply duration extensions for individual learners. Search the learner and then apply extra time. +label.monitoring.summary.time.limit.individual = Individual extensions +label.monitoring.summary.time.limit.absolute.desc = Set the number of minutes to finish the assessment for all learners. This duration applies to all learners regardless when each of them starts the assessment. Set the minutes and click Start for the time to apply. +label.monitoring.summary.time.limit.absolute = Duration for all learners +label.monitoring.summary.time.limit.relative.desc = Set the duration in minutes that the learners will have to have to complete the assessment. The duration will apply from the moment each learner begins the assessment. For example, if set to 5 minutes, all learners will have 5 minutes from the moment each of them start the assessment. +label.monitoring.summary.time.limit.relative = Duration relative to from student start +label.monitoring.summary.time.limit = Timing limits +label.time.limit.tooltip = Number of minutes that each student will get from the moment they enter this activity. Leave it at 0 for no time restrictions. +label.monitoring.learner.marks.name = Name +label.show.chat.tooltip = Enables the chat feature allowing students to exchange messages while working on the drawing simultaneously. +label.monitoring.summary.time.limit.expired = Expired Index: lams_tool_whiteboard/db/sql/activity_insert.sql =================================================================== diff -u --- lams_tool_whiteboard/db/sql/activity_insert.sql (revision 0) +++ lams_tool_whiteboard/db/sql/activity_insert.sql (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,28 @@ +INSERT INTO lams_learning_activity +( +activity_ui_id +, description +, title +, learning_activity_type_id +, grouping_support_type_id +, apply_grouping_flag +, learning_library_id +, create_date_time +, tool_id +, library_activity_ui_image +, language_file +) +VALUES +( +NULL +, 'Collaborative real-time drawing' +, 'Whiteboard' +, 1 +, 2 +, 0 +, ${learning_library_id} +, NOW() +, ${tool_id} +, 'tool/lawhiteboard11/images/icon_whiteboard.svg' +, 'org.lamsfoundation.lams.tool.whiteboard.ApplicationResources' +) Index: lams_tool_whiteboard/db/sql/create_lams_tool_whiteboard.sql =================================================================== diff -u --- lams_tool_whiteboard/db/sql/create_lams_tool_whiteboard.sql (revision 0) +++ lams_tool_whiteboard/db/sql/create_lams_tool_whiteboard.sql (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,71 @@ +SET FOREIGN_KEY_CHECKS=0; +DROP TABLE IF EXISTS tl_lawhiteboard11_whiteboard; +DROP TABLE IF EXISTS tl_lawhiteboard11_session; +DROP TABLE IF EXISTS tl_lawhiteboard11_user; +CREATE TABLE tl_lawhiteboard11_whiteboard ( + uid bigint not null auto_increment, + content_id bigint unique, + create_date datetime, + update_date datetime, + create_by bigint, + title varchar(255), + lock_on_finished tinyint, + instructions MEDIUMTEXT, + content_in_use tinyint, + define_later tinyint, + use_select_leader_tool_ouput tinyint, + reflect_instructions MEDIUMTEXT, + reflect_on_activity smallint, + relative_time_limit smallint unsigned NOT NULL DEFAULT '0', + absolute_time_limit datetime DEFAULT NULL, + gallery_walk_enabled TINYINT NOT NULL DEFAULT 0, + gallery_walk_read_only TINYINT NOT NULL DEFAULT 0, + gallery_walk_started TINYINT NOT NULL DEFAULT 0, + gallery_walk_finished TINYINT NOT NULL DEFAULT 0, + gallery_walk_instructions TEXT, + primary key (uid) +)ENGINE=InnoDB; +CREATE TABLE tl_lawhiteboard11_session ( + uid bigint not null auto_increment, + whiteboard_uid bigint, + session_id bigint, + status integer, + session_name varchar(250), + group_leader_uid BIGINT, + primary key (uid) +)ENGINE=InnoDB; +CREATE TABLE tl_lawhiteboard11_user ( + uid bigint not null auto_increment, + session_uid bigint, + whiteboard_uid bigint, + user_id bigint, + login_name varchar(255), + last_name varchar(255), + first_name varchar(255), + session_finished smallint, + time_limit_launched_date datetime DEFAULT NULL, + primary key (uid) +)ENGINE=InnoDB; +CREATE TABLE tl_lawhiteboard11_time_limit ( + whiteboard_uid BIGINT NOT NULL, + user_id BIGINT NOT NULL, + adjustment SMALLINT NOT NULL DEFAULT 0, + CONSTRAINT FK_tl_lawhiteboard11_time_limit_1 FOREIGN KEY (whiteboard_uid) + REFERENCES tl_lawhiteboard11_whiteboard (uid) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT FK_tl_lawhiteboard11_time_limit_2 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) ON DELETE CASCADE ON UPDATE CASCADE +); + +ALTER TABLE tl_lawhiteboard11_whiteboard ADD CONSTRAINT FK_tl_lawhiteboard11_whiteboard_1 FOREIGN KEY (create_by) REFERENCES tl_lawhiteboard11_user (uid) ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE tl_lawhiteboard11_session ADD CONSTRAINT FK_tl_lawhiteboard11_session_2 FOREIGN KEY (whiteboard_uid) REFERENCES tl_lawhiteboard11_whiteboard (uid) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE tl_lawhiteboard11_session ADD UNIQUE UQ_tl_lawhiteboard11_session_session_id (session_id); +ALTER TABLE tl_lawhiteboard11_user ADD CONSTRAINT tl_lawhiteboard11_user_1 FOREIGN KEY (session_uid) REFERENCES tl_lawhiteboard11_session (uid) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE tl_lawhiteboard11_user ADD CONSTRAINT tl_lawhiteboard11_user_2 FOREIGN KEY (whiteboard_uid) REFERENCES tl_lawhiteboard11_whiteboard (uid) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE tl_lawhiteboard11_user ADD INDEX idx_user_user_id (user_id); +ALTER TABLE tl_lawhiteboard11_session ADD CONSTRAINT tl_lawhiteboard11_session_2 FOREIGN KEY (`group_leader_uid`) REFERENCES `tl_lawhiteboard11_user` (`uid`) ON DELETE SET NULL ON UPDATE CASCADE; + +INSERT INTO `tl_lawhiteboard11_whiteboard` (`uid`, `create_date`, `update_date`, `create_by`, `title`, `lock_on_finished`, + `instructions`, `content_in_use`, `define_later`, `content_id`, `use_select_leader_tool_ouput`, `reflect_on_activity`) VALUES + (1,NULL,NULL,NULL,'Whiteboard','0','Instructions',0,0,${default_content_id},0,0); + +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_whiteboard/db/sql/db_version_insert.sql =================================================================== diff -u --- lams_tool_whiteboard/db/sql/db_version_insert.sql (revision 0) +++ lams_tool_whiteboard/db/sql/db_version_insert.sql (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,2 @@ + +INSERT INTO patches VALUES ('@signature@', '@tool_version@', NOW(), 'F'); Index: lams_tool_whiteboard/db/sql/library_insert.sql =================================================================== diff -u --- lams_tool_whiteboard/db/sql/library_insert.sql (revision 0) +++ lams_tool_whiteboard/db/sql/library_insert.sql (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,14 @@ +INSERT INTO lams_learning_library +( +description, +title, +valid_flag, +create_date_time +) +VALUES +( +'Collaborative real-time drawing editor', +'Whiteboard', +0, +NOW() +) Index: lams_tool_whiteboard/db/sql/tool_insert.sql =================================================================== diff -u --- lams_tool_whiteboard/db/sql/tool_insert.sql (revision 0) +++ lams_tool_whiteboard/db/sql/tool_insert.sql (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,48 @@ +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, +learner_url, +learner_preview_url, +learner_progress_url, +author_url, +monitor_url, +pedagogical_planner_url, +help_url, +language_file, +create_date_time, +modified_date_time, +admin_url +) +VALUES +( +'lawhiteboard11', +'whiteboardService', +'Whiteboard', +'Collaborative real-time drawing editor', +'whiteboard', +'@tool_version@', +NULL, +NULL, +0, +2, +'tool/lawhiteboard11/learning/start.do?mode=learner', +'tool/lawhiteboard11/learning/start.do?mode=author', +'tool/lawhiteboard11/learning/start.do?mode=teacher', +'tool/lawhiteboard11/authoring/start.do', +'tool/lawhiteboard11/monitoring/summary.do', +NULL, +'http://wiki.lamsfoundation.org/display/lamsdocs/lawhiteboard11', +'org.lamsfoundation.lams.tool.whiteboard.ApplicationResources', +NOW(), +NOW(), +'tool/lawhiteboard11/admin/start.do' +) Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/WhiteboardConstants.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/WhiteboardConstants.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/WhiteboardConstants.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,121 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard; + +public class WhiteboardConstants { + public static final String TOOL_SIGNATURE = "lawhiteboard11"; + + public static final String WHITEBOARD_SERVICE = "whiteboardService"; + + public static final String TOOL_CONTENT_HANDLER_NAME = "whiteboardToolContentHandler"; + + public static final int COMPLETED = 1; + + // for action forward name + public static final String SUCCESS = "success"; + + public static final String ERROR = "error"; + + public static final String DEFINE_LATER = "definelater"; + + // for parameters' name + public static final String PARAM_TOOL_CONTENT_ID = "toolContentID"; + + public static final String PARAM_TOOL_SESSION_ID = "toolSessionID"; + + public static final String PARAM_CURRENT_INSTRUCTION_INDEX = "insIdx"; + + public static final String PARAM_OPEN_URL_POPUP = "popupUrl"; + + public static final String PARAM_TITLE = "title"; + + // for request attribute name + public static final String ATTR_TOOL_CONTENT_ID = "toolContentID"; + + public static final String ATTR_TOOL_SESSION_ID = "toolSessionID"; + + public static final String ATTR_WHITEBOARD = "whiteboard"; + + public static final String ATTR_GROUP_USERS = "groupUsers"; + + public static final String ATTR_IS_LEADER_RESPONSE_FINALIZED = "isLeaderResponseFinalized"; + + public static final String ATTR_NEXT_ACTIVITY_URL = "nextActivityUrl"; + + public static final String ATTR_SUMMARY_LIST = "summaryList"; + + public static final String ATTR_HAS_FAULTY_SESSION = "hasFaultySession"; + + public static final String ATTR_USER_LIST = "userList"; + + public static final String ATTR_FINISH_LOCK = "finishedLock"; + + public static final String ATTR_LOCK_ON_FINISH = "lockOnFinish"; + + public static final String ATTR_HAS_EDIT_RIGHT = "hasEditRight"; + + public static final String ATTR_SESSION_MAP_ID = "sessionMapID"; + + public static final String ATTR_RESOURCE_FORM = "whiteboardForm"; + + public static final String ATTR_ADD_RESOURCE_TYPE = "addType"; + + public static final String ATTR_FILE_TYPE_FLAG = "fileTypeFlag"; + + public static final String ATTR_TITLE = "title"; + + public static final String ATTR_INSTRUCTIONS = "instructions"; + + public static final String ATTR_USER_FINISHED = "userFinished"; + + public static final String ATTR_IS_GROUPED_ACTIVITY = "isGroupedActivity"; + + public static final String ATTR_SECONDS_LEFT = "secondsLeft"; + + public static final String KEY_WHITEBOARD_SERVER_URL = "whiteboardServerUrl"; + + public static final String DEFAULT_PAD_NAME = "LAMS-pad"; + + public static final String PREFIX_REGULAR_GROUP = "LAMS-group-"; + + public static final String PREFIX_SHARED_GROUP = "LAMS-sharedGroup-"; + + // error message keys + + public static final String PAGE_EDITABLE = "isPageEditable"; + + public static final String MODE_AUTHOR_SESSION = "author_session"; + + 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 MANUAL_GRADING_DEFINITION_NAME = "manual.grading"; +} Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/WhiteboardDAO.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/WhiteboardDAO.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/WhiteboardDAO.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,34 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.dao; + +import org.lamsfoundation.lams.dao.IBaseDAO; +import org.lamsfoundation.lams.tool.whiteboard.model.Whiteboard; + +public interface WhiteboardDAO extends IBaseDAO { + + Whiteboard getByContentId(Long contentId); + + Whiteboard getByUid(Long whiteboardUid); +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/WhiteboardSessionDAO.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/WhiteboardSessionDAO.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/WhiteboardSessionDAO.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,38 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.dao; + +import java.util.List; + +import org.lamsfoundation.lams.dao.IBaseDAO; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardSession; + +public interface WhiteboardSessionDAO extends IBaseDAO { + + WhiteboardSession getSessionBySessionId(Long toolSessionId); + + List getByContentId(Long toolContentId); + + void deleteBySessionId(Long toolSessionId); +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/WhiteboardUserDAO.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/WhiteboardUserDAO.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/WhiteboardUserDAO.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,38 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.dao; + +import java.util.List; + +import org.lamsfoundation.lams.dao.IBaseDAO; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardUser; + +public interface WhiteboardUserDAO extends IBaseDAO{ + + WhiteboardUser getUserByUserIDAndSessionID(Long userID, Long sessionId); + + WhiteboardUser getUserByUserIDAndContentID(Long userId, Long contentId); + + List getBySessionID(Long sessionId); +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/hibernate/WhiteboardDAOHibernate.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/hibernate/WhiteboardDAOHibernate.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/hibernate/WhiteboardDAOHibernate.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 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.whiteboard.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.dao.hibernate.LAMSBaseDAO; +import org.lamsfoundation.lams.tool.whiteboard.dao.WhiteboardDAO; +import org.lamsfoundation.lams.tool.whiteboard.model.Whiteboard; +import org.springframework.stereotype.Repository; + +@Repository +public class WhiteboardDAOHibernate extends LAMSBaseDAO implements WhiteboardDAO { + private static final String GET_RESOURCE_BY_CONTENTID = "from " + Whiteboard.class.getName() + + " as r where r.contentId=?"; + + @Override + public Whiteboard getByContentId(Long contentId) { + List list = doFind(GET_RESOURCE_BY_CONTENTID, contentId); + if (list.size() > 0) { + return (Whiteboard) list.get(0); + } else { + return null; + } + } + + @Override + public Whiteboard getByUid(Long whiteboardUid) { + return (Whiteboard) getObject(Whiteboard.class, whiteboardUid); + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/hibernate/WhiteboardSessionDAOHibernate.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/hibernate/WhiteboardSessionDAOHibernate.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/hibernate/WhiteboardSessionDAOHibernate.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 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.whiteboard.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.dao.hibernate.LAMSBaseDAO; +import org.lamsfoundation.lams.tool.whiteboard.dao.WhiteboardSessionDAO; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardSession; +import org.springframework.stereotype.Repository; + +@Repository +public class WhiteboardSessionDAOHibernate extends LAMSBaseDAO implements WhiteboardSessionDAO { + + private static final String FIND_BY_SESSION_ID = "from " + WhiteboardSession.class.getName() + + " as p where p.sessionId=?"; + private static final String FIND_BY_CONTENT_ID = "from " + WhiteboardSession.class.getName() + + " as p where p.whiteboard.contentId=? order by p.sessionName asc"; + + @Override + public WhiteboardSession getSessionBySessionId(Long sessionId) { + List list = doFind(FIND_BY_SESSION_ID, sessionId); + if (list == null || list.size() == 0) { + return null; + } + return (WhiteboardSession) list.get(0); + } + + @Override + @SuppressWarnings("unchecked") + public List getByContentId(Long toolContentId) { + return doFind(FIND_BY_CONTENT_ID, toolContentId); + } + + @Override + public void deleteBySessionId(Long toolSessionId) { + this.removeObject(WhiteboardSession.class, toolSessionId); + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/hibernate/WhiteboardUserDAOHibernate.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/hibernate/WhiteboardUserDAOHibernate.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dao/hibernate/WhiteboardUserDAOHibernate.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,66 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.dao.hibernate.LAMSBaseDAO; +import org.lamsfoundation.lams.tool.whiteboard.dao.WhiteboardUserDAO; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardUser; +import org.springframework.stereotype.Repository; + +@Repository +public class WhiteboardUserDAOHibernate extends LAMSBaseDAO implements WhiteboardUserDAO { + + private static final String FIND_BY_USER_ID_CONTENT_ID = "from " + WhiteboardUser.class.getName() + + " as u where u.userId =? and u.whiteboard.contentId=?"; + private static final String FIND_BY_USER_ID_SESSION_ID = "from " + WhiteboardUser.class.getName() + + " as u where u.userId =? and u.session.sessionId=?"; + private static final String FIND_BY_SESSION_ID = "from " + WhiteboardUser.class.getName() + + " as u where u.session.sessionId=?"; + + @Override + public WhiteboardUser getUserByUserIDAndSessionID(Long userId, Long toolSessionId) { + List list = this.doFind(FIND_BY_USER_ID_SESSION_ID, new Object[] { userId, toolSessionId }); + if (list == null || list.size() == 0) { + return null; + } + return (WhiteboardUser) list.get(0); + } + + @Override + public WhiteboardUser getUserByUserIDAndContentID(Long userId, Long contentId) { + List list = this.doFind(FIND_BY_USER_ID_CONTENT_ID, new Object[] { userId, contentId }); + if (list == null || list.size() == 0) { + return null; + } + return (WhiteboardUser) list.get(0); + } + + @Override + @SuppressWarnings("unchecked") + public List getBySessionID(Long sessionId) { + return this.doFind(FIND_BY_SESSION_ID, sessionId); + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dbupdates/autopatchContext.xml =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dbupdates/autopatchContext.xml (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dbupdates/autopatchContext.xml (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,14 @@ + + + + + + + + + + + Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dto/ReflectDTO.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dto/ReflectDTO.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dto/ReflectDTO.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,87 @@ +package org.lamsfoundation.lams.tool.whiteboard.dto; + +import java.util.Date; + +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardUser; + +public class ReflectDTO { + private Long userUid; + private Long userId; + private String fullName; + private String loginName; + private String reflectInstrctions; + private boolean finishReflection; + private String reflect; + private Date date; + + public ReflectDTO(WhiteboardUser user) { + this.setLoginName(user.getLoginName()); + this.setFullName(user.getFirstName() + " " + user.getLastName()); + this.setUserUid(user.getUid()); + this.setUserId(user.getUserId()); + } + + 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 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; + } + + public Date getDate() { + return date; + } + + public void setDate(Date date) { + this.date = date; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } +} Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dto/SessionDTO.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dto/SessionDTO.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/dto/SessionDTO.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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.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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.dto; + +import org.lamsfoundation.lams.rating.dto.ItemRatingDTO; + +public class SessionDTO { + + private Long sessionId; + private String sessionName; + private String wid; + private String readOnlyWid; + private boolean sessionFaulty; + private ItemRatingDTO itemRatingDto; + private int numberOfLearners; + private boolean sessionFinished; + + 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 getWid() { + return wid; + } + + public void setWid(String padId) { + this.wid = padId; + } + + public String getReadOnlyWid() { + return readOnlyWid; + } + + public void setReadOnlyWid(String readOnlyPadId) { + this.readOnlyWid = readOnlyPadId; + } + + public boolean isSessionFaulty() { + return sessionFaulty; + } + + public void setSessionFaulty(boolean sessionFaulty) { + this.sessionFaulty = sessionFaulty; + } + + public ItemRatingDTO getItemRatingDto() { + return itemRatingDto; + } + + public void setItemRatingDto(ItemRatingDTO ratingDto) { + this.itemRatingDto = ratingDto; + } + + public int getNumberOfLearners() { + return numberOfLearners; + } + + public void setNumberOfLearners(int numberOfLearners) { + this.numberOfLearners = numberOfLearners; + } + + public boolean isSessionFinished() { + return sessionFinished; + } + + public void setSessionFinished(boolean sesssionFinished) { + this.sessionFinished = sesssionFinished; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/model/Whiteboard.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/model/Whiteboard.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/model/Whiteboard.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,393 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.model; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import javax.persistence.CollectionTable; +import javax.persistence.Column; +import javax.persistence.ElementCollection; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.MapKeyColumn; +import javax.persistence.Table; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.log4j.Logger; +import org.hibernate.annotations.Cascade; + +@Entity +@Table(name = "tl_lawhiteboard11_whiteboard") +public class Whiteboard implements Cloneable { + private static final Logger log = Logger.getLogger(Whiteboard.class); + + @Id + @Column + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long uid; + + @Column(name = "content_id") + private Long contentId; + + @Column + private String title; + + @Column + private String instructions; + + // advance + @Column(name = "use_select_leader_tool_ouput") + private boolean useSelectLeaderToolOuput; + + @Column(name = "relative_time_limit") + private int relativeTimeLimit; + + @Column(name = "absolute_time_limit") + private LocalDateTime absoluteTimeLimit; + + @ElementCollection(fetch = FetchType.LAZY) + @CollectionTable(name = "tl_lawhiteboard11_time_limit", joinColumns = @JoinColumn(name = "whiteboard_uid")) + @MapKeyColumn(name = "user_id") + @Column(name = "adjustment") + private Map timeLimitAdjustments = new HashMap<>(); + + @Column(name = "lock_on_finished") + private boolean lockWhenFinished; + + @Column(name = "content_in_use") + private boolean contentInUse; + + @Column(name = "define_later") + private boolean defineLater; + + @Column(name = "reflect_on_activity") + private boolean reflectOnActivity; + + @Column(name = "reflect_instructions") + private String reflectInstructions; + + @Column(name = "gallery_walk_enabled") + private boolean galleryWalkEnabled; + + @Column(name = "gallery_walk_read_only") + private boolean galleryWalkReadOnly; + + @Column(name = "gallery_walk_started") + private boolean galleryWalkStarted; + + @Column(name = "gallery_walk_finished") + private boolean galleryWalkFinished; + + @Column(name = "gallery_walk_instructions") + private String galleryWalkInstructions; + + // general information + @Column(name = "create_date") + private Date created; + + @Column(name = "update_date") + private Date updated; + + @ManyToOne(fetch = FetchType.LAZY) + @Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE) + @JoinColumn(name = "create_by") + private WhiteboardUser createdBy; + + // ********************************************************** + // Function method for Whiteboard + // ********************************************************** + public static Whiteboard newInstance(Whiteboard defaultContent, Long contentId) { + Whiteboard toContent = new Whiteboard(); + toContent = (Whiteboard) defaultContent.clone(); + toContent.setContentId(contentId); + + return toContent; + } + + @Override + public Object clone() { + Whiteboard whiteboard = null; + try { + whiteboard = (Whiteboard) super.clone(); + whiteboard.setUid(null); + // clone ReourceUser as well + if (createdBy != null) { + whiteboard.setCreatedBy((WhiteboardUser) createdBy.clone()); + } + } catch (CloneNotSupportedException e) { + Whiteboard.log.error("When clone " + Whiteboard.class + " failed"); + } + + whiteboard.setTimeLimitAdjustments(new HashMap<>(this.getTimeLimitAdjustments())); + + return whiteboard; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Whiteboard)) { + return false; + } + + final Whiteboard genericEntity = (Whiteboard) o; + + return new EqualsBuilder().append(uid, genericEntity.uid).append(title, genericEntity.title) + .append(instructions, genericEntity.instructions).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(created).append(updated) + .append(createdBy).toHashCode(); + } + + // ********************************************************** + // get/set methods + // ********************************************************** + /** + * Returns the object's creation date + * + * @return date + * + */ + public Date getCreated() { + return created; + } + + /** + * Sets the object's creation date + * + */ + public void setCreated(Date created) { + this.created = created; + } + + /** + * Returns the object's date of last update + */ + public Date getUpdated() { + return updated; + } + + /** + * Sets the object's date of last update + */ + public void setUpdated(Date updated) { + this.updated = updated; + } + + public WhiteboardUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(WhiteboardUser createdBy) { + this.createdBy = createdBy; + } + + public Long getUid() { + return uid; + } + + public void setUid(Long uid) { + this.uid = uid; + } + + /** + * @return Returns the title. + */ + public String getTitle() { + return title; + } + + /** + * @param title + * The title to set. + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * @return Returns the lockWhenFinish. + */ + public boolean getLockWhenFinished() { + return lockWhenFinished; + } + + /** + * @param lockWhenFinished + * Set to true to lock the whiteboard for finished users. + */ + public void setLockWhenFinished(boolean lockWhenFinished) { + this.lockWhenFinished = lockWhenFinished; + } + + /** + * @return Returns the instructions set by the teacher. + */ + public String getInstructions() { + return instructions; + } + + public void setInstructions(String instructions) { + this.instructions = instructions; + } + + public boolean isContentInUse() { + return contentInUse; + } + + public void setContentInUse(boolean contentInUse) { + this.contentInUse = contentInUse; + } + + public boolean isDefineLater() { + return defineLater; + } + + public void setDefineLater(boolean defineLater) { + this.defineLater = defineLater; + } + + public Long getContentId() { + return contentId; + } + + public void setContentId(Long contentId) { + this.contentId = contentId; + } + + /** + * @return Returns the time limitation, that students have to complete an attempt. + */ + public int getRelativeTimeLimit() { + return relativeTimeLimit; + } + + /** + * @param timeLimit + * the time limitation, that students have to complete an attempt. + */ + public void setRelativeTimeLimit(int timeLimit) { + this.relativeTimeLimit = timeLimit; + } + + public LocalDateTime getAbsoluteTimeLimit() { + return absoluteTimeLimit; + } + + public void setAbsoluteTimeLimit(LocalDateTime absoluteTimeLimit) { + this.absoluteTimeLimit = absoluteTimeLimit; + } + + public Long getAbsoluteTimeLimitSeconds() { + return absoluteTimeLimit == null ? null : absoluteTimeLimit.atZone(ZoneId.systemDefault()).toEpochSecond(); + } + + public Map getTimeLimitAdjustments() { + return timeLimitAdjustments; + } + + public void setTimeLimitAdjustments(Map timeLimitAdjustments) { + this.timeLimitAdjustments = timeLimitAdjustments; + } + + public boolean isUseSelectLeaderToolOuput() { + return useSelectLeaderToolOuput; + } + + public void setUseSelectLeaderToolOuput(boolean useSelectLeaderToolOuput) { + this.useSelectLeaderToolOuput = useSelectLeaderToolOuput; + } + + public String getReflectInstructions() { + return reflectInstructions; + } + + public void setReflectInstructions(String reflectInstructions) { + this.reflectInstructions = reflectInstructions; + } + + public boolean isReflectOnActivity() { + return reflectOnActivity; + } + + public void setReflectOnActivity(boolean reflectOnActivity) { + this.reflectOnActivity = reflectOnActivity; + } + + public boolean isGalleryWalkEnabled() { + return galleryWalkEnabled; + } + + public void setGalleryWalkEnabled(boolean galleryWalkEnabled) { + this.galleryWalkEnabled = galleryWalkEnabled; + } + + public boolean isGalleryWalkReadOnly() { + return galleryWalkReadOnly; + } + + public void setGalleryWalkReadOnly(boolean galleryWalkReadOnly) { + this.galleryWalkReadOnly = galleryWalkReadOnly; + } + + public boolean isGalleryWalkStarted() { + return galleryWalkStarted; + } + + public void setGalleryWalkStarted(boolean galleryWalkStarted) { + this.galleryWalkStarted = galleryWalkStarted; + } + + public boolean isGalleryWalkFinished() { + return galleryWalkFinished; + } + + public void setGalleryWalkFinished(boolean galleryWalkFinished) { + this.galleryWalkFinished = galleryWalkFinished; + } + + public String getGalleryWalkInstructions() { + return galleryWalkInstructions; + } + + public void setGalleryWalkInstructions(String galleryWalkInstructions) { + this.galleryWalkInstructions = galleryWalkInstructions; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/model/WhiteboardSession.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/model/WhiteboardSession.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/model/WhiteboardSession.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "tl_lawhiteboard11_session") +public class WhiteboardSession { + + @Id + @Column + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long uid; + + @Column(name = "session_id") + private Long sessionId; + + @Column(name = "session_name") + private String sessionName; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "whiteboard_uid") + private Whiteboard whiteboard; + + // finished or not + @Column + private int status; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "group_leader_uid") + private WhiteboardUser groupLeader; + + public Long getUid() { + return uid; + } + + public void setUid(Long uuid) { + this.uid = uuid; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public Whiteboard getWhiteboard() { + return whiteboard; + } + + public void setWhiteboard(Whiteboard whiteboard) { + this.whiteboard = whiteboard; + } + + 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 WhiteboardUser getGroupLeader() { + return this.groupLeader; + } + + public void setGroupLeader(WhiteboardUser groupLeader) { + this.groupLeader = groupLeader; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/model/WhiteboardUser.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/model/WhiteboardUser.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/model/WhiteboardUser.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,209 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.model; + +import java.time.LocalDateTime; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +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; + +@Entity +@Table(name = "tl_lawhiteboard11_user") +public class WhiteboardUser implements Cloneable { + private static Logger log = Logger.getLogger(WhiteboardUser.class); + + @Id + @Column + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long uid; + + @Column(name = "user_id") + private Long userId; + + @Column(name = "first_name") + private String firstName; + + @Column(name = "last_name") + private String lastName; + + @Column(name = "login_name") + private String loginName; + + @Column(name = "session_finished") + private boolean sessionFinished; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "session_uid") + private WhiteboardSession session; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "whiteboard_uid") + private Whiteboard whiteboard; + + // date when user has started activity + @Column(name = "time_limit_launched_date") + private LocalDateTime timeLimitLaunchedDate; + + public WhiteboardUser() { + } + + public WhiteboardUser(UserDTO user, WhiteboardSession session) { + this.userId = user.getUserID().longValue(); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.loginName = user.getLogin(); + this.session = session; + this.whiteboard = session.getWhiteboard(); + this.sessionFinished = false; + } + + public WhiteboardUser(UserDTO user, Whiteboard content) { + this.userId = user.getUserID().longValue(); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.loginName = user.getLogin(); + this.session = null; + this.whiteboard = content; + this.sessionFinished = false; + } + + @Override + public Object clone() { + WhiteboardUser user = null; + try { + user = (WhiteboardUser) super.clone(); + user.setUid(null); + // never clone session + user.setSession(null); + } catch (CloneNotSupportedException e) { + log.error("When clone " + WhiteboardUser.class + " failed"); + } + + return user; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof WhiteboardUser)) { + return false; + } + + final WhiteboardUser user = (WhiteboardUser) 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(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(uid).append(firstName).append(lastName).append(loginName).toHashCode(); + } + + public Long getUid() { + return uid; + } + + public void setUid(Long userID) { + this.uid = userID; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userID) { + this.userId = userID; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public WhiteboardSession getSession() { + return session; + } + + public void setSession(WhiteboardSession session) { + this.session = session; + } + + public Whiteboard getWhiteboard() { + return whiteboard; + } + + public void setWhiteboard(Whiteboard content) { + this.whiteboard = content; + } + + public boolean isSessionFinished() { + return sessionFinished; + } + + public void setSessionFinished(boolean sessionFinished) { + this.sessionFinished = sessionFinished; + } + + public LocalDateTime getTimeLimitLaunchedDate() { + return timeLimitLaunchedDate; + } + + public void setTimeLimitLaunchedDate(LocalDateTime timeLimitLaunchedDate) { + this.timeLimitLaunchedDate = timeLimitLaunchedDate; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/IWhiteboardService.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/IWhiteboardService.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/IWhiteboardService.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,128 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.service; + +import java.io.IOException; +import java.time.LocalDateTime; +import java.util.List; + +import org.lamsfoundation.lams.learningdesign.Grouping; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.tool.service.ICommonToolService; +import org.lamsfoundation.lams.tool.whiteboard.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.whiteboard.model.Whiteboard; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardSession; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardUser; +import org.lamsfoundation.lams.usermanagement.User; + +public interface IWhiteboardService extends ICommonToolService { + + /** + * Get Whiteboard by toolContentID. + */ + Whiteboard getWhiteboardByContentId(Long contentId); + + /** + * Get a cloned copy of tool default tool content (Whiteboard) and assign the toolContentId of that copy as the + * given + * contentId + */ + Whiteboard getDefaultContent(Long contentId) throws WhiteboardApplicationException; + + WhiteboardUser checkLeaderSelectToolForSessionLeader(WhiteboardUser user, Long toolSessionId); + + /** + * Stores date when user has started activity with time limit. + */ + LocalDateTime launchTimeLimit(long toolContentId, int userId); + + /** + * @return whether the time limit is exceeded already + */ + boolean checkTimeLimitExceeded(Whiteboard whiteboard, int userId); + + List getPossibleIndividualTimeLimitUsers(long toolContentId, String searchString); + + WhiteboardUser getUserByIDAndContent(Long userID, Long contentId); + + WhiteboardUser getUserByLoginAndContent(String login, long contentId); + + /** + * Get user by sessionID and UserID + */ + WhiteboardUser getUserByIDAndSession(Long userId, Long toolSessionId); + + /** + * Get users by the given toolSessionId. + */ + List getUsersBySession(Long toolSessionId); + + /** + * Save or update any object into database. + */ + void saveOrUpdate(Object entity); + + Whiteboard getWhiteboardBySessionId(Long sessionId); + + /** + * Get Whiteboard toolSession by toolSessionId + */ + WhiteboardSession getWhiteboardSessionBySessionId(Long toolSessionId); + + /** + * If success return next activity's url, otherwise return null. + */ + String finishToolSession(Long toolSessionId, Long userId) throws WhiteboardApplicationException; + + /** + * Create refection entry into notebook tool. + */ + Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId, + String entryText); + + /** + * Get reflection entry from notebook tool. + */ + NotebookEntry getEntry(Long sessionId, Integer idType, String signature, Integer userID); + + void updateEntry(NotebookEntry notebookEntry); + + /** + * Get Reflect DTO list. + */ + List getReflectList(Long contentId); + + /** + * Get user by UID + */ + WhiteboardUser getUser(Long uid); + + void startGalleryWalk(long toolContentId) throws IOException; + + void finishGalleryWalk(long toolContentId) throws IOException; + + void changeLeaderForGroup(long toolSessionId, long leaderUserId); + + Grouping getGrouping(long toolContentId); +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardApplicationException.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardApplicationException.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardApplicationException.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.service; + +public class WhiteboardApplicationException extends Exception { + + public WhiteboardApplicationException() { + super(); + + } + + public WhiteboardApplicationException(String message, Throwable cause) { + super(message, cause); + + } + + public WhiteboardApplicationException(String message) { + super(message); + + } + + public WhiteboardApplicationException(Throwable cause) { + super(cause); + + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardOutputFactory.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardOutputFactory.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardOutputFactory.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,95 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.service; + +import java.util.List; +import java.util.SortedMap; +import java.util.TreeMap; + +import org.lamsfoundation.lams.tool.OutputFactory; +import org.lamsfoundation.lams.tool.ToolOutput; +import org.lamsfoundation.lams.tool.ToolOutputDefinition; +import org.lamsfoundation.lams.tool.exception.ToolException; +import org.lamsfoundation.lams.tool.whiteboard.WhiteboardConstants; + +public class WhiteboardOutputFactory extends OutputFactory { + + @Override + public SortedMap getToolOutputDefinitions(Object toolContentObject, + int definitionType) throws ToolException { + TreeMap definitionMap = new TreeMap<>(); + switch (definitionType) { + case ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_CONDITION: + ToolOutputDefinition manualGradingDefinition = buildRangeDefinition( + WhiteboardConstants.MANUAL_GRADING_DEFINITION_NAME, 0L, 100L); + manualGradingDefinition.setWeightable(true); + manualGradingDefinition.setShowConditionNameOnly(true); + definitionMap.put(WhiteboardConstants.MANUAL_GRADING_DEFINITION_NAME, manualGradingDefinition); + break; + case ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_DATA_FLOW: + break; + } + return definitionMap; + } + + public SortedMap getToolOutput(List names, IWhiteboardService whiteboardService, + Long toolSessionId, Long learnerId) { + + TreeMap outputs = new TreeMap<>(); + + if (names == null) { + outputs.put(WhiteboardConstants.MANUAL_GRADING_DEFINITION_NAME, getToolOutput( + WhiteboardConstants.MANUAL_GRADING_DEFINITION_NAME, whiteboardService, toolSessionId, learnerId)); + } else { + // tool output cache + TreeMap baseOutputs = new TreeMap<>(); + for (String name : names) { + String[] nameParts = splitConditionName(name); + if (baseOutputs.get(nameParts[0]) != null) { + outputs.put(name, baseOutputs.get(nameParts[0])); + } else { + ToolOutput output = getToolOutput(name, whiteboardService, toolSessionId, learnerId); + if (output != null) { + outputs.put(name, output); + baseOutputs.put(nameParts[0], output); + } + } + } + } + + return outputs; + + } + + public ToolOutput getToolOutput(String name, IWhiteboardService whiteboardService, Long toolSessionId, + Long learnerId) { + if (name != null) { + String[] nameParts = splitConditionName(name); + if (WhiteboardConstants.MANUAL_GRADING_DEFINITION_NAME.equals(nameParts[0])) { + return new ToolOutput(WhiteboardConstants.MANUAL_GRADING_DEFINITION_NAME, + getI18NText(WhiteboardConstants.MANUAL_GRADING_DEFINITION_NAME, true), 0L); + } + } + return null; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardService.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardService.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/service/WhiteboardService.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,811 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.service; + +import java.io.IOException; +import java.security.InvalidParameterException; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.SortedMap; +import java.util.stream.Collectors; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.confidencelevel.ConfidenceLevelDTO; +import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; +import org.lamsfoundation.lams.learning.service.ILearnerService; +import org.lamsfoundation.lams.learningdesign.Grouping; +import org.lamsfoundation.lams.learningdesign.ToolActivity; +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.lesson.Lesson; +import org.lamsfoundation.lams.lesson.service.ILessonService; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; +import org.lamsfoundation.lams.notebook.service.ICoreNotebookService; +import org.lamsfoundation.lams.rating.model.RatingCriteria; +import org.lamsfoundation.lams.rating.model.ToolActivityRatingCriteria; +import org.lamsfoundation.lams.rating.service.IRatingService; +import org.lamsfoundation.lams.tool.ToolCompletionStatus; +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.exception.DataMissingException; +import org.lamsfoundation.lams.tool.exception.ToolException; +import org.lamsfoundation.lams.tool.service.ILamsToolService; +import org.lamsfoundation.lams.tool.whiteboard.WhiteboardConstants; +import org.lamsfoundation.lams.tool.whiteboard.dao.WhiteboardDAO; +import org.lamsfoundation.lams.tool.whiteboard.dao.WhiteboardSessionDAO; +import org.lamsfoundation.lams.tool.whiteboard.dao.WhiteboardUserDAO; +import org.lamsfoundation.lams.tool.whiteboard.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.whiteboard.model.Whiteboard; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardSession; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardUser; +import org.lamsfoundation.lams.tool.whiteboard.web.controller.LearningWebsocketServer; +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 com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +public class WhiteboardService implements IWhiteboardService, ToolContentManager, ToolSessionManager { + private static Logger log = Logger.getLogger(WhiteboardService.class.getName()); + + private WhiteboardDAO whiteboardDao; + + private WhiteboardUserDAO whiteboardUserDao; + + private WhiteboardSessionDAO whiteboardSessionDao; + + private IToolContentHandler whiteboardToolContentHandler; + + private MessageService messageService; + + private ILamsToolService toolService; + + private IUserManagementService userManagementService; + + private ILearnerService learnerService; + + private ILessonService lessonService; + + private IRatingService ratingService; + + private IExportToolContentService exportContentService; + + private ICoreNotebookService coreNotebookService; + + private WhiteboardOutputFactory whiteboardOutputFactory; + + // ******************************************************************************* + // Service method + // ******************************************************************************* + + @Override + public Whiteboard getWhiteboardByContentId(Long contentId) { + Whiteboard rs = whiteboardDao.getByContentId(contentId); + return rs; + } + + @Override + public Whiteboard getDefaultContent(Long contentId) throws WhiteboardApplicationException { + if (contentId == null) { + String error = messageService.getMessage("error.msg.default.content.not.find"); + WhiteboardService.log.error(error); + throw new WhiteboardApplicationException(error); + } + + Whiteboard defaultContent = getDefaultWhiteboard(); + // save default content by given ID. + Whiteboard content = new Whiteboard(); + content = Whiteboard.newInstance(defaultContent, contentId); + return content; + } + + @Override + public WhiteboardUser checkLeaderSelectToolForSessionLeader(WhiteboardUser user, Long toolSessionId) { + if (toolSessionId == null) { + return null; + } + + WhiteboardSession session = getWhiteboardSessionBySessionId(toolSessionId); + WhiteboardUser leader = session.getGroupLeader(); + // check leader select tool for a leader only in case Whiteboard tool doesn't know it + if (leader == null) { + Long leaderUserId = toolService.getLeaderUserId(toolSessionId, user.getUserId().intValue()); + // set leader only if the leader entered the activity + if (user.getUserId().equals(leaderUserId)) { + // is it me? + leader = user; + } else { + leader = getUserByIDAndSession(leaderUserId, toolSessionId); + } + if (leader != null) { + // set group leader + session.setGroupLeader(leader); + whiteboardSessionDao.update(session); + } + } + + return leader; + } + + @Override + public void changeLeaderForGroup(long toolSessionId, long leaderUserId) { + WhiteboardSession session = getWhiteboardSessionBySessionId(toolSessionId); + if (WhiteboardConstants.COMPLETED == session.getStatus()) { + throw new InvalidParameterException("Attempting to assing a new leader with user ID " + leaderUserId + + " to a finished session wtih ID " + toolSessionId); + } + + WhiteboardUser existingLeader = session.getGroupLeader(); + if (existingLeader == null || existingLeader.getUserId().equals(leaderUserId)) { + return; + } + + WhiteboardUser newLeader = getUserByIDAndSession(leaderUserId, toolSessionId); + if (newLeader == null) { + User user = userManagementService.getUserById(Long.valueOf(leaderUserId).intValue()); + newLeader = new WhiteboardUser(user.getUserDTO(), session); + saveOrUpdate(newLeader); + + if (log.isDebugEnabled()) { + log.debug("Created user with ID " + leaderUserId + " to become a new leader for session with ID " + + toolSessionId); + } + } + + session.setGroupLeader(newLeader); + whiteboardSessionDao.update(session); + + if (log.isDebugEnabled()) { + log.debug("User with ID " + leaderUserId + " became a new leader for session with ID " + toolSessionId); + } + + Set userIds = getUsersBySession(toolSessionId).stream().collect( + Collectors.mapping(whiteboardUser -> whiteboardUser.getUserId().intValue(), Collectors.toSet())); + + Whiteboard whiteboard = session.getWhiteboard(); + ObjectNode jsonCommand = JsonNodeFactory.instance.objectNode(); + jsonCommand.put("hookTrigger", "whiteboard-refresh-" + whiteboard.getContentId()); + learnerService.createCommandForLearners(whiteboard.getContentId(), userIds, jsonCommand.toString()); + } + + @Override + public LocalDateTime launchTimeLimit(long toolContentId, int userId) { + WhiteboardUser user = getUserByIDAndContent(Long.valueOf(userId), toolContentId); + if (user != null) { + LocalDateTime launchedDate = LocalDateTime.now(); + user.setTimeLimitLaunchedDate(launchedDate); + whiteboardUserDao.update(user); + return launchedDate; + } + return null; + } + + @Override + public boolean checkTimeLimitExceeded(Whiteboard whiteboard, int userId) { + Long secondsLeft = LearningWebsocketServer.getSecondsLeft(whiteboard.getContentId(), userId); + return secondsLeft != null && secondsLeft.equals(0L); + } + + @Override + public List getPossibleIndividualTimeLimitUsers(long toolContentId, String searchString) { + Lesson lesson = lessonService.getLessonByToolContentId(toolContentId); + return lessonService.getLessonLearners(lesson.getLessonId(), searchString, null, null, true); + } + + @Override + public WhiteboardUser getUserByIDAndContent(Long userId, Long contentId) { + return whiteboardUserDao.getUserByUserIDAndContentID(userId, contentId); + } + + @Override + public WhiteboardUser getUserByLoginAndContent(String login, long contentId) { + List user = whiteboardUserDao.findByProperty(User.class, "login", login); + return user.isEmpty() ? null : getUserByIDAndContent(user.get(0).getUserId().longValue(), contentId); + } + + @Override + public WhiteboardUser getUserByIDAndSession(Long userId, Long sessionId) { + return whiteboardUserDao.getUserByUserIDAndSessionID(userId, sessionId); + } + + @Override + public List getUsersBySession(Long toolSessionId) { + return whiteboardUserDao.getBySessionID(toolSessionId); + } + + @Override + public void saveOrUpdate(Object entity) { + whiteboardDao.insertOrUpdate(entity); + } + + @Override + public Whiteboard getWhiteboardBySessionId(Long sessionId) { + WhiteboardSession session = whiteboardSessionDao.getSessionBySessionId(sessionId); + // to skip CGLib problem + Long contentId = session.getWhiteboard().getContentId(); + Whiteboard res = whiteboardDao.getByContentId(contentId); + return res; + } + + @Override + public WhiteboardSession getWhiteboardSessionBySessionId(Long sessionId) { + return whiteboardSessionDao.getSessionBySessionId(sessionId); + } + + @Override + public String finishToolSession(Long toolSessionId, Long userId) throws WhiteboardApplicationException { + WhiteboardUser user = whiteboardUserDao.getUserByUserIDAndSessionID(userId, toolSessionId); + user.setSessionFinished(true); + whiteboardUserDao.update(user); + + String nextUrl = null; + try { + nextUrl = this.leaveToolSession(toolSessionId, userId); + } catch (DataMissingException e) { + throw new WhiteboardApplicationException(e); + } catch (ToolException e) { + throw new WhiteboardApplicationException(e); + } + return nextUrl; + } + + @Override + public List getReflectList(Long contentId) { + List reflections = new LinkedList<>(); + + List sessionList = whiteboardSessionDao.getByContentId(contentId); + for (WhiteboardSession session : sessionList) { + Long sessionId = session.getSessionId(); + // get all users in this session + List users = whiteboardUserDao.getBySessionID(sessionId); + for (WhiteboardUser user : users) { + + NotebookEntry entry = getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + WhiteboardConstants.TOOL_SIGNATURE, user.getUserId().intValue()); + if (entry != null) { + ReflectDTO ref = new ReflectDTO(user); + ref.setReflect(entry.getEntry()); + Date postedDate = (entry.getLastModified() != null) ? entry.getLastModified() + : entry.getCreateDate(); + ref.setDate(postedDate); + reflections.add(ref); + } + + } + + } + + return reflections; + } + + @Override + public Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId, + String entryText) { + return coreNotebookService.createNotebookEntry(sessionId, notebookToolType, toolSignature, userId, "", + entryText); + } + + @Override + 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); + } + } + + @Override + public void updateEntry(NotebookEntry notebookEntry) { + coreNotebookService.updateEntry(notebookEntry); + } + + @Override + public WhiteboardUser getUser(Long uid) { + return whiteboardUserDao.find(WhiteboardUser.class, uid); + } + + @Override + public Grouping getGrouping(long toolContentId) { + ToolActivity toolActivity = (ToolActivity) userManagementService + .findByProperty(ToolActivity.class, "toolContentId", toolContentId).get(0); + return toolActivity.getApplyGrouping() ? toolActivity.getGrouping() : null; + } + + private List createGalleryWalkRatingCriterion(long toolContentId) { + List criteria = ratingService.getCriteriasByToolContentId(toolContentId); + + if (criteria.size() >= 2) { + criteria = ratingService.getCriteriasByToolContentId(toolContentId); + // Whiteboard currently supports only one place for ratings. + // It is rating other groups' boards on results page. + // Criterion gets automatically created and there must be only one. + try { + for (int criterionIndex = 1; criterionIndex < criteria.size(); criterionIndex++) { + RatingCriteria criterion = criteria.get(criterionIndex); + Long criterionId = criterion.getRatingCriteriaId(); + whiteboardDao.delete(criterion); + log.warn("Removed a duplicate criterion ID " + criterionId + " for Whiteboard tool content ID " + + toolContentId); + } + } catch (Exception e) { + log.warn("Ignoring error while deleting a duplicate criterion for Whiteboard tool content ID " + + toolContentId + ": " + e.getMessage()); + } + return criteria; + } + + if (criteria.isEmpty()) { + ToolActivityRatingCriteria criterion = (ToolActivityRatingCriteria) RatingCriteria + .getRatingCriteriaInstance(RatingCriteria.TOOL_ACTIVITY_CRITERIA_TYPE); + criterion.setTitle(messageService.getMessage("label.pad.rating.title")); + criterion.setOrderId(1); + criterion.setRatingStyle(RatingCriteria.RATING_STYLE_STAR); + criterion.setToolContentId(toolContentId); + + whiteboardDao.insert(criterion); + criteria.add(criterion); + } + return criteria; + } + + @Override + public void startGalleryWalk(long toolContentId) throws IOException { + Whiteboard whiteboard = getWhiteboardByContentId(toolContentId); + if (!whiteboard.isGalleryWalkEnabled()) { + throw new IllegalArgumentException( + "Can not start Gallery Walk as it is not enabled for Whiteboard with tool content ID " + + toolContentId); + } + if (whiteboard.isGalleryWalkFinished()) { + throw new IllegalArgumentException( + "Can not start Gallery Walk as it is already finished for Whiteboard with tool content ID " + + toolContentId); + } + whiteboard.setGalleryWalkStarted(true); + whiteboardDao.update(whiteboard); + + sendGalleryWalkRefreshRequest(whiteboard); + } + + @Override + public void finishGalleryWalk(long toolContentId) throws IOException { + Whiteboard whiteboard = getWhiteboardByContentId(toolContentId); + if (!whiteboard.isGalleryWalkEnabled()) { + throw new IllegalArgumentException( + "Can not finish Gallery Walk as it is not enabled for Whiteboard with tool content ID " + + toolContentId); + } + whiteboard.setGalleryWalkFinished(true); + whiteboardDao.update(whiteboard); + + sendGalleryWalkRefreshRequest(whiteboard); + } + + private void sendGalleryWalkRefreshRequest(Whiteboard whiteboard) { + ObjectNode jsonCommand = JsonNodeFactory.instance.objectNode(); + jsonCommand.put("hookTrigger", "whiteboard-refresh-" + whiteboard.getContentId()); + // get all learners in this whitebaord + Set userIds = whiteboardSessionDao.getByContentId(whiteboard.getContentId()).stream() + .flatMap(session -> whiteboardUserDao.getBySessionID(session.getSessionId()).stream()) + .collect(Collectors.mapping(user -> user.getUserId().intValue(), Collectors.toSet())); + + learnerService.createCommandForLearners(whiteboard.getContentId(), userIds, jsonCommand.toString()); + } + + // ***************************************************************************** + // private methods + // ***************************************************************************** + private Whiteboard getDefaultWhiteboard() throws WhiteboardApplicationException { + Long defaultWhiteboardId = getToolDefaultContentIdBySignature(WhiteboardConstants.TOOL_SIGNATURE); + Whiteboard defaultWhiteboard = getWhiteboardByContentId(defaultWhiteboardId); + if (defaultWhiteboard == null) { + String error = messageService.getMessage("error.msg.default.content.not.find"); + WhiteboardService.log.error(error); + throw new WhiteboardApplicationException(error); + } + + return defaultWhiteboard; + } + + private Long getToolDefaultContentIdBySignature(String toolSignature) throws WhiteboardApplicationException { + return toolService.getToolDefaultContentIdBySignature(toolSignature); + } + + @Override + public boolean isGroupedActivity(long toolContentID) { + return toolService.isGroupedActivity(toolContentID); + } + + @Override + public void auditLogStartEditingActivityInMonitor(long toolContentID) { + toolService.auditLogStartEditingActivityInMonitor(toolContentID); + } + + @Override + public boolean isLastActivity(Long toolSessionId) { + return toolService.isLastActivity(toolSessionId); + } + + // ******************************************************************************* + // ToolContentManager, ToolSessionManager methods + // ******************************************************************************* + + @Override + public void exportToolContent(Long toolContentId, String rootPath) throws DataMissingException, ToolException { + Whiteboard toolContentObj = whiteboardDao.getByContentId(toolContentId); + if (toolContentObj == null) { + try { + toolContentObj = getDefaultWhiteboard(); + } catch (WhiteboardApplicationException e) { + throw new DataMissingException(e.getMessage()); + } + } + if (toolContentObj == null) { + throw new DataMissingException("Unable to find default content for the Whiteboard tool"); + } + + // set tool content handler as null to avoid copy file node in repository again. + toolContentObj = Whiteboard.newInstance(toolContentObj, toolContentId); + try { + exportContentService.exportToolContent(toolContentId, toolContentObj, whiteboardToolContentHandler, + rootPath); + } catch (ExportToolContentException e) { + throw new ToolException(e); + } + } + + @Override + public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, + String toVersion) throws ToolException { + + try { + + Object toolPOJO = exportContentService.importToolContent(toolContentPath, whiteboardToolContentHandler, + fromVersion, toVersion); + if (!(toolPOJO instanceof Whiteboard)) { + throw new ImportToolContentException( + "Import Whiteboard tool content failed. Deserialized object is " + toolPOJO); + } + Whiteboard toolContentObj = (Whiteboard) toolPOJO; + + // reset it to new toolContentId + toolContentObj.setContentId(toolContentId); + WhiteboardUser user = whiteboardUserDao.getUserByUserIDAndContentID(newUserUid.longValue(), toolContentId); + if (user == null) { + user = new WhiteboardUser(); + UserDTO sysUser = ((User) userManagementService.findById(User.class, newUserUid)).getUserDTO(); + user.setFirstName(sysUser.getFirstName()); + user.setLastName(sysUser.getLastName()); + user.setLoginName(sysUser.getLogin()); + user.setUserId(newUserUid.longValue()); + } + toolContentObj.setCreatedBy(user); + + whiteboardDao.insertOrUpdate(toolContentObj); + } catch (ImportToolContentException e) { + throw new ToolException(e); + } + } + + @Override + public SortedMap getToolOutputDefinitions(Long toolContentId, int definitionType) + throws ToolException { + Whiteboard content = getWhiteboardByContentId(toolContentId); + if (content == null) { + try { + content = getDefaultContent(toolContentId); + } catch (WhiteboardApplicationException e) { + throw new ToolException(e); + } + } + return getWhiteboardOutputFactory().getToolOutputDefinitions(content, definitionType); + } + + @Override + public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { + if (toContentId == null) { + throw new ToolException("Failed to create the Whiteboard tool seession"); + } + + Whiteboard whiteboard = null; + if (fromContentId != null) { + whiteboard = whiteboardDao.getByContentId(fromContentId); + } + if (whiteboard == null) { + try { + whiteboard = getDefaultWhiteboard(); + } catch (WhiteboardApplicationException e) { + throw new ToolException(e); + } + } + + Whiteboard toContent = Whiteboard.newInstance(whiteboard, toContentId); + whiteboardDao.insert(toContent); + + if (toContent.isGalleryWalkEnabled() && !toContent.isGalleryWalkReadOnly()) { + createGalleryWalkRatingCriterion(toContentId); + } + } + + @Override + public String getToolContentTitle(Long toolContentId) { + return getWhiteboardByContentId(toolContentId).getTitle(); + } + + @Override + public void resetDefineLater(Long toolContentId) throws DataMissingException, ToolException { + Whiteboard whiteboard = whiteboardDao.getByContentId(toolContentId); + if (whiteboard == null) { + throw new ToolException("No found tool content by given content ID:" + toolContentId); + } + whiteboard.setDefineLater(false); + } + + @Override + public boolean isContentEdited(Long toolContentId) { + return getWhiteboardByContentId(toolContentId).isDefineLater(); + } + + @Override + public boolean isReadOnly(Long toolContentId) { + List sessions = whiteboardSessionDao.getByContentId(toolContentId); + for (WhiteboardSession session : sessions) { + if (!whiteboardUserDao.getBySessionID(session.getSessionId()).isEmpty()) { + return true; + } + } + + return false; + } + + @Override + public void removeToolContent(Long toolContentId) throws ToolException { + Whiteboard whiteboard = whiteboardDao.getByContentId(toolContentId); + if (whiteboard == null) { + WhiteboardService.log.warn("Can not remove the tool content as it does not exist, ID: " + toolContentId); + return; + } + + for (WhiteboardSession session : whiteboardSessionDao.getByContentId(toolContentId)) { + List entries = coreNotebookService.getEntry(session.getSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, WhiteboardConstants.TOOL_SIGNATURE); + for (NotebookEntry entry : entries) { + coreNotebookService.deleteEntry(entry); + } + } + whiteboardDao.delete(whiteboard); + } + + @Override + @SuppressWarnings("unchecked") + public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + if (WhiteboardService.log.isDebugEnabled()) { + WhiteboardService.log + .debug("Removing Whiteboard content for user ID " + userId + " and toolContentId " + toolContentId); + } + + Whiteboard whiteboard = whiteboardDao.getByContentId(toolContentId); + if (whiteboard == null) { + WhiteboardService.log + .warn("Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); + return; + } + + List sessions = whiteboardSessionDao.getByContentId(toolContentId); + for (WhiteboardSession session : sessions) { + WhiteboardUser user = whiteboardUserDao.getUserByUserIDAndSessionID(userId.longValue(), + session.getSessionId()); + if (user != null) { + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + WhiteboardConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + whiteboardDao.deleteById(NotebookEntry.class, entry.getUid()); + } + + whiteboardUserDao.deleteById(WhiteboardUser.class, user.getUid()); + } + } + } + + @Override + public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException { + WhiteboardSession session = new WhiteboardSession(); + session.setSessionId(toolSessionId); + session.setSessionName(toolSessionName); + Whiteboard whiteboard = whiteboardDao.getByContentId(toolContentId); + session.setWhiteboard(whiteboard); + whiteboardSessionDao.insert(session); + + //create pad in a try-catch block so it doesn't affect session creation operation +// try { +// createPad(whiteboard, session); +// } catch (Exception e) { +// log.warn(e.getMessage(), e); +// } + + } + + @Override + public ToolCompletionStatus getCompletionStatus(Long learnerId, Long toolSessionId) { + WhiteboardUser learner = getUserByIDAndSession(learnerId, toolSessionId); + if (learner == null) { + return new ToolCompletionStatus(ToolCompletionStatus.ACTIVITY_NOT_ATTEMPTED, null, null); + } + + return new ToolCompletionStatus(learner.isSessionFinished() ? ToolCompletionStatus.ACTIVITY_COMPLETED + : ToolCompletionStatus.ACTIVITY_ATTEMPTED, null, null); + } + + @Override + public String leaveToolSession(Long toolSessionId, Long learnerId) throws DataMissingException, ToolException { + if (toolSessionId == null) { + WhiteboardService.log.error("Fail to leave tool session based on null tool session id."); + throw new ToolException("Fail to remove tool s ession based on null tool session id."); + } + if (learnerId == null) { + WhiteboardService.log.error("Fail to leave tool Session based on null learner."); + throw new ToolException("Fail to remove tool Session based on null learner."); + } + + WhiteboardSession session = whiteboardSessionDao.getSessionBySessionId(toolSessionId); + if (session != null) { + session.setStatus(WhiteboardConstants.COMPLETED); + whiteboardSessionDao.update(session); + } else { + WhiteboardService.log + .error("Fail to leave tool Session. Could not find Whiteboard session by given session id: " + + toolSessionId); + throw new DataMissingException( + "Fail to leave tool Session. Could not find Whiteboard session by given session id: " + + toolSessionId); + } + return toolService.completeToolSession(toolSessionId, learnerId); + } + + @Override + public ToolSessionExportOutputData exportToolSession(Long toolSessionId) + throws DataMissingException, ToolException { + return null; + } + + @Override + public ToolSessionExportOutputData exportToolSession(List toolSessionIds) + throws DataMissingException, ToolException { + return null; + } + + @Override + public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException { + whiteboardSessionDao.deleteBySessionId(toolSessionId); + } + + @Override + public SortedMap getToolOutput(List names, Long toolSessionId, Long learnerId) { + return getWhiteboardOutputFactory().getToolOutput(names, this, toolSessionId, learnerId); + } + + @Override + public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) { + return getWhiteboardOutputFactory().getToolOutput(name, this, toolSessionId, learnerId); + } + + @Override + public List getToolOutputs(String name, Long toolContentId) { + return new ArrayList<>(); + } + + @Override + public List getConfidenceLevels(Long toolSessionId) { + return null; + } + + @Override + public boolean isUserGroupLeader(Long userId, Long toolSessionId) { + WhiteboardSession session = getWhiteboardSessionBySessionId(toolSessionId); + WhiteboardUser groupLeader = session == null ? null : session.getGroupLeader(); + + return (groupLeader != null) && userId.equals(groupLeader.getUserId()); + } + + @Override + public void forceCompleteUser(Long toolSessionId, User user) { + // no actions required + } + + @Override + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getWhiteboardOutputFactory().getSupportedDefinitionClasses(definitionType); + } + + // ***************************************************************************** + // set methods for Spring Bean + // ***************************************************************************** + public void setMessageService(MessageService messageService) { + this.messageService = messageService; + } + + public void setWhiteboardDao(WhiteboardDAO whiteboardDao) { + this.whiteboardDao = whiteboardDao; + } + + public void setWhiteboardSessionDao(WhiteboardSessionDAO whiteboardSessionDao) { + this.whiteboardSessionDao = whiteboardSessionDao; + } + + public void setWhiteboardToolContentHandler(IToolContentHandler whiteboardToolContentHandler) { + this.whiteboardToolContentHandler = whiteboardToolContentHandler; + } + + public void setWhiteboardUserDao(WhiteboardUserDAO whiteboardUserDao) { + this.whiteboardUserDao = whiteboardUserDao; + } + + public void setToolService(ILamsToolService toolService) { + this.toolService = toolService; + } + + public void setExportContentService(IExportToolContentService exportContentService) { + this.exportContentService = exportContentService; + } + + public void setUserManagementService(IUserManagementService userManagementService) { + this.userManagementService = userManagementService; + } + + public void setLearnerService(ILearnerService learnerService) { + this.learnerService = learnerService; + } + + public void setLessonService(ILessonService lessonService) { + this.lessonService = lessonService; + } + + public void setRatingService(IRatingService ratingService) { + this.ratingService = ratingService; + } + + public void setCoreNotebookService(ICoreNotebookService coreNotebookService) { + this.coreNotebookService = coreNotebookService; + } + + public WhiteboardOutputFactory getWhiteboardOutputFactory() { + return whiteboardOutputFactory; + } + + public void setWhiteboardOutputFactory(WhiteboardOutputFactory whiteboardOutputFactory) { + this.whiteboardOutputFactory = whiteboardOutputFactory; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/util/ReflectDTOComparator.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/util/ReflectDTOComparator.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/util/ReflectDTOComparator.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,40 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ +package org.lamsfoundation.lams.tool.whiteboard.util; + +import java.util.Comparator; + +import org.lamsfoundation.lams.tool.whiteboard.dto.ReflectDTO; + +public class ReflectDTOComparator implements Comparator { + @Override + 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; + } + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/AuthoringController.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/AuthoringController.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/AuthoringController.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,216 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.web.controller; + +import java.sql.Timestamp; +import java.util.Date; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import org.apache.commons.beanutils.PropertyUtils; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.whiteboard.WhiteboardConstants; +import org.lamsfoundation.lams.tool.whiteboard.model.Whiteboard; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardUser; +import org.lamsfoundation.lams.tool.whiteboard.service.IWhiteboardService; +import org.lamsfoundation.lams.tool.whiteboard.web.form.WhiteboardForm; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.CommonConstants; +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.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@Controller +@RequestMapping("/authoring") +public class AuthoringController { + + private static Logger log = Logger.getLogger(AuthoringController.class); + + @Autowired + private IWhiteboardService whiteboardService; + + /** + * Read whiteboard data from database and put them into HttpSession. It will + * redirect to init.do directly after this method run successfully. + * + * This method will avoid read database again and lost un-saved resouce item + * lost when user "refresh page", + * + */ + @RequestMapping("/start") + private String start(@ModelAttribute("authoringForm") WhiteboardForm authoringForm, HttpServletRequest request) + throws ServletException { + ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); + request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); + return starting(authoringForm, request); + } + + @RequestMapping(path = "/definelater", method = RequestMethod.POST) + private String definelater(@ModelAttribute("authoringForm") WhiteboardForm authoringForm, + HttpServletRequest request) throws ServletException { + Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + Whiteboard whiteboard = whiteboardService.getWhiteboardByContentId(contentId); + + whiteboard.setDefineLater(true); + whiteboardService.saveOrUpdate(whiteboard); + + //audit log the teacher has started editing activity in monitor + whiteboardService.auditLogStartEditingActivityInMonitor(contentId); + + request.setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.TEACHER.toString()); + return starting(authoringForm, request); + } + + private String starting(@ModelAttribute("authoringForm") WhiteboardForm authoringForm, HttpServletRequest request) + throws ServletException { + + // save toolContentID into HTTPSession + Long contentId = WebUtil.readLongParam(request, WhiteboardConstants.PARAM_TOOL_CONTENT_ID); + + Whiteboard whiteboard = null; + + // get contentFolderID and save to form. + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + authoringForm.setContentFolderID(contentFolderID); + + // initial Session Map + SessionMap sessionMap = new SessionMap<>(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + authoringForm.setSessionMapID(sessionMap.getSessionID()); + + try { + whiteboard = whiteboardService.getWhiteboardByContentId(contentId); + // if Whiteboard does not exist, try to use default content instead. + if (whiteboard == null) { + whiteboard = whiteboardService.getDefaultContent(contentId); + } + + authoringForm.setWhiteboard(whiteboard); + } catch (Exception e) { + AuthoringController.log.error(e); + throw new ServletException(e); + } + + sessionMap.put(WhiteboardConstants.ATTR_RESOURCE_FORM, authoringForm); + request.getSession().setAttribute(AttributeNames.PARAM_NOTIFY_CLOSE_URL, + request.getParameter(AttributeNames.PARAM_NOTIFY_CLOSE_URL)); + return "pages/authoring/start"; + } + + /** + * Display same entire authoring page content from HttpSession variable. + */ + + @RequestMapping("/init") + private String initPage(@ModelAttribute("authoringForm") WhiteboardForm authoringForm, HttpServletRequest request) + throws ServletException { + String sessionMapID = WebUtil.readStrParam(request, WhiteboardConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession() + .getAttribute(sessionMapID); + WhiteboardForm existForm = (WhiteboardForm) sessionMap.get(WhiteboardConstants.ATTR_RESOURCE_FORM); + + try { + PropertyUtils.copyProperties(authoringForm, existForm); + } catch (Exception e) { + throw new ServletException(e); + } + + ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); + request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); + authoringForm.setMode(mode.toString()); + + return "pages/authoring/authoring"; + } + + /** + * This method will persist all information in this authoring page + */ + @RequestMapping(path = "/update", method = RequestMethod.POST) + private String updateContent(@ModelAttribute("authoringForm") WhiteboardForm authoringForm, + HttpServletRequest request) throws Exception { + SessionMap sessionMap = (SessionMap) request.getSession() + .getAttribute(authoringForm.getSessionMapID()); + ToolAccessMode mode = WebUtil.readToolAccessModeAuthorDefaulted(request); + Whiteboard whiteboard = authoringForm.getWhiteboard(); + + // **********************************Get Whiteboard PO********************* + Whiteboard whiteboardPO = whiteboardService.getWhiteboardByContentId(whiteboard.getContentId()); + if (whiteboardPO == null) { + // new Whiteboard, create it + whiteboardPO = whiteboard; + whiteboardPO.setCreated(new Timestamp(new Date().getTime())); + whiteboardPO.setUpdated(new Timestamp(new Date().getTime())); + } else { + Long uid = whiteboardPO.getUid(); + PropertyUtils.copyProperties(whiteboardPO, whiteboard); + + // copyProperties() above may result in "collection assigned to two objects in a session" exception + // Below we remove reference to one of Assessment objects, + // so maybe there will be just one object in session when save is done + // If this fails, we may have to evict the object from session using DAO + authoringForm.setWhiteboard(null); + whiteboard = null; + // get back UID + whiteboardPO.setUid(uid); + + // if it's a teacher - change define later status + if (mode.isTeacher()) { + whiteboardPO.setDefineLater(false); + } + whiteboardPO.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); + WhiteboardUser whiteboardUser = whiteboardService.getUserByIDAndContent(user.getUserID().longValue(), + whiteboardPO.getContentId()); + if (whiteboardUser == null) { + whiteboardUser = new WhiteboardUser(user, whiteboardPO); + } + + whiteboardPO.setCreatedBy(whiteboardUser); + + // ***************************** finally persist whiteboardPO again + whiteboardService.saveOrUpdate(whiteboardPO); + + authoringForm.setWhiteboard(whiteboardPO); + + request.setAttribute(CommonConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); + request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); + + return "pages/authoring/authoring"; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/ClearSessionController.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/ClearSessionController.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/ClearSessionController.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.web.controller; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.web.controller.LamsAuthoringFinishController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.context.WebApplicationContext; + +/** + * This class give a chance to clear HttpSession when user save/close authoring page. + */ +@Controller +public class ClearSessionController extends LamsAuthoringFinishController { + + @Autowired + private WebApplicationContext applicationContext; + + @RequestMapping("/clearsession") + public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException { + super.execute(request, response, applicationContext); + } + + @Override + public void clearSession(String customiseSessionID, HttpSession session, ToolAccessMode mode) { + if (mode.isAuthor()) { + session.removeAttribute(customiseSessionID); + } + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/LearningController.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/LearningController.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/LearningController.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,355 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.web.controller; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Set; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.log4j.Logger; +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.whiteboard.WhiteboardConstants; +import org.lamsfoundation.lams.tool.whiteboard.model.Whiteboard; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardSession; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardUser; +import org.lamsfoundation.lams.tool.whiteboard.service.IWhiteboardService; +import org.lamsfoundation.lams.tool.whiteboard.service.WhiteboardApplicationException; +import org.lamsfoundation.lams.tool.whiteboard.web.form.ReflectionForm; +import org.lamsfoundation.lams.usermanagement.User; +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.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; + +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +@Controller +@RequestMapping("/learning") +public class LearningController { + + private static Logger log = Logger.getLogger(LearningController.class); + + @Autowired + private IWhiteboardService whiteboardService; + + /** + * Read Whiteboard data from database and put them into HttpSession. It will redirect to init.do directly after this + * method run successfully. + * + * This method will avoid read database again and lost un-saved resouce item lost when user "refresh page", + * + */ + @RequestMapping("/start") + private String start(HttpServletRequest request, HttpServletResponse response) + throws WhiteboardApplicationException { + + // initial Session Map + SessionMap sessionMap = new SessionMap<>(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + request.setAttribute(WhiteboardConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + + Long toolSessionId = WebUtil.readLongParam(request, WhiteboardConstants.PARAM_TOOL_SESSION_ID); + Whiteboard whiteboard = whiteboardService.getWhiteboardBySessionId(toolSessionId); + WhiteboardSession session = whiteboardService.getWhiteboardSessionBySessionId(toolSessionId); + sessionMap.put(WhiteboardConstants.ATTR_TOOL_CONTENT_ID, whiteboard.getContentId()); + + // get back the whiteboard and item list and display them on page + WhiteboardUser user = null; + ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, true); + // get back login user DTO + HttpSession ss = SessionManager.getSession(); + UserDTO currentUserDto = null; + if ((mode != null) && mode.isTeacher()) { + // monitoring mode - user is specified in URL + // whiteboardUser may be null if the user was force completed. + user = getSpecifiedUser(toolSessionId, WebUtil.readIntParam(request, AttributeNames.PARAM_USER_ID, false)); + } else { + currentUserDto = (UserDTO) ss.getAttribute(AttributeNames.USER); + user = whiteboardService.getUserByIDAndSession(currentUserDto.getUserID().longValue(), toolSessionId); + if (user == null) { + user = new WhiteboardUser(currentUserDto, session); + whiteboardService.saveOrUpdate(user); + } + } + + // support for leader select feature + WhiteboardUser leader = whiteboard.isUseSelectLeaderToolOuput() + ? whiteboardService.checkLeaderSelectToolForSessionLeader(user, toolSessionId) + : null; + // forwards to the leaderSelection page + if (whiteboard.isUseSelectLeaderToolOuput() && leader == null && !mode.isTeacher()) { + // get group users and store it to request as DTO objects + List groupUsers = whiteboardService.getUsersBySession(toolSessionId); + List groupUserDtos = new ArrayList<>(); + for (WhiteboardUser groupUser : groupUsers) { + User groupUserDto = new User(); + groupUserDto.setUserId(groupUser.getUserId().intValue()); + groupUserDto.setFirstName(groupUser.getFirstName()); + groupUserDto.setLastName(groupUser.getLastName()); + groupUserDtos.add(groupUserDto); + } + request.setAttribute(WhiteboardConstants.ATTR_GROUP_USERS, groupUserDtos); + request.setAttribute(WhiteboardConstants.ATTR_WHITEBOARD, whiteboard); + return "pages/learning/waitforleader"; + } + + boolean isUserLeader = user != null && leader != null && user.getUid().equals(leader.getUid()); + boolean hasEditRight = !whiteboard.isUseSelectLeaderToolOuput() + || whiteboard.isUseSelectLeaderToolOuput() && isUserLeader; + sessionMap.put(WhiteboardConstants.ATTR_HAS_EDIT_RIGHT, hasEditRight); + sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionId); + sessionMap.put(WhiteboardConstants.ATTR_REFLECTION_ON, whiteboard.isReflectOnActivity()); + sessionMap.put(AttributeNames.ATTR_IS_LAST_ACTIVITY, whiteboardService.isLastActivity(toolSessionId)); + sessionMap.put(WhiteboardConstants.ATTR_WHITEBOARD, whiteboard); + sessionMap.put(AttributeNames.ATTR_MODE, mode); + + // reflection information + String entryText = new String(); + if (user != null) { + NotebookEntry notebookEntry = whiteboardService.getEntry(toolSessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + WhiteboardConstants.TOOL_SIGNATURE, user.getUserId().intValue()); + if (notebookEntry != null) { + entryText = notebookEntry.getEntry(); + } + } + sessionMap.put(WhiteboardConstants.ATTR_REFLECTION_INSTRUCTION, whiteboard.getReflectInstructions()); + sessionMap.put(WhiteboardConstants.ATTR_REFLECTION_ENTRY, entryText); + + if (whiteboard.isGalleryWalkEnabled() && mode != null && mode.isAuthor()) { + String[] galleryWalkParameterValuesArray = request.getParameterValues("galleryWalk"); + if (galleryWalkParameterValuesArray != null) { + Collection galleryWalkParameterValues = Set.of(galleryWalkParameterValuesArray); + + if (!whiteboard.isGalleryWalkStarted() && galleryWalkParameterValues.contains("forceStart")) { + whiteboard.setGalleryWalkStarted(true); + whiteboardService.saveOrUpdate(whiteboard); + } + + if (!whiteboard.isGalleryWalkFinished() && galleryWalkParameterValues.contains("forceFinish")) { + whiteboard.setGalleryWalkFinished(true); + whiteboardService.saveOrUpdate(whiteboard); + } + } + } + + if (whiteboard.isGalleryWalkStarted()) { +// List groupList = null; +// try { +// groupList = whiteboardService.getSummary(whiteboard.getContentId(), user.getUserId()); +// } catch (HibernateOptimisticLockingFailureException e) { +// log.warn("Ignoring error caused probably by creating Gallery Walk criteria", e); +// // simply run the transaction again +// groupList = whiteboardService.getSummary(whiteboard.getContentId(), user.getUserId()); +// } +// request.setAttribute(WhiteboardConstants.ATTR_SUMMARY_LIST, groupList); +// +// if (currentUserDto == null) { +// currentUserDto = (UserDTO) ss.getAttribute(AttributeNames.USER); +// } +// Cookie cookie = whiteboardService.createEtherpadCookieForMonitor(currentUserDto, whiteboard.getContentId()); +// response.addCookie(cookie); + return "pages/learning/galleryWalk"; + } + + // check whether finish lock is on/off + boolean finishedLock = whiteboard.getLockWhenFinished() && (user != null) && user.isSessionFinished(); + sessionMap.put(WhiteboardConstants.ATTR_TITLE, whiteboard.getTitle()); + sessionMap.put(WhiteboardConstants.ATTR_INSTRUCTIONS, whiteboard.getInstructions()); + sessionMap.put(WhiteboardConstants.ATTR_FINISH_LOCK, finishedLock); + sessionMap.put(WhiteboardConstants.ATTR_LOCK_ON_FINISH, whiteboard.getLockWhenFinished()); + sessionMap.put(WhiteboardConstants.ATTR_USER_FINISHED, (user != null) && user.isSessionFinished()); + + // add define later support + if (whiteboard.isDefineLater()) { + return "pages/learning/definelater"; + } + + // set contentInUse flag to true! + whiteboard.setContentInUse(true); + whiteboard.setDefineLater(false); + whiteboardService.saveOrUpdate(whiteboard); + + //time limit + boolean isTimeLimitExceeded = whiteboardService.checkTimeLimitExceeded(whiteboard, user.getUserId().intValue()); + request.setAttribute("timeLimitExceeded", isTimeLimitExceeded); + + return "pages/learning/learning"; + } + + /** + * Checks Leader Progress + */ + @RequestMapping("/checkLeaderProgress") + private String checkLeaderProgress(HttpServletRequest request, HttpServletResponse response) throws IOException { + + Long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + + // boolean isLeaderResponseFinalized = whiteboardService.isLeaderResponseFinalized(toolSessionId); + + ObjectNode responseJSON = JsonNodeFactory.instance.objectNode(); + // responseJSON.put(WhiteboardConstants.ATTR_IS_LEADER_RESPONSE_FINALIZED, isLeaderResponseFinalized); + response.setContentType("application/json;charset=utf-8"); + response.getWriter().print(responseJSON); + return responseJSON.toString(); + } + + /** + * Finish learning session. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + @RequestMapping("/finish") + private String finish(HttpServletRequest request) { + + // get back SessionMap + String sessionMapID = request.getParameter(WhiteboardConstants.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); + + // 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 = whiteboardService.finishToolSession(sessionId, userID); + request.setAttribute(WhiteboardConstants.ATTR_NEXT_ACTIVITY_URL, nextActivityUrl); + } catch (WhiteboardApplicationException e) { + LearningController.log.error("Failed get next activity url:" + e.getMessage()); + } + + return "pages/learning/finish"; + } + + /** + * Display empty reflection form. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + @SuppressWarnings("unchecked") + @RequestMapping("/newReflection") + private String newReflection(@ModelAttribute("reflectionForm") ReflectionForm reflectionForm, + HttpServletRequest request) { + + // get session value + String sessionMapID = WebUtil.readStrParam(request, WhiteboardConstants.ATTR_SESSION_MAP_ID); + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + + reflectionForm.setUserID(user.getUserID()); + reflectionForm.setSessionMapID(sessionMapID); + + // get the existing reflection entry + + SessionMap map = (SessionMap) request.getSession().getAttribute(sessionMapID); + Long toolSessionID = (Long) map.get(AttributeNames.PARAM_TOOL_SESSION_ID); + NotebookEntry entry = whiteboardService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + WhiteboardConstants.TOOL_SIGNATURE, user.getUserID()); + + if (entry != null) { + reflectionForm.setEntryText(entry.getEntry()); + } + + return "pages/learning/notebook"; + } + + /** + * Submit reflection form input database. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + @RequestMapping("/submitReflection") + private String submitReflection(@ModelAttribute("reflectionForm") ReflectionForm reflectionForm, + HttpServletRequest request) { + Integer userId = reflectionForm.getUserID(); + + String sessionMapID = WebUtil.readStrParam(request, WhiteboardConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession() + .getAttribute(sessionMapID); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + + // check for existing notebook entry + NotebookEntry entry = whiteboardService.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + WhiteboardConstants.TOOL_SIGNATURE, userId); + + if (entry == null) { + // create new entry + whiteboardService.createNotebookEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + WhiteboardConstants.TOOL_SIGNATURE, userId, reflectionForm.getEntryText()); + } else { + // update existing entry + entry.setEntry(reflectionForm.getEntryText()); + entry.setLastModified(new Date()); + whiteboardService.updateEntry(entry); + } + + return finish(request); + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + + private WhiteboardUser getSpecifiedUser(Long sessionId, Integer userId) { + WhiteboardUser whiteboardUser = whiteboardService.getUserByIDAndSession(userId.longValue(), sessionId); + if (whiteboardUser == null) { + LearningController.log.error( + "Unable to find specified user for Whiteboard activity. Screens are likely to fail. Session ID = " + + sessionId + ", user ID = " + userId); + } + return whiteboardUser; + } +} Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/LearningWebsocketServer.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/LearningWebsocketServer.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/LearningWebsocketServer.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,88 @@ +package org.lamsfoundation.lams.tool.whiteboard.web.controller; + +import java.time.LocalDateTime; +import java.util.Collection; + +import javax.websocket.server.ServerEndpoint; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.whiteboard.WhiteboardConstants; +import org.lamsfoundation.lams.tool.whiteboard.model.Whiteboard; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardUser; +import org.lamsfoundation.lams.tool.whiteboard.service.IWhiteboardService; +import org.lamsfoundation.lams.web.controller.AbstractTimeLimitWebsocketServer; +import org.lamsfoundation.lams.web.controller.AbstractTimeLimitWebsocketServer.EndpointConfigurator; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * Controls Whiteboard time limits + * + * @author Marcin Cieslak + */ +@ServerEndpoint(value = "/learningWebsocket", configurator = EndpointConfigurator.class) +public class LearningWebsocketServer extends AbstractTimeLimitWebsocketServer { + + private static final Logger log = Logger.getLogger(LearningWebsocketServer.class); + + private IWhiteboardService whiteboardService; + + public LearningWebsocketServer() { + if (whiteboardService == null) { + WebApplicationContext wac = WebApplicationContextUtils + .getRequiredWebApplicationContext(SessionManager.getServletContext()); + whiteboardService = (IWhiteboardService) wac.getBean(WhiteboardConstants.WHITEBOARD_SERVICE); + } + } + + @Override + protected Logger getLog() { + return LearningWebsocketServer.log; + } + + /** + * Gets settings from DB. + */ + @Override + protected TimeCache getExistingTimeSettings(long toolContentId, Collection userIds) { + Whiteboard whiteboard = whiteboardService.getWhiteboardByContentId(toolContentId); + TimeCache existingTimeSettings = new TimeCache(); + + existingTimeSettings.absoluteTimeLimit = whiteboard.getAbsoluteTimeLimit(); + existingTimeSettings.relativeTimeLimit = whiteboard.getRelativeTimeLimit() * 60; + existingTimeSettings.timeLimitAdjustment = whiteboard.getTimeLimitAdjustments(); + + for (Integer userId : userIds) { + WhiteboardUser user = whiteboardService.getUserByIDAndContent(userId.longValue(), toolContentId); + if (user != null && user.getTimeLimitLaunchedDate() != null) { + existingTimeSettings.timeLimitLaunchedDate.put(userId, user.getTimeLimitLaunchedDate()); + } + } + + return existingTimeSettings; + } + + @Override + protected LocalDateTime launchUserTimeLimit(long toolContentId, int userId) { + return whiteboardService.launchTimeLimit(toolContentId, userId); + } + + /** + * Fetches or creates a singleton of this websocket server. + */ + public static LearningWebsocketServer getInstance() { + LearningWebsocketServer result = (LearningWebsocketServer) AbstractTimeLimitWebsocketServer + .getInstance(LearningWebsocketServer.class.getName()); + if (result == null) { + result = new LearningWebsocketServer(); + AbstractTimeLimitWebsocketServer.registerInstance(result); + } + return result; + } + + public static Long getSecondsLeft(long toolContentId, int userId) { + LearningWebsocketServer instance = LearningWebsocketServer.getInstance(); + return AbstractTimeLimitWebsocketServer.getSecondsLeft(instance, toolContentId, userId, true); + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/MonitoringController.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/MonitoringController.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/controller/MonitoringController.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,443 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.web.controller; + +import java.io.IOException; +import java.security.InvalidParameterException; +import java.time.LocalDateTime; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.stream.Collectors; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.gradebook.GradebookUserActivity; +import org.lamsfoundation.lams.gradebook.service.IGradebookService; +import org.lamsfoundation.lams.learningdesign.Group; +import org.lamsfoundation.lams.learningdesign.Grouping; +import org.lamsfoundation.lams.security.ISecurityService; +import org.lamsfoundation.lams.tool.ToolSession; +import org.lamsfoundation.lams.tool.service.ILamsCoreToolService; +import org.lamsfoundation.lams.tool.whiteboard.WhiteboardConstants; +import org.lamsfoundation.lams.tool.whiteboard.model.Whiteboard; +import org.lamsfoundation.lams.tool.whiteboard.model.WhiteboardUser; +import org.lamsfoundation.lams.tool.whiteboard.service.IWhiteboardService; +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.Configuration; +import org.lamsfoundation.lams.util.ConfigurationKeys; +import org.lamsfoundation.lams.util.MessageService; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; + +@Controller +@RequestMapping("/monitoring") +public class MonitoringController { + + public static Logger log = Logger.getLogger(MonitoringController.class); + + public static final int LEARNER_MARKS_SORTING_FIRST_NAME_ASC = 0; + public static final int LEARNER_MARKS_SORTING_FIRST_NAME_DESC = 1; + public static final int LEARNER_MARKS_SORTING_LAST_NAME_ASC = 2; + public static final int LEARNER_MARKS_SORTING_LAST_NAME_DESC = 3; + + private static final Comparator USER_NAME_COMPARATOR = Comparator.comparing(User::getFirstName) + .thenComparing(User::getLastName).thenComparing(User::getLogin); + + @Autowired + private IWhiteboardService whiteboardService; + + @Autowired + private IUserManagementService userManagementService; + + @Autowired + private IGradebookService gradebookService; + + @Autowired + @Qualifier("lamsCoreToolService") + private ILamsCoreToolService toolService; + + @Autowired + private ISecurityService securityService; + + @Autowired + @Qualifier("whiteboardMessageService") + private MessageService messageService; + + /* + * @RequestMapping("/summary") + * private String summary(HttpServletRequest request, HttpServletResponse response) throws EtherpadException { + * // initial Session Map + * SessionMap sessionMap = new SessionMap<>(); + * request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + * request.setAttribute(WhiteboardConstants.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, true)); + * + * Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + * List groupList = whiteboardService.getSummary(contentId, null); + * boolean hasFaultySession = false; + * int attemptedLearnersNumber = 0; + * for (SessionDTO group : groupList) { + * hasFaultySession |= group.isSessionFaulty(); + * attemptedLearnersNumber += group.getNumberOfLearners(); + * } + * + * Whiteboard whiteboard = whiteboardService.getWhiteboardByContentId(contentId); + * + * // Create reflectList if reflection is enabled. + * if (whiteboard.isReflectOnActivity()) { + * List relectList = whiteboardService.getReflectList(contentId); + * sessionMap.put(WhiteboardConstants.ATTR_REFLECT_LIST, relectList); + * } + * + * // cache into sessionMap + * sessionMap.put(WhiteboardConstants.ATTR_SUMMARY_LIST, groupList); + * sessionMap.put(WhiteboardConstants.ATTR_HAS_FAULTY_SESSION, hasFaultySession); + * sessionMap.put(WhiteboardConstants.PAGE_EDITABLE, whiteboard.isContentInUse()); + * sessionMap.put(WhiteboardConstants.ATTR_WHITEBOARD, whiteboard); + * sessionMap.put(WhiteboardConstants.ATTR_TOOL_CONTENT_ID, contentId); + * sessionMap.put(WhiteboardConstants.ATTR_IS_GROUPED_ACTIVITY, whiteboardService.isGroupedActivity(contentId)); + * request.setAttribute("attemptedLearnersNumber", attemptedLearnersNumber); + * + * // get the API key from the config table and add it to the session + * String etherpadServerUrl = Configuration.get(ConfigurationKeys.ETHERPAD_SERVER_URL); + * String etherpadApiKey = Configuration.get(ConfigurationKeys.ETHERPAD_API_KEY); + * if (StringUtils.isBlank(etherpadServerUrl) || StringUtils.isBlank(etherpadApiKey)) { + * return "pages/learning/notconfigured"; + * } + * request.setAttribute(WhiteboardConstants.KEY_ETHERPAD_SERVER_URL, etherpadServerUrl); + * + * HttpSession ss = SessionManager.getSession(); + * // get back login user DTO + * UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + * + * //no need to store cookie if there are no sessions created yet + * if (!groupList.isEmpty()) { + * // add new sessionID cookie in order to access pad + * Cookie etherpadSessionCookie = whiteboardService.createEtherpadCookieForMonitor(user, contentId); + * response.addCookie(etherpadSessionCookie); + * } + * + * return "pages/monitoring/monitoring"; + * } + */ + + @RequestMapping("/getLearnerMarks") + @ResponseBody + private String getLearnerMarks(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + Long toolSessionId = WebUtil.readLongParam(request, "toolSessionId"); + + // paging parameters of tablesorter + int size = WebUtil.readIntParam(request, "size"); + int page = WebUtil.readIntParam(request, "page"); + Integer isSortFirstName = WebUtil.readIntParam(request, "column[0]", true); + Integer isSortLastName = WebUtil.readIntParam(request, "column[1]", true); + + // identify sorting type + int sorting = LEARNER_MARKS_SORTING_FIRST_NAME_ASC; + if (isSortFirstName != null) { + sorting = isSortFirstName.equals(1) ? LEARNER_MARKS_SORTING_FIRST_NAME_DESC + : LEARNER_MARKS_SORTING_FIRST_NAME_ASC; + } else if (isSortLastName != null) { + sorting = isSortLastName.equals(1) ? LEARNER_MARKS_SORTING_LAST_NAME_DESC + : LEARNER_MARKS_SORTING_LAST_NAME_ASC; + } + + // get all session users and sort them according to the parameter from tablesorter + List users = whiteboardService.getUsersBySession(toolSessionId).stream() + .sorted(Comparator.comparing(sorting <= 1 ? WhiteboardUser::getFirstName : WhiteboardUser::getLastName)) + .collect(Collectors.toList()); + + ObjectNode responsedata = JsonNodeFactory.instance.objectNode(); + if (!users.isEmpty()) { + // reverse if sorting is descending + if (sorting == LEARNER_MARKS_SORTING_FIRST_NAME_DESC || sorting == LEARNER_MARKS_SORTING_LAST_NAME_DESC) { + Collections.reverse(users); + } + + // paging + int endIndex = (page + 1) * size; + users = users.subList(page * size, users.size() > endIndex ? endIndex : users.size()); + + ArrayNode rows = JsonNodeFactory.instance.arrayNode(); + + responsedata.put("total_rows", users.size()); + + ToolSession toolSession = toolService.getToolSessionById(toolSessionId); + Map gradebookUserActivities = gradebookService + .getGradebookUserActivities(toolSession.getToolActivity().getActivityId()).stream() + .filter(g -> g.getMark() != null) + .collect(Collectors.toMap(g -> g.getLearner().getUserId(), GradebookUserActivity::getMark)); + + WhiteboardUser leader = users.get(0).getSession().getGroupLeader(); + for (WhiteboardUser user : users) { + ObjectNode responseRow = JsonNodeFactory.instance.objectNode(); + + responseRow.put("userId", user.getUserId()); + responseRow.put("firstName", user.getFirstName()); + responseRow.put("lastName", user.getLastName()); + Double mark = gradebookUserActivities.get(user.getUserId().intValue()); + responseRow.put("mark", mark == null ? "" : String.valueOf(mark)); + responseRow.put("isLeader", leader != null && leader.getUid().equals(user.getUid())); + + rows.add(responseRow); + } + responsedata.set("rows", rows); + } + + response.setContentType("application/json;charset=utf-8"); + return responsedata.toString(); + } + + @RequestMapping(path = "/updateLearnerMark", method = RequestMethod.POST) + private void updateLearnerMark(@RequestParam long toolSessionId, @RequestParam int userId, + @RequestParam Double mark) { + ToolSession toolSession = toolService.getToolSessionById(toolSessionId); + long lessonId = toolSession.getLesson().getLessonId(); + securityService.isLessonMonitor(lessonId, getUserId(), "update Whiteboard learner mark", true); + + gradebookService.updateGradebookUserActivityMark(mark, null, userId, toolSessionId, true); + + } + + @RequestMapping(path = "/displayChangeLeaderForGroupDialogFromActivity") + public String displayChangeLeaderForGroupDialogFromActivity( + @RequestParam(name = AttributeNames.PARAM_TOOL_SESSION_ID) long toolSessionId) { + // tell Change Leader dialog in Leader Selection tool which learner has already reached this activity + String availableLearners = whiteboardService.getUsersBySession(toolSessionId).stream() + .collect(Collectors.mapping(user -> Long.toString(user.getUserId()), Collectors.joining(","))); + + return new StringBuilder("redirect:").append(Configuration.get(ConfigurationKeys.SERVER_URL)) + .append("tool/lalead11/monitoring/displayChangeLeaderForGroupDialogFromActivity.do?toolSessionId=") + .append(toolSessionId).append("&availableLearners=").append(availableLearners).toString(); + } + + @RequestMapping(path = "/changeLeaderForGroup", method = RequestMethod.POST) + @ResponseBody + @ResponseStatus(HttpStatus.OK) + public void changeLeaderForGroup(@RequestParam(name = AttributeNames.PARAM_TOOL_SESSION_ID) long toolSessionId, + @RequestParam long leaderUserId) { + whiteboardService.changeLeaderForGroup(toolSessionId, leaderUserId); + } + + @RequestMapping("/startGalleryWalk") + private void startGalleryWalk(HttpServletRequest request) throws IOException { + Long toolContentId = WebUtil.readLongParam(request, WhiteboardConstants.ATTR_TOOL_CONTENT_ID, false); + + whiteboardService.startGalleryWalk(toolContentId); + } + + @RequestMapping("/finishGalleryWalk") + private void finishGalleryWalk(HttpServletRequest request) throws IOException { + Long toolContentId = WebUtil.readLongParam(request, WhiteboardConstants.ATTR_TOOL_CONTENT_ID, false); + + whiteboardService.finishGalleryWalk(toolContentId); + } + + @RequestMapping(path = "/updateTimeLimit", method = RequestMethod.POST) + @ResponseStatus(HttpStatus.OK) + public void updateTimeLimit(@RequestParam(name = AttributeNames.PARAM_TOOL_CONTENT_ID) long toolContentId, + @RequestParam int relativeTimeLimit, @RequestParam(required = false) Long absoluteTimeLimit) { + if (relativeTimeLimit < 0) { + throw new InvalidParameterException( + "Relative time limit must not be negative and it is " + relativeTimeLimit); + } + if (absoluteTimeLimit != null && relativeTimeLimit != 0) { + throw new InvalidParameterException( + "Relative time limit must not be provided when absolute time limit is set"); + } + + Whiteboard whiteboard = whiteboardService.getWhiteboardByContentId(toolContentId); + whiteboard.setRelativeTimeLimit(relativeTimeLimit); + // set time limit as seconds from start of epoch, using current server time zone + whiteboard.setAbsoluteTimeLimit(absoluteTimeLimit == null ? null + : LocalDateTime.ofEpochSecond(absoluteTimeLimit, 0, OffsetDateTime.now().getOffset())); + whiteboardService.saveOrUpdate(whiteboard); + } + + @RequestMapping(path = "/getPossibleIndividualTimeLimitUsers", method = RequestMethod.GET) + @ResponseBody + public String getPossibleIndividualTimeLimitUsers( + @RequestParam(name = AttributeNames.PARAM_TOOL_CONTENT_ID) long toolContentId, + @RequestParam(name = "term") String searchString) { + Whiteboard whiteboard = whiteboardService.getWhiteboardByContentId(toolContentId); + Map timeLimitAdjustments = whiteboard.getTimeLimitAdjustments(); + + List users = whiteboardService.getPossibleIndividualTimeLimitUsers(toolContentId, searchString); + Grouping grouping = whiteboardService.getGrouping(toolContentId); + + ArrayNode responseJSON = JsonNodeFactory.instance.arrayNode(); + String groupLabel = messageService.getMessage("monitoring.label.group") + " \""; + if (grouping != null) { + Set groups = grouping.getGroups(); + for (Group group : groups) { + if (!group.getUsers().isEmpty() && group.getGroupName().contains(searchString.toLowerCase())) { + ObjectNode groupJSON = JsonNodeFactory.instance.objectNode(); + groupJSON.put("label", groupLabel + group.getGroupName() + "\""); + groupJSON.put("value", "group-" + group.getGroupId()); + responseJSON.add(groupJSON); + } + } + } + + for (User user : users) { + if (!timeLimitAdjustments.containsKey(user.getUserId())) { + // this format is required by jQuery UI autocomplete + ObjectNode userJSON = JsonNodeFactory.instance.objectNode(); + userJSON.put("value", "user-" + user.getUserId()); + + String name = user.getFirstName() + " " + user.getLastName() + " (" + user.getLogin() + ")"; + if (grouping != null) { + Group group = grouping.getGroupBy(user); + if (group != null) { + name += " - " + group.getGroupName(); + } + } + + userJSON.put("label", name); + responseJSON.add(userJSON); + } + } + return responseJSON.toString(); + } + + @RequestMapping(path = "/getExistingIndividualTimeLimitUsers", method = RequestMethod.GET) + @ResponseBody + public String getExistingIndividualTimeLimitUsers( + @RequestParam(name = AttributeNames.PARAM_TOOL_CONTENT_ID) long toolContentId) { + Whiteboard whiteboard = whiteboardService.getWhiteboardByContentId(toolContentId); + Map timeLimitAdjustments = whiteboard.getTimeLimitAdjustments(); + Grouping grouping = whiteboardService.getGrouping(toolContentId); + // find User objects based on their userIDs and sort by name + List users = timeLimitAdjustments.keySet().stream() + .map(userId -> userManagementService.getUserById(userId)).sorted(USER_NAME_COMPARATOR) + .collect(Collectors.toList()); + + if (grouping != null) { + // Make a map group -> its users who have a time limit set + // key are sorted by group name, users in each group are sorted by name + List groupedUsers = grouping.getGroups().stream() + .collect(Collectors.toMap(Group::getGroupName, group -> { + return group.getUsers().stream() + .filter(user -> timeLimitAdjustments.containsKey(user.getUserId())) + .collect(Collectors.toCollection(() -> new TreeSet<>(USER_NAME_COMPARATOR))); + }, (s1, s2) -> { + s1.addAll(s2); + return s1; + }, TreeMap::new)).values().stream().flatMap(Set::stream).collect(Collectors.toList()); + + // from general user list remove grouped users + users.removeAll(groupedUsers); + // at the end of list, add remaining, not yet grouped users + groupedUsers.addAll(users); + users = groupedUsers; + } + + ArrayNode responseJSON = JsonNodeFactory.instance.arrayNode(); + for (User user : users) { + ObjectNode userJSON = JsonNodeFactory.instance.objectNode(); + userJSON.put("userId", user.getUserId()); + userJSON.put("adjustment", timeLimitAdjustments.get(user.getUserId().intValue())); + + String name = user.getFirstName() + " " + user.getLastName() + " (" + user.getLogin() + ")"; + if (grouping != null) { + Group group = grouping.getGroupBy(user); + if (group != null && !group.isNull()) { + name += " - " + group.getGroupName(); + } + } + userJSON.put("name", name); + + responseJSON.add(userJSON); + } + return responseJSON.toString(); + } + + @RequestMapping(path = "/updateIndividualTimeLimit", method = RequestMethod.POST) + @ResponseStatus(HttpStatus.OK) + public void updateIndividualTimeLimit(@RequestParam(name = AttributeNames.PARAM_TOOL_CONTENT_ID) long toolContentId, + @RequestParam String itemId, @RequestParam(required = false) Integer adjustment) { + Whiteboard whiteboard = whiteboardService.getWhiteboardByContentId(toolContentId); + Map timeLimitAdjustments = whiteboard.getTimeLimitAdjustments(); + Set userIds = null; + + // itemId can user- or group- + String[] itemIdParts = itemId.split("-"); + if (itemIdParts[0].equalsIgnoreCase("group")) { + // add all users from a group, except for ones who are already added + Group group = (Group) userManagementService.findById(Group.class, Long.valueOf(itemIdParts[1])); + userIds = group.getUsers().stream().map(User::getUserId) + .filter(userId -> !timeLimitAdjustments.containsKey(userId)).collect(Collectors.toSet()); + } else { + // adjust for a single user + userIds = new HashSet<>(); + userIds.add(Integer.valueOf(itemIdParts[1])); + } + + for (Integer userId : userIds) { + if (adjustment == null) { + timeLimitAdjustments.remove(userId); + } else { + timeLimitAdjustments.put(userId, adjustment); + } + } + whiteboardService.saveOrUpdate(whiteboard); + } + + private Integer getUserId() { + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + return user != null ? user.getUserID() : null; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/form/ReflectionForm.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/form/ReflectionForm.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/form/ReflectionForm.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.whiteboard.web.form; + +import org.apache.log4j.Logger; + +public class ReflectionForm { + 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; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/form/WhiteboardForm.java =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/form/WhiteboardForm.java (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/web/form/WhiteboardForm.java (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 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.whiteboard.web.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.whiteboard.model.Whiteboard; + +public class WhiteboardForm { + + private static Logger logger = Logger.getLogger(WhiteboardForm.class.getName()); + + private String sessionMapID; + private String contentFolderID; + private int currentTab; + + private String mode; + + private Whiteboard whiteboard; + + public WhiteboardForm() { + whiteboard = new Whiteboard(); + whiteboard.setTitle("Whiteboard"); + currentTab = 1; + } + + public void setWhiteboard(Whiteboard whiteboard) { + this.whiteboard = whiteboard; + } + + public void reset(HttpServletRequest request, String param) { + // 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")) { + whiteboard.setRelativeTimeLimit(0); + whiteboard.setLockWhenFinished(false); + whiteboard.setDefineLater(false); + whiteboard.setUseSelectLeaderToolOuput(false); + whiteboard.setReflectOnActivity(false); + } + } + + public int getCurrentTab() { + return currentTab; + } + + public void setCurrentTab(int currentTab) { + this.currentTab = currentTab; + } + + public Whiteboard getWhiteboard() { + return whiteboard; + } + + 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; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } +} \ No newline at end of file Index: lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/whiteboardApplicationContext.xml =================================================================== diff -u --- lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/whiteboardApplicationContext.xml (revision 0) +++ lams_tool_whiteboard/src/java/org/lamsfoundation/lams/tool/whiteboard/whiteboardApplicationContext.xml (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,99 @@ + + + + + + + + org.lamsfoundation.lams.tool.whiteboard.ApplicationResources + + + + + + + + + + + + + + + + + + + + + + + + + + + + + whiteboardworkspace + whiteboard + lams-whiteboard + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + PROPAGATION_REQUIRED + + + + \ No newline at end of file Index: lams_tool_whiteboard/web/403.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/403.jsp (revision 0) +++ lams_tool_whiteboard/web/403.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,5 @@ +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c" %> + + + Index: lams_tool_whiteboard/web/404.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/404.jsp (revision 0) +++ lams_tool_whiteboard/web/404.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,7 @@ +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c" %> + + + + + Index: lams_tool_whiteboard/web/WEB-INF/spring-servlet.xml =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/spring-servlet.xml (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/spring-servlet.xml (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,17 @@ + + + + + + + + + + + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/AdvancedAccordian.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/AdvancedAccordian.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/AdvancedAccordian.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,53 @@ +<% + /**************************************************************** + * 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 + * **************************************************************** + */ + + /** + * AdvancedAccordian.tag + * Author: Fiona Malikoff + * Description: Creates the show/hide entry for the Advanced Settings in Montoring. + * Wiki: + */ +%> +<%@ attribute name="title" required="true" rtexprvalue="true"%> + +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + +
+
+ + +
+ +
+
+
+ \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/Alert.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Alert.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Alert.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,46 @@ +<%@ tag body-content="scriptless"%> +<%@ taglib uri="tags-core" prefix="c"%> + +<%@ attribute name="close" required="false" rtexprvalue="true"%> +<%@ attribute name="id" required="false" rtexprvalue="true"%> +<%@ attribute name="type" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ +
+
+ + × + + +
+
+
+
+
Index: lams_tool_whiteboard/web/WEB-INF/tags/Arrow.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Arrow.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Arrow.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,56 @@ +<%@ tag body-content="scriptless"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-function" prefix="fn" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> + +<%-- state = up: up arrow; state = down: down arrow --%> +<%@ attribute name="state" required="true" rtexprvalue="true"%> +<%@ attribute name="titleKey" required="false" rtexprvalue="true"%> +<%@ attribute name="onclick" required="false" rtexprvalue="true"%> +<%@ attribute name="id" required="false" rtexprvalue="true"%> +<%@ attribute name="display" required="false" rtexprvalue="true"%> + + + + title="" + + + + + + + + + onclick="${onclick}" + + + + + + + + + id="${id}" + + + + + + + + + style='display:${display}' + + + + + + + + + + + + + + Index: lams_tool_whiteboard/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/AuthoringButton.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/AuthoringButton.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,133 @@ +<% +/**************************************************************** + * 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="http://www.springframework.org/tags/form" prefix="form" %> +<%@ taglib uri="tags-lams" prefix="lams"%> + +<%@ 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 --%> + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,422 @@ +<% + /** + * AuthoringRatingSimple.tag + * Author: Andrey Balan + * Description: Creates list of rating criterias for authoring page, only support stars. + */ + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> + + +<%@ attribute name="criterias" required="true" rtexprvalue="true" type="java.util.Collection" %> + +<%-- Optional attribute --%> +<%@ attribute name="hasRatingLimits" required="false" rtexprvalue="true" %> +<%@ attribute name="formContentPrefix" required="false" rtexprvalue="true" %> +<%@ attribute name="styleId" required="false" rtexprvalue="true" %> +<%@ attribute name="headerLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="addLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="deleteLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="upLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="downLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="minimumLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="maximumLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="noMinimumLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="noMaximumLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="jsWarningLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="allowCommentsLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="minNumberWordsLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="allLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="justifyLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="rankLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="hedgeRankLabel" required="false" rtexprvalue="true" %> + +<%-- Default value for message key --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ +
+ + + + + +
+
+ +
+ + + +   + +
+ +
+ \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/AuthoringRatingCriteria.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/AuthoringRatingCriteria.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/AuthoringRatingCriteria.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,348 @@ +<% + /** + * AuthoringRatingCriteria.tag + * Author: Andrey Balan + * Description: Creates list of rating criterias for authoring page + */ + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> + + +<%@ attribute name="criterias" required="true" rtexprvalue="true" type="java.util.Collection" %> + +<%-- Optional attribute --%> +<%@ attribute name="hasRatingLimits" required="false" rtexprvalue="true" %> +<%@ attribute name="formContentPrefix" required="false" rtexprvalue="true" %> +<%@ attribute name="styleId" required="false" rtexprvalue="true" %> +<%@ attribute name="headerLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="addLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="deleteLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="upLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="downLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="minimumLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="maximumLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="noMinimumLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="noMaximumLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="jsWarningLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="allowCommentsLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="minNumberWordsLabel" required="false" rtexprvalue="true" %> + +<%-- Default value for message key --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + +
+ + + +
">
+
">
+
+ "> +
+ + + + +
+ + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + + + + + + + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + +
+
+ +
+ +
+ +
+ + +
+
+
+
+ \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/CKEditor.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/CKEditor.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/CKEditor.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,116 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> + +<%@ attribute name="id" required="true" rtexprvalue="true"%> +<%@ attribute name="placeholder" required="false" rtexprvalue="true"%> +<%@ attribute name="value" required="true" rtexprvalue="true"%> +<%@ attribute name="toolbarSet" required="false" rtexprvalue="true"%> +<%@ attribute name="classes" required="false" rtexprvalue="true"%> +<%@ attribute name="height" required="false" rtexprvalue="true"%> +<%@ attribute name="width" required="false" rtexprvalue="true"%> +<%@ attribute name="contentFolderID" required="false" rtexprvalue="true"%> +<%@ attribute name="displayExpanded" required="false" rtexprvalue="true"%> +<%@ attribute name="resizeParentFrameName" required="false" rtexprvalue="true"%> +<%@ attribute name="method" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + + + ${toolbarSet}Inline + + + + + + + + + + + + + + + +
+ + + + + + +
+
+ + + /lams/ckeditor/ + + + + Index: lams_tool_whiteboard/web/WEB-INF/tags/Comments.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Comments.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Comments.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,79 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> + +<%@ attribute name="toolSessionId" required="true" rtexprvalue="true"%> +<%@ attribute name="toolItemId" required="false" rtexprvalue="true"%> +<%@ attribute name="toolSignature" required="true" rtexprvalue="true"%> +<%@ attribute name="height" required="false" rtexprvalue="true"%> +<%@ attribute name="width" required="false" rtexprvalue="true"%> +<%@ attribute name="mode" required="false" rtexprvalue="true"%> +<%@ attribute name="likeAndDislike" required="false" rtexprvalue="true"%> +<%@ attribute name="anonymous" required="false" rtexprvalue="true"%> +<%@ attribute name="readOnly" required="false" rtexprvalue="true"%> +<%@ attribute name="pageSize" required="false" rtexprvalue="true"%> +<%@ attribute name="sortBy" required="false" rtexprvalue="true"%> +<%@ attribute name="embedInAccordian" required="false" rtexprvalue="true"%> +<%@ attribute name="accordionTitle" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + &mode=${mode} + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/CommentsAuthor.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/CommentsAuthor.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/CommentsAuthor.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,76 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + +<%@ attribute name="allowCommentsVariableName" required="false" rtexprvalue="true"%> +<%@ attribute name="allowCommentLabelKey" required="false" rtexprvalue="true"%> +<%@ attribute name="likeDislikeVariableName" required="false" rtexprvalue="true"%> +<%@ attribute name="likeOnlyCommentLabelKey" required="false" rtexprvalue="true"%> +<%@ attribute name="likeDislikeLabelKey" required="false" rtexprvalue="true"%> +<%@ attribute name="allowAnonymousVariableName" required="false" rtexprvalue="true"%> +<%@ attribute name="allowAnonymousLabelKey" required="false" rtexprvalue="true"%> +<%@ attribute name="commentPanelHeaderKey" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+     +   +
+
+ +
+
+ +
+ + + + Index: lams_tool_whiteboard/web/WEB-INF/tags/Date.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Date.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Date.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,64 @@ +<% +/**************************************************************** + * 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"%> +<%@ attribute name="timeago" required="false" rtexprvalue="true"%> + +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-core" prefix="c" %> + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/DefineLater.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/DefineLater.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/DefineLater.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,66 @@ + +<% + /**************************************************************** + * 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 --%> + + + + + + + +
+
+
+ +
+
+
+
+
+ +
+
\ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/Errors.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Errors.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Errors.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,48 @@ +<%@ tag body-content="scriptless"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ attribute name="path" required="false" rtexprvalue="true"%> + +<%-- To show the GLOBAL messages (default case) use no parameters --%> +<%-- To show the all messages, ignoring their keys (e.g. Change Password) use path="*" --%> +<%-- To show the messages for a particular item use path="itemName" --%> + + + +<%-- Show Messages for GLOBAL. Usual alert box --%> + + + + + +
+
+
+
+
+ +<%-- Show All Messages --%> + + + + + +
+
+
+
+
+
+ +<%-- Show messages for a particular key --%> + + + + +
+
+
+
+
+ +
Index: lams_tool_whiteboard/web/WEB-INF/tags/Etherpad.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Etherpad.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Etherpad.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,128 @@ +<% + /** + * Etherpad.tag + * Author: Marcin Cieslak + * Description: Etherpad pad + */ + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> + +<%@ attribute name="groupId" required="true" rtexprvalue="true" %> + +<%@ attribute name="padId" required="false" rtexprvalue="true" %> +<%@ attribute name="showControls" required="false" rtexprvalue="true" %> +<%@ attribute name="showChat" required="false" rtexprvalue="true" %> +<%@ attribute name="height" required="false" rtexprvalue="true" %> +<%@ attribute name="heightAutoGrow" required="false" rtexprvalue="true" %> +<%@ attribute name="showOnDemand" required="false" rtexprvalue="true" %> + +<%@ tag import="org.lamsfoundation.lams.util.Configuration"%> +<%@ tag import="org.lamsfoundation.lams.util.ConfigurationKeys"%> + +<%=Configuration.get(ConfigurationKeys.ETHERPAD_SERVER_URL)%> + + + +<%-- ---------------------------------------%> + + +<%-- THIS TAG REQUIRES JQUERY --%> + + + +
+ +<%-- If content was provided, put it into a hidden div so new lines will not break JavaScript --%> + + + ${content} + + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/FileUpload.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/FileUpload.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/FileUpload.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,84 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> + +<%-- Usually fileFieldname and fileFieldId are the same, but DACO needs them to be different. + If they can be the same, set fileFieldname and fileFieldId will be set to the same. + If you need them different, then define both. + If you define neither, fileFieldname = fileFieldId = "fileSelector" --%> +<%@ attribute name="fileFieldname" required="false" rtexprvalue="true"%> +<%@ attribute name="fileFieldId" required="false" rtexprvalue="true"%> + +<%@ attribute name="fileInputNameFieldname" required="false" rtexprvalue="true"%> +<%@ attribute name="fileInputMessageKey" required="false" rtexprvalue="true"%> + +<%-- Set uploadInfoMessageKey to '-' to NOT show the "not exe and max file size" type message. Leave it blank for the default key label.upload.info --%> +<%@ attribute name="uploadInfoMessageKey" required="false" rtexprvalue="true"%> +<%@ attribute name="maxFileSize" required="true" rtexprvalue="true"%> +<%@ attribute name="tabindex" required="false" rtexprvalue="true"%> + +<%-- Only set if you have more than one file field on the screen (such as DACO) --%> +<%@ attribute name="errorMsgDiv" required="false" rtexprvalue="true"%> +<%@ attribute name="fileButtonBrowse" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ <%-- font-size:inherit needed for Share Resources authoring or the button is too small --%> + + + + +
+ +

${maxFileSize}

+
+ + + + Index: lams_tool_whiteboard/web/WEB-INF/tags/Head.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Head.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Head.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 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_whiteboard/web/WEB-INF/tags/ImgButtonWrapper.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/ImgButtonWrapper.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/ImgButtonWrapper.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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_whiteboard/web/WEB-INF/tags/LeaderDisplay.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/LeaderDisplay.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/LeaderDisplay.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,28 @@ +<%@ tag body-content="scriptless"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + +<%@ attribute name="idName" required="false" rtexprvalue="true"%> +<%@ attribute name="messageKey" required="false" rtexprvalue="true"%> +<%@ attribute name="username" required="false" rtexprvalue="true"%> +<%@ attribute name="userId" required="true" rtexprvalue="true"%> + + + + + + + + + +
+
+
+

+ +   +

+
+
+
Index: lams_tool_whiteboard/web/WEB-INF/tags/OutcomeAuthor.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/OutcomeAuthor.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/OutcomeAuthor.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,210 @@ +<% + /** + * Outcome.tag + * Author: Marcin Cieslak + * Description: Outcome selection in authoring + */ + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> +<%@ taglib uri="csrfguard" prefix="csrf" %> + + +<%-- Optional attributes. Must provide at either lessonId or toolContentId --%> +<%@ attribute name="lessonId" required="false" rtexprvalue="true" %> +<%@ attribute name="toolContentId" required="false" rtexprvalue="true" %> +<%@ attribute name="itemId" required="false" rtexprvalue="true" %> +<%@ attribute name="qbQuestionId" required="false" rtexprvalue="true" %> +<%@ attribute name="inPanel" required="false" rtexprvalue="true" %> + +<%-- Support for multiple tags on one page --%> + + +<%-- ---------------------------------------%> + + + + + + + +
+ + +
+
+ :
+
+
+
+ +
+ + +
+
+ + +
+
+ :
+
+
+
+
+
Index: lams_tool_whiteboard/web/WEB-INF/tags/Page.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Page.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Page.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,450 @@ +<%@ tag body-content="scriptless"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + +<%@ attribute name="type" required="true" rtexprvalue="true"%> +<%@ attribute name="formID" required="false" rtexprvalue="true"%> +<%@ attribute name="style" required="false" rtexprvalue="true"%> +<%@ attribute name="title" required="false" rtexprvalue="true"%> +<%@ attribute name="titleHelpURL" required="false" rtexprvalue="true"%> +<%@ attribute name="headingContent" required="false" rtexprvalue="true"%> +<%@ attribute name="usePanel" required="false" rtexprvalue="true"%> +<%@ attribute name="hideProgressBar" required="false" rtexprvalue="true"%> + +<%@ tag import="org.lamsfoundation.lams.util.Configuration"%> +<%@ tag import="org.lamsfoundation.lams.util.ConfigurationKeys"%> + + + true + +<%=Configuration.get(ConfigurationKeys.DISPLAY_PORTRAIT)%> + + + + + <%-- Combined tab and navigation bar used in authoring and monitoring --%> +
+
+
+ +
+
+
+
+ + + <%-- Learner --%> + + <%-- Try to get authoring preview/learning/monitoring from the tool activity so we don't show the progress bar in monitoring --%> + + + + + + + + + + + <%-- only have sidebar and presence in learner main window, not in popup windows --%> + + + <%-- Links placed in body instead of head. Ugly, but it works. --%> + + + + + + + + + + + + <%-- Desperately try to get tool session ID from the tool activity --%> + + + + + + + + + + + + + + + + + + + + + + + + ${toolForm.toolSessionID} + + + + + + + + +
+ +
<%-- end of sidebar stuff - only used if in learner screen --%> + + + +
+ + + +
+
+
+ + + +
+ +
+
+ + + ${titleHelpURL} + +
+ + + +
+
+ +
+ +
+
+
+ + + + +
+ +
+
+
+
+
Index: lams_tool_whiteboard/web/WEB-INF/tags/Rating.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Rating.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Rating.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,216 @@ +<% + /** + * Rating.tag + * Author: Andrey Balan + * Description: Shows rating stars widget + */ + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> + + +<%@ attribute name="itemRatingDto" required="true" rtexprvalue="true" type="org.lamsfoundation.lams.rating.dto.ItemRatingDTO" %> + +<%-- Optional attribute --%> +<%@ attribute name="disabled" required="false" rtexprvalue="true" %> +<%@ attribute name="isItemAuthoredByUser" required="false" rtexprvalue="true" %> +<%@ attribute name="maxRates" required="false" rtexprvalue="true" %> +<%@ attribute name="countRatedItems" required="false" rtexprvalue="true" %> +<%@ attribute name="yourRatingLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="averageRatingLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="minNumberWordsLabel" required="false" rtexprvalue="true" %> +<%@ attribute name="hideCriteriaTitle" required="false" rtexprvalue="true" %> +<%@ attribute name="showComments" required="false" rtexprvalue="true" %> +<%@ attribute name="showAllComments" required="false" rtexprvalue="true" %> +<%@ attribute name="allowRetries" required="false" rtexprvalue="true" %> +<%-- ID of HTML element where to scroll after refresh after comment was submitted --%> +<%@ attribute name="refreshOnComment" required="false" rtexprvalue="true" %> + +<%-- Default value for message key --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%--Rating stars area---------------------------------------%> + +
+
+ + + + + + + + + + + + + + + + + + + + + + + ${criteriaDto.ratingCriteria.title} + + + + + + + + + + + + +
+
+ + + +
+ + + + + + ${criteriaDto.numberOfVotes} + + +
+
+ + +
style="visibility: hidden;" + > + + + + + + + + + + + + + ${criteriaDto.numberOfVotes} + + +
+ +
+
+ +
+ +
+ +
+ +<%--Comments area---------------------------------------%> + +
+ + + +
+ +
+
+
+ + +
+ +
+
+ + +
+ + + + + + + : + + + + +
+
+ +
+
+
+
+ +
+
+
+ +
+
\ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/RestrictedUsageAccordian.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/RestrictedUsageAccordian.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/RestrictedUsageAccordian.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 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 + * **************************************************************** + */ + + /** + * AdvancedAccordian.tag + * Author: Fiona Malikoff + * Description: Creates the show/hide entry for the Restricted Usage Settings in Monitoring. + * Wiki: + */ +%> +<%@ attribute name="title" required="true" rtexprvalue="true"%> + +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + +
+
+ + + +
+ +
+
+
+ \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/SimplePanel.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/SimplePanel.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/SimplePanel.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,32 @@ +<%@ tag body-content="scriptless"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> + +<%@ attribute name="title" required="false" rtexprvalue="true"%> +<%@ attribute name="titleKey" required="false" rtexprvalue="true"%> +<%@ attribute name="titleHelpURL" required="false" rtexprvalue="true"%> +<%@ attribute name="panelBodyClass" required="false" rtexprvalue="true"%> + + + + + +
+ +
+
+ + + + +
+
+
+
+ +
+
+ + + + Index: lams_tool_whiteboard/web/WEB-INF/tags/StyledRating.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/StyledRating.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/StyledRating.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,203 @@ +<% + /** + * StyledRating.tag + * Author: Andrey Balan + * Description: Shows the results of a styled rating. Does not allow for update. + */ + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> + + +<%@ attribute name="criteriaRatings" required="true" rtexprvalue="true" type="org.lamsfoundation.lams.rating.dto.StyledCriteriaRatingDTO" %> +<%@ attribute name="showJustification" required="true" %> +<%@ attribute name="alwaysShowAverage" required="true" %> + + +<%@ attribute name="currentUserDisplay" required="true" %> + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+   + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+   + +
+ ${criteriaRatings.ratingCriteria.ratingCriteriaId}-${rating.itemId} +
+ ${rating.userRating} +
+ + + + + + ${userRating} + + +
+ + ${rating.averageRating} + ${rating.numberOfVotes} + +
+
+ +
+
+ + + + + + + + + + + + + + + + + +
+
+ ${criteriaRatings.ratingCriteria.ratingCriteriaId}-${rating.itemId} +
+
+ + ${rating.averageRating} + ${rating.numberOfVotes} + +
+
+
+
+
+
+ +
+ + +   +
    + + +
  • + + - + + + : +   +    + + (${rating.userRating}) + +
  • +
    +
    +
+
+ + +   +
    + + +
  • + + - + ${rating.averageRating} + + : +   +    + + (${rating.userRating}) + +
  • +
    +
    +
+ +   +
+
+
+ + +
\ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/TSTable.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/TSTable.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/TSTable.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,53 @@ +<%-- Tablesorter Table and Pager --%> +<%@ tag body-content="scriptless"%> +<%@ taglib uri="tags-core" prefix="c"%> + +<%@ attribute name="numColumns" required="true" rtexprvalue="true"%> +<%@ attribute name="dataId" required="false" rtexprvalue="true"%> +<%@ attribute name="tableClass" required="false" rtexprvalue="true"%> +<%@ attribute name="pagerClass" required="false" rtexprvalue="true"%> +<%@ attribute name="test" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/Tab.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Tab.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Tab.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,89 @@ +<% + /**************************************************************** + * 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: Fiona Malikoff + * Description: Creates a tab element within the Hybrid Tab Header. + * 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 + + -- onclick="${methodCall}(${id});return false;"> + +--%> + + + + + + + + + + + + + + + + + + + + + class="active" + + + + + class="disabled" + + +
  • ${tabTitle}
  • Index: lams_tool_whiteboard/web/WEB-INF/tags/TabBody.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/TabBody.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/TabBody.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,50 @@ +<%/**************************************************************** + * 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: + */ + +%> +<%@ attribute name="id" required="true" rtexprvalue="true"%> +<%@ attribute name="page" required="false" rtexprvalue="true"%> +<%@ taglib uri="tags-core" prefix="c"%> + + + + active + + +
    + + + + + + + + +
    \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/TabBodyArea.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/TabBodyArea.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/TabBodyArea.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,38 @@ +<%/**************************************************************** + * 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 + * **************************************************************** + */ + +/** + * TabBodyArea.tag + * Author: Fiona Malikoff + * Description: Creates the panel body area for a nav bar screen + * Wiki: + */ + +%> +<%@ taglib uri="tags-core" prefix="c"%> + +
    + +
    + + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/TabBodys.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/TabBodys.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/TabBodys.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 + * **************************************************************** + */ + +/** + * TabBodys.tag + * Author: Fiona Malikoff + * Description: Create a tabbody list from nested TabBody tags. + * Wiki: + */ + + %> +<%@ tag body-content="scriptless"%> + + +
    + +
    Index: lams_tool_whiteboard/web/WEB-INF/tags/Tabs.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/Tabs.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/Tabs.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,100 @@ +<%/**************************************************************** + * 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: Fiona Malikoff + * Description: Create a hybrid panel header that contains a nav bar that acts like tabs. + */ + +%> +<%@ attribute name="control" required="false" rtexprvalue="true"%> +<%@ attribute name="title" required="false" rtexprvalue="true"%> +<%@ attribute name="refreshOnClickAction" required="false" rtexprvalue="true"%> +<%@ attribute name="helpPage" required="false" rtexprvalue="true"%> +<%@ attribute name="helpToolSignature" required="false" rtexprvalue="true"%> +<%@ attribute name="helpModule" required="false" rtexprvalue="true"%> +<%@ attribute name="extraControl" required="false" rtexprvalue="true"%> + +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> + + + + + + + + + + + + +
    + + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/TextSearch.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/TextSearch.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/TextSearch.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,123 @@ +<% +/**************************************************************** + * 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 + * **************************************************************** + */ + + /** + * TextSearch.tag + * Author: Marcin Cieslak + * Description: Displays form for creating text search conditions. + */ + + %> +<%@ tag body-content="scriptless" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + +<%-- Required attributes --%> +<%@ attribute name="sessionMapID" required="true" rtexprvalue="true" %> + +<%-- Optional attributes --%> +<%@ attribute name="action" required="false" rtexprvalue="true" %> +<%@ attribute name="formID" required="false" rtexprvalue="true" %> +<%@ attribute name="headingLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="allWordsLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="phraseLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="anyWordsLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="excludedWordsLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %> +<%@ attribute name="cancelAction" required="false" rtexprvalue="true" %> + +<%-- Default value for message key --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/WaitingSpinner.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/WaitingSpinner.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/WaitingSpinner.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,17 @@ +<%@ taglib uri="tags-core" prefix="c"%> + +<%@ attribute name="id" required="false" rtexprvalue="true"%> +<%@ attribute name="showInline" required="false" rtexprvalue="true"%> + + + id="${id}" + + + + + + + + + + \ No newline at end of file Index: lams_tool_whiteboard/web/WEB-INF/tags/headItems.tag =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tags/headItems.tag (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tags/headItems.tag (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,49 @@ +<%/**************************************************************** + * 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_whiteboard/web/WEB-INF/tlds/jstl/c.tld =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tlds/jstl/c.tld (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tlds/jstl/c.tld (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 resource to import. + + url + true + true + + + +Name of the exported scoped variable for the +resource'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 +resource's content. The type of the scoped +variable is Reader. + + varReader + false + false + + + +Name of the context when accessing a relative +URL resource that belongs to a foreign +context. + + context + false + true + + + +Character encoding of the content at the input +resource. + + charEncoding + false + true + + + + + + The basic iteration tag, accepting many different + collection types and supporting subsetting and other + functionality + + forEach + org.apache.taglibs.standard.tag.rt.core.ForEachTag + org.apache.taglibs.standard.tei.ForEachTEI + JSP + + +Collection of items to iterate over. + + items + false + true + java.lang.Object + + + +If items specified: +Iteration begins at the item located at the +specified index. First item of the collection has +index 0. +If items not specified: +Iteration begins with index set at the value +specified. + + begin + false + true + int + + + +If items specified: +Iteration ends at the item located at the +specified index (inclusive). +If items not specified: +Iteration ends when index reaches the value +specified. + + end + false + true + int + + + +Iteration will only process every step items of +the collection, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. Its type depends +on the object of the underlying collection. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of type +javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Iterates over tokens, separated by the supplied delimeters + + forTokens + org.apache.taglibs.standard.tag.rt.core.ForTokensTag + JSP + + +String of tokens to iterate over. + + items + true + true + java.lang.String + + + +The set of delimiters (the characters that +separate the tokens in the string). + + delims + true + true + java.lang.String + + + +Iteration begins at the token located at the +specified index. First token has index 0. + + begin + false + true + int + + + +Iteration ends at the token located at the +specified index (inclusive). + + end + false + true + int + + + +Iteration will only process every step tokens +of the string, starting with the first one. + + step + false + true + int + + + +Name of the exported scoped variable for the +current item of the iteration. This scoped +variable has nested visibility. + + var + false + false + + + +Name of the exported scoped variable for the +status of the iteration. Object exported is of +type +javax.servlet.jsp.jstl.core.LoopTag +Status. This scoped variable has nested +visibility. + + varStatus + false + false + + + + + + Like <%= ... >, but for expressions. + + out + org.apache.taglibs.standard.tag.rt.core.OutTag + JSP + + +Expression to be evaluated. + + value + true + true + + + +Default value if the resulting value is null. + + default + false + true + + + +Determines whether characters <,>,&,'," in the +resulting string should be converted to their +corresponding character entity codes. Default value is +true. + + escapeXml + false + true + + + + + + + Subtag of <choose> that follows <when> tags + and runs only if all of the prior conditions evaluated to + 'false' + + otherwise + org.apache.taglibs.standard.tag.common.core.OtherwiseTag + JSP + + + + + Adds a parameter to a containing 'import' tag's URL. + + param + org.apache.taglibs.standard.tag.rt.core.ParamTag + JSP + + +Name of the query string parameter. + + name + true + true + + + +Value of the parameter. + + value + false + true + + + + + + Redirects to a new URL. + + redirect + org.apache.taglibs.standard.tag.rt.core.RedirectTag + JSP + + +The URL of the resource to redirect to. + + url + false + true + + + +Name of the context when redirecting to a relative URL +resource 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 +resource 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_whiteboard/web/WEB-INF/tlds/jstl/fmt.tld =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tlds/jstl/fmt.tld (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tlds/jstl/fmt.tld (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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 resource bundle to be used by its tag body + + bundle + org.apache.taglibs.standard.tag.rt.fmt.BundleTag + JSP + + +Resource bundle base name. This is the bundle's +fully-qualified resource 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 resource bundle and stores it in the named scoped variable or + the bundle configuration variable + + setBundle + org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag + empty + + +Resource bundle base name. This is the bundle's +fully-qualified resource 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 resource +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_whiteboard/web/WEB-INF/tlds/jstl/fn.tld =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tlds/jstl/fn.tld (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tlds/jstl/fn.tld (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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_whiteboard/web/WEB-INF/tlds/jstl/permittedTaglibs.tld =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tlds/jstl/permittedTaglibs.tld (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tlds/jstl/permittedTaglibs.tld (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,34 @@ + + + + + Restricts JSP pages to the JSTL tag libraries + + permittedTaglibs + 1.1 + permittedTaglibs + http://jakarta.apache.org/taglibs/standard/permittedTaglibs + + + + javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV + + + + Whitespace-separated list of taglib URIs to permit. This example + TLD for the Standard Taglib allows only JSTL 'el' taglibs to be + imported. + + permittedTaglibs + + http://java.sun.com/jsp/jstl/core + http://java.sun.com/jsp/jstl/fmt + http://java.sun.com/jsp/jstl/sql + http://java.sun.com/jsp/jstl/xml + + + + Index: lams_tool_whiteboard/web/WEB-INF/tlds/jstl/scriptfree.tld =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tlds/jstl/scriptfree.tld (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tlds/jstl/scriptfree.tld (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,51 @@ + + + + + Validates JSP pages to prohibit use of scripting elements. + + 1.1 + scriptfree + http://jakarta.apache.org/taglibs/standard/scriptfree + + + + Validates prohibitions against scripting elements. + + + javax.servlet.jsp.jstl.tlv.ScriptFreeTLV + + + + Controls whether or not declarations are considered valid. + + allowDeclarations + false + + + + Controls whether or not scriptlets are considered valid. + + allowScriptlets + false + + + + Controls whether or not top-level expressions are considered valid. + + allowExpressions + false + + + + Controls whether or not expressions used to supply request-time + attribute values are considered valid. + + allowRTExpressions + false + + + Index: lams_tool_whiteboard/web/WEB-INF/tlds/jstl/x.tld =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tlds/jstl/x.tld (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tlds/jstl/x.tld (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -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_whiteboard/web/WEB-INF/tlds/lams/lams.tld =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tlds/lams/lams.tld (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tlds/lams/lams.tld (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,413 @@ + + + + + 1.0 + lams + + LAMSTags + + + + org.lamsfoundation.lams.web.SessionListener + + + + + 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 + + + + + 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 + + + + + + + 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 + + + + + + + Converts role name into form usable as message resources key + Converts role name into form usable as message resources key + + + role + org.lamsfoundation.lams.web.tag.RoleTag + empty + + + Converts role name into form usable as message resources key + role + true + + true + + + + + + + Output stylesheet based on the user preferences. + User's chosen stylesheet + + + css + org.lamsfoundation.lams.web.tag.CssTag + empty + + Override the name to use a different suffix than "learner" + suffix + false + true + + + Include this webapp in the path + webapp + 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 + + + + + + + + Small portrait of a user + User Portrait + + Portrait + org.lamsfoundation.lams.web.tag.PortraitTag + JSP + + userId + true + true + + + size + false + true + + + round + false + true + If true shows the portrait as a round dot. Defaults to true. + + + hover + false + true + If true then display as a hover box. Uses the body of the tag as the link text. + + + + + Tab + /WEB-INF/tags/Tab.tag + + + Tabs + /WEB-INF/tags/Tabs.tag + + + TabBody + /WEB-INF/tags/TabBody.tag + + + TabBodys + /WEB-INF/tags/TabBodys.tag + + + TabBodyArea + /WEB-INF/tags/TabBodyArea.tag + + + CKEditor + /WEB-INF/tags/CKEditor.tag + + + AuthoringButton + /WEB-INF/tags/AuthoringButton.tag + + + AuthoringRatingCriteria + /WEB-INF/tags/AuthoringRatingCriteria.tag + + + AuthoringRatingAllStyleCriteria + /WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag + + + Rating + /WEB-INF/tags/Rating.tag + + + StyledRating + /WEB-INF/tags/StyledRating.tag + + + headItems + /WEB-INF/tags/headItems.tag + + + Date + /WEB-INF/tags/Date.tag + + + DefineLater + /WEB-INF/tags/DefineLater.tag + + + Alert + /WEB-INF/tags/Alert.tag + + + Page + /WEB-INF/tags/Page.tag + + + TSTable + /WEB-INF/tags/TSTable.tag + + + Arrow + /WEB-INF/tags/Arrow.tag + + + AdvancedAccordian + /WEB-INF/tags/AdvancedAccordian.tag + + + RestrictedUsageAccordian + /WEB-INF/tags/RestrictedUsageAccordian.tag + + + SimplePanel + /WEB-INF/tags/SimplePanel.tag + + + ImgButtonWrapper + /WEB-INF/tags/ImgButtonWrapper.tag + + + TextSearch + /WEB-INF/tags/TextSearch.tag + + + LeaderDisplay + /WEB-INF/tags/LeaderDisplay.tag + + + OutcomeAuthor + /WEB-INF/tags/OutcomeAuthor.tag + + + Etherpad + /WEB-INF/tags/Etherpad.tag + + + errors + /WEB-INF/tags/Errors.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 + + + + + disabled + false + true + + + + head + /WEB-INF/tags/Head.tag + + + Comments + /WEB-INF/tags/Comments.tag + + + CommentsAuthor + /WEB-INF/tags/CommentsAuthor.tag + + + FileUpload + /WEB-INF/tags/FileUpload.tag + + + WaitingSpinner + /WEB-INF/tags/WaitingSpinner.tag + + + Index: lams_tool_whiteboard/web/WEB-INF/tlds/security/csrfguard.tld =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/tlds/security/csrfguard.tld (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/tlds/security/csrfguard.tld (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,70 @@ + + + + 1.2 + 2.0 + Owasp CsrfGuard Tag Library + http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project/Owasp.CsrfGuard.tld + + token + org.owasp.csrfguard.tag.TokenTag + empty + + uri + false + true + + + + tokenname + org.owasp.csrfguard.tag.TokenNameTag + empty + + + tokenvalue + org.owasp.csrfguard.tag.TokenValueTag + empty + + uri + false + true + + + + a + org.owasp.csrfguard.tag.ATag + true + + + form + org.owasp.csrfguard.tag.FormTag + true + + Index: lams_tool_whiteboard/web/WEB-INF/web.xml =================================================================== diff -u --- lams_tool_whiteboard/web/WEB-INF/web.xml (revision 0) +++ lams_tool_whiteboard/web/WEB-INF/web.xml (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,271 @@ + + + + Whiteboard + + Whiteboard tool + + + javax.servlet.jsp.jstl.fmt.localizationContext + org.lamsfoundation.lams.tool.whiteboard.ApplicationResources + + + + contextConfigLocation + classpath:/org/lamsfoundation/lams/tool/whiteboard/dbupdates/autopatchContext.xml + + + locatorFactorySelector + classpath:/org/lamsfoundation/lams/beanRefContext.xml + + + parentContextKey + context.central + + + + + org.springframework.web.context.ContextLoaderListener + + + + + hibernateFilter + + org.springframework.orm.hibernate5.support.OpenSessionInViewFilter + + + sessionFactoryBeanName + coreSessionFactory + + + + + SystemSessionFilter + + org.lamsfoundation.lams.web.session.SystemSessionFilter + + + + LocaleFilter + + org.lamsfoundation.lams.web.filter.LocaleFilter + + + encoding + UTF-8 + + + + CSRFGuard + org.owasp.csrfguard.CsrfGuardFilter + + + + hibernateFilter + /* + + + SystemSessionFilter + /* + + + LocaleFilter + /* + + + CSRFGuard + *.do + + + + spring + + org.springframework.web.servlet.DispatcherServlet + + 1 + + + + Connector + net.fckeditor.connector.ConnectorServlet + + baseDir + /UserFiles/ + + + debug + false + + 1 + + + + + Instructions Download + Instructions Download + download + org.lamsfoundation.lams.contentrepository.client.ToolDownload + + toolContentHandlerBeanName + whiteboardToolContentHandler + + 3 + + + + spring + *.do + + + + Connector + /ckeditor/filemanager/browser/default/connectors/jsp/connector + + + + download + /download/* + + + + + + + + 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 + + + + + + tags-lams + /WEB-INF/tlds/lams/lams.tld + + + + + + csrfguard + /WEB-INF/tlds/security/csrfguard.tld + + + + *.jsp + UTF-8 + text/html; charset=UTF-8 + + + + + + + + + + Secure content + /* + GET + POST + + + LEARNER + MONITOR + AUTHOR + SYSADMIN + + + + + + Authoring content + /authoring/* + /pages/authoring/* + GET + POST + + + AUTHOR + MONITOR + SYSADMIN + + + + + Staff content + /monitoring/* + /pages/monitoring/* + /definelater.do + GET + POST + + + MONITOR + SYSADMIN + + + + + + Student + LEARNER + + + + Authors Learning Designs + AUTHOR + + + + Member of Staff + MONITOR + + + + Group Manager + GROUP MANAGER + + + + LAMS System Adminstrator + SYSADMIN + + + + + FORM + LAMS + + /login.jsp + /login.jsp?failed=y + + + + + 500 + /error.jsp + + + 403 + /403.jsp + + + 404 + /404.jsp + + Index: lams_tool_whiteboard/web/common/header.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/common/header.jsp (revision 0) +++ lams_tool_whiteboard/web/common/header.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,15 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + Index: lams_tool_whiteboard/web/common/taglibs.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/common/taglibs.jsp (revision 0) +++ lams_tool_whiteboard/web/common/taglibs.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,8 @@ +<%@ page errorPage="/error.jsp"%> +<%@ taglib uri="csrfguard" prefix="csrf" %> +<%@ 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="http://www.springframework.org/tags/form" prefix="form" %> \ No newline at end of file Index: lams_tool_whiteboard/web/error.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/error.jsp (revision 0) +++ lams_tool_whiteboard/web/error.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,78 @@ +<%@ page isErrorPage="true"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ page import="org.lamsfoundation.lams.util.Configuration" import="org.lamsfoundation.lams.util.ConfigurationKeys" %> + + + + + + + + + +<%-- Catch JSP Servlet Exception --%> +<%-- The javascript method checkForErrorScreen in error.js is coded to match this page exactly. +---- If you change this page, please change the javascript. --%> +<% +if ( Configuration.getAsBoolean(ConfigurationKeys.ERROR_STACK_TRACE) ) { +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_whiteboard/web/login.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/login.jsp (revision 0) +++ lams_tool_whiteboard/web/login.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,11 @@ +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c" %> + + + + Index: lams_tool_whiteboard/web/pages/authoring/advance.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/authoring/advance.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/authoring/advance.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,106 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + +
    + +
    +
    + + + +
    + + +
    +
    + + +

    + +

    +

    + +

    + +
    + +
    + + +
    + + + + + +
    + +
    + +
    + +
    + +
    + +
    + +
    + + \ No newline at end of file Index: lams_tool_whiteboard/web/pages/authoring/authoring.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/authoring/authoring.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/authoring/authoring.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,98 @@ + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.tool.whiteboard.WhiteboardConstants"%> + + + + <fmt:message key="label.author.title" /> + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- Default value + cancelButtonLabelKey="label.authoring.cancel.button" + saveButtonLabelKey="label.authoring.save.button" + cancelConfirmMsgKey="authoring.msg.cancel.save" + accessMode="author" + --%> + + + + + + + + + Index: lams_tool_whiteboard/web/pages/authoring/basic.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/authoring/basic.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/authoring/basic.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,17 @@ +<%@ include file="/common/taglibs.jsp"%> + + +
    + + +
    + +
    + + +
    Index: lams_tool_whiteboard/web/pages/authoring/start.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/authoring/start.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/authoring/start.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,15 @@ + +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + + Index: lams_tool_whiteboard/web/pages/learning/definelater.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/definelater.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/definelater.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,22 @@ + +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + Index: lams_tool_whiteboard/web/pages/learning/finish.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/finish.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/finish.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,10 @@ + +<%@ include file="/common/taglibs.jsp"%> +<%-- This page just for : redir finish page to parent rather that part of the frame --%> + + + + + Index: lams_tool_whiteboard/web/pages/learning/galleryWalk.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/galleryWalk.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/galleryWalk.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,209 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + <fmt:message key="label.learning.title" /> + + <%@ include file="/common/header.jsp"%> + + + + + + + + + <%@ include file="websocket.jsp"%> + + + + + + + +

    + + +
    +

    +
    + + +

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

    + + + + + + +
    + + +
    + +
    + <%-- Do not show rating to own group before Gallery Walk is finished --%> + + + + +<%-- +<%-- showControls="${not whiteboard.galleryWalkFinished and not whiteboard.galleryWalkReadOnly and hasEditRight}" --%> +<%-- showOnDemand="true" height="600" /> --%> +
    +
    +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + +
    Index: lams_tool_whiteboard/web/pages/learning/learning.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/learning.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/learning.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,311 @@ + +<%@ include file="/common/taglibs.jsp"%> +<%-- param has higher level for request attribute --%> + + + + + + + + + + + + + + <fmt:message key="label.learning.title" /> + <%@ include file="/common/header.jsp"%> + + + + + + + + + <%@ include file="websocket.jsp"%> + + + + + + + + + + + + + + + + + + + + + +

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

    + + + +

    +
    + +

    + +

    +
    +
    + + + + +
    +
    +
    + + + +
    + + + + + + + + + <%-- show no button for non-leaders until leader will finish activity --%> + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    + +
    Index: lams_tool_whiteboard/web/pages/learning/notconfigured.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/notconfigured.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/notconfigured.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,21 @@ + +<%@include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + Index: lams_tool_whiteboard/web/pages/learning/notebook.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/notebook.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/notebook.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,66 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + <fmt:message key="label.learning.title" /> + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + +
    + + +

    + +

    + + + + +
    +
    + + + + +
    + + +
    Index: lams_tool_whiteboard/web/pages/learning/success.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/success.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/success.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,26 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + + + <%@ include file="/common/header.jsp"%> + + + + + + +
    + + + + +
    +
    + +
    Index: lams_tool_whiteboard/web/pages/learning/waitForTimeLimitLaunch.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/waitForTimeLimitLaunch.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/waitForTimeLimitLaunch.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,31 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + <fmt:message key="label.learning.title" /> + <%@ include file="/common/header.jsp"%> + + <%@ include file="websocket.jsp"%> + + + + + + + + + +
    + +
    + + +
    + +
    Index: lams_tool_whiteboard/web/pages/learning/waitforleader.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/waitforleader.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/waitforleader.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,50 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + <fmt:message key="label.learning.title" /> + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + +
    + +
    + +
    + +
    + + + + +
    +
    +
    + +
    + +
    + + +
    + +
    Index: lams_tool_whiteboard/web/pages/learning/websocket.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/learning/websocket.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/learning/websocket.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,11 @@ + \ No newline at end of file Index: lams_tool_whiteboard/web/pages/monitoring/advanceoptions.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/monitoring/advanceoptions.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/monitoring/advanceoptions.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,109 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + +
    +
    Index: lams_tool_whiteboard/web/pages/monitoring/editactivity.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/monitoring/editactivity.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/monitoring/editactivity.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,43 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + +
    + : + + +
    + : + + +
    +
    + + + +
    + + + + +
    Index: lams_tool_whiteboard/web/pages/monitoring/monitoring.jsp =================================================================== diff -u --- lams_tool_whiteboard/web/pages/monitoring/monitoring.jsp (revision 0) +++ lams_tool_whiteboard/web/pages/monitoring/monitoring.jsp (revision 90e5fd15f6474eb56d0b497d1b73e14bda75e262) @@ -0,0 +1,71 @@ + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.tool.whiteboard.WhiteboardConstants"%> + + + + <%@ include file="/common/tabbedheader.jsp" %> + + + + + + + + + + + + + + + + + + + + + + + + +