Index: lams_tool_kaltura/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.5 -r1.6 --- lams_tool_kaltura/conf/language/lams/ApplicationResources_en_AU.properties 9 Apr 2013 12:46:10 -0000 1.5 +++ lams_tool_kaltura/conf/language/lams/ApplicationResources_en_AU.properties 17 Jan 2014 22:04:39 -0000 1.6 @@ -33,7 +33,6 @@ link.delete =Delete message.unsavedChanges =Page contains unsaved changes message.defineLaterSet =Please wait for the instructor to complete the contents of this activity -message.runOfflineSet =This activity is not being done on the computer. Please see your instructor for details. pageTitle.monitoring =Kaltura Monitoring button.summary =Summary button.editActivity =Edit Activity Index: lams_tool_kaltura/conf/middlegen/lams_tool_lakaltura11-prefs.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/conf/middlegen/lams_tool_lakaltura11-prefs.properties,v diff -u -r1.1 -r1.2 --- lams_tool_kaltura/conf/middlegen/lams_tool_lakaltura11-prefs.properties 15 Nov 2012 14:39:33 -0000 1.1 +++ lams_tool_kaltura/conf/middlegen/lams_tool_lakaltura11-prefs.properties 17 Jan 2014 22:04:39 -0000 1.2 @@ -44,8 +44,6 @@ hibernate.tables.tl_lakalt11_kaltura.columns.offline_instructions.java-type=java.lang.String hibernate.tables.tl_lakalt11_kaltura.columns.online_instructions.java-name=onlineInstructions hibernate.tables.tl_lakalt11_kaltura.columns.online_instructions.java-type=java.lang.String -hibernate.tables.tl_lakalt11_kaltura.columns.run_offline.java-name=runOffline -hibernate.tables.tl_lakalt11_kaltura.columns.run_offline.java-type=java.lang.Boolean hibernate.tables.tl_lakalt11_kaltura.columns.title.inctostring=true hibernate.tables.tl_lakalt11_kaltura.columns.title.java-name=title hibernate.tables.tl_lakalt11_kaltura.columns.title.java-type=java.lang.String Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/kalturaApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/kalturaApplicationContext.xml,v diff -u -r1.3 -r1.4 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/kalturaApplicationContext.xml 3 Apr 2013 13:18:39 -0000 1.3 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/kalturaApplicationContext.xml 17 Jan 2014 22:04:38 -0000 1.4 @@ -25,7 +25,6 @@ - @@ -41,7 +40,6 @@ - @@ -60,8 +58,6 @@ PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED - PROPAGATION_REQUIRED - PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED @@ -100,10 +96,6 @@ - - - - Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/IKalturaAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/IKalturaDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/IKalturaDAO.java,v diff -u -r1.1 -r1.2 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/IKalturaDAO.java 15 Nov 2012 14:39:28 -0000 1.1 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/IKalturaDAO.java 17 Jan 2014 22:04:39 -0000 1.2 @@ -37,8 +37,6 @@ void saveOrUpdate(Kaltura toContent); - void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type); - void releaseFromCache(Object o); } Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/hibernate/KalturaAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/hibernate/KalturaDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/hibernate/KalturaDAO.java,v diff -u -r1.1 -r1.2 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/hibernate/KalturaDAO.java 15 Nov 2012 14:39:30 -0000 1.1 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dao/hibernate/KalturaDAO.java 17 Jan 2014 22:04:39 -0000 1.2 @@ -26,12 +26,9 @@ import java.util.List; -import org.hibernate.FlushMode; import org.lamsfoundation.lams.dao.hibernate.BaseDAO; import org.lamsfoundation.lams.tool.kaltura.dao.IKalturaDAO; import org.lamsfoundation.lams.tool.kaltura.model.Kaltura; -import org.lamsfoundation.lams.tool.kaltura.model.KalturaAttachment; -import org.springframework.orm.hibernate3.HibernateTemplate; /** * DAO for accessing the Kaltura objects - Hibernate specific code. @@ -40,9 +37,6 @@ private static final String FIND_FORUM_BY_CONTENTID = "from Kaltura kaltura where kaltura.toolContentId=?"; - private static final String FIND_INSTRUCTION_FILE = "from " + KalturaAttachment.class.getName() - + " as i where tool_content_id=? and i.file_uuid=? and i.file_version_id=? and i.file_type=?"; - public Kaltura getByContentId(Long toolContentId) { List list = getHibernateTemplate().find(KalturaDAO.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(KalturaDAO.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) { - KalturaAttachment file = (KalturaAttachment) list.get(0); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(file); - templ.flush(); - } - } - - } - public void releaseFromCache(Object o) { getSession().evict(o); Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dbupdates/patch20140102.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dbupdates/patch20140102.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/dbupdates/patch20140102.sql 17 Jan 2014 22:04:39 -0000 1.1 @@ -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_lakalt11_kaltura DROP COLUMN online_instructions; +ALTER TABLE tl_lakalt11_kaltura DROP COLUMN offline_instructions; +ALTER TABLE tl_lakalt11_kaltura DROP COLUMN run_offline; +DROP TABLE IF EXISTS tl_lakalt11_attachment; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lakalt11'; + +----------------------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_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/model/Kaltura.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/model/Kaltura.java,v diff -u -r1.2 -r1.3 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/model/Kaltura.java 10 Jun 2013 09:13:53 -0000 1.2 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/model/Kaltura.java 17 Jan 2014 22:04:39 -0000 1.3 @@ -61,8 +61,6 @@ private String instructions; - private boolean runOffline; - private boolean lockOnFinished; private boolean allowContributeVideos; @@ -75,10 +73,6 @@ private boolean allowRatings; - private String onlineInstructions; - - private String offlineInstructions; - private boolean contentInUse; private boolean defineLater; @@ -91,40 +85,16 @@ private String reflectInstructions; - private Set kalturaAttachments; - private Set kalturaSessions; private Set kalturaItems; - // *********** NON Persisit fields - private IToolContentHandler toolContentHandler; - - private List onlineFileList; - - private List offlineFileList; - // Constructors /** default constructor */ public Kaltura() { kalturaItems = new HashSet(); } - - public void toDTO() { - onlineFileList = new ArrayList(); - offlineFileList = new ArrayList(); - Set fileSet = this.getKalturaAttachments(); - if (fileSet != null) { - for (KalturaAttachment file : fileSet) { - if (StringUtils.equalsIgnoreCase(file.getFileType(), IToolContentHandler.TYPE_OFFLINE)) { - offlineFileList.add(file); - } else { - onlineFileList.add(file); - } - } - } - } // Property accessors /** @@ -200,17 +170,6 @@ } /** - * @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" */ public boolean isLockOnFinished() { @@ -278,28 +237,6 @@ } /** - * @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" */ public boolean isContentInUse() { @@ -370,19 +307,6 @@ } /** - * @hibernate.set lazy="true" inverse="false" cascade="all-delete-orphan" - * @hibernate.collection-key column="kaltura_uid" - * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.kaltura.model.KalturaAttachment" - */ - public Set getKalturaAttachments() { - return kalturaAttachments; - } - - public void setKalturaAttachments(Set kalturaAttachments) { - this.kalturaAttachments = kalturaAttachments; - } - - /** * @hibernate.set lazy="true" inverse="true" cascade="none" * @hibernate.collection-key column="kaltura_uid" * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.kaltura.model.KalturaSession" @@ -445,10 +369,8 @@ return result; } - public static Kaltura newInstance(Kaltura fromContent, Long toContentId, - IToolContentHandler kalturaToolContentHandler) { + public static Kaltura newInstance(Kaltura fromContent, Long toContentId) { Kaltura toContent = new Kaltura(); - fromContent.toolContentHandler = kalturaToolContentHandler; toContent = (Kaltura) fromContent.clone(); toContent.setToolContentId(toContentId); toContent.setCreateDate(new Date()); @@ -484,18 +406,6 @@ } kaltura.kalturaItems = set; } - - if (kalturaAttachments != null) { - // create a copy of the attachments - Iterator iter = kalturaAttachments.iterator(); - Set set = new HashSet(); - while (iter.hasNext()) { - KalturaAttachment originalFile = (KalturaAttachment) iter.next(); - KalturaAttachment newFile = (KalturaAttachment) originalFile.clone(); - set.add(newFile); - } - kaltura.kalturaAttachments = set; - } // clone KalturaUser as well if (createdBy != null) { @@ -511,28 +421,4 @@ return kaltura; } - public IToolContentHandler getToolContentHandler() { - return toolContentHandler; - } - - public void setToolContentHandler(IToolContentHandler toolContentHandler) { - this.toolContentHandler = toolContentHandler; - } - - 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; - } - } Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/model/KalturaAttachment.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/IKalturaService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/IKalturaService.java,v diff -u -r1.2 -r1.3 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/IKalturaService.java 16 Nov 2012 13:47:56 -0000 1.2 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/IKalturaService.java 17 Jan 2014 22:04:39 -0000 1.3 @@ -30,7 +30,6 @@ import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.kaltura.dto.AverageRatingDTO; import org.lamsfoundation.lams.tool.kaltura.model.Kaltura; -import org.lamsfoundation.lams.tool.kaltura.model.KalturaAttachment; import org.lamsfoundation.lams.tool.kaltura.model.KalturaItem; import org.lamsfoundation.lams.tool.kaltura.model.KalturaSession; import org.lamsfoundation.lams.tool.kaltura.model.KalturaUser; @@ -69,28 +68,6 @@ Kaltura getKalturaByContentId(Long toolContentID); /** - * @param toolContentId - * @param file - * @param type - * @return - */ - KalturaAttachment uploadFileToContent(Long toolContentId, FormFile file, String type); - - /** - * @param uuid - * @param versionID - */ - void deleteFromRepository(Long uuid, Long versionID) throws KalturaException; - - /** - * @param contentID - * @param uuid - * @param versionID - * @param type - */ - void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type); - - /** * @param kaltura */ void saveOrUpdateKaltura(Kaltura kaltura); Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/KalturaService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/KalturaService.java,v diff -u -r1.4 -r1.5 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/KalturaService.java 29 Jul 2013 23:12:11 -0000 1.4 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/service/KalturaService.java 17 Jan 2014 22:04:39 -0000 1.5 @@ -24,8 +24,6 @@ package org.lamsfoundation.lams.tool.kaltura.service; -import java.io.FileNotFoundException; -import java.io.IOException; import java.sql.Timestamp; import java.util.Date; import java.util.Hashtable; @@ -34,20 +32,8 @@ import java.util.SortedMap; import java.util.TreeSet; -import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; -import org.apache.struts.upload.FormFile; -import org.lamsfoundation.lams.contentrepository.AccessDeniedException; -import org.lamsfoundation.lams.contentrepository.ICredentials; -import org.lamsfoundation.lams.contentrepository.ITicket; -import org.lamsfoundation.lams.contentrepository.InvalidParameterException; -import org.lamsfoundation.lams.contentrepository.LoginException; -import org.lamsfoundation.lams.contentrepository.NodeKey; -import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; -import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; -import org.lamsfoundation.lams.contentrepository.service.IRepositoryService; -import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; import org.lamsfoundation.lams.learning.service.ILearnerService; import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; @@ -64,7 +50,6 @@ import org.lamsfoundation.lams.tool.exception.DataMissingException; import org.lamsfoundation.lams.tool.exception.SessionDataExistsException; import org.lamsfoundation.lams.tool.exception.ToolException; -import org.lamsfoundation.lams.tool.kaltura.dao.IKalturaAttachmentDAO; import org.lamsfoundation.lams.tool.kaltura.dao.IKalturaCommentDAO; import org.lamsfoundation.lams.tool.kaltura.dao.IKalturaDAO; import org.lamsfoundation.lams.tool.kaltura.dao.IKalturaItemDAO; @@ -74,7 +59,6 @@ import org.lamsfoundation.lams.tool.kaltura.dao.IKalturaUserDAO; import org.lamsfoundation.lams.tool.kaltura.dto.AverageRatingDTO; import org.lamsfoundation.lams.tool.kaltura.model.Kaltura; -import org.lamsfoundation.lams.tool.kaltura.model.KalturaAttachment; import org.lamsfoundation.lams.tool.kaltura.model.KalturaComment; import org.lamsfoundation.lams.tool.kaltura.model.KalturaItem; import org.lamsfoundation.lams.tool.kaltura.model.KalturaItemVisitLog; @@ -83,8 +67,8 @@ import org.lamsfoundation.lams.tool.kaltura.model.KalturaUser; import org.lamsfoundation.lams.tool.kaltura.util.KalturaConstants; import org.lamsfoundation.lams.tool.kaltura.util.KalturaException; +import org.lamsfoundation.lams.tool.kaltura.util.KalturaImportContentVersionFilter; import org.lamsfoundation.lams.tool.kaltura.util.KalturaItemComparator; -import org.lamsfoundation.lams.tool.kaltura.util.KalturaToolContentHandler; import org.lamsfoundation.lams.tool.service.ILamsToolService; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; @@ -117,8 +101,6 @@ private IKalturaUserDAO kalturaUserDao = null; - private IKalturaAttachmentDAO kalturaAttachmentDao = null; - private ILearnerService learnerService; private ILamsToolService toolService; @@ -129,8 +111,6 @@ private IToolContentHandler kalturaToolContentHandler = null; - private IRepositoryService repositoryService = null; - private IAuditService auditService = null; private IExportToolContentService exportContentService; @@ -214,31 +194,11 @@ // create the fromContent using the default tool content fromContent = getDefaultContent(); } - Kaltura toContent = Kaltura.newInstance(fromContent, toContentId, kalturaToolContentHandler); + Kaltura toContent = Kaltura.newInstance(fromContent, toContentId); kalturaDao.saveOrUpdate(toContent); } @Override - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Kaltura kaltura = kalturaDao.getByContentId(toolContentId); - if (kaltura == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - kaltura.setDefineLater(value); - kalturaDao.saveOrUpdate(kaltura); - } - - @Override - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Kaltura kaltura = kalturaDao.getByContentId(toolContentId); - if (kaltura == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - kaltura.setRunOffline(value); - kalturaDao.saveOrUpdate(kaltura); - } - - @Override public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { } @@ -255,20 +215,13 @@ // set ResourceToolContentHandler as null to avoid copy file node in // repository again. - kaltura = Kaltura.newInstance(kaltura, toolContentId, null); - kaltura.setToolContentHandler(null); + kaltura = Kaltura.newInstance(kaltura, toolContentId); kaltura.setKalturaSessions(null); - Set atts = kaltura.getKalturaAttachments(); - for (KalturaAttachment att : atts) { - att.setKaltura(null); - } Set items = kaltura.getKalturaItems(); for (KalturaItem item : items) { item.setKalturaUid(null); } try { - exportContentService.registerFileClassForExport(KalturaAttachment.class.getName(), "fileUuid", - "fileVersionId"); exportContentService.exportToolContent(toolContentId, kaltura, kalturaToolContentHandler, rootPath); } catch (ExportToolContentException e) { throw new ToolException(e); @@ -279,9 +232,9 @@ public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, String toVersion) throws ToolException { try { - exportContentService.registerFileClassForImport(KalturaAttachment.class.getName(), "fileUuid", - "fileVersionId", "fileName", "fileType", null, null); - + // register version filter class + exportContentService.registerImportVersionFilterClass(KalturaImportContentVersionFilter.class); + Object toolPOJO = exportContentService.importToolContent(toolContentPath, kalturaToolContentHandler, fromVersion, toVersion); if (!(toolPOJO instanceof Kaltura)) { @@ -525,7 +478,7 @@ Kaltura defaultContent = getDefaultContent(); // create new kaltura using the newContentID Kaltura newContent = new Kaltura(); - newContent = Kaltura.newInstance(defaultContent, newContentID, kalturaToolContentHandler); + newContent = Kaltura.newInstance(defaultContent, newContentID); kalturaDao.saveOrUpdate(newContent); return newContent; } @@ -564,36 +517,6 @@ } @Override - public KalturaAttachment uploadFileToContent(Long toolContentId, FormFile file, String type) { - if (file == null || StringUtils.isEmpty(file.getFileName())) { - throw new KalturaException("Could not find upload file: " + file); - } - - NodeKey nodeKey = processFile(file, type); - - KalturaAttachment attachment = new KalturaAttachment(nodeKey.getVersion(), type, file.getFileName(), - nodeKey.getUuid(), new Date()); - return attachment; - } - - @Override - public void deleteFromRepository(Long uuid, Long versionID) throws KalturaException { - ITicket ticket = getRepositoryLoginTicket(); - try { - repositoryService.deleteVersion(ticket, uuid, versionID); - } catch (Exception e) { - throw new KalturaException("Exception occured while deleting files from" + " the repository " - + e.getMessage()); - } - } - - @Override - public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type) { - kalturaDao.deleteInstructionFile(contentID, uuid, versionID, type); - - } - - @Override public void saveOrUpdateKaltura(Kaltura kaltura) { kalturaDao.saveOrUpdate(kaltura); } @@ -628,53 +551,6 @@ return messageService.getMessage(key, args); } - private NodeKey processFile(FormFile file, String type) { - NodeKey node = null; - if (file != null && !StringUtils.isEmpty(file.getFileName())) { - String fileName = file.getFileName(); - try { - node = kalturaToolContentHandler.uploadFile(file.getInputStream(), fileName, - file.getContentType(), type); - } catch (InvalidParameterException e) { - throw new KalturaException("InvalidParameterException occured while trying to upload File" - + e.getMessage()); - } catch (FileNotFoundException e) { - throw new KalturaException("FileNotFoundException occured while trying to upload File" + e.getMessage()); - } catch (RepositoryCheckedException e) { - throw new KalturaException("RepositoryCheckedException occured while trying to upload File" - + e.getMessage()); - } catch (IOException e) { - throw new KalturaException("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 KalturaException { - ICredentials credentials = new SimpleCredentials(KalturaToolContentHandler.repositoryUser, - KalturaToolContentHandler.repositoryId); - try { - ITicket ticket = repositoryService.login(credentials, KalturaToolContentHandler.repositoryWorkspaceName); - return ticket; - } catch (AccessDeniedException ae) { - throw new KalturaException("Access Denied to repository." + ae.getMessage()); - } catch (WorkspaceNotFoundException we) { - throw new KalturaException("Workspace not found." + we.getMessage()); - } catch (LoginException e) { - throw new KalturaException("Login failed." + e.getMessage()); - } - } - /* ===============Methods implemented from ToolContentImport102Manager =============== */ /** @@ -700,10 +576,6 @@ // ========================================================================================= /* ********** Used by Spring to "inject" the linked objects ************* */ - public void setKalturaAttachmentDao(IKalturaAttachmentDAO attachmentDAO) { - kalturaAttachmentDao = attachmentDAO; - } - public void setKalturaDao(IKalturaDAO kalturaDAO) { this.kalturaDao = kalturaDAO; } @@ -760,10 +632,6 @@ this.coreNotebookService = coreNotebookService; } - public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - public KalturaOutputFactory getKalturaOutputFactory() { return kalturaOutputFactory; } Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/util/KalturaImportContentVersionFilter.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/util/KalturaImportContentVersionFilter.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/util/KalturaImportContentVersionFilter.java 17 Jan 2014 22:04:38 -0000 1.1 @@ -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: KalturaImportContentVersionFilter.java,v 1.1 2014/01/17 22:04:38 andreyb Exp $ */ +package org.lamsfoundation.lams.tool.kaltura.util; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.kaltura.model.Kaltura; + +/** + * Import filter class for different version of Kaltura content. + */ +public class KalturaImportContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20121018 version content to 20140102 version tool server. + */ + public void up20121018To20140102() { + this.removeField(Kaltura.class, "runOffline"); + this.removeField(Kaltura.class, "onlineInstructions"); + this.removeField(Kaltura.class, "offlineInstructions"); + this.removeField(Kaltura.class, "kalturaAttachments"); + } +} Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/AuthoringAction.java,v diff -u -r1.2 -r1.3 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/AuthoringAction.java 3 Apr 2013 13:18:39 -0000 1.2 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/AuthoringAction.java 17 Jan 2014 22:04:38 -0000 1.3 @@ -54,7 +54,6 @@ import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.kaltura.model.Kaltura; -import org.lamsfoundation.lams.tool.kaltura.model.KalturaAttachment; import org.lamsfoundation.lams.tool.kaltura.model.KalturaItem; import org.lamsfoundation.lams.tool.kaltura.model.KalturaUser; import org.lamsfoundation.lams.tool.kaltura.service.IKalturaService; @@ -90,11 +89,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"; @Override protected ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -132,8 +126,6 @@ AuthoringForm authForm = (AuthoringForm) form; authForm.setTitle(kaltura.getTitle()); authForm.setInstructions(kaltura.getInstructions()); - authForm.setOnlineInstruction(kaltura.getOnlineInstructions()); - authForm.setOfflineInstruction(kaltura.getOfflineInstructions()); authForm.setLockOnFinished(kaltura.isLockOnFinished()); authForm.setAllowContributeVideos(kaltura.isAllowContributeVideos()); authForm.setAllowSeeingOtherUsersRecordings(kaltura.isAllowSeeingOtherUsersRecordings()); @@ -152,23 +144,6 @@ sessionMap.put(AuthoringAction.KEY_MODE, mode); sessionMap.put(AuthoringAction.KEY_CONTENT_FOLDER_ID, contentFolderID); sessionMap.put(AuthoringAction.KEY_TOOL_CONTENT_ID, toolContentID); - sessionMap.put(AuthoringAction.KEY_ONLINE_FILES, new LinkedList()); - sessionMap.put(AuthoringAction.KEY_OFFLINE_FILES, new LinkedList()); - sessionMap.put(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, new LinkedList()); - sessionMap.put(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, new LinkedList()); - sessionMap.put(AuthoringAction.KEY_DELETED_FILES, new LinkedList()); - - Iterator iter = kaltura.getKalturaAttachments().iterator(); - while (iter.hasNext()) { - KalturaAttachment attachment = (KalturaAttachment) iter.next(); - String type = attachment.getFileType(); - if (type.equals(IToolContentHandler.TYPE_OFFLINE)) { - getAttList(AuthoringAction.KEY_OFFLINE_FILES, sessionMap).add(attachment); - } - if (type.equals(IToolContentHandler.TYPE_ONLINE)) { - getAttList(AuthoringAction.KEY_ONLINE_FILES, sessionMap).add(attachment); - } - } Set items = kaltura.getKalturaItems(); // init taskList item list @@ -195,8 +170,6 @@ kaltura.setTitle(authForm.getTitle()); kaltura.setInstructions(authForm.getInstructions()); if (mode.isAuthor()) { // Teacher cannot modify following - kaltura.setOfflineInstructions(authForm.getOfflineInstruction()); - kaltura.setOnlineInstructions(authForm.getOnlineInstruction()); kaltura.setLockOnFinished(authForm.isLockOnFinished()); kaltura.setAllowContributeVideos(authForm.isAllowContributeVideos()); kaltura.setLearnerContributionLimit(authForm.getLearnerContributionLimit()); @@ -217,24 +190,6 @@ } kaltura.setCreatedBy(kalturaUser); - - // remove attachments marked for deletion. - Set attachments = kaltura.getKalturaAttachments(); - if (attachments == null) { - attachments = new HashSet(); - } - - for (KalturaAttachment att : getAttList(AuthoringAction.KEY_DELETED_FILES, sessionMap)) { - // remove from db, leave in repository - attachments.remove(att); - } - - // add unsaved attachments - attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, sessionMap)); - attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, sessionMap)); - - // set attachments in case it didn't exist - kaltura.setKalturaAttachments(attachments); // ************************* Handle taskList items ******************* Set itemList = new LinkedHashSet(); @@ -413,156 +368,6 @@ return mapping.findForward(KalturaConstants.ITEM_LIST); } - 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(KalturaConstants.ATTR_SESSION_MAP, map); - this.saveErrors(request, errors); - return mapping.findForward("success"); - } - - if (file.getFileName().length() != 0) { - - // upload file to repository - KalturaAttachment newAtt = kalturaService.uploadFileToContent( - (Long) map.get(AuthoringAction.KEY_TOOL_CONTENT_ID), file, type); - - // Add attachment to unsavedFiles - // check to see if file with same name exists - KalturaAttachment currAtt; - Iterator iter = savedFiles.iterator(); - while (iter.hasNext()) { - currAtt = (KalturaAttachment) 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(KalturaConstants.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()) { - KalturaAttachment att = (KalturaAttachment) 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(KalturaConstants.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()) { - KalturaAttachment att = (KalturaAttachment) iter.next(); - - if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) { - // delete from repository and list - kalturaService.deleteFromRepository(att.getFileUuid(), att.getFileVersionId()); - iter.remove(); - break; - } - } - - request.setAttribute(KalturaConstants.ATTR_SESSION_MAP, map); - request.setAttribute("unsavedChanges", new Boolean(true)); - - return mapping.findForward("success"); - } - /** * Get ToolAccessMode from HttpRequest parameters. Default value is AUTHOR mode. */ @@ -578,14 +383,6 @@ } /** - * Retrieves a List of attachments from the map using the key. - */ - private List getAttList(String key, SessionMap map) { - List list = (List) map.get(key); - return list; - } - - /** * Retrieve the SessionMap from the HttpSession. */ private SessionMap getSessionMap(HttpServletRequest request, AuthoringForm authForm) { Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/LearningAction.java,v diff -u -r1.7 -r1.8 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/LearningAction.java 9 Apr 2013 12:46:10 -0000 1.7 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/LearningAction.java 17 Jan 2014 22:04:38 -0000 1.8 @@ -81,7 +81,7 @@ * @struts.action-forward name="success" path="tiles:/learning/main" * @struts:action-forward name ="viewitem" path="/learning.do?dispatch=viewItem" redirect="true" * @struts.action-forward name="commentlist" path="tiles:/learning/commentlist" - * @struts.action-forward name="runOffline" path="tiles:/learning/runOffline" + * @struts.action-forward name="submissionDeadline" path="tiles:/learning/submissionDeadline" * @struts.action-forward name="defineLater" path="tiles:/learning/defineLater" * @struts.action-forward name="notebook" path="tiles:/learning/notebook" * @struts.action-forward name="finish" path="tiles:/learning/finish" @@ -147,11 +147,6 @@ ActivityPositionDTO activityPosition = LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionId, request, getServlet() .getServletContext()); sessionMap.put(AttributeNames.ATTR_ACTIVITY_POSITION, activityPosition); - - // check runOffline - if (kaltura.isRunOffline()) { - return mapping.findForward("runOffline"); - } // reflection information String entryText = new String(); @@ -181,9 +176,9 @@ Date tzSubmissionDeadline = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, submissionDeadline); Date currentLearnerDate = DateUtil.convertToTimeZoneFromDefault(learnerTimeZone, new Date()); - // 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"); } } Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/MonitoringAction.java,v diff -u -r1.2 -r1.3 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/MonitoringAction.java 16 Nov 2012 13:47:56 -0000 1.2 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/actions/MonitoringAction.java 17 Jan 2014 22:04:38 -0000 1.3 @@ -82,7 +82,6 @@ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); Kaltura kaltura = kalturaService.getKalturaByContentId(toolContentID); - kaltura.toDTO(); boolean isGroupedActivity = kalturaService.isGroupedActivity(toolContentID); request.setAttribute(KalturaConstants.ATTR_KALTURA, kaltura); request.setAttribute("contentFolderID", contentFolderID); Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/forms/AuthoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/forms/AuthoringForm.java,v diff -u -r1.1 -r1.2 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/forms/AuthoringForm.java 15 Nov 2012 14:39:33 -0000 1.1 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/forms/AuthoringForm.java 17 Jan 2014 22:04:39 -0000 1.2 @@ -48,10 +48,6 @@ private String instructions; - private String offlineInstruction; - - private String onlineInstruction; - private boolean lockOnFinished; private boolean allowContributeVideos; @@ -64,10 +60,6 @@ private boolean allowRatings; - private FormFile onlineFile; - - private FormFile offlineFile; - private String currentTab; private String dispatch; @@ -138,38 +130,6 @@ this.allowContributeVideos = allowContributeVideos; } - public FormFile getOfflineFile() { - return offlineFile; - } - - public void setOfflineFile(FormFile offlineFile) { - this.offlineFile = offlineFile; - } - - public String getOfflineInstruction() { - return offlineInstruction; - } - - public void setOfflineInstruction(String offlineInstruction) { - this.offlineInstruction = offlineInstruction; - } - - public FormFile getOnlineFile() { - return onlineFile; - } - - public void setOnlineFile(FormFile onlineFile) { - this.onlineFile = onlineFile; - } - - public String getOnlineInstruction() { - return onlineInstruction; - } - - public void setOnlineInstruction(String onlineInstruction) { - this.onlineInstruction = onlineInstruction; - } - public String getTitle() { return title; } Index: lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/servlets/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/servlets/ExportServlet.java,v diff -u -r1.2 -r1.3 --- lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/servlets/ExportServlet.java 6 Jan 2014 08:42:30 -0000 1.2 +++ lams_tool_kaltura/src/java/org/lamsfoundation/lams/tool/kaltura/web/servlets/ExportServlet.java 17 Jan 2014 22:04:39 -0000 1.3 @@ -77,30 +77,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 (kalturaService == null) { - kalturaService = KalturaServiceProxy.getKalturaService(getServletContext()); - } - - Kaltura content = null; - if (toolContentID != null) { - content = kalturaService.getKalturaByContentId(toolContentID); - } else { - KalturaSession session = kalturaService.getSessionBySessionId(toolSessionID); - if (session != null) - content = session.getKaltura(); - } - if (content != null) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); - } - private void doLearnerExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) throws KalturaException { Index: lams_tool_kaltura/web/WEB-INF/tiles-defs.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/web/WEB-INF/tiles-defs.xml,v diff -u -r1.2 -r1.3 --- lams_tool_kaltura/web/WEB-INF/tiles-defs.xml 24 Nov 2012 12:37:49 -0000 1.2 +++ lams_tool_kaltura/web/WEB-INF/tiles-defs.xml 17 Jan 2014 22:04:38 -0000 1.3 @@ -64,9 +64,9 @@ - - - + + + Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_kaltura/web/WEB-INF/tags/DefineLater.tag'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_kaltura/web/includes/javascript/authoring.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/web/includes/javascript/authoring.js,v diff -u -r1.1 -r1.2 --- lams_tool_kaltura/web/includes/javascript/authoring.js 15 Nov 2012 14:39:32 -0000 1.1 +++ lams_tool_kaltura/web/includes/javascript/authoring.js 17 Jan 2014 22:04:39 -0000 1.2 @@ -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_kaltura/web/pages/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/web/pages/authoring/authoring.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_kaltura/web/pages/authoring/authoring.jsp 15 Nov 2012 14:39:28 -0000 1.1 +++ lams_tool_kaltura/web/pages/authoring/authoring.jsp 17 Jan 2014 22:04:38 -0000 1.2 @@ -19,7 +19,6 @@ - @@ -32,9 +31,6 @@
- - -

@@ -50,7 +46,6 @@ - + + + + + + + + + + + +

+

+ ${kaltura.title} +

+ +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + +
+
+
+
+ Fisheye: Tag 1.4 refers to a dead (removed) revision in file `lams_tool_kaltura/web/pages/learning/mobile/runOffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_kaltura/web/pages/learning/mobile/submissionDeadline.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/web/pages/learning/mobile/submissionDeadline.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_kaltura/web/pages/learning/mobile/submissionDeadline.jsp 17 Jan 2014 22:04:38 -0000 1.1 @@ -0,0 +1,64 @@ +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + +
+

+ ${kaltura.title} +

+
+ +
+
+ + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_kaltura/web/pages/monitoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_kaltura/web/pages/monitoring/monitoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_kaltura/web/pages/monitoring/monitoring.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_kaltura/web/pages/monitoring/monitoring.jsp 15 Nov 2012 14:39:27 -0000 1.1 +++ lams_tool_kaltura/web/pages/monitoring/monitoring.jsp 17 Jan 2014 22:04:40 -0000 1.2 @@ -4,9 +4,8 @@ Index: lams_tool_laqa/conf/hibernate/mappings/org/lamsfoundation/lams/tool/qa/QaContent.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/conf/hibernate/mappings/org/lamsfoundation/lams/tool/qa/QaContent.hbm.xml,v diff -u -r1.17 -r1.18 --- lams_tool_laqa/conf/hibernate/mappings/org/lamsfoundation/lams/tool/qa/QaContent.hbm.xml 8 Jan 2014 17:50:55 -0000 1.17 +++ lams_tool_laqa/conf/hibernate/mappings/org/lamsfoundation/lams/tool/qa/QaContent.hbm.xml 17 Jan 2014 22:04:45 -0000 1.18 @@ -61,14 +61,6 @@ /> - - - - - - - - - - - - - - conditions = new TreeSet(new TextSearchConditionComparator()); public QaContent() { }; /** full constructor */ public QaContent(Long qaContentId, String content, String title, String instructions, String reportTitle, - String monitoringReportTitle, String offlineInstructions, String onlineInstructions, long createdBy, - boolean defineLater, boolean runOffline, boolean questionsSequenced, boolean usernameVisible, + String monitoringReportTitle, long createdBy, boolean questionsSequenced, boolean usernameVisible, boolean allowRateAnswers, boolean synchInMonitor, boolean lockWhenFinished, boolean contentLocked, boolean showOtherAnswers, boolean reflect, String reflectionSubject, Date creationDate, Date updateDate, - Set qaQueContents, Set qaSessions, Set qaUploadedFiles, Set conditions, boolean allowRichEditor, boolean useSelectLeaderToolOuput) { + Set qaQueContents, Set qaSessions, Set conditions, boolean allowRichEditor, + boolean useSelectLeaderToolOuput) { this.qaContentId = qaContentId; this.content = content; this.title = title; this.instructions = instructions; this.reportTitle = reportTitle; this.monitoringReportTitle = monitoringReportTitle; - this.offlineInstructions = offlineInstructions; - this.onlineInstructions = onlineInstructions; this.createdBy = createdBy; - this.defineLater = defineLater; - this.runOffline = runOffline; this.questionsSequenced = questionsSequenced; this.usernameVisible = usernameVisible; this.allowRateAnswers = allowRateAnswers; @@ -170,36 +154,32 @@ this.updateDate = updateDate; this.qaQueContents = qaQueContents; this.qaSessions = qaSessions; - this.qaUploadedFiles = qaUploadedFiles; this.conditions = conditions; this.allowRichEditor = allowRichEditor; this.useSelectLeaderToolOuput = useSelectLeaderToolOuput; } /** - * Copy Construtor to create a new qa content instance. Note that we don't - * copy the qa session data here because the qa session will be created - * after we copied tool content. + * Copy Construtor to create a new qa content instance. Note that we don't copy the qa session data here because the + * qa session will be created after we copied tool content. * * @param qa - * the original qa content. + * the original qa content. * @param newContentId - * the new qa content id. + * the new qa content id. * @return the new qa content object. */ - public static QaContent newInstance(IToolContentHandler toolContentHandler, QaContent qa, Long newContentId) - throws ItemNotFoundException, RepositoryCheckedException { + public static QaContent newInstance(QaContent qa, Long newContentId) throws ItemNotFoundException, + RepositoryCheckedException { QaContent newContent = new QaContent(newContentId, qa.getContent(), qa.getTitle(), qa.getInstructions(), - qa.getReportTitle(), qa.getMonitoringReportTitle(), qa.getOfflineInstructions(), - qa.getOnlineInstructions(), qa.getCreatedBy(), qa.isDefineLater(), qa.isRunOffline(), - qa.isQuestionsSequenced(), qa.isUsernameVisible(), qa.isAllowRateAnswers(), qa.isSynchInMonitor(), - qa.isLockWhenFinished(), qa.isContentLocked(), qa.isShowOtherAnswers(), qa.isReflect(), - qa.getReflectionSubject(), qa.getCreationDate(), qa.getUpdateDate(), new TreeSet(), new TreeSet(), - new TreeSet(), new TreeSet(new TextSearchConditionComparator()), qa.isAllowRichEditor(), qa.isUseSelectLeaderToolOuput()); + qa.getReportTitle(), qa.getMonitoringReportTitle(), qa.getCreatedBy(), qa.isQuestionsSequenced(), + qa.isUsernameVisible(), qa.isAllowRateAnswers(), qa.isSynchInMonitor(), qa.isLockWhenFinished(), + qa.isContentLocked(), qa.isShowOtherAnswers(), qa.isReflect(), qa.getReflectionSubject(), + qa.getCreationDate(), qa.getUpdateDate(), new TreeSet(), new TreeSet(), new TreeSet( + new TextSearchConditionComparator()), qa.isAllowRichEditor(), qa.isUseSelectLeaderToolOuput()); newContent.setQaQueContents(qa.deepCopyQaQueContent(newContent)); - newContent.setQaUploadedFiles(qa.deepCopyQaAttachments(toolContentHandler, newContent)); newContent.setConditions(qa.deepCopyConditions(newContent)); return newContent; } @@ -213,20 +193,6 @@ return newQaQueContent; } - public Set deepCopyQaAttachments(IToolContentHandler toolContentHandler, QaContent newQaContent) - throws ItemNotFoundException, RepositoryCheckedException { - Set attachments = new TreeSet(); - for (Iterator i = this.getQaUploadedFiles().iterator(); i.hasNext();) { - QaUploadedFile qaUploadedFile = (QaUploadedFile) i.next(); - if (qaUploadedFile.getQaContent() != null) { - QaUploadedFile newQaUploadedFile = QaUploadedFile.newInstance(toolContentHandler, qaUploadedFile, - newQaContent); - attachments.add(newQaUploadedFile); - } - } - return attachments; - } - public Set deepCopyConditions(QaContent newQaContent) { Set newConditions = new TreeSet(new TextSearchConditionComparator()); @@ -274,7 +240,7 @@ /** * @param qaContentId - * The qaContentId to set. + * The qaContentId to set. */ public void setQaContentId(Long qaContentId) { this.qaContentId = qaContentId; @@ -289,7 +255,7 @@ /** * @param title - * The title to set. + * The title to set. */ public void setTitle(String title) { this.title = title; @@ -298,12 +264,10 @@ @Override public String toString() { return new ToStringBuilder(this).append("qaContentId:", getQaContentId()).append("qa title:", getTitle()) - .append("qa instructions:", getInstructions()).append("creator user id", getCreatedBy()).append( - "username_visible:", isUsernameVisible()).append( - "allow to rate answers:", isAllowRateAnswers()).append("defineLater", isDefineLater()).append( - "offline_instructions:", getOfflineInstructions()).append("online_instructions:", - getOnlineInstructions()).append("report_title: ", getReportTitle()).append( - "reflection subject: ", getReflectionSubject()) + .append("qa instructions:", getInstructions()).append("creator user id", getCreatedBy()) + .append("username_visible:", isUsernameVisible()) + .append("allow to rate answers:", isAllowRateAnswers()).append("defineLater", isDefineLater()) + .append("report_title: ", getReportTitle()).append("reflection subject: ", getReflectionSubject()) .append("synch_in_monitor: ", isSynchInMonitor()).toString(); } @@ -330,7 +294,7 @@ /** * @param createdBy - * The createdBy to set. + * The createdBy to set. */ public void setCreatedBy(long createdBy) { this.createdBy = createdBy; @@ -345,7 +309,7 @@ /** * @param defineLater - * The defineLater to set. + * The defineLater to set. */ public void setDefineLater(boolean defineLater) { this.defineLater = defineLater; @@ -360,43 +324,13 @@ /** * @param instructions - * The instructions to set. + * The instructions to set. */ public void setInstructions(String instructions) { this.instructions = instructions; } /** - * @return Returns the offlineInstructions. - */ - public String getOfflineInstructions() { - return offlineInstructions; - } - - /** - * @param offlineInstructions - * The offlineInstructions to set. - */ - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - /** - * @return Returns the onlineInstructions. - */ - public String getOnlineInstructions() { - return onlineInstructions; - } - - /** - * @param onlineInstructions - * The onlineInstructions to set. - */ - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - - /** * @return Returns the reportTitle. */ public String getReportTitle() { @@ -405,7 +339,7 @@ /** * @param reportTitle - * The reportTitle to set. + * The reportTitle to set. */ public void setReportTitle(String reportTitle) { this.reportTitle = reportTitle; @@ -420,7 +354,7 @@ /** * @param synchInMonitor - * The synchInMonitor to set. + * The synchInMonitor to set. */ public void setSynchInMonitor(boolean synchInMonitor) { this.synchInMonitor = synchInMonitor; @@ -435,7 +369,7 @@ /** * @param updateDate - * The updateDate to set. + * The updateDate to set. */ public void setUpdateDate(Date updateDate) { this.updateDate = updateDate; @@ -445,17 +379,17 @@ * @return Returns the submissionDeadline. */ public Date getSubmissionDeadline() { - return submissionDeadline; + return submissionDeadline; } - + /** * @param submissionDeadline - * The submissionDeadline to set. + * The submissionDeadline to set. */ public void setSubmissionDeadline(Date submissionDeadline) { - this.submissionDeadline = submissionDeadline; + this.submissionDeadline = submissionDeadline; } - + /** * @return Returns the usernameVisible. */ @@ -465,12 +399,12 @@ /** * @param usernameVisible - * The usernameVisible to set. + * The usernameVisible to set. */ public void setUsernameVisible(boolean usernameVisible) { this.usernameVisible = usernameVisible; } - + /** * @return Returns the allowRateAnswers. */ @@ -480,7 +414,7 @@ /** * @param allowRateAnswers - * The allowRateAnswers to set. + * The allowRateAnswers to set. */ public void setAllowRateAnswers(boolean allowRateAnswers) { this.allowRateAnswers = allowRateAnswers; @@ -495,28 +429,13 @@ /** * @param questionsSequenced - * The questionsSequenced to set. + * The questionsSequenced to set. */ public void setQuestionsSequenced(boolean questionsSequenced) { this.questionsSequenced = questionsSequenced; } /** - * @return Returns the runOffline. - */ - public boolean isRunOffline() { - return runOffline; - } - - /** - * @param runOffline - * The runOffline to set. - */ - public void setRunOffline(boolean runOffline) { - this.runOffline = runOffline; - } - - /** * @return Returns the monitoringReportTitle. */ public String getMonitoringReportTitle() { @@ -525,7 +444,7 @@ /** * @param monitoringReportTitle - * The monitoringReportTitle to set. + * The monitoringReportTitle to set. */ public void setMonitoringReportTitle(String monitoringReportTitle) { this.monitoringReportTitle = monitoringReportTitle; @@ -540,31 +459,13 @@ /** * @param contentLocked - * The contentLocked to set. + * The contentLocked to set. */ public void setContentLocked(boolean contentLocked) { this.contentLocked = contentLocked; } /** - * @return Returns the qaUploadedFiles. - */ - public Set getQaUploadedFiles() { - if (qaUploadedFiles == null) { - qaUploadedFiles = new TreeSet(); - } - return qaUploadedFiles; - } - - /** - * @param qaUploadedFiles - * The qaUploadedFiles to set. - */ - public void setQaUploadedFiles(Set qaUploadedFiles) { - this.qaUploadedFiles = qaUploadedFiles; - } - - /** * @return Returns the uid. */ public Long getUid() { @@ -573,7 +474,7 @@ /** * @param uid - * The uid to set. + * The uid to set. */ public void setUid(Long uid) { this.uid = uid; @@ -588,7 +489,7 @@ /** * @param content - * The content to set. + * The content to set. */ public void setContent(String content) { this.content = content; @@ -603,7 +504,7 @@ /** * @param creationDate - * The creationDate to set. + * The creationDate to set. */ public void setCreationDate(Date creationDate) { this.creationDate = creationDate; @@ -618,7 +519,7 @@ /** * @param reflect - * The reflect to set. + * The reflect to set. */ public void setReflect(boolean reflect) { this.reflect = reflect; @@ -633,7 +534,7 @@ /** * @param reflectionSubject - * The reflectionSubject to set. + * The reflectionSubject to set. */ public void setReflectionSubject(String reflectionSubject) { this.reflectionSubject = reflectionSubject; @@ -648,19 +549,18 @@ /** * @param lockWhenFinished - * The lockWhenFinished to set. + * The lockWhenFinished to set. */ public void setLockWhenFinished(boolean lockWhenFinished) { this.lockWhenFinished = lockWhenFinished; } - - + public boolean isAllowRichEditor() { - return allowRichEditor; + return allowRichEditor; } public void setAllowRichEditor(boolean allowRichEditor) { - this.allowRichEditor = allowRichEditor; + this.allowRichEditor = allowRichEditor; } public boolean isUseSelectLeaderToolOuput() { @@ -680,7 +580,7 @@ /** * @param showOtherAnswers - * The showOtherAnswers to set. + * The showOtherAnswers to set. */ public void setShowOtherAnswers(boolean showOtherAnswers) { this.showOtherAnswers = showOtherAnswers; Fisheye: Tag 1.20 refers to a dead (removed) revision in file `lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUploadedFile.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/qaApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/qaApplicationContext.xml,v diff -u -r1.27 -r1.28 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/qaApplicationContext.xml 8 Jan 2014 17:50:55 -0000 1.27 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/qaApplicationContext.xml 17 Jan 2014 22:04:44 -0000 1.28 @@ -52,10 +52,6 @@ - - - - @@ -82,12 +78,10 @@ - - + - @@ -105,7 +99,6 @@ PROPAGATION_REQUIRED,-QaApplicationException PROPAGATION_REQUIRED, -QaApplicationException PROPAGATION_REQUIRED,-QaApplicationException - PROPAGATION_REQUIRED,-QaApplicationException PROPAGATION_REQUIRED,-QaApplicationException PROPAGATION_REQUIRED,-QaApplicationException PROPAGATION_REQUIRED,-QaApplicationException Fisheye: Tag 1.12 refers to a dead (removed) revision in file `lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/IQaUploadedFileDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaSessionDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaSessionDAO.java,v diff -u -r1.20 -r1.21 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaSessionDAO.java 13 Nov 2013 15:38:47 -0000 1.20 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaSessionDAO.java 17 Jan 2014 22:04:44 -0000 1.21 @@ -29,7 +29,6 @@ import org.lamsfoundation.lams.tool.qa.QaContent; import org.lamsfoundation.lams.tool.qa.QaSession; import org.lamsfoundation.lams.tool.qa.dao.IQaSessionDAO; -import org.springframework.orm.hibernate3.HibernateTemplate; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; /** Fisheye: Tag 1.17 refers to a dead (removed) revision in file `lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dao/hibernate/QaUploadedFileDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20140102.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20140102.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dbupdates/patch20140102.sql 17 Jan 2014 22:04:44 -0000 1.1 @@ -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_laqa11_content DROP COLUMN online_instructions; +ALTER TABLE tl_laqa11_content DROP COLUMN offline_instructions; +ALTER TABLE tl_laqa11_content DROP COLUMN run_offline; +DROP TABLE IF EXISTS tl_laqa11_uploadedfile; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='laqa11'; + +----------------------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_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralLearnerFlowDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralLearnerFlowDTO.java,v diff -u -r1.3 -r1.4 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralLearnerFlowDTO.java 8 May 2013 14:07:08 -0000 1.3 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralLearnerFlowDTO.java 17 Jan 2014 22:04:43 -0000 1.4 @@ -37,7 +37,6 @@ * @author Ozgur Demirtas */ public class GeneralLearnerFlowDTO implements Comparable { - protected String activityOffline; protected Integer totalQuestionCount; @@ -208,21 +207,6 @@ } /** - * @return Returns the activityOffline. - */ - public String getActivityOffline() { - return activityOffline; - } - - /** - * @param activityOffline - * The activityOffline to set. - */ - public void setActivityOffline(String activityOffline) { - this.activityOffline = activityOffline; - } - - /** * @return Returns the activityTitle. */ public String getActivityTitle() { @@ -277,7 +261,7 @@ } public String toString() { - return new ToStringBuilder(this).append("activityOffline: ", activityOffline).append( + return new ToStringBuilder(this).append( "remainingQuestionCount: ", remainingQuestionCount).append("totalQuestionCount : ", totalQuestionCount) .append("activityInstructions: ", activityInstructions).append("teacherViewOnly: ", teacherViewOnly) .append("lockWhenFinished: ", lockWhenFinished).append("activityTitle: ", activityTitle).append( Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralMonitoringDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/Attic/GeneralMonitoringDTO.java,v diff -u -r1.2 -r1.3 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralMonitoringDTO.java 18 Mar 2011 17:09:50 -0000 1.2 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/GeneralMonitoringDTO.java 17 Jan 2014 22:04:43 -0000 1.3 @@ -24,8 +24,6 @@ package org.lamsfoundation.lams.tool.qa.dto; -import java.util.List; - import org.apache.commons.lang.builder.ToStringBuilder; @@ -54,12 +52,6 @@ protected String defaultQuestionContent; - protected String onlineInstructions; - protected String offlineInstructions; - - protected List attachmentList; - protected List deletedAttachmentList; - protected String contentFolderID; @@ -75,11 +67,7 @@ .append("editResponse: ", editResponse) .append("defaultQuestionContent: ", defaultQuestionContent) .append("countAllUsers: ", countAllUsers) - .append("countSessionComplete: ", countSessionComplete) - .append("onlineInstructions: ", onlineInstructions) - .append("offlineInstructions: ", offlineInstructions) - .append("attachmentList: ", attachmentList) - .append("deletedAttachmentList: ", deletedAttachmentList) + .append("countSessionComplete: ", countSessionComplete) .toString(); } @@ -155,54 +143,6 @@ this.defaultQuestionContent = defaultQuestionContent; } /** - * @return Returns the offlineInstructions. - */ - public String getOfflineInstructions() { - return offlineInstructions; - } - /** - * @param offlineInstructions The offlineInstructions to set. - */ - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - /** - * @return Returns the onlineInstructions. - */ - public String getOnlineInstructions() { - return onlineInstructions; - } - /** - * @param onlineInstructions The onlineInstructions to set. - */ - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - /** - * @return Returns the attachmentList. - */ - public List getAttachmentList() { - return attachmentList; - } - /** - * @param attachmentList The attachmentList to set. - */ - public void setAttachmentList(List attachmentList) { - this.attachmentList = attachmentList; - } - /** - * @return Returns the deletedAttachmentList. - */ - public List getDeletedAttachmentList() { - return deletedAttachmentList; - } - /** - * @param deletedAttachmentList The deletedAttachmentList to set. - */ - public void setDeletedAttachmentList(List deletedAttachmentList) { - this.deletedAttachmentList = deletedAttachmentList; - } - /** * @return Returns the userExceptionNoStudentActivity. */ public String getUserExceptionNoStudentActivity() { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/QaGeneralAuthoringDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/Attic/QaGeneralAuthoringDTO.java,v diff -u -r1.3 -r1.4 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/QaGeneralAuthoringDTO.java 8 May 2013 14:07:08 -0000 1.3 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/dto/QaGeneralAuthoringDTO.java 17 Jan 2014 22:04:43 -0000 1.4 @@ -24,8 +24,6 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.qa.dto; -import java.util.List; - import org.apache.commons.lang.builder.ToStringBuilder; /** @@ -48,8 +46,6 @@ protected String activityTitle; protected String activityInstructions; - protected String onlineInstructions; - protected String offlineInstructions; protected String usernameVisible; protected String allowRateAnswers; protected String showOtherAnswers; @@ -68,9 +64,6 @@ protected String requestedModule; protected String isDefineLater; - protected List attachmentList; - protected List deletedAttachmentList; - protected String sbmtSuccess; protected String userExceptionQuestionsDuplicate; @@ -88,14 +81,12 @@ .append("targetMode: ", targetMode).append("defaultQuestionContent: ", defaultQuestionContent) .append("defaultContentIdStr: ", defaultContentIdStr).append("activityTitle: ", activityTitle) .append("activityInstructions: ", activityInstructions).append("reflect: ", reflect) - .append("onlineInstructions: ", onlineInstructions) - .append("offlineInstructions: ", offlineInstructions).append("usernameVisible: ", usernameVisible) + .append("usernameVisible: ", usernameVisible) .append("allowRateAnswers: ", allowRateAnswers).append("showOtherAnswers: ", showOtherAnswers) .append("synchInMonitor: ", synchInMonitor).append("questionsSequenced: ", questionsSequenced) .append("lockWhenFinished: ", lockWhenFinished).append("editActivityEditMode: ", editActivityEditMode) .append("reflectionSubject: ", reflectionSubject).append("requestedModule: ", requestedModule) .append("isDefineLater: ", isDefineLater).append("monitoredContentInUse: ", monitoredContentInUse) - .append("attachmentList: ", attachmentList).append("deletedAttachmentList: ", deletedAttachmentList) .append("sbmtSuccess: ", sbmtSuccess) .append("userExceptionQuestionsDuplicate: ", userExceptionQuestionsDuplicate).toString(); } @@ -161,21 +152,6 @@ } /** - * @return Returns the deletedAttachmentList. - */ - public List getDeletedAttachmentList() { - return deletedAttachmentList; - } - - /** - * @param deletedAttachmentList - * The deletedAttachmentList to set. - */ - public void setDeletedAttachmentList(List deletedAttachmentList) { - this.deletedAttachmentList = deletedAttachmentList; - } - - /** * @return Returns the isDefineLater. */ public String getIsDefineLater() { @@ -191,21 +167,6 @@ } /** - * @return Returns the attachmentList. - */ - public List getAttachmentList() { - return attachmentList; - } - - /** - * @param attachmentList - * The attachmentList to set. - */ - public void setAttachmentList(List attachmentList) { - this.attachmentList = attachmentList; - } - - /** * @return Returns the toolContentID. */ public String getToolContentID() { @@ -380,36 +341,6 @@ } /** - * @return Returns the offlineInstructions. - */ - public String getOfflineInstructions() { - return offlineInstructions; - } - - /** - * @param offlineInstructions - * The offlineInstructions to set. - */ - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - /** - * @return Returns the onlineInstructions. - */ - public String getOnlineInstructions() { - return onlineInstructions; - } - - /** - * @param onlineInstructions - * The onlineInstructions to set. - */ - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - - /** * @return Returns the questionsSequenced. */ public String getQuestionsSequenced() { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java,v diff -u -r1.62 -r1.63 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java 8 Jan 2014 17:50:55 -0000 1.62 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/IQaService.java 17 Jan 2014 22:04:44 -0000 1.63 @@ -23,12 +23,10 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.qa.service; -import java.io.InputStream; import java.util.Collection; import java.util.List; import java.util.SortedSet; -import org.lamsfoundation.lams.contentrepository.ITicket; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.IToolVO; import org.lamsfoundation.lams.tool.exception.DataMissingException; @@ -39,7 +37,6 @@ import org.lamsfoundation.lams.tool.qa.QaQueContent; import org.lamsfoundation.lams.tool.qa.QaQueUsr; import org.lamsfoundation.lams.tool.qa.QaSession; -import org.lamsfoundation.lams.tool.qa.QaUploadedFile; import org.lamsfoundation.lams.tool.qa.QaUsrResp; import org.lamsfoundation.lams.tool.qa.QaWizardCategory; import org.lamsfoundation.lams.tool.qa.dto.AverageRatingDTO; @@ -188,10 +185,6 @@ */ void copyToolContent(Long fromContentId, Long toContentId) throws ToolException; - void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException; - - void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException; - boolean isStudentActivityOccurredGlobal(QaContent qaContent) throws QaApplicationException; /** @@ -221,21 +214,6 @@ long getToolDefaultContentIdBySignature(String toolSignature) throws QaApplicationException; - ITicket getRepositoryLoginTicket() throws QaApplicationException; - - void deleteFromRepository(Long uuid, Long versionID) throws QaApplicationException; - - InputStream downloadFile(Long uuid, Long versionID) throws QaApplicationException; - - void persistFile(String uuid, boolean isOnlineFile, String fileName, QaContent qaContent) - throws QaApplicationException; - - void persistFile(QaContent content, QaUploadedFile file) throws QaApplicationException; - - void removeFile(Long submissionId) throws QaApplicationException; - - List retrieveQaUploadedFiles(QaContent qa) throws QaApplicationException; - Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry); NotebookEntry getEntry(Long id, Integer idType, String signature, Integer userID); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaImportContentVersionFilter.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaImportContentVersionFilter.java,v diff -u -r1.7 -r1.8 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaImportContentVersionFilter.java 22 Mar 2011 16:51:34 -0000 1.7 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaImportContentVersionFilter.java 17 Jan 2014 22:04:44 -0000 1.8 @@ -45,4 +45,14 @@ this.removeField(QaQueContent.class, "isOptional"); this.addField(QaQueContent.class, "required", new Boolean(false)); } + + /** + * Import 20140101 version content to 20140102 version tool server. + */ + public void up20140101To20140102() { + this.removeField(QaContent.class, "runOffline"); + this.removeField(QaContent.class, "onlineInstructions"); + this.removeField(QaContent.class, "offlineInstructions"); + this.removeField(QaContent.class, "qaUploadedFiles"); + } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java,v diff -u -r1.99 -r1.100 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 8 Jan 2014 17:50:55 -0000 1.99 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 17 Jan 2014 22:04:44 -0000 1.100 @@ -24,7 +24,6 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.qa.service; -import java.io.InputStream; import java.util.Collection; import java.util.Date; import java.util.Hashtable; @@ -40,18 +39,9 @@ import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; -import org.lamsfoundation.lams.contentrepository.AccessDeniedException; -import org.lamsfoundation.lams.contentrepository.FileException; -import org.lamsfoundation.lams.contentrepository.ICredentials; -import org.lamsfoundation.lams.contentrepository.ITicket; -import org.lamsfoundation.lams.contentrepository.IVersionedNode; import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; -import org.lamsfoundation.lams.contentrepository.LoginException; import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; -import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; -import org.lamsfoundation.lams.contentrepository.service.IRepositoryService; -import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; import org.lamsfoundation.lams.learning.service.ILearnerService; import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; @@ -76,7 +66,6 @@ import org.lamsfoundation.lams.tool.qa.QaQueContent; import org.lamsfoundation.lams.tool.qa.QaQueUsr; import org.lamsfoundation.lams.tool.qa.QaSession; -import org.lamsfoundation.lams.tool.qa.QaUploadedFile; import org.lamsfoundation.lams.tool.qa.QaUsrResp; import org.lamsfoundation.lams.tool.qa.QaWizardCategory; import org.lamsfoundation.lams.tool.qa.ResponseRating; @@ -85,7 +74,6 @@ import org.lamsfoundation.lams.tool.qa.dao.IQaQueUsrDAO; import org.lamsfoundation.lams.tool.qa.dao.IQaQuestionDAO; import org.lamsfoundation.lams.tool.qa.dao.IQaSessionDAO; -import org.lamsfoundation.lams.tool.qa.dao.IQaUploadedFileDAO; import org.lamsfoundation.lams.tool.qa.dao.IQaUsrRespDAO; import org.lamsfoundation.lams.tool.qa.dao.IQaWizardDAO; import org.lamsfoundation.lams.tool.qa.dao.IResponseRatingDAO; @@ -125,20 +113,13 @@ QaAppConstants { static Logger logger = Logger.getLogger(QaServicePOJO.class.getName()); - private final String repositoryUser = "laqa11"; - private final char[] repositoryId = { 'l', 'a', 'q', 'a', '_', '1', '1' }; - private final String repositoryWorkspace = "laqa11"; - private IRepositoryService repositoryService; - private ICredentials cred; - private IQaContentDAO qaDAO; private IQaQuestionDAO qaQuestionDAO; private IQaSessionDAO qaSessionDAO; private IQaQueUsrDAO qaQueUsrDAO; private IQaUsrRespDAO qaUsrRespDAO; private IResponseRatingDAO qaResponseRatingDAO; - private IQaUploadedFileDAO qaUploadedFileDAO; private IToolContentHandler qaToolContentHandler = null; private IUserManagementService userManagementService; @@ -530,15 +511,6 @@ .getUsername(), qaUsrResp.getAnswer()); } - public List retrieveQaUploadedFiles(QaContent qa) throws QaApplicationException { - try { - return qaUploadedFileDAO.retrieveQaUploadedFiles(qa); - } catch (DataAccessException e) { - throw new QaApplicationException("Exception occured when lams is loading qa uploaded files: " - + e.getMessage(), e); - } - } - public int getTotalNumberOfUsers(QaContent qa) { try { return qaQueUsrDAO.getTotalNumberOfUsers(qa); @@ -644,7 +616,7 @@ fromContent.getConditions().add( getQaOutputFactory().createDefaultComplexUserAnswersCondition(fromContent)); } - QaContent toContent = QaContent.newInstance(qaToolContentHandler, fromContent, toContentId); + QaContent toContent = QaContent.newInstance(fromContent, toContentId); if (toContent == null) { QaServicePOJO.logger.error("throwing ToolException: WARNING!, retrieved toContent is null."); throw new ToolException("WARNING! Fail to create toContent. Can't continue!"); @@ -664,48 +636,6 @@ } /** - * setAsDefineLater(Long toolContentID) throws DataMissingException, - * ToolException - * - * @param toolContentID - * return void - */ - public void setAsDefineLater(Long toolContentID, boolean value) throws DataMissingException, ToolException { - if (toolContentID == null) { - QaServicePOJO.logger.error("throwing DataMissingException: WARNING!: retrieved toolContentID is null."); - throw new DataMissingException("toolContentID is missing"); - } - QaContent qaContent = qaDAO.getQaByContentId(toolContentID.longValue()); - if (qaContent == null) { - QaServicePOJO.logger.error("throwing DataMissingException: WARNING!: retrieved qaContent is null."); - throw new DataMissingException("qaContent is missing"); - } - qaContent.setDefineLater(value); - updateQa(qaContent); - } - - /** - * setAsRunOffline(Long toolContentID) throws DataMissingException, ToolException set the runOffline to true on this - * content - * - * @param toolContentID - * return void - */ - public void setAsRunOffline(Long toolContentID, boolean value) throws DataMissingException, ToolException { - if (toolContentID == null) { - QaServicePOJO.logger.error("throwing DataMissingException: WARNING!: retrieved toolContentID is null."); - throw new DataMissingException("toolContentID is missing"); - } - QaContent qaContent = qaDAO.getQaByContentId(toolContentID.longValue()); - if (qaContent == null) { - QaServicePOJO.logger.error("throwing DataMissingException: WARNING!: retrieved qaContent is null."); - throw new DataMissingException("qaContent is missing"); - } - qaContent.setRunOffline(value); - updateQa(qaContent); - } - - /** * removeToolContent(Long toolContentID, boolean removeSessionData) throws * SessionDataExistsException, ToolException Will need an update on the core * tool signature: reason : when qaContent is null throw an exception @@ -857,7 +787,7 @@ try { // set ToolContentHandler as null to avoid copy file node in // repository again. - toolContentObj = QaContent.newInstance(null, toolContentObj, toolContentID); + toolContentObj = QaContent.newInstance(toolContentObj, toolContentID); // don't export following fields value toolContentObj.setQaSessions(null); @@ -866,12 +796,7 @@ question.setQaQueUsers(null); question.setQaContent(null); } - Set files = toolContentObj.getQaUploadedFiles(); - for (QaUploadedFile file : files) { - file.setQaContent(null); - } - exportContentService.registerFileClassForExport(QaUploadedFile.class.getName(), "uuid", null); exportContentService.exportToolContent(toolContentID, toolContentObj, qaToolContentHandler, rootPath); } catch (ExportToolContentException e) { throw new ToolException(e); @@ -891,9 +816,6 @@ public void importToolContent(Long toolContentID, Integer newUserUid, String toolContentPath, String fromVersion, String toVersion) throws ToolException { try { - exportContentService.registerFileClassForImport(QaUploadedFile.class.getName(), "uuid", null, "fileName", - "fileProperty", null, null); - // register version filter class exportContentService.registerImportVersionFilterClass(QaImportContentVersionFilter.class); @@ -914,10 +836,6 @@ for (QaQueContent question : questions) { question.setQaContent(toolContentObj); } - Set files = toolContentObj.getQaUploadedFiles(); - for (QaUploadedFile file : files) { - file.setQaContent(toolContentObj); - } qaDAO.saveOrUpdateQa(toolContentObj); } catch (ImportToolContentException e) { throw new ToolException(e); @@ -1137,91 +1055,6 @@ return contentId; } - /** - * 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 - */ - public ITicket getRepositoryLoginTicket() throws QaApplicationException { - ICredentials credentials = new SimpleCredentials(repositoryUser, repositoryId); - try { - ITicket ticket = repositoryService.login(credentials, repositoryWorkspace); - return ticket; - } catch (AccessDeniedException e) { - throw new QaApplicationException("Access Denied to repository." + e.getMessage()); - } catch (WorkspaceNotFoundException e) { - throw new QaApplicationException("Workspace not found." + e.getMessage()); - } catch (LoginException e) { - throw new QaApplicationException("Login failed." + e.getMessage()); - } - } - - /** - * This method deletes the content with the given uuid and versionID from the content - * repository - * - * @param uuid - * The uuid of the node to be deleted - * @param versionID - * The version_id of the node to be deleted. - * @throws SubmitFilesException - */ - public void deleteFromRepository(Long uuid, Long versionID) throws QaApplicationException { - ITicket ticket = getRepositoryLoginTicket(); - try { - String files[] = repositoryService.deleteVersion(ticket, uuid, versionID); - } catch (Exception e) { - throw new QaApplicationException("Exception occured while deleting files from" + " the repository " - + e.getMessage()); - } - } - - public InputStream downloadFile(Long uuid, Long versionID) throws QaApplicationException { - ITicket ticket = getRepositoryLoginTicket(); - try { - IVersionedNode node = repositoryService.getFileItem(ticket, uuid, null); - return node.getFile(); - } catch (AccessDeniedException e) { - throw new QaApplicationException("AccessDeniedException occured while trying to download file " - + e.getMessage()); - } catch (FileException e) { - throw new QaApplicationException("FileException occured while trying to download file " + e.getMessage()); - } catch (ItemNotFoundException e) { - throw new QaApplicationException("ItemNotFoundException occured while trying to download file " - + e.getMessage()); - } - } - - /** - * adds a new entry to the uploaded files table - */ - public void persistFile(String uuid, boolean isOnlineFile, String fileName, QaContent qaContent) - throws QaApplicationException { - QaUploadedFile qaUploadedFile = new QaUploadedFile(uuid, isOnlineFile, fileName, qaContent); - qaUploadedFileDAO.saveUploadFile(qaUploadedFile); - } - - /** - * adds a new entry to the uploaded files table - */ - public void persistFile(QaContent content, QaUploadedFile file) throws QaApplicationException { - content.getQaUploadedFiles().add(file); - file.setQaContent(content); - qaDAO.saveOrUpdateQa(content); - } - - /** - * removes an entry from the uploaded files table - */ - public void removeFile(Long submissionId) throws QaApplicationException { - qaUploadedFileDAO.removeUploadFile(submissionId); - } - @Override public Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry) { return coreNotebookService.createNotebookEntry(id, idType, signature, userID, "", entry); @@ -1249,57 +1082,6 @@ } /** - * @return Returns the cred. - */ - public ICredentials getCred() { - return cred; - } - - /** - * @param cred - * The cred to set. - */ - public void setCred(ICredentials cred) { - this.cred = cred; - } - - /** - * @return Returns the qaUploadedFileDAO. - */ - public IQaUploadedFileDAO getQaUploadedFileDAO() { - return qaUploadedFileDAO; - } - - /** - * @param qaUploadedFileDAO - * The qaUploadedFileDAO to set. - */ - public void setQaUploadedFileDAO(IQaUploadedFileDAO qaUploadedFileDAO) { - this.qaUploadedFileDAO = qaUploadedFileDAO; - } - - /** - * @return Returns the repositoryId. - */ - public char[] getRepositoryId() { - return repositoryId; - } - - /** - * @return Returns the repositoryUser. - */ - public String getRepositoryUser() { - return repositoryUser; - } - - /** - * @return Returns the repositoryWorkspace. - */ - public String getRepositoryWorkspace() { - return repositoryWorkspace; - } - - /** * @return Returns the qaQuestionDAO. */ public IQaQuestionDAO getQaQuestionDAO() { @@ -1387,21 +1169,6 @@ return qaResponseRatingDAO; } - /** - * @return Returns the repositoryService. - */ - public IRepositoryService getRepositoryService() { - return repositoryService; - } - - /** - * @param repositoryService - * The repositoryService to set. - */ - public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - public void setUserManagementService(IUserManagementService userManagementService) { this.userManagementService = userManagementService; } @@ -1456,11 +1223,8 @@ toolContentObj.setCreationDate(now); toolContentObj.setDefineLater(false); toolContentObj.setInstructions(null); - toolContentObj.setOfflineInstructions(null); - toolContentObj.setOnlineInstructions(null); toolContentObj.setReflect(false); toolContentObj.setReflectionSubject(null); - toolContentObj.setRunOffline(false); toolContentObj.setTitle((String) importValues.get(ToolContentImport102Manager.CONTENT_TITLE)); toolContentObj.setQaContentId(toolContentId); toolContentObj.setUpdateDate(now); @@ -1489,7 +1253,6 @@ } // leave as empty, no need to set them to anything. - // setQaUploadedFiles(Set qaUploadedFiles); // setQaSessions(Set qaSessions); // set up question from body Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaUtils.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaUtils.java,v diff -u -r1.4 -r1.5 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaUtils.java 4 Jul 2013 10:27:29 -0000 1.4 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/util/QaUtils.java 17 Jan 2014 22:04:44 -0000 1.5 @@ -24,7 +24,6 @@ package org.lamsfoundation.lams.tool.qa.util; import java.text.DateFormat; -import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.List; @@ -37,7 +36,6 @@ import org.lamsfoundation.lams.tool.qa.QaAppConstants; import org.lamsfoundation.lams.tool.qa.QaContent; import org.lamsfoundation.lams.tool.qa.QaSession; -import org.lamsfoundation.lams.tool.qa.QaUploadedFile; import org.lamsfoundation.lams.tool.qa.dto.QaGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.qa.service.IQaService; import org.lamsfoundation.lams.tool.qa.web.form.QaAuthoringForm; @@ -63,9 +61,6 @@ QaGeneralAuthoringDTO qaGeneralAuthoringDTO) { qaGeneralAuthoringDTO.setActivityTitle(defaultQaContent.getTitle()); qaGeneralAuthoringDTO.setActivityInstructions(defaultQaContent.getInstructions()); - - qaGeneralAuthoringDTO.setOnlineInstructions(defaultQaContent.getOnlineInstructions()); - qaGeneralAuthoringDTO.setOfflineInstructions(defaultQaContent.getOfflineInstructions()); } public static String replaceNewLines(String text) { @@ -118,16 +113,6 @@ qaAuthoringForm.setLockWhenFinished(lockWhenFinished); qaGeneralAuthoringDTO.setLockWhenFinished(lockWhenFinished); - String offlineInstructions = request.getParameter(OFFLINE_INSTRUCTIONS); - - qaAuthoringForm.setOfflineInstructions(offlineInstructions); - qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); - - String onlineInstructions = request.getParameter(ONLINE_INSTRUCTIONS); - - qaAuthoringForm.setOnlineInstructions(onlineInstructions); - qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - String reflect = request.getParameter(REFLECT); qaAuthoringForm.setReflect(reflect); @@ -186,64 +171,6 @@ } /** - * If this file exists in attachments map, move it to the deleted - * attachments map. Returns the updated deletedAttachments map, creating a - * new one if needed. If uuid supplied then tries to match on that, - * otherwise uses filename and isOnline. - */ - public static List moveToDelete(String uuid, List attachmentsList, List deletedAttachmentsList) { - - List deletedList = deletedAttachmentsList != null ? deletedAttachmentsList : new ArrayList(); - - if (attachmentsList != null) { - Iterator iter = attachmentsList.iterator(); - QaUploadedFile attachment = null; - while (iter.hasNext() && attachment == null) { - QaUploadedFile value = (QaUploadedFile) iter.next(); - if (uuid.equals(value.getUuid())) { - attachment = value; - } - - } - if (attachment != null) { - deletedList.add(attachment); - attachmentsList.remove(attachment); - } - } - - return deletedList; - } - - /** - * If this file exists in attachments map, move it to the deleted - * attachments map. Returns the updated deletedAttachments map, creating a - * new one if needed. If uuid supplied then tries to match on that, - * otherwise uses filename and isOnline. - */ - public static List moveToDelete(String filename, boolean isOnline, List attachmentsList, List deletedAttachmentsList) { - - List deletedList = deletedAttachmentsList != null ? deletedAttachmentsList : new ArrayList(); - - if (attachmentsList != null) { - Iterator iter = attachmentsList.iterator(); - QaUploadedFile attachment = null; - while (iter.hasNext() && attachment == null) { - QaUploadedFile value = (QaUploadedFile) iter.next(); - if (filename.equals(value.getFileName()) && isOnline == value.isFileOnline()) { - attachment = value; - } - - } - if (attachment != null) { - deletedList.add(attachment); - attachmentsList.remove(attachment); - } - } - - return deletedList; - } - - /** * builds a String based map from a list convertToMap(List sessionsList) * * @param sessionsList @@ -306,19 +233,12 @@ request.getSession().removeAttribute(SELECTION_CASE); request.getSession().removeAttribute(MAP_QUESTION_CONTENT); request.getSession().removeAttribute(DEFAULT_QUESTION_CONTENT); - request.getSession().removeAttribute(ONLINE_INSTRUCTIONS); - request.getSession().removeAttribute(OFFLINE_INSTRUCTIONS); request.getSession().removeAttribute(END_LEARNING_MESSSAGE); request.getSession().removeAttribute(ON); request.getSession().removeAttribute(OFF); - request.getSession().removeAttribute(RICHTEXT_OFFLINEINSTRUCTIONS); - request.getSession().removeAttribute(RICHTEXT_ONLINEINSTRUCTIONS); request.getSession().removeAttribute(RICHTEXT_TITLE); request.getSession().removeAttribute(RICHTEXT_INSTRUCTIONS); request.getSession().removeAttribute(RICHTEXT_BLANK); - request.getSession().removeAttribute(SUBMIT_OFFLINE_FILE); - request.getSession().removeAttribute(SUBMIT_ONLINE_FILE); - request.getSession().removeAttribute(POPULATED_UPLOADED_FILESDATA); request.getSession().removeAttribute(USER_ID); request.getSession().removeAttribute(NOT_ATTEMPTED); request.getSession().removeAttribute(INCOMPLETE); @@ -353,7 +273,6 @@ request.getSession().removeAttribute(MONITORING_REPORT_TITLE); request.getSession().removeAttribute(REPORT_TITLE_LEARNER); request.getSession().removeAttribute(END_LEARNING_MESSAGE); - request.getSession().removeAttribute(IS_TOOL_ACTIVITY_OFFLINE); request.getSession().removeAttribute(CHECK_ALL_SESSIONS_COMPLETED); request.getSession().removeAttribute(FROM_TOOL_CONTENT_ID); request.getSession().removeAttribute(TO_TOOL_CONTENT_ID); @@ -371,10 +290,7 @@ request.getSession().removeAttribute(FEEDBACK_TYPE_SEQUENTIAL); request.getSession().removeAttribute(FEEDBACK_TYPE_COMBINED); request.getSession().removeAttribute(QUESTIONS); - request.getSession().removeAttribute(ATTACHMENT_LIST); request.getSession().removeAttribute(SUBMIT_SUCCESS); - request.getSession().removeAttribute(DELETED_ATTACHMENT_LIST); - request.getSession().removeAttribute(UUID); request.getSession().removeAttribute(IS_USERNAME_VISIBLE); request.getSession().removeAttribute(CURRENT_ANSWER); request.getSession().removeAttribute(ACTIVE_MODULE); @@ -411,7 +327,6 @@ request.getSession().removeAttribute(USER_EXCEPTION_NO_STUDENT_ACTIVITY); request.getSession().removeAttribute(USER_EXCEPTION_CONTENT_IN_USE); request.getSession().removeAttribute(USER_EXCEPTION_MODE_REQUIRED); - request.getSession().removeAttribute(USER_EXCEPTION_RUN_OFFLINE); request.getSession().removeAttribute(USER_EXCEPTION_MODE_INVALID); request.getSession().removeAttribute(USER_EXCEPTION_QUESTIONS_DUPLICATE); } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java,v diff -u -r1.58 -r1.59 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java 8 Jan 2014 17:50:55 -0000 1.58 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/AuthoringUtil.java 17 Jan 2014 22:04:43 -0000 1.59 @@ -307,8 +307,6 @@ String useSelectLeaderToolOuput = request.getParameter("useSelectLeaderToolOuput"); - String richTextOfflineInstructions = request.getParameter(QaAppConstants.OFFLINE_INSTRUCTIONS); - String richTextOnlineInstructions = request.getParameter(QaAppConstants.ONLINE_INSTRUCTIONS); String reflect = request.getParameter(QaAppConstants.REFLECT); String reflectionSubject = request.getParameter(QaAppConstants.REFLECTION_SUBJECT); @@ -388,8 +386,6 @@ /** make sure we are setting the userId from the User object above */ if (activeModule.equals(QaAppConstants.AUTHORING)) { - qaContent.setOnlineInstructions(richTextOnlineInstructions); - qaContent.setOfflineInstructions(richTextOfflineInstructions); qaContent.setUsernameVisible(usernameVisibleBoolean); qaContent.setAllowRateAnswers(allowRateQuestionsBoolean); qaContent.setShowOtherAnswers(showOtherAnswersBoolean); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java,v diff -u -r1.24 -r1.25 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java 6 Jan 2014 08:42:09 -0000 1.24 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java 17 Jan 2014 22:04:43 -0000 1.25 @@ -83,27 +83,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 { - IQaService service = QaServiceProxy.getQaService(getServletContext()); - QaContent content = null; - if (toolContentID != null) { - content = service.getQa(toolContentID); - } else { - QaSession session = service.retrieveQaSession(toolSessionID); - if (session != null) - content = session.getQaContent(); - } - if (content != null) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); - } - public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) { IQaService qaService = QaServiceProxy.getQaService(getServletContext()); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java,v diff -u -r1.47 -r1.48 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java 8 Jan 2014 17:50:55 -0000 1.47 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/LearningUtil.java 17 Jan 2014 22:04:43 -0000 1.48 @@ -76,7 +76,6 @@ generalLearnerFlowDTO.setUserNameVisible(new Boolean(qaContent.isUsernameVisible()).toString()); generalLearnerFlowDTO.setShowOtherAnswers(new Boolean(qaContent.isShowOtherAnswers()).toString()); - generalLearnerFlowDTO.setActivityOffline(new Boolean(qaContent.isRunOffline()).toString()); generalLearnerFlowDTO.setAllowRichEditor(new Boolean(qaContent.isAllowRichEditor()).toString()); generalLearnerFlowDTO.setUseSelectLeaderToolOuput(new Boolean(qaContent.isUseSelectLeaderToolOuput()).toString()); generalLearnerFlowDTO.setAllowRateAnswers(new Boolean(qaContent.isAllowRateAnswers()).toString()); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java,v diff -u -r1.34 -r1.35 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 4 Jul 2013 10:27:29 -0000 1.34 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java 17 Jan 2014 22:04:43 -0000 1.35 @@ -24,7 +24,6 @@ /* $$Id$$ */ package org.lamsfoundation.lams.tool.qa.web; -import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -44,28 +43,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.NodeKey; -import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; -import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.qa.QaAppConstants; import org.lamsfoundation.lams.tool.qa.QaCondition; import org.lamsfoundation.lams.tool.qa.QaConfigItem; import org.lamsfoundation.lams.tool.qa.QaContent; import org.lamsfoundation.lams.tool.qa.QaQueContent; -import org.lamsfoundation.lams.tool.qa.QaUploadedFile; import org.lamsfoundation.lams.tool.qa.dto.EditActivityDTO; import org.lamsfoundation.lams.tool.qa.dto.QaGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.qa.dto.QaQuestionDTO; import org.lamsfoundation.lams.tool.qa.service.IQaService; import org.lamsfoundation.lams.tool.qa.service.QaServiceProxy; -import org.lamsfoundation.lams.tool.qa.util.QaApplicationException; import org.lamsfoundation.lams.tool.qa.util.QaToolContentHandler; import org.lamsfoundation.lams.tool.qa.util.QaUtils; import org.lamsfoundation.lams.tool.qa.web.form.QaAuthoringForm; -import org.lamsfoundation.lams.util.FileValidatorUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -74,63 +66,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils; /** - * * @author Ozgur Demirtas - * - - - - - - - - - - - - - - - - - */ public class QaAction extends LamsDispatchAction implements QaAppConstants { static Logger logger = Logger.getLogger(QaAction.class.getName()); @@ -190,26 +126,6 @@ QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - if (activeModule.equals(QaAppConstants.AUTHORING)) { - List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - - String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - - String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); - - qaGeneralAuthoringDTO.setAttachmentList(attachmentList); - qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); - - String strOnlineInstructions = request.getParameter("onlineInstructions"); - String strOfflineInstructions = request.getParameter("offlineInstructions"); - qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); - qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); - - } - qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(QaAppConstants.TITLE); @@ -255,13 +171,6 @@ authoringUtil.reOrganizeDisplayOrder(qaService, qaAuthoringForm, qaContent); - if (activeModule.equals(QaAppConstants.AUTHORING)) { - - List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - List attachments = saveAttachments(qaContent, attachmentList, deletedAttachmentList, mapping, request); - } - QaUtils.setDefineLater(request, false, strToolContentID, qaService); QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID); @@ -451,29 +360,6 @@ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - if (activeModule.equals(QaAppConstants.AUTHORING)) { - String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - - qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - - String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); - - List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - - List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - - qaGeneralAuthoringDTO.setAttachmentList(attachmentList); - qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); - - String strOnlineInstructions = request.getParameter("onlineInstructions"); - String strOfflineInstructions = request.getParameter("offlineInstructions"); - qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); - qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); - - } - qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -578,26 +464,7 @@ sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - if (activeModule.equals(QaAppConstants.AUTHORING)) { - String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); - - List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - - List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - - qaGeneralAuthoringDTO.setAttachmentList(attachmentList); - qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); - - String strOnlineInstructions = request.getParameter("onlineInstructions"); - String strOfflineInstructions = request.getParameter("offlineInstructions"); - qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); - qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); - } - qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -671,12 +538,6 @@ QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, sessionMap, httpSessionID); - if (activeModule.equals(QaAppConstants.AUTHORING)) { - String strOnlineInstructions = request.getParameter("onlineInstructions"); - String strOfflineInstructions = request.getParameter("offlineInstructions"); - qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); - qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); - } qaGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); @@ -780,13 +641,6 @@ request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); - if (activeModule.equals(QaAppConstants.AUTHORING)) { - String strOnlineInstructions = request.getParameter("onlineInstructions"); - String strOfflineInstructions = request.getParameter("offlineInstructions"); - qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); - qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); - } - return mapping.findForward("editQuestionBox"); } @@ -886,25 +740,6 @@ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - if (activeModule.equals(QaAppConstants.AUTHORING)) { - String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - - String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); - - List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - - qaGeneralAuthoringDTO.setAttachmentList(attachmentList); - qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); - - String strOnlineInstructions = request.getParameter("onlineInstructions"); - String strOfflineInstructions = request.getParameter("offlineInstructions"); - qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); - qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); - } - AuthoringUtil authoringUtil = new AuthoringUtil(); qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); @@ -994,25 +829,6 @@ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - if (activeModule.equals(QaAppConstants.AUTHORING)) { - String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - - String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); - - List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - - qaGeneralAuthoringDTO.setAttachmentList(attachmentList); - qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); - - String strOnlineInstructions = request.getParameter("onlineInstructions"); - String strOfflineInstructions = request.getParameter("offlineInstructions"); - qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); - qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); - } - AuthoringUtil authoringUtil = new AuthoringUtil(); qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); @@ -1102,26 +918,6 @@ qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - if (activeModule.equals(QaAppConstants.AUTHORING)) { - String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - - String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); - - List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - - qaGeneralAuthoringDTO.setAttachmentList(attachmentList); - qaGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); - - String strOnlineInstructions = request.getParameter("onlineInstructions"); - String strOfflineInstructions = request.getParameter("offlineInstructions"); - qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); - qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); - } - AuthoringUtil authoringUtil = new AuthoringUtil(); qaGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); @@ -1150,218 +946,8 @@ return mapping.findForward(QaAppConstants.LOAD_QUESTIONS); } - /** - * adds a new file to content repository - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException - */ - public ActionForward addNewFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - - String httpSessionID = qaAuthoringForm.getHttpSessionID(); - - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - qaAuthoringForm.setContentFolderID(contentFolderID); - - String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - - String onlineInstructions = request.getParameter(QaAppConstants.ONLINE_INSTRUCTIONS); - - String offlineInstructions = request.getParameter(QaAppConstants.OFFLINE_INSTRUCTIONS); - - sessionMap.put(QaAppConstants.ONLINE_INSTRUCTIONS_KEY, onlineInstructions); - sessionMap.put(QaAppConstants.OFFLINE_INSTRUCTIONS, offlineInstructions); - - List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - - request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - - QaContent qaContent = qaService.getQa(new Long(strToolContentID).longValue()); - - QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - - qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); - - qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); - - qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); - - String richTextTitle = request.getParameter(QaAppConstants.TITLE); - String richTextInstructions = request.getParameter(QaAppConstants.INSTRUCTIONS); - - qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); - qaAuthoringForm.setTitle(richTextTitle); - - qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); - sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - - List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - - addFileToContentRepository(request, qaAuthoringForm, attachmentList, deletedAttachmentList, sessionMap, - qaGeneralAuthoringDTO); - - sessionMap.put(QaAppConstants.ATTACHMENT_LIST_KEY, attachmentList); - sessionMap.put(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY, deletedAttachmentList); - - qaGeneralAuthoringDTO.setAttachmentList(attachmentList); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, - defaultContentIdStr, activeModule, sessionMap, httpSessionID); - - qaGeneralAuthoringDTO.setToolContentID(strToolContentID); - qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - qaGeneralAuthoringDTO.setActiveModule(activeModule); - qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr); - qaAuthoringForm.setToolContentID(strToolContentID); - qaAuthoringForm.setHttpSessionID(httpSessionID); - qaAuthoringForm.setActiveModule(activeModule); - qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr); - qaAuthoringForm.setCurrentTab("3"); - - request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); - - qaAuthoringForm.resetUserAction(); - - String strOnlineInstructions = request.getParameter("onlineInstructions"); - String strOfflineInstructions = request.getParameter("offlineInstructions"); - - qaAuthoringForm.setOnlineInstructions(strOnlineInstructions); - qaAuthoringForm.setOfflineInstructions(strOfflineInstructions); - - request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); - return mapping.findForward(QaAppConstants.LOAD_QUESTIONS); - } - /** - * deletes a file from the content repository - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws IOException - * @throws ServletException - */ - public ActionForward deleteFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - QaAuthoringForm qaAuthoringForm = (QaAuthoringForm) form; - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - - String httpSessionID = qaAuthoringForm.getHttpSessionID(); - - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - qaAuthoringForm.setContentFolderID(contentFolderID); - - String activeModule = request.getParameter(QaAppConstants.ACTIVE_MODULE); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - - String defaultContentIdStr = request.getParameter(QaAppConstants.DEFAULT_CONTENT_ID_STR); - - List listQuestionContentDTO = (List) sessionMap.get(QaAppConstants.LIST_QUESTION_CONTENT_DTO_KEY); - - request.setAttribute(QaAppConstants.LIST_QUESTION_CONTENT_DTO, listQuestionContentDTO); - - QaContent qaContent = qaService.getQa(new Long(strToolContentID).longValue()); - - QaGeneralAuthoringDTO qaGeneralAuthoringDTO = new QaGeneralAuthoringDTO(); - - qaGeneralAuthoringDTO.setContentFolderID(contentFolderID); - - qaGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); - - QaUtils.setFormProperties(request, qaService, qaAuthoringForm, qaGeneralAuthoringDTO, strToolContentID, - defaultContentIdStr, activeModule, sessionMap, httpSessionID); - - String onlineInstructions = (String) sessionMap.get(QaAppConstants.ONLINE_INSTRUCTIONS_KEY); - - String offlineInstructions = (String) sessionMap.get(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY); - - qaGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - qaGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); - qaAuthoringForm.setOnlineInstructions(onlineInstructions); - qaAuthoringForm.setOfflineInstructions(offlineInstructions); - - String richTextTitle = (String) sessionMap.get(QaAppConstants.ACTIVITY_TITLE_KEY); - String richTextInstructions = (String) sessionMap.get(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY); - - qaGeneralAuthoringDTO.setActivityTitle(richTextTitle); - qaAuthoringForm.setTitle(richTextTitle); - - qaGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - - long uuid = WebUtil.readLongParam(request, QaAppConstants.UUID); - - List attachmentList = (List) sessionMap.get(QaAppConstants.ATTACHMENT_LIST_KEY); - - if (attachmentList == null) { - attachmentList = new ArrayList(); - } - - List deletedAttachmentList = (List) sessionMap.get(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY); - - if (deletedAttachmentList == null) { - deletedAttachmentList = new ArrayList(); - } - - /* - * move the file's details from the attachment collection to the deleted attachments collection the attachment - * will be delete on saving. - */ - - deletedAttachmentList = QaUtils.moveToDelete(Long.toString(uuid), attachmentList, deletedAttachmentList); - - sessionMap.put(QaAppConstants.ATTACHMENT_LIST_KEY, attachmentList); - sessionMap.put(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY, deletedAttachmentList); - - qaGeneralAuthoringDTO.setAttachmentList(attachmentList); - - request.getSession().setAttribute(httpSessionID, sessionMap); - - qaGeneralAuthoringDTO.setToolContentID(strToolContentID); - qaGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - qaGeneralAuthoringDTO.setActiveModule(activeModule); - qaGeneralAuthoringDTO.setDefaultContentIdStr(defaultContentIdStr); - qaAuthoringForm.setToolContentID(strToolContentID); - qaAuthoringForm.setHttpSessionID(httpSessionID); - qaAuthoringForm.setActiveModule(activeModule); - qaAuthoringForm.setDefaultContentIdStr(defaultContentIdStr); - qaAuthoringForm.setCurrentTab("3"); - - request.setAttribute(QaAppConstants.QA_GENERAL_AUTHORING_DTO, qaGeneralAuthoringDTO); - - request.setAttribute(QaAppConstants.TOTAL_QUESTION_COUNT, new Integer(listQuestionContentDTO.size())); - - qaAuthoringForm.resetUserAction(); - return mapping.findForward(QaAppConstants.LOAD_QUESTIONS); - } - - /** * persists error messages to request scope * * @@ -1375,94 +961,6 @@ } /** - * - * @param request - * @param qaAuthoringForm - */ - public void addFileToContentRepository(HttpServletRequest request, QaAuthoringForm qaAuthoringForm, - List attachmentList, List deletedAttachmentList, SessionMap sessionMap, - QaGeneralAuthoringDTO qaGeneralAuthoringDTO) { - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - - if (attachmentList == null) { - attachmentList = new ArrayList(); - } - - if (deletedAttachmentList == null) { - deletedAttachmentList = new ArrayList(); - } - - FormFile uploadedFile = null; - boolean isOnlineFile = false; - String fileType = null; - if (qaAuthoringForm.getTheOfflineFile() != null && qaAuthoringForm.getTheOfflineFile().getFileSize() > 0) { - //theOfflineFile is available - uploadedFile = qaAuthoringForm.getTheOfflineFile(); - fileType = IToolContentHandler.TYPE_OFFLINE; - } else if (qaAuthoringForm.getTheOnlineFile() != null && qaAuthoringForm.getTheOnlineFile().getFileSize() > 0) { - //theOnlineFile is available - uploadedFile = qaAuthoringForm.getTheOnlineFile(); - isOnlineFile = true; - fileType = IToolContentHandler.TYPE_ONLINE; - } else { - /* no file uploaded */ - return; - } - - // validate upload file size. - ActionMessages errors = new ActionMessages(); - FileValidatorUtil.validateFileSize(uploadedFile, true, errors); - if (!errors.isEmpty()) { - this.saveErrors(request, errors); - return; - } - - /* - * if a file with the same name already exists then move the old one to deleted - */ - deletedAttachmentList = QaUtils.moveToDelete(uploadedFile.getFileName(), isOnlineFile, attachmentList, - deletedAttachmentList); - - try { - /* - * This is a new file and so is saved to the content repository. Add it to the attachments collection, but - * don't add it to the tool's tables yet. - */ - NodeKey node = getToolContentHandler().uploadFile(uploadedFile.getInputStream(), - uploadedFile.getFileName(), uploadedFile.getContentType(), fileType); - QaUploadedFile file = new QaUploadedFile(); - String fileName = uploadedFile.getFileName(); - - if (fileName != null && fileName.length() > 30) { - fileName = fileName.substring(0, 31); - } - - file.setFileName(fileName); - file.setFileOnline(isOnlineFile); - file.setUuid(node.getUuid().toString()); - /* file.setVersionId(node.getVersion()); */ - - /* - * add the files to the attachment collection - if one existed, it should have already been removed. - */ - attachmentList.add(file); - - /* reset the fields so that more files can be uploaded */ - qaAuthoringForm.setTheOfflineFile(null); - qaAuthoringForm.setTheOnlineFile(null); - } catch (FileNotFoundException e) { - QaAction.logger.error("Unable to uploadfile", e); - throw new RuntimeException("Unable to upload file, exception was " + e.getMessage()); - } catch (IOException e) { - QaAction.logger.error("Unable to uploadfile", e); - throw new RuntimeException("Unable to upload file, exception was " + e.getMessage()); - } catch (RepositoryCheckedException e) { - QaAction.logger.error("Unable to uploadfile", e); - throw new RuntimeException("Unable to upload file, exception was " + e.getMessage()); - } - } - - /** * QaToolContentHandler getToolContentHandler() * * @return @@ -1476,60 +974,6 @@ return toolContentHandler; } - /** - * - * Go through the attachments collections. Remove any content repository or - * tool objects matching entries in the the deletedAttachments collection, - * add any new attachments in the attachments collection. Clear the - * deletedAttachments collection, ready for new editing. - * - * @param qaContent - * @param attachmentList - * @param deletedAttachmentList - * @param mapping - * @param request - * @return - */ - private List saveAttachments(QaContent qaContent, List attachmentList, List deletedAttachmentList, - ActionMapping mapping, HttpServletRequest request) { - - if (attachmentList == null || deletedAttachmentList == null) { - return null; - } - - IQaService qaService = QaServiceProxy.getQaService(getServlet().getServletContext()); - - if (deletedAttachmentList != null) { - Iterator iter = deletedAttachmentList.iterator(); - while (iter.hasNext()) { - QaUploadedFile attachment = (QaUploadedFile) iter.next(); - - /* remove entry from db, leave in content repository. */ - - if (attachment.getSubmissionId() != null) { - qaService.removeFile(attachment.getSubmissionId()); - } - } - deletedAttachmentList.clear(); - } - - if (attachmentList != null) { - Iterator iter = attachmentList.iterator(); - while (iter.hasNext()) { - QaUploadedFile attachment = (QaUploadedFile) iter.next(); - - if (attachment.getSubmissionId() == null) { - /* - * add entry to tool table - file already in content repository - */ - qaService.persistFile(qaContent, attachment); - } - } - } - - return deletedAttachmentList; - } - public ActionForward editActivity(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { return null; Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java,v diff -u -r1.80 -r1.81 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 8 Jan 2014 17:50:55 -0000 1.80 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningStarterAction.java 17 Jan 2014 22:04:43 -0000 1.81 @@ -291,13 +291,6 @@ return (mapping.findForward(INDIVIDUAL_LEARNER_REPORT)); } - // find out if the content is set to run offline or online. If it is set to run offline , the learners are - // informed about that. - if (qaContent.isRunOffline()) { - QaUtils.cleanUpSessionAbsolute(request); - return (mapping.findForward(RUN_OFFLINE)); - } - //check if there is submission deadline Date submissionDeadline = qaContent.getSubmissionDeadline(); if (submissionDeadline != null) { @@ -310,9 +303,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("runOffline"); + return mapping.findForward("submissionDeadline"); } } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java,v diff -u -r1.74 -r1.75 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java 8 Jan 2014 17:50:55 -0000 1.74 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringAction.java 17 Jan 2014 22:04:43 -0000 1.75 @@ -95,7 +95,6 @@ package org.lamsfoundation.lams.tool.qa.web; import java.io.IOException; -import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.LinkedList; @@ -223,17 +222,7 @@ } /* ... till here */ - /** getting instructions screen content from here... */ - generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - generalMonitoringDTO.setAttachmentList(attachmentList); - generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); - /** ...till here * */ - - request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); MonitoringUtil.setUpMonitoring(request, qaService, qaContent); @@ -329,17 +318,7 @@ } /* ... till here */ - /** getting instructions screen content from here... */ - generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - generalMonitoringDTO.setAttachmentList(attachmentList); - generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); - /** ...till here * */ - - request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); MonitoringUtil.setUpMonitoring(request, qaService, qaContent); @@ -424,17 +403,7 @@ } request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); - /** getting instructions screen content from here... */ - generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - generalMonitoringDTO.setAttachmentList(attachmentList); - generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); - /** ...till here * */ - - request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); List reflectionDTOs = qaService.getReflectList(qaContent, null); @@ -542,16 +511,6 @@ } /* ... till here */ - /* getting instructions screen content from here... */ - generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - - generalMonitoringDTO.setAttachmentList(attachmentList); - generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); - /* ...till here */ - request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); MonitoringUtil.setUpMonitoring(request, qaService, qaContent); @@ -607,17 +566,7 @@ generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - /** getting instructions screen content from here... */ - generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - generalMonitoringDTO.setAttachmentList(attachmentList); - generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); - /** ...till here * */ - - request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); List listQuestionContentDTO = new LinkedList(); @@ -1360,16 +1309,6 @@ generalMonitoringDTO.setEditResponse(new Boolean(setEditResponse).toString()); - /* getting instructions screen content from here... */ - generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - - generalMonitoringDTO.setAttachmentList(attachmentList); - generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); - /* ...till here * */ - if (generalLearnerFlowDTO != null) { generalLearnerFlowDTO.setListMonitoredAnswersContainerDTO(listMonitoredAnswersContainerDTO); @@ -1447,11 +1386,7 @@ if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - generalMonitoringDTO.setAttachmentList(attachmentList); - request.setAttribute(QaAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, generalMonitoringDTO); @@ -1842,9 +1777,6 @@ prepareEditActivityScreenData(request, qaContent); GeneralMonitoringDTO generalMonitoringDTO = new GeneralMonitoringDTO(); - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - - generalMonitoringDTO.setAttachmentList(attachmentList); if (qaService.isStudentActivityOccurredGlobal(qaContent)) { generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); @@ -2022,14 +1954,7 @@ } else { qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - - qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); @@ -2227,14 +2152,7 @@ qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - - qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); @@ -2382,14 +2300,7 @@ } else { qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - - qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); @@ -2477,14 +2388,7 @@ } else { qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - - qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); @@ -2601,15 +2505,6 @@ } else { qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - - qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - - qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - - qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); request.setAttribute(QaAppConstants.QA_GENERAL_MONITORING_DTO, qaGeneralMonitoringDTO); @@ -2753,14 +2648,7 @@ } else { qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - - qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); @@ -2888,14 +2776,7 @@ } else { qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - - qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); @@ -3025,14 +2906,7 @@ } else { qaGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - - qaGeneralMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaGeneralMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - qaGeneralMonitoringDTO.setAttachmentList(attachmentList); - qaGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java,v diff -u -r1.62 -r1.63 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java 13 Nov 2013 15:38:47 -0000 1.62 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaMonitoringStarterAction.java 17 Jan 2014 22:04:43 -0000 1.63 @@ -25,7 +25,6 @@ package org.lamsfoundation.lams.tool.qa.web; import java.io.IOException; -import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -122,16 +121,6 @@ qaMonitoringForm.setActiveModule(MONITORING); qaMonitoringForm.setEditResponse(new Boolean(false).toString()); - /** getting instructions screen content from here... */ - generalMonitoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - generalMonitoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - - generalMonitoringDTO.setAttachmentList(attachmentList); - generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); - /** ...till here * */ - EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = qaContent.isContentLocked(); if (isContentInUse == true) { Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaPedagogicalPlannerAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaPedagogicalPlannerAction.java,v diff -u -r1.9 -r1.10 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaPedagogicalPlannerAction.java 4 Jul 2013 10:27:29 -0000 1.9 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaPedagogicalPlannerAction.java 17 Jan 2014 22:04:43 -0000 1.10 @@ -30,7 +30,6 @@ import javax.servlet.http.HttpServletResponse; 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; Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java,v diff -u -r1.78 -r1.79 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 8 Jan 2014 17:50:55 -0000 1.78 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaStarterAction.java 17 Jan 2014 22:04:43 -0000 1.79 @@ -124,7 +124,6 @@ package org.lamsfoundation.lams.tool.qa.web; import java.io.IOException; -import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -236,8 +235,6 @@ SessionMap sessionMap = new SessionMap(); List sequentialCheckedCa = new LinkedList(); - sessionMap.put(QaAppConstants.ATTACHMENT_LIST_KEY, new ArrayList()); - sessionMap.put(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY, new ArrayList()); sessionMap.put(QaAppConstants.ACTIVITY_TITLE_KEY, ""); sessionMap.put(QaAppConstants.ACTIVITY_INSTRUCTIONS_KEY, ""); qaAuthoringForm.setHttpSessionID(sessionMap.getSessionID()); @@ -302,20 +299,6 @@ strToolContentID).longValue(), false, qaService, qaGeneralAuthoringDTO, sessionMap); } - if (qaGeneralAuthoringDTO.getOnlineInstructions() == null - || qaGeneralAuthoringDTO.getOnlineInstructions().length() == 0) { - qaGeneralAuthoringDTO.setOnlineInstructions(QaAppConstants.DEFAULT_ONLINE_INST); - qaAuthoringForm.setOnlineInstructions(QaAppConstants.DEFAULT_ONLINE_INST); - sessionMap.put(QaAppConstants.ONLINE_INSTRUCTIONS_KEY, QaAppConstants.DEFAULT_ONLINE_INST); - } - - if (qaGeneralAuthoringDTO.getOfflineInstructions() == null - || qaGeneralAuthoringDTO.getOfflineInstructions().length() == 0) { - qaGeneralAuthoringDTO.setOfflineInstructions(QaAppConstants.DEFAULT_OFFLINE_INST); - qaAuthoringForm.setOfflineInstructions(QaAppConstants.DEFAULT_OFFLINE_INST); - sessionMap.put(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY, QaAppConstants.DEFAULT_OFFLINE_INST); - } - SortedSet conditionList = getQaConditionList(sessionMap); conditionList.clear(); conditionList.addAll(qaContent.getConditions()); @@ -373,13 +356,6 @@ qaAuthoringForm.setReflectionSubject(qaContent.getReflectionSubject()); qaGeneralAuthoringDTO.setReflectionSubject(qaContent.getReflectionSubject()); - List attachmentList = qaService.retrieveQaUploadedFiles(qaContent); - qaGeneralAuthoringDTO.setAttachmentList(attachmentList); - qaGeneralAuthoringDTO.setDeletedAttachmentList(new ArrayList()); - - sessionMap.put(QaAppConstants.ATTACHMENT_LIST_KEY, attachmentList); - sessionMap.put(QaAppConstants.DELETED_ATTACHMENT_LIST_KEY, new ArrayList()); - qaGeneralAuthoringDTO.setIsDefineLater(new Boolean(qaContent.isDefineLater()).toString()); qaGeneralAuthoringDTO.setActivityTitle(qaContent.getTitle()); @@ -437,14 +413,6 @@ } - qaGeneralAuthoringDTO.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaGeneralAuthoringDTO.setOfflineInstructions(qaContent.getOfflineInstructions()); - - qaAuthoringForm.setOnlineInstructions(qaContent.getOnlineInstructions()); - qaAuthoringForm.setOfflineInstructions(qaContent.getOfflineInstructions()); - sessionMap.put(QaAppConstants.ONLINE_INSTRUCTIONS_KEY, qaContent.getOnlineInstructions()); - sessionMap.put(QaAppConstants.OFFLINE_INSTRUCTIONS_KEY, qaContent.getOfflineInstructions()); - qaAuthoringForm.resetUserAction(); return qaContent; Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java,v diff -u -r1.3 -r1.4 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java 8 Jan 2014 17:50:55 -0000 1.3 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/form/QaAuthoringForm.java 17 Jan 2014 22:04:44 -0000 1.4 @@ -25,7 +25,6 @@ /* ActionForm for the Authoring environment*/ import org.apache.commons.lang.builder.ToStringBuilder; -import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.tool.qa.QaAppConstants; import org.lamsfoundation.lams.tool.qa.service.IQaService; @@ -41,8 +40,6 @@ protected String removeAllContent; protected String submitAllContent; protected String submitTabDone; - protected String submitOfflineFile; - protected String submitOnlineFile; protected String dispatch; protected String currentTab; @@ -59,12 +56,6 @@ protected String questionIndex; protected String isRemoveContent; - /* instructions content */ - protected String onlineInstructions; - protected String offlineInstructions; - protected FormFile theOfflineFile; - protected FormFile theOnlineFile; - protected String toolContentID; /* advanced content */ protected String synchInMonitor; @@ -106,8 +97,6 @@ this.removeAllContent = null; this.submitAllContent = null; this.submitTabDone = null; - this.submitOfflineFile = null; - this.submitOnlineFile = null; this.summaryMonitoring = null; this.instructionsMonitoring = null; @@ -124,8 +113,6 @@ this.removeAllContent = null; this.submitAllContent = null; this.submitTabDone = null; - this.submitOfflineFile = null; - this.submitOnlineFile = null; this.choice = null; this.choiceBasic = null; @@ -137,9 +124,6 @@ this.questionIndex = null; this.isRemoveContent = null; - this.onlineInstructions = null; - this.offlineInstructions = null; - this.endLearningMessage = null; this.synchInMonitor = null; this.reportTitle = null; @@ -177,8 +161,8 @@ .append("activeModule: ", activeModule).append("defaultContentIdStr: ", defaultContentIdStr) .append("title: ", title).append("instructions: ", instructions).append("reportTitle: ", reportTitle) .append("monitoringReportTitle: ", monitoringReportTitle) - .append("endLearningMessage: ", endLearningMessage).append("onlineInstructions: ", onlineInstructions) - .append("offlineInstructions: ", offlineInstructions).append("usernameVisible: ", usernameVisible) + .append("endLearningMessage: ", endLearningMessage) + .append("usernameVisible: ", usernameVisible) .append("allowRateAnswers: ", allowRateAnswers).append("showOtherAnswers: ", showOtherAnswers) .append("synchInMonitor: ", synchInMonitor).append("questionsSequenced: ", questionsSequenced) .append("lockWhenFinished: ", lockWhenFinished).append("reflect: ", reflect) @@ -306,36 +290,6 @@ } /** - * @return Returns the offlineInstructions. - */ - public String getOfflineInstructions() { - return offlineInstructions; - } - - /** - * @param offlineInstructions - * The offlineInstructions to set. - */ - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; - } - - /** - * @return Returns the onlineInstructions. - */ - public String getOnlineInstructions() { - return onlineInstructions; - } - - /** - * @param onlineInstructions - * The onlineInstructions to set. - */ - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; - } - - /** * @return Returns the syncInMonitor. */ public String getSynchInMonitor() { @@ -591,66 +545,6 @@ } /** - * @return Returns the submitOfflineFile. - */ - public String getSubmitOfflineFile() { - return submitOfflineFile; - } - - /** - * @param submitOfflineFile - * The submitOfflineFile to set. - */ - public void setSubmitOfflineFile(String submitOfflineFile) { - this.submitOfflineFile = submitOfflineFile; - } - - /** - * @param theOfflineFile - * The theOfflineFile to set. - */ - public void setTheOfflineFile(FormFile theOfflineFile) { - this.theOfflineFile = theOfflineFile; - } - - /** - * @param theOnlineFile - * The theOnlineFile to set. - */ - public void setTheOnlineFile(FormFile theOnlineFile) { - this.theOnlineFile = theOnlineFile; - } - - /** - * @return Returns the theOfflineFile. - */ - public FormFile getTheOfflineFile() { - return theOfflineFile; - } - - /** - * @return Returns the theOnlineFile. - */ - public FormFile getTheOnlineFile() { - return theOnlineFile; - } - - /** - * @return Returns the submitOnlineFile. - */ - public String getSubmitOnlineFile() { - return submitOnlineFile; - } - - /** - * @param submitOnlineFile - * The submitOnlineFile to set. - */ - public void setSubmitOnlineFile(String submitOnlineFile) { - this.submitOnlineFile = submitOnlineFile; - } - - /** * @return Returns the dispatch. */ public String getDispatch() { Index: lams_tool_laqa/web/WEB-INF/struts-config.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/WEB-INF/struts-config.xml,v diff -u -r1.50 -r1.51 --- lams_tool_laqa/web/WEB-INF/struts-config.xml 8 Jan 2014 17:50:56 -0000 1.50 +++ lams_tool_laqa/web/WEB-INF/struts-config.xml 17 Jan 2014 22:04:44 -0000 1.51 @@ -262,8 +262,8 @@ /> Index: lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp,v diff -u -r1.31 -r1.32 --- lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp 28 Feb 2011 12:21:58 -0000 1.31 +++ lams_tool_laqa/web/authoring/AuthoringTabsHolder.jsp 17 Jan 2014 22:04:44 -0000 1.32 @@ -32,7 +32,6 @@ Set tabs = new LinkedHashSet(); tabs.add("label.basic"); tabs.add("label.advanced"); - tabs.add("label.instructions"); tabs.add("label.conditions"); pageContext.setAttribute("tabs", tabs); @@ -141,13 +140,9 @@ - - - - - - + + Fisheye: Tag 1.23 refers to a dead (removed) revision in file `lams_tool_laqa/web/authoring/InstructionsContent.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_laqa/web/learning/AnswersContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/AnswersContent.jsp,v diff -u -r1.36 -r1.37 --- lams_tool_laqa/web/learning/AnswersContent.jsp 8 Jan 2014 17:50:56 -0000 1.36 +++ lams_tool_laqa/web/learning/AnswersContent.jsp 17 Jan 2014 22:04:44 -0000 1.37 @@ -150,57 +150,47 @@

- -

- -

-
- - -

- + + + - - - - -

+ + +

- + -

+

-
+
+ + +

+ + +

+
- -

- - -

-
+ + - - + - + +   + + - -   - - + + + - - - - -
Fisheye: Tag 1.23 refers to a dead (removed) revision in file `lams_tool_laqa/web/learning/RunOffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_laqa/web/learning/submissionDeadline.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/submissionDeadline.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_laqa/web/learning/submissionDeadline.jsp 17 Jan 2014 22:04:44 -0000 1.1 @@ -0,0 +1,100 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + + <fmt:message key="activity.title" /> + + + + + + + + + + + + + + +
+ +

+ +

+ +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + +
+ + + + + + + + Index: lams_tool_laqa/web/learning/mobile/AnswersContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/mobile/AnswersContent.jsp,v diff -u -r1.4 -r1.5 --- lams_tool_laqa/web/learning/mobile/AnswersContent.jsp 8 Jan 2014 17:50:54 -0000 1.4 +++ lams_tool_laqa/web/learning/mobile/AnswersContent.jsp 17 Jan 2014 22:04:44 -0000 1.5 @@ -155,50 +155,43 @@

+ +

+ +

+ + + - -

- -

-
- - -

- -

- - - - - -

- - -

-
-
- - -

- + + +

+

+
- -
+ +

+ + +

+
- - -   - - - - -
- + + + + +   + + + + + + Fisheye: Tag 1.5 refers to a dead (removed) revision in file `lams_tool_laqa/web/learning/mobile/RunOffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_laqa/web/learning/mobile/submissionDeadline.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/learning/mobile/submissionDeadline.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_laqa/web/learning/mobile/submissionDeadline.jsp 17 Jan 2014 22:04:43 -0000 1.1 @@ -0,0 +1,99 @@ + + + +<%@ include file="/common/taglibs.jsp"%> + + + + + + + + + + + + + <fmt:message key="activity.title" /> + + + + + + + + + +
+ +
+

+ +

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

 

+
+ +
+ +
Fisheye: Tag 1.19 refers to a dead (removed) revision in file `lams_tool_laqa/web/monitoring/Instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp,v diff -u -r1.35 -r1.36 --- lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp 19 Feb 2013 10:51:15 -0000 1.35 +++ lams_tool_laqa/web/monitoring/MonitoringMaincontent.jsp 17 Jan 2014 22:04:44 -0000 1.36 @@ -29,7 +29,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); @@ -214,9 +213,8 @@ - - - + + Index: lams_tool_larsrc/conf/xdoclet/struts-actions.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/conf/xdoclet/struts-actions.xml,v diff -u -r1.34 -r1.35 --- lams_tool_larsrc/conf/xdoclet/struts-actions.xml 18 Aug 2009 04:29:08 -0000 1.34 +++ lams_tool_larsrc/conf/xdoclet/struts-actions.xml 17 Jan 2014 22:06:34 -0000 1.35 @@ -36,39 +36,6 @@ - - - - - - - - - - - - - - - +
@@ -116,11 +104,7 @@ - - - - <%-- Default value cancelButtonLabelKey="label.authoring.cancel.button" Fisheye: Tag 1.14 refers to a dead (removed) revision in file `lams_tool_larsrc/web/pages/authoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_larsrc/web/pages/authoring/parts/instructionfilelist.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.17 refers to a dead (removed) revision in file `lams_tool_larsrc/web/pages/learning/runoffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_larsrc/web/pages/learning/mobile/runoffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7 refers to a dead (removed) revision in file `lams_tool_larsrc/web/pages/monitoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_larsrc/web/pages/monitoring/monitoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/web/pages/monitoring/monitoring.jsp,v diff -u -r1.18 -r1.19 --- lams_tool_larsrc/web/pages/monitoring/monitoring.jsp 2 May 2008 07:43:35 -0000 1.18 +++ lams_tool_larsrc/web/pages/monitoring/monitoring.jsp 17 Jan 2014 22:06:33 -0000 1.19 @@ -37,18 +37,16 @@
- - - + +
Index: lams_tool_leader/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.1 -r1.2 --- lams_tool_leader/conf/language/lams/ApplicationResources_en_AU.properties 8 Jan 2014 20:13:50 -0000 1.1 +++ lams_tool_leader/conf/language/lams/ApplicationResources_en_AU.properties 17 Jan 2014 22:06:30 -0000 1.2 @@ -4,7 +4,7 @@ # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu Aug 30 09:17:50 CST 2012 -#=================== labels for Notebook =================# +#=================== labels for Leaderselection =================# tool.display.name =Leader Selection tool.description =Leader Selection Tool @@ -15,9 +15,7 @@ button.basic =Basic label.authoring.basic.title =Title: label.authoring.basic.instructions =Instructions: -message.unsavedChanges =Page contains unsaved changes message.defineLaterSet =Please wait for the instructor to complete the contents of this activity -message.runOfflineSet =This activity is not being done on the computer. Please see your instructor for details. pageTitle.monitoring =Leader Selection Monitoring button.summary =Summary button.editActivity =Edit Activity Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/leaderselectionApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/leaderselectionApplicationContext.xml,v diff -u -r1.1 -r1.2 --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/leaderselectionApplicationContext.xml 8 Jan 2014 20:13:51 -0000 1.1 +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/leaderselectionApplicationContext.xml 17 Jan 2014 22:06:30 -0000 1.2 @@ -49,8 +49,6 @@ PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED - PROPAGATION_REQUIRED - PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/dbupdates/patch20140102.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/dbupdates/patch20140102.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/dbupdates/patch20140102.sql 17 Jan 2014 22:06:30 -0000 1.1 @@ -0,0 +1,16 @@ +-- 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_lalead11_leaderselection DROP COLUMN run_offline; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lalead11'; + +----------------------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_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/model/Leaderselection.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/model/Leaderselection.java,v diff -u -r1.1 -r1.2 --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/model/Leaderselection.java 8 Jan 2014 20:13:46 -0000 1.1 +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/model/Leaderselection.java 17 Jan 2014 22:06:30 -0000 1.2 @@ -56,8 +56,6 @@ private String instructions; - private boolean runOffline; - private boolean contentInUse; private boolean defineLater; @@ -140,18 +138,6 @@ } /** - * @hibernate.property column="run_offline" length="1" - * - */ - public boolean isRunOffline() { - return runOffline; - } - - public void setRunOffline(boolean runOffline) { - this.runOffline = runOffline; - } - - /** * @hibernate.property column="content_in_use" length="1" * */ Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionImportContentVersionFilter.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionImportContentVersionFilter.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionImportContentVersionFilter.java 17 Jan 2014 22:06:30 -0000 1.1 @@ -0,0 +1,40 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License 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: LeaderselectionImportContentVersionFilter.java,v 1.1 2014/01/17 22:06:30 andreyb Exp $ */ +package org.lamsfoundation.lams.tool.leaderselection.service; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.leaderselection.model.Leaderselection; + +/** + * Import filter class for different version of Leaderselection content. + */ +public class LeaderselectionImportContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20130422 version content to 20140102 version tool server. + */ + public void up20130422To20140102() { + this.removeField(Leaderselection.class, "runOffline"); + } +} Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionService.java,v diff -u -r1.1 -r1.2 --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionService.java 8 Jan 2014 20:13:49 -0000 1.1 +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/service/LeaderselectionService.java 17 Jan 2014 22:06:30 -0000 1.2 @@ -24,22 +24,15 @@ package org.lamsfoundation.lams.tool.leaderselection.service; -import java.io.FileNotFoundException; -import java.io.IOException; import java.util.Hashtable; import java.util.List; 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; @@ -70,7 +63,6 @@ import org.lamsfoundation.lams.tool.leaderselection.util.LeaderselectionToolContentHandler; import org.lamsfoundation.lams.tool.service.ILamsToolService; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; -import org.lamsfoundation.lams.util.audit.IAuditService; /** * An implementation of the ILeaderselectionService interface. @@ -81,7 +73,7 @@ public class LeaderselectionService implements ToolSessionManager, ToolContentManager, ILeaderselectionService, ToolContentImport102Manager { - static Logger logger = Logger.getLogger(LeaderselectionService.class.getName()); + private static Logger logger = Logger.getLogger(LeaderselectionService.class.getName()); private ILeaderselectionDAO leaderselectionDAO = null; @@ -184,26 +176,6 @@ } @Override - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Leaderselection content = leaderselectionDAO.getByContentId(toolContentId); - if (content == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - content.setDefineLater(value); - leaderselectionDAO.saveOrUpdate(content); - } - - @Override - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Leaderselection content = leaderselectionDAO.getByContentId(toolContentId); - if (content == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - content.setRunOffline(value); - leaderselectionDAO.saveOrUpdate(content); - } - - @Override public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { } @@ -233,6 +205,8 @@ public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, String toVersion) throws ToolException { try { + // register version filter class + exportContentService.registerImportVersionFilterClass(LeaderselectionImportContentVersionFilter.class); Object toolPOJO = exportContentService.importToolContent(toolContentPath, leaderselectionToolContentHandler, fromVersion, toVersion); Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/actions/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/actions/LearningAction.java,v diff -u -r1.1 -r1.2 --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/actions/LearningAction.java 8 Jan 2014 20:13:51 -0000 1.1 +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/actions/LearningAction.java 17 Jan 2014 22:06:30 -0000 1.2 @@ -56,7 +56,6 @@ /** * @struts.action path="/learning" parameter="dispatch" scope="request" * @struts.action-forward name="leaderselection" 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 { @@ -101,11 +100,6 @@ LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionId, request, getServlet() .getServletContext()); - // check runOffline - if (content.isRunOffline()) { - return mapping.findForward("runOffline"); - } - LeaderselectionUser user; if (mode.equals(ToolAccessMode.TEACHER)) { Long userID = WebUtil.readLongParam(request, AttributeNames.PARAM_USER_ID, false); Index: lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/servlets/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/servlets/ExportServlet.java,v diff -u -r1.1 -r1.2 --- lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/servlets/ExportServlet.java 8 Jan 2014 20:13:46 -0000 1.1 +++ lams_tool_leader/src/java/org/lamsfoundation/lams/tool/leaderselection/web/servlets/ExportServlet.java 17 Jan 2014 22:06:30 -0000 1.2 @@ -82,30 +82,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 (leaderselectionService == null) { - leaderselectionService = LeaderselectionServiceProxy.getLeaderselectionService(getServletContext()); - } - - Leaderselection content = null; - if (toolContentID != null) { - content = leaderselectionService.getContentByContentId(toolContentID); - } else { - LeaderselectionSession session = leaderselectionService.getSessionBySessionId(toolSessionID); - if (session != null) - content = session.getLeaderselection(); - } - if (content != null) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); - } - private void doLearnerExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) throws LeaderselectionException { Index: lams_tool_leader/web/WEB-INF/tiles-defs.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/web/WEB-INF/tiles-defs.xml,v diff -u -r1.1 -r1.2 --- lams_tool_leader/web/WEB-INF/tiles-defs.xml 8 Jan 2014 20:13:48 -0000 1.1 +++ lams_tool_leader/web/WEB-INF/tiles-defs.xml 17 Jan 2014 22:06:30 -0000 1.2 @@ -63,11 +63,6 @@ - - - - - Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_leader/web/WEB-INF/tags/DefineLater.tag'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_leader/web/WEB-INF/tlds/lams/lams.tld =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/web/WEB-INF/tlds/lams/lams.tld,v diff -u -r1.1 -r1.2 --- lams_tool_leader/web/WEB-INF/tlds/lams/lams.tld 8 Jan 2014 20:13:47 -0000 1.1 +++ lams_tool_leader/web/WEB-INF/tlds/lams/lams.tld 17 Jan 2014 22:06:30 -0000 1.2 @@ -436,10 +436,6 @@ /WEB-INF/tags/Date.tag - DefineLater - /WEB-INF/tags/DefineLater.tag - - ImgButtonWrapper /WEB-INF/tags/ImgButtonWrapper.tag Index: lams_tool_leader/web/pages/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_leader/web/pages/authoring/authoring.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_leader/web/pages/authoring/authoring.jsp 8 Jan 2014 20:13:51 -0000 1.1 +++ lams_tool_leader/web/pages/authoring/authoring.jsp 17 Jan 2014 22:06:30 -0000 1.2 @@ -28,9 +28,6 @@
- - -

Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_leader/web/pages/learning/runOffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_leader/web/pages/learning/mobile/runOffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/mindmapApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/mindmapApplicationContext.xml,v diff -u -r1.1 -r1.2 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/mindmapApplicationContext.xml 3 Apr 2009 00:00:31 -0000 1.1 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/mindmapApplicationContext.xml 17 Jan 2014 22:06:37 -0000 1.2 @@ -25,7 +25,6 @@ - @@ -38,7 +37,6 @@ - @@ -53,8 +51,6 @@ PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED - PROPAGATION_REQUIRED - PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED @@ -86,10 +82,6 @@ - - - - Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/IMindmapAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/IMindmapDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/IMindmapDAO.java,v diff -u -r1.1 -r1.2 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/IMindmapDAO.java 3 Apr 2009 00:00:38 -0000 1.1 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/IMindmapDAO.java 17 Jan 2014 22:06:36 -0000 1.2 @@ -39,7 +39,5 @@ void saveOrUpdate(Mindmap toContent); - void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type); - void releaseFromCache(Object o); } Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapDAO.java,v diff -u -r1.1 -r1.2 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapDAO.java 3 Apr 2009 00:00:30 -0000 1.1 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapDAO.java 17 Jan 2014 22:06:37 -0000 1.2 @@ -26,22 +26,16 @@ import java.util.List; -import org.hibernate.FlushMode; import org.lamsfoundation.lams.dao.hibernate.BaseDAO; import org.lamsfoundation.lams.tool.mindmap.dao.IMindmapDAO; import org.lamsfoundation.lams.tool.mindmap.model.Mindmap; -import org.lamsfoundation.lams.tool.mindmap.model.MindmapAttachment; -import org.springframework.orm.hibernate3.HibernateTemplate; /** * DAO for accessing the Mindmap objects - Hibernate specific code. */ public class MindmapDAO extends BaseDAO implements IMindmapDAO { private static final String FIND_MINDMAP_BY_CONTENTID = "from Mindmap mindmap where mindmap.toolContentId = ?"; - - private static final String FIND_INSTRUCTION_FILE = "from " + MindmapAttachment.class.getName() - + " as i where tool_content_id=? and i.file_uuid=? and i.file_version_id=? and i.file_type=?"; private static final String FIND_MINDMAP_BY_UID = "from Mindmap mindmap where mindmap.uid = ?"; @@ -69,22 +63,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(MindmapDAO.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) { - MindmapAttachment file = (MindmapAttachment) list.get(0); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(file); - templ.flush(); - } - } - - } - public void releaseFromCache(Object o) { getSession().evict(o); Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapRequestDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapRequestDAO.java,v diff -u -r1.3 -r1.4 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapRequestDAO.java 12 May 2009 01:39:01 -0000 1.3 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapRequestDAO.java 17 Jan 2014 22:06:37 -0000 1.4 @@ -25,6 +25,7 @@ package org.lamsfoundation.lams.tool.mindmap.dao.hibernate; import java.util.List; + import org.lamsfoundation.lams.dao.hibernate.BaseDAO; import org.lamsfoundation.lams.tool.mindmap.dao.IMindmapRequestDAO; import org.lamsfoundation.lams.tool.mindmap.model.MindmapRequest; Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dbupdates/patch20140102.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dbupdates/patch20140102.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dbupdates/patch20140102.sql 17 Jan 2014 22:06:37 -0000 1.1 @@ -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_lamind10_mindmap DROP COLUMN online_instructions; +ALTER TABLE tl_lamind10_mindmap DROP COLUMN offline_instructions; +ALTER TABLE tl_lamind10_mindmap DROP COLUMN run_offline; +DROP TABLE IF EXISTS tl_lamind10_attachment; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lamind10'; + +----------------------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 1.2 refers to a dead (removed) revision in file `lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dto/MindmapAttachmentDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dto/MindmapDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dto/MindmapDTO.java,v diff -u -r1.2 -r1.3 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dto/MindmapDTO.java 14 Apr 2009 00:46:15 -0000 1.2 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dto/MindmapDTO.java 17 Jan 2014 22:06:36 -0000 1.3 @@ -30,9 +30,7 @@ import java.util.TreeSet; import org.apache.log4j.Logger; -import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.tool.mindmap.model.Mindmap; -import org.lamsfoundation.lams.tool.mindmap.model.MindmapAttachment; import org.lamsfoundation.lams.tool.mindmap.model.MindmapSession; public class MindmapDTO { @@ -42,14 +40,10 @@ public Long toolContentId; public String title; public String instructions; - public String onlineInstructions; - public String offlineInstructions; public boolean defineLater; public boolean contentInUse; public boolean lockOnFinish; public boolean multiUserMode; - public Set onlineInstructionsFiles; - public Set offlineInstructionsFiles; public Set sessionDTOs = new TreeSet(); public Long currentTab; // reflection @@ -64,31 +58,12 @@ toolContentId = mindmap.getToolContentId(); title = mindmap.getTitle(); instructions = mindmap.getInstructions(); - onlineInstructions = mindmap.getOnlineInstructions(); - offlineInstructions = mindmap.getOfflineInstructions(); contentInUse = mindmap.isContentInUse(); lockOnFinish = mindmap.isLockOnFinished(); multiUserMode = mindmap.isMultiUserMode(); reflectOnActivity = mindmap.isReflectOnActivity(); reflectInstructions = mindmap.getReflectInstructions(); - onlineInstructionsFiles = new TreeSet(); - offlineInstructionsFiles = new TreeSet(); - - for (Iterator i = mindmap.getMindmapAttachments().iterator(); i.hasNext();) { - MindmapAttachment att = (MindmapAttachment) i.next(); - if (att.getFileType().equals(IToolContentHandler.TYPE_OFFLINE)) { - MindmapAttachmentDTO attDTO = new MindmapAttachmentDTO(att); - offlineInstructionsFiles.add(attDTO); - } else if (att.getFileType().equals(IToolContentHandler.TYPE_ONLINE)) { - MindmapAttachmentDTO attDTO = new MindmapAttachmentDTO(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 = mindmap.getMindmapSessions().iterator(); iter.hasNext();) { MindmapSession session = (MindmapSession) iter.next(); MindmapSessionDTO sessionDTO = new MindmapSessionDTO(session); @@ -114,38 +89,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_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/model/Mindmap.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/model/Mindmap.java,v diff -u -r1.4 -r1.5 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/model/Mindmap.java 18 May 2011 16:43:24 -0000 1.4 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/model/Mindmap.java 17 Jan 2014 22:06:37 -0000 1.5 @@ -26,12 +26,11 @@ import java.util.Date; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; import org.apache.log4j.Logger; -import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; //import org.lamsfoundation.lams.learningdesign.TextSearchConditionComparator; import org.lamsfoundation.lams.tool.mindmap.service.MindmapService; +//import org.lamsfoundation.lams.learningdesign.TextSearchConditionComparator; /** * @hibernate.class table="tl_lamind10_mindmap" @@ -49,24 +48,17 @@ private Long createBy; private String title; private String instructions; - private boolean runOffline; private boolean lockOnFinished; private boolean multiUserMode; - private String onlineInstructions; - private String offlineInstructions; private boolean contentInUse; private boolean defineLater; private Long toolContentId; - private String mindmapExportContent; - private Set mindmapAttachments; + private String mindmapExportContent; private Set mindmapSessions; private boolean reflectOnActivity; private String reflectInstructions; - // *********** NON Persisit fields - private IToolContentHandler toolContentHandler; - // Constructors /** default constructor */ @@ -75,22 +67,17 @@ /** full constructor */ public Mindmap(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 mindmapAttachments, Set mindmapSessions) { + boolean lockOnFinished, boolean filteringEnabled, String filterKeywords, boolean contentInUse, + boolean defineLater, Long toolContentId, Set mindmapSessions) { 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.mindmapAttachments = mindmapAttachments; this.mindmapSessions = mindmapSessions; } @@ -187,18 +174,6 @@ } /** - * @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" * */ @@ -223,30 +198,6 @@ } /** - * @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" * */ @@ -315,20 +266,6 @@ } /** - * @hibernate.set lazy="true" inverse="false" cascade="all-delete-orphan" - * @hibernate.collection-key column="mindmap_uid" - * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.mindmap.model.MindmapAttachment" - * - */ - public Set getMindmapAttachments() { - return mindmapAttachments; - } - - public void setMindmapAttachments(Set mindmapAttachments) { - this.mindmapAttachments = mindmapAttachments; - } - - /** * @hibernate.set lazy="true" inverse="true" cascade="none" * @hibernate.collection-key column="mindmap_uid" * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.mindmap.model.MindmapSession" @@ -384,10 +321,8 @@ return result; } - public static Mindmap newInstance(Mindmap fromContent, Long toContentId, - IToolContentHandler mindmapToolContentHandler) { + public static Mindmap newInstance(Mindmap fromContent, Long toContentId) { Mindmap toContent = new Mindmap(); - fromContent.toolContentHandler = mindmapToolContentHandler; toContent = (Mindmap) fromContent.clone(); toContent.setToolContentId(toContentId); toContent.setCreateDate(new Date()); @@ -402,17 +337,6 @@ mindmap = (Mindmap) super.clone(); mindmap.setUid(null); - if (mindmapAttachments != null) { - // create a copy of the attachments - Iterator iter = mindmapAttachments.iterator(); - Set set = new HashSet(); - while (iter.hasNext()) { - MindmapAttachment originalFile = (MindmapAttachment) iter.next(); - MindmapAttachment newFile = (MindmapAttachment) originalFile.clone(); - set.add(newFile); - } - mindmap.mindmapAttachments = set; - } // create an empty set for the mindmapSession mindmap.mindmapSessions = new HashSet(); @@ -421,12 +345,4 @@ } return mindmap; } - - public IToolContentHandler getToolContentHandler() { - return toolContentHandler; - } - - public void setToolContentHandler(IToolContentHandler toolContentHandler) { - this.toolContentHandler = toolContentHandler; - } } Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/model/MindmapAttachment.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/IMindmapService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/IMindmapService.java,v diff -u -r1.4 -r1.5 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/IMindmapService.java 12 May 2009 01:39:00 -0000 1.4 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/IMindmapService.java 17 Jan 2014 22:06:37 -0000 1.5 @@ -25,15 +25,13 @@ package org.lamsfoundation.lams.tool.mindmap.service; import java.util.List; -import org.apache.struts.upload.FormFile; + import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.mindmap.model.Mindmap; -import org.lamsfoundation.lams.tool.mindmap.model.MindmapAttachment; import org.lamsfoundation.lams.tool.mindmap.model.MindmapNode; import org.lamsfoundation.lams.tool.mindmap.model.MindmapRequest; import org.lamsfoundation.lams.tool.mindmap.model.MindmapSession; import org.lamsfoundation.lams.tool.mindmap.model.MindmapUser; -import org.lamsfoundation.lams.tool.mindmap.util.MindmapException; import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NodeModel; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.MessageService; @@ -53,12 +51,6 @@ public Mindmap getMindmapByUid(Long Uid); - public MindmapAttachment uploadFileToContent(Long toolContentId, FormFile file, String type); - - public void deleteFromRepository(Long uuid, Long versionID) throws MindmapException; - - public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type); - public void saveOrUpdateMindmap(Mindmap mindmap); public MindmapSession getSessionBySessionId(Long toolSessionId); Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapImportContentVersionFilter.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapImportContentVersionFilter.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapImportContentVersionFilter.java 17 Jan 2014 22:06:37 -0000 1.1 @@ -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: MindmapImportContentVersionFilter.java,v 1.1 2014/01/17 22:06:37 andreyb Exp $ */ +package org.lamsfoundation.lams.tool.mindmap.service; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.mindmap.model.Mindmap; + +/** + * Import filter class for different version of Mindmap content. + */ +public class MindmapImportContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20110414 version content to 20140102 version tool server. + */ + public void up20110414To20140102() { + this.removeField(Mindmap.class, "runOffline"); + this.removeField(Mindmap.class, "onlineInstructions"); + this.removeField(Mindmap.class, "offlineInstructions"); + this.removeField(Mindmap.class, "mindmapAttachments"); + } +} Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java,v diff -u -r1.10 -r1.11 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java 29 Jul 2013 23:11:45 -0000 1.10 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java 17 Jan 2014 22:06:37 -0000 1.11 @@ -24,30 +24,15 @@ package org.lamsfoundation.lams.tool.mindmap.service; -import java.io.FileNotFoundException; -import java.io.IOException; import java.util.ArrayList; import java.util.Date; import java.util.Hashtable; import java.util.Iterator; import java.util.List; -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.learning.service.ILearnerService; import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; @@ -63,21 +48,18 @@ import org.lamsfoundation.lams.tool.exception.DataMissingException; import org.lamsfoundation.lams.tool.exception.SessionDataExistsException; import org.lamsfoundation.lams.tool.exception.ToolException; -import org.lamsfoundation.lams.tool.mindmap.dao.IMindmapAttachmentDAO; import org.lamsfoundation.lams.tool.mindmap.dao.IMindmapDAO; import org.lamsfoundation.lams.tool.mindmap.dao.IMindmapNodeDAO; import org.lamsfoundation.lams.tool.mindmap.dao.IMindmapRequestDAO; import org.lamsfoundation.lams.tool.mindmap.dao.IMindmapSessionDAO; import org.lamsfoundation.lams.tool.mindmap.dao.IMindmapUserDAO; import org.lamsfoundation.lams.tool.mindmap.model.Mindmap; -import org.lamsfoundation.lams.tool.mindmap.model.MindmapAttachment; import org.lamsfoundation.lams.tool.mindmap.model.MindmapNode; import org.lamsfoundation.lams.tool.mindmap.model.MindmapRequest; import org.lamsfoundation.lams.tool.mindmap.model.MindmapSession; import org.lamsfoundation.lams.tool.mindmap.model.MindmapUser; import org.lamsfoundation.lams.tool.mindmap.util.MindmapConstants; import org.lamsfoundation.lams.tool.mindmap.util.MindmapException; -import org.lamsfoundation.lams.tool.mindmap.util.MindmapToolContentHandler; import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NodeConceptModel; import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NodeModel; import org.lamsfoundation.lams.tool.service.ILamsToolService; @@ -97,18 +79,14 @@ static Logger logger = Logger.getLogger(MindmapService.class.getName()); - boolean exp = false; - private IMindmapDAO mindmapDAO = null; private IMindmapSessionDAO mindmapSessionDAO = null; private IMindmapUserDAO mindmapUserDAO = null; - private IMindmapAttachmentDAO mindmapAttachmentDAO = null; private IMindmapNodeDAO mindmapNodeDAO = null; private IMindmapRequestDAO mindmapRequestDAO = null; private ILearnerService learnerService; private ILamsToolService toolService; private IToolContentHandler mindmapToolContentHandler = null; - private IRepositoryService repositoryService = null; private IAuditService auditService = null; private IExportToolContentService exportContentService; private ICoreNotebookService coreNotebookService; @@ -215,7 +193,7 @@ fromContent = getDefaultContent(); } - Mindmap toContent = Mindmap.newInstance(fromContent, toContentId, mindmapToolContentHandler); + Mindmap toContent = Mindmap.newInstance(fromContent, toContentId); mindmapDAO.saveOrUpdate(toContent); /* Copying Mindmap Nodes */ @@ -393,24 +371,6 @@ return languageOutput; } - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Mindmap mindmap = mindmapDAO.getByContentId(toolContentId); - if (mindmap == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - mindmap.setDefineLater(value); - mindmapDAO.saveOrUpdate(mindmap); - } - - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Mindmap mindmap = mindmapDAO.getByContentId(toolContentId); - if (mindmap == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - mindmap.setRunOffline(value); - mindmapDAO.saveOrUpdate(mindmap); - } - public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { // TODO Auto-generated method stub @@ -451,20 +411,12 @@ mindmapContent = xstream.toXML(currentNodeModel); } - // set ResourceToolContentHandler as null to avoid copy file node in repository again. - mindmap = Mindmap.newInstance(mindmap, toolContentId, null); + mindmap = Mindmap.newInstance(mindmap, toolContentId); mindmap.setMindmapExportContent(mindmapContent); - mindmap.setToolContentHandler(null); mindmap.setMindmapSessions(null); - Set atts = mindmap.getMindmapAttachments(); - for (MindmapAttachment att : atts) { - att.setMindmap(null); - } try { - exportContentService.registerFileClassForExport(MindmapAttachment.class.getName(), "fileUuid", - "fileVersionId"); exportContentService.exportToolContent(toolContentId, mindmap, mindmapToolContentHandler, rootPath); } catch (ExportToolContentException e) { throw new ToolException(e); @@ -480,9 +432,9 @@ public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, String toVersion) throws ToolException { try { - exportContentService.registerFileClassForImport(MindmapAttachment.class.getName(), "fileUuid", - "fileVersionId", "fileName", "fileType", null, null); - + // register version filter class + exportContentService.registerImportVersionFilterClass(MindmapImportContentVersionFilter.class); + Object toolPOJO = exportContentService.importToolContent(toolContentPath, mindmapToolContentHandler, fromVersion, toVersion); if (!(toolPOJO instanceof Mindmap)) { @@ -596,7 +548,7 @@ Mindmap defaultContent = getDefaultContent(); // create new mindmap using the newContentID Mindmap newContent = new Mindmap(); - newContent = Mindmap.newInstance(defaultContent, newContentID, mindmapToolContentHandler); + newContent = Mindmap.newInstance(defaultContent, newContentID); mindmapDAO.saveOrUpdate(newContent); return newContent; } @@ -637,32 +589,6 @@ return mindmapUserDAO.getByUID(uid); } - public MindmapAttachment uploadFileToContent(Long toolContentId, FormFile file, String type) { - if (file == null || StringUtils.isEmpty(file.getFileName())) { - throw new MindmapException("Could not find upload file: " + file); - } - - NodeKey nodeKey = processFile(file, type); - MindmapAttachment attachment = new MindmapAttachment(nodeKey.getVersion(), type, file.getFileName(), nodeKey - .getUuid(), new Date()); - return attachment; - } - - public void deleteFromRepository(Long uuid, Long versionID) throws MindmapException { - ITicket ticket = getRepositoryLoginTicket(); - try { - repositoryService.deleteVersion(ticket, uuid, versionID); - } catch (Exception e) { - throw new MindmapException("Exception occured while deleting files from" + " the repository " - + e.getMessage()); - } - } - - public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type) { - mindmapDAO.deleteInstructionFile(contentID, uuid, versionID, type); - - } - public void saveOrUpdateMindmap(Mindmap mindmap) { mindmapDAO.saveOrUpdate(mindmap); } @@ -693,53 +619,6 @@ 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 = getMindmapToolContentHandler().uploadFile(file.getInputStream(), fileName, - file.getContentType(), type); - } catch (InvalidParameterException e) { - throw new MindmapException("InvalidParameterException occured while trying to upload File" - + e.getMessage()); - } catch (FileNotFoundException e) { - throw new MindmapException("FileNotFoundException occured while trying to upload File" + e.getMessage()); - } catch (RepositoryCheckedException e) { - throw new MindmapException("RepositoryCheckedException occured while trying to upload File" - + e.getMessage()); - } catch (IOException e) { - throw new MindmapException("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 MindmapException { - ICredentials credentials = new SimpleCredentials(MindmapToolContentHandler.repositoryUser, - MindmapToolContentHandler.repositoryId); - try { - ITicket ticket = repositoryService.login(credentials, MindmapToolContentHandler.repositoryWorkspaceName); - return ticket; - } catch (AccessDeniedException ae) { - throw new MindmapException("Access Denied to repository." + ae.getMessage()); - } catch (WorkspaceNotFoundException we) { - throw new MindmapException("Workspace not found." + we.getMessage()); - } catch (LoginException e) { - throw new MindmapException("Login failed." + e.getMessage()); - } - } - /* ===============Methods implemented from ToolContentImport102Manager =============== */ /** @@ -755,15 +634,11 @@ mindmap.setInstructions(WebUtil.convertNewlines((String) importValues .get(ToolContentImport102Manager.CONTENT_BODY))); mindmap.setLockOnFinished(Boolean.TRUE); - mindmap.setOfflineInstructions(null); - mindmap.setOnlineInstructions(null); - mindmap.setRunOffline(Boolean.FALSE); mindmap.setTitle((String) importValues.get(ToolContentImport102Manager.CONTENT_TITLE)); mindmap.setToolContentId(toolContentId); mindmap.setUpdateDate(now); // mindmap.setAllowRichEditor(Boolean.FALSE); // leave as empty, no need to set them to anything. - // setMindmapAttachments(Set mindmapAttachments); // setMindmapSessions(Set mindmapSessions); mindmapDAO.saveOrUpdate(mindmap); } @@ -786,22 +661,6 @@ // ========================================================================================= /* Used by Spring to "inject" the linked objects */ - public IRepositoryService getRepositoryService() { - return repositoryService; - } - - public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - - public IMindmapAttachmentDAO getMindmapAttachmentDAO() { - return mindmapAttachmentDAO; - } - - public void setMindmapAttachmentDAO(IMindmapAttachmentDAO attachmentDAO) { - mindmapAttachmentDAO = attachmentDAO; - } - public IMindmapDAO getMindmapDAO() { return mindmapDAO; } Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapConstants.java,v diff -u -r1.2 -r1.3 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapConstants.java 18 May 2011 16:43:24 -0000 1.2 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapConstants.java 17 Jan 2014 22:06:36 -0000 1.3 @@ -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_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeModel.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeModel.java,v diff -u -r1.1 -r1.2 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeModel.java 3 Apr 2009 00:00:30 -0000 1.1 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeModel.java 17 Jan 2014 22:06:36 -0000 1.2 @@ -27,7 +27,6 @@ import java.util.ArrayList; import java.util.List; -import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NodeConceptModel; /** * XML Model Class for Mindmap Node Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NotifyRequestModel.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NotifyRequestModel.java,v diff -u -r1.1 -r1.2 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NotifyRequestModel.java 3 Apr 2009 00:00:30 -0000 1.1 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NotifyRequestModel.java 17 Jan 2014 22:06:36 -0000 1.2 @@ -25,7 +25,6 @@ package org.lamsfoundation.lams.tool.mindmap.util.xmlmodel; -import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NodeConceptModel; /** * XML Model Class for Notify Request (Actions sent by Flash) in Mindmap. Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/AuthoringAction.java,v diff -u -r1.4 -r1.5 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/AuthoringAction.java 18 May 2009 01:18:17 -0000 1.4 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/AuthoringAction.java 17 Jan 2014 22:06:36 -0000 1.5 @@ -26,11 +26,7 @@ import java.io.IOException; import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; import java.util.List; -import java.util.Set; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -40,13 +36,9 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; -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.mindmap.model.Mindmap; -import org.lamsfoundation.lams.tool.mindmap.model.MindmapAttachment; import org.lamsfoundation.lams.tool.mindmap.model.MindmapNode; import org.lamsfoundation.lams.tool.mindmap.model.MindmapUser; import org.lamsfoundation.lams.tool.mindmap.service.IMindmapService; @@ -57,7 +49,6 @@ import org.lamsfoundation.lams.tool.mindmap.web.forms.AuthoringForm; import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.ConfigurationKeys; -import org.lamsfoundation.lams.util.FileValidatorUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -83,11 +74,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 @@ -251,24 +237,6 @@ // update mindmap content using form inputs. ToolAccessMode mode = (ToolAccessMode) map.get(AuthoringAction.KEY_MODE); updateMindmap(mindmap, authForm, mode); - - // remove attachments marked for deletion. - Set attachments = mindmap.getMindmapAttachments(); - if (attachments == null) { - attachments = new HashSet(); - } - - for (MindmapAttachment 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 - mindmap.setMindmapAttachments(attachments); // set the update date mindmap.setUpdateDate(new Date()); @@ -318,156 +286,6 @@ 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(MindmapConstants.ATTR_SESSION_MAP, map); - this.saveErrors(request, errors); - return mapping.findForward("success"); - } - - if (file.getFileName().length() != 0) { - - // upload file to repository - MindmapAttachment newAtt = mindmapService.uploadFileToContent((Long) map - .get(AuthoringAction.KEY_TOOL_CONTENT_ID), file, type); - - // Add attachment to unsavedFiles - // check to see if file with same name exists - MindmapAttachment currAtt; - Iterator iter = savedFiles.iterator(); - while (iter.hasNext()) { - currAtt = (MindmapAttachment) 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(MindmapConstants.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()) { - MindmapAttachment att = (MindmapAttachment) 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(MindmapConstants.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()) { - MindmapAttachment att = (MindmapAttachment) iter.next(); - - if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) { - // delete from repository and list - mindmapService.deleteFromRepository(att.getFileUuid(), att.getFileVersionId()); - iter.remove(); - break; - } - } - - request.setAttribute(MindmapConstants.ATTR_SESSION_MAP, map); - request.setAttribute("unsavedChanges", new Boolean(true)); - - return mapping.findForward("success"); - } - /** * Updates Mindmap content using AuthoringForm inputs. * @@ -479,8 +297,6 @@ mindmap.setTitle(authForm.getTitle()); mindmap.setInstructions(authForm.getInstructions()); if (mode.isAuthor()) { // Teacher cannot modify following - mindmap.setOfflineInstructions(authForm.getOfflineInstruction()); - mindmap.setOnlineInstructions(authForm.getOnlineInstruction()); mindmap.setLockOnFinished(authForm.isLockOnFinished()); mindmap.setMultiUserMode(authForm.isMultiUserMode()); // reflection @@ -498,8 +314,6 @@ private void updateAuthForm(AuthoringForm authForm, Mindmap mindmap) { authForm.setTitle(mindmap.getTitle()); authForm.setInstructions(mindmap.getInstructions()); - authForm.setOnlineInstruction(mindmap.getOnlineInstructions()); - authForm.setOfflineInstruction(mindmap.getOfflineInstructions()); authForm.setLockOnFinished(mindmap.isLockOnFinished()); authForm.setMultiUserMode(mindmap.isMultiUserMode()); // reflection @@ -522,24 +336,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 = mindmap.getMindmapAttachments().iterator(); - while (iter.hasNext()) { - MindmapAttachment attachment = (MindmapAttachment) 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; } @@ -560,17 +357,6 @@ } /** - * Retrieves a List of attachments from the map using the key. - * - * @param key - * @param map - */ - 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_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java,v diff -u -r1.15 -r1.16 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java 9 Apr 2013 12:45:47 -0000 1.15 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java 17 Jan 2014 22:06:36 -0000 1.16 @@ -37,7 +37,6 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; -import org.lamsfoundation.lams.learning.web.bean.ActivityPositionDTO; import org.lamsfoundation.lams.learning.web.util.LearningWebUtil; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; @@ -79,7 +78,7 @@ * @struts.action path="/learning" parameter="dispatch" scope="request" * name="learningForm" * @struts.action-forward name="mindmap" path="tiles:/learning/main" - * @struts.action-forward name="runOffline" path="tiles:/learning/runOffline" + * @struts.action-forward name="submissionDeadline" path="tiles:/learning/submissionDeadline" * @struts.action-forward name="defineLater" path="tiles:/learning/defineLater" * @struts.action-forward name="reflect" path="tiles:/learning/reflect" */ @@ -150,11 +149,6 @@ LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionID, request, getServlet() .getServletContext()); - - // check runOffline - if (mindmap.isRunOffline()) { - return mapping.findForward("runOffline"); - } // check if there is submission deadline Date submissionDeadline = mindmap.getSubmissionDeadline(); @@ -168,9 +162,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("runOffline"); + return mapping.findForward("submissionDeadline"); } } Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/MonitoringAction.java,v diff -u -r1.8 -r1.9 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/MonitoringAction.java 18 May 2011 16:43:24 -0000 1.8 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/MonitoringAction.java 17 Jan 2014 22:06:36 -0000 1.9 @@ -57,6 +57,7 @@ import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; + import com.thoughtworks.xstream.XStream; /** Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/forms/AuthoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/forms/AuthoringForm.java,v diff -u -r1.1 -r1.2 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/forms/AuthoringForm.java 3 Apr 2009 00:00:36 -0000 1.1 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/forms/AuthoringForm.java 17 Jan 2014 22:06:36 -0000 1.2 @@ -32,7 +32,6 @@ 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.web.util.SessionMap; /** @@ -44,16 +43,11 @@ String title; String instructions; - String offlineInstruction; - String onlineInstruction; boolean lockOnFinished; boolean multiUserMode; - FormFile onlineFile; - FormFile offlineFile; String currentTab; String dispatch; String sessionMapID; - Long deleteFileUuid; SessionMap sessionMap; String mindmapContent; // reflection @@ -108,38 +102,6 @@ this.lockOnFinished = lockOnFinished; } - public FormFile getOfflineFile() { - return offlineFile; - } - - public void setOfflineFile(FormFile offlineFile) { - this.offlineFile = offlineFile; - } - - public String getOfflineInstruction() { - return offlineInstruction; - } - - public void setOfflineInstruction(String offlineInstruction) { - this.offlineInstruction = offlineInstruction; - } - - public FormFile getOnlineFile() { - return onlineFile; - } - - public void setOnlineFile(FormFile onlineFile) { - this.onlineFile = onlineFile; - } - - public String getOnlineInstruction() { - return onlineInstruction; - } - - public void setOnlineInstruction(String onlineInstruction) { - this.onlineInstruction = onlineInstruction; - } - public String getTitle() { return title; } @@ -156,14 +118,6 @@ return sessionMap; } - public Long getDeleteFileUuid() { - return deleteFileUuid; - } - - public void setDeleteFileUuid(Long deleteFile) { - this.deleteFileUuid = deleteFile; - } - public boolean isMultiUserMode() { return multiUserMode; } Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/servlets/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/servlets/ExportServlet.java,v diff -u -r1.7 -r1.8 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/servlets/ExportServlet.java 6 Jan 2014 08:42:26 -0000 1.7 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/servlets/ExportServlet.java 17 Jan 2014 22:06:37 -0000 1.8 @@ -35,9 +35,9 @@ import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; - import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.mindmap.dto.MindmapDTO; @@ -157,30 +157,6 @@ return ERROR; } - - 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 (mindmapService == null) { - mindmapService = MindmapServiceProxy.getMindmapService(getServletContext()); - } - - Mindmap content = null; - if (toolContentID != null) { - content = mindmapService.getMindmapByContentId(toolContentID); - } else { - MindmapSession session = mindmapService.getSessionBySessionId(toolSessionID); - if (session != null) - content = session.getMindmap(); - } - if (content != null) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); - } private void exportMindmapNodes(List mindmapNodeList, Mindmap mindmap, MindmapUser mindmapUser, String path) { Index: lams_tool_mindmap/web/WEB-INF/tiles-defs.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/WEB-INF/tiles-defs.xml,v diff -u -r1.1 -r1.2 --- lams_tool_mindmap/web/WEB-INF/tiles-defs.xml 30 Jul 2012 18:49:32 -0000 1.1 +++ lams_tool_mindmap/web/WEB-INF/tiles-defs.xml 17 Jan 2014 22:06:37 -0000 1.2 @@ -91,8 +91,8 @@ - - + + Index: lams_tool_mindmap/web/includes/javascript/authoring.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/includes/javascript/authoring.js,v diff -u -r1.3 -r1.4 --- lams_tool_mindmap/web/includes/javascript/authoring.js 22 Apr 2009 04:56:08 -0000 1.3 +++ lams_tool_mindmap/web/includes/javascript/authoring.js 17 Jan 2014 22:06:37 -0000 1.4 @@ -33,8 +33,3 @@ document.authoringForm.submit(); } -function deleteAttachment(dispatch, uuid) { - document.authoringForm.dispatch.value = dispatch; - document.authoringForm.deleteFileUuid.value = uuid; - document.authoringForm.submit(); -} Index: lams_tool_mindmap/web/pages/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/pages/authoring/authoring.jsp,v diff -u -r1.8 -r1.9 --- lams_tool_mindmap/web/pages/authoring/authoring.jsp 10 Dec 2012 11:11:05 -0000 1.8 +++ lams_tool_mindmap/web/pages/authoring/authoring.jsp 17 Jan 2014 22:06:37 -0000 1.9 @@ -61,7 +61,6 @@ - @@ -75,9 +74,6 @@

- - -

@@ -93,7 +89,6 @@ - + + + +

+

+ ${mindmapDTO.title} +

+ +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + +
+
+
+
+ Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_mindmap/web/pages/monitoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_mindmap/web/pages/monitoring/monitoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/pages/monitoring/monitoring.jsp,v diff -u -r1.1 -r1.2 --- lams_tool_mindmap/web/pages/monitoring/monitoring.jsp 3 Apr 2009 00:00:37 -0000 1.1 +++ lams_tool_mindmap/web/pages/monitoring/monitoring.jsp 17 Jan 2014 22:06:37 -0000 1.2 @@ -4,9 +4,8 @@
@@ -82,11 +68,7 @@ - - - - <%-- Default value cancelButtonLabelKey="label.authoring.cancel.button" Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_scratchie/web/pages/authoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_scratchie/web/pages/authoring/parts/instructionfilelist.jsp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `lams_tool_scratchie/web/pages/learning/runoffline.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_scratchie/web/pages/learning/submissionDeadline.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scratchie/web/pages/learning/submissionDeadline.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_scratchie/web/pages/learning/submissionDeadline.jsp 17 Jan 2014 22:12:29 -0000 1.1 @@ -0,0 +1,90 @@ + + +<%@include file="/common/taglibs.jsp"%> + + + + <%@ include file="/common/header.jsp"%> + + + + + +
+

+ ${sessionMap.title} +

+ +
+ +
+ + +
+

+ ${sessionMap.reflectInstructions} +

+ + + +

+ + +

+
+ +

+ +

+
+
+ + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_scratchie/web/pages/monitoring/instructions.jsp'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_scratchie/web/pages/monitoring/monitoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scratchie/web/pages/monitoring/monitoring.jsp,v diff -u -r1.5 -r1.6 --- lams_tool_scratchie/web/pages/monitoring/monitoring.jsp 13 Oct 2013 22:19:47 -0000 1.5 +++ lams_tool_scratchie/web/pages/monitoring/monitoring.jsp 17 Jan 2014 22:12:29 -0000 1.6 @@ -47,18 +47,16 @@
- - - + +
Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/scribeApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/scribeApplicationContext.xml,v diff -u -r1.6 -r1.7 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/scribeApplicationContext.xml 26 Mar 2009 10:00:39 -0000 1.6 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/scribeApplicationContext.xml 17 Jan 2014 22:12:31 -0000 1.7 @@ -16,18 +16,15 @@ - - - + - @@ -41,8 +38,6 @@ PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED - PROPAGATION_REQUIRED - PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED @@ -68,9 +63,6 @@ - - - Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/IScribeAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/IScribeDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/IScribeDAO.java,v diff -u -r1.2 -r1.3 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/IScribeDAO.java 17 Sep 2006 06:28:16 -0000 1.2 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/IScribeDAO.java 17 Jan 2014 22:12:32 -0000 1.3 @@ -36,7 +36,5 @@ Scribe getByContentId(Long toolContentId); void saveOrUpdate(Scribe toContent); - - void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type); } Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/hibernate/ScribeAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/hibernate/ScribeDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/hibernate/ScribeDAO.java,v diff -u -r1.2 -r1.3 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/hibernate/ScribeDAO.java 17 Sep 2006 06:28:15 -0000 1.2 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dao/hibernate/ScribeDAO.java 17 Jan 2014 22:12:31 -0000 1.3 @@ -26,12 +26,9 @@ import java.util.List; -import org.hibernate.FlushMode; import org.lamsfoundation.lams.dao.hibernate.BaseDAO; import org.lamsfoundation.lams.tool.scribe.dao.IScribeDAO; import org.lamsfoundation.lams.tool.scribe.model.Scribe; -import org.lamsfoundation.lams.tool.scribe.model.ScribeAttachment; -import org.springframework.orm.hibernate3.HibernateTemplate; /** * DAO for accessing the Scribe objects - Hibernate specific code. @@ -40,10 +37,6 @@ private static final String FIND_FORUM_BY_CONTENTID = "from Scribe scribe where scribe.toolContentId=?"; - private static final String FIND_INSTRUCTION_FILE = "from " - + ScribeAttachment.class.getName() - + " as i where tool_content_id=? and i.file_uuid=? and i.file_version_id=? and i.file_type=?"; - public Scribe getByContentId(Long toolContentId) { List list = getHibernateTemplate().find(FIND_FORUM_BY_CONTENTID, toolContentId); @@ -57,22 +50,4 @@ this.getHibernateTemplate().saveOrUpdate(scribe); 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) { - ScribeAttachment file = (ScribeAttachment) list.get(0); - this.getSession().setFlushMode(FlushMode.AUTO); - templ.delete(file); - templ.flush(); - } - } - - } } Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dbupdates/patch20140102.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dbupdates/patch20140102.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dbupdates/patch20140102.sql 17 Jan 2014 22:12:31 -0000 1.1 @@ -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_lascrb11_scribe DROP COLUMN online_instructions; +ALTER TABLE tl_lascrb11_scribe DROP COLUMN offline_instructions; +ALTER TABLE tl_lascrb11_scribe DROP COLUMN run_offline; +DROP TABLE IF EXISTS tl_lascrb11_attachment; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lascrb11'; + +----------------------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 1.3 refers to a dead (removed) revision in file `lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dto/ScribeAttachmentDTO.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dto/ScribeDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dto/ScribeDTO.java,v diff -u -r1.7 -r1.8 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dto/ScribeDTO.java 16 Nov 2007 07:49:40 -0000 1.7 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/dto/ScribeDTO.java 17 Jan 2014 22:12:31 -0000 1.8 @@ -25,14 +25,11 @@ package org.lamsfoundation.lams.tool.scribe.dto; -import java.util.Iterator; import java.util.Set; import java.util.TreeSet; import org.apache.log4j.Logger; -import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.tool.scribe.model.Scribe; -import org.lamsfoundation.lams.tool.scribe.model.ScribeAttachment; public class ScribeDTO { @@ -43,10 +40,6 @@ public String title; public String instructions; - - public String onlineInstructions; - - public String offlineInstructions; public boolean defineLater; @@ -55,11 +48,7 @@ public boolean reflectOnActivity; public String reflectInstructions; - - public Set onlineInstructionsFiles = new TreeSet(); - public Set offlineInstructionsFiles = new TreeSet(); - public Set sessionDTOs = new TreeSet(); public Set headingDTOs = new TreeSet(); @@ -73,30 +62,11 @@ toolContentID = scribe.getToolContentId(); title = scribe.getTitle(); instructions = scribe.getInstructions(); - onlineInstructions = scribe.getOnlineInstructions(); - offlineInstructions = scribe.getOfflineInstructions(); contentInUse = scribe.isContentInUse(); reflectInstructions = scribe.getReflectInstructions(); reflectOnActivity = scribe.isReflectOnActivity(); autoSelectScribe = scribe.isAutoSelectScribe(); showAggregatedReports = scribe.isShowAggregatedReports(); - - // Adding attachments - for (Iterator i = scribe.getScribeAttachments().iterator(); i.hasNext();) { - ScribeAttachment att = (ScribeAttachment) i.next(); - if (att.getFileType().equals(IToolContentHandler.TYPE_OFFLINE)) { - ScribeAttachmentDTO attDTO = new ScribeAttachmentDTO(att); - offlineInstructionsFiles.add(attDTO); - } else if (att.getFileType() - .equals(IToolContentHandler.TYPE_ONLINE)) { - ScribeAttachmentDTO attDTO = new ScribeAttachmentDTO(att); - onlineInstructionsFiles.add(attDTO); - } else { - // something is wrong. Ignore file, log error - logger.error("File with uid " + att.getFileUuid() - + " contains invalid fileType: " + att.getFileType()); - } - } } @@ -116,40 +86,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_scribe/src/java/org/lamsfoundation/lams/tool/scribe/model/Scribe.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/model/Scribe.java,v diff -u -r1.8 -r1.9 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/model/Scribe.java 16 Nov 2007 07:49:40 -0000 1.8 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/model/Scribe.java 17 Jan 2014 22:12:31 -0000 1.9 @@ -61,19 +61,13 @@ private String title; private String instructions; - - private boolean runOffline; private boolean lockOnFinished; private boolean reflectOnActivity; private String reflectInstructions; - private String onlineInstructions; - - private String offlineInstructions; - private boolean contentInUse; private boolean defineLater; @@ -82,44 +76,12 @@ private Long toolContentId; - private Set scribeAttachments; - private Set scribeSessions; private Set scribeHeadings; private boolean showAggregatedReports; - - //*********** NON Persisit fields - private IToolContentHandler toolContentHandler; - // Constructors - - /** default constructor */ - public Scribe() { - } - - /** full constructor */ - public Scribe(Date createDate, Date updateDate, Long createBy, String title, - String instructions, boolean runOffline, - String onlineInstructions, String offlineInstructions, - boolean contentInUse, boolean defineLater, Long toolContentId, - Set scribeAttachments, Set scribeSessions) { - this.createDate = createDate; - this.updateDate = updateDate; - this.createBy = createBy; - this.title = title; - this.instructions = instructions; - this.runOffline = runOffline; - this.onlineInstructions = onlineInstructions; - this.offlineInstructions = offlineInstructions; - this.contentInUse = contentInUse; - this.defineLater = defineLater; - this.toolContentId = toolContentId; - this.scribeAttachments = scribeAttachments; - this.scribeSessions = scribeSessions; - } - // Property accessors /** * @hibernate.id generator-class="native" type="java.lang.Long" column="uid" @@ -200,19 +162,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" * */ @@ -258,34 +207,8 @@ public void setReflectInstructions(String reflectInstructions) { this.reflectInstructions = reflectInstructions; } - - /** - * @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" * */ @@ -325,21 +248,6 @@ } /** - * @hibernate.set lazy="false" inverse="false" cascade="all-delete-orphan" - * @hibernate.collection-key column="scribe_uid" - * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.scribe.model.ScribeAttachment" - * - */ - - public Set getScribeAttachments() { - return this.scribeAttachments; - } - - public void setScribeAttachments(Set scribeAttachments) { - this.scribeAttachments = scribeAttachments; - } - - /** * @hibernate.set lazy="true" inverse="true" cascade="none" * @hibernate.collection-key column="scribe_uid" * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.scribe.model.ScribeSession" @@ -421,10 +329,8 @@ return result; } - public static Scribe newInstance(Scribe fromContent, Long toContentId, - IToolContentHandler scribeToolContentHandler) { + public static Scribe newInstance(Scribe fromContent, Long toContentId) { Scribe toContent = new Scribe(); - fromContent.toolContentHandler = scribeToolContentHandler; toContent = (Scribe) fromContent.clone(); toContent.setToolContentId(toContentId); toContent.setCreateDate(new Date()); @@ -437,20 +343,6 @@ try { scribe = (Scribe) super.clone(); scribe.setUid(null); - - if (scribeAttachments != null) { - // create a copy of the attachments - Iterator iter = scribeAttachments.iterator(); - Set set = new HashSet(); - while (iter.hasNext()) { - ScribeAttachment originalFile = (ScribeAttachment) iter.next(); - ScribeAttachment newFile = (ScribeAttachment) originalFile - .clone(); - newFile.setScribe(scribe); - set.add(newFile); - } - scribe.scribeAttachments = set; - } if (scribeHeadings != null) { // create copy of headings @@ -477,12 +369,4 @@ } return scribe; } - - public IToolContentHandler getToolContentHandler() { - return toolContentHandler; - } - - public void setToolContentHandler(IToolContentHandler toolContentHandler) { - this.toolContentHandler = toolContentHandler; - } } \ No newline at end of file Fisheye: Tag 1.3 refers to a dead (removed) revision in file `lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/model/ScribeAttachment.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/IScribeService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/IScribeService.java,v diff -u -r1.8 -r1.9 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/IScribeService.java 26 Feb 2009 19:19:21 -0000 1.8 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/IScribeService.java 17 Jan 2014 22:12:31 -0000 1.9 @@ -27,7 +27,6 @@ import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.scribe.model.Scribe; -import org.lamsfoundation.lams.tool.scribe.model.ScribeAttachment; import org.lamsfoundation.lams.tool.scribe.model.ScribeSession; import org.lamsfoundation.lams.tool.scribe.model.ScribeUser; import org.lamsfoundation.lams.tool.scribe.util.ScribeException; @@ -65,28 +64,6 @@ public Scribe getScribeByContentId(Long toolContentID); /** - * @param toolContentId - * @param file - * @param type - * @return - */ - public ScribeAttachment uploadFileToContent(Long toolContentId, FormFile file, String type); - - /** - * @param uuid - * @param versionID - */ - public void deleteFromRepository(Long uuid, Long versionID) throws ScribeException; - - /** - * @param contentID - * @param uuid - * @param versionID - * @param type - */ - public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type); - - /** * @param scribe */ public void saveOrUpdateScribe(Scribe scribe); Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeImportContentVersionFilter.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeImportContentVersionFilter.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeImportContentVersionFilter.java 17 Jan 2014 22:12:31 -0000 1.1 @@ -0,0 +1,44 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id: ScribeImportContentVersionFilter.java,v 1.1 2014/01/17 22:12:31 andreyb Exp $ */ +package org.lamsfoundation.lams.tool.scribe.service; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.scribe.model.Scribe; + +/** + * Import filter class for different version of Scribe content. + * + */ +public class ScribeImportContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20090226 version content to 20140102 version tool server. + */ + public void up20090226To20140102() { + this.removeField(Scribe.class, "runOffline"); + this.removeField(Scribe.class, "onlineInstructions"); + this.removeField(Scribe.class, "offlineInstructions"); + this.removeField(Scribe.class, "scribeAttachments"); + } +} Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java,v diff -u -r1.25 -r1.26 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java 29 Jul 2013 23:12:09 -0000 1.25 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java 17 Jan 2014 22:12:31 -0000 1.26 @@ -64,13 +64,11 @@ import org.lamsfoundation.lams.tool.exception.DataMissingException; import org.lamsfoundation.lams.tool.exception.SessionDataExistsException; import org.lamsfoundation.lams.tool.exception.ToolException; -import org.lamsfoundation.lams.tool.scribe.dao.IScribeAttachmentDAO; import org.lamsfoundation.lams.tool.scribe.dao.IScribeDAO; import org.lamsfoundation.lams.tool.scribe.dao.IScribeHeadingDAO; import org.lamsfoundation.lams.tool.scribe.dao.IScribeSessionDAO; import org.lamsfoundation.lams.tool.scribe.dao.IScribeUserDAO; import org.lamsfoundation.lams.tool.scribe.model.Scribe; -import org.lamsfoundation.lams.tool.scribe.model.ScribeAttachment; import org.lamsfoundation.lams.tool.scribe.model.ScribeHeading; import org.lamsfoundation.lams.tool.scribe.model.ScribeReportEntry; import org.lamsfoundation.lams.tool.scribe.model.ScribeSession; @@ -104,18 +102,12 @@ private IScribeUserDAO scribeUserDAO = null; - private IScribeAttachmentDAO scribeAttachmentDAO = null; - private ILearnerService learnerService; private ILamsToolService toolService; private IToolContentHandler scribeToolContentHandler = null; - private IRepositoryService repositoryService = null; - - private IAuditService auditService = null; - private IExportToolContentService exportContentService; private ICoreNotebookService coreNotebookService; @@ -205,28 +197,10 @@ // create the fromContent using the default tool content fromContent = getDefaultContent(); } - Scribe toContent = Scribe.newInstance(fromContent, toContentId, scribeToolContentHandler); + Scribe toContent = Scribe.newInstance(fromContent, toContentId); scribeDAO.saveOrUpdate(toContent); } - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Scribe scribe = scribeDAO.getByContentId(toolContentId); - if (scribe == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - scribe.setDefineLater(value); - scribeDAO.saveOrUpdate(scribe); - } - - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Scribe scribe = scribeDAO.getByContentId(toolContentId); - if (scribe == null) { - throw new ToolException("Could not find tool with toolContentID: " + toolContentId); - } - scribe.setRunOffline(value); - scribeDAO.saveOrUpdate(scribe); - } - public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { // TODO Auto-generated method stub @@ -252,22 +226,15 @@ // set ResourceToolContentHandler as null to avoid copy file node in // repository again. - scribe = Scribe.newInstance(scribe, toolContentId, null); - scribe.setToolContentHandler(null); + scribe = Scribe.newInstance(scribe, toolContentId); scribe.setScribeSessions(null); - // wipe out the links from ScribeAttachments, ScribeHeading back to Scribe, or it will try to + // wipe out the links from ScribeHeading back to Scribe, or it will try to // include the hibernate object version of the Scribe within the XML - Set atts = scribe.getScribeAttachments(); - for (ScribeAttachment att : atts) { - att.setScribe(null); - } Set headings = scribe.getScribeHeadings(); for (ScribeHeading heading : headings) { heading.setScribe(null); } try { - exportContentService.registerFileClassForExport(ScribeAttachment.class.getName(), "fileUuid", - "fileVersionId"); exportContentService.exportToolContent(toolContentId, scribe, scribeToolContentHandler, rootPath); } catch (ExportToolContentException e) { throw new ToolException(e); @@ -283,9 +250,9 @@ public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion, String toVersion) throws ToolException { try { - exportContentService.registerFileClassForImport(ScribeAttachment.class.getName(), "fileUuid", - "fileVersionId", "fileName", "fileType", null, null); - + // register version filter class + exportContentService.registerImportVersionFilterClass(ScribeImportContentVersionFilter.class); + Object toolPOJO = exportContentService.importToolContent(toolContentPath, scribeToolContentHandler, fromVersion, toVersion); if (!(toolPOJO instanceof Scribe)) { @@ -390,7 +357,7 @@ Scribe defaultContent = getDefaultContent(); // create new scribe using the newContentID Scribe newContent = new Scribe(); - newContent = Scribe.newInstance(defaultContent, newContentID, scribeToolContentHandler); + newContent = Scribe.newInstance(defaultContent, newContentID); scribeDAO.saveOrUpdate(newContent); return newContent; } @@ -423,38 +390,6 @@ return scribeUserDAO.getByUID(uid); } - public ScribeAttachment uploadFileToContent(Long toolContentId, FormFile file, String type) { - if (file == null || StringUtils.isEmpty(file.getFileName())) { - throw new ScribeException("Could not find upload file: " + file); - } - - NodeKey nodeKey = processFile(file, type); - - ScribeAttachment attachment = new ScribeAttachment(); - attachment.setFileType(type); - attachment.setFileUuid(nodeKey.getUuid()); - attachment.setFileVersionId(nodeKey.getVersion()); - attachment.setFileName(file.getFileName()); - attachment.setCreateDate(new Date()); - - return attachment; - } - - public void deleteFromRepository(Long uuid, Long versionID) throws ScribeException { - ITicket ticket = getRepositoryLoginTicket(); - try { - repositoryService.deleteVersion(ticket, uuid, versionID); - } catch (Exception e) { - throw new ScribeException("Exception occured while deleting files from" + " the repository " - + e.getMessage()); - } - } - - public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type) { - scribeDAO.deleteInstructionFile(contentID, uuid, versionID, type); - - } - public void saveOrUpdateScribe(Scribe scribe) { scribeDAO.saveOrUpdate(scribe); } @@ -477,73 +412,9 @@ return toolService.isGroupedActivity(toolContentID); } - public IAuditService getAuditService() { - return auditService; - } - - public void setAuditService(IAuditService auditService) { - this.auditService = auditService; - } - - /* ********** Private methods ********** */ - - private NodeKey processFile(FormFile file, String type) { - NodeKey node = null; - if (file != null && !StringUtils.isEmpty(file.getFileName())) { - String fileName = file.getFileName(); - try { - node = getScribeToolContentHandler().uploadFile(file.getInputStream(), fileName, file.getContentType(), - type); - } catch (InvalidParameterException e) { - throw new ScribeException("InvalidParameterException occured while trying to upload File" - + e.getMessage()); - } catch (FileNotFoundException e) { - throw new ScribeException("FileNotFoundException occured while trying to upload File" + e.getMessage()); - } catch (RepositoryCheckedException e) { - throw new ScribeException("RepositoryCheckedException occured while trying to upload File" - + e.getMessage()); - } catch (IOException e) { - throw new ScribeException("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 ScribeException { - ICredentials credentials = new SimpleCredentials(ScribeToolContentHandler.repositoryUser, - ScribeToolContentHandler.repositoryId); - try { - ITicket ticket = repositoryService.login(credentials, ScribeToolContentHandler.repositoryWorkspaceName); - return ticket; - } catch (AccessDeniedException ae) { - throw new ScribeException("Access Denied to repository." + ae.getMessage()); - } catch (WorkspaceNotFoundException we) { - throw new ScribeException("Workspace not found." + we.getMessage()); - } catch (LoginException e) { - throw new ScribeException("Login failed." + e.getMessage()); - } - } - /* ********** Used by Spring to "inject" the linked objects ************* */ - public IScribeAttachmentDAO getScribeAttachmentDAO() { - return scribeAttachmentDAO; - } - public void setScribeAttachmentDAO(IScribeAttachmentDAO attachmentDAO) { - scribeAttachmentDAO = attachmentDAO; - } - public IScribeDAO getScribeDAO() { return scribeDAO; } @@ -608,14 +479,6 @@ this.coreNotebookService = coreNotebookService; } - public IRepositoryService getRepositoryService() { - return repositoryService; - } - - public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - public Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry) { return coreNotebookService.createNotebookEntry(id, idType, signature, userID, "", entry); } @@ -643,11 +506,8 @@ scribe.setCreateDate(now); scribe.setDefineLater(Boolean.FALSE); scribe.setInstructions(null); - scribe.setOfflineInstructions(null); - scribe.setOnlineInstructions(null); scribe.setReflectInstructions(null); scribe.setReflectOnActivity(Boolean.FALSE); - scribe.setRunOffline(Boolean.FALSE); scribe.setTitle((String) importValues.get(ToolContentImport102Manager.CONTENT_TITLE)); scribe.setToolContentId(toolContentId); scribe.setUpdateDate(now); @@ -681,7 +541,6 @@ } // leave as empty, no need to set them to anything. - // setScribeAttachments(Set scribeAttachments); // setScribeSessions(Set scribeSessions); scribeDAO.saveOrUpdate(scribe); } Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/util/ScribeConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/util/ScribeConstants.java,v diff -u -r1.2 -r1.3 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/util/ScribeConstants.java 17 Sep 2006 06:28:16 -0000 1.2 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/util/ScribeConstants.java 17 Jan 2014 22:12:32 -0000 1.3 @@ -34,8 +34,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_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/AuthoringAction.java,v diff -u -r1.14 -r1.15 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/AuthoringAction.java 5 May 2008 05:26:58 -0000 1.14 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/AuthoringAction.java 17 Jan 2014 22:12:31 -0000 1.15 @@ -47,7 +47,6 @@ import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.scribe.model.Scribe; -import org.lamsfoundation.lams.tool.scribe.model.ScribeAttachment; import org.lamsfoundation.lams.tool.scribe.model.ScribeHeading; import org.lamsfoundation.lams.tool.scribe.service.IScribeService; import org.lamsfoundation.lams.tool.scribe.service.ScribeServiceProxy; @@ -60,8 +59,6 @@ import org.lamsfoundation.lams.web.util.SessionMap; /** - * @author - * @version * * @struts.action path="/authoring" name="authoringForm" parameter="dispatch" * scope="request" validate="false" @@ -86,16 +83,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"; - private static final String KEY_HEADINGS = "headings"; /** @@ -180,24 +167,6 @@ ToolAccessMode mode = (ToolAccessMode) map.get(KEY_MODE); updateScribe(scribe, authForm, mode); - // remove attachments marked for deletion. - Set attachments = scribe.getScribeAttachments(); - if (attachments == null) { - attachments = new HashSet(); - } - - for (ScribeAttachment att : getAttList(KEY_DELETED_FILES, map)) { - // remove from db, leave in repository - attachments.remove(att); - } - - // add unsaved attachments - attachments.addAll(getAttList(KEY_UNSAVED_ONLINE_FILES, map)); - attachments.addAll(getAttList(KEY_UNSAVED_OFFLINE_FILES, map)); - - // set attachments in case it didn't exist - scribe.setScribeAttachments(attachments); - // update headings. List updatedHeadings = getHeadingList(map); Set currentHeadings = scribe.getScribeHeadings(); @@ -258,44 +227,6 @@ 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); - } - public ActionForward loadHeadingForm(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { @@ -406,126 +337,6 @@ /* ========== 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 = (FormFile) authForm.getOfflineFile(); - unsavedFiles = getAttList(KEY_UNSAVED_OFFLINE_FILES, map); - - savedFiles = getAttList(KEY_OFFLINE_FILES, map); - } else { - file = (FormFile) authForm.getOnlineFile(); - unsavedFiles = getAttList(KEY_UNSAVED_ONLINE_FILES, map); - - savedFiles = getAttList(KEY_ONLINE_FILES, map); - } - - // validate file max size - ActionMessages errors = new ActionMessages(); - FileValidatorUtil.validateFileSize(file, true, errors); - if (!errors.isEmpty()) { - request.setAttribute(ScribeConstants.ATTR_SESSION_MAP, map); - this.saveErrors(request, errors); - return mapping.findForward("success"); - } - - if (file.getFileName().length() != 0) { - - // upload file to repository - ScribeAttachment newAtt = scribeService.uploadFileToContent( - (Long) map.get(KEY_TOOL_CONTENT_ID), file, type); - - // Add attachment to unsavedFiles - // check to see if file with same name exists - ScribeAttachment currAtt; - Iterator iter = savedFiles.iterator(); - while (iter.hasNext()) { - currAtt = (ScribeAttachment) iter.next(); - if (StringUtils.equals(currAtt.getFileName(), newAtt.getFileName()) - && StringUtils.equals(currAtt.getFileType(), newAtt.getFileType())) { - // move from this this list to deleted list. - getAttList(KEY_DELETED_FILES, map).add(currAtt); - iter.remove(); - break; - } - } - unsavedFiles.add(newAtt); - - request.setAttribute(ScribeConstants.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(KEY_OFFLINE_FILES, map); - } else { - fileList = getAttList(KEY_ONLINE_FILES, map); - } - - Iterator iter = fileList.iterator(); - - while (iter.hasNext()) { - ScribeAttachment att = (ScribeAttachment) iter.next(); - - if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) { - // move to delete file list, deleted at next updateContent - getAttList(KEY_DELETED_FILES, map).add(att); - - // remove from this list - iter.remove(); - break; - } - } - - request.setAttribute(ScribeConstants.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(KEY_UNSAVED_OFFLINE_FILES, map); - } else { - unsavedFiles = getAttList(KEY_UNSAVED_ONLINE_FILES, map); - } - - Iterator iter = unsavedFiles.iterator(); - while (iter.hasNext()) { - ScribeAttachment att = (ScribeAttachment) iter.next(); - - if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) { - // delete from repository and list - scribeService.deleteFromRepository(att.getFileUuid(), att - .getFileVersionId()); - iter.remove(); - break; - } - } - - request.setAttribute(ScribeConstants.ATTR_SESSION_MAP, map); - request.setAttribute("unsavedChanges", new Boolean(true)); - - return mapping.findForward("success"); - } - /** * Updates Scribe content using AuthoringForm inputs. * @@ -538,8 +349,6 @@ scribe.setTitle(authForm.getTitle()); scribe.setInstructions(authForm.getInstructions()); if (mode.isAuthor()) { // Teacher cannot modify following - scribe.setOfflineInstructions(authForm.getOnlineInstruction()); - scribe.setOnlineInstructions(authForm.getOfflineInstruction()); scribe.setReflectOnActivity(authForm.isReflectOnActivity()); scribe.setReflectInstructions(authForm.getReflectInstructions()); scribe.setAutoSelectScribe(authForm.isAutoSelectScribe()); @@ -557,8 +366,6 @@ private void updateAuthForm(AuthoringForm authForm, Scribe scribe) { authForm.setTitle(scribe.getTitle()); authForm.setInstructions(scribe.getInstructions()); - authForm.setOnlineInstruction(scribe.getOnlineInstructions()); - authForm.setOfflineInstruction(scribe.getOfflineInstructions()); authForm.setReflectOnActivity(scribe.isReflectOnActivity()); authForm.setReflectInstructions(scribe.getReflectInstructions()); authForm.setAutoSelectScribe(scribe.isAutoSelectScribe()); @@ -579,28 +386,10 @@ map.put(KEY_MODE, mode); map.put(KEY_CONTENT_FOLDER_ID, contentFolderID); map.put(KEY_TOOL_CONTENT_ID, toolContentID); - map.put(KEY_ONLINE_FILES, new LinkedList()); - map.put(KEY_OFFLINE_FILES, new LinkedList()); - map.put(KEY_UNSAVED_ONLINE_FILES, new LinkedList()); - map.put(KEY_UNSAVED_OFFLINE_FILES, new LinkedList()); - map.put(KEY_DELETED_FILES, new LinkedList()); map.put(KEY_HEADINGS, new LinkedList()); - // adding attachments - Iterator iter = scribe.getScribeAttachments().iterator(); - while (iter.hasNext()) { - ScribeAttachment attachment = (ScribeAttachment) iter.next(); - String type = attachment.getFileType(); - if (type.equals(IToolContentHandler.TYPE_OFFLINE)) { - getAttList(KEY_OFFLINE_FILES, map).add(attachment); - } - if (type.equals(IToolContentHandler.TYPE_ONLINE)) { - getAttList(KEY_ONLINE_FILES, map).add(attachment); - } - } - // adding headings - iter = scribe.getScribeHeadings().iterator(); + Iterator iter = scribe.getScribeHeadings().iterator(); while (iter.hasNext()) { ScribeHeading element = (ScribeHeading) iter.next(); getHeadingList(map).add(element); @@ -630,18 +419,6 @@ return mode; } - /** - * Retrieves a List of attachments from the map using the key. - * - * @param key - * @param map - * @return - */ - private List getAttList(String key, - SessionMap map) { - return (List) map.get(key); - } - private List getHeadingList(SessionMap map) { return (List) map.get(KEY_HEADINGS); } Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/LearningAction.java,v diff -u -r1.16 -r1.17 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/LearningAction.java 9 Apr 2013 12:45:43 -0000 1.16 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/LearningAction.java 17 Jan 2014 22:12:31 -0000 1.17 @@ -74,7 +74,6 @@ * name="learningForm" * @struts.action-forward name="learning" path="tiles:/learning/main" * @struts.action-forward name="scribe" path="tiles:/learning/scribe" - * @struts.action-forward name="runOffline" path="tiles:/learning/runOffline" * @struts.action-forward name="defineLater" path="tiles:/learning/defineLater" * @struts.action-forward name="waitForScribe" path="tiles:/learning/waitForScribe" * @struts.action-forward name="notebook" path="tiles:/learning/notebook" @@ -170,11 +169,6 @@ request.setAttribute("MODE", mode.toString()); setupDTOs(request, scribeSession, scribeUser); - // check runOffline - if (scribe.isRunOffline()) { - return mapping.findForward("runOffline"); - } - // check force complete if (scribeSession.isForceComplete()) { // go to report page Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java,v diff -u -r1.11 -r1.12 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java 6 Jan 2014 08:42:17 -0000 1.11 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java 17 Jan 2014 22:12:32 -0000 1.12 @@ -99,27 +99,7 @@ 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 { - IScribeService service = ScribeServiceProxy.getScribeService(getServletContext()); - - Scribe content = null; - if ( toolContentID != null ) { - content = service.getScribeByContentId(toolContentID); - } else { - ScribeSession session=service.getSessionBySessionId(toolSessionID); - if ( session != null ) - content = session.getScribe(); - } - if ( content != null ) { - activityTitle = content.getTitle(); - } - } - return super.doOfflineExport(request, response, directoryName, cookies); - } + private void doLearnerExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) throws ScribeException { Index: lams_tool_scribe/web/WEB-INF/tiles-defs.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/web/WEB-INF/tiles-defs.xml,v diff -u -r1.1 -r1.2 --- lams_tool_scribe/web/WEB-INF/tiles-defs.xml 30 Jul 2012 18:53:23 -0000 1.1 +++ lams_tool_scribe/web/WEB-INF/tiles-defs.xml 17 Jan 2014 22:12:32 -0000 1.2 @@ -111,10 +111,6 @@ - - - - Index: lams_tool_scribe/web/includes/javascript/authoring.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/web/includes/javascript/authoring.js,v diff -u -r1.2 -r1.3 --- lams_tool_scribe/web/includes/javascript/authoring.js 26 Oct 2006 02:32:30 -0000 1.2 +++ lams_tool_scribe/web/includes/javascript/authoring.js 17 Jan 2014 22:12:31 -0000 1.3 @@ -17,9 +17,4 @@ 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_scribe/web/pages/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/web/pages/authoring/authoring.jsp,v diff -u -r1.6 -r1.7 --- lams_tool_scribe/web/pages/authoring/authoring.jsp 14 Dec 2006 03:55:47 -0000 1.6 +++ lams_tool_scribe/web/pages/authoring/authoring.jsp 17 Jan 2014 22:12:31 -0000 1.7 @@ -1,13 +1,9 @@ <%@ include file="/common/taglibs.jsp"%> -<%@ page - import="org.lamsfoundation.lams.tool.scribe.util.ScribeConstants"%> +<%@ page import="org.lamsfoundation.lams.tool.scribe.util.ScribeConstants"%> - + - + @@ -20,7 +16,6 @@ -
@@ -35,9 +30,6 @@
- - -

@@ -47,14 +39,11 @@

- + <%-- Page tabs --%> - - - - + +
- - - + +
Index: lams_tool_spreadsheet/conf/xdoclet/struts-actions.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/conf/xdoclet/struts-actions.xml,v diff -u -r1.3 -r1.4 --- lams_tool_spreadsheet/conf/xdoclet/struts-actions.xml 13 Jul 2008 08:53:49 -0000 1.3 +++ lams_tool_spreadsheet/conf/xdoclet/struts-actions.xml 17 Jan 2014 22:12:26 -0000 1.4 @@ -36,39 +36,6 @@ - - - - - - - - - - - - - - - + - - - - - - @@ -66,9 +60,6 @@ - - - @@ -78,18 +69,12 @@ - - - - - - @@ -115,9 +100,7 @@ PROPAGATION_REQUIRED,-java.lang.Exception PROPAGATION_REQUIRED,-java.lang.Exception PROPAGATION_REQUIRED - 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 Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/dao/SpreadsheetAttachmentDAO.java'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/dao/hibernate/SpreadsheetAttachmentDAOHibernate.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/dbupdates/patch20140102.sql =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/dbupdates/patch20140102.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/dbupdates/patch20140102.sql 17 Jan 2014 22:12:25 -0000 1.1 @@ -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_lasprd10_spreadsheet DROP COLUMN online_instructions; +ALTER TABLE tl_lasprd10_spreadsheet DROP COLUMN offline_instructions; +ALTER TABLE tl_lasprd10_spreadsheet DROP COLUMN run_offline; +DROP TABLE IF EXISTS tl_lasprd10_attachment; + +UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lasprd10'; + +----------------------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_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/model/Spreadsheet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/model/Spreadsheet.java,v diff -u -r1.2 -r1.3 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/model/Spreadsheet.java 23 Jul 2008 04:46:03 -0000 1.2 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/model/Spreadsheet.java 17 Jan 2014 22:12:25 -0000 1.3 @@ -23,487 +23,356 @@ /* $Id$ */ package org.lamsfoundation.lams.tool.spreadsheet.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.spreadsheet.util.SpreadsheetToolContentHandler; /** * Spreadsheet + * * @author Andrey Balan - * - * @hibernate.class table="tl_lasprd10_spreadsheet" - * + * + * @hibernate.class table="tl_lasprd10_spreadsheet" + * */ public class Spreadsheet implements Cloneable { - - private static final Logger log = Logger.getLogger(Spreadsheet.class); - - //key - private Long uid; - //tool contentID - private Long contentId; - private String title; - private String instructions; - private String code; - - //advance - private boolean runOffline; - private boolean isLearnerAllowedToSave; - private boolean isMarkingEnabled; - - private boolean lockWhenFinished; - private boolean defineLater; - private boolean contentInUse; - //instructions - private String onlineInstructions; - private String offlineInstructions; - private Set attachments; - - //general infomation - private Date created; - private Date updated; - private SpreadsheetUser createdBy; - - private boolean reflectOnActivity; - private String reflectInstructions; - - //*************** NON Persist Fields ******************** - private IToolContentHandler toolContentHandler; - private List onlineFileList; - private List offlineFileList; - /** - * Default contruction method. - * - */ - public Spreadsheet(){ - attachments = new HashSet(); - } -// ********************************************************** - // Function method for Spreadsheet -// ********************************************************** - public static Spreadsheet newInstance(Spreadsheet defaultContent, Long contentId, SpreadsheetToolContentHandler spreadsheetToolContentHandler) { - Spreadsheet toContent = new Spreadsheet(); - defaultContent.toolContentHandler = spreadsheetToolContentHandler; - toContent = (Spreadsheet) defaultContent.clone(); - toContent.setContentId(contentId); - - //reset user info as well - if(toContent.getCreatedBy() != null){ - toContent.getCreatedBy().setSpreadsheet(toContent); - } - return toContent; - } - public Object clone(){ - - Spreadsheet spreadsheet = null; - try{ - spreadsheet = (Spreadsheet) super.clone(); - spreadsheet.setUid(null); - //clone attachment - if(attachments != null){ - Iterator iter = attachments.iterator(); - Set set = new HashSet(); - while(iter.hasNext()){ - SpreadsheetAttachment file = (SpreadsheetAttachment)iter.next(); - SpreadsheetAttachment newFile = (SpreadsheetAttachment) file.clone(); - //just clone old file without duplicate it in repository - set.add(newFile); - } - spreadsheet.attachments = set; - } - //clone ReourceUser as well - if(this.createdBy != null){ - spreadsheet.setCreatedBy((SpreadsheetUser) this.createdBy.clone()); - } - } catch (CloneNotSupportedException e) { - log.error("When clone " + Spreadsheet.class + " failed"); - } - - return spreadsheet; - } - public boolean equals(Object o) { - if (this == o) - return true; - if (!(o instanceof Spreadsheet)) - return false; + private static final Logger log = Logger.getLogger(Spreadsheet.class); - final Spreadsheet genericEntity = (Spreadsheet) o; + // key + private Long uid; + // tool contentID + private Long contentId; + private String title; + private String instructions; + private String code; - return new EqualsBuilder() - .append(this.uid,genericEntity.uid) - .append(this.title,genericEntity.title) - .append(this.instructions,genericEntity.instructions) - .append(this.code,genericEntity.code) - .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) - .isEquals(); - } + // advance + private boolean isLearnerAllowedToSave; + private boolean isMarkingEnabled; - public int hashCode() { - return new HashCodeBuilder().append(uid).append(title) - .append(instructions).append(onlineInstructions) - .append(code).append(code) - .append(offlineInstructions).append(created) - .append(updated).append(createdBy) - .toHashCode(); + private boolean lockWhenFinished; + private boolean defineLater; + private boolean contentInUse; + + // general infomation + private Date created; + private Date updated; + private SpreadsheetUser createdBy; + + private boolean reflectOnActivity; + private String reflectInstructions; + + // ********************************************************** + // Function method for Spreadsheet + // ********************************************************** + public static Spreadsheet newInstance(Spreadsheet defaultContent, Long contentId) { + Spreadsheet toContent = new Spreadsheet(); + toContent = (Spreadsheet) defaultContent.clone(); + toContent.setContentId(contentId); + + // reset user info as well + if (toContent.getCreatedBy() != null) { + toContent.getCreatedBy().setSpreadsheet(toContent); } - - /** - * Updates the modification data for this entity. - */ - public void updateModificationData() { - - long now = System.currentTimeMillis(); - if (created == null) { - this.setCreated (new Date(now)); - } - this.setUpdated(new Date(now)); - } + return toContent; + } - public void toDTO(){ - onlineFileList = new ArrayList(); - offlineFileList = new ArrayList(); - Set fileSet = this.getAttachments(); - if(fileSet != null){ - for(SpreadsheetAttachment file:fileSet){ - if(StringUtils.equalsIgnoreCase(file.getFileType(),IToolContentHandler.TYPE_OFFLINE)) - offlineFileList.add(file); - else - onlineFileList.add(file); - } - } + public Object clone() { + + Spreadsheet spreadsheet = null; + try { + spreadsheet = (Spreadsheet) super.clone(); + spreadsheet.setUid(null); + // clone ReourceUser as well + if (this.createdBy != null) { + spreadsheet.setCreatedBy((SpreadsheetUser) this.createdBy.clone()); + } + } catch (CloneNotSupportedException e) { + log.error("When clone " + Spreadsheet.class + " failed"); } - - //********************************************************** - // get/set methods - //********************************************************** - /** - * Returns the object's creation date - * - * @return date - * @hibernate.property column="create_date" - */ - public Date getCreated() { - return created; - } - /** - * Sets the object's creation date - * - * @param created - */ - public void setCreated(Date created) { - this.created = created; - } - /** - * Returns the object's date of last update - * - * @return date updated - * @hibernate.property column="update_date" - */ - public Date getUpdated() { - return updated; + return spreadsheet; + } + + public boolean equals(Object o) { + if (this == o) + return true; + if (!(o instanceof Spreadsheet)) + return false; + + final Spreadsheet genericEntity = (Spreadsheet) o; + + return new EqualsBuilder().append(this.uid, genericEntity.uid).append(this.title, genericEntity.title) + .append(this.instructions, genericEntity.instructions).append(this.code, genericEntity.code) + .append(this.created, genericEntity.created).append(this.updated, genericEntity.updated) + .append(this.createdBy, genericEntity.createdBy).isEquals(); + } + + public int hashCode() { + return new HashCodeBuilder().append(uid).append(title).append(instructions).append(code).append(code) + .append(created).append(updated).append(createdBy).toHashCode(); + } + + /** + * Updates the modification data for this entity. + */ + public void updateModificationData() { + + long now = System.currentTimeMillis(); + if (created == null) { + this.setCreated(new Date(now)); } - /** - * Sets the object's date of last update - * - * @param updated - */ - public void setUpdated(Date updated) { - this.updated = updated; - } + this.setUpdated(new Date(now)); + } + // ********************************************************** + // get/set methods + // ********************************************************** /** + * Returns the object's creation date + * + * @return date + * @hibernate.property column="create_date" + */ + public Date getCreated() { + return created; + } + + /** + * Sets the object's creation date + * + * @param created + */ + public void setCreated(Date created) { + this.created = created; + } + + /** + * Returns the object's date of last update + * + * @return date updated + * @hibernate.property column="update_date" + */ + public Date getUpdated() { + return updated; + } + + /** + * Sets the object's date of last update + * + * @param updated + */ + public void setUpdated(Date updated) { + this.updated = updated; + } + + /** * @return Returns the userid of the user who created the Share spreadsheet. - * - * @hibernate.many-to-one - * cascade="save-update" - * column="create_by" + * + * @hibernate.many-to-one cascade="save-update" column="create_by" */ public SpreadsheetUser getCreatedBy() { - return createdBy; + return createdBy; } + /** - * @param createdBy The userid of the user who created this Share spreadsheet. + * @param createdBy + * The userid of the user who created this Share spreadsheet. */ public void setCreatedBy(SpreadsheetUser createdBy) { - this.createdBy = createdBy; + this.createdBy = createdBy; } /** * @hibernate.id column="uid" generator-class="native" */ - public Long getUid() { - return uid; - } - public void setUid(Long uid) { - this.uid = uid; - } + public Long getUid() { + return uid; + } - /** - * @return Returns the title. - * - * @hibernate.property - * column="title" - */ - public String getTitle() { - return title; - } - /** - * @param title The title to set. - */ - public void setTitle(String title) { - this.title = title; - } + public void setUid(Long uid) { + this.uid = uid; + } - /** - * @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) { - this.runOffline = forceOffline; - } - - /** - * @return Returns whether learner is allowed to save spreadsheet. - * - * @hibernate.property column="is_learner_allowed_to_save" - */ - public boolean isLearnerAllowedToSave() { - return isLearnerAllowedToSave; - } - /** - * @param isLearnerAllowedToSave boolean describing whether learner is allowed to save spreadsheet or not - */ - public void setLearnerAllowedToSave(boolean isLearnerAllowedToSave) { - this.isLearnerAllowedToSave = isLearnerAllowedToSave; - } - - /** - * @return Returns whether the marking is enabled. - * - * @hibernate.property column="is_marking_enabled" - */ - public boolean isMarkingEnabled() { - return isMarkingEnabled; - } - /** - * @param isMarkingEnabled boolean describing wwhether the marking is enabled - */ - public void setMarkingEnabled(boolean isMarkingEnabled) { - this.isMarkingEnabled = isMarkingEnabled; - } + /** + * @return Returns the title. + * + * @hibernate.property column="title" + */ + public String getTitle() { + return title; + } /** + * @param title + * The title to set. + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * @return Returns whether learner is allowed to save spreadsheet. + * + * @hibernate.property column="is_learner_allowed_to_save" + */ + public boolean isLearnerAllowedToSave() { + return isLearnerAllowedToSave; + } + + /** + * @param isLearnerAllowedToSave + * boolean describing whether learner is allowed to save spreadsheet or not + */ + public void setLearnerAllowedToSave(boolean isLearnerAllowedToSave) { + this.isLearnerAllowedToSave = isLearnerAllowedToSave; + } + + /** + * @return Returns whether the marking is enabled. + * + * @hibernate.property column="is_marking_enabled" + */ + public boolean isMarkingEnabled() { + return isMarkingEnabled; + } + + /** + * @param isMarkingEnabled + * boolean describing wwhether the marking is enabled + */ + public void setMarkingEnabled(boolean isMarkingEnabled) { + this.isMarkingEnabled = isMarkingEnabled; + } + + /** * @return Returns the lockWhenFinish. - * - * @hibernate.property - * column="lock_on_finished" + * + * @hibernate.property column="lock_on_finished" */ public boolean getLockWhenFinished() { - return lockWhenFinished; + return lockWhenFinished; } + /** - * @param lockWhenFinished Set to true to lock the spreadsheet for finished users. + * @param lockWhenFinished + * Set to true to lock the spreadsheet for finished users. */ public void setLockWhenFinished(boolean lockWhenFinished) { - this.lockWhenFinished = lockWhenFinished; + this.lockWhenFinished = lockWhenFinished; } /** * @return Returns the instructions set by the teacher. - * - * @hibernate.property - * column="instructions" - * type="text" + * + * @hibernate.property column="instructions" type="text" */ public String getInstructions() { - return instructions; + return instructions; } + public void setInstructions(String instructions) { - this.instructions = instructions; + this.instructions = instructions; } - + /** * @return Returns spreadsheet code. - * - * @hibernate.property - * column="code" - * type="text" + * + * @hibernate.property column="code" type="text" */ public String getCode() { - return code; + return code; } + public void setCode(String code) { - this.code = code; -// this.code = javaScriptEscape(code);; + this.code = code; + // this.code = javaScriptEscape(code);; } /** - * @return Returns the onlineInstructions set by the teacher. - * - * @hibernate.property - * column="online_instructions" - * type="text" + * @hibernate.property column="content_in_use" + * @return */ - public String getOnlineInstructions() { - return onlineInstructions; + public boolean isContentInUse() { + return contentInUse; } - public void setOnlineInstructions(String onlineInstructions) { - this.onlineInstructions = onlineInstructions; + + public void setContentInUse(boolean contentInUse) { + this.contentInUse = contentInUse; } /** - * @return Returns the onlineInstructions set by the teacher. - * - * @hibernate.property - * column="offline_instructions" - * type="text" + * @hibernate.property column="define_later" + * @return */ - public String getOfflineInstructions() { - return offlineInstructions; + public boolean isDefineLater() { + return defineLater; } - public void setOfflineInstructions(String offlineInstructions) { - this.offlineInstructions = offlineInstructions; + + public void setDefineLater(boolean defineLater) { + this.defineLater = defineLater; } - /** - * - * @hibernate.set lazy="true" - * cascade="all" - * inverse="false" - * order-by="create_date desc" - * @hibernate.collection-key column="spreadsheet_uid" - * @hibernate.collection-one-to-many - * class="org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetAttachment" - * - * @return a set of Attachments to this Message. + /** + * @hibernate.property column="content_id" unique="true" + * @return */ - public Set getAttachments() { - return attachments; - } + public Long getContentId() { + return contentId; + } + + public void setContentId(Long contentId) { + this.contentId = contentId; + } + /** - * @param attachments The attachments to set. + * @hibernate.property column="reflect_instructions" + * @return */ - public void setAttachments(Set attachments) { - this.attachments = attachments; - } + public String getReflectInstructions() { + return reflectInstructions; + } - /** - * @hibernate.property column="content_in_use" - * @return - */ - public boolean isContentInUse() { - return contentInUse; - } - public void setContentInUse(boolean contentInUse) { - this.contentInUse = contentInUse; - } - - /** - * @hibernate.property column="define_later" - * @return - */ - public boolean isDefineLater() { - return defineLater; - } - public void setDefineLater(boolean defineLater) { - this.defineLater = defineLater; - } - - /** - * @hibernate.property column="content_id" unique="true" - * @return - */ - public Long getContentId() { - return contentId; - } - public void setContentId(Long contentId) { - this.contentId = contentId; - } + public void setReflectInstructions(String reflectInstructions) { + this.reflectInstructions = reflectInstructions; + } - 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_on_activity" + * @return + */ + public boolean isReflectOnActivity() { + return reflectOnActivity; + } - /** - * @hibernate.property column="reflect_instructions" - * @return - */ - public String getReflectInstructions() { - return reflectInstructions; + public void setReflectOnActivity(boolean reflectOnActivity) { + this.reflectOnActivity = reflectOnActivity; + } + + private static String javaScriptEscape(String input) { + StringBuffer filtered = new StringBuffer(); + + for (char c : input.toCharArray()) { + switch (c) { + case '\'': + filtered.append("\\'"); + break; + + case '"': + filtered.append("\\\""); + break; + + case '\n': + case '\r': + break; + + default: + filtered.append(c); + } } - public void setReflectInstructions(String reflectInstructions) { - this.reflectInstructions = reflectInstructions; - } - - /** - * @hibernate.property column="reflect_on_activity" - * @return - */ - public boolean isReflectOnActivity() { - return reflectOnActivity; - } - public void setReflectOnActivity(boolean reflectOnActivity) { - this.reflectOnActivity = reflectOnActivity; - } - - private static String javaScriptEscape(String input) { - StringBuffer filtered = new StringBuffer(); - - for ( char c : input.toCharArray() ) { - switch (c) { - case '\'': - filtered.append("\\'"); - break; - - case '"': - filtered.append("\\\""); - break; - - case '\n': case '\r': - break; - - default: - filtered.append(c); - } - } - return filtered.toString(); - } + return filtered.toString(); + } } Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/model/SpreadsheetAttachment.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/ISpreadsheetService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/ISpreadsheetService.java,v diff -u -r1.5 -r1.6 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/ISpreadsheetService.java 11 Feb 2011 08:18:44 -0000 1.5 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/ISpreadsheetService.java 17 Jan 2014 22:12:25 -0000 1.6 @@ -27,13 +27,11 @@ import java.util.Map; import java.util.Set; -import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.spreadsheet.dto.ReflectDTO; import org.lamsfoundation.lams.tool.spreadsheet.dto.StatisticDTO; import org.lamsfoundation.lams.tool.spreadsheet.dto.Summary; import org.lamsfoundation.lams.tool.spreadsheet.model.Spreadsheet; -import org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetAttachment; import org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetSession; import org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetUser; import org.lamsfoundation.lams.tool.spreadsheet.model.UserModifiedSpreadsheet; @@ -61,15 +59,6 @@ */ Spreadsheet getDefaultContent(Long contentId) throws SpreadsheetApplicationException; - /** - * Upload instruciton file into repository. - * @param file - * @param type - * @return - * @throws UploadSpreadsheetFileException - */ - SpreadsheetAttachment uploadInstructionFile(FormFile file, String type) throws UploadSpreadsheetFileException; - //********** user methods ************* /** * Save or update SpreadsheetUser in database, mostly for saving userModifiedSpreadsheet. @@ -114,25 +103,12 @@ * @return */ SpreadsheetUser getUser(Long uid); - - //********** Repository methods *********************** - /** - * Delete file from repository. - */ - void deleteFromRepository(Long fileUuid, Long fileVersionId) throws SpreadsheetApplicationException ; /** * Save or update spreadsheet into database. * @param Spreadsheet */ void saveOrUpdateSpreadsheet(Spreadsheet Spreadsheet); - /** - * Delete reource attachment(i.e., offline/online instruction file) from database. This method does not - * delete the file from repository. - * - * @param attachmentUid - */ - void deleteSpreadsheetAttachment(Long attachmentUid); /** * Get spreadsheet which is relative with the special toolSession. Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetImportContentVersionFilter.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetImportContentVersionFilter.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetImportContentVersionFilter.java 17 Jan 2014 22:12:25 -0000 1.1 @@ -0,0 +1,44 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id: SpreadsheetImportContentVersionFilter.java,v 1.1 2014/01/17 22:12:25 andreyb Exp $ */ +package org.lamsfoundation.lams.tool.spreadsheet.service; + +import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter; +import org.lamsfoundation.lams.tool.spreadsheet.model.Spreadsheet; + +/** + * Import filter class for different version of Spreadsheet content. + * + */ +public class SpreadsheetImportContentVersionFilter extends ToolContentVersionFilter { + + /** + * Import 20080612 version content to 20140102 version tool server. + */ + public void up20080612To20140102() { + this.removeField(Spreadsheet.class, "runOffline"); + this.removeField(Spreadsheet.class, "onlineInstructions"); + this.removeField(Spreadsheet.class, "offlineInstructions"); + this.removeField(Spreadsheet.class, "attachments"); + } +} Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java,v diff -u -r1.9 -r1.10 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java 29 Jul 2013 23:12:06 -0000 1.9 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java 17 Jan 2014 22:12:25 -0000 1.10 @@ -71,7 +71,6 @@ import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.service.ILamsToolService; import org.lamsfoundation.lams.tool.spreadsheet.SpreadsheetConstants; -import org.lamsfoundation.lams.tool.spreadsheet.dao.SpreadsheetAttachmentDAO; import org.lamsfoundation.lams.tool.spreadsheet.dao.SpreadsheetDAO; import org.lamsfoundation.lams.tool.spreadsheet.dao.SpreadsheetMarkDAO; import org.lamsfoundation.lams.tool.spreadsheet.dao.SpreadsheetSessionDAO; @@ -81,7 +80,6 @@ import org.lamsfoundation.lams.tool.spreadsheet.dto.StatisticDTO; import org.lamsfoundation.lams.tool.spreadsheet.dto.Summary; import org.lamsfoundation.lams.tool.spreadsheet.model.Spreadsheet; -import org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetAttachment; import org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetMark; import org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetSession; import org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetUser; @@ -103,7 +101,6 @@ ToolContentImport102Manager { static Logger log = Logger.getLogger(SpreadsheetServiceImpl.class.getName()); private SpreadsheetDAO spreadsheetDao; - private SpreadsheetAttachmentDAO spreadsheetAttachmentDao; private SpreadsheetUserDAO spreadsheetUserDao; private SpreadsheetSessionDAO spreadsheetSessionDao; private UserModifiedSpreadsheetDAO userModifiedSpreadsheetDao; @@ -112,82 +109,17 @@ private SpreadsheetToolContentHandler spreadsheetToolContentHandler; private MessageService messageService; // system services - private IRepositoryService repositoryService; private ILamsToolService toolService; private ILearnerService learnerService; - private IAuditService auditService; private IUserManagementService userManagementService; private IExportToolContentService exportContentService; private ICoreNotebookService coreNotebookService; // ******************************************************************************* // 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 SpreadsheetApplicationException { - 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."; - SpreadsheetServiceImpl.log.error(error); - throw new SpreadsheetApplicationException(error, e); - - } catch (Exception e) { - - String error = "Unable to access repository to get file uuid " + uuid + " version id " + versionId - + " path " + relativePath + "." + " Exception: " + e.getMessage(); - SpreadsheetServiceImpl.log.error(error); - throw new SpreadsheetApplicationException(error, e); - - } - } - - /** - * This method verifies the credentials of the Spreadsheet 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 SpreadsheetApplicationException - */ - private ITicket getRepositoryLoginTicket() throws SpreadsheetApplicationException { - ICredentials credentials = new SimpleCredentials(spreadsheetToolContentHandler.getRepositoryUser(), - spreadsheetToolContentHandler.getRepositoryId()); - try { - ITicket ticket = repositoryService.login(credentials, spreadsheetToolContentHandler - .getRepositoryWorkspaceName()); - return ticket; - } catch (AccessDeniedException ae) { - throw new SpreadsheetApplicationException("Access Denied to repository." + ae.getMessage()); - } catch (WorkspaceNotFoundException we) { - throw new SpreadsheetApplicationException("Workspace not found." + we.getMessage()); - } catch (LoginException e) { - throw new SpreadsheetApplicationException("Login failed." + e.getMessage()); - } - } - public Spreadsheet getSpreadsheetByContentId(Long contentId) { Spreadsheet rs = spreadsheetDao.getByContentId(contentId); if (rs == null) { @@ -206,31 +138,10 @@ Spreadsheet defaultContent = getDefaultSpreadsheet(); // save default content by given ID. Spreadsheet content = new Spreadsheet(); - content = Spreadsheet.newInstance(defaultContent, contentId, spreadsheetToolContentHandler); + content = Spreadsheet.newInstance(defaultContent, contentId); return content; } - public SpreadsheetAttachment uploadInstructionFile(FormFile uploadFile, String fileType) - throws UploadSpreadsheetFileException { - if (uploadFile == null || StringUtils.isEmpty(uploadFile.getFileName())) { - throw new UploadSpreadsheetFileException(messageService.getMessage("error.msg.upload.file.not.found", - new Object[] { uploadFile })); - } - - // upload file to repository - NodeKey nodeKey = processFile(uploadFile, fileType); - - // create new attachement - SpreadsheetAttachment file = new SpreadsheetAttachment(); - file.setFileType(fileType); - file.setFileUuid(nodeKey.getUuid()); - file.setFileVersionId(nodeKey.getVersion()); - file.setFileName(uploadFile.getFileName()); - file.setCreated(new Date()); - - return file; - } - public void saveOrUpdateUser(SpreadsheetUser spreadsheetUser) { spreadsheetUserDao.saveObject(spreadsheetUser); } @@ -252,25 +163,10 @@ return userList; } - public void deleteFromRepository(Long fileUuid, Long fileVersionId) throws SpreadsheetApplicationException { - ITicket ticket = getRepositoryLoginTicket(); - try { - repositoryService.deleteVersion(ticket, fileUuid, fileVersionId); - } catch (Exception e) { - throw new SpreadsheetApplicationException("Exception occured while deleting files from" - + " the repository " + e.getMessage()); - } - } - public void saveOrUpdateSpreadsheet(Spreadsheet spreadsheet) { spreadsheetDao.saveObject(spreadsheet); } - public void deleteSpreadsheetAttachment(Long attachmentUid) { - spreadsheetAttachmentDao.removeObject(SpreadsheetAttachment.class, attachmentUid); - - } - public List exportForLearner(Long sessionId, SpreadsheetUser learner) { SpreadsheetSession session = spreadsheetSessionDao.getSessionBySessionId(sessionId); if (session == null) { @@ -320,7 +216,7 @@ // for(SpreadsheetItem item:sessList){ // if(skipHide && item.isHide()) // continue; - // + // // //to skip all item create by author // if(!item.isCreateByAuthor()){ // Summary sum = new Summary(session.getSessionId(), session.getSessionName(),item,false); @@ -509,7 +405,7 @@ } } } - + public boolean isGroupedActivity(long toolContentID) { return toolService.isGroupedActivity(toolContentID); } @@ -540,86 +436,9 @@ return contentId; } - /** - * Process an uploaded file. - * - * @throws SpreadsheetApplicationException - * @throws FileNotFoundException - * @throws IOException - * @throws RepositoryCheckedException - * @throws InvalidParameterException - */ - private NodeKey processFile(FormFile file, String fileType) throws UploadSpreadsheetFileException { - NodeKey node = null; - if (file != null && !StringUtils.isEmpty(file.getFileName())) { - String fileName = file.getFileName(); - try { - node = spreadsheetToolContentHandler.uploadFile(file.getInputStream(), fileName, file.getContentType(), - fileType); - } catch (InvalidParameterException e) { - throw new UploadSpreadsheetFileException(messageService.getMessage("error.msg.invaid.param.upload")); - } catch (FileNotFoundException e) { - throw new UploadSpreadsheetFileException(messageService.getMessage("error.msg.file.not.found")); - } catch (RepositoryCheckedException e) { - throw new UploadSpreadsheetFileException(messageService.getMessage("error.msg.repository")); - } catch (IOException e) { - throw new UploadSpreadsheetFileException(messageService.getMessage("error.msg.io.exception")); - } - } - return node; - } - - private NodeKey processPackage(String packageDirectory, String initFile) throws UploadSpreadsheetFileException { - NodeKey node = null; - try { - node = spreadsheetToolContentHandler.uploadPackage(packageDirectory, initFile); - } catch (InvalidParameterException e) { - throw new UploadSpreadsheetFileException(messageService.getMessage("error.msg.invaid.param.upload")); - } catch (RepositoryCheckedException e) { - throw new UploadSpreadsheetFileException(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; - } - } - // ***************************************************************************** // set methods for Spring Bean // ***************************************************************************** - public void setAuditService(IAuditService auditService) { - this.auditService = auditService; - } - public void setLearnerService(ILearnerService learnerService) { this.learnerService = learnerService; } @@ -632,14 +451,6 @@ return messageService; } - public void setRepositoryService(IRepositoryService repositoryService) { - this.repositoryService = repositoryService; - } - - public void setSpreadsheetAttachmentDao(SpreadsheetAttachmentDAO spreadsheetAttachmentDao) { - this.spreadsheetAttachmentDao = spreadsheetAttachmentDao; - } - public void setSpreadsheetDao(SpreadsheetDAO spreadsheetDao) { this.spreadsheetDao = spreadsheetDao; } @@ -686,13 +497,8 @@ } // set SpreadsheetToolContentHandler as null to avoid copy file node in repository again. - toolContentObj = Spreadsheet.newInstance(toolContentObj, toolContentId, null); - toolContentObj.setToolContentHandler(null); - toolContentObj.setOfflineFileList(null); - toolContentObj.setOnlineFileList(null); + toolContentObj = Spreadsheet.newInstance(toolContentObj, toolContentId); try { - exportContentService.registerFileClassForExport(SpreadsheetAttachment.class.getName(), "fileUuid", - "fileVersionId"); exportContentService.exportToolContent(toolContentId, toolContentObj, spreadsheetToolContentHandler, rootPath); } catch (ExportToolContentException e) { @@ -704,9 +510,9 @@ String toVersion) throws ToolException { try { - exportContentService.registerFileClassForImport(SpreadsheetAttachment.class.getName(), "fileUuid", - "fileVersionId", "fileName", "fileType", null, null); - + // register version filter class + exportContentService.registerImportVersionFilterClass(SpreadsheetImportContentVersionFilter.class); + Object toolPOJO = exportContentService.importToolContent(toolContentPath, spreadsheetToolContentHandler, fromVersion, toVersion); if (!(toolPOJO instanceof Spreadsheet)) { @@ -766,30 +572,14 @@ } } - Spreadsheet toContent = Spreadsheet.newInstance(spreadsheet, toContentId, spreadsheetToolContentHandler); + Spreadsheet toContent = Spreadsheet.newInstance(spreadsheet, toContentId); spreadsheetDao.saveObject(toContent); } - + public String getToolContentTitle(Long toolContentId) { return getSpreadsheetByContentId(toolContentId).getTitle(); } - - public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Spreadsheet spreadsheet = spreadsheetDao.getByContentId(toolContentId); - if (spreadsheet == null) { - throw new ToolException("No found tool content by given content ID:" + toolContentId); - } - spreadsheet.setDefineLater(value); - } - public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException { - Spreadsheet spreadsheet = spreadsheetDao.getByContentId(toolContentId); - if (spreadsheet == null) { - throw new ToolException("No found tool content by given content ID:" + toolContentId); - } - spreadsheet.setRunOffline(value); - } - public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { Spreadsheet spreadsheet = spreadsheetDao.getByContentId(toolContentId); Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/AuthoringAction.java,v diff -u -r1.3 -r1.4 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/AuthoringAction.java 25 Jul 2013 05:55:20 -0000 1.3 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/AuthoringAction.java 17 Jan 2014 22:12:25 -0000 1.4 @@ -50,7 +50,6 @@ import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.spreadsheet.SpreadsheetConstants; import org.lamsfoundation.lams.tool.spreadsheet.model.Spreadsheet; -import org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetAttachment; import org.lamsfoundation.lams.tool.spreadsheet.model.SpreadsheetUser; import org.lamsfoundation.lams.tool.spreadsheet.service.ISpreadsheetService; import org.lamsfoundation.lams.tool.spreadsheet.service.UploadSpreadsheetFileException; @@ -64,483 +63,250 @@ import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; - /** - * @author Steve.Ni - * @version $Revision$ */ public class AuthoringAction extends Action { - private static Logger log = Logger.getLogger(AuthoringAction.class); - - public ActionForward execute(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws Exception{ - - String param = mapping.getParameter(); - //-----------------------Spreadsheet Author function --------------------------- - if(param.equals("start")){ - ToolAccessMode mode = getAccessMode(request); - //teacher mode "check for new" button enter. - if(mode != null) - request.setAttribute(AttributeNames.ATTR_MODE,mode.toString()); - else - request.setAttribute(AttributeNames.ATTR_MODE,ToolAccessMode.AUTHOR.toString()); - return start(mapping, form, request, response); - } - if (param.equals("definelater")) { - //update define later flag to true - Long contentId = new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID)); - ISpreadsheetService service = getSpreadsheetService(); - Spreadsheet spreadsheet = service.getSpreadsheetByContentId(contentId); - - spreadsheet.setDefineLater(true); - service.saveOrUpdateSpreadsheet(spreadsheet); - - request.setAttribute(AttributeNames.ATTR_MODE,ToolAccessMode.TEACHER.toString()); - return start(mapping, form, request, response); - } - if (param.equals("initPage")) { - return initPage(mapping, form, request, response); - } + private static Logger log = Logger.getLogger(AuthoringAction.class); - 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); - } + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { - return mapping.findForward(SpreadsheetConstants.ERROR); + String param = mapping.getParameter(); + // -----------------------Spreadsheet Author function --------------------------- + if (param.equals("start")) { + ToolAccessMode mode = getAccessMode(request); + // teacher mode "check for new" button enter. + if (mode != null) + request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); + else + request.setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.AUTHOR.toString()); + return start(mapping, form, request, response); } + if (param.equals("definelater")) { + // update define later flag to true + Long contentId = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); + ISpreadsheetService service = getSpreadsheetService(); + Spreadsheet spreadsheet = service.getSpreadsheetByContentId(contentId); - /** - * Read spreadsheet data from database and put them into HttpSession. It will redirect to init.do directly after this - * method run successfully. - * - * This method will avoid read database again and lost un-saved resouce item lost when user "refresh page", - * @throws ServletException - * - */ - private ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException { - - //save toolContentID into HTTPSession - Long contentId = new Long(WebUtil.readLongParam(request,SpreadsheetConstants.PARAM_TOOL_CONTENT_ID)); - -// get back the spreadsheet and item list and display them on page - ISpreadsheetService service = getSpreadsheetService(); + spreadsheet.setDefineLater(true); + service.saveOrUpdateSpreadsheet(spreadsheet); - Spreadsheet spreadsheet = null; - SpreadsheetForm spreadsheetForm = (SpreadsheetForm)form; - - // Get contentFolderID and save to form. - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - spreadsheetForm.setContentFolderID(contentFolderID); - - //initial Session Map - SessionMap sessionMap = new SessionMap(); - request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); - spreadsheetForm.setSessionMapID(sessionMap.getSessionID()); - - try { - spreadsheet = service.getSpreadsheetByContentId(contentId); - //if spreadsheet does not exist, try to use default content instead. - if(spreadsheet == null){ - spreadsheet = service.getDefaultContent(contentId); - } - spreadsheetForm.setSpreadsheet(spreadsheet); + request.setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.TEACHER.toString()); + return start(mapping, form, request, response); + } + if (param.equals("initPage")) { + return initPage(mapping, form, request, response); + } - //initialize instruction attachment list - List attachmentList = getAttachmentList(sessionMap); - attachmentList.clear(); - attachmentList.addAll(spreadsheet.getAttachments()); - } catch (Exception e) { - log.error(e); - throw new ServletException(e); - } - - sessionMap.put(SpreadsheetConstants.ATTR_RESOURCE_FORM, spreadsheetForm); - request.getSession().setAttribute(AttributeNames.PARAM_NOTIFY_CLOSE_URL, - request.getParameter(AttributeNames.PARAM_NOTIFY_CLOSE_URL)); - return mapping.findForward(SpreadsheetConstants.SUCCESS); + if (param.equals("updateContent")) { + return updateContent(mapping, form, request, response); } + return mapping.findForward(SpreadsheetConstants.ERROR); + } - /** - * Display same entire authoring page content from HttpSession variable. - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws ServletException - */ - private ActionForward initPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws ServletException { - String sessionMapID = WebUtil.readStrParam(request, SpreadsheetConstants.ATTR_SESSION_MAP_ID); - SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(sessionMapID); - SpreadsheetForm existForm = (SpreadsheetForm) sessionMap.get(SpreadsheetConstants.ATTR_RESOURCE_FORM); - - SpreadsheetForm spreadsheetForm = (SpreadsheetForm )form; - try { - PropertyUtils.copyProperties(spreadsheetForm, existForm); - } catch (Exception e) { - throw new ServletException(e); - } - - ToolAccessMode mode = getAccessMode(request); - if(mode.isAuthor()) - return mapping.findForward(SpreadsheetConstants.SUCCESS); - else - return mapping.findForward(SpreadsheetConstants.DEFINE_LATER); - } - /** - * This method will persist all inforamtion in this authoring page, include all spreadsheet item, information etc. - * - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws ServletException - */ - private ActionForward updateContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { - SpreadsheetForm spreadsheetForm = (SpreadsheetForm)(form); - - //get back sessionMAP - SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(spreadsheetForm.getSessionMapID()); - - ToolAccessMode mode = getAccessMode(request); - - ActionMessages errors = validate(spreadsheetForm, mapping, request); - if(!errors.isEmpty()){ - saveErrors(request, errors); - if(mode.isAuthor()) - return mapping.findForward("author"); - else - return mapping.findForward("monitor"); - } - - Spreadsheet spreadsheet = spreadsheetForm.getSpreadsheet(); - ISpreadsheetService service = getSpreadsheetService(); - - //**********************************Get Spreadsheet PO********************* - Spreadsheet spreadsheetPO = service.getSpreadsheetByContentId(spreadsheetForm.getSpreadsheet().getContentId()); - if(spreadsheetPO == null){ - //new Spreadsheet, create it. - spreadsheetPO = spreadsheet; - spreadsheetPO.setCreated(new Timestamp(new Date().getTime())); - spreadsheetPO.setUpdated(new Timestamp(new Date().getTime())); - }else{ - if(mode.isAuthor()){ - Long uid = spreadsheetPO.getUid(); - PropertyUtils.copyProperties(spreadsheetPO,spreadsheet); - //get back UID - spreadsheetPO.setUid(uid); - }else{ //if it is Teacher, then just update basic tab content (definelater) - spreadsheetPO.setInstructions(spreadsheet.getInstructions()); - spreadsheetPO.setCode(spreadsheet.getCode()); - spreadsheetPO.setTitle(spreadsheet.getTitle()); -// change define later status - spreadsheetPO.setDefineLater(false); - } - spreadsheetPO.setUpdated(new Timestamp(new Date().getTime())); - } - - //*******************************Handle user******************* - //try to get form system session - HttpSession ss = SessionManager.getSession(); - //get back login user DTO - UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - SpreadsheetUser spreadsheetUser = service.getUserByIDAndContent(new Long(user.getUserID().intValue()) - ,spreadsheetForm.getSpreadsheet().getContentId()); - if(spreadsheetUser == null){ - spreadsheetUser = new SpreadsheetUser(user,spreadsheetPO); - } + /** + * Read spreadsheet data from database and put them into HttpSession. It will redirect to init.do directly after + * this method run successfully. + * + * This method will avoid read database again and lost un-saved resouce item lost when user "refresh page", + * + * @throws ServletException + * + */ + private ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws ServletException { - spreadsheetPO.setCreatedBy(spreadsheetUser); - - //**********************************Handle Authoring Instruction Attachement ********************* - //merge attachment info - //so far, attPOSet will be empty if content is existed. because PropertyUtils.copyProperties() is executed - Set attPOSet = spreadsheetPO.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()){ - SpreadsheetAttachment newAtt = (SpreadsheetAttachment) 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()){ - SpreadsheetAttachment delAtt = (SpreadsheetAttachment) 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()){ - SpreadsheetAttachment att = (SpreadsheetAttachment) attIter.next(); - if(delAtt.getUid().equals(att.getUid())){ - attIter.remove(); - break; - } - } - service.deleteSpreadsheetAttachment(delAtt.getUid()); - }//end remove from persist value - } - - //copy back - spreadsheetPO.setAttachments(attPOSet); - - //finally persist spreadsheetPO again - service.saveOrUpdateSpreadsheet(spreadsheetPO); - - //initialize attachmentList again - attachmentList = getAttachmentList(sessionMap); - attachmentList.addAll(spreadsheet.getAttachments()); - spreadsheetForm.setSpreadsheet(spreadsheetPO); - - request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG,Boolean.TRUE); - if(mode.isAuthor()) - return mapping.findForward("author"); - else - return mapping.findForward("monitor"); - } + // save toolContentID into HTTPSession + Long contentId = new Long(WebUtil.readLongParam(request, SpreadsheetConstants.PARAM_TOOL_CONTENT_ID)); - /** - * Handle upload online instruction files request. - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws UploadSpreadsheetFileException - */ - public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws UploadSpreadsheetFileException { - return uploadFile(mapping, form, IToolContentHandler.TYPE_ONLINE,request); - } - /** - * Handle upload offline instruction files request. - * @param mapping - * @param form - * @param request - * @param response - * @return - * @throws UploadSpreadsheetFileException - */ - public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) throws UploadSpreadsheetFileException { - 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 UploadSpreadsheetFileException - */ - private ActionForward uploadFile(ActionMapping mapping, ActionForm form, - String type,HttpServletRequest request) throws UploadSpreadsheetFileException { + // get back the spreadsheet and item list and display them on page + ISpreadsheetService service = getSpreadsheetService(); - SpreadsheetForm spreadsheetForm = (SpreadsheetForm) form; - //get back sessionMAP - SessionMap sessionMap = (SessionMap)request.getSession().getAttribute(spreadsheetForm.getSessionMapID()); + Spreadsheet spreadsheet = null; + SpreadsheetForm spreadsheetForm = (SpreadsheetForm) form; - FormFile file; - if(StringUtils.equals(IToolContentHandler.TYPE_OFFLINE,type)) - file = (FormFile) spreadsheetForm.getOfflineFile(); - else - file = (FormFile) spreadsheetForm.getOnlineFile(); - - if(file == null || StringUtils.isBlank(file.getFileName())) - return mapping.findForward(SpreadsheetConstants.SUCCESS); - - //validate file size - ActionMessages errors = new ActionMessages(); - FileValidatorUtil.validateFileSize(file, true, errors ); - if(!errors.isEmpty()){ - this.saveErrors(request, errors); - return mapping.findForward(SpreadsheetConstants.SUCCESS); - } - - ISpreadsheetService service = getSpreadsheetService(); - //upload to repository - SpreadsheetAttachment 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(); - SpreadsheetAttachment existAtt; - while(iter.hasNext()){ - existAtt = (SpreadsheetAttachment) 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); + // Get contentFolderID and save to form. + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + spreadsheetForm.setContentFolderID(contentFolderID); - return mapping.findForward(SpreadsheetConstants.SUCCESS); + // initial Session Map + SessionMap sessionMap = new SessionMap(); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); + spreadsheetForm.setSessionMapID(sessionMap.getSessionID()); + try { + spreadsheet = service.getSpreadsheetByContentId(contentId); + // if spreadsheet does not exist, try to use default content instead. + if (spreadsheet == null) { + spreadsheet = service.getDefaultContent(contentId); + } + spreadsheetForm.setSpreadsheet(spreadsheet); + } catch (Exception e) { + log.error(e); + throw new ServletException(e); } - /** - * Delete offline instruction file from current Spreadsheet 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); + + sessionMap.put(SpreadsheetConstants.ATTR_RESOURCE_FORM, spreadsheetForm); + request.getSession().setAttribute(AttributeNames.PARAM_NOTIFY_CLOSE_URL, + request.getParameter(AttributeNames.PARAM_NOTIFY_CLOSE_URL)); + return mapping.findForward(SpreadsheetConstants.SUCCESS); + } + + /** + * Display same entire authoring page content from HttpSession variable. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ServletException + */ + private ActionForward initPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws ServletException { + String sessionMapID = WebUtil.readStrParam(request, SpreadsheetConstants.ATTR_SESSION_MAP_ID); + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(sessionMapID); + SpreadsheetForm existForm = (SpreadsheetForm) sessionMap.get(SpreadsheetConstants.ATTR_RESOURCE_FORM); + + SpreadsheetForm spreadsheetForm = (SpreadsheetForm) form; + try { + PropertyUtils.copyProperties(spreadsheetForm, existForm); + } catch (Exception e) { + throw new ServletException(e); } - /** - * Delete online instruction file from current Spreadsheet 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,SpreadsheetConstants.PARAM_FILE_VERSION_ID)); - Long uuID = new Long(WebUtil.readLongParam(request,SpreadsheetConstants.PARAM_FILE_UUID)); - - //get back sessionMAP - String sessionMapID = WebUtil.readStrParam(request, SpreadsheetConstants.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(); - SpreadsheetAttachment existAtt; - while(iter.hasNext()){ - existAtt = (SpreadsheetAttachment) 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(); - } - } + ToolAccessMode mode = getAccessMode(request); + if (mode.isAuthor()) + return mapping.findForward(SpreadsheetConstants.SUCCESS); + else + return mapping.findForward(SpreadsheetConstants.DEFINE_LATER); + } - request.setAttribute(SpreadsheetConstants.ATTR_FILE_TYPE_FLAG, type); - request.setAttribute(SpreadsheetConstants.ATTR_SESSION_MAP_ID, sessionMapID); - return mapping.findForward(SpreadsheetConstants.SUCCESS); + /** + * This method will persist all inforamtion in this authoring page, include all spreadsheet item, information etc. + * + * @param mapping + * @param form + * @param request + * @param response + * @return + * @throws ServletException + */ + private ActionForward updateContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws Exception { + SpreadsheetForm spreadsheetForm = (SpreadsheetForm) (form); + // get back sessionMAP + SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(spreadsheetForm.getSessionMapID()); + + ToolAccessMode mode = getAccessMode(request); + + ActionMessages errors = validate(spreadsheetForm, mapping, request); + if (!errors.isEmpty()) { + saveErrors(request, errors); + if (mode.isAuthor()) + return mapping.findForward("author"); + else + return mapping.findForward("monitor"); } - //************************************************************************************* - // Private method - //************************************************************************************* - /** - * Return SpreadsheetService bean. - */ - private ISpreadsheetService getSpreadsheetService() { - WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet().getServletContext()); - return (ISpreadsheetService) wac.getBean(SpreadsheetConstants.RESOURCE_SERVICE); - } - /** - * @param request - * @return - */ - private List getAttachmentList(SessionMap sessionMap) { - return getListFromSession(sessionMap,SpreadsheetConstants.ATT_ATTACHMENT_LIST); - } - /** - * @param request - * @return - */ - private List getDeletedAttachmentList(SessionMap sessionMap) { - return getListFromSession(sessionMap,SpreadsheetConstants.ATTR_DELETED_ATTACHMENT_LIST); - } - /** - * Get java.util.List from HttpSession by given name. - * - * @param request - * @param name - * @return - */ - private List getListFromSession(SessionMap sessionMap,String name) { - List list = (List) sessionMap.get(name); - if(list == null){ - list = new ArrayList(); - sessionMap.put(name,list); - } - return list; + Spreadsheet spreadsheet = spreadsheetForm.getSpreadsheet(); + ISpreadsheetService service = getSpreadsheetService(); + + // **********************************Get Spreadsheet PO********************* + Spreadsheet spreadsheetPO = service.getSpreadsheetByContentId(spreadsheetForm.getSpreadsheet().getContentId()); + if (spreadsheetPO == null) { + // new Spreadsheet, create it. + spreadsheetPO = spreadsheet; + spreadsheetPO.setCreated(new Timestamp(new Date().getTime())); + spreadsheetPO.setUpdated(new Timestamp(new Date().getTime())); + } else { + if (mode.isAuthor()) { + Long uid = spreadsheetPO.getUid(); + PropertyUtils.copyProperties(spreadsheetPO, spreadsheet); + // get back UID + spreadsheetPO.setUid(uid); + } else { // if it is Teacher, then just update basic tab content (definelater) + spreadsheetPO.setInstructions(spreadsheet.getInstructions()); + spreadsheetPO.setCode(spreadsheet.getCode()); + spreadsheetPO.setTitle(spreadsheet.getTitle()); + // change define later status + spreadsheetPO.setDefineLater(false); + } + spreadsheetPO.setUpdated(new Timestamp(new Date().getTime())); } - /** - * Get ToolAccessMode from HttpRequest parameters. Default value is AUTHOR mode. - * @param request - * @return - */ - private ToolAccessMode getAccessMode(HttpServletRequest request) { - ToolAccessMode mode; - String modeStr = request.getParameter(AttributeNames.ATTR_MODE); - if(StringUtils.equalsIgnoreCase(modeStr,ToolAccessMode.TEACHER.toString())) - mode = ToolAccessMode.TEACHER; - else - mode = ToolAccessMode.AUTHOR; - return mode; + // *******************************Handle user******************* + // try to get form system session + HttpSession ss = SessionManager.getSession(); + // get back login user DTO + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + SpreadsheetUser spreadsheetUser = service.getUserByIDAndContent(new Long(user.getUserID().intValue()), + spreadsheetForm.getSpreadsheet().getContentId()); + if (spreadsheetUser == null) { + spreadsheetUser = new SpreadsheetUser(user, spreadsheetPO); } - - - private ActionMessages validate(SpreadsheetForm spreadsheetForm, ActionMapping mapping, HttpServletRequest request) { - ActionMessages errors = new ActionMessages(); -// if (StringUtils.isBlank(spreadsheetForm.getSpreadsheet().getTitle())) { -// ActionMessage error = new ActionMessage("error.resource.item.title.blank"); -// errors.add(ActionMessages.GLOBAL_MESSAGE, error); -// } - - //define it later mode(TEACHER) skip below validation. - String modeStr = request.getParameter(AttributeNames.ATTR_MODE); - if(StringUtils.equals(modeStr, ToolAccessMode.TEACHER.toString())){ - return errors; - } - //Some other validation outside basic Tab. - - return errors; + spreadsheetPO.setCreatedBy(spreadsheetUser); + + // finally persist spreadsheetPO again + service.saveOrUpdateSpreadsheet(spreadsheetPO); + + spreadsheetForm.setSpreadsheet(spreadsheetPO); + + request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); + if (mode.isAuthor()) + return mapping.findForward("author"); + else + return mapping.findForward("monitor"); + } + + // ************************************************************************************* + // Private method + // ************************************************************************************* + /** + * Return SpreadsheetService bean. + */ + private ISpreadsheetService getSpreadsheetService() { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + return (ISpreadsheetService) wac.getBean(SpreadsheetConstants.RESOURCE_SERVICE); + } + + /** + * Get ToolAccessMode from HttpRequest parameters. Default value is AUTHOR mode. + * + * @param request + * @return + */ + private ToolAccessMode getAccessMode(HttpServletRequest request) { + ToolAccessMode mode; + String modeStr = request.getParameter(AttributeNames.ATTR_MODE); + if (StringUtils.equalsIgnoreCase(modeStr, ToolAccessMode.TEACHER.toString())) + mode = ToolAccessMode.TEACHER; + else + mode = ToolAccessMode.AUTHOR; + return mode; + } + + private ActionMessages validate(SpreadsheetForm spreadsheetForm, ActionMapping mapping, HttpServletRequest request) { + ActionMessages errors = new ActionMessages(); + // if (StringUtils.isBlank(spreadsheetForm.getSpreadsheet().getTitle())) { + // ActionMessage error = new ActionMessage("error.resource.item.title.blank"); + // errors.add(ActionMessages.GLOBAL_MESSAGE, error); + // } + + // define it later mode(TEACHER) skip below validation. + String modeStr = request.getParameter(AttributeNames.ATTR_MODE); + if (StringUtils.equals(modeStr, ToolAccessMode.TEACHER.toString())) { + return errors; } + // Some other validation outside basic Tab. + + return errors; + } + } Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/LearningAction.java,v diff -u -r1.6 -r1.7 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/LearningAction.java 9 Apr 2013 12:47:21 -0000 1.6 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/LearningAction.java 17 Jan 2014 22:12:25 -0000 1.7 @@ -177,13 +177,6 @@ ActivityPositionDTO activityPosition = LearningWebUtil.putActivityPositionInRequestByToolSessionId(sessionId, request, getServlet().getServletContext()); sessionMap.put(AttributeNames.ATTR_ACTIVITY_POSITION, activityPosition); - - //add run offline support - if(spreadsheet.getRunOffline()){ - sessionMap.put(SpreadsheetConstants.PARAM_RUN_OFFLINE, true); - return mapping.findForward("runOffline"); - }else - sessionMap.put(SpreadsheetConstants.PARAM_RUN_OFFLINE, false); sessionMap.put(SpreadsheetConstants.ATTR_RESOURCE,spreadsheet); Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/MonitoringAction.java,v diff -u -r1.8 -r1.9 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/MonitoringAction.java 15 Aug 2011 14:50:58 -0000 1.8 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/action/MonitoringAction.java 17 Jan 2014 22:12:25 -0000 1.9 @@ -121,7 +121,6 @@ request.setAttribute(SpreadsheetConstants.ATTR_STATISTIC_LIST, statisticList); Spreadsheet spreadsheet = service.getSpreadsheetByContentId(contentId); - spreadsheet.toDTO(); Map> reflectList = service.getReflectList(contentId, false); Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/form/SpreadsheetForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/form/SpreadsheetForm.java,v diff -u -r1.2 -r1.3 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/form/SpreadsheetForm.java 23 Jul 2008 04:46:03 -0000 1.2 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/form/SpreadsheetForm.java 17 Jan 2014 22:12:25 -0000 1.3 @@ -73,7 +73,6 @@ if(!StringUtils.equals(param,"start") && !StringUtils.equals(param,"initPage")){ spreadsheet.setLockWhenFinished(false); spreadsheet.setDefineLater(false); - spreadsheet.setRunOffline(false); spreadsheet.setLearnerAllowedToSave(true); spreadsheet.setMarkingEnabled(false); spreadsheet.setReflectOnActivity(false); Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/servlet/ExportServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/servlet/ExportServlet.java,v diff -u -r1.6 -r1.7 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/servlet/ExportServlet.java 6 Jan 2014 08:42:13 -0000 1.6 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/web/servlet/ExportServlet.java 17 Jan 2014 22:12:26 -0000 1.7 @@ -113,27 +113,7 @@ 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 { - Spreadsheet content = null; - if ( toolContentID != null ) { - content = service.getSpreadsheetByContentId(toolContentID); - } else { - SpreadsheetSession session=service.getSessionBySessionId(toolSessionID); - if ( session != null ) - content = session.getSpreadsheet(); - } - 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 SpreadsheetApplicationException { if (userID == null || toolSessionID == null) { Index: lams_tool_spreadsheet/web/pages/authoring/authoring.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/web/pages/authoring/authoring.jsp,v diff -u -r1.4 -r1.5 --- lams_tool_spreadsheet/web/pages/authoring/authoring.jsp 27 Nov 2012 16:00:51 -0000 1.4 +++ lams_tool_spreadsheet/web/pages/authoring/authoring.jsp 17 Jan 2014 22:12:25 -0000 1.5 @@ -27,18 +27,7 @@ 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(); - } function onSubmitHandler() { var code = window.frames["externalSpreadsheet"].cellsToJS(); @@ -60,7 +49,6 @@ -
@@ -85,17 +73,7 @@ - - - - - <%-- Default value - cancelButtonLabelKey="label.authoring.cancel.button" - saveButtonLabelKey="label.authoring.save.button" - cancelConfirmMsgKey="authoring.msg.cancel.save" - accessMode="author" - --%> - - - + +
- - - + +