@@ -120,14 +107,10 @@
-
-
+
+
-
-
-
-
<%-- Default value
cancelButtonLabelKey="label.authoring.cancel.button"
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_task/web/pages/authoring/instructions.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_task/web/pages/authoring/parts/instructionfilelist.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_task/web/pages/learning/runoffline.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_task/web/pages/learning/submissionDeadline.jsp
===================================================================
diff -u
--- lams_tool_task/web/pages/learning/submissionDeadline.jsp (revision 0)
+++ lams_tool_task/web/pages/learning/submissionDeadline.jsp (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -0,0 +1,93 @@
+
+
+<%@include file="/common/taglibs.jsp"%>
+
+
+
+ <%@ include file="/common/header.jsp"%>
+
+
+
+
+
+
+
+ ${sessionMap.title}
+
+
+
+
+
+
+
+
+
+
+
${sessionMap.reflectInstructions}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_task/web/pages/monitoring/instructions.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_task/web/pages/monitoring/monitoring.jsp
===================================================================
diff -u -r341a816804f6b2b61a5f180479b56d8fd0d1ea29 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_task/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 341a816804f6b2b61a5f180479b56d8fd0d1ea29)
+++ lams_tool_task/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -33,18 +33,16 @@
-
-
-
+
+
Index: lams_tool_videorecorder/conf/middlegen/lams_tool_lavideoRecorder11-prefs.properties
===================================================================
diff -u -r3d081de4a45da632ee6029251318fac795d41813 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/conf/middlegen/lams_tool_lavideoRecorder11-prefs.properties (.../lams_tool_lavideoRecorder11-prefs.properties) (revision 3d081de4a45da632ee6029251318fac795d41813)
+++ lams_tool_videorecorder/conf/middlegen/lams_tool_lavideoRecorder11-prefs.properties (.../lams_tool_lavideoRecorder11-prefs.properties) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -44,8 +44,6 @@
hibernate.tables.tl_lavidr10_videoRecorder.columns.offline_instructions.java-type=java.lang.String
hibernate.tables.tl_lavidr10_videoRecorder.columns.online_instructions.java-name=onlineInstructions
hibernate.tables.tl_lavidr10_videoRecorder.columns.online_instructions.java-type=java.lang.String
-hibernate.tables.tl_lavidr10_videoRecorder.columns.run_offline.java-name=runOffline
-hibernate.tables.tl_lavidr10_videoRecorder.columns.run_offline.java-type=java.lang.Boolean
hibernate.tables.tl_lavidr10_videoRecorder.columns.title.inctostring=true
hibernate.tables.tl_lavidr10_videoRecorder.columns.title.java-name=title
hibernate.tables.tl_lavidr10_videoRecorder.columns.title.java-type=java.lang.String
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/IVideoRecorderAttachmentDAO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/IVideoRecorderDAO.java
===================================================================
diff -u -r3d081de4a45da632ee6029251318fac795d41813 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/IVideoRecorderDAO.java (.../IVideoRecorderDAO.java) (revision 3d081de4a45da632ee6029251318fac795d41813)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/IVideoRecorderDAO.java (.../IVideoRecorderDAO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -37,8 +37,6 @@
void saveOrUpdate(VideoRecorder toContent);
- void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type);
-
void releaseFromCache(Object o);
}
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/hibernate/VideoRecorderAttachmentDAO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/hibernate/VideoRecorderDAO.java
===================================================================
diff -u -r3d081de4a45da632ee6029251318fac795d41813 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/hibernate/VideoRecorderDAO.java (.../VideoRecorderDAO.java) (revision 3d081de4a45da632ee6029251318fac795d41813)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dao/hibernate/VideoRecorderDAO.java (.../VideoRecorderDAO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -26,12 +26,9 @@
import java.util.List;
-import org.hibernate.FlushMode;
import org.lamsfoundation.lams.dao.hibernate.BaseDAO;
import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderDAO;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment;
-import org.springframework.orm.hibernate3.HibernateTemplate;
/**
* DAO for accessing the VideoRecorder objects - Hibernate specific code.
@@ -40,9 +37,6 @@
private static final String FIND_FORUM_BY_CONTENTID = "from VideoRecorder videoRecorder where videoRecorder.toolContentId=?";
- private static final String FIND_INSTRUCTION_FILE = "from " + VideoRecorderAttachment.class.getName()
- + " as i where tool_content_id=? and i.file_uuid=? and i.file_version_id=? and i.file_type=?";
-
public VideoRecorder getByContentId(Long toolContentId) {
List list = getHibernateTemplate().find(VideoRecorderDAO.FIND_FORUM_BY_CONTENTID, toolContentId);
if (list != null && list.size() > 0) {
@@ -57,22 +51,6 @@
this.getHibernateTemplate().flush();
}
- public void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type) {
- HibernateTemplate templ = this.getHibernateTemplate();
- if (toolContentId != null && uuid != null && versionId != null) {
- List list = getSession().createQuery(VideoRecorderDAO.FIND_INSTRUCTION_FILE).setLong(0,
- toolContentId.longValue()).setLong(1, uuid.longValue()).setLong(2, versionId.longValue())
- .setString(3, type).list();
- if (list != null && list.size() > 0) {
- VideoRecorderAttachment file = (VideoRecorderAttachment) list.get(0);
- this.getSession().setFlushMode(FlushMode.AUTO);
- templ.delete(file);
- templ.flush();
- }
- }
-
- }
-
public void releaseFromCache(Object o) {
getSession().evict(o);
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/patch20140102.sql
===================================================================
diff -u
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/patch20140102.sql (revision 0)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dbupdates/patch20140102.sql (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -0,0 +1,19 @@
+-- Turn off autocommit, so nothing is committed if there is an error
+SET AUTOCOMMIT = 0;
+SET FOREIGN_KEY_CHECKS=0;
+----------------------Put all sql statements below here-------------------------
+
+-- LDEV-3147 Simplify tools: get rid of instructions tab, define in monitor and offline activity options
+ALTER TABLE tl_lavidr10_videoRecorder DROP COLUMN online_instructions;
+ALTER TABLE tl_lavidr10_videoRecorder DROP COLUMN offline_instructions;
+ALTER TABLE tl_lavidr10_videoRecorder DROP COLUMN run_offline;
+DROP TABLE IF EXISTS tl_lavidr10_attachment;
+
+UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lavidr10';
+
+----------------------Put all sql statements above here-------------------------
+
+-- If there were no errors, commit and restore autocommit to on
+COMMIT;
+SET AUTOCOMMIT = 1;
+SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderAttachmentDTO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderDTO.java
===================================================================
diff -u -rea79f29aed5c764a223234e456442bc1e49fcf85 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderDTO.java (.../VideoRecorderDTO.java) (revision ea79f29aed5c764a223234e456442bc1e49fcf85)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderDTO.java (.../VideoRecorderDTO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -32,8 +32,6 @@
import org.apache.log4j.Logger;
import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderSession;
public class VideoRecorderDTO {
@@ -44,10 +42,6 @@
public String title;
public String instructions;
-
- public String onlineInstructions;
-
- public String offlineInstructions;
public boolean reflectOnActivity;
@@ -72,11 +66,7 @@
public boolean exportOffline;
public boolean exportAll;
-
- public Set
onlineInstructionsFiles;
- public Set offlineInstructionsFiles;
-
public Set sessionDTOs = new TreeSet();
public VideoRecorderRecordingDTO authorRecording;
@@ -90,8 +80,6 @@
toolContentId = videoRecorder.getToolContentId();
title = videoRecorder.getTitle();
instructions = videoRecorder.getInstructions();
- onlineInstructions = videoRecorder.getOnlineInstructions();
- offlineInstructions = videoRecorder.getOfflineInstructions();
contentInUse = videoRecorder.isContentInUse();
lockOnFinish = videoRecorder.isLockOnFinished();
allowUseVoice = videoRecorder.isAllowUseVoice();
@@ -103,28 +91,10 @@
exportOffline = videoRecorder.isExportOffline();
reflectOnActivity = videoRecorder.isReflectOnActivity();
reflectInstructions = videoRecorder.getReflectInstructions();
- onlineInstructionsFiles = new TreeSet();
- offlineInstructionsFiles = new TreeSet();
if(videoRecorder.getAuthorRecording() != null){
authorRecording = new VideoRecorderRecordingDTO();
}
-
- for (Iterator i = videoRecorder.getVideoRecorderAttachments().iterator(); i.hasNext();) {
- VideoRecorderAttachment att = (VideoRecorderAttachment) i.next();
- if (att.getFileType().equals(IToolContentHandler.TYPE_OFFLINE)) {
- VideoRecorderAttachmentDTO attDTO = new VideoRecorderAttachmentDTO(att);
- offlineInstructionsFiles.add(attDTO);
- } else if (att.getFileType()
- .equals(IToolContentHandler.TYPE_ONLINE)) {
- VideoRecorderAttachmentDTO attDTO = new VideoRecorderAttachmentDTO(att);
- onlineInstructionsFiles.add(attDTO);
- } else {
- // something is wrong. Ignore file, log error
- logger.error("File with uid " + att.getFileUuid()
- + " contains invalid fileType: " + att.getFileType());
- }
- }
}
/* Getters / Setters */
@@ -144,48 +114,14 @@
this.instructions = instructions;
}
- public String getOfflineInstructions() {
- return offlineInstructions;
- }
-
- public void setOfflineInstructions(String offlineInstructions) {
- this.offlineInstructions = offlineInstructions;
- }
-
- public Set getOfflineInstructionsFiles() {
- return offlineInstructionsFiles;
- }
-
public VideoRecorderRecordingDTO getAuthorRecording() {
return authorRecording;
}
public void setAuthorRecording(VideoRecorderRecordingDTO authorRecording) {
this.authorRecording = authorRecording;
}
-
- public void setOfflineInstructionsFiles(
- Set offlineInstructionsFiles) {
- this.offlineInstructionsFiles = offlineInstructionsFiles;
- }
- public String getOnlineInstructions() {
- return onlineInstructions;
- }
-
- public void setOnlineInstructions(String onlineInstructions) {
- this.onlineInstructions = onlineInstructions;
- }
-
- public Set getOnlineInstructionsFiles() {
- return onlineInstructionsFiles;
- }
-
- public void setOnlineInstructionsFiles(
- Set onlineInstructionsFiles) {
- this.onlineInstructionsFiles = onlineInstructionsFiles;
- }
-
public boolean isReflectOnActivity() {
return reflectOnActivity;
}
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java
===================================================================
diff -u -racc8d2acf5b6b0002e0c8129947040a779ab4077 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java (.../VideoRecorderRecordingDTO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java (.../VideoRecorderRecordingDTO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -26,18 +26,12 @@
package org.lamsfoundation.lams.tool.videoRecorder.dto;
import java.util.ArrayList;
+import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import java.util.TreeSet;
-import java.util.Date;
import org.apache.log4j.Logger;
-import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderComment;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderRating;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderRecording;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderSession;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderUser;
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorder.java
===================================================================
diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorder.java (.../VideoRecorder.java) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorder.java (.../VideoRecorder.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -68,8 +68,6 @@
String reflectInstructions;
- private boolean runOffline;
-
private boolean lockOnFinished;
private boolean allowUseVoice;
@@ -85,65 +83,19 @@
private boolean exportOffline;
private boolean exportAll;
-
- private String onlineInstructions;
- private String offlineInstructions;
-
private boolean contentInUse;
private boolean defineLater;
private Long toolContentId;
- private Set videoRecorderAttachments;
-
private Set videoRecorderSessions;
private VideoRecorderRecording authorRecording;
private Set conditions = new TreeSet(new TextSearchConditionComparator());
- // *********** NON Persisit fields
- private IToolContentHandler toolContentHandler;
-
- // Constructors
-
- /** default constructor */
- public VideoRecorder() {
- }
-
- /** full constructor */
- public VideoRecorder(Date createDate, Date updateDate, Long createBy, String title, String instructions,
- boolean runOffline, boolean lockOnFinished, boolean filteringEnabled, String filterKeywords,
- String onlineInstructions, String offlineInstructions, boolean contentInUse, boolean defineLater,
- boolean allowUseVoice, boolean allowUseCamera, boolean allowLearnerVideoExport, boolean allowLearnerVideoVisibility,
- Long toolContentId, Set videoRecorderAttachments, Set videoRecorderSessions, VideoRecorderRecording authorRecording,
- boolean exportAll, boolean exportOffline, boolean reflectOnActivity, String reflectInstructions) {
- this.createDate = createDate;
- this.updateDate = updateDate;
- this.createBy = createBy;
- this.title = title;
- this.instructions = instructions;
- this.runOffline = runOffline;
- this.lockOnFinished = lockOnFinished;
- this.onlineInstructions = onlineInstructions;
- this.offlineInstructions = offlineInstructions;
- this.contentInUse = contentInUse;
- this.defineLater = defineLater;
- this.toolContentId = toolContentId;
- this.videoRecorderAttachments = videoRecorderAttachments;
- this.videoRecorderSessions = videoRecorderSessions;
- this.authorRecording = authorRecording;
- this.allowUseVoice = allowUseVoice;
- this.allowUseCamera = allowUseCamera;
- this.allowLearnerVideoVisibility = allowLearnerVideoVisibility;
- this.exportOffline = exportOffline;
- this.exportAll = exportAll;
- this.reflectOnActivity = reflectOnActivity;
- this.reflectInstructions = reflectInstructions;
- }
-
// Property accessors
/**
* @hibernate.id generator-class="native" type="java.lang.Long" column="uid"
@@ -243,21 +195,8 @@
public void setReflectInstructions(String reflectInstructions) {
this.reflectInstructions = reflectInstructions;
- }
-
- /**
- * @hibernate.property column="run_offline" length="1"
- *
- */
+ }
- public boolean isRunOffline() {
- return runOffline;
- }
-
- public void setRunOffline(boolean runOffline) {
- this.runOffline = runOffline;
- }
-
/**
* @hibernate.property column="lock_on_finished" length="1"
*
@@ -353,35 +292,9 @@
public void setExportAll(boolean exportAll) {
this.exportAll = exportAll;
- }
-
- /**
- * @hibernate.property column="online_instructions" length="65535"
- *
- */
-
- public String getOnlineInstructions() {
- return onlineInstructions;
}
- public void setOnlineInstructions(String onlineInstructions) {
- this.onlineInstructions = onlineInstructions;
- }
-
/**
- * @hibernate.property column="offline_instructions" length="65535"
- *
- */
-
- public String getOfflineInstructions() {
- return offlineInstructions;
- }
-
- public void setOfflineInstructions(String offlineInstructions) {
- this.offlineInstructions = offlineInstructions;
- }
-
- /**
* @hibernate.property column="content_in_use" length="1"
*
*/
@@ -421,21 +334,6 @@
}
/**
- * @hibernate.set lazy="true" inverse="false" cascade="all-delete-orphan"
- * @hibernate.collection-key column="videoRecorder_uid"
- * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment"
- *
- */
-
- public Set getVideoRecorderAttachments() {
- return videoRecorderAttachments;
- }
-
- public void setVideoRecorderAttachments(Set videoRecorderAttachments) {
- this.videoRecorderAttachments = videoRecorderAttachments;
- }
-
- /**
* @hibernate.set lazy="true" inverse="true" cascade="none"
* @hibernate.collection-key column="videoRecorder_uid"
* @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderSession"
@@ -527,10 +425,8 @@
return result;
}
- public static VideoRecorder newInstance(VideoRecorder fromContent, Long toContentId,
- IToolContentHandler videoRecorderToolContentHandler) {
+ public static VideoRecorder newInstance(VideoRecorder fromContent, Long toContentId) {
VideoRecorder toContent = new VideoRecorder();
- fromContent.toolContentHandler = videoRecorderToolContentHandler;
toContent = (VideoRecorder) fromContent.clone();
toContent.setToolContentId(toContentId);
toContent.setCreateDate(new Date());
@@ -545,17 +441,6 @@
videoRecorder = (VideoRecorder) super.clone();
videoRecorder.setUid(null);
- if (videoRecorderAttachments != null) {
- // create a copy of the attachments
- Iterator iter = videoRecorderAttachments.iterator();
- Set set = new HashSet();
- while (iter.hasNext()) {
- VideoRecorderAttachment originalFile = (VideoRecorderAttachment) iter.next();
- VideoRecorderAttachment newFile = (VideoRecorderAttachment) originalFile.clone();
- set.add(newFile);
- }
- videoRecorder.videoRecorderAttachments = set;
- }
// create an empty set for the videoRecorderSession
videoRecorder.videoRecorderSessions = new HashSet();
@@ -573,12 +458,4 @@
return videoRecorder;
}
- public IToolContentHandler getToolContentHandler() {
- return toolContentHandler;
- }
-
- public void setToolContentHandler(IToolContentHandler toolContentHandler) {
- this.toolContentHandler = toolContentHandler;
- }
-
}
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/model/VideoRecorderAttachment.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java
===================================================================
diff -u -racc8d2acf5b6b0002e0c8129947040a779ab4077 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java (.../IVideoRecorderService.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java (.../IVideoRecorderService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -24,7 +24,6 @@
package org.lamsfoundation.lams.tool.videoRecorder.service;
-import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -34,7 +33,6 @@
import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRatingDTO;
import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRecordingDTO;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderComment;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderCondition;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderRating;
@@ -76,28 +74,6 @@
public VideoRecorder getVideoRecorderByContentId(Long toolContentID);
/**
- * @param toolContentId
- * @param file
- * @param type
- * @return
- */
- public VideoRecorderAttachment uploadFileToContent(Long toolContentId, FormFile file, String type);
-
- /**
- * @param uuid
- * @param versionID
- */
- public void deleteFromRepository(Long uuid, Long versionID) throws VideoRecorderException;
-
- /**
- * @param contentID
- * @param uuid
- * @param versionID
- * @param type
- */
- public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type);
-
- /**
* @param videoRecorder
*/
public void saveOrUpdateVideoRecorder(VideoRecorder videoRecorder);
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderImportContentVersionFilter.java
===================================================================
diff -u
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderImportContentVersionFilter.java (revision 0)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderImportContentVersionFilter.java (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -0,0 +1,43 @@
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.tool.videoRecorder.service;
+
+import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter;
+import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder;
+
+/**
+ * Import filter class for different version of VideoRecorder content.
+ */
+public class VideoRecorderImportContentVersionFilter extends ToolContentVersionFilter {
+
+ /**
+ * Import 20081208 version content to 20140102 version tool server.
+ */
+ public void up20081208To20140102() {
+ this.removeField(VideoRecorder.class, "runOffline");
+ this.removeField(VideoRecorder.class, "onlineInstructions");
+ this.removeField(VideoRecorder.class, "offlineInstructions");
+ this.removeField(VideoRecorder.class, "videoRecorderAttachments");
+ }
+}
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java
===================================================================
diff -u -r33da76d05725a84e191a5f6dca50b394cca3c1ee -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java (.../VideoRecorderService.java) (revision 33da76d05725a84e191a5f6dca50b394cca3c1ee)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java (.../VideoRecorderService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -64,7 +64,6 @@
import org.lamsfoundation.lams.tool.exception.SessionDataExistsException;
import org.lamsfoundation.lams.tool.exception.ToolException;
import org.lamsfoundation.lams.tool.service.ILamsToolService;
-import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderAttachmentDAO;
import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderCommentDAO;
import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderDAO;
import org.lamsfoundation.lams.tool.videoRecorder.dao.IVideoRecorderRatingDAO;
@@ -75,7 +74,6 @@
import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRatingDTO;
import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRecordingDTO;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderComment;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderCondition;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderRating;
@@ -110,8 +108,6 @@
private IVideoRecorderUserDAO videoRecorderUserDAO = null;
- private IVideoRecorderAttachmentDAO videoRecorderAttachmentDAO = null;
-
private IVideoRecorderRatingDAO videoRecorderRatingDAO = null;
private IVideoRecorderCommentDAO videoRecorderCommentDAO = null;
@@ -122,10 +118,6 @@
private IToolContentHandler videoRecorderToolContentHandler = null;
- private IRepositoryService repositoryService = null;
-
- private IAuditService auditService = null;
-
private IExportToolContentService exportContentService;
private ICoreNotebookService coreNotebookService;
@@ -235,28 +227,10 @@
fromContent = getDefaultContent();
}
- VideoRecorder toContent = VideoRecorder.newInstance(fromContent, toContentId, videoRecorderToolContentHandler);
+ VideoRecorder toContent = VideoRecorder.newInstance(fromContent, toContentId);
videoRecorderDAO.saveOrUpdate(toContent);
}
- public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException {
- VideoRecorder videoRecorder = videoRecorderDAO.getByContentId(toolContentId);
- if (videoRecorder == null) {
- throw new ToolException("Could not find tool with toolContentID: " + toolContentId);
- }
- videoRecorder.setDefineLater(value);
- videoRecorderDAO.saveOrUpdate(videoRecorder);
- }
-
- public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException {
- VideoRecorder videoRecorder = videoRecorderDAO.getByContentId(toolContentId);
- if (videoRecorder == null) {
- throw new ToolException("Could not find tool with toolContentID: " + toolContentId);
- }
- videoRecorder.setRunOffline(value);
- videoRecorderDAO.saveOrUpdate(videoRecorder);
- }
-
public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException,
ToolException {
// TODO Auto-generated method stub
@@ -282,9 +256,8 @@
// set ResourceToolContentHandler as null to avoid copy file node in
// repository again.
- videoRecorder = VideoRecorder.newInstance(videoRecorder, toolContentId, null);
+ videoRecorder = VideoRecorder.newInstance(videoRecorder, toolContentId);
videoRecorder.setToolContentId(null);
- videoRecorder.setToolContentHandler(null);
videoRecorder.setVideoRecorderSessions(null);
VideoRecorderRecording authorRecording = (VideoRecorderRecording) getFirstRecordingByToolContentId(toolContentId);
@@ -298,14 +271,7 @@
}
videoRecorder.setAuthorRecording(authorRecording);
-
- Set atts = videoRecorder.getVideoRecorderAttachments();
- for (VideoRecorderAttachment att : atts) {
- att.setVideoRecorder(null);
- }
try {
- exportContentService.registerFileClassForExport(VideoRecorderAttachment.class.getName(), "fileUuid",
- "fileVersionId");
exportContentService.exportToolContent(toolContentId, videoRecorder, videoRecorderToolContentHandler,
rootPath);
} catch (ExportToolContentException e) {
@@ -322,9 +288,9 @@
public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion,
String toVersion) throws ToolException {
try {
- exportContentService.registerFileClassForImport(VideoRecorderAttachment.class.getName(), "fileUuid",
- "fileVersionId", "fileName", "fileType", null, null);
-
+ // register version filter class
+ exportContentService.registerImportVersionFilterClass(VideoRecorderImportContentVersionFilter.class);
+
Object toolPOJO = exportContentService.importToolContent(toolContentPath, videoRecorderToolContentHandler,
fromVersion, toVersion);
if (!(toolPOJO instanceof VideoRecorder)) {
@@ -423,7 +389,7 @@
VideoRecorder defaultContent = getDefaultContent();
// create new videoRecorder using the newContentID
VideoRecorder newContent = new VideoRecorder();
- newContent = VideoRecorder.newInstance(defaultContent, newContentID, videoRecorderToolContentHandler);
+ newContent = VideoRecorder.newInstance(defaultContent, newContentID);
videoRecorderDAO.saveOrUpdate(newContent);
return newContent;
}
@@ -521,32 +487,6 @@
}
}
- public VideoRecorderAttachment uploadFileToContent(Long toolContentId, FormFile file, String type) {
- if (file == null || StringUtils.isEmpty(file.getFileName())) {
- throw new VideoRecorderException("Could not find upload file: " + file);
- }
-
- NodeKey nodeKey = processFile(file, type);
-
- VideoRecorderAttachment attachment = new VideoRecorderAttachment(nodeKey.getVersion(), type,
- file.getFileName(), nodeKey.getUuid(), new Date());
- return attachment;
- }
-
- public void deleteFromRepository(Long uuid, Long versionID) throws VideoRecorderException {
- ITicket ticket = getRepositoryLoginTicket();
- try {
- repositoryService.deleteVersion(ticket, uuid, versionID);
- } catch (Exception e) {
- throw new VideoRecorderException("Exception occured while deleting files from" + " the repository "
- + e.getMessage());
- }
- }
-
- public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type) {
- videoRecorderDAO.deleteInstructionFile(contentID, uuid, versionID, type);
- }
-
public void saveOrUpdateVideoRecorder(VideoRecorder videoRecorder) {
videoRecorderDAO.saveOrUpdate(videoRecorder);
}
@@ -577,63 +517,6 @@
return videoRecorderUser;
}
- public IAuditService getAuditService() {
- return auditService;
- }
-
- public void setAuditService(IAuditService auditService) {
- this.auditService = auditService;
- }
-
- private NodeKey processFile(FormFile file, String type) {
- NodeKey node = null;
- if (file != null && !StringUtils.isEmpty(file.getFileName())) {
- String fileName = file.getFileName();
- try {
- node = getVideoRecorderToolContentHandler().uploadFile(file.getInputStream(), fileName,
- file.getContentType(), type);
- } catch (InvalidParameterException e) {
- throw new VideoRecorderException("InvalidParameterException occured while trying to upload File"
- + e.getMessage());
- } catch (FileNotFoundException e) {
- throw new VideoRecorderException("FileNotFoundException occured while trying to upload File"
- + e.getMessage());
- } catch (RepositoryCheckedException e) {
- throw new VideoRecorderException("RepositoryCheckedException occured while trying to upload File"
- + e.getMessage());
- } catch (IOException e) {
- throw new VideoRecorderException("IOException occured while trying to upload File" + e.getMessage());
- }
- }
- return node;
- }
-
- /**
- * This method verifies the credentials of the SubmitFiles Tool and gives it the Ticket
to login and
- * access the Content Repository.
- *
- * A valid ticket is needed in order to access the content from the repository. This method would be called evertime
- * the tool needs to upload/download files from the content repository.
- *
- * @return ITicket The ticket for repostory access
- * @throws SubmitFilesException
- */
- private ITicket getRepositoryLoginTicket() throws VideoRecorderException {
- ICredentials credentials = new SimpleCredentials(VideoRecorderToolContentHandler.repositoryUser,
- VideoRecorderToolContentHandler.repositoryId);
- try {
- ITicket ticket = repositoryService.login(credentials,
- VideoRecorderToolContentHandler.repositoryWorkspaceName);
- return ticket;
- } catch (AccessDeniedException ae) {
- throw new VideoRecorderException("Access Denied to repository." + ae.getMessage());
- } catch (WorkspaceNotFoundException we) {
- throw new VideoRecorderException("Workspace not found." + we.getMessage());
- } catch (LoginException e) {
- throw new VideoRecorderException("Login failed." + e.getMessage());
- }
- }
-
/* ===============Methods implemented from ToolContentImport102Manager =============== */
/**
@@ -649,15 +532,9 @@
videoRecorder.setInstructions(WebUtil.convertNewlines((String) importValues
.get(ToolContentImport102Manager.CONTENT_BODY)));
videoRecorder.setLockOnFinished(Boolean.TRUE);
- videoRecorder.setOfflineInstructions(null);
- videoRecorder.setOnlineInstructions(null);
- videoRecorder.setRunOffline(Boolean.FALSE);
videoRecorder.setTitle((String) importValues.get(ToolContentImport102Manager.CONTENT_TITLE));
videoRecorder.setToolContentId(toolContentId);
videoRecorder.setUpdateDate(now);
- // leave as empty, no need to set them to anything.
- // setVideoRecorderAttachments(Set videoRecorderAttachments);
- // setVideoRecorderSessions(Set videoRecorderSessions);
videoRecorderDAO.saveOrUpdate(videoRecorder);
}
@@ -679,14 +556,6 @@
// =========================================================================================
/* ********** Used by Spring to "inject" the linked objects ************* */
- public IVideoRecorderAttachmentDAO getVideoRecorderAttachmentDAO() {
- return videoRecorderAttachmentDAO;
- }
-
- public void setVideoRecorderAttachmentDAO(IVideoRecorderAttachmentDAO attachmentDAO) {
- videoRecorderAttachmentDAO = attachmentDAO;
- }
-
public IVideoRecorderDAO getVideoRecorderDAO() {
return videoRecorderDAO;
}
@@ -791,14 +660,6 @@
this.videoRecorderOutputFactory = videoRecorderOutputFactory;
}
- public IRepositoryService getRepositoryService() {
- return repositoryService;
- }
-
- public void setRepositoryService(IRepositoryService repositoryService) {
- this.repositoryService = repositoryService;
- }
-
public void releaseConditionsFromCache(VideoRecorder videoRecorder) {
if (videoRecorder.getConditions() != null) {
for (VideoRecorderCondition condition : videoRecorder.getConditions()) {
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/util/VideoRecorderConstants.java
===================================================================
diff -u -r61df3f3f473a3619f93c63ceb879ae36438020e8 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/util/VideoRecorderConstants.java (.../VideoRecorderConstants.java) (revision 61df3f3f473a3619f93c63ceb879ae36438020e8)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/util/VideoRecorderConstants.java (.../VideoRecorderConstants.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -33,8 +33,6 @@
public static final Integer SESSION_COMPLETED = new Integer(2);
public static final String AUTHORING_DEFAULT_TAB = "1";
- public static final String ATTACHMENT_LIST = "attachmentList";
- public static final String DELETED_ATTACHMENT_LIST = "deletedAttachmentList";
public static final String AUTH_SESSION_ID_COUNTER = "authoringSessionIdCounter";
public static final String AUTH_SESSION_ID = "authoringSessionId";
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/videoRecorderApplicationContext.xml
===================================================================
diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/videoRecorderApplicationContext.xml (.../videoRecorderApplicationContext.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/videoRecorderApplicationContext.xml (.../videoRecorderApplicationContext.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -26,7 +26,6 @@
-
@@ -35,13 +34,11 @@
-
-
-
+
@@ -55,10 +52,7 @@
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
- PROPAGATION_REQUIRED
- PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
-
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
@@ -83,10 +77,6 @@
-
-
-
-
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/AuthoringAction.java
===================================================================
diff -u -r0bbad8932a51efb88ac79f78bf2c7d7396554fe9 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 0bbad8932a51efb88ac79f78bf2c7d7396554fe9)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -52,14 +52,9 @@
import org.lamsfoundation.lams.tool.ToolSessionManager;
import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderDTO;
import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderRecordingDTO;
-import org.lamsfoundation.lams.tool.videoRecorder.dto.VideoRecorderSessionDTO;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderAttachment;
import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderCondition;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderSession;
-import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderUser;
import org.lamsfoundation.lams.tool.videoRecorder.service.IVideoRecorderService;
-import org.lamsfoundation.lams.tool.videoRecorder.service.VideoRecorderService;
import org.lamsfoundation.lams.tool.videoRecorder.service.VideoRecorderServiceProxy;
import org.lamsfoundation.lams.tool.videoRecorder.util.VideoRecorderConstants;
import org.lamsfoundation.lams.tool.videoRecorder.web.forms.AuthoringForm;
@@ -90,11 +85,6 @@
private static final String KEY_TOOL_CONTENT_ID = "toolContentID";
private static final String KEY_CONTENT_FOLDER_ID = "contentFolderID";
private static final String KEY_MODE = "mode";
- private static final String KEY_ONLINE_FILES = "onlineFiles";
- private static final String KEY_OFFLINE_FILES = "offlineFiles";
- private static final String KEY_UNSAVED_ONLINE_FILES = "unsavedOnlineFiles";
- private static final String KEY_UNSAVED_OFFLINE_FILES = "unsavedOfflineFiles";
- private static final String KEY_DELETED_FILES = "deletedFiles";
/**
* Default method when no dispatch parameter is specified. It is expected that the parameter
@@ -201,24 +191,6 @@
ToolAccessMode mode = (ToolAccessMode) map.get(AuthoringAction.KEY_MODE);
updateVideoRecorder(videoRecorder, authForm, mode);
- // remove attachments marked for deletion.
- Set attachments = videoRecorder.getVideoRecorderAttachments();
- if (attachments == null) {
- attachments = new HashSet();
- }
-
- for (VideoRecorderAttachment att : getAttList(AuthoringAction.KEY_DELETED_FILES, map)) {
- // remove from db, leave in repository
- attachments.remove(att);
- }
-
- // add unsaved attachments
- attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map));
- attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map));
-
- // set attachments in case it didn't exist
- videoRecorder.setVideoRecorderAttachments(attachments);
-
videoRecorderService.releaseConditionsFromCache(videoRecorder);
Set conditions = videoRecorder.getConditions();
@@ -239,7 +211,7 @@
}
}
- // set attachments in case it didn't exist
+ // set conditions in case it didn't exist
videoRecorder.setConditions(conditionSet);
// set the update date
@@ -263,156 +235,8 @@
return mapping.findForward("success");
}
- public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return uploadFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request);
- }
-
- public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return uploadFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request);
- }
-
- public ActionForward deleteOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return deleteFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request);
- }
-
- public ActionForward deleteOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return deleteFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request);
- }
-
- public ActionForward removeUnsavedOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return removeUnsaved(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request);
- }
-
- public ActionForward removeUnsavedOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return removeUnsaved(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request);
- }
-
/* ========== Private Methods ********** */
- private ActionForward uploadFile(ActionMapping mapping, AuthoringForm authForm, String type,
- HttpServletRequest request) {
- SessionMap map = getSessionMap(request, authForm);
-
- FormFile file;
- List unsavedFiles;
- List savedFiles;
- if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) {
- file = authForm.getOfflineFile();
- unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map);
-
- savedFiles = getAttList(AuthoringAction.KEY_OFFLINE_FILES, map);
- } else {
- file = authForm.getOnlineFile();
- unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map);
-
- savedFiles = getAttList(AuthoringAction.KEY_ONLINE_FILES, map);
- }
-
- // validate file max size
- ActionMessages errors = new ActionMessages();
- FileValidatorUtil.validateFileSize(file, true, errors);
- if (!errors.isEmpty()) {
- request.setAttribute(VideoRecorderConstants.ATTR_SESSION_MAP, map);
- this.saveErrors(request, errors);
- return mapping.findForward("success");
- }
-
- if (file.getFileName().length() != 0) {
-
- // upload file to repository
- VideoRecorderAttachment newAtt = videoRecorderService.uploadFileToContent((Long) map
- .get(AuthoringAction.KEY_TOOL_CONTENT_ID), file, type);
-
- // Add attachment to unsavedFiles
- // check to see if file with same name exists
- VideoRecorderAttachment currAtt;
- Iterator iter = savedFiles.iterator();
- while (iter.hasNext()) {
- currAtt = (VideoRecorderAttachment) iter.next();
- if (StringUtils.equals(currAtt.getFileName(), newAtt.getFileName())
- && StringUtils.equals(currAtt.getFileType(), newAtt.getFileType())) {
- // move from this this list to deleted list.
- getAttList(AuthoringAction.KEY_DELETED_FILES, map).add(currAtt);
- iter.remove();
- break;
- }
- }
- unsavedFiles.add(newAtt);
-
- request.setAttribute(VideoRecorderConstants.ATTR_SESSION_MAP, map);
- request.setAttribute("unsavedChanges", new Boolean(true));
- }
- return mapping.findForward("success");
- }
-
- private ActionForward deleteFile(ActionMapping mapping, AuthoringForm authForm, String type,
- HttpServletRequest request) {
- SessionMap map = getSessionMap(request, authForm);
-
- List fileList;
- if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) {
- fileList = getAttList(AuthoringAction.KEY_OFFLINE_FILES, map);
- } else {
- fileList = getAttList(AuthoringAction.KEY_ONLINE_FILES, map);
- }
-
- Iterator iter = fileList.iterator();
-
- while (iter.hasNext()) {
- VideoRecorderAttachment att = (VideoRecorderAttachment) iter.next();
-
- if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) {
- // move to delete file list, deleted at next updateContent
- getAttList(AuthoringAction.KEY_DELETED_FILES, map).add(att);
-
- // remove from this list
- iter.remove();
- break;
- }
- }
-
- request.setAttribute(VideoRecorderConstants.ATTR_SESSION_MAP, map);
- request.setAttribute("unsavedChanges", new Boolean(true));
-
- return mapping.findForward("success");
- }
-
- private ActionForward removeUnsaved(ActionMapping mapping, AuthoringForm authForm, String type,
- HttpServletRequest request) {
- SessionMap map = getSessionMap(request, authForm);
-
- List unsavedFiles;
-
- if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) {
- unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map);
- } else {
- unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map);
- }
-
- Iterator iter = unsavedFiles.iterator();
- while (iter.hasNext()) {
- VideoRecorderAttachment att = (VideoRecorderAttachment) iter.next();
-
- if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) {
- // delete from repository and list
- videoRecorderService.deleteFromRepository(att.getFileUuid(), att.getFileVersionId());
- iter.remove();
- break;
- }
- }
-
- request.setAttribute(VideoRecorderConstants.ATTR_SESSION_MAP, map);
- request.setAttribute("unsavedChanges", new Boolean(true));
-
- return mapping.findForward("success");
- }
-
/**
* Updates VideoRecorder content using AuthoringForm inputs.
*
@@ -424,8 +248,6 @@
videoRecorder.setTitle(authForm.getTitle());
videoRecorder.setInstructions(authForm.getInstructions());
//if (mode.isAuthor()) { // Teacher cannot modify following
- videoRecorder.setOfflineInstructions(authForm.getOnlineInstruction());
- videoRecorder.setOnlineInstructions(authForm.getOfflineInstruction());
videoRecorder.setLockOnFinished(authForm.isLockOnFinished());
videoRecorder.setAllowUseVoice(authForm.isAllowUseVoice());
videoRecorder.setAllowUseCamera(authForm.isAllowUseCamera());
@@ -447,8 +269,6 @@
private void updateAuthForm(AuthoringForm authForm, VideoRecorder videoRecorder) {
authForm.setTitle(videoRecorder.getTitle());
authForm.setInstructions(videoRecorder.getInstructions());
- authForm.setOnlineInstruction(videoRecorder.getOnlineInstructions());
- authForm.setOfflineInstruction(videoRecorder.getOfflineInstructions());
authForm.setLockOnFinished(videoRecorder.isLockOnFinished());
authForm.setAllowUseVoice(videoRecorder.isAllowUseVoice());
authForm.setAllowUseCamera(videoRecorder.isAllowUseCamera());
@@ -473,25 +293,8 @@
map.put(AuthoringAction.KEY_MODE, mode);
map.put(AuthoringAction.KEY_CONTENT_FOLDER_ID, contentFolderID);
map.put(AuthoringAction.KEY_TOOL_CONTENT_ID, toolContentID);
- map.put(AuthoringAction.KEY_ONLINE_FILES, new LinkedList());
- map.put(AuthoringAction.KEY_OFFLINE_FILES, new LinkedList());
- map.put(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, new LinkedList());
- map.put(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, new LinkedList());
- map.put(AuthoringAction.KEY_DELETED_FILES, new LinkedList());
map.put(VideoRecorderConstants.ATTR_DELETED_CONDITION_LIST, new ArrayList());
- Iterator iter = videoRecorder.getVideoRecorderAttachments().iterator();
- while (iter.hasNext()) {
- VideoRecorderAttachment attachment = (VideoRecorderAttachment) iter.next();
- String type = attachment.getFileType();
- if (type.equals(IToolContentHandler.TYPE_OFFLINE)) {
- getAttList(AuthoringAction.KEY_OFFLINE_FILES, map).add(attachment);
- }
- if (type.equals(IToolContentHandler.TYPE_ONLINE)) {
- getAttList(AuthoringAction.KEY_ONLINE_FILES, map).add(attachment);
- }
- }
-
SortedSet set = new TreeSet(new TextSearchConditionComparator());
if (videoRecorder.getConditions() != null) {
@@ -519,18 +322,6 @@
}
/**
- * Retrieves a List of attachments from the map using the key.
- *
- * @param key
- * @param map
- * @return
- */
- private List getAttList(String key, SessionMap map) {
- List list = (List) map.get(key);
- return list;
- }
-
- /**
* Retrieve the SessionMap from the HttpSession.
*
* @param request
@@ -540,20 +331,4 @@
private SessionMap getSessionMap(HttpServletRequest request, AuthoringForm authForm) {
return (SessionMap) request.getSession().getAttribute(authForm.getSessionMapID());
}
-
- /**
- * Lists deleted VideoRecorder conditions, which could be persisted or non-persisted items.
- *
- * @param request
- * @return
- */
- private List getDeletedVideoRecorderConditionList(SessionMap sessionMap) {
- List list = (List) sessionMap.get(VideoRecorderConstants.ATTR_DELETED_CONDITION_LIST);
- if (list == null) {
- list = new ArrayList();
- sessionMap.put(VideoRecorderConstants.ATTR_DELETED_CONDITION_LIST, list);
- }
- return list;
-
- }
}
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/LearningAction.java
===================================================================
diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/LearningAction.java (.../LearningAction.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/LearningAction.java (.../LearningAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -72,7 +72,6 @@
* @struts.action path="/learning" parameter="dispatch" scope="request"
* name="learningForm"
* @struts.action-forward name="videoRecorder" path="tiles:/learning/main"
- * @struts.action-forward name="runOffline" path="tiles:/learning/runOffline"
* @struts.action-forward name="defineLater" path="tiles:/learning/defineLater"
*/
public class LearningAction extends LamsDispatchAction {
@@ -169,11 +168,6 @@
LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionID, request, getServlet()
.getServletContext());
-
- // check runOffline
- if (videoRecorder.isRunOffline()) {
- return mapping.findForward("runOffline");
- }
// get any existing videoRecorder entry
Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/servlets/ExportServlet.java
===================================================================
diff -u -rb33e717f9a734d318eefab07a17234f07c770c92 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision b33e717f9a734d318eefab07a17234f07c770c92)
+++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -113,29 +113,6 @@
return FILENAME;
}
-
- protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
- if (toolContentID == null && toolSessionID == null) {
- logger.error("Tool content Id or and session Id are null. Unable to activity title");
- } else {
- if (videoRecorderService == null) {
- videoRecorderService = VideoRecorderServiceProxy.getVideoRecorderService(getServletContext());
- }
-
- VideoRecorder content = null;
- if ( toolContentID != null ) {
- content = videoRecorderService.getVideoRecorderByContentId(toolContentID);
- } else {
- VideoRecorderSession session=videoRecorderService.getSessionBySessionId(toolSessionID);
- if ( session != null )
- content = session.getVideoRecorder();
- }
- if ( content != null ) {
- activityTitle = content.getTitle();
- }
- }
- return super.doOfflineExport(request, response, directoryName, cookies);
- }
private void doLearnerExport(HttpServletRequest request,
HttpServletResponse response, String directoryName, Cookie[] cookies)
Index: lams_tool_videorecorder/web/WEB-INF/tiles-defs.xml
===================================================================
diff -u -rd56929f06ad90a63082d514e6521adc175f3de27 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision d56929f06ad90a63082d514e6521adc175f3de27)
+++ lams_tool_videorecorder/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -86,10 +86,6 @@
-
-
-
-
Index: lams_tool_videorecorder/web/includes/javascript/authoring.js
===================================================================
diff -u -r3d081de4a45da632ee6029251318fac795d41813 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/web/includes/javascript/authoring.js (.../authoring.js) (revision 3d081de4a45da632ee6029251318fac795d41813)
+++ lams_tool_videorecorder/web/includes/javascript/authoring.js (.../authoring.js) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -17,8 +17,3 @@
document.authoringForm.dispatch.value = method;
document.authoringForm.submit();
}
-function deleteAttachment(dispatch, uuid) {
- document.authoringForm.dispatch.value = dispatch;
- document.authoringForm.deleteFileUuid.value = uuid;
- document.authoringForm.submit();
-}
Index: lams_tool_videorecorder/web/pages/authoring/authoring.jsp
===================================================================
diff -u -rf0bef7d11b4f82936c417e6e55c25fe9bfdb9a82 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_videorecorder/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision f0bef7d11b4f82936c417e6e55c25fe9bfdb9a82)
+++ lams_tool_videorecorder/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -1,14 +1,10 @@
<%@ include file="/common/taglibs.jsp"%>
-<%@ page
- import="org.lamsfoundation.lams.tool.videoRecorder.util.VideoRecorderConstants"%>
+<%@ page import="org.lamsfoundation.lams.tool.videoRecorder.util.VideoRecorderConstants"%>
-
+
-
+
@@ -23,7 +19,6 @@
-
@@ -36,9 +31,6 @@
-
-
-
@@ -55,8 +47,6 @@
-
Index: lams_tool_wiki/conf/middlegen/lams_tool_lawiki11-prefs.properties
===================================================================
diff -u -r1082bdcc357c105126a5641cecc68acfa645b66b -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/conf/middlegen/lams_tool_lawiki11-prefs.properties (.../lams_tool_lawiki11-prefs.properties) (revision 1082bdcc357c105126a5641cecc68acfa645b66b)
+++ lams_tool_wiki/conf/middlegen/lams_tool_lawiki11-prefs.properties (.../lams_tool_lawiki11-prefs.properties) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -44,8 +44,6 @@
hibernate.tables.tl_lawiki10_wiki.columns.offline_instructions.java-type=java.lang.String
hibernate.tables.tl_lawiki10_wiki.columns.online_instructions.java-name=onlineInstructions
hibernate.tables.tl_lawiki10_wiki.columns.online_instructions.java-type=java.lang.String
-hibernate.tables.tl_lawiki10_wiki.columns.run_offline.java-name=runOffline
-hibernate.tables.tl_lawiki10_wiki.columns.run_offline.java-type=java.lang.Boolean
hibernate.tables.tl_lawiki10_wiki.columns.title.inctostring=true
hibernate.tables.tl_lawiki10_wiki.columns.title.java-name=title
hibernate.tables.tl_lawiki10_wiki.columns.title.java-type=java.lang.String
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/IWikiAttachmentDAO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/IWikiDAO.java
===================================================================
diff -u -r1082bdcc357c105126a5641cecc68acfa645b66b -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/IWikiDAO.java (.../IWikiDAO.java) (revision 1082bdcc357c105126a5641cecc68acfa645b66b)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/IWikiDAO.java (.../IWikiDAO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -37,6 +37,4 @@
void saveOrUpdate(Wiki toContent);
- void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type);
-
}
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/hibernate/WikiAttachmentDAO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/hibernate/WikiDAO.java
===================================================================
diff -u -r2f21856ec2ab85b47c93cfcc3fa2c8769be65077 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/hibernate/WikiDAO.java (.../WikiDAO.java) (revision 2f21856ec2ab85b47c93cfcc3fa2c8769be65077)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dao/hibernate/WikiDAO.java (.../WikiDAO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -33,7 +33,6 @@
import org.lamsfoundation.lams.dao.hibernate.BaseDAO;
import org.lamsfoundation.lams.tool.wiki.dao.IWikiDAO;
import org.lamsfoundation.lams.tool.wiki.model.Wiki;
-import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment;
import org.lamsfoundation.lams.tool.wiki.model.WikiPage;
import org.springframework.orm.hibernate3.HibernateTemplate;
@@ -44,10 +43,7 @@
private static final String FIND_FORUM_BY_CONTENTID = "from Wiki wiki where wiki.toolContentId=?";
- private static final String FIND_INSTRUCTION_FILE = "from " + WikiAttachment.class.getName()
- + " as i where tool_content_id=? and i.file_uuid=? and i.file_version_id=? and i.file_type=?";
-
- public Wiki getByContentId(Long toolContentId) {
+ public Wiki getByContentId(Long toolContentId) {
List list = getHibernateTemplate().find(FIND_FORUM_BY_CONTENTID, toolContentId);
if (list != null && list.size() > 0) {
Wiki wiki = (Wiki) list.get(0);
@@ -66,21 +62,6 @@
//this.getHibernateTemplate().flush();
}
- public void deleteInstructionFile(Long toolContentId, Long uuid, Long versionId, String type) {
- HibernateTemplate templ = this.getHibernateTemplate();
- if (toolContentId != null && uuid != null && versionId != null) {
- List list = getSession().createQuery(FIND_INSTRUCTION_FILE).setLong(0, toolContentId.longValue()).setLong(
- 1, uuid.longValue()).setLong(2, versionId.longValue()).setString(3, type).list();
- if (list != null && list.size() > 0) {
- WikiAttachment file = (WikiAttachment) list.get(0);
- this.getSession().setFlushMode(FlushMode.AUTO);
- templ.delete(file);
- templ.flush();
- }
- }
-
- }
-
/**
* Although we are dealing with a set, still somehow duplicates are coming
* through. This method removes them.
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20140102.sql
===================================================================
diff -u
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20140102.sql (revision 0)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dbupdates/patch20140102.sql (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -0,0 +1,19 @@
+-- Turn off autocommit, so nothing is committed if there is an error
+SET AUTOCOMMIT = 0;
+SET FOREIGN_KEY_CHECKS=0;
+----------------------Put all sql statements below here-------------------------
+
+-- LDEV-3147 Simplify tools: get rid of instructions tab, define in monitor and offline activity options
+ALTER TABLE tl_lawiki10_wiki DROP COLUMN online_instructions;
+ALTER TABLE tl_lawiki10_wiki DROP COLUMN offline_instructions;
+ALTER TABLE tl_lawiki10_wiki DROP COLUMN run_offline;
+DROP TABLE IF EXISTS tl_lawiki10_attachment;
+
+UPDATE lams_tool SET tool_version='20140102' WHERE tool_signature='lawiki10';
+
+----------------------Put all sql statements above here-------------------------
+
+-- If there were no errors, commit and restore autocommit to on
+COMMIT;
+SET AUTOCOMMIT = 1;
+SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiAttachmentDTO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiDTO.java
===================================================================
diff -u -rf08d91b95c1892c71594dd4f7fd6e9b4509cccc7 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiDTO.java (.../WikiDTO.java) (revision f08d91b95c1892c71594dd4f7fd6e9b4509cccc7)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/dto/WikiDTO.java (.../WikiDTO.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -32,7 +32,6 @@
import org.apache.log4j.Logger;
import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
import org.lamsfoundation.lams.tool.wiki.model.Wiki;
-import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment;
import org.lamsfoundation.lams.tool.wiki.model.WikiSession;
public class WikiDTO {
@@ -45,10 +44,6 @@
public String instructions;
- public String onlineInstructions;
-
- public String offlineInstructions;
-
public boolean defineLater;
public boolean contentInUse;
@@ -71,10 +66,6 @@
private Integer maximumEdits;
- public Set onlineInstructionsFiles;
-
- public Set offlineInstructionsFiles;
-
public Set sessionDTOs = new TreeSet();
public Long currentTab;
@@ -87,8 +78,6 @@
toolContentId = wiki.getToolContentId();
title = wiki.getTitle();
instructions = wiki.getInstructions();
- onlineInstructions = wiki.getOnlineInstructions();
- offlineInstructions = wiki.getOfflineInstructions();
contentInUse = wiki.isContentInUse();
lockOnFinish = wiki.isLockOnFinished();
allowLearnerCreatePages = wiki.isAllowLearnerCreatePages();
@@ -100,23 +89,6 @@
minimumEdits = wiki.getMinimumEdits();
maximumEdits = wiki.getMaximumEdits();
- onlineInstructionsFiles = new TreeSet();
- offlineInstructionsFiles = new TreeSet();
-
- for (Iterator i = wiki.getWikiAttachments().iterator(); i.hasNext();) {
- WikiAttachment att = (WikiAttachment) i.next();
- if (att.getFileType().equals(IToolContentHandler.TYPE_OFFLINE)) {
- WikiAttachmentDTO attDTO = new WikiAttachmentDTO(att);
- offlineInstructionsFiles.add(attDTO);
- } else if (att.getFileType().equals(IToolContentHandler.TYPE_ONLINE)) {
- WikiAttachmentDTO attDTO = new WikiAttachmentDTO(att);
- onlineInstructionsFiles.add(attDTO);
- } else {
- // something is wrong. Ignore file, log error
- logger.error("File with uid " + att.getFileUuid() + " contains invalid fileType: " + att.getFileType());
- }
- }
-
for (Iterator iter = wiki.getWikiSessions().iterator(); iter.hasNext();) {
WikiSession session = (WikiSession) iter.next();
WikiSessionDTO sessionDTO = new WikiSessionDTO(session);
@@ -142,38 +114,6 @@
this.instructions = instructions;
}
- public String getOfflineInstructions() {
- return offlineInstructions;
- }
-
- public void setOfflineInstructions(String offlineInstructions) {
- this.offlineInstructions = offlineInstructions;
- }
-
- public Set getOfflineInstructionsFiles() {
- return offlineInstructionsFiles;
- }
-
- public void setOfflineInstructionsFiles(Set offlineInstructionsFiles) {
- this.offlineInstructionsFiles = offlineInstructionsFiles;
- }
-
- public String getOnlineInstructions() {
- return onlineInstructions;
- }
-
- public void setOnlineInstructions(String onlineInstructions) {
- this.onlineInstructions = onlineInstructions;
- }
-
- public Set getOnlineInstructionsFiles() {
- return onlineInstructionsFiles;
- }
-
- public void setOnlineInstructionsFiles(Set onlineInstructionsFiles) {
- this.onlineInstructionsFiles = onlineInstructionsFiles;
- }
-
public String getTitle() {
return title;
}
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/Wiki.java
===================================================================
diff -u -rf08d91b95c1892c71594dd4f7fd6e9b4509cccc7 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/Wiki.java (.../Wiki.java) (revision f08d91b95c1892c71594dd4f7fd6e9b4509cccc7)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/Wiki.java (.../Wiki.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -61,8 +61,6 @@
private String instructions;
- private boolean runOffline;
-
// BEGIN ADVANCED OPTIONS------------------
// Lock the wiki after learner is finished
@@ -94,55 +92,18 @@
// END ADVANCED OPTIONS------------------
- private String onlineInstructions;
-
- private String offlineInstructions;
-
private boolean contentInUse;
private boolean defineLater;
private Long toolContentId;
- private Set wikiAttachments;
-
private Set wikiSessions;
private Set wikiPages;
private WikiPage mainPage;
- // *********** NON Persist fields
- private IToolContentHandler toolContentHandler;
-
- // Constructors
-
- /** default constructor */
- public Wiki() {
- }
-
- /** full constructor */
- public Wiki(Date createDate, Date updateDate, Long createBy, String title, String instructions, boolean runOffline,
- boolean lockOnFinished, boolean filteringEnabled, String filterKeywords, String onlineInstructions,
- String offlineInstructions, boolean contentInUse, boolean defineLater, Long toolContentId,
- Set wikiAttachments, Set wikiSessions, Set wikiPages) {
- this.createDate = createDate;
- this.updateDate = updateDate;
- this.createBy = createBy;
- this.title = title;
- this.instructions = instructions;
- this.runOffline = runOffline;
- this.lockOnFinished = lockOnFinished;
- this.onlineInstructions = onlineInstructions;
- this.offlineInstructions = offlineInstructions;
- this.contentInUse = contentInUse;
- this.defineLater = defineLater;
- this.toolContentId = toolContentId;
- this.wikiAttachments = wikiAttachments;
- this.wikiSessions = wikiSessions;
- this.wikiPages = wikiPages;
- }
-
// Property accessors
/**
* @hibernate.id generator-class="native" type="java.lang.Long" column="uid"
@@ -223,19 +184,6 @@
}
/**
- * @hibernate.property column="run_offline" length="1"
- *
- */
-
- public boolean isRunOffline() {
- return this.runOffline;
- }
-
- public void setRunOffline(boolean runOffline) {
- this.runOffline = runOffline;
- }
-
- /**
* @hibernate.property column="lock_on_finished" length="1"
*
*/
@@ -341,32 +289,6 @@
}
/**
- * @hibernate.property column="online_instructions" length="65535"
- *
- */
-
- public String getOnlineInstructions() {
- return this.onlineInstructions;
- }
-
- public void setOnlineInstructions(String onlineInstructions) {
- this.onlineInstructions = onlineInstructions;
- }
-
- /**
- * @hibernate.property column="offline_instructions" length="65535"
- *
- */
-
- public String getOfflineInstructions() {
- return this.offlineInstructions;
- }
-
- public void setOfflineInstructions(String offlineInstructions) {
- this.offlineInstructions = offlineInstructions;
- }
-
- /**
* @hibernate.property column="content_in_use" length="1"
*
*/
@@ -406,21 +328,6 @@
}
/**
- * @hibernate.set lazy="true" inverse="false" cascade="all-delete-orphan"
- * @hibernate.collection-key column="wiki_uid"
- * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.wiki.model.WikiAttachment"
- *
- */
-
- public Set getWikiAttachments() {
- return this.wikiAttachments;
- }
-
- public void setWikiAttachments(Set wikiAttachments) {
- this.wikiAttachments = wikiAttachments;
- }
-
- /**
* @hibernate.set lazy="true" inverse="true" cascade="none"
* @hibernate.collection-key column="wiki_uid"
* @hibernate.collection-one-to-many class="org.lamsfoundation.lams.tool.wiki.model.WikiSession"
@@ -500,9 +407,8 @@
return result;
}
- public static Wiki newInstance(Wiki fromContent, Long toContentId, IToolContentHandler wikiToolContentHandler) {
+ public static Wiki newInstance(Wiki fromContent, Long toContentId) {
Wiki toContent = new Wiki();
- fromContent.toolContentHandler = wikiToolContentHandler;
toContent = (Wiki) fromContent.clone();
toContent.setToolContentId(toContentId);
toContent.setCreateDate(new Date());
@@ -516,18 +422,6 @@
wiki = (Wiki) super.clone();
wiki.setUid(null);
- if (wikiAttachments != null) {
- // create a copy of the attachments
- Iterator iter = wikiAttachments.iterator();
- Set set = new HashSet();
- while (iter.hasNext()) {
- WikiAttachment originalFile = (WikiAttachment) iter.next();
- WikiAttachment newFile = (WikiAttachment) originalFile.clone();
- set.add(newFile);
- }
- wiki.wikiAttachments = set;
- }
-
if (wikiPages != null) {
Set newPages = new HashSet();
for (WikiPage page : wikiPages) {
@@ -552,12 +446,4 @@
}
return wiki;
}
-
- public IToolContentHandler getToolContentHandler() {
- return toolContentHandler;
- }
-
- public void setToolContentHandler(IToolContentHandler toolContentHandler) {
- this.toolContentHandler = toolContentHandler;
- }
}
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/model/WikiAttachment.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/IWikiService.java
===================================================================
diff -u -rb19488eb4b80f01e7dcc599a71a6f8bff477c68c -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/IWikiService.java (.../IWikiService.java) (revision b19488eb4b80f01e7dcc599a71a6f8bff477c68c)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/IWikiService.java (.../IWikiService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -30,7 +30,6 @@
import org.lamsfoundation.lams.events.IEventNotificationService;
import org.lamsfoundation.lams.notebook.model.NotebookEntry;
import org.lamsfoundation.lams.tool.wiki.model.Wiki;
-import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment;
import org.lamsfoundation.lams.tool.wiki.model.WikiPage;
import org.lamsfoundation.lams.tool.wiki.model.WikiPageContent;
import org.lamsfoundation.lams.tool.wiki.model.WikiSession;
@@ -76,34 +75,6 @@
public Wiki getWikiByContentId(Long toolContentID);
/**
- * Uploads a file to a wiki
- *
- * @param toolContentId
- * @param file
- * @param type
- * @return
- */
- public WikiAttachment uploadFileToContent(Long toolContentId, FormFile file, String type);
-
- /**
- * Deletes a file from the repository
- *
- * @param uuid
- * @param versionID
- */
- public void deleteFromRepository(Long uuid, Long versionID) throws WikiException;
-
- /**
- * Deletes an instruction file from the repository
- *
- * @param contentID
- * @param uuid
- * @param versionID
- * @param type
- */
- public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type);
-
- /**
* Saves or updates a wiki instance
*
* @param wiki
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiContentVersionFilter.java
===================================================================
diff -u
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiContentVersionFilter.java (revision 0)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiContentVersionFilter.java (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -0,0 +1,43 @@
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.tool.wiki.service;
+
+import org.lamsfoundation.lams.learningdesign.service.ToolContentVersionFilter;
+import org.lamsfoundation.lams.tool.wiki.model.Wiki;
+
+/**
+ * Import filter class for different version of Wiki content.
+ */
+public class WikiContentVersionFilter extends ToolContentVersionFilter {
+
+ /**
+ * Import 20130716 version content to 20140102 version tool server.
+ */
+ public void up20130716To20140102() {
+ this.removeField(Wiki.class, "runOffline");
+ this.removeField(Wiki.class, "onlineInstructions");
+ this.removeField(Wiki.class, "offlineInstructions");
+ this.removeField(Wiki.class, "wikiAttachments");
+ }
+}
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java
===================================================================
diff -u -r33da76d05725a84e191a5f6dca50b394cca3c1ee -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java (.../WikiService.java) (revision 33da76d05725a84e191a5f6dca50b394cca3c1ee)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java (.../WikiService.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -24,8 +24,6 @@
package org.lamsfoundation.lams.tool.wiki.service;
-import java.io.FileNotFoundException;
-import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
@@ -35,20 +33,8 @@
import java.util.Set;
import java.util.SortedMap;
-import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
-import org.apache.struts.upload.FormFile;
-import org.lamsfoundation.lams.contentrepository.AccessDeniedException;
-import org.lamsfoundation.lams.contentrepository.ICredentials;
-import org.lamsfoundation.lams.contentrepository.ITicket;
-import org.lamsfoundation.lams.contentrepository.InvalidParameterException;
-import org.lamsfoundation.lams.contentrepository.LoginException;
-import org.lamsfoundation.lams.contentrepository.NodeKey;
-import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException;
-import org.lamsfoundation.lams.contentrepository.WorkspaceNotFoundException;
import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
-import org.lamsfoundation.lams.contentrepository.service.IRepositoryService;
-import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials;
import org.lamsfoundation.lams.events.IEventNotificationService;
import org.lamsfoundation.lams.learning.service.ILearnerService;
import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException;
@@ -67,30 +53,25 @@
import org.lamsfoundation.lams.tool.exception.SessionDataExistsException;
import org.lamsfoundation.lams.tool.exception.ToolException;
import org.lamsfoundation.lams.tool.service.ILamsToolService;
-import org.lamsfoundation.lams.tool.wiki.dao.IWikiAttachmentDAO;
import org.lamsfoundation.lams.tool.wiki.dao.IWikiDAO;
import org.lamsfoundation.lams.tool.wiki.dao.IWikiPageContentDAO;
import org.lamsfoundation.lams.tool.wiki.dao.IWikiPageDAO;
import org.lamsfoundation.lams.tool.wiki.dao.IWikiSessionDAO;
import org.lamsfoundation.lams.tool.wiki.dao.IWikiUserDAO;
import org.lamsfoundation.lams.tool.wiki.model.Wiki;
-import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment;
import org.lamsfoundation.lams.tool.wiki.model.WikiPage;
import org.lamsfoundation.lams.tool.wiki.model.WikiPageContent;
import org.lamsfoundation.lams.tool.wiki.model.WikiSession;
import org.lamsfoundation.lams.tool.wiki.model.WikiUser;
import org.lamsfoundation.lams.tool.wiki.util.WikiConstants;
import org.lamsfoundation.lams.tool.wiki.util.WikiException;
-import org.lamsfoundation.lams.tool.wiki.util.WikiToolContentHandler;
import org.lamsfoundation.lams.tool.wiki.util.diff.Diff;
import org.lamsfoundation.lams.tool.wiki.util.diff.Difference;
import org.lamsfoundation.lams.tool.wiki.web.forms.WikiPageForm;
import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
-import org.lamsfoundation.lams.util.FileUtil;
import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.WebUtil;
-import org.lamsfoundation.lams.util.audit.IAuditService;
/**
* An implementation of the IWikiService interface.
@@ -111,18 +92,12 @@
private IWikiUserDAO wikiUserDAO = null;
- private IWikiAttachmentDAO wikiAttachmentDAO = null;
-
private ILearnerService learnerService;
private ILamsToolService toolService;
private IToolContentHandler wikiToolContentHandler = null;
- private IRepositoryService repositoryService = null;
-
- private IAuditService auditService = null;
-
private IExportToolContentService exportContentService;
private ICoreNotebookService coreNotebookService;
@@ -137,7 +112,6 @@
public WikiService() {
super();
- // TODO Auto-generated constructor stub
}
/* ************ Methods from ToolSessionManager ************* */
@@ -292,29 +266,11 @@
// create the fromContent using the default tool content
fromContent = getDefaultContent();
}
- Wiki toContent = Wiki.newInstance(fromContent, toContentId, wikiToolContentHandler);
+ Wiki toContent = Wiki.newInstance(fromContent, toContentId);
insertUnsavedWikiContent(toContent);
}
- public void setAsDefineLater(Long toolContentId, boolean value) throws DataMissingException, ToolException {
- Wiki wiki = wikiDAO.getByContentId(toolContentId);
- if (wiki == null) {
- throw new ToolException("Could not find tool with toolContentID: " + toolContentId);
- }
- wiki.setDefineLater(value);
- wikiDAO.saveOrUpdate(wiki);
- }
-
- public void setAsRunOffline(Long toolContentId, boolean value) throws DataMissingException, ToolException {
- Wiki wiki = wikiDAO.getByContentId(toolContentId);
- if (wiki == null) {
- throw new ToolException("Could not find tool with toolContentID: " + toolContentId);
- }
- wiki.setRunOffline(value);
- wikiDAO.saveOrUpdate(wiki);
- }
-
public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException,
ToolException {
// TODO Auto-generated method stub
@@ -339,8 +295,7 @@
// set ResourceToolContentHandler as null to avoid copy file node in
// repository again.
- wiki = Wiki.newInstance(wiki, toolContentId, null);
- wiki.setToolContentHandler(null);
+ wiki = Wiki.newInstance(wiki, toolContentId);
wiki.setWikiSessions(null);
// Go through each page add page content and remove parent references
@@ -361,13 +316,7 @@
mainPage.setTitle(wiki.getMainPage().getTitle());
wiki.setMainPage(mainPage);
- Set atts = wiki.getWikiAttachments();
- for (WikiAttachment att : atts) {
- att.setWiki(null);
- }
try {
- exportContentService
- .registerFileClassForExport(WikiAttachment.class.getName(), "fileUuid", "fileVersionId");
exportContentService.exportToolContent(toolContentId, wiki, wikiToolContentHandler, rootPath);
} catch (ExportToolContentException e) {
throw new ToolException(e);
@@ -383,9 +332,9 @@
public void importToolContent(Long toolContentId, Integer newUserUid, String toolContentPath, String fromVersion,
String toVersion) throws ToolException {
try {
- exportContentService.registerFileClassForImport(WikiAttachment.class.getName(), "fileUuid",
- "fileVersionId", "fileName", "fileType", null, null);
-
+ // register version filter class
+ exportContentService.registerImportVersionFilterClass(WikiContentVersionFilter.class);
+
Object toolPOJO = exportContentService.importToolContent(toolContentPath, wikiToolContentHandler,
fromVersion, toVersion);
if (!(toolPOJO instanceof Wiki)) {
@@ -566,7 +515,7 @@
}
Wiki defaultContent = getDefaultContent();
- Wiki newContent = Wiki.newInstance(defaultContent, newContentID, wikiToolContentHandler);
+ Wiki newContent = Wiki.newInstance(defaultContent, newContentID);
insertUnsavedWikiContent(newContent);
@@ -637,27 +586,6 @@
return wikiUserDAO.getByUID(uid);
}
- public WikiAttachment uploadFileToContent(Long toolContentId, FormFile file, String type) {
- if (file == null || StringUtils.isEmpty(file.getFileName())) {
- throw new WikiException("Could not find upload file: " + file);
- }
-
- NodeKey nodeKey = processFile(file, type);
-
- WikiAttachment attachment = new WikiAttachment(nodeKey.getVersion(), type, file.getFileName(), nodeKey
- .getUuid(), new Date());
- return attachment;
- }
-
- public void deleteFromRepository(Long uuid, Long versionID) throws WikiException {
- ITicket ticket = getRepositoryLoginTicket();
- try {
- repositoryService.deleteVersion(ticket, uuid, versionID);
- } catch (Exception e) {
- throw new WikiException("Exception occured while deleting files from" + " the repository " + e.getMessage());
- }
- }
-
/**
* (non-Javadoc)
*
@@ -751,11 +679,6 @@
wikiPageDAO.saveOrUpdate(wikiPage);
}
- public void deleteInstructionFile(Long contentID, Long uuid, Long versionID, String type) {
- wikiDAO.deleteInstructionFile(contentID, uuid, versionID, type);
-
- }
-
public void saveOrUpdateWiki(Wiki wiki) {
wikiDAO.saveOrUpdate(wiki);
}
@@ -807,14 +730,6 @@
saveOrUpdateWikiUser(wikiUser);
return wikiUser;
}
-
- public IAuditService getAuditService() {
- return auditService;
- }
-
- public void setAuditService(IAuditService auditService) {
- this.auditService = auditService;
- }
@Override
public boolean isGroupedActivity(long toolContentID) {
@@ -826,55 +741,8 @@
return toolService.getLearnerContentFolder(toolSessionId, userId);
}
- private NodeKey processFile(FormFile file, String type) {
- NodeKey node = null;
- if (file != null && !StringUtils.isEmpty(file.getFileName())) {
- String fileName = file.getFileName();
- try {
- node = getWikiToolContentHandler().uploadFile(file.getInputStream(), fileName, file.getContentType(),
- type);
- } catch (InvalidParameterException e) {
- throw new WikiException("InvalidParameterException occured while trying to upload File"
- + e.getMessage());
- } catch (FileNotFoundException e) {
- throw new WikiException("FileNotFoundException occured while trying to upload File" + e.getMessage());
- } catch (RepositoryCheckedException e) {
- throw new WikiException("RepositoryCheckedException occured while trying to upload File"
- + e.getMessage());
- } catch (IOException e) {
- throw new WikiException("IOException occured while trying to upload File" + e.getMessage());
- }
- }
- return node;
- }
-
/**
- * This method verifies the credentials of the Wiki Tool and gives it the Ticket
to login and access
- * the Content Repository.
*
- * A valid ticket is needed in order to access the content from the repository. This method would be called evertime
- * the tool needs to upload/download files from the content repository.
- *
- * @return ITicket The ticket for repostory access
- * @throws SubmitFilesException
- */
- private ITicket getRepositoryLoginTicket() throws WikiException {
- ICredentials credentials = new SimpleCredentials(WikiToolContentHandler.repositoryUser,
- WikiToolContentHandler.repositoryId);
- try {
- ITicket ticket = repositoryService.login(credentials, WikiToolContentHandler.repositoryWorkspaceName);
- return ticket;
- } catch (AccessDeniedException ae) {
- throw new WikiException("Access Denied to repository." + ae.getMessage());
- } catch (WorkspaceNotFoundException we) {
- throw new WikiException("Workspace not found." + we.getMessage());
- } catch (LoginException e) {
- throw new WikiException("Login failed." + e.getMessage());
- }
- }
-
- /**
- *
* @param learnerId
* @param toolSessionId
* @return
@@ -934,9 +802,6 @@
wiki.setInstructions(WebUtil.convertNewlines((String) importValues
.get(ToolContentImport102Manager.CONTENT_BODY)));
wiki.setLockOnFinished(Boolean.TRUE);
- wiki.setOfflineInstructions(null);
- wiki.setOnlineInstructions(null);
- wiki.setRunOffline(Boolean.FALSE);
wiki.setTitle((String) importValues.get(ToolContentImport102Manager.CONTENT_TITLE));
wiki.setToolContentId(toolContentId);
wiki.setUpdateDate(now);
@@ -948,9 +813,6 @@
wiki.setMaximumEdits(0);
wiki.setMinimumEdits(0);
- // leave as empty, no need to set them to anything.
- // setWikiAttachments(Set wikiAttachments);
- // setWikiSessions(Set wikiSessions);
wikiDAO.saveOrUpdate(wiki);
}
@@ -974,14 +836,6 @@
// =========================================================================================
/* ********** Used by Spring to "inject" the linked objects ************* */
- public IWikiAttachmentDAO getWikiAttachmentDAO() {
- return wikiAttachmentDAO;
- }
-
- public void setWikiAttachmentDAO(IWikiAttachmentDAO attachmentDAO) {
- wikiAttachmentDAO = attachmentDAO;
- }
-
public IWikiDAO getWikiDAO() {
return wikiDAO;
}
@@ -1106,14 +960,6 @@
this.lessonService = lessonService;
}
- public IRepositoryService getRepositoryService() {
- return repositoryService;
- }
-
- public void setRepositoryService(IRepositoryService repositoryService) {
- this.repositoryService = repositoryService;
- }
-
public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) {
return getWikiOutputFactory().getSupportedDefinitionClasses(definitionType);
}
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/util/WikiConstants.java
===================================================================
diff -u -r31d297d14df060ae066a55e125b5025ed713d681 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/util/WikiConstants.java (.../WikiConstants.java) (revision 31d297d14df060ae066a55e125b5025ed713d681)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/util/WikiConstants.java (.../WikiConstants.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -33,8 +33,6 @@
public static final Integer SESSION_COMPLETED = new Integer(2);
public static final String AUTHORING_DEFAULT_TAB = "1";
- public static final String ATTACHMENT_LIST = "attachmentList";
- public static final String DELETED_ATTACHMENT_LIST = "deletedAttachmentList";
public static final String AUTH_SESSION_ID_COUNTER = "authoringSessionIdCounter";
public static final String AUTH_SESSION_ID = "authoringSessionId";
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/AuthoringAction.java
===================================================================
diff -u -r4161978f8d7ac38d8de94e68128ae300b0892e9d -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 4161978f8d7ac38d8de94e68128ae300b0892e9d)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -49,7 +49,6 @@
import org.lamsfoundation.lams.tool.wiki.dto.WikiPageContentDTO;
import org.lamsfoundation.lams.tool.wiki.dto.WikiPageDTO;
import org.lamsfoundation.lams.tool.wiki.model.Wiki;
-import org.lamsfoundation.lams.tool.wiki.model.WikiAttachment;
import org.lamsfoundation.lams.tool.wiki.model.WikiPage;
import org.lamsfoundation.lams.tool.wiki.model.WikiPageContent;
import org.lamsfoundation.lams.tool.wiki.model.WikiUser;
@@ -91,16 +90,6 @@
private static final String KEY_MODE = "mode";
- private static final String KEY_ONLINE_FILES = "onlineFiles";
-
- private static final String KEY_OFFLINE_FILES = "offlineFiles";
-
- private static final String KEY_UNSAVED_ONLINE_FILES = "unsavedOnlineFiles";
-
- private static final String KEY_UNSAVED_OFFLINE_FILES = "unsavedOfflineFiles";
-
- private static final String KEY_DELETED_FILES = "deletedFiles";
-
/**
* Default method when no dispatch parameter is specified. It is expected that the parameter
* toolContentID
will be passed in. This will be used to retrieve content for this tool.
@@ -264,24 +253,6 @@
ToolAccessMode mode = (ToolAccessMode) map.get(AuthoringAction.KEY_MODE);
updateWiki(wiki, authForm, mode);
- // remove attachments marked for deletion.
- Set attachments = wiki.getWikiAttachments();
- if (attachments == null) {
- attachments = new HashSet();
- }
-
- for (WikiAttachment att : getAttList(AuthoringAction.KEY_DELETED_FILES, map)) {
- // remove from db, leave in repository
- attachments.remove(att);
- }
-
- // add unsaved attachments
- attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map));
- attachments.addAll(getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map));
-
- // set attachments in case it didn't exist
- wiki.setWikiAttachments(attachments);
-
// set the update date
wiki.setUpdateDate(new Date());
@@ -300,169 +271,8 @@
return mapping.findForward("success");
}
- public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return uploadFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request);
- }
- public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return uploadFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request);
- }
-
- public ActionForward deleteOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return deleteFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request);
- }
-
- public ActionForward deleteOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return deleteFile(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request);
- }
-
- public ActionForward removeUnsavedOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return removeUnsaved(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_ONLINE, request);
- }
-
- public ActionForward removeUnsavedOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
- return removeUnsaved(mapping, (AuthoringForm) form, IToolContentHandler.TYPE_OFFLINE, request);
- }
-
- /* ========== Private Methods ********** */
-
/**
- * Upload a file
- */
- private ActionForward uploadFile(ActionMapping mapping, AuthoringForm authForm, String type,
- HttpServletRequest request) {
- SessionMap map = getSessionMap(request, authForm);
-
- FormFile file;
- List unsavedFiles;
- List savedFiles;
- if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) {
- file = authForm.getOfflineFile();
- unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map);
-
- savedFiles = getAttList(AuthoringAction.KEY_OFFLINE_FILES, map);
- } else {
- file = authForm.getOnlineFile();
- unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map);
-
- savedFiles = getAttList(AuthoringAction.KEY_ONLINE_FILES, map);
- }
-
- // validate file max size
- ActionMessages errors = new ActionMessages();
- FileValidatorUtil.validateFileSize(file, true, errors);
- if (!errors.isEmpty()) {
- request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map);
- this.saveErrors(request, errors);
- return mapping.findForward("success");
- }
-
- if (file.getFileName().length() != 0) {
-
- // upload file to repository
- WikiAttachment newAtt = wikiService.uploadFileToContent(
- (Long) map.get(AuthoringAction.KEY_TOOL_CONTENT_ID), file, type);
-
- // Add attachment to unsavedFiles
- // check to see if file with same name exists
- WikiAttachment currAtt;
- Iterator iter = savedFiles.iterator();
- while (iter.hasNext()) {
- currAtt = (WikiAttachment) iter.next();
- if (StringUtils.equals(currAtt.getFileName(), newAtt.getFileName())
- && StringUtils.equals(currAtt.getFileType(), newAtt.getFileType())) {
- // move from this this list to deleted list.
- getAttList(AuthoringAction.KEY_DELETED_FILES, map).add(currAtt);
- iter.remove();
- break;
- }
- }
- unsavedFiles.add(newAtt);
-
- request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map);
- request.setAttribute("unsavedChanges", new Boolean(true));
- }
- return mapping.findForward("success");
- }
-
- /**
- * Delete a file
- *
- * @param mapping
- * @param authForm
- * @param type
- * @param request
- * @return
- */
- private ActionForward deleteFile(ActionMapping mapping, AuthoringForm authForm, String type,
- HttpServletRequest request) {
- SessionMap map = getSessionMap(request, authForm);
-
- List fileList;
- if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) {
- fileList = getAttList(AuthoringAction.KEY_OFFLINE_FILES, map);
- } else {
- fileList = getAttList(AuthoringAction.KEY_ONLINE_FILES, map);
- }
-
- Iterator iter = fileList.iterator();
-
- while (iter.hasNext()) {
- WikiAttachment att = (WikiAttachment) iter.next();
-
- if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) {
- // move to delete file list, deleted at next updateContent
- getAttList(AuthoringAction.KEY_DELETED_FILES, map).add(att);
-
- // remove from this list
- iter.remove();
- break;
- }
- }
-
- request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map);
- request.setAttribute("unsavedChanges", new Boolean(true));
-
- return mapping.findForward("success");
- }
-
- private ActionForward removeUnsaved(ActionMapping mapping, AuthoringForm authForm, String type,
- HttpServletRequest request) {
- SessionMap map = getSessionMap(request, authForm);
-
- List unsavedFiles;
-
- if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) {
- unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, map);
- } else {
- unsavedFiles = getAttList(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, map);
- }
-
- Iterator iter = unsavedFiles.iterator();
- while (iter.hasNext()) {
- WikiAttachment att = (WikiAttachment) iter.next();
-
- if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) {
- // delete from repository and list
- wikiService.deleteFromRepository(att.getFileUuid(), att.getFileVersionId());
- iter.remove();
- break;
- }
- }
-
- request.setAttribute(WikiConstants.ATTR_SESSION_MAP, map);
- request.setAttribute("unsavedChanges", new Boolean(true));
-
- return mapping.findForward("success");
- }
-
- /**
* Updates Wiki content using AuthoringForm inputs.
*
* @param authForm
@@ -481,8 +291,6 @@
wiki.setMainPage(mainPage);
if (mode.isAuthor()) { // Teacher cannot modify following
- wiki.setOfflineInstructions(authForm.getOfflineInstruction());
- wiki.setOnlineInstructions(authForm.getOnlineInstruction());
wiki.setLockOnFinished(authForm.isLockOnFinished());
wiki.setAllowLearnerAttachImages(authForm.isAllowLearnerAttachImages());
wiki.setAllowLearnerCreatePages(authForm.isAllowLearnerCreatePages());
@@ -503,8 +311,6 @@
* @return
*/
private void updateAuthForm(AuthoringForm authForm, Wiki wiki) {
- authForm.setOnlineInstruction(wiki.getOnlineInstructions());
- authForm.setOfflineInstruction(wiki.getOfflineInstructions());
authForm.setLockOnFinished(wiki.isLockOnFinished());
authForm.setAllowLearnerAttachImages(wiki.isAllowLearnerAttachImages());
authForm.setAllowLearnerCreatePages(wiki.isAllowLearnerCreatePages());
@@ -531,24 +337,7 @@
map.put(AuthoringAction.KEY_MODE, mode);
map.put(AuthoringAction.KEY_CONTENT_FOLDER_ID, contentFolderID);
map.put(AuthoringAction.KEY_TOOL_CONTENT_ID, toolContentID);
- map.put(AuthoringAction.KEY_ONLINE_FILES, new LinkedList());
- map.put(AuthoringAction.KEY_OFFLINE_FILES, new LinkedList());
- map.put(AuthoringAction.KEY_UNSAVED_ONLINE_FILES, new LinkedList());
- map.put(AuthoringAction.KEY_UNSAVED_OFFLINE_FILES, new LinkedList());
- map.put(AuthoringAction.KEY_DELETED_FILES, new LinkedList());
- Iterator iter = wiki.getWikiAttachments().iterator();
- while (iter.hasNext()) {
- WikiAttachment attachment = (WikiAttachment) iter.next();
- String type = attachment.getFileType();
- if (type.equals(IToolContentHandler.TYPE_OFFLINE)) {
- getAttList(AuthoringAction.KEY_OFFLINE_FILES, map).add(attachment);
- }
- if (type.equals(IToolContentHandler.TYPE_ONLINE)) {
- getAttList(AuthoringAction.KEY_ONLINE_FILES, map).add(attachment);
- }
- }
-
return map;
}
@@ -567,18 +356,6 @@
}
/**
- * Retrieves a List of attachments from the map using the key.
- *
- * @param key
- * @param map
- * @return
- */
- private List getAttList(String key, SessionMap map) {
- List list = (List) map.get(key);
- return list;
- }
-
- /**
* Retrieve the SessionMap from the HttpSession.
*
* @param request
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java
===================================================================
diff -u -rb19488eb4b80f01e7dcc599a71a6f8bff477c68c -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java (.../LearningAction.java) (revision b19488eb4b80f01e7dcc599a71a6f8bff477c68c)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/actions/LearningAction.java (.../LearningAction.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -77,7 +77,6 @@
* @struts.action path="/learning" parameter="dispatch" scope="request"
* name="learningForm" validate="false"
* @struts.action-forward name="wiki" path="tiles:/learning/main"
- * @struts.action-forward name="runOffline" path="tiles:/learning/runOffline"
* @struts.action-forward name="compareWiki" path="/pages/wiki/compare.jsp"
* @struts.action-forward name="viewWiki" path="/pages/wiki/viewWiki.jsp"
* @struts.action-forward name="defineLater" path="tiles:/learning/defineLater"
@@ -141,11 +140,6 @@
LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionID, request, getServlet()
.getServletContext());
-
- // check runOffline
- if (wiki.isRunOffline()) {
- return mapping.findForward("runOffline");
- }
// get the user
WikiUser wikiUser;
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java
===================================================================
diff -u -rb33e717f9a734d318eefab07a17234f07c770c92 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision b33e717f9a734d318eefab07a17234f07c770c92)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -113,35 +113,6 @@
}
/**
- * Do an offline export
- */
- @Override
- protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName,
- Cookie[] cookies) {
- if (toolContentID == null && toolSessionID == null) {
- ExportServlet.logger.error("Tool content Id or and session Id are null. Unable to activity title");
- } else {
- if (wikiService == null) {
- wikiService = WikiServiceProxy.getWikiService(getServletContext());
- }
-
- Wiki content = null;
- if (toolContentID != null) {
- content = wikiService.getWikiByContentId(toolContentID);
- } else {
- WikiSession session = wikiService.getSessionBySessionId(toolSessionID);
- if (session != null) {
- content = session.getWiki();
- }
- }
- if (content != null) {
- activityTitle = content.getTitle();
- }
- }
- return super.doOfflineExport(request, response, directoryName, cookies);
- }
-
- /**
* Do export for learners, outputs the wiki pages into one page which seperates each page into divs which are
* displayed onclick
*
Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/wikiApplicationContext.xml
===================================================================
diff -u -r126d84999e520648cb187e465cb4aaa3baad222e -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/wikiApplicationContext.xml (.../wikiApplicationContext.xml) (revision 126d84999e520648cb187e465cb4aaa3baad222e)
+++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/wikiApplicationContext.xml (.../wikiApplicationContext.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -16,22 +16,19 @@
-
-
-
-
+
@@ -45,8 +42,6 @@
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
- PROPAGATION_REQUIRED
- PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
@@ -78,10 +73,6 @@
-
-
-
-
Index: lams_tool_wiki/web/WEB-INF/tiles-defs.xml
===================================================================
diff -u -rd56929f06ad90a63082d514e6521adc175f3de27 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision d56929f06ad90a63082d514e6521adc175f3de27)
+++ lams_tool_wiki/web/WEB-INF/tiles-defs.xml (.../tiles-defs.xml) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -86,10 +86,6 @@
-
-
-
-
Index: lams_tool_wiki/web/includes/javascript/authoring.js
===================================================================
diff -u -r31d297d14df060ae066a55e125b5025ed713d681 -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/web/includes/javascript/authoring.js (.../authoring.js) (revision 31d297d14df060ae066a55e125b5025ed713d681)
+++ lams_tool_wiki/web/includes/javascript/authoring.js (.../authoring.js) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -25,7 +25,3 @@
finishButtonDiv.style.display = "block";
}
}
-function deleteAttachment(dispatch, uuid) {
- document.authoringForm.deleteFileUuid.value = uuid;
- submitWiki(dispatch);
-}
Index: lams_tool_wiki/web/pages/authoring/authoring.jsp
===================================================================
diff -u -r4161978f8d7ac38d8de94e68128ae300b0892e9d -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 4161978f8d7ac38d8de94e68128ae300b0892e9d)
+++ lams_tool_wiki/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -19,7 +19,6 @@
-
@@ -38,9 +37,6 @@
-
-
-
@@ -61,8 +57,6 @@
-
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/web/pages/authoring/instructions.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/web/pages/learning/runOffline.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 8b97231e320c0c5b674f07c14da711f232ba9e1c refers to a dead (removed) revision in file `lams_tool_wiki/web/pages/monitoring/instructions.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_wiki/web/pages/monitoring/monitoring.jsp
===================================================================
diff -u -r1082bdcc357c105126a5641cecc68acfa645b66b -r8b97231e320c0c5b674f07c14da711f232ba9e1c
--- lams_tool_wiki/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 1082bdcc357c105126a5641cecc68acfa645b66b)
+++ lams_tool_wiki/web/pages/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 8b97231e320c0c5b674f07c14da711f232ba9e1c)
@@ -4,9 +4,8 @@