Index: lams_tool_task/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -61,13 +61,11 @@ label.authoring.advance.run.content.sequentialOrder =Tasks have to be completed in sequential order label.authoring.cancel.button =Cancel label.authoring.save.button =Save -label.learning.new.task.details =New task details: +authoring.msg.cancel.save =Do you want to close this window without saving? +authoring.msg.no.tasks.save =There must be at least one task to be saved. label.next.instruction =Next Instruction authoring.exception =There is a problem in task list authoring page, the reason is {0} error.resource.item.title.blank =Title can not be blank. -error.resource.item.url.blank =URL can not be blank. -error.resource.item.file.blank =File can not be blank. -error.resource.item.invalid.url =Invalid URL format. error.upload.failed =Upload file failed: {0} error.msg.upload.file.not.found =Could not find upload file {0}. error.msg.zip.file.exception =Could not handle zip file when uploading file. @@ -79,12 +77,11 @@ error.msg.repository =Repository occurs exception while trying to upload file. error.msg.default.content.not.find =Could not retrieve default content record for this tool. msg.no.instruction =No instruction available. -authoring.msg.cancel.save =Do you want to close this window without saving? -authoring.msg.no.tasks.save =There must be at least one task to be saved. label.learning.title =Task List Learning label.learning.heading =Task List label.learning.tasks.to.do =Tasks to do -label.check.for.new =Check for new +label.learning.new.task.details =New task details: +label.learning.check.for.new =Check for new label.learning.suggest.new.task =Suggest a new task label.learning.comment.or.instruction =Description label.learning.required.tasks =* - required tasks Index: lams_tool_task/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -13,7 +13,7 @@ errorPage.title =Error page errorPage.heading =Some error occurs when handling your request label.authoring.heading =Task List -label.author.title =Task List Authoring +label.authoring.title =Task List Authoring label.authoring.heading.basic =Basic label.authoring.heading.instructions =Instructions label.authoring.heading.basic.desc =Basic input information for task list @@ -28,10 +28,7 @@ label.authoring.basic.task.isChildTask =Don't display until parent has been completed label.authoring.basic.task.parent.task.name =Parent: label.authoring.basic.task.list.title =Task List -label.authoring.basic.resource.url =URL label.authoring.basic.resource.task =Task -label.authoring.basic.resource.file =File -label.authoring.basic.resource.website =Website label.authoring.basic.resource.preview =Preview label.authoring.basic.resource.edit =Edit label.authoring.basic.resource.delete =Delete @@ -41,11 +38,9 @@ label.authoring.basic.resource.url.input =URL label.authoring.basic.resource.file.input =File label.authoring.basic.resource.description.input =Description -label.authoring.basic.resource.zip.file.input =Zip file: label.authoring.online.instruction =Online Instructions label.authoring.offline.instruction =Offline Instructions label.authoring.online.file =Upload online file -error.resource.item.desc.blank =Comment/Instruction can not be blank label.authoring.offline.file =Upload offline file label.authoring.choosefile.button =Choose file label.authoring.upload.online.button =Upload Online @@ -61,12 +56,12 @@ label.authoring.advance.run.content.sequentialOrder =Tasks have to be completed in sequential order label.authoring.cancel.button =Cancel label.authoring.save.button =Save -label.next.instruction =Next Instruction +label.authoring.up =Move Up +label.authoring.down =Move down authoring.exception =There is a problem in task list authoring page, the reason is {0} +authoring.msg.cancel.save =Do you want to close this window without saving? +authoring.msg.no.tasks.save =There must be at least one task to be saved. error.resource.item.title.blank =Title can not be blank. -error.resource.item.url.blank =URL can not be blank. -error.resource.item.file.blank =File can not be blank. -error.resource.item.invalid.url =Invalid URL format. error.upload.failed =Upload file failed: {0} error.msg.upload.file.not.found =Could not find upload file {0}. error.msg.zip.file.exception =Could not handle zip file when uploading file. @@ -77,17 +72,11 @@ error.msg.invaid.param.upload =InvalidParameterException occured while trying to upload File. error.msg.repository =Repository occurs exception while trying to upload file. error.msg.default.content.not.find =Could not retrieve default content record for this tool. -msg.no.instruction =No instruction available. -authoring.msg.cancel.save =Do you want to close this window without saving? -authoring.msg.no.tasks.save =There must be at least one task to be saved. label.learning.title =Task List Learning label.learning.heading =Task List label.resoruce.to.review =Resources to view label.learning.minimum.review =You must view at least {0} of the resources. -label.check.for.new =Check for new -label.suggest.new =Suggest a new -label.learning.new.file =New file details: -label.learning.new.url =New URL details: +label.learning.check.for.new =Check for new label.learning.comment.or.instruction =Comment/Instruction monitoring.tab.summary =Summary monitoring.tab.statistics =Statistic @@ -143,10 +132,6 @@ activity.title =Task List activity.description =Sharing resource with others. monitoring.label.access.time =Access time -error.msg.ims.package =Invalid IMS CP format. -message.step.of =Step {0} of {1} -label.up =Move Up -label.down =Move down error.reflection.emtpy =Please input reflection title.reflection =Reflection label.continue =Continue Index: lams_tool_task/conf/xdoclet/struts-actions.xml =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -207,27 +207,25 @@ parameter="summary" > + + + + + - - - - - - - + + Index: lams_tool_task/db/model/taskList.clay =================================================================== diff -u -re12e54b34d1312f79a1c8b1fb3662fb5a6da9676 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/db/model/taskList.clay (.../taskList.clay) (revision e12e54b34d1312f79a1c8b1fb3662fb5a6da9676) +++ lams_tool_task/db/model/taskList.clay (.../taskList.clay) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -14,8 +14,8 @@ - + @@ -34,8 +34,8 @@ - + @@ -47,8 +47,8 @@ - + @@ -160,8 +160,8 @@ - + @@ -173,8 +173,8 @@ - + @@ -546,12 +546,6 @@ - - - - - - Index: lams_tool_task/db/sql/create_lams_tool_taskList.sql =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/db/sql/create_lams_tool_taskList.sql (.../create_lams_tool_taskList.sql) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/db/sql/create_lams_tool_taskList.sql (.../create_lams_tool_taskList.sql) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -48,7 +48,6 @@ create_by bigint, create_date datetime, create_by_author tinyint, - is_hide tinyint, is_required tinyint, is_comments_allowed tinyint, show_comments_to_all tinyint, @@ -129,7 +128,7 @@ `lock_when_finished`, `is_sequential_order`, `allow_contribute_tasks`, `is_monitor_verification_required`, `reflect_on_activity`) VALUES (1,NULL,NULL,NULL,'TaskList','0','Instructions ',null,null,0,0,${default_content_id},0,0,0,0,0); -INSERT INTO `tl_latask10_taskList_item` (`uid`, `sequence_id`, `description`, `init_item`, `organization_xml`, `title`, `create_by`, `create_date`, `create_by_author`, `is_hide`, `is_required`, `is_comments_allowed`, `show_comments_to_all`, `is_child_task`, `parent_task_name`, `taskList_uid`, `session_uid`) VALUES - (1,1,NULL,NULL,NULL,'Task number 1',null,NOW(),1,0,0,0,0,0,NULL,1,NULL); +INSERT INTO `tl_latask10_taskList_item` (`uid`, `sequence_id`, `description`, `init_item`, `organization_xml`, `title`, `create_by`, `create_date`, `create_by_author`, `is_required`, `is_comments_allowed`, `show_comments_to_all`, `is_child_task`, `parent_task_name`, `taskList_uid`, `session_uid`) VALUES + (1,1,NULL,NULL,NULL,'Task number 1',null,NOW(),1,0,0,0,0,NULL,1,NULL); SET FOREIGN_KEY_CHECKS=1; Index: lams_tool_task/db/sql/table-schema.sql =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/db/sql/table-schema.sql (.../table-schema.sql) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/db/sql/table-schema.sql (.../table-schema.sql) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -28,7 +28,7 @@ create table tl_latask10_item_comment (uid bigint not null auto_increment, comment varchar(255), taskList_item_uid bigint, create_by bigint, create_date datetime, primary key (uid)); create table tl_latask10_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, status integer, taskList_uid bigint, session_id bigint, session_name varchar(250), primary key (uid)); create table tl_latask10_taskList (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), run_offline bit, instructions text, online_instructions text, offline_instructions text, content_in_use bit, define_later bit, content_id bigint unique, lock_when_finished bit, allow_contribute_tasks bit, is_monitor_verification_required bit, is_sequential_order bit, reflect_instructions varchar(255), reflect_on_activity bit, primary key (uid)); -create table tl_latask10_taskList_item (uid bigint not null auto_increment, description varchar(255), init_item varchar(255), organization_xml text, title varchar(255), create_by bigint, create_date datetime, create_by_author bit, is_hide bit, sequence_id integer, is_required bit, is_comments_allowed bit, show_comments_to_all bit, is_child_task bit, parent_task_name varchar(255), taskList_uid bigint, session_uid bigint, primary key (uid)); +create table tl_latask10_taskList_item (uid bigint not null auto_increment, description varchar(255), init_item varchar(255), organization_xml text, title varchar(255), create_by bigint, create_date datetime, create_by_author bit, sequence_id integer, is_required bit, is_comments_allowed bit, show_comments_to_all bit, is_child_task bit, parent_task_name varchar(255), taskList_uid bigint, session_uid bigint, primary key (uid)); create table tl_latask10_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), first_name varchar(255), login_name varchar(255), session_uid bigint, taskList_uid bigint, session_finished bit, primary key (uid)); alter table tl_latask10_attachment add index FK281134C2994F51CE (taskList_uid), add constraint FK281134C2994F51CE foreign key (taskList_uid) references tl_latask10_taskList (uid); alter table tl_latask10_item_log add index FK6CFEC3773324488D (taskList_item_uid), add constraint FK6CFEC3773324488D foreign key (taskList_item_uid) references tl_latask10_taskList_item (uid); Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/TaskListConstants.java =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/TaskListConstants.java (.../TaskListConstants.java) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/TaskListConstants.java (.../TaskListConstants.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -30,12 +30,6 @@ public static final int COMPLETED = 1; -// //taskList type; -// public static final short RESOURCE_TYPE_URL = 1; -// public static final short RESOURCE_TYPE_FILE = 2; -// public static final short RESOURCE_TYPE_WEBSITE = 3; -// public static final short RESOURCE_TYPE_LEARNING_OBJECT = 4; - //for action forward name public static final String SUCCESS = "success"; public static final String ERROR = "error"; @@ -67,7 +61,8 @@ public static final String ATTR_RUN_AUTO = "runAuto"; public static final String ATTR_RESOURCE_ITEM_UID = "itemUid"; public static final String ATTR_NEXT_ACTIVITY_URL = "nextActivityUrl"; - public static final String ATTR_SUMMARY_LIST = "summaryList"; + public static final String ATTR_SUMMARY = "summary"; + public static final String ATTR_EXPORT_DTO_LIST = "exportDTOList"; public static final String ATTR_USER_LIST = "userList"; public static final String ATTR_FINISH_LOCK = "finishedLock"; public static final String ATTR_SESSION_MAP_ID = "sessionMapID"; @@ -84,13 +79,8 @@ //error message keys public static final String ERROR_MSG_TITLE_BLANK = "error.resource.item.title.blank"; - public static final String ERROR_MSG_URL_BLANK = "error.resource.item.url.blank"; - public static final String ERROR_MSG_DESC_BLANK = "error.resource.item.desc.blank"; - public static final String ERROR_MSG_FILE_BLANK = "error.resource.item.file.blank"; - public static final String ERROR_MSG_INVALID_URL = "error.resource.item.invalid.url"; public static final String ERROR_MSG_UPLOAD_FAILED = "error.upload.failed"; - public static final String PAGE_EDITABLE = "isPageEditable"; public static final String MODE_AUTHOR_SESSION = "author_session"; public static final String ATTR_REFLECTION_ON = "reflectOn"; Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/AttachmentDTO.java =================================================================== diff -u --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/AttachmentDTO.java (revision 0) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/AttachmentDTO.java (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -0,0 +1,99 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.taskList.dto; + +import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemAttachment; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemComment; + +/** + * DTO class used for export of TaskListItem's attachments. Usefull for + * TaskListAttachment and TaskListItemAttachment + * both.
+ * + * @author Andrey Balan + * + */ +public class AttachmentDTO { + + private Long fileUuid; + private Long fileVersionId; + private String fileName; + private String attachmentLocalUrl; + //following is used for TaskListItemAttachment only + private String createdBy; + + public AttachmentDTO(){} + + /** + * Contruction method for export summary function. + * + * Don't not set isInitGroup and viewNumber fields + * @param sessionName + * @param item + * @param isInitGroup + */ + public AttachmentDTO(TaskListItemAttachment attachment){ + this.fileName = attachment.getFileName(); + this.fileUuid = attachment.getFileUuid(); + this.fileVersionId = attachment.getFileVersionId(); + this.createdBy = attachment.getCreateBy().getLoginName(); + } + + public Long getFileUuid() { + return fileUuid; + } + public void setFileUuid(Long fileUuid) { + this.fileUuid = fileUuid; + } + + public Long getFileVersionId() { + return fileVersionId; + } + public void setFileVersionId(Long fileVersionId) { + this.fileVersionId = fileVersionId; + } + + public String getAttachmentLocalUrl() { + return attachmentLocalUrl; + } + public void setAttachmentLocalUrl(String attachmentLocalUrl) { + this.attachmentLocalUrl = attachmentLocalUrl; + } + + public String getFileName() { + return fileName; + } + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getCreatedBy() { + return createdBy; + } + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } +} + \ No newline at end of file Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/CommentDTO.java =================================================================== diff -u --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/CommentDTO.java (revision 0) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/CommentDTO.java (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -0,0 +1,84 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.taskList.dto; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemComment; +import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; + +/** + * DTO class used for export of TaskListItem's comments. + * + * @author Andrey Balan + * + */ +public class CommentDTO { + + private String comment; + private String createdBy; + private Date createDate; + + public CommentDTO(){} + + /** + * Contruction method for monitoring summary function. + * + * Don't not set isInitGroup and viewNumber fields + * @param sessionName + * @param item + * @param isInitGroup + * @param userLogin + */ + public CommentDTO(TaskListItemComment comment){ + this.comment = comment.getComment(); + this.createdBy = comment.getCreateBy().getLoginName(); + this.createDate = comment.getCreateDate(); + } + + public String getComment() { + return comment; + } + public void setComment(String comment) { + this.comment = comment; + } + + public String getCreatedBy() { + return createdBy; + } + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getCreateDate() { + return createDate; + } + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} + \ No newline at end of file Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/ExportDTO.java =================================================================== diff -u --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/ExportDTO.java (revision 0) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/ExportDTO.java (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -0,0 +1,197 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.taskList.dto; + +import java.util.ArrayList; +import java.util.List; + +import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemAttachment; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemComment; + +/** + * List contains following element:
+ * + *
  • session_id
  • + *
  • session_name
  • + *
  • TaskListItem.uid
  • + *
  • TaskListItem.create_by_author
  • + *
  • TaskListItem.is_hide
  • + *
  • TaskListItem.title
  • + *
  • User.login_name
  • + *
  • count(taskList_item_uid)
  • + * @author Steve.Ni + * + * @version $Revision$ + */ +public class ExportDTO { + + private String sessionName; + private Long itemUid; + private boolean itemCreateByAuthor; + private String itemTitle; + private String username; + + //true: initial group item, false, belong to some group. + private boolean isInitGroup; + + private List commentDTOs; + private List attachmentDTOs; + + public ExportDTO(){} + + /** + * Contruction method for export profolio function. learner + * + * Don't not set sessionId and viewNumber fields + * @param sessionName + * @param item + * @param isInitGroup + */ + public ExportDTO(String sessionName, TaskListItem item,boolean isInitGroup, String userLogin){ + commentDTOs = new ArrayList(); + attachmentDTOs = new ArrayList(); + this.sessionName = sessionName; + if(item != null){ + this.itemUid = item.getUid(); + this.itemCreateByAuthor = item.isCreateByAuthor(); + this.itemTitle = item.getTitle(); + this.username = item.getCreateBy() == null?"":item.getCreateBy().getLoginName(); + + if (item.isCommentsAllowed()) { + for (Object objectComment:item.getComments()) { + TaskListItemComment comment = (TaskListItemComment) objectComment; + + if (item.getShowCommentsToAll() || comment.getCreateBy().getLoginName().equals(userLogin)) { + CommentDTO commentDTO = new CommentDTO(comment); + commentDTOs.add(commentDTO); + } + } + + for (Object objectAttachment:item.getUploadedFileList()) { + TaskListItemAttachment attachment = (TaskListItemAttachment) objectAttachment; + + if (item.getShowCommentsToAll() || attachment.getCreateBy().getLoginName().equals(userLogin)) { + AttachmentDTO attachmentDTO = new AttachmentDTO(attachment); + attachmentDTOs.add(attachmentDTO); + } + } + } + + }else { + this.itemUid = new Long(-1); + } + + this.isInitGroup = isInitGroup; + } + + /** + * Contruction method for export profolio function. teacher + * + * Don't not set sessionId and viewNumber fields + * @param sessionName + * @param item + * @param isInitGroup + */ + public ExportDTO(String sessionName, TaskListItem item, boolean isInitGroup){ + commentDTOs = new ArrayList(); + attachmentDTOs = new ArrayList(); + this.sessionName = sessionName; + if(item != null){ + this.itemUid = item.getUid(); + this.itemCreateByAuthor = item.isCreateByAuthor(); + this.itemTitle = item.getTitle(); + this.username = item.getCreateBy() == null?"":item.getCreateBy().getLoginName(); + + if (item.isCommentsAllowed()) { + for (Object objectComment:item.getComments()) { + TaskListItemComment comment = (TaskListItemComment) objectComment; + CommentDTO commentDTO = new CommentDTO(comment); + commentDTOs.add(commentDTO); + } + + for (Object objectAttachment:item.getUploadedFileList()) { + TaskListItemAttachment attachment = (TaskListItemAttachment) objectAttachment; + AttachmentDTO attachmentDTO = new AttachmentDTO(attachment); + attachmentDTOs.add(attachmentDTO); + } + } + + }else { + this.itemUid = new Long(-1); + } + + this.isInitGroup = isInitGroup; + } + + public boolean isItemCreateByAuthor() { + return itemCreateByAuthor; + } + public void setItemCreateByAuthor(boolean itemCreateByAuthor) { + this.itemCreateByAuthor = itemCreateByAuthor; + } + + public String getItemTitle() { + return itemTitle; + } + public void setItemTitle(String itemTitle) { + this.itemTitle = itemTitle; + } + public Long getItemUid() { + return itemUid; + } + public void setItemUid(Long itemUid) { + this.itemUid = itemUid; + } + + public String getSessionName() { + return sessionName; + } + public void setSessionName(String sessionName) { + this.sessionName = sessionName; + } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + public boolean isInitGroup() { + return isInitGroup; + } + + public void setInitGroup(boolean isInitGroup) { + this.isInitGroup = isInitGroup; + } + + public List getCommentDTOs() { + return commentDTOs; + } + public List getAttachmentDTOs() { + return attachmentDTOs; + } + +} Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/Summary.java =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/Summary.java (.../Summary.java) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/Summary.java (.../Summary.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -24,15 +24,20 @@ /* $Id$ */ package org.lamsfoundation.lams.tool.taskList.dto; +import java.util.ArrayList; +import java.util.List; + import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemAttachment; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItemComment; +import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; /** * List contains following element:
    * *
  • session_id
  • *
  • session_name
  • *
  • TaskListItem.uid
  • - *
  • TaskListItem.item_type
  • *
  • TaskListItem.create_by_author
  • *
  • TaskListItem.is_hide
  • *
  • TaskListItem.title
  • @@ -44,19 +49,15 @@ */ public class Summary { - private Long sessionId; - private String sessionName; - private Long itemUid; - private boolean itemCreateByAuthor; - private boolean itemHide; - private String itemTitle; - private String username; - private int viewNumber; + private boolean isMonitorVerificationRequired; - //true: initial group item, false, belong to some group. - private boolean isInitGroup; + private List userNames; + private List taskListItems; + private boolean[][] completeMap; + public Summary(){} + /** * Contruction method for monitoring summary function. * @@ -65,93 +66,39 @@ * @param item * @param isInitGroup */ - public Summary(Long sessionId, String sessionName, TaskListItem item){ - this.sessionId = sessionId; - this.sessionName = sessionName; - if(item != null){ - this.itemUid = item.getUid(); - this.itemCreateByAuthor = item.isCreateByAuthor(); - this.itemHide = item.isHide(); - this.itemTitle = item.getTitle(); - this.username = item.getCreateBy() == null?"":item.getCreateBy().getLoginName(); - }else - this.itemUid = new Long(-1); + public Summary(List taskListItems, List userNames, boolean[][] completeMap, boolean isMonitorVerificationRequired){ + this.userNames = userNames; + this.taskListItems = taskListItems; + this.completeMap = completeMap; + this.isMonitorVerificationRequired = isMonitorVerificationRequired; } - /** - * Contruction method for export profolio function. - * - * Don't not set sessionId and viewNumber fields - * @param sessionName - * @param item - * @param isInitGroup - */ - public Summary(String sessionName, TaskListItem item,boolean isInitGroup){ - this.sessionName = sessionName; - if(item != null){ - this.itemUid = item.getUid(); - this.itemCreateByAuthor = item.isCreateByAuthor(); - this.itemHide = item.isHide(); - this.itemTitle = item.getTitle(); - this.username = item.getCreateBy() == null?"":item.getCreateBy().getLoginName(); - }else - this.itemUid = new Long(-1); - this.isInitGroup = isInitGroup; + + public List getUserNames() { + return userNames; } - public boolean isItemCreateByAuthor() { - return itemCreateByAuthor; + public void setUserNames(List userNames) { + this.userNames = userNames; } - public void setItemCreateByAuthor(boolean itemCreateByAuthor) { - this.itemCreateByAuthor = itemCreateByAuthor; + + public List getTaskListItems() { + return taskListItems; } - public boolean isItemHide() { - return itemHide; + public void setTaskListItems(List taskListItems) { + this.taskListItems = taskListItems; } - public void setItemHide(boolean itemHide) { - this.itemHide = itemHide; + + public boolean[][] getCompleteMap() { + return completeMap; } - public String getItemTitle() { - return itemTitle; + public void setCompleteMap(boolean[][] completeMap) { + this.completeMap = completeMap; } - public void setItemTitle(String itemTitle) { - this.itemTitle = itemTitle; + + public boolean isMonitorVerificationRequired() { + return isMonitorVerificationRequired; } - public Long getItemUid() { - return itemUid; + public void setIsMonitorVerificationRequired(boolean isMonitorVerificationRequired) { + this.isMonitorVerificationRequired = isMonitorVerificationRequired; } - public void setItemUid(Long itemUid) { - this.itemUid = itemUid; - } - public Long getSessionId() { - return sessionId; - } - public void setSessionId(Long sessionId) { - this.sessionId = sessionId; - } - public String getSessionName() { - return sessionName; - } - public void setSessionName(String sessionName) { - this.sessionName = sessionName; - } - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public int getViewNumber() { - return viewNumber; - } - public void setViewNumber(int viewNumber) { - this.viewNumber = viewNumber; - } - - public boolean isInitGroup() { - return isInitGroup; - } - - public void setInitGroup(boolean isInitGroup) { - this.isInitGroup = isInitGroup; - } } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskList.java =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskList.java (.../TaskList.java) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskList.java (.../TaskList.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -85,6 +85,7 @@ private List onlineFileList; private List offlineFileList; + /** * Default contruction method. * @@ -93,6 +94,7 @@ attachments = new HashSet(); taskListItems = new HashSet(); } + // ********************************************************** // Function method for TaskList // ********************************************************** @@ -125,7 +127,7 @@ while(iter.hasNext()){ TaskListItem item = (TaskListItem)iter.next(); TaskListItem newItem = (TaskListItem) item.clone(); -// just clone old file without duplicate it in repository + //just clone old file without duplicate it in repository set.add(newItem); } taskList.taskListItems = set; @@ -137,7 +139,7 @@ while(iter.hasNext()){ TaskListAttachment file = (TaskListAttachment)iter.next(); TaskListAttachment newFile = (TaskListAttachment) file.clone(); -// just clone old file without duplicate it in repository + //just clone old file without duplicate it in repository set.add(newFile); } @@ -295,8 +297,6 @@ this.title = title; } - - /** * @return Returns the runOffline. * Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListItem.hbm.xml =================================================================== diff -u -r972362fd3b15f3887b276091d6731b78d2d1296a -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListItem.hbm.xml (.../TaskListItem.hbm.xml) (revision 972362fd3b15f3887b276091d6731b78d2d1296a) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListItem.hbm.xml (.../TaskListItem.hbm.xml) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -86,14 +86,6 @@ /> - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListItemAttachment.java =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListItemAttachment.java (.../TaskListItemAttachment.java) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListItemAttachment.java (.../TaskListItemAttachment.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -51,51 +51,53 @@ private Date created; private TaskListUser createBy; -// //Default contruction method -// public TaskListItemAttachment(){ -// -// } -// // ********************************************************** -// // Function method for Attachment -// // ********************************************************** -// public Object clone(){ -// Object obj = null; -// try { -// obj = super.clone(); -// ((TaskListItemAttachment)obj).setUid(null); -// } catch (CloneNotSupportedException e) { -// log.error("When clone " + TaskListItemAttachment.class + " failed"); -// } -// -// return obj; -// } -// public boolean equals(Object o) { -// if (this == o) -// return true; -// if (!(o instanceof TaskListItemAttachment)) -// return false; -// -// final TaskListItemAttachment genericEntity = (TaskListItemAttachment) o; -// -// return new EqualsBuilder() -// .append(this.uid,genericEntity.uid) -// .append(this.fileVersionId,genericEntity.fileVersionId) -// .append(this.fileName,genericEntity.fileName) -// .append(this.fileType,genericEntity.fileType) -// .append(this.created,genericEntity.created) -// .append(this.createBy,genericEntity.createBy) -// .isEquals(); -// } -// -// public int hashCode() { -// return new HashCodeBuilder().append(uid).append(fileVersionId).append( -// fileName).append(fileType).append(created).append(createBy) -// .toHashCode(); -// } + // ********************************************************** + // Function method for TaskListItemAttachment + // ********************************************************** + public Object clone(){ + TaskListItemAttachment taskListItemAttachment = null; + try { + taskListItemAttachment = (TaskListItemAttachment) super.clone(); + ((TaskListItemAttachment)taskListItemAttachment).setUid(null); + + //clone ReourceUser as well + if(this.createBy != null){ + taskListItemAttachment.setCreateBy((TaskListUser) this.createBy.clone()); + } + } catch (CloneNotSupportedException e) { + log.error("When clone " + TaskListItemAttachment.class + " failed"); + } + + return taskListItemAttachment; + } + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof TaskListItemAttachment)) + return false; + + final TaskListItemAttachment genericEntity = (TaskListItemAttachment) o; + + return new EqualsBuilder() + .append(this.uid,genericEntity.uid) + .append(this.fileVersionId,genericEntity.fileVersionId) + .append(this.fileName,genericEntity.fileName) + .append(this.fileType,genericEntity.fileType) + .append(this.created,genericEntity.created) + .append(this.createBy,genericEntity.createBy) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder().append(uid).append(fileVersionId).append( + fileName).append(fileType).append(created).append(createBy) + .toHashCode(); + } // ********************************************************** - // get/set methods + // Get/Set methods // ********************************************************** + /** * @hibernate.id generator-class="native" type="java.lang.Long" column="uid" * @return Returns the log Uid. Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListItemComment.java =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListItemComment.java (.../TaskListItemComment.java) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListItemComment.java (.../TaskListItemComment.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -25,6 +25,10 @@ package org.lamsfoundation.lams.tool.taskList.model; import java.util.Date; + +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.log4j.Logger; /** * TaskList * @author Andrey Balan @@ -33,12 +37,57 @@ * */ public class TaskListItemComment { + + private static final Logger log = Logger.getLogger(TaskListItemComment.class); private Long uid; private String comment; private TaskListUser createBy; private Date createDate; + // ********************************************************** + // Function method for TaskListItemComment + // ********************************************************** + public Object clone(){ + TaskListItemComment taskListItemComment = null; + try { + taskListItemComment = (TaskListItemComment) super.clone(); + ((TaskListItemComment)taskListItemComment).setUid(null); + + //clone ReourceUser as well + if(this.createBy != null){ + taskListItemComment.setCreateBy((TaskListUser) this.createBy.clone()); + } + } catch (CloneNotSupportedException e) { + log.error("When clone " + TaskListItemComment.class + " failed"); + } + + return taskListItemComment; + } + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof TaskListItemComment)) + return false; + + final TaskListItemComment genericEntity = (TaskListItemComment) o; + + return new EqualsBuilder() + .append(this.uid,genericEntity.uid) + .append(this.comment,genericEntity.comment) + .append(this.createBy,genericEntity.createBy) + .isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder().append(uid).append(comment) + .append(createBy).toHashCode(); + } + + // ********************************************************** + // Get/Set methods + // ********************************************************** + /** * @hibernate.property column="create_date" * @return Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListSession.java =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListSession.java (.../TaskListSession.java) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListSession.java (.../TaskListSession.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -56,7 +56,7 @@ // ********************************************************** /** * @hibernate.id generator-class="native" type="java.lang.Long" column="uid" - * @return Returns the learnerID. + * @return Returns the ID. */ public Long getUid() { return uid; Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListUser.java =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListUser.java (.../TaskListUser.java) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListUser.java (.../TaskListUser.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -54,6 +54,8 @@ //the user access some reousrce item date time. Use in monitoring summary page private Date accessDate; + private boolean verified; + public TaskListUser(){ } public TaskListUser(UserDTO user, TaskListSession session){ @@ -216,5 +218,11 @@ this.accessDate = accessDate; } + public boolean getVerified() { + return verified; + } + public void setVerified(boolean verified) { + this.verified = verified; + } } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/start.jsp =================================================================== diff -u --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/start.jsp (revision 0) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/start.jsp (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -0,0 +1,16 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + + <%-- --%> + + + + + + Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/ITaskListService.java =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/ITaskListService.java (.../ITaskListService.java) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/ITaskListService.java (.../ITaskListService.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -30,6 +30,7 @@ import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.tool.taskList.dto.ExportDTO; import org.lamsfoundation.lams.tool.taskList.dto.ReflectDTO; import org.lamsfoundation.lams.tool.taskList.dto.Summary; import org.lamsfoundation.lams.tool.taskList.model.TaskList; @@ -183,27 +184,20 @@ * @param contentId * @return */ - List> getSummary(Long contentId); + Summary getSummary(Long contentId); List getUserListBySessionItem(Long sessionId, Long itemUid); /** - * Set a taskList item visible or not. - * @param itemUid - * @param visible true, item is visible. False, item is invisible. - */ - void setItemVisible(Long itemUid, boolean visible); - - /** - * Get taskList item Summary list according to sessionId and skipHide flag. + * Get taskList item Summary list according to sessionId, and userLogin. * * @param sessionId - * @param skipHide true, don't get taskList item if its isHide flag is true. - * Otherwise, get all taskList item + * @param userLogin login of the user which portfolio is being exported + * * @return */ - public List exportBySessionId(Long sessionId, boolean skipHide); - public List> exportByContentId(Long contentId); + public List exportBySessionId(Long sessionId, String userLogin); + public List> exportByContentId(Long contentId); /** * Create refection entry into notebook tool. @@ -244,5 +238,6 @@ TaskListUser getUser(Long uid); public void saveOrUpdateTaskListItem(TaskListItem item); +// Summary getSummary(Long contentId, String null1); } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java (.../TaskListServiceImpl.java) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java (.../TaskListServiceImpl.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -45,6 +45,7 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.struts.upload.FormFile; +import org.hibernate.collection.PersistentSet; import org.lamsfoundation.lams.contentrepository.AccessDeniedException; import org.lamsfoundation.lams.contentrepository.ICredentials; import org.lamsfoundation.lams.contentrepository.ITicket; @@ -81,6 +82,7 @@ import org.lamsfoundation.lams.tool.taskList.dao.TaskListItemVisitDAO; import org.lamsfoundation.lams.tool.taskList.dao.TaskListSessionDAO; import org.lamsfoundation.lams.tool.taskList.dao.TaskListUserDAO; +import org.lamsfoundation.lams.tool.taskList.dto.ExportDTO; import org.lamsfoundation.lams.tool.taskList.dto.ReflectDTO; import org.lamsfoundation.lams.tool.taskList.dto.Summary; import org.lamsfoundation.lams.tool.taskList.model.TaskList; @@ -91,6 +93,7 @@ import org.lamsfoundation.lams.tool.taskList.model.TaskListSession; import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; import org.lamsfoundation.lams.tool.taskList.util.TaskListToolContentHandler; +import org.lamsfoundation.lams.usermanagement.Role; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; @@ -130,6 +133,7 @@ private class ReflectDTOComparator implements Comparator{ public int compare(ReflectDTO o1, ReflectDTO o2) { + if(o1 != null && o2 != null){ return o1.getFullName().compareTo(o2.getFullName()); }else if(o1 != null) @@ -342,70 +346,66 @@ return items; } - public List exportBySessionId(Long sessionId, boolean skipHide) { + public List exportBySessionId(Long sessionId, String userLogin) { TaskListSession session = taskListSessionDao.getSessionBySessionId(sessionId); if(session == null){ log.error("Failed get TaskListSession by ID [" +sessionId + "]"); return null; } //initial taskList items list - List itemList = new ArrayList(); + List itemList = new ArrayList(); Set resList = session.getTaskList().getTaskListItems(); for(TaskListItem item:resList){ - if(skipHide && item.isHide()) - continue; //if item is create by author if(item.isCreateByAuthor()){ - Summary sum = new Summary(session.getSessionName(),item,false); - itemList.add(sum); + ExportDTO exportDTO = new ExportDTO(session.getSessionName(), item, false, userLogin); + itemList.add(exportDTO); } } //get this session's all taskList items Set sessList =session.getTaskListItems(); for(TaskListItem item:sessList){ - if(skipHide && item.isHide()) - continue; - //to skip all item create by author if(!item.isCreateByAuthor()){ - Summary sum = new Summary(session.getSessionName(),item,false); - itemList.add(sum); + ExportDTO exportDTO = new ExportDTO(session.getSessionName(), item, false, userLogin); + itemList.add(exportDTO); } } return itemList; } - public List> exportByContentId(Long contentId) { + + public List> exportByContentId(Long contentId) { TaskList taskList = taskListDao.getByContentId(contentId); - List> groupList = new ArrayList(); + List> groupList = new ArrayList(); //create init taskList items list - List initList = new ArrayList(); + List initList = new ArrayList(); groupList.add(initList); Set resList = taskList.getTaskListItems(); for(TaskListItem item:resList){ if(item.isCreateByAuthor()){ - Summary sum = new Summary(null,item,true); - initList.add(sum); + ExportDTO exportDTO = new ExportDTO(null,item,true); + initList.add(exportDTO); } } //session by session List sessionList = taskListSessionDao.getByContentId(contentId); for(TaskListSession session:sessionList){ - List group = new ArrayList(); + List group = new ArrayList(); //get this session's all taskList items Set sessList =session.getTaskListItems(); for(TaskListItem item:sessList){ //to skip all item create by author if(!item.isCreateByAuthor()){ - Summary sum = new Summary(session.getSessionName(),item,false); - group.add(sum); + ExportDTO exportDTO = new ExportDTO(session.getSessionName(),item,false); + group.add(exportDTO); } } if(group.size() == 0){ - group.add(new Summary(session.getSessionName(),null,false)); + group.add(new ExportDTO(session.getSessionName(),null,false)); } groupList.add(group); } @@ -508,51 +508,103 @@ public TaskListItem getTaskListItemByUid(Long itemUid) { return taskListItemDao.getByUid(itemUid); } - public List> getSummary(Long contentId) { - List> groupList = new ArrayList>(); - List group = new ArrayList(); + + public Summary getSummary(Long contentId) { - //get all item which is accessed by user - Map visitCountMap = taskListItemVisitDao.getSummary(contentId); - TaskList taskList = taskListDao.getByContentId(contentId); - Set resItemList = taskList.getTaskListItems(); + ArrayList itemList = new ArrayList(); + itemList.addAll(taskList.getTaskListItems()); + + ArrayList userList = new ArrayList(); + +// service.isUserInRole(userId, group.getOrganisationId(), Role.GROUP_ADMIN) +// userManagementService.getAllUsers(filteredOrgId) +// userManagementService.is +// taskListUserDao.getBySessionID(contentId); +// TaskListUser user = taskListUserDao.getUserByUserIDAndContentID(userId, contentId); +// users.add(user); - //get all sessions in a taskList and retrieve all taskList items under this session - //plus initial taskList items by author creating (resItemList) List sessionList = taskListSessionDao.getByContentId(contentId); - for(TaskListSession session:sessionList){ - //one new group for one session. - group = new ArrayList(); - //firstly, put all initial taskList item into this group. - for(TaskListItem item:resItemList){ - Summary sum = new Summary(session.getSessionId(),session.getSessionName(),item); - //set viewNumber according visit log - if(visitCountMap.containsKey(item.getUid())) - sum.setViewNumber(visitCountMap.get(item.getUid()).intValue()); - group.add(sum); + for(TaskListSession session:sessionList) { + + Set newItems = session.getTaskListItems(); + for(TaskListItem item : newItems) { + if (!itemList.contains(item)) itemList.add(item); } - //get this session's all taskList items - Set sessItemList =session.getTaskListItems(); - for(TaskListItem item : sessItemList){ - //to skip all item create by author - if(!item.isCreateByAuthor()){ - Summary sum = new Summary(session.getSessionId(),session.getSessionName(),item); - //set viewNumber according visit log - if(visitCountMap.containsKey(item.getUid())) - sum.setViewNumber(visitCountMap.get(item.getUid()).intValue()); - group.add(sum); + +// userList.addAll(taskListUserDao.getBySessionID(session.getSessionId())); + List newUsers = taskListUserDao.getBySessionID(session.getSessionId()); + for(TaskListUser user : newUsers) { + if (!userList.contains(user)) userList.add(user); + } + } + + boolean[][] complete = new boolean[userList.size()][itemList.size()]; + for (int i = 0; i < userList.size(); i++) { + for (int j = 0; j < itemList.size(); j++) { + + TaskListUser user = userList.get(i); + TaskListItem item = itemList.get(j); + + TaskListItemVisitLog visitLog = taskListItemVisitDao.getTaskListItemLog(item.getUid(), user.getUserId()); + if (visitLog !=null) { + complete[i][j] = visitLog.isComplete(); + } else { + complete[i][j] = false; } } - //so far no any item available, so just put session name info to Summary - if(group.size() == 0) - group.add(new Summary(session.getSessionId(),session.getSessionName(),null)); - groupList.add(group); - } + } - return groupList; - + Summary summary = new Summary(itemList, userList, complete, taskList.isMonitorVerificationRequired()); + return summary; } + +// public List> getSummary(Long contentId) { +// List> groupList = new ArrayList>(); +// List group = new ArrayList(); +// +// //get all item which is accessed by user +// Map visitCountMap = taskListItemVisitDao.getSummary(contentId); +// +// TaskList taskList = taskListDao.getByContentId(contentId); +// Set resItemList = taskList.getTaskListItems(); +// +// //get all sessions in a taskList and retrieve all taskList items under this session +// //plus initial taskList items by author creating (resItemList) +// List sessionList = taskListSessionDao.getByContentId(contentId); +// for(TaskListSession session:sessionList){ +// //one new group for one session. +// group = new ArrayList(); +// //firstly, put all initial taskList item into this group. +// for(TaskListItem item:resItemList){ +// Summary sum = new Summary(session.getSessionId(),session.getSessionName(),item); +// //set viewNumber according visit log +// if(visitCountMap.containsKey(item.getUid())) +// sum.setViewNumber(visitCountMap.get(item.getUid()).intValue()); +// group.add(sum); +// } +// //get this session's all taskList items +// Set sessItemList =session.getTaskListItems(); +// for(TaskListItem item : sessItemList){ +// //to skip all item create by author +// if(!item.isCreateByAuthor()){ +// Summary sum = new Summary(session.getSessionId(),session.getSessionName(),item); +// //set viewNumber according visit log +// if(visitCountMap.containsKey(item.getUid())) +// sum.setViewNumber(visitCountMap.get(item.getUid()).intValue()); +// group.add(sum); +// } +// } +// //so far no any item available, so just put session name info to Summary +// if(group.size() == 0) +// group.add(new Summary(session.getSessionId(),session.getSessionName(),null)); +// groupList.add(group); +// } +// +// return groupList; +// return null; +// +// } public Map> getReflectList(Long contentId){ Map> map = new HashMap>(); @@ -584,27 +636,6 @@ return userList; } - public void setItemVisible(Long itemUid, boolean visible) { - TaskListItem item = taskListItemDao.getByUid(itemUid); - if ( item != null ) { - //createBy should be null for system default value. - Long userId = 0L; - String loginName = "No user"; - if(item.getCreateBy() != null){ - userId = item.getCreateBy().getUserId(); - loginName = item.getCreateBy().getLoginName(); - } - if ( visible ) { - auditService.logShowEntry(TaskListConstants.TOOL_SIGNATURE,userId, - loginName, item.toString()); - } else { - auditService.logHideEntry(TaskListConstants.TOOL_SIGNATURE, userId, - loginName, item.toString()); - } - item.setHide(!visible); - taskListItemDao.saveObject(item); - } - } public Long createNotebookEntry(Long sessionId, Integer notebookToolType, String toolSignature, Integer userId, String entryText) { return coreNotebookService.createNotebookEntry(sessionId, notebookToolType, toolSignature, userId, "", entryText); } @@ -1048,7 +1079,6 @@ item.setTitle((String) urlMap.get(ToolContentImport102Manager.CONTENT_TITLE)); item.setCreateBy(ruser); item.setCreateByAuthor(true); - item.setHide(false); // String taskListType = (String) urlMap.get(ToolContentImport102Manager.CONTENT_URL_URL_TYPE); // if ( ToolContentImport102Manager.URL_RESOURCE_TYPE_URL.equals(taskListType) ) { @@ -1135,6 +1165,4 @@ this.coreNotebookService = coreNotebookService; } - - } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/AuthoringAction.java =================================================================== diff -u -re12e54b34d1312f79a1c8b1fb3662fb5a6da9676 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision e12e54b34d1312f79a1c8b1fb3662fb5a6da9676) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -866,7 +866,6 @@ item.setTitle(itemForm.getTitle()); item.setDescription(itemForm.getDescription()); item.setCreateByAuthor(true); - item.setHide(false); item.setRequired(itemForm.isRequired()); item.setCommentsAllowed(itemForm.isCommentsAllowed()); Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/LearningAction.java =================================================================== diff -u -re12e54b34d1312f79a1c8b1fb3662fb5a6da9676 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/LearningAction.java (.../LearningAction.java) (revision e12e54b34d1312f79a1c8b1fb3662fb5a6da9676) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/LearningAction.java (.../LearningAction.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -219,9 +219,7 @@ //initial it to avoid session close error in proxy object. if(item.getCreateBy() != null) item.getCreateBy().getLoginName(); - if(!item.isHide()){ - taskListItemList.add(item); - } + taskListItemList.add(item); } } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/MonitoringAction.java =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -28,10 +28,12 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.SortedSet; 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; @@ -44,10 +46,13 @@ import org.lamsfoundation.lams.tool.taskList.dto.ReflectDTO; import org.lamsfoundation.lams.tool.taskList.dto.Summary; import org.lamsfoundation.lams.tool.taskList.model.TaskList; +import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; import org.lamsfoundation.lams.tool.taskList.model.TaskListSession; import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; import org.lamsfoundation.lams.tool.taskList.service.ITaskListService; +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; @@ -56,115 +61,77 @@ public class MonitoringAction extends Action { public static Logger log = Logger.getLogger(MonitoringAction.class); - - public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String param = mapping.getParameter(); if (param.equals("summary")) { return summary(mapping, form, request, response); } + + if(param.equals("verifyUser")){ + return verifyUser(mapping, form, request, response); + } if (param.equals("listuser")) { return listuser(mapping, form, request, response); } - if (param.equals("showitem")) { - return showitem(mapping, form, request, response); - } - if (param.equals("hideitem")) { - return hideitem(mapping, form, request, response); - } + if (param.equals("viewReflection")) { return viewReflection(mapping, form, request, response); } - return mapping.findForward(TaskListConstants.ERROR); } - - private ActionForward hideitem(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - - Long itemUid = WebUtil.readLongParam(request, TaskListConstants.PARAM_RESOURCE_ITEM_UID); + private ActionForward summary(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ITaskListService service = getTaskListService(); - service.setItemVisible(itemUid,false); - //get back SessionMap - String sessionMapID = request.getParameter(TaskListConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); - request.setAttribute(TaskListConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); + Long contentId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID); + request.setAttribute(AttributeNames.PARAM_TOOL_SESSION_ID,contentId); - //update session value - List groupList = (List) sessionMap.get(TaskListConstants.ATTR_SUMMARY_LIST); - if(groupList != null) - for(List group : groupList){ - for(Summary sum: group){ - if(itemUid.equals(sum.getItemUid())){ - sum.setItemHide(true); - break; - } - } - } - - return mapping.findForward(TaskListConstants.SUCCESS); - } - - private ActionForward showitem(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - Long itemUid = WebUtil.readLongParam(request, TaskListConstants.PARAM_RESOURCE_ITEM_UID); - ITaskListService service = getTaskListService(); - service.setItemVisible(itemUid,true); - - //get back SessionMap - String sessionMapID = request.getParameter(TaskListConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); - request.setAttribute(TaskListConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); - - //update session value - List groupList = (List) sessionMap.get(TaskListConstants.ATTR_SUMMARY_LIST); - if(groupList != null) - for(List group : groupList){ - for(Summary sum: group){ - if(itemUid.equals(sum.getItemUid())){ - sum.setItemHide(false); - break; - } - } - } - return mapping.findForward(TaskListConstants.SUCCESS); - } - - private ActionForward summary(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { //initial Session Map SessionMap sessionMap = new SessionMap(); request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); request.setAttribute(TaskListConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); -// save contentFolderID into session + //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); - ITaskListService service = getTaskListService(); - List> groupList = service.getSummary(contentId); - TaskList taskList = service.getTaskListByContentId(contentId); taskList.toDTO(); Map >relectList = service.getReflectList(contentId); + Summary summary = service.getSummary(contentId); //cache into sessionMap - sessionMap.put(TaskListConstants.ATTR_SUMMARY_LIST, groupList); + sessionMap.put(TaskListConstants.ATTR_SUMMARY, summary); sessionMap.put(TaskListConstants.PAGE_EDITABLE, taskList.isContentInUse()); sessionMap.put(TaskListConstants.ATTR_RESOURCE, taskList); sessionMap.put(TaskListConstants.ATTR_TOOL_CONTENT_ID, contentId); sessionMap.put(TaskListConstants.ATTR_REFLECT_LIST, relectList); return mapping.findForward(TaskListConstants.SUCCESS); } + + /** + * Mark taskList item as complete status. + * @param mapping + * @param form + * @param request + * @param response + * @return + */ + private ActionForward verifyUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - private ActionForward listuser(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + Long uid = WebUtil.readLongParam(request, TaskListConstants.ATTR_USER_UID); + Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); + + ITaskListService service = getTaskListService(); + TaskListUser user = service.getUser(uid); + + return mapping.findForward(TaskListConstants.SUCCESS); + } + + private ActionForward listuser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { Long sessionId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); Long itemUid = WebUtil.readLongParam(request, TaskListConstants.PARAM_RESOURCE_ITEM_UID); @@ -177,17 +144,14 @@ return mapping.findForward(TaskListConstants.SUCCESS); } - private ActionForward viewReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { + private ActionForward viewReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { Long uid = WebUtil.readLongParam(request, TaskListConstants.ATTR_USER_UID); Long sessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); ITaskListService service = getTaskListService(); TaskListUser user = service.getUser(uid); - NotebookEntry notebookEntry = service.getEntry(sessionID, - CoreNotebookConstants.NOTEBOOK_TOOL, - TaskListConstants.TOOL_SIGNATURE, user.getUserId().intValue()); + NotebookEntry notebookEntry = service.getEntry(sessionID, CoreNotebookConstants.NOTEBOOK_TOOL, TaskListConstants.TOOL_SIGNATURE, user.getUserId().intValue()); TaskListSession session = service.getTaskListSessionBySessionId(sessionID); @@ -209,8 +173,8 @@ // Private method // ************************************************************************************* private ITaskListService getTaskListService() { - WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() - .getServletContext()); + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); return (ITaskListService) wac.getBean(TaskListConstants.RESOURCE_SERVICE); } + } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/ViewItemAction.java =================================================================== diff -u -r5d767fb50e700c22e857db49f7ec2ab40d4e3744 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/ViewItemAction.java (.../ViewItemAction.java) (revision 5d767fb50e700c22e857db49f7ec2ab40d4e3744) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/ViewItemAction.java (.../ViewItemAction.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -124,12 +124,12 @@ //these attribute will be use to instruction navigator page request.setAttribute(TaskListConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); - request.setAttribute(AttributeNames.ATTR_MODE,mode); - request.setAttribute(TaskListConstants.ATTR_TOOL_SESSION_ID,sessionId); - int itemIdx = NumberUtils.stringToInt(request.getParameter(TaskListConstants.PARAM_ITEM_INDEX)); - request.setAttribute(TaskListConstants.PARAM_ITEM_INDEX,itemIdx); +// request.setAttribute(AttributeNames.ATTR_MODE,mode); +// request.setAttribute(TaskListConstants.ATTR_TOOL_SESSION_ID,sessionId); +// int itemIdx = NumberUtils.stringToInt(request.getParameter(TaskListConstants.PARAM_ITEM_INDEX)); +// request.setAttribute(TaskListConstants.PARAM_ITEM_INDEX,itemIdx); Long itemUid = NumberUtils.createLong(request.getParameter(TaskListConstants.PARAM_RESOURCE_ITEM_UID)); - request.setAttribute(TaskListConstants.PARAM_RESOURCE_ITEM_UID,itemUid); +// request.setAttribute(TaskListConstants.PARAM_RESOURCE_ITEM_UID,itemUid); sessionMap.put(TaskListConstants.PARAM_RESOURCE_ITEM_UID,itemUid); @@ -138,6 +138,7 @@ sessionMap.put(TaskListConstants.ATTR_TASK_LIST_ITEM_TITLE, item.getTitle()); sessionMap.put(TaskListConstants.ATTR_TASK_LIST_ITEM_DESCRIPTION,item.getDescription()); sessionMap.put(TaskListConstants.ATTR_TOOL_SESSION_ID,sessionId); + sessionMap.put(AttributeNames.ATTR_MODE,mode); //init taskList item list SortedSet commentList = getCommentList(sessionMap); Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/servlet/ExportServlet.java =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -25,6 +25,7 @@ package org.lamsfoundation.lams.tool.taskList.web.servlet; +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -37,14 +38,16 @@ import org.apache.log4j.Logger; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.taskList.TaskListConstants; -import org.lamsfoundation.lams.tool.taskList.dto.Summary; +import org.lamsfoundation.lams.tool.taskList.dto.AttachmentDTO; +import org.lamsfoundation.lams.tool.taskList.dto.ExportDTO; import org.lamsfoundation.lams.tool.taskList.model.TaskList; import org.lamsfoundation.lams.tool.taskList.model.TaskListSession; import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; import org.lamsfoundation.lams.tool.taskList.service.ITaskListService; import org.lamsfoundation.lams.tool.taskList.service.TaskListApplicationException; import org.lamsfoundation.lams.tool.taskList.service.TaskListServiceProxy; import org.lamsfoundation.lams.tool.taskList.util.TaskListToolContentHandler; +import org.lamsfoundation.lams.util.FileUtil; import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet; import org.lamsfoundation.lams.web.util.AttributeNames; import org.lamsfoundation.lams.web.util.SessionMap; @@ -64,7 +67,7 @@ private static Logger logger = Logger.getLogger(ExportServlet.class); - private final String FILENAME = "shared_taskList_main.html"; + private final String FILENAME = "taskList_main.html"; private TaskListToolContentHandler handler; @@ -114,8 +117,6 @@ return super.doOfflineExport(request, response, directoryName, cookies); } - - public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies, HashMap sessionMap) throws TaskListApplicationException { @@ -144,15 +145,15 @@ } - List group = service.exportBySessionId(toolSessionID,true); -// ????????????????????? -// saveFileToLocal(group, directoryName); + List group = service.exportBySessionId(toolSessionID, learner.getLoginName()); + + saveFileToLocal(group, directoryName); List groupList = new ArrayList(); if(group.size() > 0) groupList.add(group); sessionMap.put(TaskListConstants.ATTR_TITLE, content.getTitle()); - sessionMap.put(TaskListConstants.ATTR_SUMMARY_LIST, groupList); + sessionMap.put(TaskListConstants.ATTR_EXPORT_DTO_LIST, groupList); } public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies, HashMap sessionMap) @@ -173,46 +174,42 @@ logger.error(error); throw new TaskListApplicationException(error); } - List> groupList = service.exportByContentId(toolContentID); - ////????????????????????? -// if(groupList != null) -// for (List list : groupList) { -// saveFileToLocal(list, directoryName); -// } + List> groupList = service.exportByContentId(toolContentID); + + if(groupList != null) + for (List list : groupList) { + saveFileToLocal(list, directoryName); + } // put it into HTTPSession sessionMap.put(TaskListConstants.ATTR_TITLE, content.getTitle()); - sessionMap.put(TaskListConstants.ATTR_SUMMARY_LIST, groupList); + sessionMap.put(TaskListConstants.ATTR_EXPORT_DTO_LIST, groupList); } - /////???????????????????????????? -// private void saveFileToLocal(List list, String directoryName) { -// handler = getToolContentHandler(); -// for (Summary summary : list) { -// //for learning object, it just display "No offlice pakcage avaliable" information. -// if(summary.getItemType() == TaskListConstants.RESOURCE_TYPE_LEARNING_OBJECT -// || summary.getItemType() == TaskListConstants.RESOURCE_TYPE_URL) -// continue; -// try{ -// int idx= 1; -// String userName = summary.getUsername(); -// String localDir; -// while(true){ -// localDir = FileUtil.getFullPath(directoryName,userName + "/" + idx); -// File local = new File(localDir); -// if(!local.exists()){ -// local.mkdirs(); -// break; -// } -// idx++; -// } -// summary.setAttachmentLocalUrl(userName + "/" + idx + "/" + summary.getFileUuid() + '.' + FileUtil.getFileExtension(summary.getFileName())); -// handler.saveFile(summary.getFileUuid(), FileUtil.getFullPath(directoryName, summary.getAttachmentLocalUrl())); -// } catch (Exception e) { -// logger.error("Export forum topic attachment failed: " + e.toString()); -// } -// } -// -// } + private void saveFileToLocal(List exportDTOs, String directoryName) { + handler = getToolContentHandler(); + for (ExportDTO exportDTO : exportDTOs) { + for (AttachmentDTO attachment : exportDTO.getAttachmentDTOs()) { + try{ + int idx= 1; + String userName = attachment.getCreatedBy(); + String localDir; + while(true){ + localDir = FileUtil.getFullPath(directoryName,userName + "/" + idx); + File local = new File(localDir); + if(!local.exists()){ + local.mkdirs(); + break; + } + idx++; + } + attachment.setAttachmentLocalUrl(userName + "/" + idx + "/" + attachment.getFileUuid() + '.' + FileUtil.getFileExtension(attachment.getFileName())); + handler.saveFile(attachment.getFileUuid(), FileUtil.getFullPath(directoryName, attachment.getAttachmentLocalUrl())); + } catch (Exception e) { + logger.error("Export forum topic attachment failed: " + e.toString()); + } + } + } + } private TaskListToolContentHandler getToolContentHandler() { if ( handler == null ) { Index: lams_tool_task/web/includes/images/completeitem.gif =================================================================== diff -u Binary files differ Index: lams_tool_task/web/includes/images/incompleteitem.gif =================================================================== diff -u Binary files differ Index: lams_tool_task/web/pages/authoring/authoring.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -7,7 +7,7 @@ - <fmt:message key="label.author.title" /> + <fmt:message key="label.authoring.title" /> <%@ include file="/common/tabbedheader.jsp"%> <%@ include file="/common/fckeditorheader.jsp"%> Index: lams_tool_task/web/pages/authoring/definelater.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/authoring/definelater.jsp (.../definelater.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/authoring/definelater.jsp (.../definelater.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -12,7 +12,7 @@ %> - <fmt:message key="label.author.title" /> + <fmt:message key="label.authoring.title" /> <%@ include file="/common/tabbedheader.jsp"%> <%@ include file="/common/fckeditorheader.jsp"%> Index: lams_tool_task/web/pages/authoring/definelaterforbid.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/authoring/definelaterforbid.jsp (.../definelaterforbid.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/authoring/definelaterforbid.jsp (.../definelaterforbid.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -3,7 +3,7 @@ "http://www.w3.org/TR/html4/loose.dtd"> - <fmt:message key="label.author.title" /> + <fmt:message key="label.authoring.title" /> <%@ include file="/common/header.jsp"%> Index: lams_tool_task/web/pages/authoring/parts/itemlist.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/authoring/parts/itemlist.jsp (.../itemlist.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/authoring/parts/itemlist.jsp (.../itemlist.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -29,24 +29,24 @@ " + border="0" title="" onclick="upQuestion(${status.index},'${sessionMapID}')"> "> + border="0" title=""> "> + border="0" title=""> " + border="0" title="" onclick="downQuestion(${status.index},'${sessionMapID}')"> Index: lams_tool_task/web/pages/export/exportportfolio.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/export/exportportfolio.jsp (.../exportportfolio.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/export/exportportfolio.jsp (.../exportportfolio.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -3,7 +3,7 @@ "http://www.w3.org/TR/html4/loose.dtd"> - + @@ -33,7 +33,7 @@

    ${title}

    - + <%-- display group name on first row--%> @@ -54,13 +54,10 @@ + + + + - - - - - - - - <%-- End group title display --%> @@ -55,22 +168,6 @@ - - - <%-- Reflection list --%> + @@ -149,3 +236,5 @@
    - - - - + + - - - + + Index: lams_tool_task/web/pages/learning/learning.jsp =================================================================== diff -u -re12e54b34d1312f79a1c8b1fb3662fb5a6da9676 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/learning/learning.jsp (.../learning.jsp) (revision e12e54b34d1312f79a1c8b1fb3662fb5a6da9676) +++ lams_tool_task/web/pages/learning/learning.jsp (.../learning.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -159,7 +159,7 @@

    - +



    Index: lams_tool_task/web/pages/monitoring/monitoring.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -6,8 +6,8 @@ - <%@ include file="/common/tabbedheader.jsp" %> - Index: lams_tool_task/web/pages/monitoring/notebook.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/monitoring/notebook.jsp (.../notebook.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/monitoring/notebook.jsp (.../notebook.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -9,40 +9,40 @@ -
    -

    - -

    - ${userDTO.fullName}

    -
    - - + + @@ -85,50 +82,56 @@
    - - - - - - - - - - - - - - - ${item.itemTitle} ${item.username} - - - - - - - - - - - - - - + + +
    + + + + + + + + + + + + + +
    + + ${comment.createdBy} + - + +
    +
    + +
    +
    +
    + +
      + +
    • + + + + [${file.createdBy}] + +
    • +
      +
    - - - -
    - - - - - - -
    - -
    - - - - - - - - -
    - - - - -
    - -
    - - +
    +

    + +

    + ${userDTO.fullName}

    + + + + + + + +
    + +
    + + + + + + + + +
    + + + + +
    + +
    +
    + Index: lams_tool_task/web/pages/monitoring/statistic.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/monitoring/statistic.jsp (.../statistic.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/monitoring/statistic.jsp (.../statistic.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -2,7 +2,6 @@ -
    @@ -22,13 +21,10 @@
    - - - - Index: lams_tool_task/web/pages/monitoring/summary.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/monitoring/summary.jsp (.../summary.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -1,47 +1,160 @@ <%@ include file="/common/taglibs.jsp"%> - + + -
    - - + + @@ -48,28 +44,12 @@
    - - - - - - - - - - - - - - - ${item.itemTitle} - ${item.username} - + ${item.username} + @@ -80,8 +60,8 @@ ${item.viewNumber} - 0 - + 0 +
    - - - - <%-- display group name on first row--%> - +
    + +

    + Overall Summary +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + USER + + ${item.title} + + Complete Activity? +
    + ${user.loginName} + + + + + + + + + + + + + + + + + + [ for ${user.loginName}] + + + +
    + +<%-- + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + ${item.title} + + + + ${item.title} + + + + + [${item.createBy.loginName}] + + + + * + + + + + + + + + + + + + +
    - ${item.sessionName} - - - - - -
    - - + + - -
    - - - - - - - - - - - - - - - ${item.itemTitle} @@ -91,20 +188,10 @@ - - - - - - - - -
    + +--%> Index: lams_tool_task/web/pages/monitoring/userlist.jsp =================================================================== diff -u -r875f56cb6917d1a52bed0545f2933c3b55497a02 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/monitoring/userlist.jsp (.../userlist.jsp) (revision 875f56cb6917d1a52bed0545f2933c3b55497a02) +++ lams_tool_task/web/pages/monitoring/userlist.jsp (.../userlist.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -1,54 +1,54 @@ - <%@ include file="/common/taglibs.jsp"%> <%@ include file="/common/header.jsp" %> - -
    +

    - - - - - - - +
    - - - - - -
    - + + + + + + + + + + + + - - - - - - -
    - ${user.loginName} + + + + + + +
    + ${user.loginName} + + + + ${user.firstName},${user.lastName} +
    + Close - - - ${user.firstName},${user.lastName} -
    - Close -
    -
    - -
    + + + + +
    Index: lams_tool_task/web/pages/reviewtask/reviewtask.jsp =================================================================== diff -u -re56f0e75c6dca065dd45490bb76e7e70eaf528c5 -r182743b20b3ea04f99193cdce3a176f04d055641 --- lams_tool_task/web/pages/reviewtask/reviewtask.jsp (.../reviewtask.jsp) (revision e56f0e75c6dca065dd45490bb76e7e70eaf528c5) +++ lams_tool_task/web/pages/reviewtask/reviewtask.jsp (.../reviewtask.jsp) (revision 182743b20b3ea04f99193cdce3a176f04d055641) @@ -24,11 +24,6 @@ myForm.action = ""; myForm.submit(); } - -// function completeItem(itemUid){ - // document.location.href = "?sessionMapID=${sessionMapID}&itemUid=" + itemUid;//&mode=${mode} - // return false; - //} function completeItem(itemUid){ //learner and author(preview mode) will mark the finish