Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java,v diff -u -r1.3.4.4 -r1.3.4.5 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java 7 May 2009 06:54:42 -0000 1.3.4.4 +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/dto/VideoRecorderRecordingDTO.java 13 May 2009 00:56:51 -0000 1.3.4.5 @@ -70,9 +70,9 @@ public String filename; - public Set ratings; + public Set ratings; - public Set comments; + public Set comments; /* Constructors */ public VideoRecorderRecordingDTO(){} @@ -206,19 +206,19 @@ this.filename = filename; } - public Set getComments() { + public Set getComments() { return this.comments; } - public void setComments(Set comments) { + public void setComments(Set comments) { this.comments = comments; } - public Set getRatings() { + public Set getRatings() { return this.ratings; } - public void setRatings(Set ratings) { + public void setRatings(Set ratings) { this.ratings = ratings; } } Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java,v diff -u -r1.4.2.4 -r1.4.2.5 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java 7 May 2009 06:54:47 -0000 1.4.2.4 +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/IVideoRecorderService.java 13 May 2009 00:56:51 -0000 1.4.2.5 @@ -273,16 +273,6 @@ */ void updateEntry(Long uid, String entry); - /** - * Creates an unique name for a ChatCondition. It consists of the tool output definition name and a unique positive - * integer number. - * - * @param existingConditions - * existing conditions; required to check if a condition with the same name does not exist. - * @return unique ChatCondition name - */ - String createConditionName(Collection existingConditions); - void releaseConditionsFromCache(VideoRecorder videoRecorder); void deleteCondition(VideoRecorderCondition condition); Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderOutputFactory.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderOutputFactory.java,v diff -u -r1.2.2.4 -r1.2.2.5 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderOutputFactory.java 7 May 2009 06:54:47 -0000 1.2.2.4 +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderOutputFactory.java 13 May 2009 00:56:51 -0000 1.2.2.5 @@ -23,27 +23,20 @@ /* $Id$ */ package org.lamsfoundation.lams.tool.videoRecorder.service; -import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; -import org.lamsfoundation.lams.learningdesign.BranchCondition; -import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.tool.OutputFactory; import org.lamsfoundation.lams.tool.ToolOutput; import org.lamsfoundation.lams.tool.ToolOutputDefinition; import org.lamsfoundation.lams.tool.exception.ToolException; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorder; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderCondition; -import org.lamsfoundation.lams.tool.videoRecorder.model.VideoRecorderUser; import org.lamsfoundation.lams.tool.videoRecorder.util.VideoRecorderConstants; /** * Output factory for VideoRecorder tool. Currently it provides only one type of output - the entry that user provided. * - * @author Marcin Cieslak + * @author Paul Georges */ public class VideoRecorderOutputFactory extends OutputFactory { @@ -54,20 +47,6 @@ public SortedMap getToolOutputDefinitions(Object toolContentObject) throws ToolException { SortedMap definitionMap = new TreeMap(); - if (toolContentObject != null) { - ToolOutputDefinition videoRecorderEntryDefinition = buildStringOutputDefinition(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME); - VideoRecorder videoRecorder = (VideoRecorder) toolContentObject; - // adding all existing conditions - videoRecorderEntryDefinition.setDefaultConditions(new ArrayList(videoRecorder.getConditions())); - // if no conditions were created in the tool instance, a default condition is added; - if (videoRecorderEntryDefinition.getDefaultConditions().isEmpty()) { - VideoRecorderCondition defaultCondition = createDefaultComplexCondition(videoRecorder); - videoRecorder.getConditions().add(defaultCondition); - videoRecorderEntryDefinition.getDefaultConditions().add(defaultCondition); - } - videoRecorderEntryDefinition.setShowConditionNameOnly(true); - definitionMap.put(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME, videoRecorderEntryDefinition); - } ToolOutputDefinition numberOfRecordingsDefinition = buildRangeDefinition(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME, new Long(0), null); definitionMap.put(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME, numberOfRecordingsDefinition); @@ -89,41 +68,6 @@ Long toolSessionId, Long learnerId) { TreeMap outputs = new TreeMap(); - // cached tool output for all text search conditions - ToolOutput videoRecorderEntryOutput = null; - if (names == null) { - // output will be set for all the existing conditions - VideoRecorder videoRecorder = videoRecorderService.getSessionBySessionId(toolSessionId).getVideoRecorder(); - Set conditions = videoRecorder.getConditions(); - for (VideoRecorderCondition condition : conditions) { - String name = condition.getName(); - if (isTextSearchConditionName(name) && videoRecorderEntryOutput != null) { - outputs.put(name, videoRecorderEntryOutput); - } else { - ToolOutput output = getToolOutput(name, videoRecorderService, toolSessionId, learnerId); - if (output != null) { - outputs.put(name, output); - if (isTextSearchConditionName(name)) { - videoRecorderEntryOutput = output; - } - } - } - } - } else { - for (String name : names) { - if (isTextSearchConditionName(name) && videoRecorderEntryOutput != null) { - outputs.put(name, videoRecorderEntryOutput); - } else { - ToolOutput output = getToolOutput(name, videoRecorderService, toolSessionId, learnerId); - if (output != null) { - outputs.put(name, output); - if (isTextSearchConditionName(name)) { - videoRecorderEntryOutput = output; - } - } - } - } - } if (names == null || names.contains(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME)) { outputs.put(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME, getNbRecordings(videoRecorderService, learnerId, toolSessionId)); @@ -143,17 +87,7 @@ public ToolOutput getToolOutput(String name, IVideoRecorderService videoRecorderService, Long toolSessionId, Long learnerId) { ToolOutput toolOutput = null; - if (isTextSearchConditionName(name)) { - // entry is loaded from DB - VideoRecorder videoRecorder = videoRecorderService.getSessionBySessionId(toolSessionId).getVideoRecorder(); - - VideoRecorderUser user = videoRecorderService.getUserByUserIdAndSessionId(learnerId, toolSessionId); - NotebookEntry entry = videoRecorderService.getEntry(user.getEntryUID()); - - String value = entry == null ? null : entry.getEntry(); - - toolOutput = new ToolOutput(name, getI18NText(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME, true), value); - }else if (name != null && name.equals(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME)) { + if (name != null && name.equals(VideoRecorderConstants.NB_RECORDINGS_DEFINITION_NAME)) { toolOutput = getNbRecordings(videoRecorderService, learnerId, toolSessionId); }else if (name != null && name.equals(VideoRecorderConstants.NB_COMMENTS_DEFINITION_NAME)) { toolOutput = getNbComments(videoRecorderService, learnerId, toolSessionId); @@ -163,34 +97,6 @@ return toolOutput; } - - @Override - protected String[] splitConditionName(String conditionName) { - return super.splitConditionName(conditionName); - } - - protected String buildConditionName(String uniquePart) { - return super.buildConditionName(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME, uniquePart); - } - - private boolean isTextSearchConditionName(String name) { - return name != null && name.startsWith(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME); - } - - /** - * Creates a default condition so teachers know how to use complex conditions for this tool. - * - * @param videoRecorder - * content of the tool - * @return default videoRecorder condition - */ - protected VideoRecorderCondition createDefaultComplexCondition(VideoRecorder videoRecorder) { - String name = buildConditionName(VideoRecorderConstants.TEXT_SEARCH_DEFINITION_NAME, videoRecorder.getToolContentId() - .toString()); - // Default condition checks if the text contains word "LAMS" - return new VideoRecorderCondition(null, null, 1, name, getI18NText( - VideoRecorderConstants.TEXT_SEARCH_DEFAULT_CONDITION_DISPLAY_NAME_KEY, false), "LAMS", null, null, null); - } private ToolOutput getNbRecordings(IVideoRecorderService videoRecorderService, Long learnerId, Long toolSessionId) { Long nb = videoRecorderService.getNbRecordings(learnerId, toolSessionId); Index: lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java,v diff -u -r1.5.2.5 -r1.5.2.6 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java 8 May 2009 04:03:11 -0000 1.5.2.5 +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java 13 May 2009 00:56:51 -0000 1.5.2.6 @@ -395,8 +395,7 @@ throw new VideoRecorderException(error); } if (defaultContent.getConditions().isEmpty()) { - defaultContent.getConditions() - .add(getVideoRecorderOutputFactory().createDefaultComplexCondition(defaultContent)); + // needed? } return defaultContent; } @@ -785,23 +784,6 @@ this.repositoryService = repositoryService; } - /** - * {@inheritDoc} - */ - public String createConditionName(Collection existingConditions) { - String uniqueNumber = null; - do { - uniqueNumber = String.valueOf(Math.abs(generator.nextInt())); - for (VideoRecorderCondition condition : existingConditions) { - String[] splitedName = getVideoRecorderOutputFactory().splitConditionName(condition.getName()); - if (uniqueNumber.equals(splitedName[1])) { - uniqueNumber = null; - } - } - } while (uniqueNumber == null); - return getVideoRecorderOutputFactory().buildConditionName(uniqueNumber); - } - public void releaseConditionsFromCache(VideoRecorder videoRecorder) { if (videoRecorder.getConditions() != null) { for (VideoRecorderCondition condition : videoRecorder.getConditions()) { Fisheye: Tag 1.1.4.3 refers to a dead (removed) revision in file `lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/web/actions/AuthoringVideoRecorderConditionAction.java'. Fisheye: No comparison available. Pass `N' to diff?