Index: lams_tool_survey/conf/xdoclet/struts-actions.xml =================================================================== diff -u -rdb4fc43d6e110f7298d227fae4683af2e1e681f3 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision db4fc43d6e110f7298d227fae4683af2e1e681f3) +++ lams_tool_survey/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -36,39 +36,6 @@ - - - - - - - - - - - - - - + Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/SurveyConstants.java =================================================================== diff -u -rdb4fc43d6e110f7298d227fae4683af2e1e681f3 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/SurveyConstants.java (.../SurveyConstants.java) (revision db4fc43d6e110f7298d227fae4683af2e1e681f3) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/SurveyConstants.java (.../SurveyConstants.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -44,8 +44,6 @@ public static final String DEFINE_LATER = "definelater"; - public static final String RUN_OFFLINE = "runOffline"; - public static final String FORWARD_RESULT = "result"; // for submission deadline @@ -61,8 +59,6 @@ public static final String PARAM_ITEM_INDEX = "itemIndex"; - public static final String PARAM_RUN_OFFLINE = "runOffline"; - public static final String PARAM_TITLE = "title"; public static final String ATTR_USER_UID = "userUid"; @@ -118,10 +114,6 @@ public static final String ATTR_INSTRUCTION_LIST = "instructionList"; - public static final String ATT_ATTACHMENT_LIST = "instructionAttachmentList"; - - public static final String ATTR_DELETED_ATTACHMENT_LIST = "deletedAttachmmentList"; - public static final String ATTR_QUESTION_LIST = "questionList"; public static final String ATTR_ANSWER_LIST = "answerList"; Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/SurveyAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dao/hibernate/SurveyAttachmentDAOHibernate.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dbupdates/patch20140102.sql =================================================================== diff -u --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dbupdates/patch20140102.sql (revision 0) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/dbupdates/patch20140102.sql (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -0,0 +1,19 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3147 Simplify tools: get rid of instructions tab, define in monitor and offline activity options +ALTER TABLE tl_lasurv11_survey DROP COLUMN online_instructions; +ALTER TABLE tl_lasurv11_survey DROP COLUMN offline_instructions; +ALTER TABLE tl_lasurv11_survey DROP COLUMN run_offline; +DROP TABLE IF EXISTS tl_lasurv11_attachment; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lasurv11'; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.java =================================================================== diff -u -rda3ab23df4afd600475db0e6f4886a0358f849aa -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.java (.../Survey.java) (revision da3ab23df4afd600475db0e6f4886a0358f849aa) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.java (.../Survey.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -65,14 +65,9 @@ private String reflectInstructions; private boolean defineLater; - private boolean runOffline; private boolean contentInUse; private boolean notifyTeachersOnAnswerSumbit; - // instructions - private String onlineInstructions; - private String offlineInstructions; - private Set attachments; // general infomation private Date created; @@ -86,28 +81,19 @@ // conditions private Set conditions = new TreeSet(new TextSearchConditionComparator()); - // *************** NON Persist Fields ******************** - private IToolContentHandler toolContentHandler; - - private List onlineFileList; - private List offlineFileList; - /** * Default contruction method. * */ public Survey() { - attachments = new HashSet(); questions = new HashSet(); } // ********************************************************** // Function method for Survey // ********************************************************** - public static Survey newInstance(Survey defaultContent, Long contentId, - SurveyToolContentHandler surveyToolContentHandler) { + public static Survey newInstance(Survey defaultContent, Long contentId) { Survey toContent = new Survey(); - defaultContent.toolContentHandler = surveyToolContentHandler; toContent = (Survey) defaultContent.clone(); toContent.setContentId(contentId); @@ -147,19 +133,6 @@ survey.setConditions(set); } - // clone attachment - if (attachments != null) { - Iterator iter = attachments.iterator(); - Set set = new HashSet(); - while (iter.hasNext()) { - SurveyAttachment file = (SurveyAttachment) iter.next(); - SurveyAttachment newFile = (SurveyAttachment) file.clone(); - // clone old file without duplicate it in repository - - set.add(newFile); - } - survey.attachments = set; - } // clone ReourceUser as well if (createdBy != null) { survey.setCreatedBy((SurveyUser) createdBy.clone()); @@ -183,15 +156,13 @@ final Survey genericEntity = (Survey) o; return new EqualsBuilder().append(uid, genericEntity.uid).append(title, genericEntity.title).append( - instructions, genericEntity.instructions).append(onlineInstructions, genericEntity.onlineInstructions) - .append(offlineInstructions, genericEntity.offlineInstructions).append(created, genericEntity.created) + 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(onlineInstructions).append( - offlineInstructions).append(created).append(updated).append(createdBy).toHashCode(); + return new HashCodeBuilder().append(uid).append(title).append(instructions).append(created).append(updated).append(createdBy).toHashCode(); } /** @@ -206,21 +177,6 @@ this.setUpdated(new Date(now)); } - public void toDTO() { - onlineFileList = new ArrayList(); - offlineFileList = new ArrayList(); - Set fileSet = this.getAttachments(); - if (fileSet != null) { - for (SurveyAttachment file : fileSet) { - if (StringUtils.equalsIgnoreCase(file.getFileType(), IToolContentHandler.TYPE_OFFLINE)) { - offlineFileList.add(file); - } else { - onlineFileList.add(file); - } - } - } - } - // ********************************************************** // get/set methods // ********************************************************** @@ -310,26 +266,6 @@ } /** - * @return Returns the runOffline. - * - * @hibernate.property column="run_offline" - * - */ - public boolean getRunOffline() { - return runOffline; - } - - /** - * @param runOffline - * The forceOffLine to set. - * - * - */ - public void setRunOffline(boolean forceOffline) { - runOffline = forceOffline; - } - - /** * @return Returns the lockWhenFinish. * * @hibernate.property column="lock_on_finished" @@ -361,53 +297,8 @@ } /** - * @return Returns the onlineInstructions set by the teacher. * - * @hibernate.property column="online_instructions" type="text" - */ - public String getOnlineInstructions() { - return onlineInstructions; - } - - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - - /** - * @return Returns the onlineInstructions set by the teacher. * - * @hibernate.property column="offline_instructions" type="text" - */ - public String getOfflineInstructions() { - return offlineInstructions; - } - - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - /** - * - * @hibernate.set lazy="true" cascade="all" inverse="false" order-by="create_date desc" - * @hibernate.collection-key column="survey_uid" - * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.survey.model.SurveyAttachment" - * - * @return a set of Attachments to this Message. - */ - public Set getAttachments() { - return attachments; - } - - /* - * @param attachments The attachments to set. - */ - public void setAttachments(Set attachments) { - this.attachments = attachments; - } - - /** - * - * * @hibernate.set lazy="true" inverse="false" cascade="all" order-by="sequence_id asc" * @hibernate.collection-key column="survey_uid" * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.survey.model.SurveyQuestion" @@ -458,26 +349,6 @@ this.contentId = contentId; } - public List getOfflineFileList() { - return offlineFileList; - } - - public void setOfflineFileList(List offlineFileList) { - this.offlineFileList = offlineFileList; - } - - public List getOnlineFileList() { - return onlineFileList; - } - - public void setOnlineFileList(List onlineFileList) { - this.onlineFileList = onlineFileList; - } - - public void setToolContentHandler(IToolContentHandler toolContentHandler) { - this.toolContentHandler = toolContentHandler; - } - /** * @hibernate.property column="reflect_instructions" * @return Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyAttachment.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyQuestion.java =================================================================== diff -u -r920894ca746cba5e080023c5cc80167d64d1653d -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyQuestion.java (.../SurveyQuestion.java) (revision 920894ca746cba5e080023c5cc80167d64d1653d) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/SurveyQuestion.java (.../SurveyQuestion.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -67,7 +67,7 @@ SurveyQuestion obj = null; try { obj = (SurveyQuestion) super.clone(); -// clone attachment +// clone options if(options != null){ Iterator iter = options.iterator(); Set set = new HashSet(); Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/ISurveyService.java =================================================================== diff -u -rf0450cb2776a8eba5e274ec3e72f83a333f5d229 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/ISurveyService.java (.../ISurveyService.java) (revision f0450cb2776a8eba5e274ec3e72f83a333f5d229) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/ISurveyService.java (.../ISurveyService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -36,7 +36,6 @@ import org.lamsfoundation.lams.tool.survey.dto.ReflectDTO; import org.lamsfoundation.lams.tool.survey.model.Survey; import org.lamsfoundation.lams.tool.survey.model.SurveyAnswer; -import org.lamsfoundation.lams.tool.survey.model.SurveyAttachment; import org.lamsfoundation.lams.tool.survey.model.SurveyCondition; import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion; import org.lamsfoundation.lams.tool.survey.model.SurveySession; @@ -89,24 +88,7 @@ // ****************************************************************************************** // *************** Instruction file methods ********************** // ****************************************************************************************** - /** - * Upload instruciton file into repository. - * - * @param file - * @param type - * @return - * @throws UploadSurveyFileException - */ - SurveyAttachment uploadInstructionFile(FormFile file, String type) throws UploadSurveyFileException; - /** - * Delete reource attachment(i.e., offline/online instruction file) from database. This method does not delete the - * file from repository. - * - * @param attachmentUid - */ - void deleteSurveyAttachment(Long attachmentUid); - // ****************************************************************************************** // *************** Questions and Answers methods ********************** // ****************************************************************************************** @@ -186,14 +168,6 @@ List getSessionUsers(Long sessionId); // ****************************************************************************************** - // ********** Repository methods *********************** - // ****************************************************************************************** - /** - * Delete file from repository. - */ - void deleteFromRepository(Long fileUuid, Long fileVersionId) throws SurveyApplicationException; - - // ****************************************************************************************** // ********** Session methods *********************** // ****************************************************************************************** Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyImportContentVersionFilter.java =================================================================== diff -u --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyImportContentVersionFilter.java (revision 0) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyImportContentVersionFilter.java (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -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 + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.survey.service; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.survey.model.Survey; + +/** + * Import filter class for different version of Survey content. + */ +public class SurveyImportContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20110406 version content to 20140102 version tool server. + */ + public void up20110406To20140102() { + this.removeField(Survey.class, "runOffline"); + this.removeField(Survey.class, "onlineInstructions"); + this.removeField(Survey.class, "offlineInstructions"); + this.removeField(Survey.class, "attachments"); + } +} Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java =================================================================== diff -u -r33da76d05725a84e191a5f6dca50b394cca3c1ee -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java (.../SurveyServiceImpl.java) (revision 33da76d05725a84e191a5f6dca50b394cca3c1ee) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java (.../SurveyServiceImpl.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -76,7 +76,6 @@ import org.lamsfoundation.lams.tool.service.ILamsToolService; import org.lamsfoundation.lams.tool.survey.SurveyConstants; import org.lamsfoundation.lams.tool.survey.dao.SurveyAnswerDAO; -import org.lamsfoundation.lams.tool.survey.dao.SurveyAttachmentDAO; import org.lamsfoundation.lams.tool.survey.dao.SurveyDAO; import org.lamsfoundation.lams.tool.survey.dao.SurveyQuestionDAO; import org.lamsfoundation.lams.tool.survey.dao.SurveySessionDAO; @@ -85,7 +84,6 @@ import org.lamsfoundation.lams.tool.survey.dto.ReflectDTO; import org.lamsfoundation.lams.tool.survey.model.Survey; import org.lamsfoundation.lams.tool.survey.model.SurveyAnswer; -import org.lamsfoundation.lams.tool.survey.model.SurveyAttachment; import org.lamsfoundation.lams.tool.survey.model.SurveyCondition; import org.lamsfoundation.lams.tool.survey.model.SurveyOption; import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion; @@ -123,8 +121,6 @@ private SurveyAnswerDAO surveyAnswerDao; - private SurveyAttachmentDAO surveyAttachmentDao; - private SurveyUserDAO surveyUserDao; private SurveySessionDAO surveySessionDao; @@ -135,14 +131,11 @@ private MessageService messageService; // system services - private IRepositoryService repositoryService; private ILamsToolService toolService; private ILearnerService learnerService; - private IAuditService auditService; - private IUserManagementService userManagementService; private IExportToolContentService exportContentService; @@ -182,31 +175,10 @@ } // save default content by given ID. Survey content = new Survey(); - content = Survey.newInstance(defaultContent, contentId, surveyToolContentHandler); + content = Survey.newInstance(defaultContent, contentId); return content; } - public SurveyAttachment uploadInstructionFile(FormFile uploadFile, String fileType) - throws UploadSurveyFileException { - if (uploadFile == null || StringUtils.isEmpty(uploadFile.getFileName())) { - throw new UploadSurveyFileException(messageService.getMessage("error.msg.upload.file.not.found", - new Object[] { uploadFile })); - } - - // upload file to repository - NodeKey nodeKey = processFile(uploadFile, fileType); - - // create new attachement - SurveyAttachment file = new SurveyAttachment(); - file.setFileType(fileType); - file.setFileUuid(nodeKey.getUuid()); - file.setFileVersionId(nodeKey.getVersion()); - file.setFileName(uploadFile.getFileName()); - file.setCreated(new Date()); - - return file; - } - public void createUser(SurveyUser surveyUser) { surveyUserDao.saveObject(surveyUser); } @@ -223,25 +195,10 @@ } - public void deleteFromRepository(Long fileUuid, Long fileVersionId) throws SurveyApplicationException { - ITicket ticket = getRepositoryLoginTicket(); - try { - repositoryService.deleteVersion(ticket, fileUuid, fileVersionId); - } catch (Exception e) { - throw new SurveyApplicationException("Exception occured while deleting files from" + " the repository " - + e.getMessage()); - } - } - public void saveOrUpdateSurvey(Survey survey) { surveyDao.saveObject(survey); } - public void deleteSurveyAttachment(Long attachmentUid) { - surveyAttachmentDao.removeObject(SurveyAttachment.class, attachmentUid); - - } - public Survey getSurveyBySessionId(Long sessionId) { SurveySession session = surveySessionDao.getSessionBySessionId(sessionId); // to skip CGLib problem @@ -608,61 +565,6 @@ return contentId; } - /** - * Process an uploaded file. - * - * @throws SurveyApplicationException - * @throws FileNotFoundException - * @throws IOException - * @throws RepositoryCheckedException - * @throws InvalidParameterException - */ - private NodeKey processFile(FormFile file, String fileType) throws UploadSurveyFileException { - NodeKey node = null; - if (file != null && !StringUtils.isEmpty(file.getFileName())) { - String fileName = file.getFileName(); - try { - node = surveyToolContentHandler.uploadFile(file.getInputStream(), fileName, file.getContentType(), - fileType); - } catch (InvalidParameterException e) { - throw new UploadSurveyFileException(messageService.getMessage("error.msg.invaid.param.upload")); - } catch (FileNotFoundException e) { - throw new UploadSurveyFileException(messageService.getMessage("error.msg.file.not.found")); - } catch (RepositoryCheckedException e) { - throw new UploadSurveyFileException(messageService.getMessage("error.msg.repository")); - } catch (IOException e) { - throw new UploadSurveyFileException(messageService.getMessage("error.msg.io.exception")); - } - } - return node; - } - - /** - * This method verifies the credentials of the Share Survey Tool and gives it the Ticket to login and - * access the Content Repository. - * - * A valid ticket is needed in order to access the content from the repository. This method would be called evertime - * the tool needs to upload/download files from the content repository. - * - * @return ITicket The ticket for repostory access - * @throws SurveyApplicationException - */ - private ITicket getRepositoryLoginTicket() throws SurveyApplicationException { - ICredentials credentials = new SimpleCredentials(surveyToolContentHandler.getRepositoryUser(), - surveyToolContentHandler.getRepositoryId()); - try { - ITicket ticket = repositoryService - .login(credentials, surveyToolContentHandler.getRepositoryWorkspaceName()); - return ticket; - } catch (AccessDeniedException ae) { - throw new SurveyApplicationException("Access Denied to repository." + ae.getMessage()); - } catch (WorkspaceNotFoundException we) { - throw new SurveyApplicationException("Workspace not found." + we.getMessage()); - } catch (LoginException e) { - throw new SurveyApplicationException("Login failed." + e.getMessage()); - } - } - // ******************************************************************************* // ToolContentManager, ToolSessionManager methods // ******************************************************************************* @@ -681,13 +583,8 @@ } // set SurveyToolContentHandler as null to avoid copy file node in repository again. - toolContentObj = Survey.newInstance(toolContentObj, toolContentId, null); - toolContentObj.setToolContentHandler(null); - toolContentObj.setOfflineFileList(null); - toolContentObj.setOnlineFileList(null); + toolContentObj = Survey.newInstance(toolContentObj, toolContentId); try { - exportContentService.registerFileClassForExport(SurveyAttachment.class.getName(), "fileUuid", - "fileVersionId"); exportContentService.exportToolContent(toolContentId, toolContentObj, surveyToolContentHandler, rootPath); } catch (ExportToolContentException e) { throw new ToolException(e); @@ -698,9 +595,9 @@ String toVersion) throws ToolException { try { - exportContentService.registerFileClassForImport(SurveyAttachment.class.getName(), "fileUuid", - "fileVersionId", "fileName", "fileType", null, null); - + // register version filter class + exportContentService.registerImportVersionFilterClass(SurveyImportContentVersionFilter.class); + Object toolPOJO = exportContentService.importToolContent(toolContentPath, surveyToolContentHandler, fromVersion, toVersion); if (!(toolPOJO instanceof Survey)) { @@ -773,7 +670,7 @@ } } - Survey toContent = Survey.newInstance(survey, toContentId, surveyToolContentHandler); + Survey toContent = Survey.newInstance(survey, toContentId); surveyDao.saveObject(toContent); // save survey items as well @@ -790,23 +687,7 @@ public String getToolContentTitle(Long toolContentId) { return getSurveyByContentId(toolContentId).getTitle(); } - - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Survey survey = surveyDao.getByContentId(toolContentId); - if (survey == null) { - throw new ToolException("No found tool content by given content ID:" + toolContentId); - } - survey.setDefineLater(value); - } - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Survey survey = surveyDao.getByContentId(toolContentId); - if (survey == null) { - throw new ToolException("No found tool content by given content ID:" + toolContentId); - } - survey.setRunOffline(value); - } - public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { Survey survey = surveyDao.getByContentId(toolContentId); @@ -920,9 +801,6 @@ toolContentObj.setDefineLater(Boolean.FALSE); toolContentObj.setInstructions(WebUtil.convertNewlines((String) importValues .get(ToolContentImport102Manager.CONTENT_BODY))); - toolContentObj.setOfflineInstructions(null); - toolContentObj.setOnlineInstructions(null); - toolContentObj.setRunOffline(Boolean.FALSE); toolContentObj.setUpdated(now); Boolean isReusable = WDDXProcessor.convertToBoolean(importValues, @@ -1037,9 +915,6 @@ // ***************************************************************************** // set methods for Spring Bean // ***************************************************************************** - public void setAuditService(IAuditService auditService) { - this.auditService = auditService; - } public void setLearnerService(ILearnerService learnerService) { this.learnerService = learnerService; @@ -1049,14 +924,6 @@ this.messageService = messageService; } - public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - - public void setSurveyAttachmentDao(SurveyAttachmentDAO surveyAttachmentDao) { - this.surveyAttachmentDao = surveyAttachmentDao; - } - public void setSurveyDao(SurveyDAO surveyDao) { this.surveyDao = surveyDao; } Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/surveyApplicationContext.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/surveyApplicationContext.xml (.../surveyApplicationContext.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/surveyApplicationContext.xml (.../surveyApplicationContext.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -32,12 +32,6 @@ - - - - - - @@ -66,9 +60,6 @@ - - - @@ -78,18 +69,12 @@ - - - - - - @@ -122,9 +107,6 @@ PROPAGATION_REQUIRED,-java.lang.Exception PROPAGATION_REQUIRED,-java.lang.Exception PROPAGATION_REQUIRED,-java.lang.Exception - - PROPAGATION_REQUIRED,-java.lang.Exception - PROPAGATION_REQUIRED,-java.lang.Exception PROPAGATION_REQUIRED,-java.lang.Exception PROPAGATION_REQUIRED,-java.lang.Exception PROPAGATION_REQUIRED,-java.lang.Exception Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java =================================================================== diff -u -rdfe9ef3dde4b722b5d87c4964a66f19fd48ea2b0 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision dfe9ef3dde4b722b5d87c4964a66f19fd48ea2b0) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -37,6 +37,7 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -60,7 +61,6 @@ import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.survey.SurveyConstants; import org.lamsfoundation.lams.tool.survey.model.Survey; -import org.lamsfoundation.lams.tool.survey.model.SurveyAttachment; import org.lamsfoundation.lams.tool.survey.model.SurveyCondition; import org.lamsfoundation.lams.tool.survey.model.SurveyOption; import org.lamsfoundation.lams.tool.survey.model.SurveyQuestion; @@ -136,18 +136,6 @@ if (param.equals("updateContent")) { return updateContent(mapping, form, request, response); } - if (param.equals("uploadOnlineFile")) { - return uploadOnline(mapping, form, request, response); - } - if (param.equals("uploadOfflineFile")) { - return uploadOffline(mapping, form, request, response); - } - if (param.equals("deleteOnlineFile")) { - return deleteOnlineFile(mapping, form, request, response); - } - if (param.equals("deleteOfflineFile")) { - return deleteOfflineFile(mapping, form, request, response); - } // ----------------------- Add survey item function --------------------------- if (param.equals("newItemInit")) { return newItemlInit(mapping, form, request, response); @@ -461,11 +449,6 @@ surveyForm.setSurvey(survey); - // initialize instruction attachment list - List attachmentList = getAttachmentList(sessionMap); - attachmentList.clear(); - attachmentList.addAll(survey.getAttachments()); - // init it to avoid null exception in following handling if (questions == null) { questions = new ArrayList(); @@ -598,51 +581,11 @@ } surveyPO.setCreatedBy(surveyUser); - - // **********************************Handle Authoring Instruction Attachement ********************* - // merge attachment info - // so far, attPOSet will be empty if content is existed. because PropertyUtils.copyProperties() is executed - Set attPOSet = surveyPO.getAttachments(); - if (attPOSet == null) { - attPOSet = new HashSet(); - } - List attachmentList = getAttachmentList(sessionMap); - List deleteAttachmentList = getDeletedAttachmentList(sessionMap); - - // current attachemnt in authoring instruction tab. - Iterator iter = attachmentList.iterator(); - while (iter.hasNext()) { - SurveyAttachment newAtt = (SurveyAttachment) iter.next(); - attPOSet.add(newAtt); - } - attachmentList.clear(); - - // deleted attachment. 2 possible types: one is persist another is non-persist before. - iter = deleteAttachmentList.iterator(); - while (iter.hasNext()) { - SurveyAttachment delAtt = (SurveyAttachment) iter.next(); - iter.remove(); - // it is an existed att, then delete it from current attachmentPO - if (delAtt.getUid() != null) { - Iterator attIter = attPOSet.iterator(); - while (attIter.hasNext()) { - SurveyAttachment att = (SurveyAttachment) attIter.next(); - if (delAtt.getUid().equals(att.getUid())) { - attIter.remove(); - break; - } - } - service.deleteSurveyAttachment(delAtt.getUid()); - }// end remove from persist value - } - - // copy back - surveyPO.setAttachments(attPOSet); // ************************* Handle survey questions ******************* Set questionList = new LinkedHashSet(); SortedSet topics = getSurveyItemList(sessionMap); - iter = topics.iterator(); + Iterator iter = topics.iterator(); while (iter.hasNext()) { SurveyQuestion item = (SurveyQuestion) iter.next(); if (item != null) { @@ -696,9 +639,6 @@ // finally persist surveyPO again service.saveOrUpdateSurvey(surveyPO); - // initialize attachmentList again - attachmentList = getAttachmentList(sessionMap); - attachmentList.addAll(survey.getAttachments()); surveyForm.setSurvey(surveyPO); request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); @@ -709,165 +649,6 @@ } } - /** - * Handle upload online instruction files request. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws UploadSurveyFileException - */ - public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws UploadSurveyFileException { - return uploadFile(mapping, form, IToolContentHandler.TYPE_ONLINE, request); - } - - /** - * Handle upload offline instruction files request. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws UploadSurveyFileException - */ - public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws UploadSurveyFileException { - return uploadFile(mapping, form, IToolContentHandler.TYPE_OFFLINE, request); - } - - /** - * Common method to upload online or offline instruction files request. - * - * @param mapping - * @param form - * @param type - * @param request - * @return - * @throws UploadSurveyFileException - */ - private ActionForward uploadFile(ActionMapping mapping, ActionForm form, String type, HttpServletRequest request) - throws UploadSurveyFileException { - - SurveyForm surveyForm = (SurveyForm) form; - // get back sessionMAP - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(surveyForm.getSessionMapID()); - - FormFile file; - if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { - file = surveyForm.getOfflineFile(); - } else { - file = surveyForm.getOnlineFile(); - } - - if (file == null || StringUtils.isBlank(file.getFileName())) { - return mapping.findForward(SurveyConstants.SUCCESS); - } - - ActionMessages errors = new ActionMessages(); - FileValidatorUtil.validateFileSize(file, true, errors); - if (!errors.isEmpty()) { - this.saveErrors(request, errors); - return mapping.findForward("success"); - } - - ISurveyService service = getSurveyService(); - // upload to repository - SurveyAttachment att = service.uploadInstructionFile(file, type); - // handle session value - List attachmentList = getAttachmentList(sessionMap); - List deleteAttachmentList = getDeletedAttachmentList(sessionMap); - // first check exist attachment and delete old one (if exist) to deletedAttachmentList - Iterator iter = attachmentList.iterator(); - SurveyAttachment existAtt; - while (iter.hasNext()) { - existAtt = (SurveyAttachment) iter.next(); - if (StringUtils.equals(existAtt.getFileName(), att.getFileName()) - && StringUtils.equals(existAtt.getFileType(), att.getFileType())) { - // if there is same name attachment, delete old one - deleteAttachmentList.add(existAtt); - iter.remove(); - break; - } - } - // add to attachmentList - attachmentList.add(att); - - return mapping.findForward(SurveyConstants.SUCCESS); - - } - - /** - * Delete offline instruction file from current Survey authoring page. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - public ActionForward deleteOfflineFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return deleteFile(mapping, request, response, form, IToolContentHandler.TYPE_OFFLINE); - } - - /** - * Delete online instruction file from current Survey authoring page. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - public ActionForward deleteOnlineFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return deleteFile(mapping, request, response, form, IToolContentHandler.TYPE_ONLINE); - } - - /** - * General method to delete file (online or offline) - * - * @param mapping - * @param request - * @param response - * @param form - * @param type - * @return - */ - private ActionForward deleteFile(ActionMapping mapping, HttpServletRequest request, HttpServletResponse response, - ActionForm form, String type) { - Long versionID = new Long(WebUtil.readLongParam(request, SurveyConstants.PARAM_FILE_VERSION_ID)); - Long uuID = new Long(WebUtil.readLongParam(request, SurveyConstants.PARAM_FILE_UUID)); - - // get back sessionMAP - String sessionMapID = WebUtil.readStrParam(request, SurveyConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); - - // handle session value - List attachmentList = getAttachmentList(sessionMap); - List deleteAttachmentList = getDeletedAttachmentList(sessionMap); - // first check exist attachment and delete old one (if exist) to deletedAttachmentList - Iterator iter = attachmentList.iterator(); - SurveyAttachment existAtt; - while (iter.hasNext()) { - existAtt = (SurveyAttachment) iter.next(); - if (existAtt.getFileUuid().equals(uuID) && existAtt.getFileVersionId().equals(versionID)) { - // if there is same name attachment, delete old one - deleteAttachmentList.add(existAtt); - iter.remove(); - } - } - - request.setAttribute(SurveyConstants.ATTR_FILE_TYPE_FLAG, type); - request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, sessionMapID); - return mapping.findForward(SurveyConstants.SUCCESS); - - } - // ************************************************************************************* // Private method // ************************************************************************************* @@ -881,22 +662,6 @@ } /** - * @param request - * @return - */ - private List getAttachmentList(SessionMap sessionMap) { - return getListFromSession(sessionMap, SurveyConstants.ATT_ATTACHMENT_LIST); - } - - /** - * @param request - * @return - */ - private List getDeletedAttachmentList(SessionMap sessionMap) { - return getListFromSession(sessionMap, SurveyConstants.ATTR_DELETED_ATTACHMENT_LIST); - } - - /** * List save current survey items. * * @param request Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java =================================================================== diff -u -r1edbb81f16cedfcc1326e4eca6e520b5b48cbddc -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java (.../LearningAction.java) (revision 1edbb81f16cedfcc1326e4eca6e520b5b48cbddc) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/LearningAction.java (.../LearningAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -144,7 +144,7 @@ // save toolContentID into HTTPSession ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, true); Long sessionId = new Long(request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID)); - // it will be use when runOffline or lock on finish page. + // it will be use when submissionDeadline or lock on finish page. request.setAttribute(SurveyConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID()); // get back the survey and question list and display them on page @@ -205,14 +205,6 @@ survey.setDefineLater(false); service.saveOrUpdateSurvey(survey); - // add run offline support - if (survey.getRunOffline()) { - sessionMap.put(SurveyConstants.PARAM_RUN_OFFLINE, true); - return mapping.findForward(SurveyConstants.RUN_OFFLINE); - } else { - sessionMap.put(SurveyConstants.PARAM_RUN_OFFLINE, false); - } - ActivityPositionDTO activityPosition = LearningWebUtil.putActivityPositionInRequestByToolSessionId(sessionId, request, getServlet().getServletContext()); sessionMap.put(AttributeNames.ATTR_ACTIVITY_POSITION, activityPosition); @@ -228,9 +220,9 @@ Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline); Date currentLearnerDate = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, new Date()); - // calculate whether submission deadline has passed, and if so forward to "runOffline" + // calculate whether submission deadline has passed, and if so forward to "submissionDeadline" if (currentLearnerDate.after(tzSubmissionDeadline)) { - return mapping.findForward(SurveyConstants.RUN_OFFLINE); + return mapping.findForward("submissionDeadline"); } } Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/MonitoringAction.java =================================================================== diff -u -rdb4fc43d6e110f7298d227fae4683af2e1e681f3 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision db4fc43d6e110f7298d227fae4683af2e1e681f3) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -148,7 +148,6 @@ // get survey Survey survey = service.getSurveyByContentId(contentId); - survey.toDTO(); // get statistic SortedMap statis = service.getStatistic(contentId); Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/SurveyForm.java =================================================================== diff -u -rf0c3f41d54ef4f390ef3f93f28c0679c46b6730c -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/SurveyForm.java (.../SurveyForm.java) (revision f0c3f41d54ef4f390ef3f93f28c0679c46b6730c) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/form/SurveyForm.java (.../SurveyForm.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -73,7 +73,6 @@ if(!StringUtils.equals(param,"start") && !StringUtils.equals(param,"initPage")){ survey.setLockWhenFinished(false); survey.setDefineLater(false); - survey.setRunOffline(false); survey.setReflectOnActivity(false); survey.setShowOnePage(false); Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java =================================================================== diff -u -rb33e717f9a734d318eefab07a17234f07c770c92 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision b33e717f9a734d318eefab07a17234f07c770c92) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -107,26 +107,6 @@ return FILENAME; } - protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { - if (toolContentID == null && toolSessionID == null) { - logger.error("Tool content Id or and session Id are null. Unable to activity title"); - } else { - - Survey content = null; - if ( toolContentID != null ) { - content = service.getSurveyByContentId(toolContentID); - } else { - SurveySession session=service.getSurveySessionBySessionId(toolSessionID); - if ( session != null ) - content = session.getSurvey(); - } - if ( content != null ) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); - } - public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies, HashMap sessionMap) throws SurveyApplicationException { Index: lams_tool_survey/web/includes/javascript/surveyitem.js =================================================================== diff -u -r2b350be06485bbfe1da8c66def9fc2cd81e883a8 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/web/includes/javascript/surveyitem.js (.../surveyitem.js) (revision 2b350be06485bbfe1da8c66def9fc2cd81e883a8) +++ lams_tool_survey/web/includes/javascript/surveyitem.js (.../surveyitem.js) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -2,7 +2,6 @@ This is Survey Item instrcution area. */ var instructionTargetDiv = "instructionArea"; - var itemAttachmentTargetDiv = "itemAttachmentArea"; // Please set these 2 variables in JSP file for using tag reason: // var removeInstructionUrl = ""; // var addInstructionUrl = ""; Index: lams_tool_survey/web/pages/authoring/authoring.jsp =================================================================== diff -u -rd4749f70eef0ca437b7d9040576e3f8152b6b4e9 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision d4749f70eef0ca437b7d9040576e3f8152b6b4e9) +++ lams_tool_survey/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -27,20 +27,8 @@ tag.value = tabId; // end optional tab controller stuff selectTab(tabId); - } - - function doUploadOnline() { - var myForm = $("authoringForm"); - myForm.action = ""; - myForm.submit(); } - function doUploadOffline() { - var myForm = $("authoringForm"); - myForm.action = ""; - myForm.submit(); - } - @@ -52,8 +40,7 @@ - - + @@ -76,22 +63,12 @@ - - - - - + - <%-- Default value - cancelButtonLabelKey="label.authoring.cancel.button" - saveButtonLabelKey="label.authoring.save.button" - cancelConfirmMsgKey="authoring.msg.cancel.save" - accessMode="author" - --%> + +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + +
+ +

+ ${sessionMap.title} +

+ +
+ + + +
+ + +
+

+ ${sessionMap.reflectInstructions} +

+ + + +

+ + +

+
+ +

+ +

+
+
+ + + + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + +
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_survey/web/pages/monitoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_survey/web/pages/monitoring/monitoring.jsp =================================================================== diff -u -ree0e5932cc01fa7dca855f20f19e8feaad60e418 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_survey/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision ee0e5932cc01fa7dca855f20f19e8feaad60e418) +++ lams_tool_survey/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -37,18 +37,16 @@
- - - + +
Index: lams_tool_task/conf/xdoclet/struts-actions.xml =================================================================== diff -u -rc142236c124ecebfa9f29ea91c71759c579e1c61 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision c142236c124ecebfa9f29ea91c71759c579e1c61) +++ lams_tool_task/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -38,41 +38,6 @@ - - - - - - - - - - - - - - - - + TaskListItemVisitDAO. Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dbupdates/patch20140102.sql =================================================================== diff -u --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dbupdates/patch20140102.sql (revision 0) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dbupdates/patch20140102.sql (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -0,0 +1,19 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3147 Simplify tools: get rid of instructions tab, define in monitor and offline activity options +ALTER TABLE tl_latask10_taskList DROP COLUMN online_instructions; +ALTER TABLE tl_latask10_taskList DROP COLUMN offline_instructions; +ALTER TABLE tl_latask10_taskList DROP COLUMN run_offline; +DROP TABLE IF EXISTS tl_latask10_attachment; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='latask10'; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/GroupSummary.java =================================================================== diff -u -r3f118a66718ff89ec94041602e7e60db6ee06722 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/GroupSummary.java (.../GroupSummary.java) (revision 3f118a66718ff89ec94041602e7e60db6ee06722) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/GroupSummary.java (.../GroupSummary.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -26,8 +26,6 @@ import java.util.ArrayList; import java.util.List; -import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; - /** * DTO object used in a monitoring. Contains information for group. * Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/TasListItemDTO.java =================================================================== diff -u -r5d4c7c430b9dd0fc2247d9e5fa5babbac5fb4571 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/TasListItemDTO.java (.../TasListItemDTO.java) (revision 5d4c7c430b9dd0fc2247d9e5fa5babbac5fb4571) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/dto/TasListItemDTO.java (.../TasListItemDTO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -23,16 +23,12 @@ /* $Id$ */ package org.lamsfoundation.lams.tool.taskList.dto; -import java.util.ArrayList; -import java.util.Date; import java.util.HashSet; -import java.util.List; import java.util.Set; 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; /** * DTO object which contains data for displaying learning stuff. Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskList.java =================================================================== diff -u -rc142236c124ecebfa9f29ea91c71759c579e1c61 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskList.java (.../TaskList.java) (revision c142236c124ecebfa9f29ea91c71759c579e1c61) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskList.java (.../TaskList.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -23,21 +23,15 @@ /* $Id$ */ package org.lamsfoundation.lams.tool.taskList.model; -import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; -import java.util.List; -import java.util.Map; import java.util.Set; -import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.log4j.Logger; -import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; -import org.lamsfoundation.lams.tool.taskList.util.TaskListToolContentHandler; /** * The main entity class of TaskList tool. Contains all the data related to the whole tool. @@ -65,17 +59,10 @@ private boolean allowContributeTasks; private boolean monitorVerificationRequired; - private boolean runOffline; private boolean defineLater; private boolean contentInUse; - - // LDEV-2657 private Date submissionDeadline; - //instructions - private String onlineInstructions; - private String offlineInstructions; - private Set attachments; //conditions private Set conditions; @@ -91,17 +78,12 @@ private String reflectInstructions; //*************** NON Persist Fields ******************** - private IToolContentHandler toolContentHandler; - - private List onlineFileList; - private List offlineFileList; private String minimumNumberTasksErrorStr; /** * Default contructor. */ public TaskList(){ - attachments = new HashSet(); conditions = new HashSet(); taskListItems = new HashSet(); } @@ -110,9 +92,8 @@ // Function method for TaskList // ********************************************************** - public static TaskList newInstance(TaskList defaultContent, Long contentId, TaskListToolContentHandler taskListToolContentHandler) { + public static TaskList newInstance(TaskList defaultContent, Long contentId) { TaskList toContent = new TaskList(); - defaultContent.toolContentHandler = taskListToolContentHandler; toContent = (TaskList) defaultContent.clone(); toContent.setContentId(contentId); @@ -147,20 +128,6 @@ taskList.taskListItems = set; } - //clone attachment - if(attachments != null){ - Iterator iter = attachments.iterator(); - Set set = new HashSet(); - while(iter.hasNext()){ - TaskListAttachment file = (TaskListAttachment)iter.next(); - TaskListAttachment newFile = (TaskListAttachment) file.clone(); - //just clone old file without duplicate it in repository - - set.add(newFile); - } - taskList.attachments = set; - } - //clone conditions if(conditions != null){ @@ -219,8 +186,6 @@ .append(this.uid,genericEntity.uid) .append(this.title,genericEntity.title) .append(this.instructions,genericEntity.instructions) - .append(this.onlineInstructions,genericEntity.onlineInstructions) - .append(this.offlineInstructions,genericEntity.offlineInstructions) .append(this.created,genericEntity.created) .append(this.updated,genericEntity.updated) .append(this.createdBy,genericEntity.createdBy) @@ -229,8 +194,7 @@ public int hashCode() { return new HashCodeBuilder().append(uid).append(title) - .append(instructions).append(onlineInstructions) - .append(offlineInstructions).append(created) + .append(instructions).append(created) .append(updated).append(createdBy) .toHashCode(); } @@ -246,23 +210,6 @@ } this.setUpdated(new Date(now)); } - - /** - * Method to support exporting. - */ - public void toDTO(){ - onlineFileList = new ArrayList(); - offlineFileList = new ArrayList(); - Set fileSet = this.getAttachments(); - if(fileSet != null){ - for(TaskListAttachment file:fileSet){ - if(StringUtils.equalsIgnoreCase(file.getFileType(),IToolContentHandler.TYPE_OFFLINE)) - offlineFileList.add(file); - else - onlineFileList.add(file); - } - } - } //********************************************************** // Get/set methods @@ -366,26 +313,6 @@ this.title = title; } - /** - * Returns either the tasklist should run offline. - * - * @return runOffline flag - * - * @hibernate.property - * column="run_offline" - */ - public boolean getRunOffline() { - return runOffline; - } - /** - * Sets if the tasklist should run offline. - * - * @param runOffline The forceOffLine to set. - */ - public void setRunOffline(boolean forceOffline) { - this.runOffline = forceOffline; - } - /** * Returns tasklist instructions set by teacher. * @@ -406,73 +333,6 @@ public void setInstructions(String instructions) { this.instructions = instructions; } - - /** - * Returns tasklist onlineInstructions set by teacher. - * - * @return tasklist onlineInstructions set by teacher - * - * @hibernate.property - * column="online_instructions" - * type="text" - */ - public String getOnlineInstructions() { - return onlineInstructions; - } - /** - * Sets tasklist instructions. Usually done by teacher. - * - * @param onlineInstructions tasklist onlineInstructions - */ - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - - /** - * Returns tasklist offlineInstructions set by teacher. - * - * @return tasklist offlineInstructions set by teacher - * - * @hibernate.property - * column="offline_instructions" - * type="text" - */ - public String getOfflineInstructions() { - return offlineInstructions; - } - /** - * Sets tasklist offlineInstructions. Usually done by teacher. - * - * @param instructions tasklist offlineInstructions - */ - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - /** - * Returns a set of Attachments belong to this tasklist. - * - * @return a set of Attachments belong to this tasklist. - * - * @hibernate.set lazy="true" - * cascade="all" - * inverse="false" - * order-by="create_date desc" - * @hibernate.collection-key column="taskList_uid" - * @hibernate.collection-one-to-many - * class="org.lamsfoundation.lams.tool.taskList.model.TaskListAttachment" - */ - public Set getAttachments() { - return attachments; - } - /** - * Sets a set of Attachments belong to this tasklist - * - * @param attachments The attachments to set - */ - public void setAttachments(Set attachments) { - this.attachments = attachments; - } /** * Returns a set of conditions belong to this tasklist. @@ -708,29 +568,7 @@ public void setSubmissionDeadline(Date submissionDeadline) { this.submissionDeadline = submissionDeadline; } - - /** - * For display use - * @return - */ - public List getOfflineFileList() { - return offlineFileList; - } - public void setOfflineFileList(List offlineFileList) { - this.offlineFileList = offlineFileList; - } - public List getOnlineFileList() { - return onlineFileList; - } - public void setOnlineFileList(List onlineFileList) { - this.onlineFileList = onlineFileList; - } - - public void setToolContentHandler(IToolContentHandler toolContentHandler) { - this.toolContentHandler = toolContentHandler; - } - /** * Returns the number of tasks needed to be completed to finish this activity. * Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListAttachment.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListCondition.java =================================================================== diff -u -r721fa349b42e0b7e2ae19d60756fea47146bfdd4 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListCondition.java (.../TaskListCondition.java) (revision 721fa349b42e0b7e2ae19d60756fea47146bfdd4) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/model/TaskListCondition.java (.../TaskListCondition.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -23,19 +23,10 @@ /* $Id$ */ package org.lamsfoundation.lams.tool.taskList.model; -import java.util.ArrayList; -import java.util.Date; import java.util.HashSet; -import java.util.Iterator; -import java.util.List; import java.util.Set; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.builder.EqualsBuilder; -import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.log4j.Logger; -import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; -import org.lamsfoundation.lams.tool.taskList.util.TaskListToolContentHandler; /** * The main entity class of TaskList tool. Contains all the data related to the whole tool. Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/ITaskListService.java =================================================================== diff -u -r0d23815a0217cc440544b56c2a964cef24d7de50 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/ITaskListService.java (.../ITaskListService.java) (revision 0d23815a0217cc440544b56c2a964cef24d7de50) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/ITaskListService.java (.../ITaskListService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -24,24 +24,13 @@ package org.lamsfoundation.lams.tool.taskList.service; import java.util.List; -import java.util.Map; import java.util.Set; -import java.util.SortedMap; -import java.util.SortedSet; -import java.util.TreeMap; import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.notebook.model.NotebookEntry; -import org.lamsfoundation.lams.tool.ToolOutputDefinition; -import org.lamsfoundation.lams.tool.exception.ToolException; -import org.lamsfoundation.lams.tool.taskList.dto.GroupSummary; import org.lamsfoundation.lams.tool.taskList.dto.ItemSummary; -import org.lamsfoundation.lams.tool.taskList.dto.ReflectDTO; -import org.lamsfoundation.lams.tool.taskList.dto.TaskListItemVisitLogSummary; import org.lamsfoundation.lams.tool.taskList.dto.Summary; import org.lamsfoundation.lams.tool.taskList.model.TaskList; -import org.lamsfoundation.lams.tool.taskList.model.TaskListAttachment; -import org.lamsfoundation.lams.tool.taskList.model.TaskListCondition; import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; import org.lamsfoundation.lams.tool.taskList.model.TaskListItemAttachment; import org.lamsfoundation.lams.tool.taskList.model.TaskListSession; @@ -105,27 +94,16 @@ */ List getAuthoredItems(Long taskListUid); - /** - * Upload instruciton file into repository. - * - * @param file - * @param type - * @return - * @throws UploadTaskListFileException - */ - TaskListAttachment uploadInstructionFile(FormFile file, String type) throws UploadTaskListFileException; - /** * Upload tasklistItem file to repository. * * @param uploadFile - * @param fileType * @param userLogin * @return * @throws UploadTaskListFileException */ - TaskListItemAttachment uploadTaskListItemFile(FormFile uploadFile, String fileType, TaskListUser user) throws UploadTaskListFileException; + TaskListItemAttachment uploadTaskListItemFile(FormFile uploadFile, TaskListUser user) throws UploadTaskListFileException; /** * Returns Message service. It makes available to have access to message resources files. @@ -183,14 +161,6 @@ TaskListUser getUser(Long uid); //********** Repository methods *********************** - /** - * Delete file from the repository. - * - * @param fileUuid - * @param fileVersionId - * @throws TaskListException - */ - void deleteFromRepository(Long fileUuid, Long fileVersionId) throws TaskListException ; /** * Save or update taskList into database. @@ -200,14 +170,6 @@ void saveOrUpdateTaskList(TaskList TaskList); /** - * Delete reource attachment(i.e., offline/online instruction file) from database. This method does not - * delete the file from repository. - * - * @param attachmentUid - */ - void deleteTaskListAttachment(Long attachmentUid); - - /** * Delete resoruce item from database. * * @param uid Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListImportContentVersionFilter.java =================================================================== diff -u --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListImportContentVersionFilter.java (revision 0) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListImportContentVersionFilter.java (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -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 + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.taskList.service; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.taskList.model.TaskList; + +/** + * Import filter class for different version of TaskList content. + */ +public class TaskListImportContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20110510 version content to 20140102 version tool server. + */ + public void up20110510To20140102() { + this.removeField(TaskList.class, "runOffline"); + this.removeField(TaskList.class, "onlineInstructions"); + this.removeField(TaskList.class, "offlineInstructions"); + this.removeField(TaskList.class, "attachments"); + } +} \ No newline at end of file Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java =================================================================== diff -u -r33da76d05725a84e191a5f6dca50b394cca3c1ee -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java (.../TaskListServiceImpl.java) (revision 33da76d05725a84e191a5f6dca50b394cca3c1ee) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java (.../TaskListServiceImpl.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -23,13 +23,10 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.taskList.service; -import java.io.File; -import java.io.FileFilter; import java.io.FileNotFoundException; import java.io.IOException; import java.sql.Timestamp; import java.util.ArrayList; -import java.util.Comparator; import java.util.Date; import java.util.Hashtable; import java.util.Iterator; @@ -40,17 +37,9 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.struts.upload.FormFile; -import org.lamsfoundation.lams.contentrepository.AccessDeniedException; -import org.lamsfoundation.lams.contentrepository.ICredentials; -import org.lamsfoundation.lams.contentrepository.ITicket; -import org.lamsfoundation.lams.contentrepository.IVersionedNode; import org.lamsfoundation.lams.contentrepository.InvalidParameterException; -import org.lamsfoundation.lams.contentrepository.LoginException; import org.lamsfoundation.lams.contentrepository.NodeKey; import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; -import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; -import org.lamsfoundation.lams.contentrepository.service.IRepositoryService; -import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; import org.lamsfoundation.lams.learning.service.ILearnerService; import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; @@ -69,7 +58,6 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.service.ILamsToolService; import org.lamsfoundation.lams.tool.taskList.TaskListConstants; -import org.lamsfoundation.lams.tool.taskList.dao.TaskListAttachmentDAO; import org.lamsfoundation.lams.tool.taskList.dao.TaskListConditionDAO; import org.lamsfoundation.lams.tool.taskList.dao.TaskListDAO; import org.lamsfoundation.lams.tool.taskList.dao.TaskListItemAttachmentDAO; @@ -84,7 +72,6 @@ import org.lamsfoundation.lams.tool.taskList.dto.Summary; import org.lamsfoundation.lams.tool.taskList.dto.TaskListItemVisitLogSummary; import org.lamsfoundation.lams.tool.taskList.model.TaskList; -import org.lamsfoundation.lams.tool.taskList.model.TaskListAttachment; import org.lamsfoundation.lams.tool.taskList.model.TaskListCondition; import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; import org.lamsfoundation.lams.tool.taskList.model.TaskListItemAttachment; @@ -97,7 +84,6 @@ import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; import org.lamsfoundation.lams.util.MessageService; -import org.lamsfoundation.lams.util.audit.IAuditService; /** * Class implements org.lamsfoundation.lams.tool.taskList.service.ITaskListService. @@ -111,7 +97,6 @@ static Logger log = Logger.getLogger(TaskListServiceImpl.class.getName()); private TaskListDAO taskListDao; private TaskListItemDAO taskListItemDao; - private TaskListAttachmentDAO taskListAttachmentDao; private TaskListConditionDAO taskListConditionDAO; private TaskListUserDAO taskListUserDao; private TaskListSessionDAO taskListSessionDao; @@ -123,10 +108,8 @@ private MessageService messageService; private TaskListOutputFactory taskListOutputFactory; // system services - private IRepositoryService repositoryService; private ILamsToolService toolService; private ILearnerService learnerService; - private IAuditService auditService; private IUserManagementService userManagementService; private IExportToolContentService exportContentService; private ICoreNotebookService coreNotebookService; @@ -159,7 +142,7 @@ TaskList defaultContent = getDefaultTaskList(); // save default content by given ID. TaskList content = new TaskList(); - content = TaskList.newInstance(defaultContent, contentId, taskListToolContentHandler); + content = TaskList.newInstance(defaultContent, contentId); return content; } @@ -173,43 +156,18 @@ /** * {@inheritDoc} */ - public TaskListAttachment uploadInstructionFile(FormFile uploadFile, String fileType) + public TaskListItemAttachment uploadTaskListItemFile(FormFile uploadFile, TaskListUser user) throws UploadTaskListFileException { if (uploadFile == null || StringUtils.isEmpty(uploadFile.getFileName())) { throw new UploadTaskListFileException(messageService.getMessage("error.msg.upload.file.not.found", new Object[] { uploadFile })); } // upload file to repository - NodeKey nodeKey = processFile(uploadFile, fileType); + NodeKey nodeKey = processFile(uploadFile); // create new attachement - TaskListAttachment file = new TaskListAttachment(); - file.setFileType(fileType); - file.setFileUuid(nodeKey.getUuid()); - file.setFileVersionId(nodeKey.getVersion()); - file.setFileName(uploadFile.getFileName()); - file.setCreated(new Date()); - - return file; - } - - /** - * {@inheritDoc} - */ - public TaskListItemAttachment uploadTaskListItemFile(FormFile uploadFile, String fileType, TaskListUser user) - throws UploadTaskListFileException { - if (uploadFile == null || StringUtils.isEmpty(uploadFile.getFileName())) { - throw new UploadTaskListFileException(messageService.getMessage("error.msg.upload.file.not.found", - new Object[] { uploadFile })); - } - - // upload file to repository - NodeKey nodeKey = processFile(uploadFile, fileType); - - // create new attachement TaskListItemAttachment file = new TaskListItemAttachment(); - file.setFileType(fileType); file.setFileUuid(nodeKey.getUuid()); file.setFileVersionId(nodeKey.getVersion()); file.setFileName(uploadFile.getFileName()); @@ -250,33 +208,13 @@ /** * {@inheritDoc} */ - public void deleteFromRepository(Long fileUuid, Long fileVersionId) throws TaskListException { - ITicket ticket = getRepositoryLoginTicket(); - try { - repositoryService.deleteVersion(ticket, fileUuid, fileVersionId); - } catch (Exception e) { - throw new TaskListException("Exception occured while deleting files from" + " the repository " - + e.getMessage()); - } - } - - /** - * {@inheritDoc} - */ public void saveOrUpdateTaskList(TaskList taskList) { taskListDao.saveObject(taskList); } /** * {@inheritDoc} */ - public void deleteTaskListAttachment(Long attachmentUid) { - taskListAttachmentDao.removeObject(TaskListAttachment.class, attachmentUid); - } - - /** - * {@inheritDoc} - */ public void deleteTaskListCondition(Long conditionUid) { taskListConditionDAO.removeObject(TaskListCondition.class, conditionUid); } @@ -710,10 +648,6 @@ // Set methods for Spring Bean // ***************************************************************************** - public void setAuditService(IAuditService auditService) { - this.auditService = auditService; - } - public void setLearnerService(ILearnerService learnerService) { this.learnerService = learnerService; } @@ -730,14 +664,10 @@ this.taskListOutputFactory = taskListOutputFactory; } - public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; + public void setTaskListAttachmentDao(TaskListItemAttachmentDAO taskListItemAttachmentDao) { + this.taskListItemAttachmentDao = taskListItemAttachmentDao; } - public void setTaskListAttachmentDao(TaskListAttachmentDAO taskListAttachmentDao) { - this.taskListAttachmentDao = taskListAttachmentDao; - } - public void setTaskListConditionDao(TaskListConditionDAO taskListConditionDAO) { this.taskListConditionDAO = taskListConditionDAO; } @@ -822,19 +752,14 @@ } // set TaskListToolContentHandler as null to avoid copy file node in repository again. - toolContentObj = TaskList.newInstance(toolContentObj, toolContentId, null); - toolContentObj.setToolContentHandler(null); - toolContentObj.setOfflineFileList(null); - toolContentObj.setOnlineFileList(null); + toolContentObj = TaskList.newInstance(toolContentObj, toolContentId); Set taskListItems = toolContentObj.getTaskListItems(); for (TaskListItem taskListItem : taskListItems) { taskListItem.setComments(null); taskListItem.setAttachments(null); } try { - exportContentService.registerFileClassForExport(TaskListAttachment.class.getName(), "fileUuid", - "fileVersionId"); exportContentService.exportToolContent(toolContentId, toolContentObj, taskListToolContentHandler, rootPath); } catch (ExportToolContentException e) { throw new ToolException(e); @@ -848,9 +773,9 @@ String toVersion) throws ToolException { try { - exportContentService.registerFileClassForImport(TaskListAttachment.class.getName(), "fileUuid", - "fileVersionId", "fileName", "fileType", null, null); - + // register version filter class + exportContentService.registerImportVersionFilterClass(TaskListImportContentVersionFilter.class); + Object toolPOJO = exportContentService.importToolContent(toolContentPath, taskListToolContentHandler, fromVersion, toVersion); if (!(toolPOJO instanceof TaskList)) { @@ -927,7 +852,7 @@ } } - TaskList toContent = TaskList.newInstance(taskList, toContentId, taskListToolContentHandler); + TaskList toContent = TaskList.newInstance(taskList, toContentId); taskListDao.saveObject(toContent); // save taskList items as well @@ -944,28 +869,6 @@ /** * {@inheritDoc} */ - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { - TaskList taskList = taskListDao.getByContentId(toolContentId); - if (taskList == null) { - throw new ToolException("No found tool content by given content ID:" + toolContentId); - } - taskList.setDefineLater(value); - } - - /** - * {@inheritDoc} - */ - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { - TaskList taskList = taskListDao.getByContentId(toolContentId); - if (taskList == null) { - throw new ToolException("No found tool content by given content ID:" + toolContentId); - } - taskList.setRunOffline(value); - } - - /** - * {@inheritDoc} - */ public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { TaskList taskList = taskListDao.getByContentId(toolContentId); @@ -1166,13 +1069,12 @@ * @throws RepositoryCheckedException * @throws InvalidParameterException */ - private NodeKey processFile(FormFile file, String fileType) throws UploadTaskListFileException { + private NodeKey processFile(FormFile file) throws UploadTaskListFileException { NodeKey node = null; if (file != null && !StringUtils.isEmpty(file.getFileName())) { String fileName = file.getFileName(); try { - node = taskListToolContentHandler.uploadFile(file.getInputStream(), fileName, file.getContentType(), - fileType); + node = taskListToolContentHandler.uploadFile(file.getInputStream(), fileName, file.getContentType()); } catch (InvalidParameterException e) { throw new UploadTaskListFileException(messageService.getMessage("error.msg.invaid.param.upload")); } catch (FileNotFoundException e) { @@ -1186,128 +1088,10 @@ return node; } - private NodeKey processPackage(String packageDirectory, String initFile) throws UploadTaskListFileException { - NodeKey node = null; - try { - node = taskListToolContentHandler.uploadPackage(packageDirectory, initFile); - } catch (InvalidParameterException e) { - throw new UploadTaskListFileException(messageService.getMessage("error.msg.invaid.param.upload")); - } catch (RepositoryCheckedException e) { - throw new UploadTaskListFileException(messageService.getMessage("error.msg.repository")); - } - return node; - } - - /** - * Find out default.htm/html or index.htm/html in the given directory folder - * - * @param packageDirectory - * @return - */ - private String findWebsiteInitialItem(String packageDirectory) { - File file = new File(packageDirectory); - if (!file.isDirectory()) { - return null; - } - - File[] initFiles = file.listFiles(new FileFilter() { - public boolean accept(File pathname) { - if (pathname == null || pathname.getName() == null) { - return false; - } - String name = pathname.getName(); - if (name.endsWith("default.html") || name.endsWith("default.htm") || name.endsWith("index.html") - || name.endsWith("index.htm")) { - return true; - } - return false; - } - }); - if (initFiles != null && initFiles.length > 0) { - return initFiles[0].getName(); - } else { - return null; - } - } - - private class ReflectDTOComparator implements Comparator { - public int compare(ReflectDTO o1, ReflectDTO o2) { - - if (o1 != null && o2 != null) { - return o1.getFullName().compareTo(o2.getFullName()); - } else if (o1 != null) { - return 1; - } else { - return -1; - } - } - } - // ******************************************************************************* // Service method // ******************************************************************************* - /** - * Try to get the file. If forceLogin = false and an access denied exception occurs, call this method again to get a - * new ticket and retry file lookup. If forceLogin = true and it then fails then throw exception. - * - * @param uuid - * @param versionId - * @param relativePath - * @param attemptCount - * @return file node - * @throws ImscpApplicationException - */ - private IVersionedNode getFile(Long uuid, Long versionId, String relativePath) throws TaskListException { - 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."; - TaskListServiceImpl.log.error(error); - throw new TaskListException(error, e); - - } catch (Exception e) { - - String error = "Unable to access repository to get file uuid " + uuid + " version id " + versionId - + " path " + relativePath + "." + " Exception: " + e.getMessage(); - TaskListServiceImpl.log.error(error); - throw new TaskListException(error, e); - - } - } - - /** - * This method verifies the credentials of the TaskList 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 TaskListException - */ - private ITicket getRepositoryLoginTicket() throws TaskListException { - ICredentials credentials = new SimpleCredentials(taskListToolContentHandler.getRepositoryUser(), - taskListToolContentHandler.getRepositoryId()); - try { - ITicket ticket = repositoryService.login(credentials, taskListToolContentHandler - .getRepositoryWorkspaceName()); - return ticket; - } catch (AccessDeniedException ae) { - throw new TaskListException("Access Denied to repository." + ae.getMessage()); - } catch (WorkspaceNotFoundException we) { - throw new TaskListException("Workspace not found." + we.getMessage()); - } catch (LoginException e) { - throw new TaskListException("Login failed." + e.getMessage()); - } - } - public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { return getTaskListOutputFactory().getSupportedDefinitionClasses(definitionType); } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/taskListApplicationContext.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/taskListApplicationContext.xml (.../taskListApplicationContext.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/taskListApplicationContext.xml (.../taskListApplicationContext.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -32,12 +32,6 @@
- - - - - - @@ -73,9 +67,6 @@ - - - @@ -88,18 +79,12 @@ - - - - - - @@ -125,9 +110,7 @@ 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_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/AuthoringAction.java =================================================================== diff -u -rdfe9ef3dde4b722b5d87c4964a66f19fd48ea2b0 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision dfe9ef3dde4b722b5d87c4964a66f19fd48ea2b0) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -27,7 +27,6 @@ import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.LinkedList; @@ -52,26 +51,21 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionMessage; import org.apache.struts.action.ActionMessages; -import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.authoring.web.AuthoringConstants; -import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.taskList.TaskListConstants; import org.lamsfoundation.lams.tool.taskList.model.TaskList; -import org.lamsfoundation.lams.tool.taskList.model.TaskListAttachment; import org.lamsfoundation.lams.tool.taskList.model.TaskListCondition; import org.lamsfoundation.lams.tool.taskList.model.TaskListItem; import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; import org.lamsfoundation.lams.tool.taskList.service.ITaskListService; import org.lamsfoundation.lams.tool.taskList.service.TaskListException; -import org.lamsfoundation.lams.tool.taskList.service.UploadTaskListFileException; import org.lamsfoundation.lams.tool.taskList.util.TaskListConditionComparator; import org.lamsfoundation.lams.tool.taskList.util.TaskListItemComparator; import org.lamsfoundation.lams.tool.taskList.web.form.TaskListForm; import org.lamsfoundation.lams.tool.taskList.web.form.TaskListItemForm; import org.lamsfoundation.lams.tool.taskList.web.form.TaskListPedagogicalPlannerForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; -import org.lamsfoundation.lams.util.FileValidatorUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -126,18 +120,6 @@ if (param.equals("updateContent")) { return updateContent(mapping, form, request, response); } - if (param.equals("uploadOnlineFile")) { - return uploadOnline(mapping, form, request, response); - } - if (param.equals("uploadOfflineFile")) { - return uploadOffline(mapping, form, request, response); - } - if (param.equals("deleteOnlineFile")) { - return deleteOnlineFile(mapping, form, request, response); - } - if (param.equals("deleteOfflineFile")) { - return deleteOfflineFile(mapping, form, request, response); - } // ----------------------- Add taskListItem methods --------------------------- if (param.equals("newItemInit")) { @@ -220,11 +202,6 @@ } taskListForm.setTaskList(taskList); - - // initialize instruction attachment list - List attachmentList = getAttachmentList(sessionMap); - attachmentList.clear(); - attachmentList.addAll(taskList.getAttachments()); } catch (Exception e) { AuthoringAction.log.error(e); throw new ServletException(e); @@ -361,45 +338,6 @@ } taskListPO.setCreatedBy(taskListUser); - - // **********************************Handle Authoring Instruction Attachement ********************* - // merge attachment info - // so far, attPOSet will be empty if content is existed. because PropertyUtils.copyProperties() is executed - Set attPOSet = taskListPO.getAttachments(); - if (attPOSet == null) { - attPOSet = new HashSet(); - } - List attachmentList = getAttachmentList(sessionMap); - List deleteAttachmentList = getDeletedAttachmentList(sessionMap); - - // current attachemnt in authoring instruction tab. - Iterator iter = attachmentList.iterator(); - while (iter.hasNext()) { - TaskListAttachment newAtt = (TaskListAttachment) iter.next(); - attPOSet.add(newAtt); - } - attachmentList.clear(); - - // deleted attachment. 2 possible types: one is persist another is non-persist before. - iter = deleteAttachmentList.iterator(); - while (iter.hasNext()) { - TaskListAttachment delAtt = (TaskListAttachment) iter.next(); - iter.remove(); - // it is an existed att, then delete it from current attachmentPO - if (delAtt.getUid() != null) { - Iterator attIter = attPOSet.iterator(); - while (attIter.hasNext()) { - TaskListAttachment att = (TaskListAttachment) attIter.next(); - if (delAtt.getUid().equals(att.getUid())) { - attIter.remove(); - break; - } - } - service.deleteTaskListAttachment(delAtt.getUid()); - }// end remove from persist value - } - // copy back - taskListPO.setAttachments(attPOSet); // ************************* Handle taskList items ******************* Set itemList = new LinkedHashSet(); @@ -436,7 +374,7 @@ taskListPO.setConditions(conditions); // delete TaskListConditions from database. - iter = delConditions.iterator(); + Iterator iter = delConditions.iterator(); while (iter.hasNext()) { TaskListCondition condition = (TaskListCondition) iter.next(); iter.remove(); @@ -470,9 +408,6 @@ service.getTaskListByContentId(taskListPO.getContentId()); - // initialize attachmentList again - attachmentList = getAttachmentList(sessionMap); - attachmentList.addAll(taskList.getAttachments()); taskListForm.setTaskList(taskListPO); request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); @@ -483,166 +418,6 @@ } } - /** - * Handle upload online instruction files request. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws UploadTaskListFileException - */ - private ActionForward uploadOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws UploadTaskListFileException { - return uploadFile(mapping, form, IToolContentHandler.TYPE_ONLINE, request); - } - - /** - * Handle upload offline instruction files request. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws UploadTaskListFileException - */ - private ActionForward uploadOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws UploadTaskListFileException { - return uploadFile(mapping, form, IToolContentHandler.TYPE_OFFLINE, request); - } - - /** - * Common method to upload online or offline instruction files request. - * - * @param mapping - * @param form - * @param type - * @param request - * @return - * @throws UploadTaskListFileException - */ - private ActionForward uploadFile(ActionMapping mapping, ActionForm form, String type, HttpServletRequest request) - throws UploadTaskListFileException { - - TaskListForm taskListForm = (TaskListForm) form; - // get back sessionMAP - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(taskListForm.getSessionMapID()); - - FormFile file; - if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { - file = taskListForm.getOfflineFile(); - } else { - file = taskListForm.getOnlineFile(); - } - - if (file == null || StringUtils.isBlank(file.getFileName())) { - return mapping.findForward(TaskListConstants.SUCCESS); - } - - // validate file size - ActionMessages errors = new ActionMessages(); - FileValidatorUtil.validateFileSize(file, true, errors); - if (!errors.isEmpty()) { - this.saveErrors(request, errors); - return mapping.findForward(TaskListConstants.SUCCESS); - } - - ITaskListService service = getTaskListService(); - // upload to repository - TaskListAttachment att = service.uploadInstructionFile(file, type); - // handle session value - List attachmentList = getAttachmentList(sessionMap); - List deleteAttachmentList = getDeletedAttachmentList(sessionMap); - // first check exist attachment and delete old one (if exist) to deletedAttachmentList - Iterator iter = attachmentList.iterator(); - TaskListAttachment existAtt; - while (iter.hasNext()) { - existAtt = (TaskListAttachment) iter.next(); - if (StringUtils.equals(existAtt.getFileName(), att.getFileName()) - && StringUtils.equals(existAtt.getFileType(), att.getFileType())) { - // if there is same name attachment, delete old one - deleteAttachmentList.add(existAtt); - iter.remove(); - break; - } - } - // add to attachmentList - attachmentList.add(att); - - return mapping.findForward(TaskListConstants.SUCCESS); - - } - - /** - * Delete offline instruction file from current TaskList authoring page. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward deleteOfflineFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return deleteFile(mapping, request, response, form, IToolContentHandler.TYPE_OFFLINE); - } - - /** - * Delete online instruction file from current TaskList authoring page. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - */ - private ActionForward deleteOnlineFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return deleteFile(mapping, request, response, form, IToolContentHandler.TYPE_ONLINE); - } - - /** - * General method to delete file (online or offline) - * - * @param mapping - * @param request - * @param response - * @param form - * @param type - * @return - */ - private ActionForward deleteFile(ActionMapping mapping, HttpServletRequest request, HttpServletResponse response, - ActionForm form, String type) { - Long versionID = new Long(WebUtil.readLongParam(request, TaskListConstants.PARAM_FILE_VERSION_ID)); - Long uuID = new Long(WebUtil.readLongParam(request, TaskListConstants.PARAM_FILE_UUID)); - - // get back sessionMAP - String sessionMapID = WebUtil.readStrParam(request, TaskListConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); - - // handle session value - List attachmentList = getAttachmentList(sessionMap); - List deleteAttachmentList = getDeletedAttachmentList(sessionMap); - // first check exist attachment and delete old one (if exist) to deletedAttachmentList - Iterator iter = attachmentList.iterator(); - TaskListAttachment existAtt; - while (iter.hasNext()) { - existAtt = (TaskListAttachment) iter.next(); - if (existAtt.getFileUuid().equals(uuID) && existAtt.getFileVersionId().equals(versionID)) { - // if there is same name attachment, delete old one - deleteAttachmentList.add(existAtt); - iter.remove(); - } - } - - request.setAttribute(TaskListConstants.ATTR_FILE_TYPE_FLAG, type); - request.setAttribute(TaskListConstants.ATTR_SESSION_MAP_ID, sessionMapID); - return mapping.findForward(TaskListConstants.SUCCESS); - - } - // ********************************************************** // Add taskListItem methods // ********************************************************** @@ -848,22 +623,6 @@ } /** - * @param request - * @return - */ - private List getAttachmentList(SessionMap sessionMap) { - return getListFromSession(sessionMap, TaskListConstants.ATT_ATTACHMENT_LIST); - } - - /** - * @param request - * @return - */ - private List getDeletedAttachmentList(SessionMap sessionMap) { - return getListFromSession(sessionMap, TaskListConstants.ATTR_DELETED_ATTACHMENT_LIST); - } - - /** * List save current taskList items. * * @param request Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/LearningAction.java =================================================================== diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/LearningAction.java (.../LearningAction.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/LearningAction.java (.../LearningAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -26,14 +26,12 @@ import java.io.IOException; import java.sql.Timestamp; -import java.util.ArrayList; import java.util.Comparator; import java.util.Date; -import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.TreeSet; import java.util.TimeZone; +import java.util.TreeSet; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -51,7 +49,6 @@ import org.apache.struts.action.ActionMessages; import org.apache.struts.action.ActionRedirect; import org.apache.struts.upload.FormFile; -import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.learning.web.bean.ActivityPositionDTO; import org.lamsfoundation.lams.learning.web.util.LearningWebUtil; import org.lamsfoundation.lams.notebook.model.NotebookEntry; @@ -63,7 +60,6 @@ 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.TaskListItemVisitLog; import org.lamsfoundation.lams.tool.taskList.model.TaskListSession; import org.lamsfoundation.lams.tool.taskList.model.TaskListUser; import org.lamsfoundation.lams.tool.taskList.service.ITaskListService; @@ -328,15 +324,8 @@ ActivityPositionDTO activityPosition = LearningWebUtil.putActivityPositionInRequestByToolSessionId(sessionId, request, getServlet().getServletContext()); sessionMap.put(AttributeNames.ATTR_ACTIVITY_POSITION, activityPosition); - - //add run offline support - if(taskList.getRunOffline()){ - sessionMap.put(TaskListConstants.PARAM_RUN_OFFLINE, true); - return mapping.findForward("runOffline"); - }else - sessionMap.put(TaskListConstants.PARAM_RUN_OFFLINE, false); - // check if there is submission deadline LDEV-2657 + // check if there is submission deadline Date submissionDeadline = taskList.getSubmissionDeadline(); if (submissionDeadline != null) { HttpSession ss = SessionManager.getSession(); @@ -346,9 +335,9 @@ Date currentLearnerDate = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, new Date()); sessionMap.put(TaskListConstants.ATTR_SUBMISSION_DEADLINE, tzSubmissionDeadline); - //calculate whether deadline has passed, and if so forward to "runOffline" + //calculate whether deadline has passed, and if so forward to "submissionDeadline" if (currentLearnerDate.after(tzSubmissionDeadline)) { - return mapping.findForward("runOffline"); + return mapping.findForward("submissionDeadline"); } } @@ -574,7 +563,7 @@ ITaskListService service = getTaskListService(); UserDTO user = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); TaskListUser taskListUser = service.getUserByIDAndSession(new Long(user.getUserID().intValue()),sessionId); - TaskListItemAttachment att = service.uploadTaskListItemFile(file, IToolContentHandler.TYPE_ONLINE, taskListUser); + TaskListItemAttachment att = service.uploadTaskListItemFile(file, taskListUser); //persist TaskListItem changes in DB Long itemUid = new Long(request.getParameter(TaskListConstants.PARAM_RESOURCE_ITEM_UID)); @@ -727,9 +716,7 @@ int numberCompletedTasks = service.getNumTasksCompletedByUser(sessionId, userID); int minimumNumberTasks = service.getTaskListBySessionId(sessionId).getMinimumNumberTasks(); //if current user view less than reqired view count number, then just return error message. - //if it is runOffline content, then need not check minimum view count - Boolean runOffline = (Boolean) sessionMap.get(TaskListConstants.PARAM_RUN_OFFLINE); - if((minimumNumberTasks - numberCompletedTasks) > 0 && !runOffline){ + if((minimumNumberTasks - numberCompletedTasks) > 0){ ActionErrors errors = new ActionErrors(); errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("lable.learning.minimum.view.number",minimumNumberTasks, numberCompletedTasks)); this.addErrors(request,errors); Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/MonitoringAction.java =================================================================== diff -u -rb9713d8a49fcc108d3835a3d675c490f9e687287 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision b9713d8a49fcc108d3835a3d675c490f9e687287) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -25,8 +25,8 @@ package org.lamsfoundation.lams.tool.taskList.web.action; import java.io.IOException; -import java.util.List; import java.util.Date; +import java.util.List; import java.util.TimeZone; import javax.servlet.ServletException; @@ -43,21 +43,19 @@ import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.taskList.TaskListConstants; -import org.lamsfoundation.lams.tool.taskList.dto.GroupSummary; import org.lamsfoundation.lams.tool.taskList.dto.ItemSummary; import org.lamsfoundation.lams.tool.taskList.dto.ReflectDTO; -import org.lamsfoundation.lams.tool.taskList.dto.TaskListItemVisitLogSummary; import org.lamsfoundation.lams.tool.taskList.dto.Summary; 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.usermanagement.dto.UserDTO; -import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.util.DateUtil; +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.lamsfoundation.lams.web.session.SessionManager; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -103,7 +101,6 @@ ITaskListService service = getTaskListService(); TaskList taskList = service.getTaskListByContentId(contentId); - taskList.toDTO(); List summaryList = service.getSummary(contentId); Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/form/TaskListConditionForm.java =================================================================== diff -u -rfe31f08d68bebdde45fb5597de931d532ce7aace -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/form/TaskListConditionForm.java (.../TaskListConditionForm.java) (revision fe31f08d68bebdde45fb5597de931d532ce7aace) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/form/TaskListConditionForm.java (.../TaskListConditionForm.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -24,7 +24,6 @@ package org.lamsfoundation.lams.tool.taskList.web.form; import org.apache.struts.action.ActionForm; -import org.apache.struts.upload.FormFile; import org.apache.struts.util.LabelValueBean; /** Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/form/TaskListForm.java =================================================================== diff -u -rac170eba5ee70135e473b3a5525d1743d0098bc8 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/form/TaskListForm.java (.../TaskListForm.java) (revision ac170eba5ee70135e473b3a5525d1743d0098bc8) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/form/TaskListForm.java (.../TaskListForm.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -77,7 +77,6 @@ taskList.setAllowContributeTasks(false); taskList.setMonitorVerificationRequired(false); taskList.setDefineLater(false); - taskList.setRunOffline(false); taskList.setReflectOnActivity(false); } } Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/servlet/ExportServlet.java =================================================================== diff -u -rb33e717f9a734d318eefab07a17234f07c770c92 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision b33e717f9a734d318eefab07a17234f07c770c92) +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -25,12 +25,8 @@ package org.lamsfoundation.lams.tool.taskList.web.servlet; -import java.io.BufferedInputStream; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.IOException; -import java.io.OutputStream; import java.util.HashMap; import java.util.List; @@ -40,21 +36,13 @@ import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.lamsfoundation.lams.notebook.model.NotebookEntry; -import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.taskList.TaskListConstants; import org.lamsfoundation.lams.tool.taskList.dto.GroupSummary; import org.lamsfoundation.lams.tool.taskList.dto.ItemSummary; -import org.lamsfoundation.lams.tool.taskList.dto.ReflectDTO; -import org.lamsfoundation.lams.tool.taskList.dto.Summary; import org.lamsfoundation.lams.tool.taskList.dto.TaskListItemVisitLogSummary; import org.lamsfoundation.lams.tool.taskList.model.TaskList; import org.lamsfoundation.lams.tool.taskList.model.TaskListItemAttachment; -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.TaskListException; @@ -112,29 +100,6 @@ return FILENAME; } - - /** - * {@inheritDoc} - */ - protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { - if (toolContentID == null && toolSessionID == null) { - logger.error("Tool content Id or and session Id are null. Unable to activity title"); - } else { - ITaskListService service = TaskListServiceProxy.getTaskListService(getServletContext()); - TaskList content = null; - if ( toolContentID != null ) { - content = service.getTaskListByContentId(toolContentID); - } else { - TaskListSession session=service.getTaskListSessionBySessionId(toolSessionID); - if ( session != null ) - content = session.getTaskList(); - } - if ( content != null ) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); - } /** * Internal method to make an export for specified learner. Index: lams_tool_task/web/pages/authoring/authoring.jsp =================================================================== diff -u -rd4749f70eef0ca437b7d9040576e3f8152b6b4e9 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision d4749f70eef0ca437b7d9040576e3f8152b6b4e9) +++ lams_tool_task/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -29,27 +29,15 @@ // end optional tab controller stuff //if we're leaving Condition tab its addCondition area should be closed - if (tabId != 4) window.parent.hideConditionMessage(); + if (tabId != 3) window.parent.hideConditionMessage(); selectTab(tabId); //for advanceTab if(tabId == 2) changeMinTasks(-1); - } - - function doUploadOnline() { - var myForm = $("authoringForm"); - myForm.action = ""; - myForm.submit(); } - function doUploadOffline() { - var myForm = $("authoringForm"); - myForm.action = ""; - myForm.submit(); - } - function changeMinTasks(initVal){ var tb = document.getElementById("itemTable"); var num = tb.getElementsByTagName("tr"); @@ -94,8 +82,7 @@ - - +
@@ -120,14 +107,10 @@ - - + + - - - - <%-- Default value cancelButtonLabelKey="label.authoring.cancel.button" Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_task/web/pages/authoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_task/web/pages/authoring/parts/instructionfilelist.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_task/web/pages/learning/runoffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_task/web/pages/learning/submissionDeadline.jsp =================================================================== diff -u --- lams_tool_task/web/pages/learning/submissionDeadline.jsp (revision 0) +++ lams_tool_task/web/pages/learning/submissionDeadline.jsp (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -0,0 +1,93 @@ + + +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + +
+

+ ${sessionMap.title} +

+ +
+ + + +
+ + +
+

${sessionMap.reflectInstructions}

+ + + +

+ + + +

+
+ +

+
+
+ + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_task/web/pages/monitoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_task/web/pages/monitoring/monitoring.jsp =================================================================== diff -u -r341a816804f6b2b61a5f180479b56d8fd0d1ea29 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_task/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 341a816804f6b2b61a5f180479b56d8fd0d1ea29) +++ lams_tool_task/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -33,18 +33,16 @@
- - - + +
Index: lams_tool_videorecorder/conf/middlegen/lams_tool_lavideoRecorder11-prefs.properties =================================================================== diff -u -r3d081de4a45da632ee6029251318fac795d41813 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/conf/middlegen/lams_tool_lavideoRecorder11-prefs.properties (.../lams_tool_lavideoRecorder11-prefs.properties) (revision 3d081de4a45da632ee6029251318fac795d41813) +++ lams_tool_videorecorder/conf/middlegen/lams_tool_lavideoRecorder11-prefs.properties (.../lams_tool_lavideoRecorder11-prefs.properties) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -44,8 +44,6 @@ hibernate.tables.tl_lavidr10_videoRecorder.columns.offline_instructions.java-type=java.lang.String hibernate.tables.tl_lavidr10_videoRecorder.columns.online_instructions.java-name=onlineInstructions hibernate.tables.tl_lavidr10_videoRecorder.columns.online_instructions.java-type=java.lang.String -hibernate.tables.tl_lavidr10_videoRecorder.columns.run_offline.java-name=runOffline -hibernate.tables.tl_lavidr10_videoRecorder.columns.run_offline.java-type=java.lang.Boolean hibernate.tables.tl_lavidr10_videoRecorder.columns.title.inctostring=true hibernate.tables.tl_lavidr10_videoRecorder.columns.title.java-name=title hibernate.tables.tl_lavidr10_videoRecorder.columns.title.java-type=java.lang.String Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/IVideoRecorderAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/IVideoRecorderDAO.java =================================================================== diff -u -r3d081de4a45da632ee6029251318fac795d41813 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/IVideoRecorderDAO.java (.../IVideoRecorderDAO.java) (revision 3d081de4a45da632ee6029251318fac795d41813) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/IVideoRecorderDAO.java (.../IVideoRecorderDAO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -37,8 +37,6 @@ void saveOrUpdate(VideoRecorder toContent); - void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type); - void releaseFromCache(Object o); } Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/hibernate/VideoRecorderAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/hibernate/VideoRecorderDAO.java =================================================================== diff -u -r3d081de4a45da632ee6029251318fac795d41813 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/hibernate/VideoRecorderDAO.java (.../VideoRecorderDAO.java) (revision 3d081de4a45da632ee6029251318fac795d41813) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/hibernate/VideoRecorderDAO.java (.../VideoRecorderDAO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -26,12 +26,9 @@ import java.util.List; -import org.hibernate.FlushMode; import org.lamsfoundation.lams.dao.hibernate.BaseDAO; import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderDAO; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment; -import org.springframework.orm.hibernate3.HibernateTemplate; /** * DAO for accessing the VideoRecorder objects - Hibernate specific code. @@ -40,9 +37,6 @@ private static final String FIND_FORUM_BY_CONTENTID = "from VideoRecorder videoRecorder where videoRecorder.toolContentId=?"; - private static final String FIND_INSTRUCTION_FILE = "from " + VideoRecorderAttachment.class.getName() - + " as i where tool_content_id=? and i.file_uuid=? and i.file_version_id=? and i.file_type=?"; - public VideoRecorder getByContentId(Long toolContentId) { List list = getHibernateTemplate().find(VideoRecorderDAO.FIND_FORUM_BY_CONTENTID, toolContentId); if (list != null && list.size() > 0) { @@ -57,22 +51,6 @@ this.getHibernateTemplate().flush(); } - public void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type) { - HibernateTemplate templ = this.getHibernateTemplate(); - if (toolContentId != null && uuid != null && versionId != null) { - List list = getSession().createQuery(VideoRecorderDAO.FIND_INSTRUCTION_FILE).setLong(0, - toolContentId.longValue()).setLong(1, uuid.longValue()).setLong(2, versionId.longValue()) - .setString(3, type).list(); - if (list != null && list.size() > 0) { - VideoRecorderAttachment file = (VideoRecorderAttachment) list.get(0); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(file); - templ.flush(); - } - } - - } - public void releaseFromCache(Object o) { getSession().evict(o); Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/patch20140102.sql =================================================================== diff -u --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/patch20140102.sql (revision 0) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/patch20140102.sql (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -0,0 +1,19 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3147 Simplify tools: get rid of instructions tab, define in monitor and offline activity options +ALTER TABLE tl_lavidr10_videoRecorder DROP COLUMN online_instructions; +ALTER TABLE tl_lavidr10_videoRecorder DROP COLUMN offline_instructions; +ALTER TABLE tl_lavidr10_videoRecorder DROP COLUMN run_offline; +DROP TABLE IF EXISTS tl_lavidr10_attachment; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lavidr10'; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderAttachmentDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderDTO.java =================================================================== diff -u -rea79f29aed5c764a223234e456442bc1e49fcf85 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderDTO.java (.../VideoRecorderDTO.java) (revision ea79f29aed5c764a223234e456442bc1e49fcf85) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderDTO.java (.../VideoRecorderDTO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -32,8 +32,6 @@ import org.apache.log4j.Logger; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderSession; public class VideoRecorderDTO { @@ -44,10 +42,6 @@ public String title; public String instructions; - - public String onlineInstructions; - - public String offlineInstructions; public boolean reflectOnActivity; @@ -72,11 +66,7 @@ public boolean exportOffline; public boolean exportAll; - - public Set onlineInstructionsFiles; - public Set offlineInstructionsFiles; - public Set sessionDTOs = new TreeSet(); public VideoRecorderRecordingDTO authorRecording; @@ -90,8 +80,6 @@ toolContentId = videoRecorder.getToolContentId(); title = videoRecorder.getTitle(); instructions = videoRecorder.getInstructions(); - onlineInstructions = videoRecorder.getOnlineInstructions(); - offlineInstructions = videoRecorder.getOfflineInstructions(); contentInUse = videoRecorder.isContentInUse(); lockOnFinish = videoRecorder.isLockOnFinished(); allowUseVoice = videoRecorder.isAllowUseVoice(); @@ -103,28 +91,10 @@ exportOffline = videoRecorder.isExportOffline(); reflectOnActivity = videoRecorder.isReflectOnActivity(); reflectInstructions = videoRecorder.getReflectInstructions(); - onlineInstructionsFiles = new TreeSet(); - offlineInstructionsFiles = new TreeSet(); if(videoRecorder.getAuthorRecording() != null){ authorRecording = new VideoRecorderRecordingDTO(); } - - for (Iterator i = videoRecorder.getVideoRecorderAttachments().iterator(); i.hasNext();) { - VideoRecorderAttachment att = (VideoRecorderAttachment) i.next(); - if (att.getFileType().equals(IToolContentHandler.TYPE_OFFLINE)) { - VideoRecorderAttachmentDTO attDTO = new VideoRecorderAttachmentDTO(att); - offlineInstructionsFiles.add(attDTO); - } else if (att.getFileType() - .equals(IToolContentHandler.TYPE_ONLINE)) { - VideoRecorderAttachmentDTO attDTO = new VideoRecorderAttachmentDTO(att); - onlineInstructionsFiles.add(attDTO); - } else { - // something is wrong. Ignore file, log error - logger.error("File with uid " + att.getFileUuid() - + " contains invalid fileType: " + att.getFileType()); - } - } } /* Getters / Setters */ @@ -144,48 +114,14 @@ this.instructions = instructions; } - public String getOfflineInstructions() { - return offlineInstructions; - } - - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - public Set getOfflineInstructionsFiles() { - return offlineInstructionsFiles; - } - public VideoRecorderRecordingDTO getAuthorRecording() { return authorRecording; } public void setAuthorRecording(VideoRecorderRecordingDTO authorRecording) { this.authorRecording = authorRecording; } - - public void setOfflineInstructionsFiles( - Set offlineInstructionsFiles) { - this.offlineInstructionsFiles = offlineInstructionsFiles; - } - public String getOnlineInstructions() { - return onlineInstructions; - } - - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - - public Set getOnlineInstructionsFiles() { - return onlineInstructionsFiles; - } - - public void setOnlineInstructionsFiles( - Set onlineInstructionsFiles) { - this.onlineInstructionsFiles = onlineInstructionsFiles; - } - public boolean isReflectOnActivity() { return reflectOnActivity; } Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java =================================================================== diff -u -racc8d2acf5b6b0002e0c8129947040a779ab4077 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java (.../VideoRecorderRecordingDTO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java (.../VideoRecorderRecordingDTO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -26,18 +26,12 @@ package org.lamsfoundation.lams.tool.videoRecorder.dto; import java.util.ArrayList; +import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.Set; -import java.util.TreeSet; -import java.util.Date; import org.apache.log4j.Logger; -import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderComment; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderRating; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderRecording; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderSession; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderUser; Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorder.java =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorder.java (.../VideoRecorder.java) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorder.java (.../VideoRecorder.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -68,8 +68,6 @@ String reflectInstructions; - private boolean runOffline; - private boolean lockOnFinished; private boolean allowUseVoice; @@ -85,65 +83,19 @@ private boolean exportOffline; private boolean exportAll; - - private String onlineInstructions; - private String offlineInstructions; - private boolean contentInUse; private boolean defineLater; private Long toolContentId; - private Set videoRecorderAttachments; - private Set videoRecorderSessions; private VideoRecorderRecording authorRecording; private Set conditions = new TreeSet(new TextSearchConditionComparator()); - // *********** NON Persisit fields - private IToolContentHandler toolContentHandler; - - // Constructors - - /** default constructor */ - public VideoRecorder() { - } - - /** full constructor */ - public VideoRecorder(Date createDate, Date updateDate, Long createBy, String title, String instructions, - boolean runOffline, boolean lockOnFinished, boolean filteringEnabled, String filterKeywords, - String onlineInstructions, String offlineInstructions, boolean contentInUse, boolean defineLater, - boolean allowUseVoice, boolean allowUseCamera, boolean allowLearnerVideoExport, boolean allowLearnerVideoVisibility, - Long toolContentId, Set videoRecorderAttachments, Set videoRecorderSessions, VideoRecorderRecording authorRecording, - boolean exportAll, boolean exportOffline, boolean reflectOnActivity, String reflectInstructions) { - this.createDate = createDate; - this.updateDate = updateDate; - this.createBy = createBy; - this.title = title; - this.instructions = instructions; - this.runOffline = runOffline; - this.lockOnFinished = lockOnFinished; - this.onlineInstructions = onlineInstructions; - this.offlineInstructions = offlineInstructions; - this.contentInUse = contentInUse; - this.defineLater = defineLater; - this.toolContentId = toolContentId; - this.videoRecorderAttachments = videoRecorderAttachments; - this.videoRecorderSessions = videoRecorderSessions; - this.authorRecording = authorRecording; - this.allowUseVoice = allowUseVoice; - this.allowUseCamera = allowUseCamera; - this.allowLearnerVideoVisibility = allowLearnerVideoVisibility; - this.exportOffline = exportOffline; - this.exportAll = exportAll; - this.reflectOnActivity = reflectOnActivity; - this.reflectInstructions = reflectInstructions; - } - // Property accessors /** * @hibernate.id generator-class="native" type="java.lang.Long" column="uid" @@ -243,21 +195,8 @@ public void setReflectInstructions(String reflectInstructions) { this.reflectInstructions = reflectInstructions; - } - - /** - * @hibernate.property column="run_offline" length="1" - * - */ + } - public boolean isRunOffline() { - return runOffline; - } - - public void setRunOffline(boolean runOffline) { - this.runOffline = runOffline; - } - /** * @hibernate.property column="lock_on_finished" length="1" * @@ -353,35 +292,9 @@ public void setExportAll(boolean exportAll) { this.exportAll = exportAll; - } - - /** - * @hibernate.property column="online_instructions" length="65535" - * - */ - - public String getOnlineInstructions() { - return onlineInstructions; } - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - /** - * @hibernate.property column="offline_instructions" length="65535" - * - */ - - public String getOfflineInstructions() { - return offlineInstructions; - } - - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - /** * @hibernate.property column="content_in_use" length="1" * */ @@ -421,21 +334,6 @@ } /** - * @hibernate.set lazy="true" inverse="false" cascade="all-delete-orphan" - * @hibernate.collection-key column="videoRecorder_uid" - * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment" - * - */ - - public Set getVideoRecorderAttachments() { - return videoRecorderAttachments; - } - - public void setVideoRecorderAttachments(Set videoRecorderAttachments) { - this.videoRecorderAttachments = videoRecorderAttachments; - } - - /** * @hibernate.set lazy="true" inverse="true" cascade="none" * @hibernate.collection-key column="videoRecorder_uid" * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderSession" @@ -527,10 +425,8 @@ return result; } - public static VideoRecorder newInstance(VideoRecorder fromContent, Long toContentId, - IToolContentHandler videoRecorderToolContentHandler) { + public static VideoRecorder newInstance(VideoRecorder fromContent, Long toContentId) { VideoRecorder toContent = new VideoRecorder(); - fromContent.toolContentHandler = videoRecorderToolContentHandler; toContent = (VideoRecorder) fromContent.clone(); toContent.setToolContentId(toContentId); toContent.setCreateDate(new Date()); @@ -545,17 +441,6 @@ videoRecorder = (VideoRecorder) super.clone(); videoRecorder.setUid(null); - if (videoRecorderAttachments != null) { - // create a copy of the attachments - Iterator iter = videoRecorderAttachments.iterator(); - Set set = new HashSet(); - while (iter.hasNext()) { - VideoRecorderAttachment originalFile = (VideoRecorderAttachment) iter.next(); - VideoRecorderAttachment newFile = (VideoRecorderAttachment) originalFile.clone(); - set.add(newFile); - } - videoRecorder.videoRecorderAttachments = set; - } // create an empty set for the videoRecorderSession videoRecorder.videoRecorderSessions = new HashSet(); @@ -573,12 +458,4 @@ return videoRecorder; } - public IToolContentHandler getToolContentHandler() { - return toolContentHandler; - } - - public void setToolContentHandler(IToolContentHandler toolContentHandler) { - this.toolContentHandler = toolContentHandler; - } - } Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorderAttachment.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java =================================================================== diff -u -racc8d2acf5b6b0002e0c8129947040a779ab4077 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java (.../IVideoRecorderService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java (.../IVideoRecorderService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -24,7 +24,6 @@ package org.lamsfoundation.lams.tool.videoRecorder.service; -import java.util.Collection; import java.util.List; import java.util.Set; @@ -34,7 +33,6 @@ import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRatingDTO; import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRecordingDTO; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderComment; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderCondition; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderRating; @@ -76,28 +74,6 @@ public VideoRecorder getVideoRecorderByContentId(Long toolContentID); /** - * @param toolContentId - * @param file - * @param type - * @return - */ - public VideoRecorderAttachment uploadFileToContent(Long toolContentId, FormFile file, String type); - - /** - * @param uuid - * @param versionID - */ - public void deleteFromRepository(Long uuid, Long versionID) throws VideoRecorderException; - - /** - * @param contentID - * @param uuid - * @param versionID - * @param type - */ - public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type); - - /** * @param videoRecorder */ public void saveOrUpdateVideoRecorder(VideoRecorder videoRecorder); Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderImportContentVersionFilter.java =================================================================== diff -u --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderImportContentVersionFilter.java (revision 0) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderImportContentVersionFilter.java (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -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 + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.videoRecorder.service; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; + +/** + * Import filter class for different version of VideoRecorder content. + */ +public class VideoRecorderImportContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20081208 version content to 20140102 version tool server. + */ + public void up20081208To20140102() { + this.removeField(VideoRecorder.class, "runOffline"); + this.removeField(VideoRecorder.class, "onlineInstructions"); + this.removeField(VideoRecorder.class, "offlineInstructions"); + this.removeField(VideoRecorder.class, "videoRecorderAttachments"); + } +} Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java =================================================================== diff -u -r33da76d05725a84e191a5f6dca50b394cca3c1ee -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java (.../VideoRecorderService.java) (revision 33da76d05725a84e191a5f6dca50b394cca3c1ee) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java (.../VideoRecorderService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -64,7 +64,6 @@ import org.lamsfoundation.lams.tool.exception.SessionDataExistsException; import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.service.ILamsToolService; -import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderAttachmentDAO; import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderCommentDAO; import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderDAO; import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderRatingDAO; @@ -75,7 +74,6 @@ import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRatingDTO; import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRecordingDTO; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderComment; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderCondition; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderRating; @@ -110,8 +108,6 @@ private IVideoRecorderUserDAO videoRecorderUserDAO = null; - private IVideoRecorderAttachmentDAO videoRecorderAttachmentDAO = null; - private IVideoRecorderRatingDAO videoRecorderRatingDAO = null; private IVideoRecorderCommentDAO videoRecorderCommentDAO = null; @@ -122,10 +118,6 @@ private IToolContentHandler videoRecorderToolContentHandler = null; - private IRepositoryService repositoryService = null; - - private IAuditService auditService = null; - private IExportToolContentService exportContentService; private ICoreNotebookService coreNotebookService; @@ -235,28 +227,10 @@ fromContent = getDefaultContent(); } - VideoRecorder toContent = VideoRecorder.newInstance(fromContent, toContentId, videoRecorderToolContentHandler); + VideoRecorder toContent = VideoRecorder.newInstance(fromContent, toContentId); videoRecorderDAO.saveOrUpdate(toContent); } - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { - VideoRecorder videoRecorder = videoRecorderDAO.getByContentId(toolContentId); - if (videoRecorder == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - videoRecorder.setDefineLater(value); - videoRecorderDAO.saveOrUpdate(videoRecorder); - } - - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { - VideoRecorder videoRecorder = videoRecorderDAO.getByContentId(toolContentId); - if (videoRecorder == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - videoRecorder.setRunOffline(value); - videoRecorderDAO.saveOrUpdate(videoRecorder); - } - public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { // TODO Auto-generated method stub @@ -282,9 +256,8 @@ // set ResourceToolContentHandler as null to avoid copy file node in // repository again. - videoRecorder = VideoRecorder.newInstance(videoRecorder, toolContentId, null); + videoRecorder = VideoRecorder.newInstance(videoRecorder, toolContentId); videoRecorder.setToolContentId(null); - videoRecorder.setToolContentHandler(null); videoRecorder.setVideoRecorderSessions(null); VideoRecorderRecording authorRecording = (VideoRecorderRecording) getFirstRecordingByToolContentId(toolContentId); @@ -298,14 +271,7 @@ } videoRecorder.setAuthorRecording(authorRecording); - - Set atts = videoRecorder.getVideoRecorderAttachments(); - for (VideoRecorderAttachment att : atts) { - att.setVideoRecorder(null); - } try { - exportContentService.registerFileClassForExport(VideoRecorderAttachment.class.getName(), "fileUuid", - "fileVersionId"); exportContentService.exportToolContent(toolContentId, videoRecorder, videoRecorderToolContentHandler, rootPath); } catch (ExportToolContentException e) { @@ -322,9 +288,9 @@ public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, String toVersion) throws ToolException { try { - exportContentService.registerFileClassForImport(VideoRecorderAttachment.class.getName(), "fileUuid", - "fileVersionId", "fileName", "fileType", null, null); - + // register version filter class + exportContentService.registerImportVersionFilterClass(VideoRecorderImportContentVersionFilter.class); + Object toolPOJO = exportContentService.importToolContent(toolContentPath, videoRecorderToolContentHandler, fromVersion, toVersion); if (!(toolPOJO instanceof VideoRecorder)) { @@ -423,7 +389,7 @@ VideoRecorder defaultContent = getDefaultContent(); // create new videoRecorder using the newContentID VideoRecorder newContent = new VideoRecorder(); - newContent = VideoRecorder.newInstance(defaultContent, newContentID, videoRecorderToolContentHandler); + newContent = VideoRecorder.newInstance(defaultContent, newContentID); videoRecorderDAO.saveOrUpdate(newContent); return newContent; } @@ -521,32 +487,6 @@ } } - public VideoRecorderAttachment uploadFileToContent(Long toolContentId, FormFile file, String type) { - if (file == null || StringUtils.isEmpty(file.getFileName())) { - throw new VideoRecorderException("Could not find upload file: " + file); - } - - NodeKey nodeKey = processFile(file, type); - - VideoRecorderAttachment attachment = new VideoRecorderAttachment(nodeKey.getVersion(), type, - file.getFileName(), nodeKey.getUuid(), new Date()); - return attachment; - } - - public void deleteFromRepository(Long uuid, Long versionID) throws VideoRecorderException { - ITicket ticket = getRepositoryLoginTicket(); - try { - repositoryService.deleteVersion(ticket, uuid, versionID); - } catch (Exception e) { - throw new VideoRecorderException("Exception occured while deleting files from" + " the repository " - + e.getMessage()); - } - } - - public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type) { - videoRecorderDAO.deleteInstructionFile(contentID, uuid, versionID, type); - } - public void saveOrUpdateVideoRecorder(VideoRecorder videoRecorder) { videoRecorderDAO.saveOrUpdate(videoRecorder); } @@ -577,63 +517,6 @@ return videoRecorderUser; } - public IAuditService getAuditService() { - return auditService; - } - - public void setAuditService(IAuditService auditService) { - this.auditService = auditService; - } - - private NodeKey processFile(FormFile file, String type) { - NodeKey node = null; - if (file != null && !StringUtils.isEmpty(file.getFileName())) { - String fileName = file.getFileName(); - try { - node = getVideoRecorderToolContentHandler().uploadFile(file.getInputStream(), fileName, - file.getContentType(), type); - } catch (InvalidParameterException e) { - throw new VideoRecorderException("InvalidParameterException occured while trying to upload File" - + e.getMessage()); - } catch (FileNotFoundException e) { - throw new VideoRecorderException("FileNotFoundException occured while trying to upload File" - + e.getMessage()); - } catch (RepositoryCheckedException e) { - throw new VideoRecorderException("RepositoryCheckedException occured while trying to upload File" - + e.getMessage()); - } catch (IOException e) { - throw new VideoRecorderException("IOException occured while trying to upload File" + e.getMessage()); - } - } - return node; - } - - /** - * This method verifies the credentials of the SubmitFiles 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 SubmitFilesException - */ - private ITicket getRepositoryLoginTicket() throws VideoRecorderException { - ICredentials credentials = new SimpleCredentials(VideoRecorderToolContentHandler.repositoryUser, - VideoRecorderToolContentHandler.repositoryId); - try { - ITicket ticket = repositoryService.login(credentials, - VideoRecorderToolContentHandler.repositoryWorkspaceName); - return ticket; - } catch (AccessDeniedException ae) { - throw new VideoRecorderException("Access Denied to repository." + ae.getMessage()); - } catch (WorkspaceNotFoundException we) { - throw new VideoRecorderException("Workspace not found." + we.getMessage()); - } catch (LoginException e) { - throw new VideoRecorderException("Login failed." + e.getMessage()); - } - } - /* ===============Methods implemented from ToolContentImport102Manager =============== */ /** @@ -649,15 +532,9 @@ videoRecorder.setInstructions(WebUtil.convertNewlines((String) importValues .get(ToolContentImport102Manager.CONTENT_BODY))); videoRecorder.setLockOnFinished(Boolean.TRUE); - videoRecorder.setOfflineInstructions(null); - videoRecorder.setOnlineInstructions(null); - videoRecorder.setRunOffline(Boolean.FALSE); videoRecorder.setTitle((String) importValues.get(ToolContentImport102Manager.CONTENT_TITLE)); videoRecorder.setToolContentId(toolContentId); videoRecorder.setUpdateDate(now); - // leave as empty, no need to set them to anything. - // setVideoRecorderAttachments(Set videoRecorderAttachments); - // setVideoRecorderSessions(Set videoRecorderSessions); videoRecorderDAO.saveOrUpdate(videoRecorder); } @@ -679,14 +556,6 @@ // ========================================================================================= /* ********** Used by Spring to "inject" the linked objects ************* */ - public IVideoRecorderAttachmentDAO getVideoRecorderAttachmentDAO() { - return videoRecorderAttachmentDAO; - } - - public void setVideoRecorderAttachmentDAO(IVideoRecorderAttachmentDAO attachmentDAO) { - videoRecorderAttachmentDAO = attachmentDAO; - } - public IVideoRecorderDAO getVideoRecorderDAO() { return videoRecorderDAO; } @@ -791,14 +660,6 @@ this.videoRecorderOutputFactory = videoRecorderOutputFactory; } - public IRepositoryService getRepositoryService() { - return repositoryService; - } - - public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - public void releaseConditionsFromCache(VideoRecorder videoRecorder) { if (videoRecorder.getConditions() != null) { for (VideoRecorderCondition condition : videoRecorder.getConditions()) { Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/util/VideoRecorderConstants.java =================================================================== diff -u -r61df3f3f473a3619f93c63ceb879ae36438020e8 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/util/VideoRecorderConstants.java (.../VideoRecorderConstants.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/util/VideoRecorderConstants.java (.../VideoRecorderConstants.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -33,8 +33,6 @@ public static final Integer SESSION_COMPLETED = new Integer(2); public static final String AUTHORING_DEFAULT_TAB = "1"; - public static final String ATTACHMENT_LIST = "attachmentList"; - public static final String DELETED_ATTACHMENT_LIST = "deletedAttachmentList"; public static final String AUTH_SESSION_ID_COUNTER = "authoringSessionIdCounter"; public static final String AUTH_SESSION_ID = "authoringSessionId"; Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/videoRecorderApplicationContext.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/videoRecorderApplicationContext.xml (.../videoRecorderApplicationContext.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/videoRecorderApplicationContext.xml (.../videoRecorderApplicationContext.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -26,7 +26,6 @@ - @@ -35,13 +34,11 @@ - - - + @@ -55,10 +52,7 @@ PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED - PROPAGATION_REQUIRED - PROPAGATION_REQUIRED PROPAGATION_REQUIRED - PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED @@ -83,10 +77,6 @@ - - - - Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/AuthoringAction.java =================================================================== diff -u -r0bbad8932a51efb88ac79f78bf2c7d7396554fe9 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 0bbad8932a51efb88ac79f78bf2c7d7396554fe9) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -52,14 +52,9 @@ import org.lamsfoundation.lams.tool.ToolSessionManager; import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderDTO; import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRecordingDTO; -import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderSessionDTO; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment; import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderCondition; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderSession; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderUser; import org.lamsfoundation.lams.tool.videoRecorder.service.IVideoRecorderService; -import org.lamsfoundation.lams.tool.videoRecorder.service.VideoRecorderService; import org.lamsfoundation.lams.tool.videoRecorder.service.VideoRecorderServiceProxy; import org.lamsfoundation.lams.tool.videoRecorder.util.VideoRecorderConstants; import org.lamsfoundation.lams.tool.videoRecorder.web.forms.AuthoringForm; @@ -90,11 +85,6 @@ private static final String KEY_TOOL_CONTENT_ID = "toolContentID"; private static final String KEY_CONTENT_FOLDER_ID = "contentFolderID"; private static final String KEY_MODE = "mode"; - private static final String KEY_ONLINE_FILES = "onlineFiles"; - private static final String KEY_OFFLINE_FILES = "offlineFiles"; - private static final String KEY_UNSAVED_ONLINE_FILES = "unsavedOnlineFiles"; - private static final String KEY_UNSAVED_OFFLINE_FILES = "unsavedOfflineFiles"; - private static final String KEY_DELETED_FILES = "deletedFiles"; /** * Default method when no dispatch parameter is specified. It is expected that the parameter @@ -201,24 +191,6 @@ ToolAccessMode mode = (ToolAccessMode) map.get(AuthoringAction.KEY_MODE); updateVideoRecorder(videoRecorder, authForm, mode); - // remove attachments marked for deletion. - Set attachments = videoRecorder.getVideoRecorderAttachments(); - if (attachments == null) { - attachments = new HashSet(); - } - - for (VideoRecorderAttachment att : getAttList(AuthoringAction.KEY_DELETED_FILES, map)) { - // remove from db, leave in repository - attachments.remove(att); - } - - // add unsaved attachments - attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map)); - attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map)); - - // set attachments in case it didn't exist - videoRecorder.setVideoRecorderAttachments(attachments); - videoRecorderService.releaseConditionsFromCache(videoRecorder); Set conditions = videoRecorder.getConditions(); @@ -239,7 +211,7 @@ } } - // set attachments in case it didn't exist + // set conditions in case it didn't exist videoRecorder.setConditions(conditionSet); // set the update date @@ -263,156 +235,8 @@ return mapping.findForward("success"); } - public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return uploadFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request); - } - - public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return uploadFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request); - } - - public ActionForward deleteOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return deleteFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request); - } - - public ActionForward deleteOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return deleteFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request); - } - - public ActionForward removeUnsavedOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return removeUnsaved(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request); - } - - public ActionForward removeUnsavedOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return removeUnsaved(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request); - } - /* ========== Private Methods ********** */ - private ActionForward uploadFile(ActionMapping mapping, AuthoringForm authForm, String type, - HttpServletRequest request) { - SessionMap map = getSessionMap(request, authForm); - - FormFile file; - List unsavedFiles; - List savedFiles; - if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { - file = authForm.getOfflineFile(); - unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map); - - savedFiles = getAttList(AuthoringAction.KEY_OFFLINE_FILES, map); - } else { - file = authForm.getOnlineFile(); - unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map); - - savedFiles = getAttList(AuthoringAction.KEY_ONLINE_FILES, map); - } - - // validate file max size - ActionMessages errors = new ActionMessages(); - FileValidatorUtil.validateFileSize(file, true, errors); - if (!errors.isEmpty()) { - request.setAttribute(VideoRecorderConstants.ATTR_SESSION_MAP, map); - this.saveErrors(request, errors); - return mapping.findForward("success"); - } - - if (file.getFileName().length() != 0) { - - // upload file to repository - VideoRecorderAttachment newAtt = videoRecorderService.uploadFileToContent((Long) map - .get(AuthoringAction.KEY_TOOL_CONTENT_ID), file, type); - - // Add attachment to unsavedFiles - // check to see if file with same name exists - VideoRecorderAttachment currAtt; - Iterator iter = savedFiles.iterator(); - while (iter.hasNext()) { - currAtt = (VideoRecorderAttachment) iter.next(); - if (StringUtils.equals(currAtt.getFileName(), newAtt.getFileName()) - && StringUtils.equals(currAtt.getFileType(), newAtt.getFileType())) { - // move from this this list to deleted list. - getAttList(AuthoringAction.KEY_DELETED_FILES, map).add(currAtt); - iter.remove(); - break; - } - } - unsavedFiles.add(newAtt); - - request.setAttribute(VideoRecorderConstants.ATTR_SESSION_MAP, map); - request.setAttribute("unsavedChanges", new Boolean(true)); - } - return mapping.findForward("success"); - } - - private ActionForward deleteFile(ActionMapping mapping, AuthoringForm authForm, String type, - HttpServletRequest request) { - SessionMap map = getSessionMap(request, authForm); - - List fileList; - if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { - fileList = getAttList(AuthoringAction.KEY_OFFLINE_FILES, map); - } else { - fileList = getAttList(AuthoringAction.KEY_ONLINE_FILES, map); - } - - Iterator iter = fileList.iterator(); - - while (iter.hasNext()) { - VideoRecorderAttachment att = (VideoRecorderAttachment) iter.next(); - - if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) { - // move to delete file list, deleted at next updateContent - getAttList(AuthoringAction.KEY_DELETED_FILES, map).add(att); - - // remove from this list - iter.remove(); - break; - } - } - - request.setAttribute(VideoRecorderConstants.ATTR_SESSION_MAP, map); - request.setAttribute("unsavedChanges", new Boolean(true)); - - return mapping.findForward("success"); - } - - private ActionForward removeUnsaved(ActionMapping mapping, AuthoringForm authForm, String type, - HttpServletRequest request) { - SessionMap map = getSessionMap(request, authForm); - - List unsavedFiles; - - if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { - unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map); - } else { - unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map); - } - - Iterator iter = unsavedFiles.iterator(); - while (iter.hasNext()) { - VideoRecorderAttachment att = (VideoRecorderAttachment) iter.next(); - - if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) { - // delete from repository and list - videoRecorderService.deleteFromRepository(att.getFileUuid(), att.getFileVersionId()); - iter.remove(); - break; - } - } - - request.setAttribute(VideoRecorderConstants.ATTR_SESSION_MAP, map); - request.setAttribute("unsavedChanges", new Boolean(true)); - - return mapping.findForward("success"); - } - /** * Updates VideoRecorder content using AuthoringForm inputs. * @@ -424,8 +248,6 @@ videoRecorder.setTitle(authForm.getTitle()); videoRecorder.setInstructions(authForm.getInstructions()); //if (mode.isAuthor()) { // Teacher cannot modify following - videoRecorder.setOfflineInstructions(authForm.getOnlineInstruction()); - videoRecorder.setOnlineInstructions(authForm.getOfflineInstruction()); videoRecorder.setLockOnFinished(authForm.isLockOnFinished()); videoRecorder.setAllowUseVoice(authForm.isAllowUseVoice()); videoRecorder.setAllowUseCamera(authForm.isAllowUseCamera()); @@ -447,8 +269,6 @@ private void updateAuthForm(AuthoringForm authForm, VideoRecorder videoRecorder) { authForm.setTitle(videoRecorder.getTitle()); authForm.setInstructions(videoRecorder.getInstructions()); - authForm.setOnlineInstruction(videoRecorder.getOnlineInstructions()); - authForm.setOfflineInstruction(videoRecorder.getOfflineInstructions()); authForm.setLockOnFinished(videoRecorder.isLockOnFinished()); authForm.setAllowUseVoice(videoRecorder.isAllowUseVoice()); authForm.setAllowUseCamera(videoRecorder.isAllowUseCamera()); @@ -473,25 +293,8 @@ map.put(AuthoringAction.KEY_MODE, mode); map.put(AuthoringAction.KEY_CONTENT_FOLDER_ID, contentFolderID); map.put(AuthoringAction.KEY_TOOL_CONTENT_ID, toolContentID); - map.put(AuthoringAction.KEY_ONLINE_FILES, new LinkedList()); - map.put(AuthoringAction.KEY_OFFLINE_FILES, new LinkedList()); - map.put(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, new LinkedList()); - map.put(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, new LinkedList()); - map.put(AuthoringAction.KEY_DELETED_FILES, new LinkedList()); map.put(VideoRecorderConstants.ATTR_DELETED_CONDITION_LIST, new ArrayList()); - Iterator iter = videoRecorder.getVideoRecorderAttachments().iterator(); - while (iter.hasNext()) { - VideoRecorderAttachment attachment = (VideoRecorderAttachment) iter.next(); - String type = attachment.getFileType(); - if (type.equals(IToolContentHandler.TYPE_OFFLINE)) { - getAttList(AuthoringAction.KEY_OFFLINE_FILES, map).add(attachment); - } - if (type.equals(IToolContentHandler.TYPE_ONLINE)) { - getAttList(AuthoringAction.KEY_ONLINE_FILES, map).add(attachment); - } - } - SortedSet set = new TreeSet(new TextSearchConditionComparator()); if (videoRecorder.getConditions() != null) { @@ -519,18 +322,6 @@ } /** - * Retrieves a List of attachments from the map using the key. - * - * @param key - * @param map - * @return - */ - private List getAttList(String key, SessionMap map) { - List list = (List) map.get(key); - return list; - } - - /** * Retrieve the SessionMap from the HttpSession. * * @param request @@ -540,20 +331,4 @@ private SessionMap getSessionMap(HttpServletRequest request, AuthoringForm authForm) { return (SessionMap) request.getSession().getAttribute(authForm.getSessionMapID()); } - - /** - * Lists deleted VideoRecorder conditions, which could be persisted or non-persisted items. - * - * @param request - * @return - */ - private List getDeletedVideoRecorderConditionList(SessionMap sessionMap) { - List list = (List) sessionMap.get(VideoRecorderConstants.ATTR_DELETED_CONDITION_LIST); - if (list == null) { - list = new ArrayList(); - sessionMap.put(VideoRecorderConstants.ATTR_DELETED_CONDITION_LIST, list); - } - return list; - - } } Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/LearningAction.java =================================================================== diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/LearningAction.java (.../LearningAction.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/LearningAction.java (.../LearningAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -72,7 +72,6 @@ * @struts.action path="/learning" parameter="dispatch" scope="request" * name="learningForm" * @struts.action-forward name="videoRecorder" path="tiles:/learning/main" - * @struts.action-forward name="runOffline" path="tiles:/learning/runOffline" * @struts.action-forward name="defineLater" path="tiles:/learning/defineLater" */ public class LearningAction extends LamsDispatchAction { @@ -169,11 +168,6 @@ LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionID, request, getServlet() .getServletContext()); - - // check runOffline - if (videoRecorder.isRunOffline()) { - return mapping.findForward("runOffline"); - } // get any existing videoRecorder entry Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/servlets/ExportServlet.java =================================================================== diff -u -rb33e717f9a734d318eefab07a17234f07c770c92 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision b33e717f9a734d318eefab07a17234f07c770c92) +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -113,29 +113,6 @@ return FILENAME; } - - protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { - if (toolContentID == null && toolSessionID == null) { - logger.error("Tool content Id or and session Id are null. Unable to activity title"); - } else { - if (videoRecorderService == null) { - videoRecorderService = VideoRecorderServiceProxy.getVideoRecorderService(getServletContext()); - } - - VideoRecorder content = null; - if ( toolContentID != null ) { - content = videoRecorderService.getVideoRecorderByContentId(toolContentID); - } else { - VideoRecorderSession session=videoRecorderService.getSessionBySessionId(toolSessionID); - if ( session != null ) - content = session.getVideoRecorder(); - } - if ( content != null ) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); - } private void doLearnerExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) Index: lams_tool_videorecorder/web/WEB-INF/tiles-defs.xml =================================================================== diff -u -rd56929f06ad90a63082d514e6521adc175f3de27 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision d56929f06ad90a63082d514e6521adc175f3de27) +++ lams_tool_videorecorder/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -86,10 +86,6 @@ - - - - Index: lams_tool_videorecorder/web/includes/javascript/authoring.js =================================================================== diff -u -r3d081de4a45da632ee6029251318fac795d41813 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/web/includes/javascript/authoring.js (.../authoring.js) (revision 3d081de4a45da632ee6029251318fac795d41813) +++ lams_tool_videorecorder/web/includes/javascript/authoring.js (.../authoring.js) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -17,8 +17,3 @@ document.authoringForm.dispatch.value = method; document.authoringForm.submit(); } -function deleteAttachment(dispatch, uuid) { - document.authoringForm.dispatch.value = dispatch; - document.authoringForm.deleteFileUuid.value = uuid; - document.authoringForm.submit(); -} Index: lams_tool_videorecorder/web/pages/authoring/authoring.jsp =================================================================== diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_videorecorder/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82) +++ lams_tool_videorecorder/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -1,14 +1,10 @@ <%@ include file="/common/taglibs.jsp"%> -<%@ page - import="org.lamsfoundation.lams.tool.videoRecorder.util.VideoRecorderConstants"%> +<%@ page import="org.lamsfoundation.lams.tool.videoRecorder.util.VideoRecorderConstants"%> - + - + @@ -23,7 +19,6 @@ - @@ -36,9 +31,6 @@
- - -

@@ -55,8 +47,6 @@ - - - - + + + + + + + + +

+ +
+

+ +

+
+ + + + + + +
+
+ + + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + Index: lams_tool_vote/web/learning/submissionDeadline.jsp =================================================================== diff -u --- lams_tool_vote/web/learning/submissionDeadline.jsp (revision 0) +++ lams_tool_vote/web/learning/submissionDeadline.jsp (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -0,0 +1,113 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +License Information: http://lamsfoundation.org/licensing/lams/2.0/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> + + + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + <fmt:message key="activity.title" /> + + + + + + + + + + + + + +
+ +

+ +

+ +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +
+ + + + + + + + Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_vote/web/monitoring/Instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp =================================================================== diff -u -r57a242c8553eeec5781c2106493aa9f34efa5489 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp (.../MonitoringMaincontent.jsp) (revision 57a242c8553eeec5781c2106493aa9f34efa5489) +++ lams_tool_vote/web/monitoring/MonitoringMaincontent.jsp (.../MonitoringMaincontent.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -31,7 +31,6 @@ <% Set tabs = new LinkedHashSet(); tabs.add("label.summary"); - tabs.add("label.instructions"); tabs.add("label.editActivity"); tabs.add("label.stats"); pageContext.setAttribute("tabs", tabs); @@ -164,9 +163,8 @@ - - - + +
Index: lams_tool_wiki/conf/middlegen/lams_tool_lawiki11-prefs.properties =================================================================== diff -u -r1082bdcc357c105126a5641cecc68acfa645b66b -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/conf/middlegen/lams_tool_lawiki11-prefs.properties (.../lams_tool_lawiki11-prefs.properties) (revision 1082bdcc357c105126a5641cecc68acfa645b66b) +++ lams_tool_wiki/conf/middlegen/lams_tool_lawiki11-prefs.properties (.../lams_tool_lawiki11-prefs.properties) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -44,8 +44,6 @@ hibernate.tables.tl_lawiki10_wiki.columns.offline_instructions.java-type=java.lang.String hibernate.tables.tl_lawiki10_wiki.columns.online_instructions.java-name=onlineInstructions hibernate.tables.tl_lawiki10_wiki.columns.online_instructions.java-type=java.lang.String -hibernate.tables.tl_lawiki10_wiki.columns.run_offline.java-name=runOffline -hibernate.tables.tl_lawiki10_wiki.columns.run_offline.java-type=java.lang.Boolean hibernate.tables.tl_lawiki10_wiki.columns.title.inctostring=true hibernate.tables.tl_lawiki10_wiki.columns.title.java-name=title hibernate.tables.tl_lawiki10_wiki.columns.title.java-type=java.lang.String Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/IWikiAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/IWikiDAO.java =================================================================== diff -u -r1082bdcc357c105126a5641cecc68acfa645b66b -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/IWikiDAO.java (.../IWikiDAO.java) (revision 1082bdcc357c105126a5641cecc68acfa645b66b) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/IWikiDAO.java (.../IWikiDAO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -37,6 +37,4 @@ void saveOrUpdate(Wiki toContent); - void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type); - } Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/hibernate/WikiAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/hibernate/WikiDAO.java =================================================================== diff -u -r2f21856ec2ab85b47c93cfcc3fa2c8769be65077 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/hibernate/WikiDAO.java (.../WikiDAO.java) (revision 2f21856ec2ab85b47c93cfcc3fa2c8769be65077) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/hibernate/WikiDAO.java (.../WikiDAO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -33,7 +33,6 @@ import org.lamsfoundation.lams.dao.hibernate.BaseDAO; import org.lamsfoundation.lams.tool.wiki.dao.IWikiDAO; import org.lamsfoundation.lams.tool.wiki.model.Wiki; -import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment; import org.lamsfoundation.lams.tool.wiki.model.WikiPage; import org.springframework.orm.hibernate3.HibernateTemplate; @@ -44,10 +43,7 @@ private static final String FIND_FORUM_BY_CONTENTID = "from Wiki wiki where wiki.toolContentId=?"; - private static final String FIND_INSTRUCTION_FILE = "from " + WikiAttachment.class.getName() - + " as i where tool_content_id=? and i.file_uuid=? and i.file_version_id=? and i.file_type=?"; - - public Wiki getByContentId(Long toolContentId) { + public Wiki getByContentId(Long toolContentId) { List list = getHibernateTemplate().find(FIND_FORUM_BY_CONTENTID, toolContentId); if (list != null && list.size() > 0) { Wiki wiki = (Wiki) list.get(0); @@ -66,21 +62,6 @@ //this.getHibernateTemplate().flush(); } - public void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type) { - HibernateTemplate templ = this.getHibernateTemplate(); - if (toolContentId != null && uuid != null && versionId != null) { - List list = getSession().createQuery(FIND_INSTRUCTION_FILE).setLong(0, toolContentId.longValue()).setLong( - 1, uuid.longValue()).setLong(2, versionId.longValue()).setString(3, type).list(); - if (list != null && list.size() > 0) { - WikiAttachment file = (WikiAttachment) list.get(0); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(file); - templ.flush(); - } - } - - } - /** * Although we are dealing with a set, still somehow duplicates are coming * through. This method removes them. Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20140102.sql =================================================================== diff -u --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20140102.sql (revision 0) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20140102.sql (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -0,0 +1,19 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3147 Simplify tools: get rid of instructions tab, define in monitor and offline activity options +ALTER TABLE tl_lawiki10_wiki DROP COLUMN online_instructions; +ALTER TABLE tl_lawiki10_wiki DROP COLUMN offline_instructions; +ALTER TABLE tl_lawiki10_wiki DROP COLUMN run_offline; +DROP TABLE IF EXISTS tl_lawiki10_attachment; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lawiki10'; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiAttachmentDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiDTO.java =================================================================== diff -u -rf08d91b95c1892c71594dd4f7fd6e9b4509cccc7 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiDTO.java (.../WikiDTO.java) (revision f08d91b95c1892c71594dd4f7fd6e9b4509cccc7) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiDTO.java (.../WikiDTO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -32,7 +32,6 @@ import org.apache.log4j.Logger; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.tool.wiki.model.Wiki; -import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment; import org.lamsfoundation.lams.tool.wiki.model.WikiSession; public class WikiDTO { @@ -45,10 +44,6 @@ public String instructions; - public String onlineInstructions; - - public String offlineInstructions; - public boolean defineLater; public boolean contentInUse; @@ -71,10 +66,6 @@ private Integer maximumEdits; - public Set onlineInstructionsFiles; - - public Set offlineInstructionsFiles; - public Set sessionDTOs = new TreeSet(); public Long currentTab; @@ -87,8 +78,6 @@ toolContentId = wiki.getToolContentId(); title = wiki.getTitle(); instructions = wiki.getInstructions(); - onlineInstructions = wiki.getOnlineInstructions(); - offlineInstructions = wiki.getOfflineInstructions(); contentInUse = wiki.isContentInUse(); lockOnFinish = wiki.isLockOnFinished(); allowLearnerCreatePages = wiki.isAllowLearnerCreatePages(); @@ -100,23 +89,6 @@ minimumEdits = wiki.getMinimumEdits(); maximumEdits = wiki.getMaximumEdits(); - onlineInstructionsFiles = new TreeSet(); - offlineInstructionsFiles = new TreeSet(); - - for (Iterator i = wiki.getWikiAttachments().iterator(); i.hasNext();) { - WikiAttachment att = (WikiAttachment) i.next(); - if (att.getFileType().equals(IToolContentHandler.TYPE_OFFLINE)) { - WikiAttachmentDTO attDTO = new WikiAttachmentDTO(att); - offlineInstructionsFiles.add(attDTO); - } else if (att.getFileType().equals(IToolContentHandler.TYPE_ONLINE)) { - WikiAttachmentDTO attDTO = new WikiAttachmentDTO(att); - onlineInstructionsFiles.add(attDTO); - } else { - // something is wrong. Ignore file, log error - logger.error("File with uid " + att.getFileUuid() + " contains invalid fileType: " + att.getFileType()); - } - } - for (Iterator iter = wiki.getWikiSessions().iterator(); iter.hasNext();) { WikiSession session = (WikiSession) iter.next(); WikiSessionDTO sessionDTO = new WikiSessionDTO(session); @@ -142,38 +114,6 @@ this.instructions = instructions; } - public String getOfflineInstructions() { - return offlineInstructions; - } - - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - public Set getOfflineInstructionsFiles() { - return offlineInstructionsFiles; - } - - public void setOfflineInstructionsFiles(Set offlineInstructionsFiles) { - this.offlineInstructionsFiles = offlineInstructionsFiles; - } - - public String getOnlineInstructions() { - return onlineInstructions; - } - - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - - public Set getOnlineInstructionsFiles() { - return onlineInstructionsFiles; - } - - public void setOnlineInstructionsFiles(Set onlineInstructionsFiles) { - this.onlineInstructionsFiles = onlineInstructionsFiles; - } - public String getTitle() { return title; } Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/Wiki.java =================================================================== diff -u -rf08d91b95c1892c71594dd4f7fd6e9b4509cccc7 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/Wiki.java (.../Wiki.java) (revision f08d91b95c1892c71594dd4f7fd6e9b4509cccc7) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/Wiki.java (.../Wiki.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -61,8 +61,6 @@ private String instructions; - private boolean runOffline; - // BEGIN ADVANCED OPTIONS------------------ // Lock the wiki after learner is finished @@ -94,55 +92,18 @@ // END ADVANCED OPTIONS------------------ - private String onlineInstructions; - - private String offlineInstructions; - private boolean contentInUse; private boolean defineLater; private Long toolContentId; - private Set wikiAttachments; - private Set wikiSessions; private Set wikiPages; private WikiPage mainPage; - // *********** NON Persist fields - private IToolContentHandler toolContentHandler; - - // Constructors - - /** default constructor */ - public Wiki() { - } - - /** full constructor */ - public Wiki(Date createDate, Date updateDate, Long createBy, String title, String instructions, boolean runOffline, - boolean lockOnFinished, boolean filteringEnabled, String filterKeywords, String onlineInstructions, - String offlineInstructions, boolean contentInUse, boolean defineLater, Long toolContentId, - Set wikiAttachments, Set wikiSessions, Set wikiPages) { - this.createDate = createDate; - this.updateDate = updateDate; - this.createBy = createBy; - this.title = title; - this.instructions = instructions; - this.runOffline = runOffline; - this.lockOnFinished = lockOnFinished; - this.onlineInstructions = onlineInstructions; - this.offlineInstructions = offlineInstructions; - this.contentInUse = contentInUse; - this.defineLater = defineLater; - this.toolContentId = toolContentId; - this.wikiAttachments = wikiAttachments; - this.wikiSessions = wikiSessions; - this.wikiPages = wikiPages; - } - // Property accessors /** * @hibernate.id generator-class="native" type="java.lang.Long" column="uid" @@ -223,19 +184,6 @@ } /** - * @hibernate.property column="run_offline" length="1" - * - */ - - public boolean isRunOffline() { - return this.runOffline; - } - - public void setRunOffline(boolean runOffline) { - this.runOffline = runOffline; - } - - /** * @hibernate.property column="lock_on_finished" length="1" * */ @@ -341,32 +289,6 @@ } /** - * @hibernate.property column="online_instructions" length="65535" - * - */ - - public String getOnlineInstructions() { - return this.onlineInstructions; - } - - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - - /** - * @hibernate.property column="offline_instructions" length="65535" - * - */ - - public String getOfflineInstructions() { - return this.offlineInstructions; - } - - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - /** * @hibernate.property column="content_in_use" length="1" * */ @@ -406,21 +328,6 @@ } /** - * @hibernate.set lazy="true" inverse="false" cascade="all-delete-orphan" - * @hibernate.collection-key column="wiki_uid" - * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.wiki.model.WikiAttachment" - * - */ - - public Set getWikiAttachments() { - return this.wikiAttachments; - } - - public void setWikiAttachments(Set wikiAttachments) { - this.wikiAttachments = wikiAttachments; - } - - /** * @hibernate.set lazy="true" inverse="true" cascade="none" * @hibernate.collection-key column="wiki_uid" * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.wiki.model.WikiSession" @@ -500,9 +407,8 @@ return result; } - public static Wiki newInstance(Wiki fromContent, Long toContentId, IToolContentHandler wikiToolContentHandler) { + public static Wiki newInstance(Wiki fromContent, Long toContentId) { Wiki toContent = new Wiki(); - fromContent.toolContentHandler = wikiToolContentHandler; toContent = (Wiki) fromContent.clone(); toContent.setToolContentId(toContentId); toContent.setCreateDate(new Date()); @@ -516,18 +422,6 @@ wiki = (Wiki) super.clone(); wiki.setUid(null); - if (wikiAttachments != null) { - // create a copy of the attachments - Iterator iter = wikiAttachments.iterator(); - Set set = new HashSet(); - while (iter.hasNext()) { - WikiAttachment originalFile = (WikiAttachment) iter.next(); - WikiAttachment newFile = (WikiAttachment) originalFile.clone(); - set.add(newFile); - } - wiki.wikiAttachments = set; - } - if (wikiPages != null) { Set newPages = new HashSet(); for (WikiPage page : wikiPages) { @@ -552,12 +446,4 @@ } return wiki; } - - public IToolContentHandler getToolContentHandler() { - return toolContentHandler; - } - - public void setToolContentHandler(IToolContentHandler toolContentHandler) { - this.toolContentHandler = toolContentHandler; - } } Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/WikiAttachment.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/IWikiService.java =================================================================== diff -u -rb19488eb4b80f01e7dcc599a71a6f8bff477c68c -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/IWikiService.java (.../IWikiService.java) (revision b19488eb4b80f01e7dcc599a71a6f8bff477c68c) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/IWikiService.java (.../IWikiService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -30,7 +30,6 @@ import org.lamsfoundation.lams.events.IEventNotificationService; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.wiki.model.Wiki; -import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment; import org.lamsfoundation.lams.tool.wiki.model.WikiPage; import org.lamsfoundation.lams.tool.wiki.model.WikiPageContent; import org.lamsfoundation.lams.tool.wiki.model.WikiSession; @@ -76,34 +75,6 @@ public Wiki getWikiByContentId(Long toolContentID); /** - * Uploads a file to a wiki - * - * @param toolContentId - * @param file - * @param type - * @return - */ - public WikiAttachment uploadFileToContent(Long toolContentId, FormFile file, String type); - - /** - * Deletes a file from the repository - * - * @param uuid - * @param versionID - */ - public void deleteFromRepository(Long uuid, Long versionID) throws WikiException; - - /** - * Deletes an instruction file from the repository - * - * @param contentID - * @param uuid - * @param versionID - * @param type - */ - public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type); - - /** * Saves or updates a wiki instance * * @param wiki Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiContentVersionFilter.java =================================================================== diff -u --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiContentVersionFilter.java (revision 0) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiContentVersionFilter.java (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -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 + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool.wiki.service; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.wiki.model.Wiki; + +/** + * Import filter class for different version of Wiki content. + */ +public class WikiContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20130716 version content to 20140102 version tool server. + */ + public void up20130716To20140102() { + this.removeField(Wiki.class, "runOffline"); + this.removeField(Wiki.class, "onlineInstructions"); + this.removeField(Wiki.class, "offlineInstructions"); + this.removeField(Wiki.class, "wikiAttachments"); + } +} Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java =================================================================== diff -u -r33da76d05725a84e191a5f6dca50b394cca3c1ee -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java (.../WikiService.java) (revision 33da76d05725a84e191a5f6dca50b394cca3c1ee) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java (.../WikiService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -24,8 +24,6 @@ package org.lamsfoundation.lams.tool.wiki.service; -import java.io.FileNotFoundException; -import java.io.IOException; import java.util.Arrays; import java.util.Date; import java.util.HashSet; @@ -35,20 +33,8 @@ import java.util.Set; import java.util.SortedMap; -import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.apache.struts.upload.FormFile; -import org.lamsfoundation.lams.contentrepository.AccessDeniedException; -import org.lamsfoundation.lams.contentrepository.ICredentials; -import org.lamsfoundation.lams.contentrepository.ITicket; -import org.lamsfoundation.lams.contentrepository.InvalidParameterException; -import org.lamsfoundation.lams.contentrepository.LoginException; -import org.lamsfoundation.lams.contentrepository.NodeKey; -import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; -import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; -import org.lamsfoundation.lams.contentrepository.service.IRepositoryService; -import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; import org.lamsfoundation.lams.events.IEventNotificationService; import org.lamsfoundation.lams.learning.service.ILearnerService; import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; @@ -67,30 +53,25 @@ import org.lamsfoundation.lams.tool.exception.SessionDataExistsException; import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.service.ILamsToolService; -import org.lamsfoundation.lams.tool.wiki.dao.IWikiAttachmentDAO; import org.lamsfoundation.lams.tool.wiki.dao.IWikiDAO; import org.lamsfoundation.lams.tool.wiki.dao.IWikiPageContentDAO; import org.lamsfoundation.lams.tool.wiki.dao.IWikiPageDAO; import org.lamsfoundation.lams.tool.wiki.dao.IWikiSessionDAO; import org.lamsfoundation.lams.tool.wiki.dao.IWikiUserDAO; import org.lamsfoundation.lams.tool.wiki.model.Wiki; -import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment; import org.lamsfoundation.lams.tool.wiki.model.WikiPage; import org.lamsfoundation.lams.tool.wiki.model.WikiPageContent; import org.lamsfoundation.lams.tool.wiki.model.WikiSession; import org.lamsfoundation.lams.tool.wiki.model.WikiUser; import org.lamsfoundation.lams.tool.wiki.util.WikiConstants; import org.lamsfoundation.lams.tool.wiki.util.WikiException; -import org.lamsfoundation.lams.tool.wiki.util.WikiToolContentHandler; import org.lamsfoundation.lams.tool.wiki.util.diff.Diff; import org.lamsfoundation.lams.tool.wiki.util.diff.Difference; import org.lamsfoundation.lams.tool.wiki.web.forms.WikiPageForm; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; -import org.lamsfoundation.lams.util.FileUtil; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; -import org.lamsfoundation.lams.util.audit.IAuditService; /** * An implementation of the IWikiService interface. @@ -111,18 +92,12 @@ private IWikiUserDAO wikiUserDAO = null; - private IWikiAttachmentDAO wikiAttachmentDAO = null; - private ILearnerService learnerService; private ILamsToolService toolService; private IToolContentHandler wikiToolContentHandler = null; - private IRepositoryService repositoryService = null; - - private IAuditService auditService = null; - private IExportToolContentService exportContentService; private ICoreNotebookService coreNotebookService; @@ -137,7 +112,6 @@ public WikiService() { super(); - // TODO Auto-generated constructor stub } /* ************ Methods from ToolSessionManager ************* */ @@ -292,29 +266,11 @@ // create the fromContent using the default tool content fromContent = getDefaultContent(); } - Wiki toContent = Wiki.newInstance(fromContent, toContentId, wikiToolContentHandler); + Wiki toContent = Wiki.newInstance(fromContent, toContentId); insertUnsavedWikiContent(toContent); } - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Wiki wiki = wikiDAO.getByContentId(toolContentId); - if (wiki == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - wiki.setDefineLater(value); - wikiDAO.saveOrUpdate(wiki); - } - - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Wiki wiki = wikiDAO.getByContentId(toolContentId); - if (wiki == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - wiki.setRunOffline(value); - wikiDAO.saveOrUpdate(wiki); - } - public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { // TODO Auto-generated method stub @@ -339,8 +295,7 @@ // set ResourceToolContentHandler as null to avoid copy file node in // repository again. - wiki = Wiki.newInstance(wiki, toolContentId, null); - wiki.setToolContentHandler(null); + wiki = Wiki.newInstance(wiki, toolContentId); wiki.setWikiSessions(null); // Go through each page add page content and remove parent references @@ -361,13 +316,7 @@ mainPage.setTitle(wiki.getMainPage().getTitle()); wiki.setMainPage(mainPage); - Set atts = wiki.getWikiAttachments(); - for (WikiAttachment att : atts) { - att.setWiki(null); - } try { - exportContentService - .registerFileClassForExport(WikiAttachment.class.getName(), "fileUuid", "fileVersionId"); exportContentService.exportToolContent(toolContentId, wiki, wikiToolContentHandler, rootPath); } catch (ExportToolContentException e) { throw new ToolException(e); @@ -383,9 +332,9 @@ public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, String toVersion) throws ToolException { try { - exportContentService.registerFileClassForImport(WikiAttachment.class.getName(), "fileUuid", - "fileVersionId", "fileName", "fileType", null, null); - + // register version filter class + exportContentService.registerImportVersionFilterClass(WikiContentVersionFilter.class); + Object toolPOJO = exportContentService.importToolContent(toolContentPath, wikiToolContentHandler, fromVersion, toVersion); if (!(toolPOJO instanceof Wiki)) { @@ -566,7 +515,7 @@ } Wiki defaultContent = getDefaultContent(); - Wiki newContent = Wiki.newInstance(defaultContent, newContentID, wikiToolContentHandler); + Wiki newContent = Wiki.newInstance(defaultContent, newContentID); insertUnsavedWikiContent(newContent); @@ -637,27 +586,6 @@ return wikiUserDAO.getByUID(uid); } - public WikiAttachment uploadFileToContent(Long toolContentId, FormFile file, String type) { - if (file == null || StringUtils.isEmpty(file.getFileName())) { - throw new WikiException("Could not find upload file: " + file); - } - - NodeKey nodeKey = processFile(file, type); - - WikiAttachment attachment = new WikiAttachment(nodeKey.getVersion(), type, file.getFileName(), nodeKey - .getUuid(), new Date()); - return attachment; - } - - public void deleteFromRepository(Long uuid, Long versionID) throws WikiException { - ITicket ticket = getRepositoryLoginTicket(); - try { - repositoryService.deleteVersion(ticket, uuid, versionID); - } catch (Exception e) { - throw new WikiException("Exception occured while deleting files from" + " the repository " + e.getMessage()); - } - } - /** * (non-Javadoc) * @@ -751,11 +679,6 @@ wikiPageDAO.saveOrUpdate(wikiPage); } - public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type) { - wikiDAO.deleteInstructionFile(contentID, uuid, versionID, type); - - } - public void saveOrUpdateWiki(Wiki wiki) { wikiDAO.saveOrUpdate(wiki); } @@ -807,14 +730,6 @@ saveOrUpdateWikiUser(wikiUser); return wikiUser; } - - public IAuditService getAuditService() { - return auditService; - } - - public void setAuditService(IAuditService auditService) { - this.auditService = auditService; - } @Override public boolean isGroupedActivity(long toolContentID) { @@ -826,55 +741,8 @@ return toolService.getLearnerContentFolder(toolSessionId, userId); } - private NodeKey processFile(FormFile file, String type) { - NodeKey node = null; - if (file != null && !StringUtils.isEmpty(file.getFileName())) { - String fileName = file.getFileName(); - try { - node = getWikiToolContentHandler().uploadFile(file.getInputStream(), fileName, file.getContentType(), - type); - } catch (InvalidParameterException e) { - throw new WikiException("InvalidParameterException occured while trying to upload File" - + e.getMessage()); - } catch (FileNotFoundException e) { - throw new WikiException("FileNotFoundException occured while trying to upload File" + e.getMessage()); - } catch (RepositoryCheckedException e) { - throw new WikiException("RepositoryCheckedException occured while trying to upload File" - + e.getMessage()); - } catch (IOException e) { - throw new WikiException("IOException occured while trying to upload File" + e.getMessage()); - } - } - return node; - } - /** - * This method verifies the credentials of the Wiki 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 SubmitFilesException - */ - private ITicket getRepositoryLoginTicket() throws WikiException { - ICredentials credentials = new SimpleCredentials(WikiToolContentHandler.repositoryUser, - WikiToolContentHandler.repositoryId); - try { - ITicket ticket = repositoryService.login(credentials, WikiToolContentHandler.repositoryWorkspaceName); - return ticket; - } catch (AccessDeniedException ae) { - throw new WikiException("Access Denied to repository." + ae.getMessage()); - } catch (WorkspaceNotFoundException we) { - throw new WikiException("Workspace not found." + we.getMessage()); - } catch (LoginException e) { - throw new WikiException("Login failed." + e.getMessage()); - } - } - - /** - * * @param learnerId * @param toolSessionId * @return @@ -934,9 +802,6 @@ wiki.setInstructions(WebUtil.convertNewlines((String) importValues .get(ToolContentImport102Manager.CONTENT_BODY))); wiki.setLockOnFinished(Boolean.TRUE); - wiki.setOfflineInstructions(null); - wiki.setOnlineInstructions(null); - wiki.setRunOffline(Boolean.FALSE); wiki.setTitle((String) importValues.get(ToolContentImport102Manager.CONTENT_TITLE)); wiki.setToolContentId(toolContentId); wiki.setUpdateDate(now); @@ -948,9 +813,6 @@ wiki.setMaximumEdits(0); wiki.setMinimumEdits(0); - // leave as empty, no need to set them to anything. - // setWikiAttachments(Set wikiAttachments); - // setWikiSessions(Set wikiSessions); wikiDAO.saveOrUpdate(wiki); } @@ -974,14 +836,6 @@ // ========================================================================================= /* ********** Used by Spring to "inject" the linked objects ************* */ - public IWikiAttachmentDAO getWikiAttachmentDAO() { - return wikiAttachmentDAO; - } - - public void setWikiAttachmentDAO(IWikiAttachmentDAO attachmentDAO) { - wikiAttachmentDAO = attachmentDAO; - } - public IWikiDAO getWikiDAO() { return wikiDAO; } @@ -1106,14 +960,6 @@ this.lessonService = lessonService; } - public IRepositoryService getRepositoryService() { - return repositoryService; - } - - public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { return getWikiOutputFactory().getSupportedDefinitionClasses(definitionType); } Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/util/WikiConstants.java =================================================================== diff -u -r31d297d14df060ae066a55e125b5025ed713d681 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/util/WikiConstants.java (.../WikiConstants.java) (revision 31d297d14df060ae066a55e125b5025ed713d681) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/util/WikiConstants.java (.../WikiConstants.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -33,8 +33,6 @@ public static final Integer SESSION_COMPLETED = new Integer(2); public static final String AUTHORING_DEFAULT_TAB = "1"; - public static final String ATTACHMENT_LIST = "attachmentList"; - public static final String DELETED_ATTACHMENT_LIST = "deletedAttachmentList"; public static final String AUTH_SESSION_ID_COUNTER = "authoringSessionIdCounter"; public static final String AUTH_SESSION_ID = "authoringSessionId"; Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/AuthoringAction.java =================================================================== diff -u -r4161978f8d7ac38d8de94e68128ae300b0892e9d -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 4161978f8d7ac38d8de94e68128ae300b0892e9d) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -49,7 +49,6 @@ import org.lamsfoundation.lams.tool.wiki.dto.WikiPageContentDTO; import org.lamsfoundation.lams.tool.wiki.dto.WikiPageDTO; import org.lamsfoundation.lams.tool.wiki.model.Wiki; -import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment; import org.lamsfoundation.lams.tool.wiki.model.WikiPage; import org.lamsfoundation.lams.tool.wiki.model.WikiPageContent; import org.lamsfoundation.lams.tool.wiki.model.WikiUser; @@ -91,16 +90,6 @@ private static final String KEY_MODE = "mode"; - private static final String KEY_ONLINE_FILES = "onlineFiles"; - - private static final String KEY_OFFLINE_FILES = "offlineFiles"; - - private static final String KEY_UNSAVED_ONLINE_FILES = "unsavedOnlineFiles"; - - private static final String KEY_UNSAVED_OFFLINE_FILES = "unsavedOfflineFiles"; - - private static final String KEY_DELETED_FILES = "deletedFiles"; - /** * Default method when no dispatch parameter is specified. It is expected that the parameter * toolContentID will be passed in. This will be used to retrieve content for this tool. @@ -264,24 +253,6 @@ ToolAccessMode mode = (ToolAccessMode) map.get(AuthoringAction.KEY_MODE); updateWiki(wiki, authForm, mode); - // remove attachments marked for deletion. - Set attachments = wiki.getWikiAttachments(); - if (attachments == null) { - attachments = new HashSet(); - } - - for (WikiAttachment att : getAttList(AuthoringAction.KEY_DELETED_FILES, map)) { - // remove from db, leave in repository - attachments.remove(att); - } - - // add unsaved attachments - attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map)); - attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map)); - - // set attachments in case it didn't exist - wiki.setWikiAttachments(attachments); - // set the update date wiki.setUpdateDate(new Date()); @@ -300,169 +271,8 @@ return mapping.findForward("success"); } - public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return uploadFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request); - } - public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return uploadFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request); - } - - public ActionForward deleteOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return deleteFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request); - } - - public ActionForward deleteOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return deleteFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request); - } - - public ActionForward removeUnsavedOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return removeUnsaved(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request); - } - - public ActionForward removeUnsavedOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) { - return removeUnsaved(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request); - } - - /* ========== Private Methods ********** */ - /** - * Upload a file - */ - private ActionForward uploadFile(ActionMapping mapping, AuthoringForm authForm, String type, - HttpServletRequest request) { - SessionMap map = getSessionMap(request, authForm); - - FormFile file; - List unsavedFiles; - List savedFiles; - if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { - file = authForm.getOfflineFile(); - unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map); - - savedFiles = getAttList(AuthoringAction.KEY_OFFLINE_FILES, map); - } else { - file = authForm.getOnlineFile(); - unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map); - - savedFiles = getAttList(AuthoringAction.KEY_ONLINE_FILES, map); - } - - // validate file max size - ActionMessages errors = new ActionMessages(); - FileValidatorUtil.validateFileSize(file, true, errors); - if (!errors.isEmpty()) { - request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map); - this.saveErrors(request, errors); - return mapping.findForward("success"); - } - - if (file.getFileName().length() != 0) { - - // upload file to repository - WikiAttachment newAtt = wikiService.uploadFileToContent( - (Long) map.get(AuthoringAction.KEY_TOOL_CONTENT_ID), file, type); - - // Add attachment to unsavedFiles - // check to see if file with same name exists - WikiAttachment currAtt; - Iterator iter = savedFiles.iterator(); - while (iter.hasNext()) { - currAtt = (WikiAttachment) iter.next(); - if (StringUtils.equals(currAtt.getFileName(), newAtt.getFileName()) - && StringUtils.equals(currAtt.getFileType(), newAtt.getFileType())) { - // move from this this list to deleted list. - getAttList(AuthoringAction.KEY_DELETED_FILES, map).add(currAtt); - iter.remove(); - break; - } - } - unsavedFiles.add(newAtt); - - request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map); - request.setAttribute("unsavedChanges", new Boolean(true)); - } - return mapping.findForward("success"); - } - - /** - * Delete a file - * - * @param mapping - * @param authForm - * @param type - * @param request - * @return - */ - private ActionForward deleteFile(ActionMapping mapping, AuthoringForm authForm, String type, - HttpServletRequest request) { - SessionMap map = getSessionMap(request, authForm); - - List fileList; - if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { - fileList = getAttList(AuthoringAction.KEY_OFFLINE_FILES, map); - } else { - fileList = getAttList(AuthoringAction.KEY_ONLINE_FILES, map); - } - - Iterator iter = fileList.iterator(); - - while (iter.hasNext()) { - WikiAttachment att = (WikiAttachment) iter.next(); - - if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) { - // move to delete file list, deleted at next updateContent - getAttList(AuthoringAction.KEY_DELETED_FILES, map).add(att); - - // remove from this list - iter.remove(); - break; - } - } - - request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map); - request.setAttribute("unsavedChanges", new Boolean(true)); - - return mapping.findForward("success"); - } - - private ActionForward removeUnsaved(ActionMapping mapping, AuthoringForm authForm, String type, - HttpServletRequest request) { - SessionMap map = getSessionMap(request, authForm); - - List unsavedFiles; - - if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { - unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map); - } else { - unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map); - } - - Iterator iter = unsavedFiles.iterator(); - while (iter.hasNext()) { - WikiAttachment att = (WikiAttachment) iter.next(); - - if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) { - // delete from repository and list - wikiService.deleteFromRepository(att.getFileUuid(), att.getFileVersionId()); - iter.remove(); - break; - } - } - - request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map); - request.setAttribute("unsavedChanges", new Boolean(true)); - - return mapping.findForward("success"); - } - - /** * Updates Wiki content using AuthoringForm inputs. * * @param authForm @@ -481,8 +291,6 @@ wiki.setMainPage(mainPage); if (mode.isAuthor()) { // Teacher cannot modify following - wiki.setOfflineInstructions(authForm.getOfflineInstruction()); - wiki.setOnlineInstructions(authForm.getOnlineInstruction()); wiki.setLockOnFinished(authForm.isLockOnFinished()); wiki.setAllowLearnerAttachImages(authForm.isAllowLearnerAttachImages()); wiki.setAllowLearnerCreatePages(authForm.isAllowLearnerCreatePages()); @@ -503,8 +311,6 @@ * @return */ private void updateAuthForm(AuthoringForm authForm, Wiki wiki) { - authForm.setOnlineInstruction(wiki.getOnlineInstructions()); - authForm.setOfflineInstruction(wiki.getOfflineInstructions()); authForm.setLockOnFinished(wiki.isLockOnFinished()); authForm.setAllowLearnerAttachImages(wiki.isAllowLearnerAttachImages()); authForm.setAllowLearnerCreatePages(wiki.isAllowLearnerCreatePages()); @@ -531,24 +337,7 @@ map.put(AuthoringAction.KEY_MODE, mode); map.put(AuthoringAction.KEY_CONTENT_FOLDER_ID, contentFolderID); map.put(AuthoringAction.KEY_TOOL_CONTENT_ID, toolContentID); - map.put(AuthoringAction.KEY_ONLINE_FILES, new LinkedList()); - map.put(AuthoringAction.KEY_OFFLINE_FILES, new LinkedList()); - map.put(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, new LinkedList()); - map.put(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, new LinkedList()); - map.put(AuthoringAction.KEY_DELETED_FILES, new LinkedList()); - Iterator iter = wiki.getWikiAttachments().iterator(); - while (iter.hasNext()) { - WikiAttachment attachment = (WikiAttachment) iter.next(); - String type = attachment.getFileType(); - if (type.equals(IToolContentHandler.TYPE_OFFLINE)) { - getAttList(AuthoringAction.KEY_OFFLINE_FILES, map).add(attachment); - } - if (type.equals(IToolContentHandler.TYPE_ONLINE)) { - getAttList(AuthoringAction.KEY_ONLINE_FILES, map).add(attachment); - } - } - return map; } @@ -567,18 +356,6 @@ } /** - * Retrieves a List of attachments from the map using the key. - * - * @param key - * @param map - * @return - */ - private List getAttList(String key, SessionMap map) { - List list = (List) map.get(key); - return list; - } - - /** * Retrieve the SessionMap from the HttpSession. * * @param request Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java =================================================================== diff -u -rb19488eb4b80f01e7dcc599a71a6f8bff477c68c -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java (.../LearningAction.java) (revision b19488eb4b80f01e7dcc599a71a6f8bff477c68c) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java (.../LearningAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -77,7 +77,6 @@ * @struts.action path="/learning" parameter="dispatch" scope="request" * name="learningForm" validate="false" * @struts.action-forward name="wiki" path="tiles:/learning/main" - * @struts.action-forward name="runOffline" path="tiles:/learning/runOffline" * @struts.action-forward name="compareWiki" path="/pages/wiki/compare.jsp" * @struts.action-forward name="viewWiki" path="/pages/wiki/viewWiki.jsp" * @struts.action-forward name="defineLater" path="tiles:/learning/defineLater" @@ -141,11 +140,6 @@ LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionID, request, getServlet() .getServletContext()); - - // check runOffline - if (wiki.isRunOffline()) { - return mapping.findForward("runOffline"); - } // get the user WikiUser wikiUser; Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java =================================================================== diff -u -rb33e717f9a734d318eefab07a17234f07c770c92 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision b33e717f9a734d318eefab07a17234f07c770c92) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -113,35 +113,6 @@ } /** - * Do an offline export - */ - @Override - protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, - Cookie[] cookies) { - if (toolContentID == null && toolSessionID == null) { - ExportServlet.logger.error("Tool content Id or and session Id are null. Unable to activity title"); - } else { - if (wikiService == null) { - wikiService = WikiServiceProxy.getWikiService(getServletContext()); - } - - Wiki content = null; - if (toolContentID != null) { - content = wikiService.getWikiByContentId(toolContentID); - } else { - WikiSession session = wikiService.getSessionBySessionId(toolSessionID); - if (session != null) { - content = session.getWiki(); - } - } - if (content != null) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); - } - - /** * Do export for learners, outputs the wiki pages into one page which seperates each page into divs which are * displayed onclick * Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/wikiApplicationContext.xml =================================================================== diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/wikiApplicationContext.xml (.../wikiApplicationContext.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e) +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/wikiApplicationContext.xml (.../wikiApplicationContext.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -16,22 +16,19 @@ - - - - + @@ -45,8 +42,6 @@ PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED - PROPAGATION_REQUIRED - PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED @@ -78,10 +73,6 @@
- - - - Index: lams_tool_wiki/web/WEB-INF/tiles-defs.xml =================================================================== diff -u -rd56929f06ad90a63082d514e6521adc175f3de27 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision d56929f06ad90a63082d514e6521adc175f3de27) +++ lams_tool_wiki/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -86,10 +86,6 @@ - - - - Index: lams_tool_wiki/web/includes/javascript/authoring.js =================================================================== diff -u -r31d297d14df060ae066a55e125b5025ed713d681 -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/web/includes/javascript/authoring.js (.../authoring.js) (revision 31d297d14df060ae066a55e125b5025ed713d681) +++ lams_tool_wiki/web/includes/javascript/authoring.js (.../authoring.js) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -25,7 +25,3 @@ finishButtonDiv.style.display = "block"; } } -function deleteAttachment(dispatch, uuid) { - document.authoringForm.deleteFileUuid.value = uuid; - submitWiki(dispatch); -} Index: lams_tool_wiki/web/pages/authoring/authoring.jsp =================================================================== diff -u -r4161978f8d7ac38d8de94e68128ae300b0892e9d -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 4161978f8d7ac38d8de94e68128ae300b0892e9d) +++ lams_tool_wiki/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -19,7 +19,6 @@ - @@ -38,9 +37,6 @@
- - -

@@ -61,8 +57,6 @@ -
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/web/pages/authoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/web/pages/learning/runOffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/web/pages/monitoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_wiki/web/pages/monitoring/monitoring.jsp =================================================================== diff -u -r1082bdcc357c105126a5641cecc68acfa645b66b -r8b97231e320c0c5b674f07c14da711f232ba9e1c --- lams_tool_wiki/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 1082bdcc357c105126a5641cecc68acfa645b66b) +++ lams_tool_wiki/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c) @@ -4,9 +4,8 @@