Index: lams_tool_doku/.classpath =================================================================== diff -u --- lams_tool_doku/.classpath (revision 0) +++ lams_tool_doku/.classpath (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_doku/.cvsignore =================================================================== diff -u --- lams_tool_doku/.cvsignore (revision 0) +++ lams_tool_doku/.cvsignore (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,2 @@ +build +bin Index: lams_tool_doku/.project =================================================================== diff -u --- lams_tool_doku/.project (revision 0) +++ lams_tool_doku/.project (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,19 @@ + + + lams_tool_doku + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + com.genuitec.eclipse.hibernate.hibernatenature + com.genuitec.eclipse.j2eedt.core.webnature + org.eclipse.jdt.core.javanature + + Index: lams_tool_doku/build.properties =================================================================== diff -u --- lams_tool_doku/build.properties (revision 0) +++ lams_tool_doku/build.properties (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,7 @@ +# Minimum compatible version of server +min.server.version.number=2.5 + +signature=ladoku11 +tool.version=20161229 +tool.hide=false +tool.short.name=dokumaran Index: lams_tool_doku/build.xml =================================================================== diff -u --- lams_tool_doku/build.xml (revision 0) +++ lams_tool_doku/build.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,7 @@ + + + + + + + Index: lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/Dokumaran.hbm.xml =================================================================== diff -u --- lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/Dokumaran.hbm.xml (revision 0) +++ lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/Dokumaran.hbm.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranConfigItem.hbm.xml =================================================================== diff -u --- lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranConfigItem.hbm.xml (revision 0) +++ lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranConfigItem.hbm.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranSession.hbm.xml =================================================================== diff -u --- lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranSession.hbm.xml (revision 0) +++ lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranSession.hbm.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranUser.hbm.xml =================================================================== diff -u --- lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranUser.hbm.xml (revision 0) +++ lams_tool_doku/conf/hibernate/mappings/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranUser.hbm.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_doku/conf/language/lams/ApplicationResources.properties =================================================================== diff -u --- lams_tool_doku/conf/language/lams/ApplicationResources.properties (revision 0) +++ lams_tool_doku/conf/language/lams/ApplicationResources.properties (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1 @@ \ No newline at end of file Index: lams_tool_doku/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u --- lams_tool_doku/conf/language/lams/ApplicationResources_en_AU.properties (revision 0) +++ lams_tool_doku/conf/language/lams/ApplicationResources_en_AU.properties (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,75 @@ +appName = dokumaran +#language code: en +#locale code: AU + +#=================== labels for doKumaran =================# + +activity.title =doKumaran +activity.description =Sharing resources with others. +activity.helptext =Uploading your resources to share with others. +tool.display.name =DoKumaran Tool +tool.description =Tool for sharing resources. +appName =doKumaran +label.authoring.heading =DoKumaran Authoring +label.author.title =doKumaran +label.authoring.heading.basic =Basic +label.authoring.heading.advance =Advanced +label.authoring.heading.basic.desc =Basic input information for doKumaran +label.authoring.heading.advance.desc =Please input advance options for doKumaran +label.authoring.basic.title =Title +label.authoring.basic.instruction =Instruction +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 =doKumaran Learning +monitoring.tab.summary =Summary +monitoring.tab.statistics =Statistic +monitoring.tab.edit.activity =Edit activity +monitoring.label.group =Group +monitoring.summary.note =Note: number of learners is the number of learners who have viewed the resource. +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 doKumaran 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\u201d, if you come back to this doKumaran, you won\u2019t be able to share new resources. +message.activityLocked =The instructor has set this activity not to allow you to edit doKumaran 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 doKumaran +monitor.summary.td.notebookInstructions =Notebook instructions +label.submit =Finish +label.resource.options =Resources options +label.activity.completion =End of activity +pageTitle.admin =Dokumaran settings +label.select.leader =Leader selection +label.use.select.leader.tool.output =Use leaders from Select Leader tool +label.show.chat =Show the line numbers +label.show.line.numbers =Show the chat button +admin.formError =Missing values, please make sure all required fields are entered. +admin.etherpad.url =Etherpad server URL +admin.apiKey =API Key +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 =Group 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. +label.users.from.group =Other learners participating in current group: +label.refresh =Refresh + +#======= End labels: Exported 164 labels for en AU ===== Index: lams_tool_doku/db/sql/activity_insert.sql =================================================================== diff -u --- lams_tool_doku/db/sql/activity_insert.sql (revision 0) +++ lams_tool_doku/db/sql/activity_insert.sql (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,78 @@ +# Connection: ROOT LOCAL +# Host: localhost +# Saved: 2005-04-07 11:08:32 +# +INSERT INTO lams_learning_activity +( +activity_ui_id +, description +, title +, help_text +, xcoord +, ycoord +, parent_activity_id +, parent_ui_id +, learning_activity_type_id +, grouping_support_type_id +, apply_grouping_flag +, grouping_id +, grouping_ui_id +, order_id +, define_later_flag +, learning_design_id +, learning_library_id +, create_date_time +, run_offline_flag +, max_number_of_options +, min_number_of_options +, options_instructions +, tool_id +, tool_content_id +, activity_category_id +, gate_activity_level_id +, gate_open_flag +, gate_start_time_offset +, gate_end_time_offset +, library_activity_ui_image +, create_grouping_id +, create_grouping_ui_id +, library_activity_id +, language_file +) +VALUES +( +NULL +, 'Collaborative real-time document editor' +, 'doKumaran' +, 'Put some help text here.' +, NULL +, NULL +, NULL +, NULL +, 1 +, 2 +, 0 +, NULL +, NULL +, NULL +, 0 +, NULL +, ${learning_library_id} +, NOW() +, 0 +, NULL +, NULL +, NULL +, ${tool_id} +, NULL +, 4 +, NULL +, NULL +, NULL +, NULL +, 'tool/ladoku11/images/icon_dokumaran.svg' +, NULL +, NULL +, NULL +, 'org.lamsfoundation.lams.tool.dokumaran.ApplicationResources' +) Index: lams_tool_doku/db/sql/create_lams_tool_dokumaran.sql =================================================================== diff -u --- lams_tool_doku/db/sql/create_lams_tool_dokumaran.sql (revision 0) +++ lams_tool_doku/db/sql/create_lams_tool_dokumaran.sql (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,83 @@ +SET FOREIGN_KEY_CHECKS=0; +DROP TABLE IF EXISTS tl_ladoku11_dokumaran; +DROP TABLE IF EXISTS tl_ladoku11_session; +DROP TABLE IF EXISTS tl_ladoku11_user; +DROP TABLE IF EXISTS tl_ladoku11_configuration; +CREATE TABLE tl_ladoku11_dokumaran ( + uid bigint not null auto_increment, + create_date datetime, + update_date datetime, + create_by bigint, + title varchar(255), + lock_on_finished tinyint, + instructions text, + content_in_use tinyint, + define_later tinyint, + content_id bigint unique, + show_chat tinyint, + show_line_numbers tinyint, + use_select_leader_tool_ouput tinyint, + reflect_instructions TEXT, + reflect_on_activity smallint, + primary key (uid) +)ENGINE=InnoDB; +CREATE TABLE tl_ladoku11_session ( + uid bigint not null auto_increment, + session_end_date datetime, + session_start_date datetime, + status integer, + dokumaran_uid bigint, + session_id bigint, + session_name varchar(250), + group_leader_uid BIGINT, + etherpad_read_only_id varchar(50), + primary key (uid) +)ENGINE=InnoDB; +CREATE TABLE tl_ladoku11_user ( + uid bigint not null auto_increment, + user_id bigint, + last_name varchar(255), + first_name varchar(255), + login_name varchar(255), + session_finished smallint, + session_uid bigint, + dokumaran_uid bigint, + primary key (uid) +)ENGINE=InnoDB; +CREATE TABLE tl_ladoku11_configuration ( + uid bigint not null auto_increment, + config_key varchar(30) unique, + config_value varchar(255), + primary key (uid) +)ENGINE=InnoDB; +ALTER TABLE tl_ladoku11_dokumaran ADD INDEX FK_NEW_680978081_89093BF758092FB (create_by), ADD CONSTRAINT FK_NEW_680978081_89093BF758092FB FOREIGN KEY (create_by) REFERENCES tl_ladoku11_user (uid) ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE tl_ladoku11_session ADD INDEX FK_NEW_680978081_24AA78C530E79035 (dokumaran_uid), ADD CONSTRAINT FK_NEW_680978081_24AA78C530E79035 FOREIGN KEY (dokumaran_uid) REFERENCES tl_ladoku11_dokumaran (uid) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE tl_ladoku11_session ADD UNIQUE (session_id); +ALTER TABLE tl_ladoku11_user ADD INDEX FK_NEW_680978081_30113BFCEC0D3147 (session_uid), ADD CONSTRAINT FK_NEW_680978081_30113BFCEC0D3147 FOREIGN KEY (session_uid) REFERENCES tl_ladoku11_session (uid) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE tl_ladoku11_user ADD INDEX FK_NEW_680978081_30113BFC309ED320 (dokumaran_uid), ADD CONSTRAINT FK_NEW_680978081_30113BFC309ED320 FOREIGN KEY (dokumaran_uid) REFERENCES tl_ladoku11_dokumaran (uid) ON DELETE SET NULL ON UPDATE CASCADE; +ALTER TABLE tl_ladoku11_user ADD INDEX idx_user_user_id (user_id); +ALTER TABLE tl_ladoku11_session ADD INDEX tl_ladoku11_session (group_leader_uid), ADD CONSTRAINT tl_ladoku11_session FOREIGN KEY (`group_leader_uid`) REFERENCES `tl_ladoku11_user` (`uid`) ON DELETE SET NULL ON UPDATE CASCADE; + +INSERT INTO `tl_ladoku11_dokumaran` (`uid`, `create_date`, `update_date`, `create_by`, `title`, `lock_on_finished`, + `instructions`, `content_in_use`, `define_later`, `content_id`, `show_chat`, + `show_line_numbers`, `use_select_leader_tool_ouput`,`reflect_on_activity`) VALUES + (1,NULL,NULL,NULL,'doKumaran','0','Instructions ',0,0,${default_content_id},0,0,0,0); + +-- Inserting the required config item into the config table +-- Etherpad API key is added so the Etherpad works there automatically for each build +INSERT INTO `tl_ladoku11_configuration` ( + `config_key`, + `config_value` +) VALUES ( + 'EtherpadUrl', + 'http://0.0.0.0:9001' +); +INSERT INTO `tl_ladoku11_configuration` ( + `config_key`, + `config_value` +) VALUES ( + 'ApiKey', + 'd7404314414a7e9c9fed51316af9720efd52f0ea8fe12849e1bded9c8df88af8' +); + +SET FOREIGN_KEY_CHECKS=1; Index: lams_tool_doku/db/sql/db_version_insert.sql =================================================================== diff -u --- lams_tool_doku/db/sql/db_version_insert.sql (revision 0) +++ lams_tool_doku/db/sql/db_version_insert.sql (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,2 @@ + +INSERT INTO patches VALUES ('@signature@', '@tool_version@', NOW(), 'F'); Index: lams_tool_doku/db/sql/drop_lams_tool_dokumaran.sql =================================================================== diff -u --- lams_tool_doku/db/sql/drop_lams_tool_dokumaran.sql (revision 0) +++ lams_tool_doku/db/sql/drop_lams_tool_dokumaran.sql (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,10 @@ +SET FOREIGN_KEY_CHECKS=0; +drop table if exists tl_ladoku11_dokumaran; +drop table if exists tl_ladoku11_session; +drop table if exists tl_ladoku11_user; +SET FOREIGN_KEY_CHECKS=1; + + + + + Index: lams_tool_doku/db/sql/library_insert.sql =================================================================== diff -u --- lams_tool_doku/db/sql/library_insert.sql (revision 0) +++ lams_tool_doku/db/sql/library_insert.sql (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,18 @@ +# Connection: ROOT LOCAL +# Host: localhost +# Saved: 2005-04-07 10:50:55 +# +INSERT INTO lams_learning_library +( +description, +title, +valid_flag, +create_date_time +) +VALUES +( +'Collaborative real-time document editor. ', +'doKumaran', +0, +NOW() +) Index: lams_tool_doku/db/sql/table-schema.sql =================================================================== diff -u --- lams_tool_doku/db/sql/table-schema.sql (revision 0) +++ lams_tool_doku/db/sql/table-schema.sql (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1 @@ \ No newline at end of file Index: lams_tool_doku/db/sql/tool_insert.sql =================================================================== diff -u --- lams_tool_doku/db/sql/tool_insert.sql (revision 0) +++ lams_tool_doku/db/sql/tool_insert.sql (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,56 @@ +# Connection: ROOT LOCAL +# Host: localhost +# Saved: 2005-04-07 10:42:43 +# +INSERT INTO lams_tool +( +tool_signature, +service_name, +tool_display_name, +description, +tool_identifier, +tool_version, +learning_library_id, +default_tool_content_id, +valid_flag, +grouping_support_type_id, +supports_run_offline_flag, +learner_url, +learner_preview_url, +learner_progress_url, +author_url, +monitor_url, +define_later_url, +pedagogical_planner_url, +help_url, +language_file, +create_date_time, +modified_date_time, +admin_url +) +VALUES +( +'ladoku11', +'dokumaranService', +'doKumaran', +'Collaborative real-time document editor', +'dokumaran', +'@tool_version@', +NULL, +NULL, +0, +2, +1, +'tool/ladoku11/learning/start.do?mode=learner', +'tool/ladoku11/learning/start.do?mode=author', +'tool/ladoku11/learning/start.do?mode=teacher', +'tool/ladoku11/authoring/start.do', +'tool/ladoku11/monitoring/summary.do', +'tool/ladoku11/definelater.do', +NULL, +'http://wiki.lamsfoundation.org/display/lamsdocs/ladoku11', +'org.lamsfoundation.lams.tool.dokumaran.ApplicationResources', +NOW(), +NOW(), +'tool/ladoku11/ladoku11admin.do' +) Index: lams_tool_doku/src/java/net/gjerull/etherpad/client/EPLiteClient.java =================================================================== diff -u --- lams_tool_doku/src/java/net/gjerull/etherpad/client/EPLiteClient.java (revision 0) +++ lams_tool_doku/src/java/net/gjerull/etherpad/client/EPLiteClient.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,865 @@ +package net.gjerull.etherpad.client; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * A client for talking to Etherpad Lite's HTTP JSON API.
+ *
+ * Example:
+ *
+ * + * EPLiteClient api = new EPLiteClient("http://etherpad.mysite.com", "FJ7jksalksdfj83jsdflkj");
+ * Map pad = api.getText("my_pad");
+ * String pad = pad.get("text").toString(); + *
+ */ +public class EPLiteClient { + /** + * The Etherpad Lite API version this client targets by default + */ + public static final String DEFAULT_API_VERSION = "1.2.12"; + + /** + * The connection object + */ + public EPLiteConnection connection; + + /** + * Initializes a new net.gjerull.etherpad.client.EPLiteClient object. + * The default Etherpad Lite API version (in DEFAULT_API_VERSION) will be used. + * + * @param url an absolute url, including protocol, to the EPL api + * @param apiKey the API Key + */ + public EPLiteClient(String url, String apiKey) { + this.connection = new EPLiteConnection(url, apiKey, DEFAULT_API_VERSION); + } + + /** + * Initializes a new net.gjerull.etherpad.client.EPLiteClient object. + * The specified Etherpad Lite API version will be used. + * + * @param url an absolute url, including protocol, to the EPL api + * @param apiKey the API Key + * @param apiVersion the API version + */ + public EPLiteClient(String url, String apiKey, String apiVersion) { + this.connection = new EPLiteConnection(url, apiKey, apiVersion); + } + + // Groups + // Pads may belong to a group. These pads are not considered "public", and won't be available through the Web UI without a session. + + /** + * Creates a new Group. The group id is returned in "groupID" in the Map. + * + * @return Map with groupID + */ + public Map createGroup() { + return this.connection.post("createGroup"); + } + + /** + * Creates a new Group for groupMapper if one doesn't already exist. Helps you map your application's groups to Etherpad Lite's groups. + * The group id is returned in "groupID" in the Map. + * + * @param groupMapper your group mapper string + * @return Map with groupID + */ + public Map createGroupIfNotExistsFor(String groupMapper) { + Map args = new HashMap<>(); + args.put("groupMapper", groupMapper); + return this.connection.post("createGroupIfNotExistsFor", args); + } + + /** + * Delete group. + * + * @param groupID string + */ + public void deleteGroup(String groupID) { + Map args = new HashMap<>(); + args.put("groupID", groupID); + this.connection.post("deleteGroup", args); + } + + /** + * List all the padIDs in a group. They will be in an array inside "padIDs". + * + * @param groupID string + * @return Map + */ + public Map listPads(String groupID) { + Map args = new HashMap<>(); + args.put("groupID", groupID); + return this.connection.get("listPads", args); + } + + /** + * Create a pad in this group. + * + * @param groupID the group the pad belongs to + * @param padName name of the pad + */ + public Map createGroupPad(String groupID, String padName) { + Map args = new HashMap<>(); + args.put("groupID", groupID); + args.put("padName", padName); + return this.connection.post("createGroupPad", args); + } + + /** + * Create a pad in this group, with initial text. + * + * @param groupID the group the pad belongs to + * @param padName name of the pad + * @param text Initial text in the pad + */ + public Map createGroupPad(String groupID, String padName, String text) { + Map args = new HashMap<>(); + args.put("groupID", groupID); + args.put("padName", padName); + args.put("text", text); + return this.connection.post("createGroupPad", args); + } + + /** + * Lists all existing groups. The group ids are returned in "groupIDs". + * + * @return Map with list of groupIDs + */ + public Map listAllGroups() { + return this.connection.get("listAllGroups"); + } + + // Authors + // These authors are bound to the attributes the users choose (color and name). The author id is returned in "authorID". + + /** + * Create a new author. + * + * @return Map with authorID + */ + public Map createAuthor() { + return this.connection.get("createAuthor"); + } + + /** + * Create a new author with the given name. The author id is returned in "authorID". + * + * @param name string + * @return Map with authorID + */ + public Map createAuthor(String name) { + Map args = new HashMap<>(); + args.put("name", name); + return this.connection.post("createAuthor", args); + } + + /** + * Creates a new Author for authorMapper if one doesn't already exist. Helps you map your application's authors to Etherpad Lite's authors. + * The author id is returned in "authorID". + * + * @param authorMapper string + * @return Map with authorID + */ + public Map createAuthorIfNotExistsFor(String authorMapper) { + Map args = new HashMap<>(); + args.put("authorMapper", authorMapper); + return this.connection.post("createAuthorIfNotExistsFor", args); + } + + /** + * Creates a new Author for authorMapper if one doesn't already exist. Helps you map your application's authors to Etherpad Lite's authors. + * The author id is returned in "authorID". + * + * @param authorMapper string + * @param name string + * @return Map with authorID + */ + public Map createAuthorIfNotExistsFor(String authorMapper, String name) { + Map args = new HashMap<>(); + args.put("authorMapper", authorMapper); + args.put("name", name); + return this.connection.post("createAuthorIfNotExistsFor", args); + } + + /** + * List the ids of pads the author has edited. They will be in an array inside "padIDs". + * + * @param authorId the authors's id string + * @return Map + */ + public Map listPadsOfAuthor(String authorId) { + Map args = new HashMap<>(); + args.put("authorID", authorId); + return this.connection.get("listPadsOfAuthor", args); + } + + /** + * Returns the Author Name of the author. + * + * @param authorId the author's id string + * @return authorName + */ + public String getAuthorName(String authorId) { + Map args = new HashMap<>(); + args.put("authorID", authorId); + return (String) this.connection.getObject("getAuthorName", args); + } + + // Sessions + // Sessions can be created between a group and an author. This allows an author to access more than one group. The sessionID will be set as a + // cookie to the client and is valid until a certain date. Only users with a valid session for this group, can access group pads. You can create a + // session after you authenticated the user at your web application, to give them access to the pads. You should save the sessionID of this session + // and delete it after the user logged out. + + /** + * Create a new session for the given author in the given group, valid until the given UNIX time. + *
+ * Example:
+ *
+ * + * import java.util.Date;
+ * ...
+ * Date now = new Date();
+ * long in1Hour = (now.getTime() + (60L * 60L * 1000L) / 1000L);
+ * String sessID1 = api.createSession(groupID, authorID, in1Hour); + *
+ * + * @param groupID string + * @param authorID string + * @param validUntil long UNIX timestamp in seconds + * @return Map with sessionID + */ + public Map createSession(String groupID, String authorID, long validUntil) { + Map args = new HashMap<>(); + args.put("groupID", groupID); + args.put("authorID", authorID); + args.put("validUntil", String.valueOf(validUntil)); + return this.connection.post("createSession", args); + } + + /** + * Create a new session for the given author in the given group valid for the given number of hours. + *
+ * Example:
+ *
+ * + * // in 2 hours
+ * String sessID1 = api.createSession(groupID, authorID, 2); + *
+ * + * @param groupID string + * @param authorID string + * @param sessionDuration int duration of session in hours + * @return Map with sessionID + */ + public Map createSession(String groupID, String authorID, int sessionDuration) { + long inNHours = ((new Date()).getTime() + ((long)sessionDuration * 60L * 60L * 1000L)) / 1000L; + return this.createSession(groupID, authorID, inNHours); + } + + /** + * Create a new session for the given author in the given group, valid until the given datetime. + *
+ * Example:
+ *
+ * + * import java.util.Date;
+ * import java.text.DateFormat;
+ * import java.text.SimpleDateFormat;
+ * import java.util.TimeZone;
+ * ...
+ * DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ * dfm.setTimeZone(TimeZone.getTimeZone("GMT-5"));
+ * Date longTime = dfm.parse("2056-01-15 20:15:00");
+ * String sessID = api.createSession(groupID, authorID, longTime); + *
+ * + * @param groupID string + * @param authorID string + * @param validUntil Date + * @return Map with sessionID + */ + public Map createSession(String groupID, String authorID, Date validUntil) { + long seconds = validUntil.getTime() / 1000L; + return this.createSession(groupID, authorID, seconds); + } + + /** + * Delete a session. + * + * @param sessionID string + */ + public void deleteSession(String sessionID) { + Map args = new HashMap<>(); + args.put("sessionID", sessionID); + this.connection.post("deleteSession", args); + } + + /** + * Returns information about a session: authorID, groupID and validUntil. + * + * @param sessionID string + * @return Map + */ + public Map getSessionInfo(String sessionID) { + Map args = new HashMap<>(); + args.put("sessionID", sessionID); + return this.connection.get("getSessionInfo", args); + } + + /** + * List all the sessions IDs in a group. Returned as a Map of sessionIDs keys, with values of Maps containing + * groupID, authorID, and validUntil. + * + * @param groupID string + * @return Map + */ + public Map listSessionsOfGroup(String groupID) { + Map args = new HashMap<>(); + args.put("groupID", groupID); + return this.connection.get("listSessionsOfGroup", args); + } + + /** + * List all the sessions IDs belonging to an author. Returned as a Map of sessionIDs keys, with values of Maps containing + * groupID, authorID, and validUntil. + * + * @param authorID string + * @return Map + */ + public Map listSessionsOfAuthor(String authorID) { + Map args = new HashMap<>(); + args.put("authorID", authorID); + return this.connection.get("listSessionsOfAuthor", args); + } + + // Pad content + + /** + * Returns a Map containing the latest revision of the pad's text. + * The text is stored under "text". + * + * @param padId the pad's id string + * @return a Map with the text content of pad + */ + public Map getText(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getText", args); + } + + /** + * Returns a Map containing the a specific revision of the pad's text. + * The text is stored under "text". + * + * @param padId the pad's id string + * @param rev the revision number + * @return a Map with the text content of pad in given revision + */ + public Map getText(String padId, long rev) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("rev", rev); + return this.connection.get("getText", args); + } + + /** + * Creates a new revision with the given text (or creates a new pad). + * + * @param padId the pad's id string + * @param text the pad's new text + */ + public void setText(String padId, String text) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("text", text); + this.connection.post("setText", args); + } + + /** + * Returns a Map containing the current revision of the pad's text as HTML. + * The html is stored under "html". + * + * @param padId the pad's id string + * @return a Map with the HTML content of pad + */ + public Map getHTML(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getHTML", args); + } + + /** + * Returns a Map containing the a specific revision of the pad's text as HTML. + * The html is stored under "html". + * + * @param padId the pad's id string + * @param rev the revision number + * @return a Map with the HTML content of pad in given revision + */ + public Map getHTML(String padId, long rev) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("rev", rev); + return this.connection.get("getHTML", args); + } + + /** + * Creates a new revision with the given html (or creates a new pad). + * + * @param padId the pad's id string + * @param html the pad's new html text + */ + public void setHTML(String padId, String html) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("html", html); + this.connection.post("setHTML", args); + } + + /** + * Returns the attribute pool of a pad + * + * API >= 1.2.8 + * + * @param padId the pad's id string + * @return a Map with the attribute pool of a pad + */ + public Map getAttributePool(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getAttributePool", args); + } + + /** + * Get the changeset at the last revision. + * + * API >= 1.2.8 + * + * @param padId the pad's id string + * @return the changeset at the last revision. + */ + public String getRevisionChangeset(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return (String) this.connection.getObject("getRevisionChangeset", args); + } + + /** + * Get the changeset at a given revision. + * + * API >= 1.2.8 + * + * @param padId the pad's id string + * @param rev the revision number + * @return the changeset at a given revision. + */ + public String getRevisionChangeset(String padId, long rev) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("rev", rev); + return (String) this.connection.getObject("getRevisionChangeset", args); + } + + /** + * Returns an object of diffs from 2 points in a pad + * + * API >= 1.2.7 + * + * @param padId the pad's id string + * @param startRev the start revision number + * @param endRev the end revision number + * @return a Map of diffs from 2 points in a pad + */ + public Map createDiffHTML(String padId, long startRev, long endRev) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("startRev", startRev); + args.put("endRev", endRev); + return this.connection.get("createDiffHTML", args); + } + + // Chat + + /** + * Returns the complete chat history of pad + * + * API >= 1.2.7 + * + * @param padId the pad's id string + * @return the whole chat histroy + */ + public Map getChatHistory(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getChatHistory", args); + } + + /** + * Returns the chat history of pad with index between start and end + * + * API >= 1.2.7 + * + * @param padId the pad's id string + * @param start the start index + * @param end the end index + * @return a part of the chat history, between start and end + */ + public Map getChatHistory(String padId, long start, long end) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("start", start); + args.put("end", end); + return this.connection.get("getChatHistory", args); + } + + /** + * Returns the chatHead (last number of the last chat-message) of the pad + * + * API >= 1.2.7 + * + * @param padId the pad's id string + * @return the last number of the last chat-message + */ + public Map getChatHead(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getChatHead", args); + } + + // Pads + // Group pads are normal pads, but with the name schema GROUPID$PADNAME. A security manager controls access of them and its + // forbidden for normal pads to include a $ in the name. + + /** + * Returns a list of all pads. + * + * @return a Map with list of pad id's + */ + public Map listAllPads() { + return this.connection.get("listAllPads"); + } + + /** + * Create a new pad. + * + * @param padId the pad's id string + */ + public void createPad(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + this.connection.post("createPad", args); + } + + /** + * Create a new pad with the given initial text. + * + * @param padId the pad's id string + * @param text the initial text string + */ + public void createPad(String padId, String text) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("text", text); + this.connection.post("createPad", args); + } + + /** + * Returns the number of revisions of this pad. The number is in "revisions". + * + * @param padId the pad's id string + * @return a Map with the number of revisions + */ + public Map getRevisionsCount(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getRevisionsCount", args); + } + + /** + * Returns the number of saved revisions of this pad + * + * API >= 1.2.11 + * + * @param padId the pad's id string + * @return a Map with number of saved revisions + */ + public Map getSavedRevisionsCount(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getSavedRevisionsCount", args); + } + + /** + * returns the list of saved revisions of this pad + * + * API >= 1.2.11 + * + * @param padId the pad's id string + * @return a Map with the list of saved revision numbers + */ + public Map listSavedRevisions(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("listSavedRevisions", args); + } + + /** + * Saves the latest revision + * + * API >= 1.2.11 + * + * @param padId the pad's id string + */ + public void saveRevision(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + this.connection.post("saveRevision", args); + } + + /** + * Saves the given revision + * + * API >= 1.2.11 + * + * @param padId the pad's id string + * @param rev the revision to be saved + */ + public void saveRevision(String padId, long rev) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("rev", rev); + this.connection.post("saveRevision", args); + } + + /** + * Get the number of users currently editing a pad. + * + * @param padId the pad's id string + * @return a Map with the padUsersCount + */ + public Map padUsersCount(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("padUsersCount", args); + } + + /** + * Returns the list of users that are currently editing this pad. + * A padUser has the values: "colorId", "name" and "timestamp". + * + * @param padId the pad's id string + * @return a Map with a List of pad user maps + */ + public Map padUsers(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("padUsers", args); + } + + /** + * Deletes a pad. + * + * @param padId the pad's id string + */ + public void deletePad(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + this.connection.post("deletePad", args); + } + + /** + * Copies a pad with full history and chat. If the destination exists the copy will fail. + * + * API >= 1.2.8 + * + * @param sourcePadId the id of the source pad + * @param destinationPadId the id of the destination pad + */ + public void copyPad(String sourcePadId, String destinationPadId) { + copyPad(sourcePadId, destinationPadId, false); + } + + /** + * Copies a pad with full history and chat. + * + * API >= 1.2.8 + * + * @param sourcePadId the id of the source pad + * @param destinationPadId the id of the destination pad + * @param force if force is true and the destination pad exists, it will be overwritten. + */ + public void copyPad(String sourcePadId, String destinationPadId, boolean force) { + Map args = new HashMap<>(); + args.put("sourceID", sourcePadId); + args.put("destinationID", destinationPadId); + args.put("force", force); + this.connection.post("copyPad", args); + } + + /** + * Moves a pad. If the destination exists the copy will fail. + * + * API >= 1.2.8 + * + * @param sourcePadId the id of the source pad + * @param destinationPadId the id of the destination pad + */ + public void movePad(String sourcePadId, String destinationPadId) { + copyPad(sourcePadId, destinationPadId, false); + } + + /** + * Moves a pad. + * + * API >= 1.2.8 + * + * @param sourcePadId the id of the source pad + * @param destinationPadId the id of the destination pad + * @param force if force is true and the destination pad exists, it will be overwritten. + */ + public void movePad(String sourcePadId, String destinationPadId, boolean force) { + Map args = new HashMap<>(); + args.put("sourceID", sourcePadId); + args.put("destinationID", destinationPadId); + args.put("force", force); + this.connection.post("movePad", args); + } + + /** + * Get the pad's read-only id. + * + * @param padId the pad's id string + * @return a Map with the readOnlyID + */ + public Map getReadOnlyID(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getReadOnlyID", args); + } + + /** + * Get the pad's id from the read only id + * + * API >= 1.2.10 + * + * @param readOnlyPadId the pad's read only id string + * @return a Map with the padID + */ + public Map getPadID(String readOnlyPadId) { + Map args = new HashMap<>(); + args.put("roID", readOnlyPadId); + return this.connection.get("getPadID", args); + } + + /** + * Sets the pad's public status. + * This is only applicable to group pads. + * + * @param padId the pad's id string + * @param publicStatus boolean + */ + public void setPublicStatus(String padId, Boolean publicStatus) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("publicStatus", publicStatus); + this.connection.post("setPublicStatus", args); + } + + /** + * Gets the pad's public status. + * + * @param padId the pad's id string + * @return a Map with the Boolean publicStatus + */ + public Map getPublicStatus(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getPublicStatus", args); + } + + /** + * Sets the pad's password. This is only applicable to group pads. + * + * @param padId the pad's id string + * @param password string + */ + public void setPassword(String padId, String password) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("password", password); + this.connection.post("setPassword", args); + } + + /** + * Checks whether the pad is password-protected or not. + * + * @param padId the pad's id string + * @return a Map with the Boolean passwordProtection + */ + public Map isPasswordProtected(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("isPasswordProtected", args); + } + + /** + * List the ids of authors who have edited a pad. + * + * @param padId the pad's id string + * @return a Map with a List of author ids + */ + public Map listAuthorsOfPad(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("listAuthorsOfPad", args); + } + + /** + * Get the pad's last edit date. + * + * @param padId the pad's id string + * @return a Map with lastEdited timestamp. + */ + public Map getLastEdited(String padId) { + Map args = new HashMap<>(); + args.put("padID", padId); + return this.connection.get("getLastEdited", args); + } + + /** + * Sends a custom message of type msg to the pad. + * + * @param padId the pad's id string + * @param msg the message to send + */ + public void sendClientsMessage(String padId, String msg) { + Map args = new HashMap<>(); + args.put("padID", padId); + args.put("msg", msg); + this.connection.post("sendClientsMessage", args); + } + + /** + * Runs without error if current api token is valid + * + * API >= 1.2 + */ + public void checkToken() { + this.connection.get("checkToken"); + } + + /** + * Returns true if the connection is using SSL/TLS, false if not. + * + * @return boolean + */ + public boolean isSecure() { + return (this.connection.uri.getPort() == 443); + } +} Index: lams_tool_doku/src/java/net/gjerull/etherpad/client/EPLiteConnection.java =================================================================== diff -u --- lams_tool_doku/src/java/net/gjerull/etherpad/client/EPLiteConnection.java (revision 0) +++ lams_tool_doku/src/java/net/gjerull/etherpad/client/EPLiteConnection.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,301 @@ +package net.gjerull.etherpad.client; + +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; + +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + +/** + * Connection object for talking to and parsing responses from the Etherpad Lite Server. + */ +public class EPLiteConnection { + public static final int CODE_OK = 0; + public static final int CODE_INVALID_PARAMETERS = 1; + public static final int CODE_INTERNAL_ERROR = 2; + public static final int CODE_INVALID_METHOD = 3; + public static final int CODE_INVALID_API_KEY = 4; + + /** + * The url of the API + */ + public final URI uri; + + /** + * The API key + */ + public final String apiKey; + + /** + * The Etherpad Lite API version + */ + public final String apiVersion; + + /** + * Initializes a new net.gjerull.etherpad.client.EPLiteConnection object. + * + * @param url an absolute url, including protocol, to the EPL api + * @param apiKey the API Key + * @param apiVersion the API version + */ + public EPLiteConnection(String url, String apiKey, String apiVersion) { + if (url.endsWith("/")) { + url = url.substring(0, url.length()-1); + } + this.uri = URI.create(url); + this.apiKey = apiKey; + this.apiVersion = apiVersion; + } + + /** + * GETs from the HTTP JSON API. + * + * @param apiMethod the name of the API method to call + * @return Object + */ + public Object getObject(String apiMethod) { + return this.getObject(apiMethod, new HashMap()); + } + + /** + * GETs from the HTTP JSON API. + * + * @param apiMethod the name of the API method to call + * @return Map + */ + public Map get(String apiMethod) { + Map response = (Map) this.getObject(apiMethod); + return (response != null) ? response : new HashMap(); + } + + /** + * GETs from the HTTP JSON API. + * + * @param apiMethod the name of the API method to call + * @param apiArgs a HashMap of url/form parameters. apikey will be set automatically + * @return Object + */ + public Object getObject(String apiMethod, Map apiArgs) { + String path = this.apiPath(apiMethod); + String query = this.queryString(apiArgs); + URL url = apiUrl(path, query); + Request request = new GETRequest(url); + return this.call(request); + } + + /** + * GETs from the HTTP JSON API. + * + * @param apiMethod the name of the API method to call + * @param apiArgs a HashMap of url/form parameters. apikey will be set automatically + * @return Map + */ + public Map get(String apiMethod, Map apiArgs) { + Map response = (Map) this.getObject(apiMethod, apiArgs); + return (response != null) ? response : new HashMap(); + } + + /** + * POSTs to the HTTP JSON API. + * + * @param apiMethod the name of the API method to call + * @return Object + */ + public Object postObject(String apiMethod) { + return this.postObject(apiMethod, new HashMap()); + } + + /** + * POSTs to the HTTP JSON API. + * + * @param apiMethod the name of the API method to call + * @return Map + */ + public Map post(String apiMethod) { + Map response = (Map) this.postObject(apiMethod); + return (response != null) ? response : new HashMap(); + } + + /** + * POSTs to the HTTP JSON API. + * + * @param apiMethod the name of the API method to call + * @param apiArgs a HashMap of url/form parameters. apikey will be set automatically + * @return Object + */ + public Object postObject(String apiMethod, Map apiArgs) { + String path = this.apiPath(apiMethod); + String query = this.queryString(apiArgs); + URL url = apiUrl(path, null); + Request request = new POSTRequest(url, query); + return this.call(request); + } + + /** + * POSTs to the HTTP JSON API. + * + * @param apiMethod the name of the API method to call + * @param apiArgs a HashMap of url/form parameters. apikey will be set automatically + * @return Map + */ + public Map post(String apiMethod, Map apiArgs) { + Map response = (Map) this.postObject(apiMethod, apiArgs); + return (response != null) ? response : new HashMap(); + } + + /** + * Handle error condition and returns the parsed content + * + * @param jsonString a valid JSON string + * @return Object + */ + protected Object handleResponse(String jsonString) { + try { + JSONParser parser = new JSONParser(); + Map response = (Map) parser.parse(jsonString); + // Act on the response code + if (response.get("code") != null) { + int code = ((Long) response.get("code")).intValue(); + switch ( code ) { + // Valid code, parse the response + case CODE_OK: + return response.get("data"); + // Invalid code, throw an exception with the message + case CODE_INVALID_PARAMETERS: + case CODE_INTERNAL_ERROR: + case CODE_INVALID_METHOD: + case CODE_INVALID_API_KEY: + throw new EPLiteException((String)response.get("message")); + default: + throw new EPLiteException("An unknown error has occurred while handling the response: " + jsonString); + } + // No response code, something's really wrong + } else { + throw new EPLiteException("An unexpected response from the server: " + jsonString); + } + } catch (ParseException e) { + throw new EPLiteException("Unable to parse JSON response (" + jsonString + ")", e); + } + } + + /** + * Returns the URL for the api path and query. + * + * @param path the api path + * @param query the query string (may be null) + * @return URL + */ + protected URL apiUrl(String path, String query) { + try { + return new URL(new URI(this.uri.getScheme(), null, this.uri.getHost(), this.uri.getPort(), path, query, null).toString()); + } catch (MalformedURLException | URISyntaxException e) { + throw new EPLiteException("Error in the URL to the Etherpad Lite instance (" + e.getClass() + "): " + e.getMessage()); + } + } + + /** + * Returns a URI path for the API method + * + * @param apiMethod the api method + * @return String + */ + protected String apiPath(String apiMethod) { + return this.uri.getPath() + "/api/" + this.apiVersion + "/" + apiMethod; + } + + /** + * Returns a query string made from HashMap keys and values + * + * @param apiArgs the api arguments in a HashMap + * @return String + */ + protected String queryString(Map apiArgs) { + String strArgs = ""; + apiArgs.put("apikey", this.apiKey); + Iterator i = apiArgs.entrySet().iterator(); + while (i.hasNext()) { + Map.Entry e = (Map.Entry)i.next(); + Object value = e.getValue(); + if (value != null) { + strArgs += e.getKey() + "=" + value; + if (i.hasNext()) { + strArgs += "&"; + } + } + } + return strArgs; + } + + /** + * Calls the HTTP JSON API. + * + * @param request the request object to send + * @return HashMap + */ + private Object call(Request request) { + trustServerAndCertificate(); + + try { + String response = request.send(); + return this.handleResponse(response); + } + catch (EPLiteException e) { + throw e; + } + catch (Exception e) { + throw new EPLiteException("Unable to connect to Etherpad Lite instance (" + e.getClass() + "): " + e.getMessage()); + } + } + + /** + * Creates a trust manager to trust all certificates if you open a ssl connection + */ + private void trustServerAndCertificate() { + // Create a trust manager that does not validate certificate chains + TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return null; + } + + public void checkClientTrusted( + java.security.cert.X509Certificate[] certs, String authType) { + } + + public void checkServerTrusted( + java.security.cert.X509Certificate[] certs, String authType) { + } + } + }; + + // Install the all-trusting trust manager + try { + SSLContext sc = SSLContext.getInstance("SSL"); + sc.init(null, trustAllCerts, new java.security.SecureRandom()); + HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); + } catch (NoSuchAlgorithmException | KeyManagementException e) { + throw new EPLiteException("Unable to create SSL context", e); + } + + HostnameVerifier hv = new HostnameVerifier() { + //@Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + HttpsURLConnection.setDefaultHostnameVerifier(hv); + } +} Index: lams_tool_doku/src/java/net/gjerull/etherpad/client/EPLiteException.java =================================================================== diff -u --- lams_tool_doku/src/java/net/gjerull/etherpad/client/EPLiteException.java (revision 0) +++ lams_tool_doku/src/java/net/gjerull/etherpad/client/EPLiteException.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,11 @@ +package net.gjerull.etherpad.client; + +public class EPLiteException extends RuntimeException { + public EPLiteException(String message) { + super(message); + } + + public EPLiteException(String message, Throwable cause) { + super(message, cause); + } +} Index: lams_tool_doku/src/java/net/gjerull/etherpad/client/GETRequest.java =================================================================== diff -u --- lams_tool_doku/src/java/net/gjerull/etherpad/client/GETRequest.java (revision 0) +++ lams_tool_doku/src/java/net/gjerull/etherpad/client/GETRequest.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,44 @@ +package net.gjerull.etherpad.client; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; + +/** + * A class for easily executing an HTTP GET request.
+ *
+ * Example:
+ *
+ * + * Request req = new GETRequest(url_object);
+ * String resp = req.send();
+ *
+ */ +public class GETRequest implements Request { + private final URL url; + + /** + * Instantiates a new GETRequest. + * + * @param url the URL object + */ + public GETRequest(URL url) { + this.url = url; + } + + /** + * Sends the request and returns the response. + * + * @return String + */ + public String send() throws Exception { + BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); + String response = ""; + String buffer; + while ((buffer = in.readLine()) != null) { + response += buffer; + } + in.close(); + return response; + } +} Index: lams_tool_doku/src/java/net/gjerull/etherpad/client/POSTRequest.java =================================================================== diff -u --- lams_tool_doku/src/java/net/gjerull/etherpad/client/POSTRequest.java (revision 0) +++ lams_tool_doku/src/java/net/gjerull/etherpad/client/POSTRequest.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,56 @@ +package net.gjerull.etherpad.client; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.net.URL; +import java.net.URLConnection; + +/** + * A class for easily executing an HTTP POST request.
+ *
+ * Example:
+ *
+ * + * Request req = new POSTRequest(url_object);
+ * String resp = req.send();
+ *
+ */ +public class POSTRequest implements Request { + private final URL url; + private final String body; + + /** + * Instantiates a new POSTRequest. + * + * @param url the URL object + * @param body url-encoded (application/x-www-form-urlencoded) request body + */ + public POSTRequest(URL url, String body) { + this.url = url; + this.body = body; + } + + /** + * Sends the request and returns the response. + * + * @return String + */ + public String send() throws Exception { + URLConnection con = this.url.openConnection(); + con.setDoOutput(true); + + OutputStreamWriter out = new OutputStreamWriter(con.getOutputStream()); + out.write(this.body); + out.close(); + + BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); + String response = ""; + String buffer; + while ((buffer = in.readLine()) != null) { + response += buffer; + } + in.close(); + return response; + } +} Index: lams_tool_doku/src/java/net/gjerull/etherpad/client/Request.java =================================================================== diff -u --- lams_tool_doku/src/java/net/gjerull/etherpad/client/Request.java (revision 0) +++ lams_tool_doku/src/java/net/gjerull/etherpad/client/Request.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,5 @@ +package net.gjerull.etherpad.client; + +public interface Request { + String send() throws Exception; +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/DokumaranConstants.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/DokumaranConstants.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/DokumaranConstants.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,117 @@ +/**************************************************************** + * 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.dokumaran; + +public class DokumaranConstants { + public static final String TOOL_SIGNATURE = "ladoku11"; + + public static final String RESOURCE_SERVICE = "dokumaranService"; + + public static final String TOOL_CONTENT_HANDLER_NAME = "dokumaranToolContentHandler"; + + 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_DOKUMARAN = "dokumaran"; + + public static final String ATTR_GROUP_USERS = "groupUsers"; + + public static final String ATTR_IS_LEADER_RESPONSE_FINALIZED = "isLeaderResponseFinalized"; + + public static final String ATTR_GROUP_LEADER = "groupLeader"; + + public static final String ATTR_NEXT_ACTIVITY_URL = "nextActivityUrl"; + + public static final String ATTR_SUMMARY_LIST = "summaryList"; + + public static final String ATTR_USER_LIST = "userList"; + + public static final String ATTR_FINISH_LOCK = "finishedLock"; + + public static final String ATTR_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 = "dokumaranForm"; + + 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_PAD_ID = "padId"; + + public static final String KEY_ETHERPAD_SERVER_URL = "etherpadServerUrl"; + + public static final String PAD_ID_PREFIX = "LAMS-sessionId-"; + + // 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 SHARED_ITEMS_DEFINITION_NAME = "shared.items.output.definition.dokumaran"; +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DAO.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DAO.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DAO.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,77 @@ +/**************************************************************** + * 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.dokumaran.dao; + +import java.io.Serializable; +import java.util.List; + +/** + * Data Access Object (DAO) interface. This is an interface + * used to tag our DAO classes and to provide common methods to all DAOs. + * + * @author Dapeng.Ni + */ +public interface DAO { + + /** + * Generic method used to get all objects of a particular type. This + * is the same as lookup up all rows in a table. + * + * @param clazz + * the type of objects (a.k.a. while table) to get data from + * @return List of populated objects + */ + public List getObjects(Class clazz); + + /** + * Generic method to get an object based on class and identifier. An + * ObjectRetrievalFailureException Runtime Exception is thrown if + * nothing is found. + * + * @param clazz + * model class to lookup + * @param id + * the identifier (primary key) of the class + * @return a populated object + */ + public Object getObject(Class clazz, Serializable id); + + /** + * Generic method to save an object - handles both update and insert. + * + * @param o + * the object to save + */ + public void saveObject(Object o); + + /** + * Generic method to delete an object based on class and id + * + * @param clazz + * model class to lookup + * @param id + * the identifier (primary key) of the class + */ + public void removeObject(Class clazz, Serializable id); +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranConfigItemDAO.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranConfigItemDAO.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranConfigItemDAO.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,10 @@ +package org.lamsfoundation.lams.tool.dokumaran.dao; + +import org.lamsfoundation.lams.dao.IBaseDAO; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranConfigItem; + +public interface DokumaranConfigItemDAO extends IBaseDAO { + void saveOrUpdate(DokumaranConfigItem toConfig); + + public DokumaranConfigItem getConfigItemByKey(final String configKey); +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranDAO.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranDAO.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranDAO.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,36 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.dokumaran.dao; + +import org.lamsfoundation.lams.tool.dokumaran.model.Dokumaran; + +public interface DokumaranDAO extends DAO { + + Dokumaran getByContentId(Long contentId); + + Dokumaran getByUid(Long dokumaranUid); + + void delete(Dokumaran dokumaran); + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranSessionDAO.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranSessionDAO.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranSessionDAO.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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.dokumaran.dao; + +import java.util.List; + +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranSession; + +public interface DokumaranSessionDAO extends DAO { + + DokumaranSession getSessionBySessionId(Long sessionId); + + List getByContentId(Long toolContentId); + + void delete(DokumaranSession session); + + void deleteBySessionId(Long toolSessionId); + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranUserDAO.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranUserDAO.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/DokumaranUserDAO.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,37 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.dokumaran.dao; + +import java.util.List; + +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranUser; + +public interface DokumaranUserDAO extends DAO { + + DokumaranUser getUserByUserIDAndSessionID(Long userID, Long sessionId); + + DokumaranUser getUserByUserIDAndContentID(Long userId, Long contentId); + + List getBySessionID(Long sessionId); +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranConfigItemDAOHibernate.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranConfigItemDAOHibernate.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranConfigItemDAOHibernate.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,24 @@ +package org.lamsfoundation.lams.tool.dokumaran.dao.hibernate; + +import org.lamsfoundation.lams.dao.hibernate.LAMSBaseDAO; +import org.lamsfoundation.lams.tool.dokumaran.dao.DokumaranConfigItemDAO; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranConfigItem; +import org.springframework.stereotype.Repository; + +@Repository +public class DokumaranConfigItemDAOHibernate extends LAMSBaseDAO implements DokumaranConfigItemDAO { + private static final String LOAD_CONFIG_ITEM_BY_KEY = "from DokumaranConfigItem configuration" + + " where configuration.configKey=:key"; + + @Override + public DokumaranConfigItem getConfigItemByKey(final String configKey) { + return (DokumaranConfigItem) getSession().createQuery(LOAD_CONFIG_ITEM_BY_KEY).setString("key", configKey) + .uniqueResult(); + } + + @Override + public void saveOrUpdate(DokumaranConfigItem mdlForumConfigItem) { + getSession().saveOrUpdate(mdlForumConfigItem); + getSession().flush(); + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranDAOHibernate.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranDAOHibernate.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranDAOHibernate.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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 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.dokumaran.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.dao.hibernate.LAMSBaseDAO; +import org.lamsfoundation.lams.tool.dokumaran.dao.DokumaranDAO; +import org.lamsfoundation.lams.tool.dokumaran.model.Dokumaran; +import org.springframework.stereotype.Repository; + +/** + * + * @author Steve.Ni + * + * @version $Revision$ + */ +@Repository +public class DokumaranDAOHibernate extends LAMSBaseDAO implements DokumaranDAO { + private static final String GET_RESOURCE_BY_CONTENTID = "from " + Dokumaran.class.getName() + + " as r where r.contentId=?"; + + @Override + public Dokumaran getByContentId(Long contentId) { + List list = doFind(GET_RESOURCE_BY_CONTENTID, contentId); + if (list.size() > 0) { + return (Dokumaran) list.get(0); + } else { + return null; + } + } + + @Override + public Dokumaran getByUid(Long dokumaranUid) { + return (Dokumaran) getObject(Dokumaran.class, dokumaranUid); + } + + @Override + public void delete(Dokumaran dokumaran) { + getSession().delete(dokumaran); + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranSessionDAOHibernate.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranSessionDAOHibernate.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranSessionDAOHibernate.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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.dokumaran.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.dao.hibernate.LAMSBaseDAO; +import org.lamsfoundation.lams.tool.dokumaran.dao.DokumaranSessionDAO; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranSession; +import org.springframework.stereotype.Repository; + +@Repository +public class DokumaranSessionDAOHibernate extends LAMSBaseDAO implements DokumaranSessionDAO { + + private static final String FIND_BY_SESSION_ID = "from " + DokumaranSession.class.getName() + + " as p where p.sessionId=?"; + private static final String FIND_BY_CONTENT_ID = "from " + DokumaranSession.class.getName() + + " as p where p.dokumaran.contentId=?"; + + @Override + public DokumaranSession getSessionBySessionId(Long sessionId) { + List list = doFind(FIND_BY_SESSION_ID, sessionId); + if (list == null || list.size() == 0) { + return null; + } + return (DokumaranSession) list.get(0); + } + + @Override + @SuppressWarnings("unchecked") + public List getByContentId(Long toolContentId) { + return (List) doFind(FIND_BY_CONTENT_ID, toolContentId); + } + + @Override + public void delete(DokumaranSession session) { + getSession().delete(session); + } + + @Override + public void deleteBySessionId(Long toolSessionId) { + this.removeObject(DokumaranSession.class, toolSessionId); + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranUserDAOHibernate.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranUserDAOHibernate.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dao/hibernate/DokumaranUserDAOHibernate.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,67 @@ +/**************************************************************** + * 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.dokumaran.dao.hibernate; + +import java.util.List; + +import org.lamsfoundation.lams.dao.hibernate.LAMSBaseDAO; +import org.lamsfoundation.lams.tool.dokumaran.dao.DokumaranUserDAO; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranUser; +import org.springframework.stereotype.Repository; + +@Repository +public class DokumaranUserDAOHibernate extends LAMSBaseDAO implements DokumaranUserDAO { + + private static final String FIND_BY_USER_ID_CONTENT_ID = "from " + DokumaranUser.class.getName() + + " as u where u.userId =? and u.dokumaran.contentId=?"; + private static final String FIND_BY_USER_ID_SESSION_ID = "from " + DokumaranUser.class.getName() + + " as u where u.userId =? and u.session.sessionId=?"; + private static final String FIND_BY_SESSION_ID = "from " + DokumaranUser.class.getName() + + " as u where u.session.sessionId=?"; + + @Override + public DokumaranUser getUserByUserIDAndSessionID(Long userID, Long sessionId) { + List list = this.doFind(FIND_BY_USER_ID_SESSION_ID, new Object[] { userID, sessionId }); + if (list == null || list.size() == 0) { + return null; + } + return (DokumaranUser) list.get(0); + } + + @Override + public DokumaranUser 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 (DokumaranUser) list.get(0); + } + + @Override + @SuppressWarnings("unchecked") + public List getBySessionID(Long sessionId) { + return (List) this.doFind(FIND_BY_SESSION_ID, sessionId); + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dbupdates/autopatchContext.xml =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dbupdates/autopatchContext.xml (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dbupdates/autopatchContext.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,14 @@ + + + + + + + + + + + Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dokumaranApplicationContext.xml =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dokumaranApplicationContext.xml (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dokumaranApplicationContext.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,117 @@ + + + + + + + + org.lamsfoundation.lams.tool.dokumaran.ApplicationResources + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,-java.lang.Exception + PROPAGATION_REQUIRED,+java.lang.Exception + PROPAGATION_REQUIRED,+java.lang.Exception + PROPAGATION_REQUIRED,+java.lang.Exception + PROPAGATION_REQUIRED,+java.lang.Exception + + + + + Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dto/ReflectDTO.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dto/ReflectDTO.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dto/ReflectDTO.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,80 @@ +package org.lamsfoundation.lams.tool.dokumaran.dto; + +import java.util.Date; + +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranUser; + +/** + * @author Dapeng Ni + */ +public class ReflectDTO { + private Long userUid; + private String fullName; + private String loginName; + private String reflectInstrctions; + private boolean finishReflection; + private String reflect; + private Date date; + + public ReflectDTO(DokumaranUser user) { + this.setLoginName(user.getLoginName()); + this.setFullName(user.getFirstName() + " " + user.getLastName()); + this.setUserUid(user.getUid()); + } + + public boolean isFinishReflection() { + return finishReflection; + } + + public void setFinishReflection(boolean finishReflection) { + this.finishReflection = finishReflection; + } + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public 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; + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dto/SessionDTO.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dto/SessionDTO.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/dto/SessionDTO.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,55 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + +package org.lamsfoundation.lams.tool.dokumaran.dto; + +public class SessionDTO { + + private Long sessionId; + private String sessionName; + private String padId; + + 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 getPadId() { + return padId; + } + + public void setPadId(String padId) { + this.padId = padId; + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/Dokumaran.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/Dokumaran.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/Dokumaran.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,357 @@ +/**************************************************************** + * 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.dokumaran.model; + +import java.util.Date; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.log4j.Logger; + +/** + * Dokumaran + * + * @author Andrey Balan + */ +public class Dokumaran implements Cloneable { + + private static final Logger log = Logger.getLogger(Dokumaran.class); + + // key + private Long uid; + + // tool contentID + private Long contentId; + + private String title; + + private String instructions; + + // advance + + private boolean useSelectLeaderToolOuput; + + private boolean showChat; + + private boolean showLineNumbers; + + private boolean lockWhenFinished; + + private boolean defineLater; + + private boolean contentInUse; + + // general infomation + private Date created; + + private Date updated; + + private DokumaranUser createdBy; + + private boolean reflectOnActivity; + + private String reflectInstructions; + + // ********************************************************** + // Function method for Dokumaran + // ********************************************************** + public static Dokumaran newInstance(Dokumaran defaultContent, Long contentId) { + Dokumaran toContent = new Dokumaran(); + toContent = (Dokumaran) defaultContent.clone(); + toContent.setContentId(contentId); + + // reset user info as well + if (toContent.getCreatedBy() != null) { + toContent.getCreatedBy().setDokumaran(toContent); + } + return toContent; + } + + @Override + public Object clone() { + + Dokumaran dokumaran = null; + try { + dokumaran = (Dokumaran) super.clone(); + dokumaran.setUid(null); + // clone ReourceUser as well + if (createdBy != null) { + dokumaran.setCreatedBy((DokumaranUser) createdBy.clone()); + } + } catch (CloneNotSupportedException e) { + Dokumaran.log.error("When clone " + Dokumaran.class + " failed"); + } + + return dokumaran; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Dokumaran)) { + return false; + } + + final Dokumaran genericEntity = (Dokumaran) 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(); + } + + /** + * Updates the modification data for this entity. + */ + public void updateModificationData() { + + long now = System.currentTimeMillis(); + if (created == null) { + this.setCreated(new Date(now)); + } + this.setUpdated(new Date(now)); + } + + // ********************************************************** + // get/set methods + // ********************************************************** + /** + * Returns the object's creation date + * + * @return date + * + */ + public Date getCreated() { + return created; + } + + /** + * Sets the object's creation date + * + * @param created + */ + public void setCreated(Date created) { + this.created = created; + } + + /** + * Returns the object's date of last update + * + * @return date updated + * + */ + public Date getUpdated() { + return updated; + } + + /** + * Sets the object's date of last update + * + * @param updated + */ + public void setUpdated(Date updated) { + this.updated = updated; + } + + /** + * @return Returns the userid of the user who created the Share dokumaran. + * + * + * + */ + public DokumaranUser getCreatedBy() { + return createdBy; + } + + /** + * @param createdBy + * The userid of the user who created this Share dokumaran. + */ + public void setCreatedBy(DokumaranUser 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 dokumaran 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; + } + + /** + * + * @return + */ + public boolean isContentInUse() { + return contentInUse; + } + + public void setContentInUse(boolean contentInUse) { + this.contentInUse = contentInUse; + } + + /** + * + * @return + */ + public boolean isDefineLater() { + return defineLater; + } + + public void setDefineLater(boolean defineLater) { + this.defineLater = defineLater; + } + + /** + * + * @return + */ + public Long getContentId() { + return contentId; + } + + public void setContentId(Long contentId) { + this.contentId = contentId; + } + + /** + * + * @return + */ + public boolean isShowChat() { + return showChat; + } + + public void setShowChat(boolean showChat) { + this.showChat = showChat; + } + + /** + * + * @return + */ + public boolean isShowLineNumbers() { + return showLineNumbers; + } + + public void setShowLineNumbers(boolean showLineNumbers) { + this.showLineNumbers = showLineNumbers; + } + + /** + * + * @return + */ + public boolean isUseSelectLeaderToolOuput() { + return useSelectLeaderToolOuput; + } + + public void setUseSelectLeaderToolOuput(boolean useSelectLeaderToolOuput) { + this.useSelectLeaderToolOuput = useSelectLeaderToolOuput; + } + + /** + * + * @return + */ + public String getReflectInstructions() { + return reflectInstructions; + } + + public void setReflectInstructions(String reflectInstructions) { + this.reflectInstructions = reflectInstructions; + } + + /** + * + * @return + */ + public boolean isReflectOnActivity() { + return reflectOnActivity; + } + + public void setReflectOnActivity(boolean reflectOnActivity) { + this.reflectOnActivity = reflectOnActivity; + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranConfigItem.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranConfigItem.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranConfigItem.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,53 @@ +package org.lamsfoundation.lams.tool.dokumaran.model; + +/** + * + */ +public class DokumaranConfigItem implements java.io.Serializable { + + private static final long serialVersionUID = 930482766653472631L; + + public static final String KEY_ETHERPAD_URL = "EtherpadUrl"; + + public static final String KEY_API_KEY = "ApiKey"; + + private Long id; + private String configKey; + private String configValue; + + /** + * + * + */ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + /** + * + * + */ + public String getConfigKey() { + return configKey; + } + + public void setConfigKey(String configKey) { + this.configKey = configKey; + } + + /** + * + * + */ + public String getConfigValue() { + return configValue; + } + + public void setConfigValue(String configValue) { + this.configValue = configValue; + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranSession.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranSession.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranSession.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,165 @@ +/**************************************************************** + * 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.dokumaran.model; + +import java.util.Date; + +import org.apache.log4j.Logger; + +/** + * Dokumaran + * + * @author Andrey Balan + */ +public class DokumaranSession { + + private static Logger log = Logger.getLogger(DokumaranSession.class); + + private Long uid; + private Long sessionId; + private String sessionName; + private Dokumaran dokumaran; + private Date sessionStartDate; + private Date sessionEndDate; + // finish or not + private int status; + private DokumaranUser groupLeader; + private String etherpadReadOnlyId; + + // ********************************************************** + // Get/Set methods + // ********************************************************** + /** + * @return Returns the learnerID. + */ + public Long getUid() { + return uid; + } + + public void setUid(Long uuid) { + this.uid = uuid; + } + + /** + * @return + */ + public Date getSessionEndDate() { + return sessionEndDate; + } + + public void setSessionEndDate(Date sessionEndDate) { + this.sessionEndDate = sessionEndDate; + } + + /** + * @return + */ + public Date getSessionStartDate() { + return sessionStartDate; + } + + public void setSessionStartDate(Date sessionStartDate) { + this.sessionStartDate = sessionStartDate; + } + + /** + * @return + */ + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + /** + * @return + */ + public Dokumaran getDokumaran() { + return dokumaran; + } + + public void setDokumaran(Dokumaran dokumaran) { + this.dokumaran = dokumaran; + } + + /** + * @return + */ + public Long getSessionId() { + return sessionId; + } + + public void setSessionId(Long sessionId) { + this.sessionId = sessionId; + } + + /** + * @return Returns the session name + */ + public String getSessionName() { + return sessionName; + } + + /** + * @param sessionName + * The session name to set. + */ + public void setSessionName(String sessionName) { + this.sessionName = sessionName; + } + + /** + */ + public DokumaranUser getGroupLeader() { + return this.groupLeader; + } + + public void setGroupLeader(DokumaranUser groupLeader) { + this.groupLeader = groupLeader; + } + + public boolean isUserGroupLeader(Long userUid) { + + boolean isUserLeader = (this.groupLeader != null) && userUid.equals(this.groupLeader.getUid()); + return isUserLeader; + } + + /** + * @return Returns the etherpadReadOnlyId + */ + public String getEtherpadReadOnlyId() { + return etherpadReadOnlyId; + } + + /** + * @param etherpadReadOnlyId + * The etherpadReadOnlyId to set. + */ + public void setEtherpadReadOnlyId(String etherpadReadOnlyId) { + this.etherpadReadOnlyId = etherpadReadOnlyId; + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranUser.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranUser.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/model/DokumaranUser.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,254 @@ +/**************************************************************** + * 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.dokumaran.model; + +import java.util.Date; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; + +/** + * Dokumaran + * + * @author Andrey Balan + */ +public class DokumaranUser implements Cloneable { + private static final long serialVersionUID = -7043502180037866257L; + private static Logger log = Logger.getLogger(DokumaranUser.class); + + private Long uid; + private Long userId; + private String firstName; + private String lastName; + private String loginName; + private boolean sessionFinished; + + private DokumaranSession session; + private Dokumaran dokumaran; + + // =============== NON Persisit value: for display use =========== + // the user access some reousrce item date time. Use in monitoring summary page + private Date accessDate; + // dokumaran item complete date. Use in monitoring summary page + private Date completeDate; + // difference between completeDate and accessDate + private Date timeTaken; + + public DokumaranUser() { + } + + public DokumaranUser(UserDTO user, DokumaranSession session) { + this.userId = new Long(user.getUserID().intValue()); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.loginName = user.getLogin(); + this.session = session; + this.dokumaran = null; + this.sessionFinished = false; + } + + public DokumaranUser(UserDTO user, Dokumaran content) { + this.userId = new Long(user.getUserID().intValue()); + this.firstName = user.getFirstName(); + this.lastName = user.getLastName(); + this.loginName = user.getLogin(); + this.session = null; + this.dokumaran = content; + this.sessionFinished = false; + } + + /** + * Clone method from java.lang.Object + */ + @Override + public Object clone() { + + DokumaranUser user = null; + try { + user = (DokumaranUser) super.clone(); + user.setUid(null); + // never clone session + user.setSession(null); + } catch (CloneNotSupportedException e) { + log.error("When clone " + DokumaranUser.class + " failed"); + } + + return user; + } + + // ********************************************************** + // Get/Set methods + // ********************************************************** + /** + * + * @return Returns the uid. + */ + public Long getUid() { + return uid; + } + + /** + * @param uid + * The uid to set. + */ + public void setUid(Long userID) { + this.uid = userID; + } + + /** + * + * @return Returns the userId. + */ + public Long getUserId() { + return userId; + } + + /** + * @param userId + * The userId to set. + */ + public void setUserId(Long userID) { + this.userId = userID; + } + + /** + * + * @return + */ + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * + * @return + */ + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * + * @return + */ + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + /** + * + * @return + */ + public DokumaranSession getSession() { + return session; + } + + public void setSession(DokumaranSession session) { + this.session = session; + } + + /** + * + * @return + */ + public Dokumaran getDokumaran() { + return dokumaran; + } + + public void setDokumaran(Dokumaran content) { + this.dokumaran = content; + } + + /** + * + * @return + */ + public boolean isSessionFinished() { + return sessionFinished; + } + + public void setSessionFinished(boolean sessionFinished) { + this.sessionFinished = sessionFinished; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DokumaranUser)) { + return false; + } + + final DokumaranUser user = (DokumaranUser) 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 Date getAccessDate() { + return accessDate; + } + + public void setAccessDate(Date accessDate) { + this.accessDate = accessDate; + } + + public Date getCompleteDate() { + return completeDate; + } + + public void setCompleteDate(Date completeDate) { + this.completeDate = completeDate; + } + + public Date getTimeTaken() { + return timeTaken; + } + + public void setTimeTaken(Date timeTaken) { + this.timeTaken = timeTaken; + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranApplicationException.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranApplicationException.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranApplicationException.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,48 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.dokumaran.service; + +public class DokumaranApplicationException extends Exception { + + public DokumaranApplicationException() { + super(); + + } + + public DokumaranApplicationException(String message, Throwable cause) { + super(message, cause); + + } + + public DokumaranApplicationException(String message) { + super(message); + + } + + public DokumaranApplicationException(Throwable cause) { + super(cause); + + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranConfigurationException.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranConfigurationException.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranConfigurationException.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,46 @@ +/**************************************************************** + * 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.dokumaran.service; + +public class DokumaranConfigurationException extends Exception { + + private static final long serialVersionUID = -6586744647823555174L; + + public DokumaranConfigurationException() { + super(); + } + + public DokumaranConfigurationException(String message, Throwable cause) { + super(message, cause); + } + + public DokumaranConfigurationException(String message) { + super(message); + } + + public DokumaranConfigurationException(Throwable cause) { + super(cause); + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranOutputFactory.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranOutputFactory.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranOutputFactory.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,130 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License 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.dokumaran.service; + +import java.util.List; +import java.util.SortedMap; +import java.util.TreeMap; + +import org.lamsfoundation.lams.tool.OutputFactory; +import org.lamsfoundation.lams.tool.SimpleURL; +import org.lamsfoundation.lams.tool.ToolOutput; +import org.lamsfoundation.lams.tool.ToolOutputDefinition; +import org.lamsfoundation.lams.tool.dokumaran.DokumaranConstants; +import org.lamsfoundation.lams.tool.exception.ToolException; + +public class DokumaranOutputFactory extends OutputFactory { + + /** + * {@inheritDoc} + */ + @Override + public SortedMap getToolOutputDefinitions(Object toolContentObject, + int definitionType) throws ToolException { + TreeMap definitionMap = new TreeMap(); + Class simpleUrlArrayClass = SimpleURL[].class; + switch (definitionType) { + case ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_CONDITION: + break; + case ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_DATA_FLOW: + ToolOutputDefinition sharedItemsDefinition = buildComplexOutputDefinition( + DokumaranConstants.SHARED_ITEMS_DEFINITION_NAME, simpleUrlArrayClass); + definitionMap.put(DokumaranConstants.SHARED_ITEMS_DEFINITION_NAME, sharedItemsDefinition); + break; + } + return definitionMap; + } + + /** + * Follows {@link PixlrService#getToolOutput(List, Long, Long)}. + * + */ + public SortedMap getToolOutput(List names, IDokumaranService dokumaranService, + Long toolSessionId, Long learnerId) { + + TreeMap outputs = new TreeMap(); + // tool output cache + TreeMap baseOutputs = new TreeMap(); + if (names == null) { + outputs.put(DokumaranConstants.SHARED_ITEMS_DEFINITION_NAME, getToolOutput( + DokumaranConstants.SHARED_ITEMS_DEFINITION_NAME, dokumaranService, toolSessionId, learnerId)); + } else { + 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, dokumaranService, toolSessionId, learnerId); + if (output != null) { + outputs.put(name, output); + baseOutputs.put(nameParts[0], output); + } + } + } + } + + return outputs; + + } + + public ToolOutput getToolOutput(String name, IDokumaranService dokumaranService, Long toolSessionId, Long learnerId) { + if (name != null) { + String[] nameParts = splitConditionName(name); +// if (DokumaranConstants.SHARED_ITEMS_DEFINITION_NAME.equals(nameParts[0])) { +// List items = dokumaranService.getDokumaranItemsBySessionId(toolSessionId); +// List uploadedItems = new ArrayList(items.size()); +// for (DokumaranItem item : items) { +// if (!item.isCreateByAuthor()) { +// uploadedItems.add(item); +// } +// } +// SimpleURL[] uploadedItemUrls = new SimpleURL[uploadedItems.size()]; +// int uploadedItemIndex = 0; +// if (!uploadedItems.isEmpty()) { +// String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); +// for (DokumaranItem uploadedItem : uploadedItems) { +// +// String path = uploadedItem.getUrl(); +// if (path == null) { +// path = serverUrl + "download/?uuid=" + uploadedItem.getFileUuid() + "&preferDownload=false&" +// + AttributeNames.PARAM_TOOL_CONTENT_HANDLER_NAME + "=" +// + DokumaranConstants.TOOL_CONTENT_HANDLER_NAME; +// +// } +// path = "javascript:var dummy = window.open('" + path + "','" + uploadedItem.getTitle() +// + "','resizable,scrollbars')"; +// SimpleURL url = new SimpleURL(uploadedItem.getTitle(), path); +// uploadedItemUrls[uploadedItemIndex] = url; +// uploadedItemIndex++; +// } +// return new ToolOutput(DokumaranConstants.SHARED_ITEMS_DEFINITION_NAME, +// getI18NText(DokumaranConstants.SHARED_ITEMS_DEFINITION_NAME, true), uploadedItemUrls, false); +// } +// +// } + + } + return null; + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranService.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranService.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranService.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,894 @@ +/**************************************************************** + * 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.dokumaran.service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.SortedMap; + +import org.apache.log4j.Logger; +import org.apache.tomcat.util.json.JSONException; +import org.apache.tomcat.util.json.JSONObject; +import org.lamsfoundation.lams.contentrepository.AccessDeniedException; +import org.lamsfoundation.lams.contentrepository.ICredentials; +import org.lamsfoundation.lams.contentrepository.ITicket; +import org.lamsfoundation.lams.contentrepository.IVersionedNode; +import org.lamsfoundation.lams.contentrepository.LoginException; +import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; +import org.lamsfoundation.lams.contentrepository.service.IRepositoryService; +import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; +import org.lamsfoundation.lams.learning.service.ILearnerService; +import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; +import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; +import org.lamsfoundation.lams.learningdesign.service.ImportToolContentException; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; +import org.lamsfoundation.lams.notebook.service.ICoreNotebookService; +import org.lamsfoundation.lams.rest.RestTags; +import org.lamsfoundation.lams.rest.ToolRestManager; +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.dokumaran.DokumaranConstants; +import org.lamsfoundation.lams.tool.dokumaran.dao.DokumaranConfigItemDAO; +import org.lamsfoundation.lams.tool.dokumaran.dao.DokumaranDAO; +import org.lamsfoundation.lams.tool.dokumaran.dao.DokumaranSessionDAO; +import org.lamsfoundation.lams.tool.dokumaran.dao.DokumaranUserDAO; +import org.lamsfoundation.lams.tool.dokumaran.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.dokumaran.dto.SessionDTO; +import org.lamsfoundation.lams.tool.dokumaran.model.Dokumaran; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranConfigItem; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranSession; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranUser; +import org.lamsfoundation.lams.tool.dokumaran.util.DokumaranToolContentHandler; +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.usermanagement.User; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.HashUtil; +import org.lamsfoundation.lams.util.JsonUtil; +import org.lamsfoundation.lams.util.MessageService; +import org.lamsfoundation.lams.util.audit.IAuditService; + +import net.gjerull.etherpad.client.EPLiteClient; +import net.gjerull.etherpad.client.EPLiteException; + +/** + * @author Dapeng.Ni + */ +public class DokumaranService implements IDokumaranService, ToolContentManager, ToolSessionManager, ToolRestManager { + private static Logger log = Logger.getLogger(DokumaranService.class.getName()); + + private DokumaranDAO dokumaranDao; + + private DokumaranUserDAO dokumaranUserDao; + + private DokumaranSessionDAO dokumaranSessionDao; + + private DokumaranConfigItemDAO dokumaranConfigItemDAO; + + // tool service + private DokumaranToolContentHandler dokumaranToolContentHandler; + + private MessageService messageService; + + // system services + private IRepositoryService repositoryService; + + private ILamsToolService toolService; + + private ILearnerService learnerService; + + private IAuditService auditService; + + private IUserManagementService userManagementService; + + private IExportToolContentService exportContentService; + + private ICoreNotebookService coreNotebookService; + + private DokumaranOutputFactory dokumaranOutputFactory; + + private EPLiteClient client = null; + + // ******************************************************************************* + // Service method + // ******************************************************************************* + /** + * Try to get the file. If forceLogin = false and an access denied exception occurs, call this method again to get a + * new ticket and retry file lookup. If forceLogin = true and it then fails then throw exception. + * + * @param uuid + * @param versionId + * @param relativePath + * @param attemptCount + * @return file node + * @throws ImscpApplicationException + */ + private IVersionedNode getFile(Long uuid, Long versionId, String relativePath) + throws DokumaranApplicationException { + + ITicket tic = getRepositoryLoginTicket(); + + try { + + return repositoryService.getFileItem(tic, uuid, versionId, relativePath); + + } catch (AccessDeniedException e) { + + String error = "Unable to access repository to get file uuid " + uuid + " version id " + versionId + + " path " + relativePath + "."; + + error = error + "AccessDeniedException: " + e.getMessage() + " Unable to retry further."; + DokumaranService.log.error(error); + throw new DokumaranApplicationException(error, e); + + } catch (Exception e) { + + String error = "Unable to access repository to get file uuid " + uuid + " version id " + versionId + + " path " + relativePath + "." + " Exception: " + e.getMessage(); + DokumaranService.log.error(error); + throw new DokumaranApplicationException(error, e); + + } + } + + /** + * This method verifies the credentials of the Dokumaran Tool and gives it the Ticket to login and + * access the Content Repository. + * + * A valid ticket is needed in order to access the content from the repository. This method would be called evertime + * the tool needs to upload/download files from the content repository. + * + * @return ITicket The ticket for repostory access + * @throws DokumaranApplicationException + */ + private ITicket getRepositoryLoginTicket() throws DokumaranApplicationException { + ICredentials credentials = new SimpleCredentials(dokumaranToolContentHandler.getRepositoryUser(), + dokumaranToolContentHandler.getRepositoryId()); + try { + ITicket ticket = repositoryService.login(credentials, + dokumaranToolContentHandler.getRepositoryWorkspaceName()); + return ticket; + } catch (AccessDeniedException ae) { + throw new DokumaranApplicationException("Access Denied to repository." + ae.getMessage()); + } catch (WorkspaceNotFoundException we) { + throw new DokumaranApplicationException("Workspace not found." + we.getMessage()); + } catch (LoginException e) { + throw new DokumaranApplicationException("Login failed." + e.getMessage()); + } + } + + @Override + public Dokumaran getDokumaranByContentId(Long contentId) { + Dokumaran rs = dokumaranDao.getByContentId(contentId); + return rs; + } + + @Override + public Dokumaran getDefaultContent(Long contentId) throws DokumaranApplicationException { + if (contentId == null) { + String error = messageService.getMessage("error.msg.default.content.not.find"); + DokumaranService.log.error(error); + throw new DokumaranApplicationException(error); + } + + Dokumaran defaultContent = getDefaultDokumaran(); + // save default content by given ID. + Dokumaran content = new Dokumaran(); + content = Dokumaran.newInstance(defaultContent, contentId); + return content; + } + + @Override + public DokumaranUser checkLeaderSelectToolForSessionLeader(DokumaranUser user, Long toolSessionId) { + if ((user == null) || (toolSessionId == null)) { + return null; + } + + DokumaranSession session = getDokumaranSessionBySessionId(toolSessionId); + DokumaranUser leader = session.getGroupLeader(); + // check leader select tool for a leader only in case Dokumaran tool doesn't know it. As otherwise it will screw + // up previous scratches done + if (leader == null) { + + Long leaderUserId = toolService.getLeaderUserId(toolSessionId, user.getUserId().intValue()); + if (leaderUserId != null) { + leader = getUserByIDAndSession(leaderUserId, toolSessionId); + + // create new user in a DB + if (leader == null) { + log.debug("creating new user with userId: " + leaderUserId); + User leaderDto = (User) userManagementService.findById(User.class, leaderUserId.intValue()); + leader = new DokumaranUser(leaderDto.getUserDTO(), session); + createUser(leader); + } + + // set group leader + session.setGroupLeader(leader); + dokumaranSessionDao.saveObject(session); + } + } + + return leader; + } + + @Override + public void createUser(DokumaranUser dokumaranUser) { + dokumaranUserDao.saveObject(dokumaranUser); + } + + @Override + public DokumaranUser getUserByIDAndContent(Long userId, Long contentId) { + return dokumaranUserDao.getUserByUserIDAndContentID(userId, contentId); + } + + @Override + public DokumaranUser getUserByIDAndSession(Long userId, Long sessionId) { + return dokumaranUserDao.getUserByUserIDAndSessionID(userId, sessionId); + } + + @Override + public List getUsersBySession(Long toolSessionId) { + return dokumaranUserDao.getBySessionID(toolSessionId); + } + + @Override + public DokumaranConfigItem getConfigItem(String key) { + return dokumaranConfigItemDAO.getConfigItemByKey(key); + } + + @Override + public void saveOrUpdateDokumaranConfigItem(DokumaranConfigItem item) { + dokumaranConfigItemDAO.saveOrUpdate(item); + } + + @Override + public void saveOrUpdateDokumaran(Dokumaran dokumaran) { + dokumaranDao.saveObject(dokumaran); + } + + @Override + public Dokumaran getDokumaranBySessionId(Long sessionId) { + DokumaranSession session = dokumaranSessionDao.getSessionBySessionId(sessionId); + // to skip CGLib problem + Long contentId = session.getDokumaran().getContentId(); + Dokumaran res = dokumaranDao.getByContentId(contentId); + return res; + } + + @Override + public DokumaranSession getDokumaranSessionBySessionId(Long sessionId) { + return dokumaranSessionDao.getSessionBySessionId(sessionId); + } + + @Override + public void saveOrUpdateDokumaranSession(DokumaranSession resSession) { + dokumaranSessionDao.saveObject(resSession); + } + + @Override + public String finishToolSession(Long toolSessionId, Long userId) throws DokumaranApplicationException { + DokumaranUser user = dokumaranUserDao.getUserByUserIDAndSessionID(userId, toolSessionId); + user.setSessionFinished(true); + dokumaranUserDao.saveObject(user); + + // DokumaranSession session = dokumaranSessionDao.getSessionBySessionId(toolSessionId); + // session.setStatus(DokumaranConstants.COMPLETED); + // dokumaranSessionDao.saveObject(session); + + String nextUrl = null; + try { + nextUrl = this.leaveToolSession(toolSessionId, userId); + } catch (DataMissingException e) { + throw new DokumaranApplicationException(e); + } catch (ToolException e) { + throw new DokumaranApplicationException(e); + } + return nextUrl; + } + + @Override + public List getSummary(Long contentId) { + List groupList = new ArrayList(); + + Dokumaran dokumaran = dokumaranDao.getByContentId(contentId); + + // get all sessions in a dokumaran and retrieve all dokumaran items under this session + // plus initial dokumaran items by author creating (resItemList) + List sessionList = dokumaranSessionDao.getByContentId(contentId); + + for (DokumaranSession session : sessionList) { + // one new group for one session. + SessionDTO group = new SessionDTO(); + group.setSessionId(session.getSessionId()); + group.setSessionName(session.getSessionName()); + + String padId = HashUtil.sha1(DokumaranConstants.PAD_ID_PREFIX + session.getSessionId()); + group.setPadId(padId); + + groupList.add(group); + } + + return groupList; + } + + @Override + public List getReflectList(Long contentId) { + List reflections = new LinkedList(); + + List sessionList = dokumaranSessionDao.getByContentId(contentId); + for (DokumaranSession session : sessionList) { + Long sessionId = session.getSessionId(); + // get all users in this session + List users = dokumaranUserDao.getBySessionID(sessionId); + for (DokumaranUser user : users) { + + NotebookEntry entry = getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + DokumaranConstants.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 DokumaranUser getUser(Long uid) { + return (DokumaranUser) dokumaranUserDao.getObject(DokumaranUser.class, uid); + } + + // ***************************************************************************** + // private methods + // ***************************************************************************** + private Dokumaran getDefaultDokumaran() throws DokumaranApplicationException { + Long defaultDokumaranId = getToolDefaultContentIdBySignature(DokumaranConstants.TOOL_SIGNATURE); + Dokumaran defaultDokumaran = getDokumaranByContentId(defaultDokumaranId); + if (defaultDokumaran == null) { + String error = messageService.getMessage("error.msg.default.content.not.find"); + DokumaranService.log.error(error); + throw new DokumaranApplicationException(error); + } + + return defaultDokumaran; + } + + private Long getToolDefaultContentIdBySignature(String toolSignature) throws DokumaranApplicationException { + Long contentId = null; + contentId = new Long(toolService.getToolDefaultContentIdBySignature(toolSignature)); + if (contentId == null) { + String error = messageService.getMessage("error.msg.default.content.not.find"); + DokumaranService.log.error(error); + throw new DokumaranApplicationException(error); + } + return contentId; + } + + /** + * Gets a message from dokumaran bundle. Same as in JSP pages. + * + * @param key + * key of the message + * @param args + * arguments for the message + * @return message content + */ + private String getLocalisedMessage(String key, Object[] args) { + return messageService.getMessage(key, args); + } + + @Override + public boolean isGroupedActivity(long toolContentID) { + return toolService.isGroupedActivity(toolContentID); + } + + // ******************************************************************************* + // ToolContentManager, ToolSessionManager methods + // ******************************************************************************* + + @Override + public void exportToolContent(Long toolContentId, String rootPath) throws DataMissingException, ToolException { + Dokumaran toolContentObj = dokumaranDao.getByContentId(toolContentId); + if (toolContentObj == null) { + try { + toolContentObj = getDefaultDokumaran(); + } catch (DokumaranApplicationException e) { + throw new DataMissingException(e.getMessage()); + } + } + if (toolContentObj == null) { + throw new DataMissingException("Unable to find default content for the dokumaran tool"); + } + + // set DokumaranToolContentHandler as null to avoid copy file node in repository again. + toolContentObj = Dokumaran.newInstance(toolContentObj, toolContentId); + try { + exportContentService.exportToolContent(toolContentId, toolContentObj, dokumaranToolContentHandler, + 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, dokumaranToolContentHandler, + fromVersion, toVersion); + if (!(toolPOJO instanceof Dokumaran)) { + throw new ImportToolContentException( + "Import Share dokumaran tool content failed. Deserialized object is " + toolPOJO); + } + Dokumaran toolContentObj = (Dokumaran) toolPOJO; + + // reset it to new toolContentId + toolContentObj.setContentId(toolContentId); + DokumaranUser user = dokumaranUserDao.getUserByUserIDAndContentID(new Long(newUserUid.longValue()), + toolContentId); + if (user == null) { + user = new DokumaranUser(); + UserDTO sysUser = ((User) userManagementService.findById(User.class, newUserUid)).getUserDTO(); + user.setFirstName(sysUser.getFirstName()); + user.setLastName(sysUser.getLastName()); + user.setLoginName(sysUser.getLogin()); + user.setUserId(new Long(newUserUid.longValue())); + user.setDokumaran(toolContentObj); + } + toolContentObj.setCreatedBy(user); + + dokumaranDao.saveObject(toolContentObj); + } catch (ImportToolContentException e) { + throw new ToolException(e); + } + } + + @Override + public SortedMap getToolOutputDefinitions(Long toolContentId, int definitionType) + throws ToolException { + Dokumaran content = getDokumaranByContentId(toolContentId); + if (content == null) { + try { + content = getDefaultContent(toolContentId); + } catch (DokumaranApplicationException e) { + throw new ToolException(e); + } + } + return getDokumaranOutputFactory().getToolOutputDefinitions(content, definitionType); + } + + @Override + public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { + if (toContentId == null) { + throw new ToolException("Failed to create the SharedDokumaranFiles tool seession"); + } + + Dokumaran dokumaran = null; + if (fromContentId != null) { + dokumaran = dokumaranDao.getByContentId(fromContentId); + } + if (dokumaran == null) { + try { + dokumaran = getDefaultDokumaran(); + } catch (DokumaranApplicationException e) { + throw new ToolException(e); + } + } + + Dokumaran toContent = Dokumaran.newInstance(dokumaran, toContentId); + dokumaranDao.saveObject(toContent); + } + + @Override + public String getToolContentTitle(Long toolContentId) { + return getDokumaranByContentId(toolContentId).getTitle(); + } + + @Override + public void resetDefineLater(Long toolContentId) throws DataMissingException, ToolException { + Dokumaran dokumaran = dokumaranDao.getByContentId(toolContentId); + if (dokumaran == null) { + throw new ToolException("No found tool content by given content ID:" + toolContentId); + } + dokumaran.setDefineLater(false); + } + + @Override + public boolean isContentEdited(Long toolContentId) { + return getDokumaranByContentId(toolContentId).isDefineLater(); + } + + @Override + public boolean isReadOnly(Long toolContentId) { + List sessions = dokumaranSessionDao.getByContentId(toolContentId); + for (DokumaranSession session : sessions) { + if (!dokumaranUserDao.getBySessionID(session.getSessionId()).isEmpty()) { + return true; + } + } + + return false; + } + + @Override + public void removeToolContent(Long toolContentId) throws ToolException { + Dokumaran dokumaran = dokumaranDao.getByContentId(toolContentId); + if (dokumaran == null) { + DokumaranService.log.warn("Can not remove the tool content as it does not exist, ID: " + toolContentId); + return; + } + + for (DokumaranSession session : dokumaranSessionDao.getByContentId(toolContentId)) { + List entries = coreNotebookService.getEntry(session.getSessionId(), + CoreNotebookConstants.NOTEBOOK_TOOL, DokumaranConstants.TOOL_SIGNATURE); + for (NotebookEntry entry : entries) { + coreNotebookService.deleteEntry(entry); + } + } + dokumaranDao.delete(dokumaran); + } + + @Override + @SuppressWarnings("unchecked") + public void removeLearnerContent(Long toolContentId, Integer userId) throws ToolException { + if (DokumaranService.log.isDebugEnabled()) { + DokumaranService.log + .debug("Removing Dokumaran content for user ID " + userId + " and toolContentId " + toolContentId); + } + + Dokumaran dokumaran = dokumaranDao.getByContentId(toolContentId); + if (dokumaran == null) { + DokumaranService.log + .warn("Did not find activity with toolContentId: " + toolContentId + " to remove learner content"); + return; + } + + List sessions = dokumaranSessionDao.getByContentId(toolContentId); + for (DokumaranSession session : sessions) { + DokumaranUser user = dokumaranUserDao.getUserByUserIDAndSessionID(userId.longValue(), + session.getSessionId()); + if (user != null) { + NotebookEntry entry = getEntry(session.getSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, + DokumaranConstants.TOOL_SIGNATURE, userId); + if (entry != null) { + dokumaranDao.removeObject(NotebookEntry.class, entry.getUid()); + } + + dokumaranUserDao.removeObject(DokumaranUser.class, user.getUid()); + } + } + } + + @Override + public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException { + DokumaranSession session = new DokumaranSession(); + session.setSessionId(toolSessionId); + session.setSessionName(toolSessionName); + Dokumaran dokumaran = dokumaranDao.getByContentId(toolContentId); + session.setDokumaran(dokumaran); + dokumaranSessionDao.saveObject(session); + +// //create pad in a new thread so it doesn't affect session creation operation +// Thread t = new Thread( +// new CreatePadThread(this, toolSessionId, dokumaran.getInstructions())); +// t.start(); + + try { + EPLiteClient client = initializeEPLiteClient(); + + String padId = HashUtil.sha1(DokumaranConstants.PAD_ID_PREFIX + toolSessionId); + try { + client.createPad(padId); + } catch (EPLiteException e) { + // allow recreating existing pads + if (!"padID does already exist".equals(e.getMessage())) { + throw e; + } + } + + // set initial content + String etherpadHtml = "" + + dokumaran.getInstructions().replaceAll("[\n\r\f]", "").replaceAll(" ", "") + + ""; + client.setHTML(padId, etherpadHtml); + + // gets read-only id + String etherpadReadOnlyId = (String) client.getReadOnlyID(padId).get("readOnlyID"); + + session.setEtherpadReadOnlyId(etherpadReadOnlyId); + dokumaranSessionDao.saveObject(session); + } catch (DokumaranConfigurationException e1) { + log.warn(e1.getMessage(), e1); + } + + } + + @Override + public ToolCompletionStatus getCompletionStatus(Long learnerId, Long toolSessionId) { + DokumaranUser 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 getEtherpadReadOnlyId(String padId) throws DokumaranConfigurationException { + + Map etherpadReadOnlyId = null; + try { + etherpadReadOnlyId = initializeEPLiteClient().getReadOnlyID(padId); + } catch (EPLiteException e) { +// if (!"padID does already exist".equals(e.getMessage())) { + throw e; +// } + } + + return etherpadReadOnlyId == null ? null : (String)etherpadReadOnlyId.get("readOnlyID"); + } + + @Override + public void setEtherpadReadOnlyId(Long toolSessionId, String etherpadReadOnlyId) { + DokumaranSession session = dokumaranSessionDao.getSessionBySessionId(toolSessionId); + session.setEtherpadReadOnlyId(etherpadReadOnlyId); + dokumaranSessionDao.saveObject(session); + } + + @Override + public EPLiteClient initializeEPLiteClient() throws DokumaranConfigurationException { + if (client == null) { + // get the API key from the config table and add it to the session + DokumaranConfigItem etherpadServerUrlConfig = getConfigItem(DokumaranConfigItem.KEY_ETHERPAD_URL); + DokumaranConfigItem etherpadApiKeyConfig = getConfigItem(DokumaranConfigItem.KEY_API_KEY); + if (etherpadApiKeyConfig == null || etherpadApiKeyConfig.getConfigValue() == null + || etherpadServerUrlConfig == null || etherpadServerUrlConfig.getConfigValue() == null) { + throw new DokumaranConfigurationException("Dokumaran settings are not configured. apiKeyConfig=" + etherpadApiKeyConfig + + " etherpadServerUrlConfig=" + etherpadServerUrlConfig + " Please seek help from your administrator"); + } + + // create EPLiteClient + String etherpadServerUrl = etherpadServerUrlConfig.getConfigValue(); + String etherpadApiKey = etherpadApiKeyConfig.getConfigValue(); + client = new EPLiteClient(etherpadServerUrl, etherpadApiKey); + } + return client; + } + + @Override + public String leaveToolSession(Long toolSessionId, Long learnerId) throws DataMissingException, ToolException { + if (toolSessionId == null) { + DokumaranService.log.error("Fail to leave tool Session based on null tool session id."); + throw new ToolException("Fail to remove tool Session based on null tool session id."); + } + if (learnerId == null) { + DokumaranService.log.error("Fail to leave tool Session based on null learner."); + throw new ToolException("Fail to remove tool Session based on null learner."); + } + + DokumaranSession session = dokumaranSessionDao.getSessionBySessionId(toolSessionId); + if (session != null) { + session.setStatus(DokumaranConstants.COMPLETED); + dokumaranSessionDao.saveObject(session); + } else { + DokumaranService.log.error("Fail to leave tool Session.Could not find shared dokumaran " + + "session by given session id: " + toolSessionId); + throw new DataMissingException("Fail to leave tool Session." + + "Could not find shared dokumaran session by given session id: " + toolSessionId); + } + return learnerService.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 { + dokumaranSessionDao.deleteBySessionId(toolSessionId); + } + + @Override + public SortedMap getToolOutput(List names, Long toolSessionId, Long learnerId) { + return getDokumaranOutputFactory().getToolOutput(names, this, toolSessionId, learnerId); + } + + @Override + public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) { + return getDokumaranOutputFactory().getToolOutput(name, this, toolSessionId, learnerId); + } + + @Override + public List getToolOutputs(String name, Long toolContentId) { + return new ArrayList(); + } + + @Override + public void forceCompleteUser(Long toolSessionId, User user) { + // no actions required + } + + @Override + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getDokumaranOutputFactory().getSupportedDefinitionClasses(definitionType); + } + + // ***************************************************************************** + // set methods for Spring Bean + // ***************************************************************************** + public void setAuditService(IAuditService auditService) { + this.auditService = auditService; + } + + public void setLearnerService(ILearnerService learnerService) { + this.learnerService = learnerService; + } + + public void setMessageService(MessageService messageService) { + this.messageService = messageService; + } + + public void setRepositoryService(IRepositoryService repositoryService) { + this.repositoryService = repositoryService; + } + + public void setDokumaranDao(DokumaranDAO dokumaranDao) { + this.dokumaranDao = dokumaranDao; + } + + public void setDokumaranSessionDao(DokumaranSessionDAO dokumaranSessionDao) { + this.dokumaranSessionDao = dokumaranSessionDao; + } + + public void setDokumaranConfigItemDAO(DokumaranConfigItemDAO dokumaranConfigItemDAO) { + this.dokumaranConfigItemDAO = dokumaranConfigItemDAO; + } + + public void setDokumaranToolContentHandler(DokumaranToolContentHandler dokumaranToolContentHandler) { + this.dokumaranToolContentHandler = dokumaranToolContentHandler; + } + + public void setDokumaranUserDao(DokumaranUserDAO dokumaranUserDao) { + this.dokumaranUserDao = dokumaranUserDao; + } + + 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 setCoreNotebookService(ICoreNotebookService coreNotebookService) { + this.coreNotebookService = coreNotebookService; + } + + public DokumaranOutputFactory getDokumaranOutputFactory() { + return dokumaranOutputFactory; + } + + public void setDokumaranOutputFactory(DokumaranOutputFactory dokumaranOutputFactory) { + this.dokumaranOutputFactory = dokumaranOutputFactory; + } + + // ****************** REST methods ************************* + + /** + * Used by the Rest calls to create content. Mandatory fields in toolContentJSON: title, instructions, dokumaran, + * user fields firstName, lastName and loginName Dokumaran must contain a JSONArray of JSONObject objects, which + * have the following mandatory fields: title, description, type. If there are instructions for a dokumaran, the + * instructions are a JSONArray of Strings. There should be at least one dokumaran object in the dokumaran array. + */ + @Override + public void createRestToolContent(Integer userID, Long toolContentID, JSONObject toolContentJSON) + throws JSONException { + + Date updateDate = new Date(); + + Dokumaran dokumaran = new Dokumaran(); + dokumaran.setContentId(toolContentID); + dokumaran.setTitle(toolContentJSON.getString(RestTags.TITLE)); + dokumaran.setInstructions(toolContentJSON.getString(RestTags.INSTRUCTIONS)); + dokumaran.setCreated(updateDate); + + dokumaran.setShowChat(JsonUtil.opt(toolContentJSON, "showChat", Boolean.FALSE)); + dokumaran.setShowLineNumbers(JsonUtil.opt(toolContentJSON, "showLineNumbers", Boolean.FALSE)); + dokumaran.setLockWhenFinished(JsonUtil.opt(toolContentJSON, RestTags.LOCK_WHEN_FINISHED, Boolean.FALSE)); + dokumaran.setReflectOnActivity(JsonUtil.opt(toolContentJSON, RestTags.REFLECT_ON_ACTIVITY, Boolean.FALSE)); + dokumaran.setReflectInstructions(JsonUtil.opt(toolContentJSON, RestTags.REFLECT_INSTRUCTIONS, (String) null)); + dokumaran.setUseSelectLeaderToolOuput(JsonUtil.opt(toolContentJSON, "useSelectLeaderToolOuput", Boolean.FALSE)); + + dokumaran.setContentInUse(false); + dokumaran.setDefineLater(false); + + DokumaranUser dokumaranUser = getUserByIDAndContent(userID.longValue(), toolContentID); + if (dokumaranUser == null) { + dokumaranUser = new DokumaranUser(); + dokumaranUser.setFirstName(toolContentJSON.getString("firstName")); + dokumaranUser.setLastName(toolContentJSON.getString("lastName")); + dokumaranUser.setLoginName(toolContentJSON.getString("loginName")); + // dokumaranUser.setDokumaran(content); + } + + dokumaran.setCreatedBy(dokumaranUser); + + saveOrUpdateDokumaran(dokumaran); + + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranServiceProxy.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranServiceProxy.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/DokumaranServiceProxy.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,71 @@ +/**************************************************************** + * 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.dokumaran.service; + +import javax.servlet.ServletContext; + +import org.lamsfoundation.lams.tool.ToolContentManager; +import org.lamsfoundation.lams.tool.ToolSessionManager; +import org.lamsfoundation.lams.tool.dokumaran.DokumaranConstants; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * @author Dapeng.Ni + * + *

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

+ */ +public class DokumaranServiceProxy { + /** + * Return the domain service object. It will delegate to the Spring + * helper method to retrieve the proper bean from Spring bean factory. + * + * @param servletContext + * the servletContext for current application + * @return Shared dokumaran service object. + */ + public static final IDokumaranService getDokumaranService(ServletContext servletContext) { + return (IDokumaranService) DokumaranServiceProxy.getDokumaranDomainService(servletContext); + } + + public static final ToolSessionManager getSessionManager(ServletContext servletContext) { + return (ToolSessionManager) DokumaranServiceProxy.getDokumaranDomainService(servletContext); + } + + public static final ToolContentManager getContentManager(ServletContext servletContext) { + return (ToolContentManager) DokumaranServiceProxy.getDokumaranDomainService(servletContext); + } + + private static Object getDokumaranDomainService(ServletContext servletContext) { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); + return wac.getBean(DokumaranConstants.RESOURCE_SERVICE); + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/IDokumaranService.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/IDokumaranService.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/service/IDokumaranService.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,223 @@ +/**************************************************************** + * 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.dokumaran.service; + +import java.util.List; + +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.tool.dokumaran.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.dokumaran.dto.SessionDTO; +import org.lamsfoundation.lams.tool.dokumaran.model.Dokumaran; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranConfigItem; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranSession; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranUser; + +import net.gjerull.etherpad.client.EPLiteClient; + +/** + * @author Dapeng.Ni + * + * Interface that defines the contract that all ShareDokumaran service provider must follow. + */ +public interface IDokumaranService { + + /** + * Get Dokumaran by toolContentID. + * + * @param contentId + * @return + */ + Dokumaran getDokumaranByContentId(Long contentId); + + /** + * Get a cloned copy of tool default tool content (Dokumaran) and assign the toolContentId of that copy as the given + * contentId + * + * @param contentId + * @return + * @throws DokumaranApplicationException + */ + Dokumaran getDefaultContent(Long contentId) throws DokumaranApplicationException; + + /** + * Set specified user as a leader. Also the previous leader (if any) is marked as non-leader. + * + * @param userId + * @param toolSessionId + */ + DokumaranUser checkLeaderSelectToolForSessionLeader(DokumaranUser user, Long toolSessionId); + + String getEtherpadReadOnlyId(String padId) throws DokumaranConfigurationException; + + /** + * Stores etherpadReadOnlyId to the session. + * + * @param toolSessionId + * @param etherpadReadOnlyId + */ + void setEtherpadReadOnlyId(Long toolSessionId, String etherpadReadOnlyId); + + /** + * Creates EPLiteClient that will make calls to Etherpad server. Throws DokumaranConfigurationException tf the tool + * is not configured appropriately (either etherpadServerUrl or etherpadApiKey is missing). + * + * @return + * @throws DokumaranConfigurationException + */ + EPLiteClient initializeEPLiteClient() throws DokumaranConfigurationException; + + // ********** for user methods ************* + /** + * Create a new user in database. + */ + void createUser(DokumaranUser dokumaranUser); + + /** + * Get user by given userID and toolContentID. + * + * @param long1 + * @return + */ + DokumaranUser getUserByIDAndContent(Long userID, Long contentId); + + /** + * Get user by sessionID and UserID + * + * @param long1 + * @param sessionId + * @return + */ + DokumaranUser getUserByIDAndSession(Long long1, Long sessionId); + + /** + * Get users by the given toolSessionId. + * + * @param toolSessionId + * @return + */ + List getUsersBySession(Long toolSessionId); + + DokumaranConfigItem getConfigItem(String key); + + void saveOrUpdateDokumaranConfigItem(DokumaranConfigItem item); + + /** + * Save or update dokumaran into database. + * + * @param Dokumaran + */ + void saveOrUpdateDokumaran(Dokumaran Dokumaran); + + /** + * Get dokumaran which is relative with the special toolSession. + * + * @param sessionId + * @return + */ + Dokumaran getDokumaranBySessionId(Long sessionId); + + /** + * Get dokumaran toolSession by toolSessionId + * + * @param sessionId + * @return + */ + DokumaranSession getDokumaranSessionBySessionId(Long sessionId); + + /** + * Save or update dokumaran session. + * + * @param resSession + */ + void saveOrUpdateDokumaranSession(DokumaranSession resSession); + + /** + * If success return next activity's url, otherwise return null. + * + * @param toolSessionId + * @param userId + * @return + */ + String finishToolSession(Long toolSessionId, Long userId) throws DokumaranApplicationException; + + /** + * Return monitoring summary list. The return value is list of dokumaran summaries for each groups. + * + * @param contentId + * @return + */ + List getSummary(Long contentId); + + /** + * Create refection entry into notebook tool. + * + * @param sessionId + * @param notebook_tool + * @param tool_signature + * @param userId + * @param entryText + */ + Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId, + String entryText); + + /** + * Get reflection entry from notebook tool. + * + * @param sessionId + * @param idType + * @param signature + * @param userID + * @return + */ + NotebookEntry getEntry(Long sessionId, Integer idType, String signature, Integer userID); + + /** + * @param notebookEntry + */ + void updateEntry(NotebookEntry notebookEntry); + + /** + * Get Reflect DTO list. + * + * @param contentId + * @return + */ + List getReflectList(Long contentId); + + /** + * Get user by UID + * + * @param uid + * @return + */ + DokumaranUser getUser(Long uid); + + /** + * Returns whether activity is grouped and therefore it is expected more than one tool session. + * + * @param toolContentID + * @return + */ + boolean isGroupedActivity(long toolContentID); +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/util/CreatePadThread.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/util/CreatePadThread.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/util/CreatePadThread.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,51 @@ +package org.lamsfoundation.lams.tool.dokumaran.util; + +import org.lamsfoundation.lams.tool.dokumaran.DokumaranConstants; +import org.lamsfoundation.lams.tool.dokumaran.service.DokumaranConfigurationException; +import org.lamsfoundation.lams.tool.dokumaran.service.IDokumaranService; + +import net.gjerull.etherpad.client.EPLiteClient; +import net.gjerull.etherpad.client.EPLiteException; + +public class CreatePadThread implements Runnable { + + private IDokumaranService service; + private Long toolSessionId; + private String dokumaranInstructions; + + public CreatePadThread(IDokumaranService service, Long toolSessionId, + String dokumaranInstructions) { + this.service = service; + this.toolSessionId = toolSessionId; + this.dokumaranInstructions = dokumaranInstructions; + } + + @Override + public void run() { + EPLiteClient client; + try { + client = service.initializeEPLiteClient(); + } catch (DokumaranConfigurationException e1) { + throw new RuntimeException(e1); + } + + String padId = DokumaranConstants.PAD_ID_PREFIX + toolSessionId; + try { + client.createPad(padId); + } catch (EPLiteException e) { + // allow recreating existing pads + if (!"padID does already exist".equals(e.getMessage())) { + throw e; + } + } + + //set initial content + String etherpadHtml = "" + dokumaranInstructions.replaceAll("[\n\r\f]", "").replaceAll(" ", "") + + ""; + client.setHTML(padId, etherpadHtml); + + //gets read-only id + String etherpadReadOnlyId = (String) client.getReadOnlyID(padId).get("readOnlyID"); + service.setEtherpadReadOnlyId(toolSessionId, etherpadReadOnlyId); + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/util/DokumaranToolContentHandler.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/util/DokumaranToolContentHandler.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/util/DokumaranToolContentHandler.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,78 @@ +/**************************************************************** + * 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.dokumaran.util; + +import org.lamsfoundation.lams.contentrepository.client.ToolContentHandler; + +/** + * Simple client for accessing the content repository. + * + * @author Fiona Malikoff + */ +public class DokumaranToolContentHandler extends ToolContentHandler { + + private static String repositoryWorkspaceName = "shareddokumaranworkspace"; + private static String repositoryUser = "shareddokumaran"; + //shareddokumaran + private static char[] repositoryId = { 'l', 'a', 'm', 's', '-', 's', 'h', 'a', 'r', 'e', 'd', 'r', 'e', 's', 'o', + 'u', 'r', 'c', 'e', 's' }; + + /** + * + */ + public DokumaranToolContentHandler() { + super(); + } + + /* + * (non-Javadoc) + * + * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryWorkspaceName() + */ + @Override + public String getRepositoryWorkspaceName() { + return repositoryWorkspaceName; + } + + /* + * (non-Javadoc) + * + * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryUser() + */ + @Override + public String getRepositoryUser() { + return repositoryUser; + } + + /* + * (non-Javadoc) + * + * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryId() + */ + @Override + public char[] getRepositoryId() { + return repositoryId; + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/util/ReflectDTOComparator.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/util/ReflectDTOComparator.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/util/ReflectDTOComparator.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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.dokumaran.util; + +import java.util.Comparator; + +import org.lamsfoundation.lams.tool.dokumaran.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; + } + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/AdminAction.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/AdminAction.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/AdminAction.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,70 @@ +package org.lamsfoundation.lams.tool.dokumaran.web.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranConfigItem; +import org.lamsfoundation.lams.tool.dokumaran.service.DokumaranServiceProxy; +import org.lamsfoundation.lams.tool.dokumaran.service.IDokumaranService; +import org.lamsfoundation.lams.tool.dokumaran.web.form.AdminForm; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; + +/** + * @author Andrey Balan + */ +public class AdminAction extends LamsDispatchAction { + public IDokumaranService dokumaranService; + + @Override + public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + // set up mdlForumService + if (dokumaranService == null) { + dokumaranService = DokumaranServiceProxy.getDokumaranService(this.getServlet().getServletContext()); + } + + AdminForm adminForm = (AdminForm) form; + + DokumaranConfigItem etherpadUrl = dokumaranService.getConfigItem(DokumaranConfigItem.KEY_ETHERPAD_URL); + if (etherpadUrl != null) { + adminForm.setEtherpadUrl(etherpadUrl.getConfigValue()); + } + + DokumaranConfigItem apiKey = dokumaranService.getConfigItem(DokumaranConfigItem.KEY_API_KEY); + if (apiKey != null) { + adminForm.setApiKey(apiKey.getConfigValue()); + } + + request.setAttribute("error", false); + return mapping.findForward("config"); + } + + public ActionForward saveContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + AdminForm adminForm = (AdminForm) form; + + if (adminForm.getApiKey() != null && !adminForm.getApiKey().equals("")) { + // set up mdlForumService + if (dokumaranService == null) { + dokumaranService = DokumaranServiceProxy.getDokumaranService(this.getServlet().getServletContext()); + } + + DokumaranConfigItem etherpadUrl = dokumaranService.getConfigItem(DokumaranConfigItem.KEY_ETHERPAD_URL); + etherpadUrl.setConfigValue(adminForm.getEtherpadUrl()); + dokumaranService.saveOrUpdateDokumaranConfigItem(etherpadUrl); + + DokumaranConfigItem apiKey = dokumaranService.getConfigItem(DokumaranConfigItem.KEY_API_KEY); + apiKey.setConfigValue(adminForm.getApiKey()); + dokumaranService.saveOrUpdateDokumaranConfigItem(apiKey); + + request.setAttribute("savedSuccess", true); + return mapping.findForward("config"); + } else { + request.setAttribute("error", true); + return mapping.findForward("config"); + } + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/AuthoringAction.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/AuthoringAction.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/AuthoringAction.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,289 @@ +/**************************************************************** + * 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.dokumaran.web.action; + +import java.sql.Timestamp; +import java.util.Date; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.commons.beanutils.PropertyUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.authoring.web.AuthoringConstants; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.dokumaran.DokumaranConstants; +import org.lamsfoundation.lams.tool.dokumaran.model.Dokumaran; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranUser; +import org.lamsfoundation.lams.tool.dokumaran.service.IDokumaranService; +import org.lamsfoundation.lams.tool.dokumaran.web.form.DokumaranForm; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * @author Steve.Ni + */ +public class AuthoringAction extends Action { + + private static Logger log = Logger.getLogger(AuthoringAction.class); + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + + String param = mapping.getParameter(); + // -----------------------Dokumaran Author function--------------------------- + if (param.equals("start")) { + ToolAccessMode mode = getAccessMode(request); + // teacher mode "check for new" button enter. + if (mode != null) { + request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); + } else { + request.setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.AUTHOR.toString()); + } + return start(mapping, form, request, response); + } + if (param.equals("definelater")) { + // update define later flag to true + Long contentId = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + IDokumaranService service = getDokumaranService(); + Dokumaran dokumaran = service.getDokumaranByContentId(contentId); + + dokumaran.setDefineLater(true); + service.saveOrUpdateDokumaran(dokumaran); + + request.setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.TEACHER.toString()); + return start(mapping, form, request, response); + } + if (param.equals("initPage")) { + return initPage(mapping, form, request, response); + } + if (param.equals("updateContent")) { + return updateContent(mapping, form, request, response); + } + + return mapping.findForward(DokumaranConstants.ERROR); + } + + /** + * Read dokumaran data from database and put them into HttpSession. It will + * redirect to init.do directly after this method run successfully. + * + * This method will avoid read database again and lost un-saved resouce item + * lost when user "refresh page", + * + * @throws ServletException + * + */ + private ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws ServletException { + + // save toolContentID into HTTPSession + Long contentId = new Long(WebUtil.readLongParam(request, DokumaranConstants.PARAM_TOOL_CONTENT_ID)); + + // get back the dokumaran and item list and display them on page + IDokumaranService service = getDokumaranService(); + + Dokumaran dokumaran = null; + DokumaranForm dokumaranForm = (DokumaranForm) form; + + // Get contentFolderID and save to form. + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + dokumaranForm.setContentFolderID(contentFolderID); + + // initial Session Map + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + dokumaranForm.setSessionMapID(sessionMap.getSessionID()); + + try { + dokumaran = service.getDokumaranByContentId(contentId); + // if dokumaran does not exist, try to use default content instead. + if (dokumaran == null) { + dokumaran = service.getDefaultContent(contentId); + } + + dokumaranForm.setDokumaran(dokumaran); + } catch (Exception e) { + AuthoringAction.log.error(e); + throw new ServletException(e); + } + + sessionMap.put(DokumaranConstants.ATTR_RESOURCE_FORM, dokumaranForm); + request.getSession().setAttribute(AttributeNames.PARAM_NOTIFY_CLOSE_URL, + request.getParameter(AttributeNames.PARAM_NOTIFY_CLOSE_URL)); + return mapping.findForward(DokumaranConstants.SUCCESS); + } + + /** + * Display same entire authoring page content from HttpSession variable. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ServletException + */ + private ActionForward initPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws ServletException { + String sessionMapID = WebUtil.readStrParam(request, DokumaranConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + DokumaranForm existForm = (DokumaranForm) sessionMap.get(DokumaranConstants.ATTR_RESOURCE_FORM); + + DokumaranForm dokumaranForm = (DokumaranForm) form; + try { + PropertyUtils.copyProperties(dokumaranForm, existForm); + } catch (Exception e) { + throw new ServletException(e); + } + + ToolAccessMode mode = getAccessMode(request); + if (mode.isAuthor()) { + return mapping.findForward(DokumaranConstants.SUCCESS); + } else { + return mapping.findForward(DokumaranConstants.DEFINE_LATER); + } + } + + /** + * This method will persist all inforamtion in this authoring page, include + * all dokumaran item, information etc. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ServletException + */ + private ActionForward updateContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + DokumaranForm dokumaranForm = (DokumaranForm) form; + + // get back sessionMAP + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(dokumaranForm.getSessionMapID()); + ToolAccessMode mode = getAccessMode(request); + Dokumaran dokumaran = dokumaranForm.getDokumaran(); + IDokumaranService service = getDokumaranService(); + + // **********************************Get Dokumaran PO********************* + Dokumaran dokumaranPO = service.getDokumaranByContentId(dokumaran.getContentId()); + if (dokumaranPO == null) { + // new Dokumaran, create it. + dokumaranPO = dokumaran; + dokumaranPO.setCreated(new Timestamp(new Date().getTime())); + dokumaranPO.setUpdated(new Timestamp(new Date().getTime())); + } else { + if (mode.isAuthor()) { + Long uid = dokumaranPO.getUid(); + PropertyUtils.copyProperties(dokumaranPO, dokumaran); + + // 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 + dokumaranForm.setDokumaran(null); + dokumaran = null; + // get back UID + dokumaranPO.setUid(uid); + } else { // if it is Teacher, then just update basic tab content + // (definelater) + dokumaranPO.setInstructions(dokumaran.getInstructions()); + dokumaranPO.setTitle(dokumaran.getTitle()); + // change define later status + dokumaranPO.setDefineLater(false); + } + dokumaranPO.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); + DokumaranUser dokumaranUser = service.getUserByIDAndContent(new Long(user.getUserID().intValue()), + dokumaranPO.getContentId()); + if (dokumaranUser == null) { + dokumaranUser = new DokumaranUser(user, dokumaranPO); + } + + dokumaranPO.setCreatedBy(dokumaranUser); + + // ***************************** finally persist dokumaranPO again + service.saveOrUpdateDokumaran(dokumaranPO); + + dokumaranForm.setDokumaran(dokumaranPO); + + request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); + if (mode.isAuthor()) { + return mapping.findForward("author"); + } else { + return mapping.findForward("monitor"); + } + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + /** + * Return DokumaranService bean. + */ + private IDokumaranService getDokumaranService() { + WebApplicationContext wac = WebApplicationContextUtils + .getRequiredWebApplicationContext(getServlet().getServletContext()); + return (IDokumaranService) wac.getBean(DokumaranConstants.RESOURCE_SERVICE); + } + + /** + * Get ToolAccessMode from HttpRequest parameters. Default value is AUTHOR + * mode. + * + * @param request + * @return + */ + private ToolAccessMode getAccessMode(HttpServletRequest request) { + ToolAccessMode mode; + String modeStr = request.getParameter(AttributeNames.ATTR_MODE); + if (StringUtils.equalsIgnoreCase(modeStr, ToolAccessMode.TEACHER.toString())) { + mode = ToolAccessMode.TEACHER; + } else { + mode = ToolAccessMode.AUTHOR; + } + return mode; + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/ClearSessionAction.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/ClearSessionAction.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/ClearSessionAction.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,48 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + +package org.lamsfoundation.lams.tool.dokumaran.web.action; + +import javax.servlet.http.HttpSession; + +import org.lamsfoundation.lams.authoring.web.LamsAuthoringFinishAction; +import org.lamsfoundation.lams.tool.ToolAccessMode; + +/** + * This class give a chance to clear HttpSession when user save/close authoring page. + * + * @author Steve.Ni + * + * @version $Revision$ + */ +public class ClearSessionAction extends LamsAuthoringFinishAction { + + @Override + public void clearSession(String customiseSessionID, HttpSession session, ToolAccessMode mode) { + if (mode.isAuthor()) { + session.removeAttribute(customiseSessionID); + } + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/LearningAction.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/LearningAction.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/LearningAction.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,399 @@ +/**************************************************************** + * 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.dokumaran.web.action; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +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.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.tomcat.util.json.JSONException; +import org.apache.tomcat.util.json.JSONObject; +import org.lamsfoundation.lams.learning.web.bean.ActivityPositionDTO; +import org.lamsfoundation.lams.learning.web.util.LearningWebUtil; +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.dokumaran.DokumaranConstants; +import org.lamsfoundation.lams.tool.dokumaran.model.Dokumaran; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranConfigItem; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranSession; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranUser; +import org.lamsfoundation.lams.tool.dokumaran.service.DokumaranApplicationException; +import org.lamsfoundation.lams.tool.dokumaran.service.DokumaranConfigurationException; +import org.lamsfoundation.lams.tool.dokumaran.service.IDokumaranService; +import org.lamsfoundation.lams.tool.dokumaran.web.form.ReflectionForm; +import org.lamsfoundation.lams.usermanagement.User; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.HashUtil; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * @author Steve.Ni + */ +public class LearningAction extends Action { + + private static Logger log = Logger.getLogger(LearningAction.class); + + private static IDokumaranService dokumaranService; + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, JSONException, DokumaranConfigurationException { + + String param = mapping.getParameter(); + // -----------------------Dokumaran Learner function --------------------------- + if (param.equals("start")) { + return start(mapping, form, request, response); + } + if (param.equals("checkLeaderProgress")) { + return checkLeaderProgress(mapping, form, request, response); + } + if (param.equals("finish")) { + return finish(mapping, form, request, response); + } + + // ================ Reflection ======================= + if (param.equals("newReflection")) { + return newReflection(mapping, form, request, response); + } + if (param.equals("submitReflection")) { + return submitReflection(mapping, form, request, response); + } + + return mapping.findForward(DokumaranConstants.ERROR); + } + + /** + * Read dokumaran data from database and put them into HttpSession. It will redirect to init.do directly after this + * method run successfully. + * + * This method will avoid read database again and lost un-saved resouce item lost when user "refresh page", + * @throws DokumaranConfigurationException + * + */ + private ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws DokumaranConfigurationException { + + // initial Session Map + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + request.setAttribute(DokumaranConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + + ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, true); + Long toolSessionId = new Long(request.getParameter(DokumaranConstants.PARAM_TOOL_SESSION_ID)); + IDokumaranService service = getDokumaranService(); + Dokumaran dokumaran = service.getDokumaranBySessionId(toolSessionId); + DokumaranSession session = service.getDokumaranSessionBySessionId(toolSessionId); + + // get back the dokumaran and item list and display them on page + DokumaranUser user = null; + if ((mode != null) && mode.isTeacher()) { + // monitoring mode - user is specified in URL + // dokumaranUser may be null if the user was force completed. + user = getSpecifiedUser(service, toolSessionId, + WebUtil.readIntParam(request, AttributeNames.PARAM_USER_ID, false)); + } else { + user = getCurrentUser(service, toolSessionId); + } + + // support for leader select feature + DokumaranUser groupLeader = dokumaran.isUseSelectLeaderToolOuput() + ? service.checkLeaderSelectToolForSessionLeader(user, new Long(toolSessionId).longValue()) + : null; + // forwards to the leaderSelection page + if (dokumaran.isUseSelectLeaderToolOuput() && (groupLeader == null) && !mode.isTeacher()) { + + // get group users and store it to request as DTO objects + List groupUsers = service.getUsersBySession(toolSessionId); + List groupUserDtos = new ArrayList(); + for (DokumaranUser groupUser : groupUsers) { + User groupUserDto = new User(); + groupUserDto.setFirstName(groupUser.getFirstName()); + groupUserDto.setLastName(groupUser.getLastName()); + groupUserDtos.add(groupUserDto); + } + request.setAttribute(DokumaranConstants.ATTR_GROUP_USERS, groupUserDtos); + request.setAttribute(DokumaranConstants.ATTR_DOKUMARAN, dokumaran); + return mapping.findForward("waitforleader"); + } + sessionMap.put(DokumaranConstants.ATTR_GROUP_LEADER, groupLeader); + boolean isUserLeader = session.isUserGroupLeader(user.getUid()); + + // check whether finish lock is on/off + boolean finishedLock = dokumaran.getLockWhenFinished() && (user != null) && user.isSessionFinished(); + boolean hasEditRight = !dokumaran.isUseSelectLeaderToolOuput() + || dokumaran.isUseSelectLeaderToolOuput() && isUserLeader; + + // basic information + sessionMap.put(DokumaranConstants.ATTR_TITLE, dokumaran.getTitle()); + sessionMap.put(DokumaranConstants.ATTR_INSTRUCTIONS, dokumaran.getInstructions()); + sessionMap.put(DokumaranConstants.ATTR_FINISH_LOCK, finishedLock); + sessionMap.put(DokumaranConstants.ATTR_LOCK_ON_FINISH, dokumaran.getLockWhenFinished()); + sessionMap.put(DokumaranConstants.ATTR_USER_FINISHED, + (user != null) && user.isSessionFinished()); + sessionMap.put(DokumaranConstants.ATTR_HAS_EDIT_RIGHT, hasEditRight); + sessionMap.put(DokumaranConstants.ATTR_IS_LEADER_RESPONSE_FINALIZED, groupLeader != null && groupLeader.isSessionFinished()); + sessionMap.put(AttributeNames.PARAM_TOOL_SESSION_ID, toolSessionId); + sessionMap.put(AttributeNames.ATTR_MODE, mode); + + // reflection information + String entryText = new String(); + if (user != null) { + NotebookEntry notebookEntry = service.getEntry(toolSessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + DokumaranConstants.TOOL_SIGNATURE, user.getUserId().intValue()); + if (notebookEntry != null) { + entryText = notebookEntry.getEntry(); + } + } + sessionMap.put(DokumaranConstants.ATTR_REFLECTION_ON, dokumaran.isReflectOnActivity()); + sessionMap.put(DokumaranConstants.ATTR_REFLECTION_INSTRUCTION, dokumaran.getReflectInstructions()); + sessionMap.put(DokumaranConstants.ATTR_REFLECTION_ENTRY, entryText); + + // add define later support + if (dokumaran.isDefineLater()) { + return mapping.findForward("defineLater"); + } + + // set contentInUse flag to true! + dokumaran.setContentInUse(true); + dokumaran.setDefineLater(false); + service.saveOrUpdateDokumaran(dokumaran); + + ActivityPositionDTO activityPosition = LearningWebUtil + .putActivityPositionInRequestByToolSessionId(toolSessionId, request, getServlet().getServletContext()); + sessionMap.put(AttributeNames.ATTR_ACTIVITY_POSITION, activityPosition); + + sessionMap.put(DokumaranConstants.ATTR_DOKUMARAN, dokumaran); + + // get the API key from the config table and add it to the session + DokumaranConfigItem etherpadServerUrlConfig = dokumaranService.getConfigItem(DokumaranConfigItem.KEY_ETHERPAD_URL); + DokumaranConfigItem apiKeyConfig = dokumaranService.getConfigItem(DokumaranConfigItem.KEY_API_KEY); + if (apiKeyConfig == null || apiKeyConfig.getConfigValue() == null || etherpadServerUrlConfig == null || etherpadServerUrlConfig.getConfigValue() == null) { + return mapping.findForward("notconfigured"); + } + String etherpadServerUrl = etherpadServerUrlConfig.getConfigValue(); + request.setAttribute(DokumaranConstants.KEY_ETHERPAD_SERVER_URL, etherpadServerUrl); + + String padId = HashUtil.sha1(DokumaranConstants.PAD_ID_PREFIX + toolSessionId); + //in case of non-leader or finished lock - show Etherpad in readonly mode + if (dokumaran.isUseSelectLeaderToolOuput() && !isUserLeader || finishedLock) { + padId = session.getEtherpadReadOnlyId(); + //in case Etherpad didn't have enough time to initialize - show notconfigured.jsp + if (padId == null) { + return mapping.findForward("notconfigured"); + } + } + request.setAttribute(DokumaranConstants.ATTR_PAD_ID, padId); + + return mapping.findForward(DokumaranConstants.SUCCESS); + } + + /** + * Checks Leader Progress + */ + private ActionForward checkLeaderProgress(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws JSONException, IOException { + + IDokumaranService service = getDokumaranService(); + Long toolSessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + + DokumaranSession session = service.getDokumaranSessionBySessionId(toolSessionId); + DokumaranUser leader = session.getGroupLeader(); + + boolean isLeaderResponseFinalized = leader.isSessionFinished(); + + JSONObject JSONObject = new JSONObject(); + JSONObject.put(DokumaranConstants.ATTR_IS_LEADER_RESPONSE_FINALIZED, isLeaderResponseFinalized); + response.setContentType("application/x-json;charset=utf-8"); + response.getWriter().print(JSONObject); + return null; + } + + /** + * Finish learning session. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + // get back SessionMap + String sessionMapID = request.getParameter(DokumaranConstants.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); + + IDokumaranService service = getDokumaranService(); + // get sessionId from HttpServletRequest + String nextActivityUrl = null; + try { + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + Long userID = new Long(user.getUserID().longValue()); + + nextActivityUrl = service.finishToolSession(sessionId, userID); + request.setAttribute(DokumaranConstants.ATTR_NEXT_ACTIVITY_URL, nextActivityUrl); + } catch (DokumaranApplicationException e) { + LearningAction.log.error("Failed get next activity url:" + e.getMessage()); + } + + return mapping.findForward(DokumaranConstants.SUCCESS); + } + + /** + * Display empty reflection form. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward newReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + // get session value + String sessionMapID = WebUtil.readStrParam(request, DokumaranConstants.ATTR_SESSION_MAP_ID); + ReflectionForm refForm = (ReflectionForm) form; + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + + refForm.setUserID(user.getUserID()); + refForm.setSessionMapID(sessionMapID); + + // get the existing reflection entry + IDokumaranService submitFilesService = getDokumaranService(); + + SessionMap map = (SessionMap) request.getSession().getAttribute(sessionMapID); + Long toolSessionID = (Long) map.get(AttributeNames.PARAM_TOOL_SESSION_ID); + NotebookEntry entry = submitFilesService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + DokumaranConstants.TOOL_SIGNATURE, user.getUserID()); + + if (entry != null) { + refForm.setEntryText(entry.getEntry()); + } + + return mapping.findForward(DokumaranConstants.SUCCESS); + } + + /** + * Submit reflection form input database. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + ReflectionForm refForm = (ReflectionForm) form; + Integer userId = refForm.getUserID(); + + String sessionMapID = WebUtil.readStrParam(request, DokumaranConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession() + .getAttribute(sessionMapID); + Long sessionId = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID); + + IDokumaranService service = getDokumaranService(); + + // check for existing notebook entry + NotebookEntry entry = service.getEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + DokumaranConstants.TOOL_SIGNATURE, userId); + + if (entry == null) { + // create new entry + service.createNotebookEntry(sessionId, CoreNotebookConstants.NOTEBOOK_TOOL, + DokumaranConstants.TOOL_SIGNATURE, userId, refForm.getEntryText()); + } else { + // update existing entry + entry.setEntry(refForm.getEntryText()); + entry.setLastModified(new Date()); + service.updateEntry(entry); + } + + return finish(mapping, form, request, response); + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + + private IDokumaranService getDokumaranService() { + if (LearningAction.dokumaranService == null) { + WebApplicationContext wac = WebApplicationContextUtils + .getRequiredWebApplicationContext(getServlet().getServletContext()); + LearningAction.dokumaranService = (IDokumaranService) wac.getBean(DokumaranConstants.RESOURCE_SERVICE); + } + return LearningAction.dokumaranService; + } + + private DokumaranUser getCurrentUser(IDokumaranService service, Long sessionId) { + // try to get form system session + HttpSession ss = SessionManager.getSession(); + // get back login user DTO + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + DokumaranUser dokumaranUser = service.getUserByIDAndSession(new Long(user.getUserID().intValue()), sessionId); + + if (dokumaranUser == null) { + DokumaranSession session = service.getDokumaranSessionBySessionId(sessionId); + dokumaranUser = new DokumaranUser(user, session); + service.createUser(dokumaranUser); + } + return dokumaranUser; + } + + private DokumaranUser getSpecifiedUser(IDokumaranService service, Long sessionId, Integer userId) { + DokumaranUser dokumaranUser = service.getUserByIDAndSession(new Long(userId.intValue()), sessionId); + if (dokumaranUser == null) { + LearningAction.log + .error("Unable to find specified user for dokumaran activity. Screens are likely to fail. SessionId=" + + sessionId + " UserId=" + userId); + } + return dokumaranUser; + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/MonitoringAction.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/MonitoringAction.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/action/MonitoringAction.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,151 @@ +/**************************************************************** + * 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.dokumaran.web.action; + +import java.io.IOException; +import java.util.List; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.tomcat.util.json.JSONException; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; +import org.lamsfoundation.lams.tool.dokumaran.DokumaranConstants; +import org.lamsfoundation.lams.tool.dokumaran.dto.ReflectDTO; +import org.lamsfoundation.lams.tool.dokumaran.dto.SessionDTO; +import org.lamsfoundation.lams.tool.dokumaran.model.Dokumaran; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranConfigItem; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranSession; +import org.lamsfoundation.lams.tool.dokumaran.model.DokumaranUser; +import org.lamsfoundation.lams.tool.dokumaran.service.IDokumaranService; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +public class MonitoringAction extends Action { + public static Logger log = Logger.getLogger(MonitoringAction.class); + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException, JSONException { + String param = mapping.getParameter(); + + request.setAttribute("initialTabId", WebUtil.readLongParam(request, AttributeNames.PARAM_CURRENT_TAB, true)); + + if (param.equals("summary")) { + return summary(mapping, form, request, response); + } + if (param.equals("viewReflection")) { + return viewReflection(mapping, form, request, response); + } + + return mapping.findForward(DokumaranConstants.ERROR); + } + + private ActionForward summary(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + // initial Session Map + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + request.setAttribute(DokumaranConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + // save contentFolderID into session + sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID, + WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID)); + + Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + IDokumaranService service = getDokumaranService(); + List groupList = service.getSummary(contentId); + + Dokumaran dokumaran = service.getDokumaranByContentId(contentId); + + // Create reflectList if reflection is enabled. + if (dokumaran.isReflectOnActivity()) { + List relectList = service.getReflectList(contentId); + sessionMap.put(DokumaranConstants.ATTR_REFLECT_LIST, relectList); + } + + // cache into sessionMap + sessionMap.put(DokumaranConstants.ATTR_SUMMARY_LIST, groupList); + sessionMap.put(DokumaranConstants.PAGE_EDITABLE, dokumaran.isContentInUse()); + sessionMap.put(DokumaranConstants.ATTR_DOKUMARAN, dokumaran); + sessionMap.put(DokumaranConstants.ATTR_TOOL_CONTENT_ID, contentId); + sessionMap.put(DokumaranConstants.ATTR_IS_GROUPED_ACTIVITY, service.isGroupedActivity(contentId)); + + // get the API key from the config table and add it to the session + DokumaranConfigItem etherpadServerUrlConfig = service.getConfigItem(DokumaranConfigItem.KEY_ETHERPAD_URL); + if (etherpadServerUrlConfig == null || etherpadServerUrlConfig.getConfigValue() == null) { + return mapping.findForward("notconfigured"); + } + String etherpadServerUrl = etherpadServerUrlConfig.getConfigValue(); + request.setAttribute(DokumaranConstants.KEY_ETHERPAD_SERVER_URL, etherpadServerUrl); + + return mapping.findForward(DokumaranConstants.SUCCESS); + } + + private ActionForward viewReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { + + Long uid = WebUtil.readLongParam(request, DokumaranConstants.ATTR_USER_UID); + Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + + IDokumaranService service = getDokumaranService(); + DokumaranUser user = service.getUser(uid); + NotebookEntry notebookEntry = service.getEntry(sessionID, CoreNotebookConstants.NOTEBOOK_TOOL, + DokumaranConstants.TOOL_SIGNATURE, user.getUserId().intValue()); + + DokumaranSession session = service.getDokumaranSessionBySessionId(sessionID); + + ReflectDTO refDTO = new ReflectDTO(user); + if (notebookEntry == null) { + refDTO.setFinishReflection(false); + refDTO.setReflect(null); + } else { + refDTO.setFinishReflection(true); + refDTO.setReflect(notebookEntry.getEntry()); + } + refDTO.setReflectInstrctions(session.getDokumaran().getReflectInstructions()); + + request.setAttribute("userDTO", refDTO); + return mapping.findForward("success"); + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + private IDokumaranService getDokumaranService() { + WebApplicationContext wac = WebApplicationContextUtils + .getRequiredWebApplicationContext(getServlet().getServletContext()); + return (IDokumaranService) wac.getBean(DokumaranConstants.RESOURCE_SERVICE); + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/form/AdminForm.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/form/AdminForm.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/form/AdminForm.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,40 @@ +package org.lamsfoundation.lams.tool.dokumaran.web.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; + +/** + * + */ +public class AdminForm extends ActionForm { + private static final long serialVersionUID = 414425664356226L; + + private String etherpadUrl; + private String apiKey; + + @Override + public ActionErrors validate(ActionMapping arg0, HttpServletRequest arg1) { + ActionErrors ac = new ActionErrors(); +// ac.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("this is an error")); + return ac; + } + + public String getEtherpadUrl() { + return etherpadUrl; + } + + public void setEtherpadUrl(String etherpadUrl) { + this.etherpadUrl = etherpadUrl; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/form/DokumaranForm.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/form/DokumaranForm.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/form/DokumaranForm.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,127 @@ +/**************************************************************** + * 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.dokumaran.web.form; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.tool.dokumaran.model.Dokumaran; + +/** + * Dokumaran Form. + * + * User: Dapeng.Ni + */ +public class DokumaranForm extends ActionForm { + private static final long serialVersionUID = 3599879328307492312L; + + private static Logger logger = Logger.getLogger(DokumaranForm.class.getName()); + + // Forum fields + private String sessionMapID; + private String contentFolderID; + private int currentTab; + private FormFile offlineFile; + private FormFile onlineFile; + + private Dokumaran dokumaran; + + public DokumaranForm() { + dokumaran = new Dokumaran(); + dokumaran.setTitle("Shared Dokumaran"); + currentTab = 1; + } + + public void setDokumaran(Dokumaran dokumaran) { + this.dokumaran = dokumaran; + // set Form special varaible from given forum + if (dokumaran == null) { + logger.error("Initial DokumaranForum failed by null value of Dokumaran."); + } + } + + @Override + public void reset(ActionMapping mapping, HttpServletRequest request) { + String param = mapping.getParameter(); + // if it is start page, all data read out from database or current session + // so need not reset checkbox to refresh value! + if (!StringUtils.equals(param, "start") && !StringUtils.equals(param, "initPage")) { + dokumaran.setShowChat(false); + dokumaran.setShowLineNumbers(false); + dokumaran.setLockWhenFinished(false); + dokumaran.setDefineLater(false); + dokumaran.setUseSelectLeaderToolOuput(false); + dokumaran.setReflectOnActivity(false); + } + } + + public int getCurrentTab() { + return currentTab; + } + + public void setCurrentTab(int currentTab) { + this.currentTab = currentTab; + } + + public FormFile getOfflineFile() { + return offlineFile; + } + + public void setOfflineFile(FormFile offlineFile) { + this.offlineFile = offlineFile; + } + + public FormFile getOnlineFile() { + return onlineFile; + } + + public void setOnlineFile(FormFile onlineFile) { + this.onlineFile = onlineFile; + } + + public Dokumaran getDokumaran() { + return dokumaran; + } + + public String getSessionMapID() { + return sessionMapID; + } + + public void setSessionMapID(String sessionMapID) { + this.sessionMapID = sessionMapID; + } + + public String getContentFolderID() { + return contentFolderID; + } + + public void setContentFolderID(String contentFolderID) { + this.contentFolderID = contentFolderID; + } + +} Index: lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/form/ReflectionForm.java =================================================================== diff -u --- lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/form/ReflectionForm.java (revision 0) +++ lams_tool_doku/src/java/org/lamsfoundation/lams/tool/dokumaran/web/form/ReflectionForm.java (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,68 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + + +package org.lamsfoundation.lams.tool.dokumaran.web.form; + +import org.apache.log4j.Logger; +import org.apache.struts.validator.ValidatorForm; + +/** + * + * Reflection Form. + * + * + */ +public class ReflectionForm extends ValidatorForm { + private static final long serialVersionUID = -9054365604649146735L; + private static Logger logger = Logger.getLogger(ReflectionForm.class.getName()); + + private Integer userID; + private String sessionMapID; + private String entryText; + + public String getEntryText() { + return entryText; + } + + public void setEntryText(String entryText) { + this.entryText = entryText; + } + + public Integer getUserID() { + return userID; + } + + public void setUserID(Integer userUid) { + this.userID = userUid; + } + + public String getSessionMapID() { + return sessionMapID; + } + + public void setSessionMapID(String sessionMapID) { + this.sessionMapID = sessionMapID; + } + +} Index: lams_tool_doku/web/403.jsp =================================================================== diff -u --- lams_tool_doku/web/403.jsp (revision 0) +++ lams_tool_doku/web/403.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,6 @@ +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c" %> + + + Index: lams_tool_doku/web/404.jsp =================================================================== diff -u --- lams_tool_doku/web/404.jsp (revision 0) +++ lams_tool_doku/web/404.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,8 @@ +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c" %> + + + + + Index: lams_tool_doku/web/WEB-INF/struts-config.xml =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/struts-config.xml (revision 0) +++ lams_tool_doku/web/WEB-INF/struts-config.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_doku/web/WEB-INF/tags/AdvancedAccordian.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/AdvancedAccordian.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/AdvancedAccordian.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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"%> + +
+
+ + +
+ +
+
+
+ Index: lams_tool_doku/web/WEB-INF/tags/Alert.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/Alert.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/Alert.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tags/Arrow.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/Arrow.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/Arrow.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,55 @@ +<%@ tag body-content="scriptless"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-function" prefix="fn" %> + +<%-- state = up: up arrow; state = down: down arrow --%> +<%@ attribute name="state" required="true" rtexprvalue="true"%> +<%@ attribute name="title" 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="${title}" + + + + + + + + + onclick="${onclick}" + + + + + + + + + id="${id}" + + + + + + + + + style='display:${display}' + + + + + + + + + + + + + + Index: lams_tool_doku/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/AuthoringButton.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/AuthoringButton.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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="tags-html" prefix="html" %> +<%@ 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 --%> + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Index: lams_tool_doku/web/WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/AuthoringRatingAllStyleCriteria.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,420 @@ +<% + /** + * 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="tags-html" prefix="html" %> +<%@ 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 --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ +
+ + + +
+
+ +
+ + + +   + +
+ +
+ Index: lams_tool_doku/web/WEB-INF/tags/AuthoringRatingCriteria.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/AuthoringRatingCriteria.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/AuthoringRatingCriteria.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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="tags-html" prefix="html" %> +<%@ 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 + +
+
+ +
+ +
+ +
+ + +
+
+
+
+ Index: lams_tool_doku/web/WEB-INF/tags/CKEditor.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/CKEditor.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/CKEditor.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,100 @@ +<%@ 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="value" required="true" rtexprvalue="true"%> +<%@ attribute name="toolbarSet" 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_doku/web/WEB-INF/tags/Comments.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/Comments.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/Comments.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,48 @@ +<%@ 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="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="readOnly" required="false" rtexprvalue="true"%> +<%@ attribute name="pageSize" required="false" rtexprvalue="true"%> +<%@ attribute name="sortBy" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + &mode=${mode} + + + + + + + + + + + + + + +
+ Index: lams_tool_doku/web/WEB-INF/tags/CommentsAuthor.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/CommentsAuthor.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/CommentsAuthor.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,59 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ 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="commentPanelHeaderKey" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+     +   +
+
+ + + + Index: lams_tool_doku/web/WEB-INF/tags/Date.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/Date.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/Date.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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" %> + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_doku/web/WEB-INF/tags/DefineLater.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/DefineLater.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/DefineLater.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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 --%> + + + + + + + +
+
+
+ +
+
+
+
+
+ +
+
Index: lams_tool_doku/web/WEB-INF/tags/Head.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/Head.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/Head.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,43 @@ +<%/**************************************************************** + * 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_doku/web/WEB-INF/tags/ImgButtonWrapper.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/ImgButtonWrapper.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/ImgButtonWrapper.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tags/Page.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/Page.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/Page.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,345 @@ +<%@ 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="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"%> + + + true + + + + + + <%-- 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_doku/web/WEB-INF/tags/Rating.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/Rating.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/Rating.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,194 @@ +<% + /** + * 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="tags-html" prefix="html" %> +<%@ 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="showComments" required="false" rtexprvalue="true" %> + +<%-- Default value for message key --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<%--Rating stars area---------------------------------------%> + +
+
+ + + + + + + + + + + + + + + + + + + + + + ${criteriaDto.ratingCriteria.title} + + + + + + + + + + + +
+
+ + + +
+ + + + + + ${criteriaDto.numberOfVotes} + + +
+
+ + +
style="visibility: hidden;" + > + + + + + + + + + + + + + ${criteriaDto.numberOfVotes} + + +
+ +
+
+ +
+ +
+ +
+ +<%--Comments area---------------------------------------%> + +
+ + + + +
+ +
+
+
+ + +
+ +
+
+ + +
+ + + + + + + : + + + + +
+
+ +
+
+
+
+
+
+
+ +
+
Index: lams_tool_doku/web/WEB-INF/tags/RestrictedUsageAccordian.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/RestrictedUsageAccordian.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/RestrictedUsageAccordian.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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"%> + +
+
+ + + +
+ +
+
+
+ Index: lams_tool_doku/web/WEB-INF/tags/SimplePanel.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/SimplePanel.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/SimplePanel.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tags/StyledRating.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/StyledRating.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/StyledRating.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,201 @@ +<% + /** + * 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="tags-html" prefix="html" %> +<%@ 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}) + +
  • +
    +
    +
+ +   +
+
+
+ + +
Index: lams_tool_doku/web/WEB-INF/tags/TSTable.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/TSTable.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/TSTable.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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"%> + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + Index: lams_tool_doku/web/WEB-INF/tags/Tab.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/Tab.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/Tab.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tags/TabBody.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/TabBody.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/TabBody.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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 + * **************************************************************** + */ + +/** + * TabBody.tag + * Author: Mitchell Seaton + * Description: Creates the body container for a tab element + * Wiki: + */ + +%> +<%@ attribute name="id" required="true" rtexprvalue="true"%> +<%@ attribute name="tabTitle" required="false" rtexprvalue="true"%> +<%@ attribute name="titleKey" required="false" rtexprvalue="true"%> +<%@ attribute name="page" required="false" rtexprvalue="true"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-bean" prefix="bean"%> + + + + active + + +
    + + + + + + + + +
    Index: lams_tool_doku/web/WEB-INF/tags/TabBodyArea.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/TabBodyArea.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/TabBodyArea.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,39 @@ +<%/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/** + * TabBodyArea.tag + * Author: Fiona Malikoff + * Description: Creates the panel body area for a nav bar screen + * Wiki: + */ + +%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-bean" prefix="bean"%> + +
    + +
    + + Index: lams_tool_doku/web/WEB-INF/tags/TabBodys.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/TabBodys.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/TabBodys.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tags/Tabs.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/Tabs.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/Tabs.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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"%> + + + + + + + + + + + + +
    + + Index: lams_tool_doku/web/WEB-INF/tags/TextSearch.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/TextSearch.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/TextSearch.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,136 @@ +<% +/**************************************************************** + * 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="tags-html" prefix="html" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + +<%-- Required attributes --%> +<%@ attribute name="sessionMapID" required="true" rtexprvalue="true" %> +<%@ attribute name="wrapInFormTag" 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 --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +

    + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + + + + + + + + Index: lams_tool_doku/web/WEB-INF/tags/headItems.tag =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tags/headItems.tag (revision 0) +++ lams_tool_doku/web/WEB-INF/tags/headItems.tag (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tlds/jstl/c.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/jstl/c.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/jstl/c.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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 dokumaran to import. + + url + true + true + + + +Name of the exported scoped variable for the +dokumaran'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 +dokumaran's content. The type of the scoped +variable is Reader. + + varReader + false + false + + + +Name of the context when accessing a relative +URL dokumaran that belongs to a foreign +context. + + context + false + true + + + +Character encoding of the content at the input +dokumaran. + + 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 dokumaran to redirect to. + + url + false + true + + + +Name of the context when redirecting to a relative URL +dokumaran 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 +dokumaran 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_doku/web/WEB-INF/tlds/jstl/fmt.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/jstl/fmt.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/jstl/fmt.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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 dokumaran bundle to be used by its tag body + + bundle + org.apache.taglibs.standard.tag.rt.fmt.BundleTag + JSP + + +Dokumaran bundle base name. This is the bundle's +fully-qualified dokumaran 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 dokumaran bundle and stores it in the named scoped variable or + the bundle configuration variable + + setBundle + org.apache.taglibs.standard.tag.rt.fmt.SetBundleTag + empty + + +Dokumaran bundle base name. This is the bundle's +fully-qualified dokumaran 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 dokumaran +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_doku/web/WEB-INF/tlds/jstl/fn.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/jstl/fn.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/jstl/fn.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tlds/jstl/permittedTaglibs.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/jstl/permittedTaglibs.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/jstl/permittedTaglibs.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tlds/jstl/scriptfree.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/jstl/scriptfree.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/jstl/scriptfree.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tlds/jstl/x.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/jstl/x.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/jstl/x.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/WEB-INF/tlds/lams/lams.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/lams/lams.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/lams/lams.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,533 @@ + + + + + 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 dokumaran key + Converts role name into form usable as message dokumaran key + + + role + org.lamsfoundation.lams.web.tag.RoleTag + empty + + + Converts role name into form usable as message dokumaran key + role + true + + true + + + + + + + Output stylesheet based on the user preferences. + User's chosen stylesheet + + + css + org.lamsfoundation.lams.web.tag.CssTag + empty + + + Output stylesheet based on the user preferences. + style + false + + true + + + + + + + Output details from the shared session UserDTO object + user details + + + user + org.lamsfoundation.lams.web.tag.UserTag + empty + + + Output details from the shared session UserDTO object + property + true + + true + + + + + + + STRUTS-textarea + org.lamsfoundation.lams.web.tag.MultiLinesTextareaTag + empty + + accesskey + false + true + + + alt + false + true + + + altKey + false + true + + + bundle + false + true + + + cols + false + true + + + disabled + false + true + + + errorKey + false + true + + + errorStyle + false + true + + + errorStyleClass + false + true + + + errorStyleId + false + true + + + index + false + true + + + indexed + false + true + + + name + false + true + + + onblur + false + true + + + onchange + false + true + + + onclick + false + true + + + ondblclick + false + true + + + onfocus + false + true + + + onkeydown + false + true + + + onkeypress + false + true + + + onkeyup + false + true + + + onmousedown + false + true + + + onmousemove + false + true + + + onmouseout + false + true + + + onmouseover + false + true + + + onmouseup + false + true + + + property + true + true + + + readonly + false + true + + + rows + false + true + + + style + false + true + + + styleClass + false + true + + + styleId + false + true + + + tabindex + false + true + + + title + false + true + + + titleKey + false + true + + + value + false + true + + + + Tab + /WEB-INF/tags/Tab.tag + + + Tabs + /WEB-INF/tags/Tabs.tag + + + TabBody + /WEB-INF/tags/TabBody.tag + + + 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 + + + textarea + org.lamsfoundation.lams.web.tag.LAMSMultiLinesTextareaTag + JSP + true + + Render text exactly same as original input, which even won't escape the input HTML tag. + + + + + name + true + true + + + + + id + false + true + + + + + onchange + false + true + + + + head + /WEB-INF/tags/Head.tag + + + Comments + /WEB-INF/tags/Comments.tag + + + CommentsAuthor + /WEB-INF/tags/CommentsAuthor.tag + + + Index: lams_tool_doku/web/WEB-INF/tlds/struts/struts-bean-el.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/struts/struts-bean-el.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/struts/struts-bean-el.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,212 @@ + + + + + + + + + + +1.2 +1.1 +bean +http://struts.apache.org/tags-bean-el + +include +org.apache.strutsel.taglib.bean.ELIncludeTag +org.apache.struts.taglib.bean.IncludeTei +empty + +anchor +false +true + + +forward +false +true + + +href +false +true + + +id +true +false + + +name +false +true + + +page +false +true + + +transaction +false +true + + + +message +org.apache.strutsel.taglib.bean.ELMessageTag +empty + +arg0 +false +true + + +arg1 +false +true + + +arg2 +false +true + + +arg3 +false +true + + +arg4 +false +true + + +bundle +false +true + + +key +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +page +org.apache.strutsel.taglib.bean.ELPageTag +empty + +id +true +false + + +property +true +true + + + +resource +org.apache.strutsel.taglib.bean.ELDokumaranTag +org.apache.struts.taglib.bean.ResourceTei +empty + +id +true +false + + +input +false +true + + +name +true +true + + + +size +org.apache.strutsel.taglib.bean.ELSizeTag +org.apache.struts.taglib.bean.SizeTei +empty + +collection +false +true + + +id +true +false + + +name +false +true + + +property +false +true + + +scope +false +true + + + +struts +org.apache.strutsel.taglib.bean.ELStrutsTag +org.apache.struts.taglib.bean.StrutsTei +empty + +id +true +false + + +formBean +false +true + + +forward +false +true + + +mapping +false +true + + + + + + Index: lams_tool_doku/web/WEB-INF/tlds/struts/struts-bean.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/struts/struts-bean.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/struts/struts-bean.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,382 @@ + + + + + + + + + + +1.2 +1.1 +bean +http://struts.apache.org/tags-bean + +cookie +org.apache.struts.taglib.bean.CookieTag +org.apache.struts.taglib.bean.CookieTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +define +org.apache.struts.taglib.bean.DefineTag +org.apache.struts.taglib.bean.DefineTei +JSP + +id +true +false + + +name +false +true + + +property +false +true + + +scope +false +true + + +toScope +false +true + + +type +false +true + + +value +false +true + + + +header +org.apache.struts.taglib.bean.HeaderTag +org.apache.struts.taglib.bean.HeaderTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +include +org.apache.struts.taglib.bean.IncludeTag +org.apache.struts.taglib.bean.IncludeTei +empty + +anchor +false +true + + +forward +false +true + + +href +false +true + + +id +true +false + + +name +false +true + + +page +false +true + + +transaction +false +true + + + +message +org.apache.struts.taglib.bean.MessageTag +empty + +arg0 +false +true + + +arg1 +false +true + + +arg2 +false +true + + +arg3 +false +true + + +arg4 +false +true + + +bundle +false +true + + +key +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +page +org.apache.struts.taglib.bean.PageTag +org.apache.struts.taglib.bean.PageTei +empty + +id +true +false + + +property +true +true + + + +parameter +org.apache.struts.taglib.bean.ParameterTag +org.apache.struts.taglib.bean.ParameterTei +empty + +id +true +false + + +multiple +false +true + + +name +true +true + + +value +false +true + + + +resource +org.apache.struts.taglib.bean.ResourceTag +org.apache.struts.taglib.bean.ResourceTei +empty + +id +true +false + + +input +false +true + + +name +true +true + + + +size +org.apache.struts.taglib.bean.SizeTag +org.apache.struts.taglib.bean.SizeTei +empty + +collection +false +true + + +id +true +false + + +name +false +true + + +property +false +true + + +scope +false +true + + + +struts +org.apache.struts.taglib.bean.StrutsTag +org.apache.struts.taglib.bean.StrutsTei +empty + +id +true +false + + +formBean +false +true + + +forward +false +true + + +mapping +false +true + + + +write +org.apache.struts.taglib.bean.WriteTag +empty + +bundle +false +true + + +filter +false +true + + +format +false +true + + +formatKey +false +true + + +ignore +false +true + + +locale +false +true + + +name +true +true + + +property +false +true + + +scope +false +true + + + + + + Index: lams_tool_doku/web/WEB-INF/tlds/struts/struts-html-el.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/struts/struts-html-el.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/struts/struts-html-el.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,3302 @@ + + + + + + + + + + +1.2 +1.1 +html +http://struts.apache.org/tags-html-el + +base +org.apache.strutsel.taglib.html.ELBaseTag +empty + +target +false +true + + +server +false +true + + + +button +org.apache.strutsel.taglib.html.ELButtonTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +cancel +org.apache.strutsel.taglib.html.ELCancelTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +checkbox +org.apache.strutsel.taglib.html.ELCheckboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +errors +org.apache.strutsel.taglib.html.ELErrorsTag +empty + +bundle +false +true + + +footer +false +true + + +header +false +true + + +locale +false +true + + +name +false +true + + +prefix +false +true + + +property +false +true + + +suffix +false +true + + + +file +org.apache.strutsel.taglib.html.ELFileTag + +accesskey +false +true + + +accept +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +form +org.apache.strutsel.taglib.html.ELFormTag +JSP + +action +true +true + + +acceptCharset +false +true + + +disabled +false +true + + +enctype +false +true + + +focus +false +true + + +focusIndex +false +true + + +method +false +true + + +onreset +false +true + + +onsubmit +false +true + + +readonly +false +true + + +scriptLanguage +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +target +false +true + + + +frame +org.apache.strutsel.taglib.html.ELFrameTag + +bundle +false +true + + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +frameborder +false +true + + +frameName +false +true + + +href +false +true + + +longdesc +false +true + + +marginheight +false +true + + +marginwidth +false +true + + +name +false +true + + +noresize +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +scrolling +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + + +hidden +org.apache.strutsel.taglib.html.ELHiddenTag +empty + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + +write +false +true + + + +html +org.apache.strutsel.taglib.html.ELHtmlTag +JSP + +lang +false +true + + +locale +false +true + + +xhtml +false +true + + + +image +org.apache.strutsel.taglib.html.ELImageTag + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +locale +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +pageKey +false +true + + +property +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +img +org.apache.strutsel.taglib.html.ELImgTag +empty + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +contextRelative +false +true + + +height +false +true + + +hspace +false +true + + +imageName +false +true + + +ismap +false +true + + +locale +false +true + + +lowsrc +false +true + + +name +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +paramId +false +true + + +page +false +true + + +pageKey +false +true + + +action +false +true + + +module +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +useLocalEncoding +false +true + + +usemap +false +true + + +vspace +false +true + + +width +false +true + + + +javascript +org.apache.strutsel.taglib.html.ELJavascriptValidatorTag +empty + +cdata +false +true + + +dynamicJavascript +false +false + + +formName +false +true + + +method +false +true + + +page +false +true + + +scriptLanguage +false +true + + +src +false +true + + +staticJavascript +false +false + + +htmlComment +false +true + + +bundle +false +true + + + +link +org.apache.strutsel.taglib.html.ELLinkTag + +accesskey +false +true + + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +indexed +false +true + + +indexId +false +true + + +bundle +false +true + + +linkName +false +true + + +name +false +true + + +onblur +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +target +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +messages +org.apache.strutsel.taglib.html.ELMessagesTag +org.apache.struts.taglib.html.MessagesTei +JSP + +id +true +false + + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +header +false +true + + +footer +false +true + + +message +false +true + + + +multibox +org.apache.strutsel.taglib.html.ELMultiboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +option +org.apache.strutsel.taglib.html.ELOptionTag + +bundle +false +true + + +disabled +false +true + + +key +false +true + + +locale +false +true + + +style +false +true + + +styleId +false +true + + +styleClass +false +true + + +value +true +true + + + +options +org.apache.strutsel.taglib.html.ELOptionsTag +empty + +collection +false +true + + +filter +false +true + + +labelName +false +true + + +labelProperty +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + + +optionsCollection +org.apache.strutsel.taglib.html.ELOptionsCollectionTag +empty + +filter +false +true + + +label +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +value +false +true + + + +password +org.apache.strutsel.taglib.html.ELPasswordTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +redisplay +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +size +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +radio +org.apache.strutsel.taglib.html.ELRadioTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +property +true +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +true +true + + +idName +false +true + + + +reset +org.apache.strutsel.taglib.html.ELResetTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +rewrite +org.apache.strutsel.taglib.html.ELRewriteTag +empty + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +select +org.apache.strutsel.taglib.html.ELSelectTag +JSP + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +multiple +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +size +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +submit +org.apache.strutsel.taglib.html.ELSubmitTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +text +org.apache.strutsel.taglib.html.ELTextTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +textarea +org.apache.strutsel.taglib.html.ELTextareaTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +cols +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +rows +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +xhtml +org.apache.struts.taglib.html.XhtmlTag +empty + + + Index: lams_tool_doku/web/WEB-INF/tlds/struts/struts-html.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/struts/struts-html.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/struts/struts-html.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,3302 @@ + + + + + + + + + + +1.2 +1.1 +html +http://struts.apache.org/tags-html + +base +org.apache.struts.taglib.html.BaseTag +empty + +target +false +true + + +server +false +true + + + +button +org.apache.struts.taglib.html.ButtonTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +cancel +org.apache.struts.taglib.html.CancelTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +checkbox +org.apache.struts.taglib.html.CheckboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +errors +org.apache.struts.taglib.html.ErrorsTag +empty + +bundle +false +true + + +footer +false +true + + +header +false +true + + +locale +false +true + + +name +false +true + + +prefix +false +true + + +property +false +true + + +suffix +false +true + + + +file +org.apache.struts.taglib.html.FileTag + +accesskey +false +true + + +accept +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +form +org.apache.struts.taglib.html.FormTag +JSP + +action +true +true + + +acceptCharset +false +true + + +disabled +false +true + + +enctype +false +true + + +focus +false +true + + +focusIndex +false +true + + +method +false +true + + +onreset +false +true + + +onsubmit +false +true + + +readonly +false +true + + +scriptLanguage +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +target +false +true + + + +frame +org.apache.struts.taglib.html.FrameTag + +bundle +false +true + + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +frameborder +false +true + + +frameName +false +true + + +href +false +true + + +longdesc +false +true + + +marginheight +false +true + + +marginwidth +false +true + + +name +false +true + + +noresize +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +scrolling +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + + +hidden +org.apache.struts.taglib.html.HiddenTag +empty + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + +write +false +true + + + +html +org.apache.struts.taglib.html.HtmlTag +JSP + +lang +false +true + + +locale +false +true + + +xhtml +false +true + + + +image +org.apache.struts.taglib.html.ImageTag + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +locale +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +pageKey +false +true + + +property +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +img +org.apache.struts.taglib.html.ImgTag +empty + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +contextRelative +false +true + + +height +false +true + + +hspace +false +true + + +imageName +false +true + + +ismap +false +true + + +locale +false +true + + +lowsrc +false +true + + +name +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +paramId +false +true + + +page +false +true + + +pageKey +false +true + + +action +false +true + + +module +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +useLocalEncoding +false +true + + +usemap +false +true + + +vspace +false +true + + +width +false +true + + + +javascript +org.apache.struts.taglib.html.JavascriptValidatorTag +empty + +cdata +false +true + + +dynamicJavascript +false +false + + +formName +false +true + + +method +false +true + + +page +false +true + + +scriptLanguage +false +true + + +src +false +true + + +staticJavascript +false +false + + +htmlComment +false +true + + +bundle +false +true + + + +link +org.apache.struts.taglib.html.LinkTag + +accesskey +false +true + + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +indexed +false +true + + +indexId +false +true + + +bundle +false +true + + +linkName +false +true + + +name +false +true + + +onblur +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +target +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +messages +org.apache.struts.taglib.html.MessagesTag +org.apache.struts.taglib.html.MessagesTei +JSP + +id +true +false + + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +header +false +true + + +footer +false +true + + +message +false +true + + + +multibox +org.apache.struts.taglib.html.MultiboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +option +org.apache.struts.taglib.html.OptionTag + +bundle +false +true + + +disabled +false +true + + +key +false +true + + +locale +false +true + + +style +false +true + + +styleId +false +true + + +styleClass +false +true + + +value +true +true + + + +options +org.apache.struts.taglib.html.OptionsTag +empty + +collection +false +true + + +filter +false +true + + +labelName +false +true + + +labelProperty +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + + +optionsCollection +org.apache.struts.taglib.html.OptionsCollectionTag +empty + +filter +false +true + + +label +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +value +false +true + + + +password +org.apache.struts.taglib.html.PasswordTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +redisplay +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +size +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +radio +org.apache.struts.taglib.html.RadioTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +property +true +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +true +true + + +idName +false +true + + + +reset +org.apache.struts.taglib.html.ResetTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +rewrite +org.apache.struts.taglib.html.RewriteTag +empty + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +select +org.apache.struts.taglib.html.SelectTag +JSP + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +multiple +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +size +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +submit +org.apache.struts.taglib.html.SubmitTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +text +org.apache.struts.taglib.html.TextTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +textarea +org.apache.struts.taglib.html.TextareaTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +cols +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +rows +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +xhtml +org.apache.struts.taglib.html.XhtmlTag +empty + + + Index: lams_tool_doku/web/WEB-INF/tlds/struts/struts-logic-el.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/struts/struts-logic-el.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/struts/struts-logic-el.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,382 @@ + + + + + + + + + +1.2 +1.1 +logic +http://struts.apache.org/tags-logic-el + +forward +org.apache.strutsel.taglib.logic.ELForwardTag +empty + +name +true +true + + + +iterate +org.apache.strutsel.taglib.logic.ELIterateTag +org.apache.struts.taglib.logic.IterateTei +JSP + +collection +false +true + + +id +true +false + + +indexId +false +false + + +length +false +true + + +name +false +true + + +offset +false +true + + +property +false +true + + +scope +false +true + + +type +false +true + + + +match +org.apache.strutsel.taglib.logic.ELMatchTag +JSP + +cookie +false +true + + +expr +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +messagesNotPresent +org.apache.strutsel.taglib.logic.ELMessagesNotPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +messagesPresent +org.apache.strutsel.taglib.logic.ELMessagesPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +notMatch +org.apache.strutsel.taglib.logic.ELNotMatchTag +JSP + +cookie +false +true + + +expr +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notPresent +org.apache.strutsel.taglib.logic.ELNotPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +present +org.apache.strutsel.taglib.logic.ELPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +redirect +org.apache.strutsel.taglib.logic.ELRedirectTag + +action +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + + + + Index: lams_tool_doku/web/WEB-INF/tlds/struts/struts-logic.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/struts/struts-logic.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/struts/struts-logic.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,652 @@ + + + + + + + + + +1.2 +1.1 +logic +http://struts.apache.org/tags-logic + +empty +org.apache.struts.taglib.logic.EmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +equal +org.apache.struts.taglib.logic.EqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +forward +org.apache.struts.taglib.logic.ForwardTag +empty + +name +true +true + + + +greaterEqual +org.apache.struts.taglib.logic.GreaterEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterThan +org.apache.struts.taglib.logic.GreaterThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +iterate +org.apache.struts.taglib.logic.IterateTag +org.apache.struts.taglib.logic.IterateTei +JSP + +collection +false +true + + +id +true +false + + +indexId +false +false + + +length +false +true + + +name +false +true + + +offset +false +true + + +property +false +true + + +scope +false +true + + +type +false +true + + + +lessEqual +org.apache.struts.taglib.logic.LessEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +lessThan +org.apache.struts.taglib.logic.LessThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +match +org.apache.struts.taglib.logic.MatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +messagesNotPresent +org.apache.struts.taglib.logic.MessagesNotPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +messagesPresent +org.apache.struts.taglib.logic.MessagesPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +notEmpty +org.apache.struts.taglib.logic.NotEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +notEqual +org.apache.struts.taglib.logic.NotEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notMatch +org.apache.struts.taglib.logic.NotMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notPresent +org.apache.struts.taglib.logic.NotPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +present +org.apache.struts.taglib.logic.PresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +redirect +org.apache.struts.taglib.logic.RedirectTag + +action +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +name +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + + + + Index: lams_tool_doku/web/WEB-INF/tlds/struts/struts-nested.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/struts/struts-nested.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/struts/struts-nested.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,3171 @@ + + + + + + + + + +1.2 +1.1 +nested +http://struts.apache.org/tags-nested + +nest +org.apache.struts.taglib.nested.NestedPropertyTag +JSP + +property +false +true + + + +writeNesting +org.apache.struts.taglib.nested.NestedWriteNestingTag +org.apache.struts.taglib.nested.NestedWriteNestingTei +JSP + +property +false +true + + +id +false +true + + +filter +false +true + + + +root +org.apache.struts.taglib.nested.NestedRootTag +JSP + +name +false +true + + + +define +org.apache.struts.taglib.nested.bean.NestedDefineTag +org.apache.struts.taglib.nested.bean.NestedDefineTei +empty + +id +true +true + + +name +false +true + + +property +false +true + + +scope +false +true + + +toScope +false +true + + +type +false +true + + +value +false +true + + + +message +org.apache.struts.taglib.nested.bean.NestedMessageTag +empty + +arg0 +false +true + + +arg1 +false +true + + +arg2 +false +true + + +arg3 +false +true + + +arg4 +false +true + + +bundle +false +true + + +key +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +size +org.apache.struts.taglib.nested.bean.NestedSizeTag +org.apache.struts.taglib.bean.SizeTei +empty + +collection +false +true + + +id +true +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +write +org.apache.struts.taglib.nested.bean.NestedWriteTag +empty + +bundle +false +true + + +filter +false +true + + +format +false +true + + +formatKey +false +true + + +ignore +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +scope +false +true + + + +checkbox +org.apache.struts.taglib.nested.html.NestedCheckboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +errors +org.apache.struts.taglib.nested.html.NestedErrorsTag +empty + +bundle +false +true + + +footer +false +true + + +header +false +true + + +locale +false +true + + +name +false +true + + +prefix +false +true + + +property +false +true + + +suffix +false +true + + + +file +org.apache.struts.taglib.nested.html.NestedFileTag + +accesskey +false +true + + +accept +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +form +org.apache.struts.taglib.nested.html.NestedFormTag +JSP + +action +true +true + + +acceptCharset +false +true + + +disabled +false +true + + +enctype +false +true + + +focus +false +true + + +focusIndex +false +true + + +method +false +true + + +onreset +false +true + + +onsubmit +false +true + + +readonly +false +true + + +scriptLanguage +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +target +false +true + + + +hidden +org.apache.struts.taglib.nested.html.NestedHiddenTag + +alt +false +true + + +altKey +false +true + + +indexed +false +true + + +name +false +true + + +property +true +true + + +title +false +true + + +titleKey +false +true + + +styleClass +false +true + + +styleId +false +true + + +value +false +true + + +write +false +true + + + +image +org.apache.struts.taglib.nested.html.NestedImageTag + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +locale +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +pageKey +false +true + + +property +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +img +org.apache.struts.taglib.nested.html.NestedImgTag +empty + +accesskey +false +true + + +align +false +true + + +alt +false +true + + +altKey +false +true + + +border +false +true + + +bundle +false +true + + +height +false +true + + +hspace +false +true + + +imageName +false +true + + +ismap +false +true + + +locale +false +true + + +lowsrc +false +true + + +name +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +paramId +false +true + + +page +false +true + + +pageKey +false +true + + +action +false +true + + +module +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +src +false +true + + +srcKey +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +title +false +true + + +titleKey +false +true + + +useLocalEncoding +false +true + + +usemap +false +true + + +vspace +false +true + + +width +false +true + + + +link +org.apache.struts.taglib.nested.html.NestedLinkTag + +accesskey +false +true + + +action +false +true + + +module +false +true + + +anchor +false +true + + +forward +false +true + + +href +false +true + + +indexed +false +true + + +indexId +false +true + + +bundle +false +true + + +linkName +false +true + + +name +false +true + + +onblur +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +page +false +true + + +paramId +false +true + + +paramName +false +true + + +paramProperty +false +true + + +paramScope +false +true + + +property +false +true + + +scope +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +target +false +true + + +title +false +true + + +titleKey +false +true + + +transaction +false +true + + +useLocalEncoding +false +true + + + +messages +org.apache.struts.taglib.nested.html.NestedMessagesTag +org.apache.struts.taglib.html.MessagesTei +JSP + +id +true +true + + +bundle +false +true + + +locale +false +true + + +name +false +true + + +property +false +true + + +header +false +true + + +footer +false +true + + +message +false +true + + + +multibox +org.apache.struts.taglib.nested.html.NestedMultiboxTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +options +org.apache.struts.taglib.nested.html.NestedOptionsTag +empty + +collection +false +true + + +filter +false +true + + +labelName +false +true + + +labelProperty +false +true + + +name +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + + +optionsCollection +org.apache.struts.taglib.nested.html.NestedOptionsCollectionTag +empty + +filter +false +true + + +label +false +true + + +name +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +value +false +true + + + +password +org.apache.struts.taglib.nested.html.NestedPasswordTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +redisplay +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +size +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +radio +org.apache.struts.taglib.nested.html.NestedRadioTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +property +true +true + + +onmousedown +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +true +true + + +idName +false +true + + + +select +org.apache.struts.taglib.nested.html.NestedSelectTag +JSP + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +multiple +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +size +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +submit +org.apache.struts.taglib.nested.html.NestedSubmitTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +indexed +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +text +org.apache.struts.taglib.nested.html.NestedTextTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +maxlength +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +size +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +textarea +org.apache.struts.taglib.nested.html.NestedTextareaTag + +accesskey +false +true + + +alt +false +true + + +altKey +false +true + + +bundle +false +true + + +cols +false +true + + +disabled +false +true + + +errorKey +false +true + + +errorStyle +false +true + + +errorStyleClass +false +true + + +errorStyleId +false +true + + +indexed +false +true + + +name +false +true + + +onblur +false +true + + +onchange +false +true + + +onclick +false +true + + +ondblclick +false +true + + +onfocus +false +true + + +onkeydown +false +true + + +onkeypress +false +true + + +onkeyup +false +true + + +onmousedown +false +true + + +onmousemove +false +true + + +onmouseout +false +true + + +onmouseover +false +true + + +onmouseup +false +true + + +property +true +true + + +readonly +false +true + + +rows +false +true + + +style +false +true + + +styleClass +false +true + + +styleId +false +true + + +tabindex +false +true + + +title +false +true + + +titleKey +false +true + + +value +false +true + + + +empty +org.apache.struts.taglib.nested.logic.NestedEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +equal +org.apache.struts.taglib.nested.logic.NestedEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterEqual +org.apache.struts.taglib.nested.logic.NestedGreaterEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +greaterThan +org.apache.struts.taglib.nested.logic.NestedGreaterThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +iterate +org.apache.struts.taglib.nested.logic.NestedIterateTag +org.apache.struts.taglib.nested.logic.NestedIterateTei +JSP + +collection +false +true + + +id +false +true + + +indexId +false +true + + +length +false +true + + +name +false +true + + +offset +false +true + + +property +false +true + + +scope +false +true + + +type +false +true + + + +lessEqual +org.apache.struts.taglib.nested.logic.NestedLessEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +lessThan +org.apache.struts.taglib.nested.logic.NestedLessThanTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +match +org.apache.struts.taglib.nested.logic.NestedMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +messagesNotPresent +org.apache.struts.taglib.nested.logic.NestedMessagesNotPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +messagesPresent +org.apache.struts.taglib.nested.logic.NestedMessagesPresentTag +JSP + +name +false +true + + +property +false +true + + +message +false +true + + + +notEmpty +org.apache.struts.taglib.nested.logic.NestedNotEmptyTag +JSP + +name +false +true + + +property +false +true + + +scope +false +true + + + +notEqual +org.apache.struts.taglib.nested.logic.NestedNotEqualTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notMatch +org.apache.struts.taglib.nested.logic.NestedNotMatchTag +JSP + +cookie +false +true + + +header +false +true + + +location +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +scope +false +true + + +value +true +true + + + +notPresent +org.apache.struts.taglib.nested.logic.NestedNotPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + +present +org.apache.struts.taglib.nested.logic.NestedPresentTag +JSP + +cookie +false +true + + +header +false +true + + +name +false +true + + +parameter +false +true + + +property +false +true + + +role +false +true + + +scope +false +true + + +user +false +true + + + + + + Index: lams_tool_doku/web/WEB-INF/tlds/struts/struts-tiles-el.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/struts/struts-tiles-el.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/struts/struts-tiles-el.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,343 @@ + + + + + + + + + + +1.2 +1.1 +tiles +http://struts.apache.org/tags-tiles-el + +insert +org.apache.strutsel.taglib.tiles.ELInsertTag +JSP + +template +false +true + + +component +false +true + + +page +false +true + + +definition +false +true + + +attribute +false +false + + +name +false +true + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +flush +false +false + + +ignore +false +true + + +role +false +true + + +controllerUrl +false +true + + +controllerClass +false +true + + + +definition +org.apache.strutsel.taglib.tiles.ELDefinitionTag +JSP + +id +true +false + + +scope +false +false + + +template +false +true + + +page +false +true + + +role +false +true + + +extends +false +true + + + +put +org.apache.strutsel.taglib.tiles.ELPutTag +JSP + +name +false +false + + +value +false +true + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +putList +org.apache.strutsel.taglib.tiles.ELPutListTag +JSP + +name +true +false + + + +add +org.apache.strutsel.taglib.tiles.ELAddTag +JSP + +value +false +false + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +get +org.apache.strutsel.taglib.tiles.ELGetTag +empty + +name +true +true + + +ignore +false +true + + +flush +false +false + + +role +false +true + + + +getAsString +org.apache.strutsel.taglib.tiles.ELGetAttributeTag +empty + +name +true +true + + +ignore +false +true + + +role +false +true + + + +useAttribute +org.apache.strutsel.taglib.tiles.ELUseAttributeTag +empty + +id +false +false + + +classname +false +false + + +scope +false +false + + +name +true +true + + +ignore +false +true + + + +importAttribute +org.apache.strutsel.taglib.tiles.ELImportAttributeTag +empty + +name +false +true + + +scope +false +false + + +ignore +false +true + + + +initComponentDefinitions +org.apache.strutsel.taglib.tiles.ELInitDefinitionsTag +empty + +file +true +false + + +classname +false +false + + + + + + Index: lams_tool_doku/web/WEB-INF/tlds/struts/struts-tiles.tld =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/tlds/struts/struts-tiles.tld (revision 0) +++ lams_tool_doku/web/WEB-INF/tlds/struts/struts-tiles.tld (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,344 @@ + + + + + + + + + + +1.2 +1.1 +tiles +http://struts.apache.org/tags-tiles + +insert +org.apache.struts.taglib.tiles.InsertTag +JSP + +template +false +true + + +component +false +true + + +page +false +true + + +definition +false +true + + +attribute +false +false + + +name +false +true + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +flush +false +false + + +ignore +false +true + + +role +false +true + + +controllerUrl +false +true + + +controllerClass +false +true + + + +definition +org.apache.struts.taglib.tiles.DefinitionTag +JSP + +id +true +false + + +scope +false +false + + +template +false +true + + +page +false +true + + +role +false +true + + +extends +false +true + + + +put +org.apache.struts.taglib.tiles.PutTag +JSP + +name +false +false + + +value +false +true + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +putList +org.apache.struts.taglib.tiles.PutListTag +JSP + +name +true +false + + + +add +org.apache.struts.taglib.tiles.AddTag +JSP + +value +false +false + + +content +false +true + + +direct +false +false + + +type +false +false + + +beanName +false +true + + +beanProperty +false +true + + +beanScope +false +false + + +role +false +true + + + +get +org.apache.struts.taglib.tiles.GetTag +empty + +name +true +true + + +ignore +false +true + + +flush +false +false + + +role +false +true + + + +getAsString +org.apache.struts.taglib.tiles.GetAttributeTag +empty + +name +true +true + + +ignore +false +true + + +role +false +true + + + +useAttribute +org.apache.struts.taglib.tiles.UseAttributeTag +org.apache.struts.taglib.tiles.UseAttributeTei +empty + +id +false +false + + +classname +false +false + + +scope +false +false + + +name +true +true + + +ignore +false +true + + + +importAttribute +org.apache.struts.taglib.tiles.ImportAttributeTag +empty + +name +false +true + + +scope +false +false + + +ignore +false +true + + + +initComponentDefinitions +org.apache.struts.taglib.tiles.InitDefinitionsTag +empty + +file +true +false + + +classname +false +false + + + + + + Index: lams_tool_doku/web/WEB-INF/validation.xml =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/validation.xml (revision 0) +++ lams_tool_doku/web/WEB-INF/validation.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,41 @@ + + + + + + datePattern + yyyy-MM-dd + + + + + + + Index: lams_tool_doku/web/WEB-INF/web.xml =================================================================== diff -u --- lams_tool_doku/web/WEB-INF/web.xml (revision 0) +++ lams_tool_doku/web/WEB-INF/web.xml (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,297 @@ + + + + Dokumaran + + Dokumaran tool + + + javax.servlet.jsp.jstl.fmt.localizationContext + org.lamsfoundation.lams.tool.dokumaran.ApplicationResources + + + + contextConfigLocation + classpath:/org/lamsfoundation/lams/tool/dokumaran/dbupdates/autopatchContext.xml + + + locatorFactorySelector + classpath:/org/lamsfoundation/lams/beanRefContext.xml + + + parentContextKey + context.central + + + + + org.springframework.web.context.ContextLoaderListener + + + + + hibernateFilter + + org.springframework.orm.hibernate4.support.OpenSessionInViewFilter + + + sessionFactoryBeanName + coreSessionFactory + + + + + SystemSessionFilter + + org.lamsfoundation.lams.web.session.SystemSessionFilter + + + + LocaleFilter + + org.lamsfoundation.lams.web.filter.LocaleFilter + + + encoding + UTF-8 + + + + + hibernateFilter + /* + + + SystemSessionFilter + /* + + + LocaleFilter + /* + + + + action + org.apache.struts.action.ActionServlet + + config + /WEB-INF/struts-config.xml + + + debug + 999 + + + detail + 1 + + + validate + true + + 2 + + + + Connector + net.fckeditor.connector.ConnectorServlet + + baseDir + /UserFiles/ + + + debug + false + + 1 + + + + + Instructions Download + Instructions Download + download + org.lamsfoundation.lams.contentrepository.client.ToolDownload + + toolContentHandlerBeanName + dokumaranToolContentHandler + + 3 + + + + action + *.do + + + + Connector + /ckeditor/filemanager/browser/default/connectors/jsp/connector + + + + download + /download/* + + + + + + + + tags-bean + /WEB-INF/tlds/struts/struts-bean.tld + + + tags-html + /WEB-INF/tlds/struts/struts-html.tld + + + tags-logic + /WEB-INF/tlds/struts/struts-logic.tld + + + tags-tiles + /WEB-INF/tlds/struts/struts-tiles.tld + + + + tags-bean-el + /WEB-INF/tlds/struts/struts-bean-el.tld + + + tags-html-el + /WEB-INF/tlds/struts/struts-html-el.tld + + + tags-logic-el + /WEB-INF/tlds/struts/struts-logic-el.tld + + + tags-tiles-el + /WEB-INF/tlds/struts/struts-tiles-el.tld + + + + + + tags-fmt + /WEB-INF/tlds/jstl/fmt.tld + + + tags-core + /WEB-INF/tlds/jstl/c.tld + + + tags-function + /WEB-INF/tlds/jstl/fn.tld + + + tags-xml + /WEB-INF/tlds/jstl/x.tld + + + + + + tags-lams + /WEB-INF/tlds/lams/lams.tld + + + + + + + + Secure content + /* + + + LEARNER + MONITOR + AUTHOR + SYSADMIN + + + + + + Authoring content + /authoring/* + /pages/authoring/* + + + AUTHOR + MONITOR + SYSADMIN + + + + + Staff content + /monitoring/* + /pages/monitoring/* + /definelater.do + + + MONITOR + SYSADMIN + + + + + + Student + LEARNER + + + + Authors Learning Designs + AUTHOR + + + + Member of Staff + MONITOR + + + + Group Manager + GROUP MANAGER + + + + Group Administrator + GROUP ADMIN + + + + LAMS System Adminstrator + SYSADMIN + + + + + FORM + LAMS + + /login.jsp + /login.jsp?failed=y + + + + + 500 + /error.jsp + + + 403 + /403.jsp + + + 404 + /404.jsp + + Index: lams_tool_doku/web/common/footer.jsp =================================================================== diff -u --- lams_tool_doku/web/common/footer.jsp (revision 0) +++ lams_tool_doku/web/common/footer.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1 @@ +
    Index: lams_tool_doku/web/common/header.jsp =================================================================== diff -u --- lams_tool_doku/web/common/header.jsp (revision 0) +++ lams_tool_doku/web/common/header.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,15 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + Index: lams_tool_doku/web/common/messages.jsp =================================================================== diff -u --- lams_tool_doku/web/common/messages.jsp (revision 0) +++ lams_tool_doku/web/common/messages.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,8 @@ +<%-- Error Messages --%> + + + +
    +
    +
    +
    Index: lams_tool_doku/web/common/tabbedheader.jsp =================================================================== diff -u --- lams_tool_doku/web/common/tabbedheader.jsp (revision 0) +++ lams_tool_doku/web/common/tabbedheader.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,13 @@ + + + + + + + + + + + + + Index: lams_tool_doku/web/common/taglibs.jsp =================================================================== diff -u --- lams_tool_doku/web/common/taglibs.jsp (revision 0) +++ lams_tool_doku/web/common/taglibs.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,11 @@ +<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-bean" prefix="bean" %> +<%@ taglib uri="tags-html" prefix="html" %> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-function" prefix="fn" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-xml" prefix="x" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + Index: lams_tool_doku/web/error.jsp =================================================================== diff -u --- lams_tool_doku/web/error.jsp (revision 0) +++ lams_tool_doku/web/error.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,69 @@ + + + +<%@ page language="java" isErrorPage="true" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> + + + + +<%-- Catch JSP Servlet Exception --%> +<% +if (exception != null) { +%> + + <%=exception.getMessage()%> + + + <%=exception.getClass().getName()%> + +<% + java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); + java.io.PrintStream os = new java.io.PrintStream(bos); + exception.printStackTrace(os); + String stack = new String(bos.toByteArray()); +%> + + <%=stack%> + +<% +} else if ((Exception) request.getAttribute("javax.servlet.error.exception") != null) { +%> + + + <%=((Exception) request.getAttribute("javax.servlet.error.exception")).getMessage()%> + + + <%=((Exception) request.getAttribute("javax.servlet.error.exception")).getMessage() + .getClass().getName()%> + +<% + java.io.ByteArrayOutputStream bos = new java.io.ByteArrayOutputStream(); + java.io.PrintStream os = new java.io.PrintStream(bos); + ((Exception) request.getAttribute("javax.servlet.error.exception")).printStackTrace(os); + String stack = new String(bos.toByteArray()); +%> + + <%=stack%> + +<% +} +%> + +
    + + + +
    + + + + Index: lams_tool_doku/web/images/icon_dokumaran.png =================================================================== diff -u Binary files differ Index: lams_tool_doku/web/images/icon_dokumaran.svg =================================================================== diff -u --- lams_tool_doku/web/images/icon_dokumaran.svg (revision 0) +++ lams_tool_doku/web/images/icon_dokumaran.svg (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,61 @@ + + + + + Etherpad + + + + image/svg+xml + + Etherpad + 2012-11-20 + + + Marcel Klehr + + + + + + + + + + + + + + + + + Index: lams_tool_doku/web/images/icon_dokumaran2.png =================================================================== diff -u Binary files differ Index: lams_tool_doku/web/images/icon_dokumaran_16.svg =================================================================== diff -u --- lams_tool_doku/web/images/icon_dokumaran_16.svg (revision 0) +++ lams_tool_doku/web/images/icon_dokumaran_16.svg (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,61 @@ + + + + + Etherpad + + + + image/svg+xml + + Etherpad + 2012-11-20 + + + Marcel Klehr + + + + + + + + + + + + + + + + + Index: lams_tool_doku/web/includes/images/.cvsignore =================================================================== diff -u --- lams_tool_doku/web/includes/images/.cvsignore (revision 0) +++ lams_tool_doku/web/includes/images/.cvsignore (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1 @@ +Thumbs.db Index: lams_tool_doku/web/includes/javascript/etherpad.js =================================================================== diff -u --- lams_tool_doku/web/includes/javascript/etherpad.js (revision 0) +++ lams_tool_doku/web/includes/javascript/etherpad.js (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,113 @@ +(function( $ ){ + + $.fn.pad = function( options ) { + var settings = { + 'host' : 'http://beta.etherpad.org', + 'baseUrl' : '/p/', + 'showControls' : false, + 'showChat' : false, + 'showLineNumbers' : false, + 'userName' : 'unnamed', + 'lang' : '', + 'useMonospaceFont' : false, + 'noColors' : false, + 'userColor' : false, + 'hideQRCode' : false, + 'alwaysShowChat' : false, + 'width' : 100, + 'height' : 100, + 'border' : 0, + 'borderStyle' : 'solid', + 'toggleTextOn' : 'Disable Rich-text', + 'toggleTextOff' : 'Enable Rich-text', + 'plugins' : {}, + 'rtl' : false + }; + + var $self = this; + if (!$self.length) return; + if (!$self.attr('id')) throw new Error('No "id" attribute'); + + var useValue = $self[0].tagName.toLowerCase() == 'textarea'; + var selfId = $self.attr('id'); + var epframeId = 'epframe'+ selfId; + // This writes a new frame if required + if ( !options.getContents ) { + if ( options ) { + $.extend( settings, options ); + } + + var pluginParams = ''; + for(var option in settings.plugins) { + pluginParams += '&' + option + '=' + settings.plugins[option] + } + + var iFrameLink = ''; + + + var $iFrameLink = $(iFrameLink); + + if (useValue) { + var $toggleLink = $(''+ settings.toggleTextOn +'').click(function(){ + var $this = $(this); + $this.toggleClass('active'); + if ($this.hasClass('active')) $this.text(settings.toggleTextOff); + $self.pad({getContents: true}); + return false; + }); + $self + .hide() + .after($toggleLink) + .after($iFrameLink) + ; + } + else { + $self.html(iFrameLink); + } + } + + // This reads the etherpad contents if required + else { + var frameUrl = $('#'+ epframeId).attr('src').split('?')[0]; + var contentsUrl = frameUrl + "/export/html"; + var target = $('#'+ options.getContents); + + // perform an ajax call on contentsUrl and write it to the parent + $.get(contentsUrl, function(data) { + + if (target.is(':input')) { + target.val(data).show(); + } + else { + target.html(data); + } + + $('#'+ epframeId).remove(); + }); + } + + + return $self; + }; +})( jQuery ); Index: lams_tool_doku/web/login.jsp =================================================================== diff -u --- lams_tool_doku/web/login.jsp (revision 0) +++ lams_tool_doku/web/login.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,12 @@ +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c" %> + + + + Index: lams_tool_doku/web/pages/admin/config.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/admin/config.jsp (revision 0) +++ lams_tool_doku/web/pages/admin/config.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,61 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + <fmt:message key="pageTitle.admin" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    + + +
    + + + + + +
    + + + +
    + + + + \ No newline at end of file Index: lams_tool_doku/web/pages/authoring/advance.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/authoring/advance.jsp (revision 0) +++ lams_tool_doku/web/pages/authoring/advance.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,69 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + +
    + +
    +
    + + + +
    + +
    + +
    + +
    + +
    + + + +
    + +
    + +
    + +
    + +
    + +
    + +
    + + Index: lams_tool_doku/web/pages/authoring/authoring.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/authoring/authoring.jsp (revision 0) +++ lams_tool_doku/web/pages/authoring/authoring.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,78 @@ + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.tool.dokumaran.DokumaranConstants"%> + + + + <fmt:message key="label.author.title" /> + <%@ include file="/common/tabbedheader.jsp"%> + + + + + + + + + + + + + + + + + + + + + + <%@ include file="/common/messages.jsp"%> + + + + + + + + + + + + + + <%-- Default value + cancelButtonLabelKey="label.authoring.cancel.button" + saveButtonLabelKey="label.authoring.save.button" + cancelConfirmMsgKey="authoring.msg.cancel.save" + accessMode="author" + --%> + + + + + + + + + Index: lams_tool_doku/web/pages/authoring/basic.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/authoring/basic.jsp (revision 0) +++ lams_tool_doku/web/pages/authoring/basic.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,17 @@ +<%@ include file="/common/taglibs.jsp"%> + + + +
    + + +
    + +
    + + +
    Index: lams_tool_doku/web/pages/authoring/definelater.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/authoring/definelater.jsp (revision 0) +++ lams_tool_doku/web/pages/authoring/definelater.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,63 @@ + +<%@ include file="/common/taglibs.jsp"%> + +<%@ page import="java.util.HashSet"%> +<%@ page import="org.lamsfoundation.lams.tool.dokumaran.DokumaranConstants"%> + + + + <fmt:message key="label.author.title" /> + <%@ include file="/common/tabbedheader.jsp"%> + + + + + + + + + + + + + + + + + + + + <%@ include file="/common/messages.jsp"%> + + + + + + + + + + + + + + + + + + + Index: lams_tool_doku/web/pages/authoring/definelaterforbid.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/authoring/definelaterforbid.jsp (revision 0) +++ lams_tool_doku/web/pages/authoring/definelaterforbid.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,19 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + <fmt:message key="label.author.title" /> + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + Index: lams_tool_doku/web/pages/authoring/start.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/authoring/start.jsp (revision 0) +++ lams_tool_doku/web/pages/authoring/start.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,15 @@ + +<%@ include file="/common/taglibs.jsp" %> + + + + + + + + + + + Index: lams_tool_doku/web/pages/learning/definelater.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/learning/definelater.jsp (revision 0) +++ lams_tool_doku/web/pages/learning/definelater.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,22 @@ + +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + Index: lams_tool_doku/web/pages/learning/finish.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/learning/finish.jsp (revision 0) +++ lams_tool_doku/web/pages/learning/finish.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -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_doku/web/pages/learning/learning.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/learning/learning.jsp (revision 0) +++ lams_tool_doku/web/pages/learning/learning.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,169 @@ + +<%@ 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="/common/messages.jsp"%> + +
    +
    +
    +
    +
    + + + +
    +
    + +
    +
    +
    + +
    + + + +

    + + + +

    +
    + +

    + +

    +
    +
    + + + + + + +
    +
    +
    + + + +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    + +
    Index: lams_tool_doku/web/pages/learning/notconfigured.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/learning/notconfigured.jsp (revision 0) +++ lams_tool_doku/web/pages/learning/notconfigured.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,21 @@ + +<%@include file="/common/taglibs.jsp"%> + + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + + + Index: lams_tool_doku/web/pages/learning/notebook.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/learning/notebook.jsp (revision 0) +++ lams_tool_doku/web/pages/learning/notebook.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,66 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + <fmt:message key="label.learning.title" /> + + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + + + + +
    + <%@ include file="/common/messages.jsp"%> + +

    + +

    + + + +
    + + + + + + + + + + + + +
    +
    +
    + + + + +
    + + +
    Index: lams_tool_doku/web/pages/learning/success.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/learning/success.jsp (revision 0) +++ lams_tool_doku/web/pages/learning/success.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,26 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + + + <%@ include file="/common/header.jsp"%> + + + + + + +
    + + + + +
    +
    + +
    Index: lams_tool_doku/web/pages/learning/waitforleader.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/learning/waitforleader.jsp (revision 0) +++ lams_tool_doku/web/pages/learning/waitforleader.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,50 @@ + +<%@ include file="/common/taglibs.jsp"%> + + + + <fmt:message key="label.learning.title" /> + <%@ include file="/common/header.jsp"%> + + + + + + + + + + + +
    + +
    + +
    + +
    + +
    + +
    +
    +
    +
    + +
    + + + +
    + + +
    + +
    Index: lams_tool_doku/web/pages/monitoring/advanceoptions.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/monitoring/advanceoptions.jsp (revision 0) +++ lams_tool_doku/web/pages/monitoring/advanceoptions.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,104 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + +
    + + + +
    +
    Index: lams_tool_doku/web/pages/monitoring/editactivity.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/monitoring/editactivity.jsp (revision 0) +++ lams_tool_doku/web/pages/monitoring/editactivity.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,41 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + + + + + + + + + + +
    + : + + +
    + : + + +
    + + + + + + + +
    Index: lams_tool_doku/web/pages/monitoring/monitoring.jsp =================================================================== diff -u --- lams_tool_doku/web/pages/monitoring/monitoring.jsp (revision 0) +++ lams_tool_doku/web/pages/monitoring/monitoring.jsp (revision b15a3b889da23ac048a689fc2d661df42571b229) @@ -0,0 +1,54 @@ + +<%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.tool.dokumaran.DokumaranConstants"%> + + + + <%@ include file="/common/tabbedheader.jsp" %> + + + + + + + + + + + + + + + + + + + + + +