Index: lams_central/src/java/org/lamsfoundation/lams/authoring/ObjectExtractor.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/ObjectExtractor.java,v diff -u -r1.83 -r1.84 --- lams_central/src/java/org/lamsfoundation/lams/authoring/ObjectExtractor.java 2 Jul 2009 13:02:40 -0000 1.83 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/ObjectExtractor.java 26 Jul 2009 22:19:13 -0000 1.84 @@ -1557,8 +1557,10 @@ Transition existingTransition = findTransition(transitionUUID, toUIID, fromUIID, transitionType); if (existingTransition == null) { - if (false/* It will soon be implemented in Flash. Now we need to check what kind of transition are we dealing with - transitionType.equals(Transition.DATA_TRANSITION_TYPE) */) { + if (false/* + * It will soon be implemented in Flash. Now we need to check what kind of transition are we + * dealing with transitionType.equals(Transition.DATA_TRANSITION_TYPE) + */) { transition = new DataTransition(); } else { transition = new Transition(); @@ -1620,10 +1622,10 @@ * activity but not a too activity. These cases should be picked up by Flash, but just in case. */ private void cleanupTransition(Transition transition) { - if (transition.getFromActivity().getTransitionFrom().equals(transition)) { + if (transition.getFromActivity() != null && transition.equals(transition.getFromActivity().getTransitionFrom())) { transition.getFromActivity().setTransitionFrom(null); } - if (transition.getToActivity().getTransitionTo().equals(transition)) { + if (transition.getToActivity() != null && transition.equals(transition.getToActivity().getTransitionTo())) { transition.getToActivity().setTransitionTo(null); } } Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java,v diff -u -r1.86 -r1.87 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 2 Jul 2009 13:02:40 -0000 1.86 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 26 Jul 2009 22:19:13 -0000 1.87 @@ -387,7 +387,7 @@ } /** - * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getToolOutputDefinitions(java.lang.Long) + * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getToolOutputDefinitions(java.lang.Long, int) */ public String getToolOutputDefinitions(Long toolContentID, int definitionType) throws IOException { @@ -407,6 +407,28 @@ } /** + * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getToolOutputDefinitions(java.lang.Long, int, + * java.lang.Long) + */ + public String getToolOutputDefinitions(Long outputToolContentID, int definitionType, Long inputToolContentID) + throws IOException { + + SortedMap defns = lamsCoreToolService.getOutputDefinitionsFromToolFiltered( + outputToolContentID, definitionType, inputToolContentID); + + ArrayList defnDTOList = new ArrayList(defns != null ? defns + .size() : 0); + if (defns != null) { + for (ToolOutputDefinition defn : defns.values()) { + defnDTOList.add(new ToolOutputDefinitionDTO(defn)); + } + } + + FlashMessage flashMessage = new FlashMessage("getToolOutputDefinitions", defnDTOList); + return flashMessage.serializeMessage(); + } + + /** * @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getLearningDesignDetails(java.lang.Long, * java.lang.Long) */ @@ -536,8 +558,8 @@ } if (design != null) { /* - * only the user who is editing the design may unlock it - */ + * only the user who is editing the design may unlock it + */ if (design.getEditOverrideUser().equals(user)) { design.setEditOverrideLock(false); design.setEditOverrideUser(null); @@ -1343,7 +1365,7 @@ } if (newTransition.getFromUIID() != null) { fromActivity = newActivities.get(newTransition.getFromUIID()); - //check if we are dealing with a "real" transition, not data flow + // check if we are dealing with a "real" transition, not data flow if (transition.isProgressTransition()) { fromActivity.setTransitionFrom(newTransition); } @@ -1620,17 +1642,15 @@ user); if (extractor.getMode().intValue() == 1) { - + // adding the customCSV to the call if it is present String customCSV = null; - if (table.containsKey(WDDXTAGS.CUSTOM_CSV)){ + if (table.containsKey(WDDXTAGS.CUSTOM_CSV)) { customCSV = WDDXProcessor.convertToString(table, WDDXTAGS.CUSTOM_CSV); } - + copyLearningDesignToolContent(design, design, design.getCopyTypeID(), customCSV); - - } return design.getLearningDesignId(); Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java,v diff -u -r1.33 -r1.34 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 2 Jul 2009 13:02:40 -0000 1.33 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 26 Jul 2009 22:19:13 -0000 1.34 @@ -202,6 +202,16 @@ public String getToolOutputDefinitions(Long toolContentID, int definitionType) throws IOException; /** + * This method returns a output definition of the Tool, filtered by the supported Tool Output classes, in WDDX + * format. + * + * @return String The required definitions in WDDX format + * @throws IOException + */ + public String getToolOutputDefinitions(Long outputToolContentID, int definitionType, Long inputToolContentID) + throws IOException; + + /** * This method returns a list of all available Learning Designs in WDDX format. * * @return String The required list in WDDX format Index: lams_common/src/java/org/lamsfoundation/lams/tool/OutputFactory.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/OutputFactory.java,v diff -u -r1.9 -r1.10 --- lams_common/src/java/org/lamsfoundation/lams/tool/OutputFactory.java 2 Jul 2009 13:06:10 -0000 1.9 +++ lams_common/src/java/org/lamsfoundation/lams/tool/OutputFactory.java 26 Jul 2009 22:18:59 -0000 1.10 @@ -24,6 +24,7 @@ package org.lamsfoundation.lams.tool; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.SortedMap; @@ -78,7 +79,7 @@ private ILoadedMessageSourceService loadedMessageSourceService; private String languageFilename; private MessageSource msgSource = null; // derived from toolMessageService, loadedMessageSourceService, - // languageFilename + // languageFilename protected final String KEY_PREFIX = "output.desc."; protected final String CONDITION_NAME_SEPARATOR = "#"; @@ -197,7 +198,7 @@ * using the getDescription() method. Only use if the other buildBlahDefinitions do not suit your needs. */ protected ToolOutputDefinition buildDefinition(String definitionName, OutputType type, Object startValue, - Object endValue, Object complexValue, Boolean showConditionNameOnly) { + Object endValue, Object complexValue, Boolean showConditionNameOnly, Class valueClass) { ToolOutputDefinition definition = new ToolOutputDefinition(); definition.setName(definitionName); definition.setDescription(getI18NText(definitionName, true)); @@ -206,16 +207,18 @@ definition.setEndValue(endValue); definition.setComplexDefinition(complexValue); definition.setShowConditionNameOnly(showConditionNameOnly); + definition.setValueClass(valueClass); return definition; } /** * Wrapper method for build definition to set the isDefaultGradebookMark flag */ protected ToolOutputDefinition buildDefinition(String definitionName, OutputType type, Object startValue, - Object endValue, Object complexValue, Boolean showConditionNameOnly, Boolean isDefaultGradebookMark) { + Object endValue, Object complexValue, Boolean showConditionNameOnly, Boolean isDefaultGradebookMark, + Class valueClass) { ToolOutputDefinition definition = this.buildDefinition(definitionName, type, startValue, endValue, - complexValue, showConditionNameOnly); + complexValue, showConditionNameOnly, valueClass); definition.setIsDefaultGradebookMark(isDefaultGradebookMark); return definition; } @@ -225,15 +228,17 @@ * I18N file using the getDescription() method and set the type to OUTPUT_LONG. */ protected ToolOutputDefinition buildRangeDefinition(String definitionName, Long startValue, Long endValue) { - return buildDefinition(definitionName, OutputType.OUTPUT_LONG, startValue, endValue, null, Boolean.FALSE); + return buildDefinition(definitionName, OutputType.OUTPUT_LONG, startValue, endValue, null, Boolean.FALSE, + Long.class); } /** * Build a tool definition designed for a range of string values. It will get the definition's description from the * I18N file using the getDescription() method and set the type to OUTPUT_LONG. */ protected ToolOutputDefinition buildRangeDefinition(String definitionName, String startValue, String endValue) { - return buildDefinition(definitionName, OutputType.OUTPUT_STRING, startValue, endValue, null, Boolean.FALSE); + return buildDefinition(definitionName, OutputType.OUTPUT_STRING, startValue, endValue, null, Boolean.FALSE, + String.class); } /** @@ -242,7 +247,7 @@ protected ToolOutputDefinition buildRangeDefinition(String definitionName, Long startValue, Long endValue, Boolean isDefaultGradebookMark) { return buildDefinition(definitionName, OutputType.OUTPUT_LONG, startValue, endValue, null, Boolean.FALSE, - isDefaultGradebookMark); + isDefaultGradebookMark, String.class); } /** @@ -251,7 +256,7 @@ protected ToolOutputDefinition buildRangeDefinition(String definitionName, String startValue, String endValue, Boolean isDefaultGradebookMark) { return buildDefinition(definitionName, OutputType.OUTPUT_STRING, startValue, endValue, null, Boolean.FALSE, - isDefaultGradebookMark); + isDefaultGradebookMark, String.class); } /** @@ -260,7 +265,7 @@ * the type to OUTPUT_LONG. */ protected ToolOutputDefinition buildLongOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_LONG, null, null, null, Boolean.FALSE); + return buildDefinition(definitionName, OutputType.OUTPUT_LONG, null, null, null, Boolean.FALSE, Long.class); } /** @@ -269,7 +274,7 @@ * and set the type to OUTPUT_DOUBLE. */ protected ToolOutputDefinition buildDoubleOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_DOUBLE, null, null, null, Boolean.FALSE); + return buildDefinition(definitionName, OutputType.OUTPUT_DOUBLE, null, null, null, Boolean.FALSE, Double.class); } /** @@ -281,7 +286,7 @@ */ protected ToolOutputDefinition buildBooleanOutputDefinition(String definitionName) { ToolOutputDefinition definition = buildDefinition(definitionName, OutputType.OUTPUT_BOOLEAN, null, null, null, - Boolean.FALSE); + Boolean.FALSE, Boolean.class); List defaultConditions = new ArrayList(); defaultConditions.add(new BranchCondition(null, null, new Integer(1), definitionName, getI18NText( @@ -305,7 +310,7 @@ */ protected ToolOutputDefinition buildBooleanSetOutputDefinition(String definitionName) { ToolOutputDefinition definition = buildDefinition(definitionName, OutputType.OUTPUT_SET_BOOLEAN, null, null, - null, Boolean.TRUE); + null, Boolean.TRUE, (new HashSet()).getClass()); List defaultConditions = new ArrayList(); definition.setDefaultConditions(defaultConditions); return definition; @@ -316,15 +321,15 @@ * I18N file using the getDescription() method and set the type to OUTPUT_STRING. */ protected ToolOutputDefinition buildStringOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_STRING, null, null, null, Boolean.FALSE); + return buildDefinition(definitionName, OutputType.OUTPUT_STRING, null, null, null, Boolean.FALSE, String.class); } /** * Build a tool definition for a complex value output. It will get the definition's description from the I18N file * using the getDescription() method and set the type to OUTPUT_COMPLEX. */ - protected ToolOutputDefinition buildComplexOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_COMPLEX, null, null, null, Boolean.FALSE); + protected ToolOutputDefinition buildComplexOutputDefinition(String definitionName, Class valueClass) { + return buildDefinition(definitionName, OutputType.OUTPUT_COMPLEX, null, null, null, Boolean.FALSE, valueClass); } /** @@ -362,4 +367,17 @@ return new String[] { conditionName, "" }; } } + + /** + * If a tool supports data flow, it should override this method and return all the classes it supports, otherwise + * non matching inputs will be filtered off in Authoring. IMPORTANT: For compatibility, NULL means that all + * definitions are accepted! If the return value is not NULL, the definitions should be limited only to the matching + * ones. + * + * @param definitionType + * @return + */ + public Class[] getSupportedDefinitionClasses(int definitionType) { + return null; + } } Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java,v diff -u -r1.19 -r1.20 --- lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java 2 Jul 2009 13:06:10 -0000 1.19 +++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentManager.java 26 Jul 2009 22:18:59 -0000 1.20 @@ -139,4 +139,5 @@ public SortedMap getToolOutputDefinitions(Long toolContentId, int definitionType) throws ToolException; -} + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType); +} \ No newline at end of file Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java,v diff -u -r1.6 -r1.7 --- lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java 2 Jul 2009 13:06:10 -0000 1.6 +++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java 26 Jul 2009 22:18:59 -0000 1.7 @@ -63,6 +63,10 @@ private Boolean showConditionNameOnly; private Boolean isDefaultGradebookMark; private List defaultConditions; + // we need it to filter definitions which other tools can not process; it must be set in the definition, otherwise + // unsupported values can be passed to the receiving end of the data flow; most methods for creating Output + // Definitions set the class already, but it must be set manually for complex definitions + private Class valueClass; /** * Name must be unique within the current tool content. This will be used to identify the output. If the definition @@ -202,4 +206,12 @@ this.isDefaultGradebookMark = isDefaultGradebookMark; } + public Class getValueClass() { + return valueClass; + } + + public void setValueClass(Class valueClass) { + this.valueClass = valueClass; + } + } Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java,v diff -u -r1.23 -r1.24 --- lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java 2 Jul 2009 13:06:09 -0000 1.23 +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/ILamsCoreToolService.java 26 Jul 2009 22:18:59 -0000 1.24 @@ -213,6 +213,19 @@ throws ToolException; /** + * This method should be called to filter out definitions that are not supported. Currently used only in Data Flow + * between tools, when a receiving tool declares which Tool Output classes it supports. + * + * @param outputToolContentId + * @param definitionType + * @param inputToolContentId + * @return + * @throws ToolException + */ + public SortedMap getOutputDefinitionsFromToolFiltered(Long outputToolContentId, + int definitionType, Long inputToolContentId) throws ToolException; + + /** * Ask a tool for one particular ToolOutput, based on the given toolSessionId. If the tool doesn't have any content * matching the toolSessionId then should return an "empty" but valid set of data. e.g an empty mark would be 0. * Index: lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java,v diff -u -r1.39 -r1.40 --- lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java 2 Jul 2009 13:06:09 -0000 1.39 +++ lams_common/src/java/org/lamsfoundation/lams/tool/service/LamsCoreToolService.java 26 Jul 2009 22:18:59 -0000 1.40 @@ -28,6 +28,7 @@ import java.util.List; import java.util.Set; import java.util.SortedMap; +import java.util.TreeSet; import org.apache.log4j.Logger; import org.lamsfoundation.lams.learningdesign.Activity; @@ -395,6 +396,79 @@ } /** + * This method should be called to filter out definitions that are not supported. Currently used only in Data Flow + * between tools, when a receiving tool declares which Tool Output classes it supports. + * + * @param outputToolContentId + * @param definitionType + * @param inputToolContentId + * @return + * @throws ToolException + */ + public SortedMap getOutputDefinitionsFromToolFiltered(Long outputToolContentId, + int definitionType, Long inputToolContentId) throws ToolException { + SortedMap definitions = getOutputDefinitionsFromTool(outputToolContentId, + definitionType); + ToolContent toolContent = (ToolContent) toolContentDAO.find(ToolContent.class, inputToolContentId); + if (toolContent == null) { + String error = "The toolContentID " + inputToolContentId + + " is not valid. No such record exists on the database."; + LamsCoreToolService.log.error(error); + throw new DataMissingException(error); + } + + Tool tool = toolContent.getTool(); + if (tool == null) { + String error = "The tool for toolContentId " + inputToolContentId + " is missing."; + LamsCoreToolService.log.error(error); + throw new DataMissingException(error); + } + + try { + ToolContentManager contentManager = (ToolContentManager) findToolService(tool); + + Class[] supportedClasses = contentManager.getSupportedToolOutputDefinitionClasses(definitionType); + if (supportedClasses != null) { + Set keysToRemove = new TreeSet(); + for (String key : definitions.keySet()) { + ToolOutputDefinition value = definitions.get(key); + Class valueClass = value.getValueClass(); + boolean matchFound = false; + if (valueClass != null) { + for (Class supportedClass : supportedClasses) { + // we take into account also superclasses + if (supportedClass.isAssignableFrom(valueClass)) { + matchFound = true; + break; + } + } + } + if (!matchFound) { + keysToRemove.add(key); + } + } + + for (String key : keysToRemove) { + definitions.remove(key); + } + } + return definitions; + } catch (NoSuchBeanDefinitionException e) { + String message = "A tool which is defined in the database appears to missing from the classpath. Unable to get the tool output definitions. ToolContentId " + + inputToolContentId; + LamsCoreToolService.log.error(message, e); + throw new ToolException(message, e); + } catch (java.lang.AbstractMethodError e) { + String message = "Tool " + + tool.getToolDisplayName() + + " doesn't support the getSupportedToolOutputDefinitionClasses(definitionType) method so no output definitions can be accessed."; + LamsCoreToolService.log.error(message, e); + throw new ToolException(message, e); + } + + } + + /** * Ask a tool for one particular ToolOutput, based on the given toolSessionId. If the tool doesn't have any content * matching the toolSessionId then should return an "empty" but valid set of data. e.g an empty mark would be 0. * Index: lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java,v diff -u -r1.17 -r1.18 --- lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java 2 Jul 2009 13:01:30 -0000 1.17 +++ lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/service/AssessmentServiceImpl.java 26 Jul 2009 22:18:18 -0000 1.18 @@ -1173,4 +1173,8 @@ public List getMonitorsByToolSessionId(Long sessionId) { return getLessonService().getMonitorsByToolSessionId(sessionId); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getAssessmentOutputFactory().getSupportedDefinitionClasses(definitionType); + } } Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatOutputFactory.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatOutputFactory.java,v diff -u -r1.4 -r1.5 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatOutputFactory.java 2 Jul 2009 13:01:20 -0000 1.4 +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatOutputFactory.java 26 Jul 2009 22:20:08 -0000 1.5 @@ -54,8 +54,10 @@ public SortedMap getToolOutputDefinitions(Object toolContentObject, int definitionType) throws ToolException { SortedMap definitionMap = new TreeMap(); + Class stringArrayClass = new String[] {}.getClass(); if (toolContentObject != null) { - ToolOutputDefinition chatMessagesDefinition = buildComplexOutputDefinition(ChatConstants.TEXT_SEARCH_DEFINITION_NAME); + ToolOutputDefinition chatMessagesDefinition = buildComplexOutputDefinition( + ChatConstants.TEXT_SEARCH_DEFINITION_NAME, stringArrayClass); Chat chat = (Chat) toolContentObject; // adding all existing conditions chatMessagesDefinition.setDefaultConditions(new ArrayList(chat.getConditions())); Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java,v diff -u -r1.52 -r1.53 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java 2 Jul 2009 13:01:20 -0000 1.52 +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java 26 Jul 2009 22:20:08 -0000 1.53 @@ -1133,5 +1133,8 @@ } } + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getChatOutputFactory().getSupportedDefinitionClasses(definitionType); + } // ========================================================================================= } Index: lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java,v diff -u -r1.10 -r1.11 --- lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java 2 Jul 2009 13:03:37 -0000 1.10 +++ lams_tool_daco/src/java/org/lamsfoundation/lams/tool/daco/service/DacoServiceImpl.java 26 Jul 2009 22:20:32 -0000 1.11 @@ -913,4 +913,8 @@ public void setDacoOutputFactory(DacoOutputFactory dacoOutputFactory) { this.dacoOutputFactory = dacoOutputFactory; } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getDacoOutputFactory().getSupportedDefinitionClasses(definitionType); + } } \ No newline at end of file Index: lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/service/DimdimService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/service/DimdimService.java,v diff -u -r1.16 -r1.17 --- lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/service/DimdimService.java 2 Jul 2009 13:04:30 -0000 1.16 +++ lams_tool_dimdim/src/java/org/lamsfoundation/lams/tool/dimdim/service/DimdimService.java 26 Jul 2009 22:18:48 -0000 1.17 @@ -782,4 +782,8 @@ public void setRepositoryService(IRepositoryService repositoryService) { this.repositoryService = repositoryService; } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return null; + } } Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumOutputFactory.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumOutputFactory.java,v diff -u -r1.7 -r1.8 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumOutputFactory.java 3 Jul 2009 05:36:28 -0000 1.7 +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumOutputFactory.java 26 Jul 2009 22:20:42 -0000 1.8 @@ -62,8 +62,10 @@ throws ToolException { SortedMap definitionMap = new TreeMap(); + Class answersClass = (new HashMap>()).getClass(); if (toolContentObject != null) { - ToolOutputDefinition chosenTopicAnswersDefinition = buildComplexOutputDefinition(ForumConstants.TEXT_SEARCH_DEFINITION_NAME); + ToolOutputDefinition chosenTopicAnswersDefinition = buildComplexOutputDefinition( + ForumConstants.TEXT_SEARCH_DEFINITION_NAME, answersClass); Forum forum = (Forum) toolContentObject; // adding all existing conditions chosenTopicAnswersDefinition.setDefaultConditions(new ArrayList(forum.getConditions())); Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java,v diff -u -r1.101 -r1.102 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java 3 Jul 2009 05:36:28 -0000 1.101 +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java 26 Jul 2009 22:20:42 -0000 1.102 @@ -1357,4 +1357,7 @@ timestampDao.saveOrUpdate(timestamp); } + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getForumOutputFactory().getSupportedDefinitionClasses(definitionType); + } } \ No newline at end of file Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapService.java,v diff -u -r1.17 -r1.18 --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapService.java 2 Jul 2009 13:04:12 -0000 1.17 +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapService.java 26 Jul 2009 22:17:33 -0000 1.18 @@ -546,7 +546,7 @@ NodeList list = document.getElementsByTagName("marker"); for (int i = 0; i < list.getLength(); i++) { - NamedNodeMap markerNode = (list.item(i)).getAttributes(); + NamedNodeMap markerNode = list.item(i).getAttributes(); Long uid = Long.parseLong(markerNode.getNamedItem("markerUID").getNodeValue()); String markerTitle = markerNode.getNamedItem("title").getNodeValue(); @@ -773,4 +773,8 @@ public void updateEntry(NotebookEntry notebookEntry) { coreNotebookService.updateEntry(notebookEntry); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return null; + } } Index: lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java,v diff -u -r1.19 -r1.20 --- lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java 2 Jul 2009 13:00:12 -0000 1.19 +++ lams_tool_images/src/java/org/lamsfoundation/lams/tool/imageGallery/service/ImageGalleryServiceImpl.java 26 Jul 2009 22:19:27 -0000 1.20 @@ -1219,4 +1219,7 @@ return userContribution; } + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getImageGalleryOutputFactory().getSupportedDefinitionClasses(definitionType); + } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java,v diff -u -r1.104 -r1.105 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java 2 Jul 2009 13:02:15 -0000 1.104 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/service/McServicePOJO.java 26 Jul 2009 22:21:24 -0000 1.105 @@ -2029,4 +2029,8 @@ this.messageService = messageService; } + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getMcOutputFactory().getSupportedDefinitionClasses(definitionType); + } + } \ No newline at end of file Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaOutputFactory.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaOutputFactory.java,v diff -u -r1.10 -r1.11 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaOutputFactory.java 2 Jul 2009 12:59:36 -0000 1.10 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaOutputFactory.java 26 Jul 2009 22:17:15 -0000 1.11 @@ -25,7 +25,9 @@ import java.util.ArrayList; import java.util.HashSet; +import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; @@ -63,9 +65,12 @@ if (toolContentObject != null) { QaContent qaContent = (QaContent) toolContentObject; // Different definitions are provided, depending how the output will be used + Class stringArrayClass = new String[] {}.getClass(); + Class listOfStringArrayClass = new LinkedList().getClass(); switch (definitionType) { case ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_CONDITION: { - ToolOutputDefinition userAnswersDefinition = buildComplexOutputDefinition(QaAppConstants.USER_ANSWERS_DEFINITION_NAME); + ToolOutputDefinition userAnswersDefinition = buildComplexOutputDefinition( + QaAppConstants.USER_ANSWERS_DEFINITION_NAME, stringArrayClass); // adding all existing conditions userAnswersDefinition.setDefaultConditions(new ArrayList(qaContent.getConditions())); @@ -82,10 +87,12 @@ } break; case ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_DATA_FLOW: { - ToolOutputDefinition groupAnswersDefinition = buildComplexOutputDefinition(QaAppConstants.GROUP_ANSWERS_DEFINITION_NAME); + ToolOutputDefinition groupAnswersDefinition = buildComplexOutputDefinition( + QaAppConstants.GROUP_ANSWERS_DEFINITION_NAME, listOfStringArrayClass); definitionMap.put(QaAppConstants.GROUP_ANSWERS_DEFINITION_NAME, groupAnswersDefinition); - ToolOutputDefinition questionsDefinition = buildComplexOutputDefinition(QaAppConstants.QUESTIONS_DEFINITION_NAME); + ToolOutputDefinition questionsDefinition = buildComplexOutputDefinition( + QaAppConstants.QUESTIONS_DEFINITION_NAME, stringArrayClass); definitionMap.put(QaAppConstants.QUESTIONS_DEFINITION_NAME, questionsDefinition); } break; @@ -171,48 +178,66 @@ QaContent qaContent = session.getQaContent(); Set questions = qaContent.getQaQueContents(); Set users = session.getQaQueUsers(); - String[] answers = new String[questions.size() * users.size()]; - int answerCount = 0; - for (QaQueContent question : questions) { - int userIndex = 0; - for (QaQueUsr user : users) { - List attempts = null; - if (user != null) { - attempts = qaService.getAttemptsForUserAndQuestionContent(user.getUid(), question.getUid()); - } - if (attempts != null && !attempts.isEmpty()) { - // only the last attempt is taken into consideration - String answer = attempts.get(attempts.size() - 1).getAnswer(); - if (!StringUtils.isBlank(answer)) { - // check for duplicate answers - boolean duplicate = false; - for (String previousAnswer : answers) { - if (answer.equalsIgnoreCase(previousAnswer)) { - duplicate = true; - break; + String[] dummyStringArray = new String[] {}; + + // answers sorted by time of adding, so "usersAndAnswers" has the newest answers at the beginning + Map timeAndAnswers = new TreeMap(); + for (QaQueUsr user : users) { + if (user != null) { + List answers = new LinkedList(); + long lastAttemptTime = Long.MAX_VALUE; + for (QaQueContent question : questions) { + + List attempts = qaService.getAttemptsForUserAndQuestionContent(user.getUid(), + question.getUid()); + + if (attempts != null && !attempts.isEmpty()) { + // only the last attempt is taken into consideration + QaUsrResp attempt = attempts.get(attempts.size() - 1); + // we get the time of the attempt - the "lastAttemptTime" will the time of the whole answer + // set given + long timeOfAttempt = attempt.getAttemptTime().getTime(); + if (timeOfAttempt < lastAttemptTime) { + lastAttemptTime = timeOfAttempt; + } + + String answer = attempt.getAnswer(); + if (!StringUtils.isBlank(answer)) { + // check for duplicate answers + boolean duplicate = false; + int questionIndex = question.getDisplayOrder() - 1; + for (String[] previousAnswers : timeAndAnswers.values()) { + for (String previousAnswer : previousAnswers) { + if (answer.equalsIgnoreCase(previousAnswer)) { + duplicate = true; + break; + } + } } + + if (!duplicate) { + answers.add(answer); + } } - if (!duplicate) { - answers[question.getDisplayOrder() - 1 + userIndex * questions.size()] = answer; - answerCount++; - } } } - userIndex++; - } - } - if (answerCount < answers.length) { - String[] trimmedAnswers = new String[answerCount]; - int answerIndex = 0; - for (String answer : answers) { - if (answer != null) { - trimmedAnswers[answerIndex++] = answer; + if (!answers.isEmpty()) { + while (timeAndAnswers.containsKey(lastAttemptTime)) { + lastAttemptTime--; + } + timeAndAnswers.put(lastAttemptTime, answers.toArray(dummyStringArray)); } } - answers = trimmedAnswers; } + String[][] usersAndAnswers = new String[timeAndAnswers.size()][]; + int userIndex = 0; + for (Long key : timeAndAnswers.keySet()) { + usersAndAnswers[userIndex] = timeAndAnswers.get(key); + userIndex++; + } - return new ToolOutput(name, getI18NText(QaAppConstants.GROUP_ANSWERS_DEFINITION_NAME, true), answers, false); + return new ToolOutput(name, getI18NText(QaAppConstants.GROUP_ANSWERS_DEFINITION_NAME, true), + usersAndAnswers, false); } else if (QaAppConstants.QUESTIONS_DEFINITION_NAME.equals(nameParts[0])) { // Questions asked in this Q&A activity QaSession session = qaService.retrieveQaSession(toolSessionId); Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java,v diff -u -r1.89 -r1.90 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 2 Jul 2009 12:59:37 -0000 1.89 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/service/QaServicePOJO.java 26 Jul 2009 22:17:15 -0000 1.90 @@ -765,7 +765,8 @@ fromContent = qaDAO.loadQaById(fromContentId.longValue()); } if (fromContentId.equals(defaultContentId) && fromContent != null && fromContent.getConditions().isEmpty()) { - fromContent.getConditions().add(getQaOutputFactory().createDefaultComplexUserAnswersCondition(fromContent)); + fromContent.getConditions().add( + getQaOutputFactory().createDefaultComplexUserAnswersCondition(fromContent)); } QaContent toContent = QaContent.newInstance(qaToolContentHandler, fromContent, toContentId); if (toContent == null) { @@ -1013,7 +1014,8 @@ long defaultToolContentId = toolService.getToolDefaultContentIdBySignature(QaAppConstants.MY_SIGNATURE); toolContentObj = retrieveQa(defaultToolContentId); if (toolContentObj != null && toolContentObj.getConditions().isEmpty()) { - toolContentObj.getConditions().add(getQaOutputFactory().createDefaultComplexUserAnswersCondition(toolContentObj)); + toolContentObj.getConditions().add( + getQaOutputFactory().createDefaultComplexUserAnswersCondition(toolContentObj)); } } if (toolContentObj == null) { @@ -1856,4 +1858,8 @@ public void removeQuestionsFromCache(QaContent qaContent) { qaDAO.removeQuestionsFromCache(qaContent); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getQaOutputFactory().getSupportedDefinitionClasses(definitionType); + } } \ No newline at end of file Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java,v diff -u -r1.61 -r1.62 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java 2 Jul 2009 13:03:47 -0000 1.61 +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/service/ResourceServiceImpl.java 26 Jul 2009 22:19:58 -0000 1.62 @@ -1300,4 +1300,8 @@ public List getMonitorsByToolSessionId(Long sessionId) { return getLessonService().getMonitorsByToolSessionId(sessionId); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return null; + } } \ No newline at end of file Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java,v diff -u -r1.7 -r1.8 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java 2 Jul 2009 13:03:27 -0000 1.7 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapService.java 26 Jul 2009 22:18:09 -0000 1.8 @@ -971,4 +971,8 @@ public MessageService getMindmapMessageService() { return mindmapMessageService; } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getMindmapOutputFactory().getSupportedDefinitionClasses(definitionType); + } } Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/NoticeboardServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/NoticeboardServicePOJO.java,v diff -u -r1.44 -r1.45 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/NoticeboardServicePOJO.java 2 Jul 2009 13:00:33 -0000 1.44 +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/service/NoticeboardServicePOJO.java 26 Jul 2009 22:18:27 -0000 1.45 @@ -691,7 +691,7 @@ try { if ((originalNb = retrieveNoticeboard(fromContentId)) == null) // the id given does not have content, use - // default content + // default content { // use default content id to grab contents NoticeboardContent defaultContent = retrieveNoticeboard(getToolDefaultContentIdBySignature(NoticeboardConstants.TOOL_SIGNATURE)); @@ -1113,4 +1113,8 @@ public void updateEntry(NotebookEntry notebookEntry) { coreNotebookService.updateEntry(notebookEntry); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return null; + } } \ No newline at end of file Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java,v diff -u -r1.22 -r1.23 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java 2 Jul 2009 13:03:57 -0000 1.22 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java 26 Jul 2009 22:21:19 -0000 1.23 @@ -664,4 +664,8 @@ public boolean isGroupedActivity(long toolContentID) { return toolService.isGroupedActivity(toolContentID); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getNotebookOutputFactory().getSupportedDefinitionClasses(definitionType); + } } \ No newline at end of file Index: lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/service/PixlrService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/service/PixlrService.java,v diff -u -r1.6 -r1.7 --- lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/service/PixlrService.java 2 Jul 2009 13:00:02 -0000 1.6 +++ lams_tool_pixlr/src/java/org/lamsfoundation/lams/tool/pixlr/service/PixlrService.java 26 Jul 2009 22:18:39 -0000 1.7 @@ -763,4 +763,8 @@ public void setRepositoryService(IRepositoryService repositoryService) { this.repositoryService = repositoryService; } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getPixlrOutputFactory().getSupportedDefinitionClasses(definitionType); + } } Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java,v diff -u -r1.81 -r1.82 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java 23 Jul 2009 04:45:52 -0000 1.81 +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/service/SubmitFilesService.java 26 Jul 2009 22:19:36 -0000 1.82 @@ -27,7 +27,6 @@ import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Comparator; @@ -184,8 +183,7 @@ /** * (non-Javadoc) * - * @see org.lamsfoundation.lams.tool.ToolContentManager#copyToolContent(java.lang.Long, - * java.lang.Long) + * @see org.lamsfoundation.lams.tool.ToolContentManager#copyToolContent(java.lang.Long, java.lang.Long) */ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { if (toContentId == null) { @@ -227,9 +225,8 @@ } /** - * If the toolContentID does not exist, then get default tool content id - * from tool core and initialize a emtpy SubmitFilesContent - * return. + * If the toolContentID does not exist, then get default tool content id from tool core and initialize a emtpy + * SubmitFilesContent return. * * @param toolContentId * @return @@ -294,8 +291,7 @@ } /** - * Export the XML fragment for the tool's content, along with any files - * needed for the content. + * Export the XML fragment for the tool's content, along with any files needed for the content. * * @throws ExportToolContentException */ @@ -360,14 +356,12 @@ } /** - * Get the definitions for possible output for an activity, based on the - * toolContentId. These may be definitions that are always available for the - * tool (e.g. number of marks for Multiple Choice) or a custom definition - * created for a particular activity such as the answer to the third - * question contains the word Koala and hence the need for the toolContentId + * Get the definitions for possible output for an activity, based on the toolContentId. These may be definitions + * that are always available for the tool (e.g. number of marks for Multiple Choice) or a custom definition created + * for a particular activity such as the answer to the third question contains the word Koala and hence the need for + * the toolContentId * - * @return SortedMap of ToolOutputDefinitions with the key being the name of - * each definition + * @return SortedMap of ToolOutputDefinitions with the key being the name of each definition */ public SortedMap getToolOutputDefinitions(Long toolContentId, int definitionType) throws ToolException { @@ -413,12 +407,11 @@ } /** - * This method verifies the credentials of the SubmitFiles Tool and gives it - * the Ticket to login and access the Content Repository. + * 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. + * 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 @@ -439,13 +432,13 @@ } /** - * This method deletes the content with the given uuid and - * versionID from the content repository + * This method deletes the content with the given uuid and versionID from the content + * repository * * @param uuid - * The uuid of the node to be deleted + * The uuid of the node to be deleted * @param versionID - * The version_id of the node to be deleted. + * The version_id of the node to be deleted. * @throws SubmitFilesException */ public void deleteFromRepository(Long uuid, Long versionID) throws SubmitFilesException { @@ -584,9 +577,8 @@ /** * Get the tool output for the given tool output names. * - * @see - * org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.util - * .List, java.lang.Long, java.lang.Long) + * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.util .List, java.lang.Long, + * java.lang.Long) */ public SortedMap getToolOutput(List names, Long toolSessionId, Long learnerId) { return new TreeMap(); @@ -595,8 +587,8 @@ /** * Get the tool output for the given tool output name. * - * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.lang.String, - * java.lang.Long, java.lang.Long) + * @see org.lamsfoundation.lams.tool.ToolSessionManager#getToolOutput(java.lang.String, java.lang.Long, + * java.lang.Long) */ public ToolOutput getToolOutput(String name, Long toolSessionId, Long learnerId) { return null; @@ -605,8 +597,7 @@ /** * (non-Javadoc) * - * @see org.lamsfoundation.lams.tool.ToolSessionManager# - * uploadFileToContent(Long,FormFile ) + * @see org.lamsfoundation.lams.tool.ToolSessionManager# uploadFileToContent(Long,FormFile ) */ public InstructionFiles uploadFileToContent(Long contentID, FormFile uploadFile, String fileType) throws SubmitFilesException { @@ -628,8 +619,7 @@ /** * (non-Javadoc) * - * @see org.lamsfoundation.lams.tool.ToolSessionManager# - * uploadFileToSession(Long,FormFile,String,Long ) + * @see org.lamsfoundation.lams.tool.ToolSessionManager# uploadFileToSession(Long,FormFile,String,Long ) */ public void uploadFileToSession(Long sessionID, FormFile uploadFile, String fileDescription, Integer userID) throws SubmitFilesException { @@ -721,9 +711,8 @@ } /** - * This method save SubmissionDetails list into a map container: key is user - * id, value is a list container, which contains all - * FileDetailsDTO object belong to this user. + * This method save SubmissionDetails list into a map container: key is user id, value is a list container, which + * contains all FileDetailsDTO object belong to this user. */ public SortedMap getFilesUploadedBySession(Long sessionID, Locale currentLocale) { List list = submissionDetailsDAO.getSubmissionDetailsBySession(sessionID); @@ -771,40 +760,42 @@ return submitUserDAO.getUsersBySession(sessionID); } - public void updateMarks(Long reportID, Float marks, String comments, FormFile markFile) throws InvalidParameterException, RepositoryCheckedException { + public void updateMarks(Long reportID, Float marks, String comments, FormFile markFile) + throws InvalidParameterException, RepositoryCheckedException { - IToolContentHandler toolContentHandler = getSbmtToolContentHandler(); - SubmitFilesReport report = submitFilesReportDAO.getReportByID(reportID); - if (report != null) { - report.setComments(comments); - report.setMarks(marks); - - // If there is a new file, delete the existing and add the mark file - if (markFile != null && !StringUtils.isEmpty(markFile.getFileName())) { - - // Delete the existing - if (report.getMarkFileUUID() != null) { - toolContentHandler.deleteFile(report.getMarkFileUUID()); - report.setMarkFileName(null); - report.setMarkFileUUID(null); - report.setMarkFileVersionID(null); - } - - // Add the new file - NodeKey nodeKey = this.processFile(markFile, IToolContentHandler.TYPE_ONLINE); - //NodeKey nodeKey = toolContentHandler.uploadFile(marksFileInputStream, marksFileName, null, IToolContentHandler.TYPE_ONLINE); + IToolContentHandler toolContentHandler = getSbmtToolContentHandler(); + SubmitFilesReport report = submitFilesReportDAO.getReportByID(reportID); + if (report != null) { + report.setComments(comments); + report.setMarks(marks); - report.setMarkFileName(markFile.getFileName()); - report.setMarkFileUUID(nodeKey.getUuid()); - report.setMarkFileVersionID(nodeKey.getVersion()); + // If there is a new file, delete the existing and add the mark file + if (markFile != null && !StringUtils.isEmpty(markFile.getFileName())) { + + // Delete the existing + if (report.getMarkFileUUID() != null) { + toolContentHandler.deleteFile(report.getMarkFileUUID()); + report.setMarkFileName(null); + report.setMarkFileUUID(null); + report.setMarkFileVersionID(null); } - - submitFilesReportDAO.update(report); + + // Add the new file + NodeKey nodeKey = this.processFile(markFile, IToolContentHandler.TYPE_ONLINE); + // NodeKey nodeKey = toolContentHandler.uploadFile(marksFileInputStream, marksFileName, null, + // IToolContentHandler.TYPE_ONLINE); + + report.setMarkFileName(markFile.getFileName()); + report.setMarkFileUUID(nodeKey.getUuid()); + report.setMarkFileVersionID(nodeKey.getVersion()); } - + + submitFilesReportDAO.update(report); + } + } - - public void removeMarkFile (Long reportID, Long markFileUUID, Long markFileVersionID) { + + public void removeMarkFile(Long reportID, Long markFileUUID, Long markFileVersionID) { SubmitFilesReport report = submitFilesReportDAO.getReportByID(reportID); if (report != null) { deleteFromRepository(markFileUUID, markFileVersionID); @@ -1022,8 +1013,7 @@ } /** - * Set the description, throws away the title value as this is not supported - * in 2.0 + * Set the description, throws away the title value as this is not supported in 2.0 */ public void setReflectiveData(Long toolContentId, String title, String description) throws ToolException, DataMissingException { @@ -1093,31 +1083,31 @@ /** * @param submitFilesContentDAO - * The submitFilesContentDAO to set. + * The submitFilesContentDAO to set. */ public void setSubmitFilesContentDAO(ISubmitFilesContentDAO submitFilesContentDAO) { this.submitFilesContentDAO = submitFilesContentDAO; } /** * @param submitFilesReportDAO - * The submitFilesReportDAO to set. + * The submitFilesReportDAO to set. */ public void setSubmitFilesReportDAO(ISubmitFilesReportDAO submitFilesReportDAO) { this.submitFilesReportDAO = submitFilesReportDAO; } /** * @param submitFilesSessionDAO - * The submitFilesSessionDAO to set. + * The submitFilesSessionDAO to set. */ public void setSubmitFilesSessionDAO(ISubmitFilesSessionDAO submitFilesSessionDAO) { this.submitFilesSessionDAO = submitFilesSessionDAO; } /** * @param submissionDetailsDAO - * The submissionDetailsDAO to set. + * The submissionDetailsDAO to set. */ public void setSubmissionDetailsDAO(ISubmissionDetailsDAO submissionDetailsDAO) { this.submissionDetailsDAO = submissionDetailsDAO; @@ -1132,7 +1122,7 @@ /** * @param sbmtToolContentHandler - * The sbmtToolContentHandler to set. + * The sbmtToolContentHandler to set. */ public void setSbmtToolContentHandler(IToolContentHandler sbmtToolContentHandler) { this.sbmtToolContentHandler = sbmtToolContentHandler; @@ -1147,7 +1137,7 @@ /** * @param learnerDAO - * The learnerDAO to set. + * The learnerDAO to set. */ public void setSubmitUserDAO(ISubmitUserDAO learnerDAO) { submitUserDAO = learnerDAO; @@ -1232,4 +1222,9 @@ public void setGradebookService(IGradebookService gradebookService) { this.gradebookService = gradebookService; } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return null; + + } } \ No newline at end of file Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java,v diff -u -r1.23 -r1.24 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java 2 Jul 2009 13:00:42 -0000 1.23 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/service/ScribeService.java 26 Jul 2009 22:17:51 -0000 1.24 @@ -704,4 +704,8 @@ public void deleteHeading(Long headingUid) { scribeHeadingDAO.deleteById(ScribeHeading.class, headingUid); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return null; + } } \ No newline at end of file Index: lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java,v diff -u -r1.5 -r1.6 --- lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java 2 Jul 2009 13:03:05 -0000 1.5 +++ lams_tool_spreadsheet/src/java/org/lamsfoundation/lams/tool/spreadsheet/service/SpreadsheetServiceImpl.java 26 Jul 2009 22:20:52 -0000 1.6 @@ -909,4 +909,7 @@ this.coreNotebookService = coreNotebookService; } + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return null; + } } Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyOutputFactory.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyOutputFactory.java,v diff -u -r1.8 -r1.9 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyOutputFactory.java 2 Jul 2009 13:00:24 -0000 1.8 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyOutputFactory.java 26 Jul 2009 22:19:46 -0000 1.9 @@ -58,8 +58,10 @@ public SortedMap getToolOutputDefinitions(Object toolContentObject, int definitionType) throws ToolException { SortedMap definitionMap = new TreeMap(); + Class stringArrayClass = new String[] {}.getClass(); if (toolContentObject != null) { - ToolOutputDefinition allAnswersDefinition = buildComplexOutputDefinition(SurveyConstants.TEXT_SEARCH_DEFINITION_NAME); + ToolOutputDefinition allAnswersDefinition = buildComplexOutputDefinition( + SurveyConstants.TEXT_SEARCH_DEFINITION_NAME, stringArrayClass); Survey survey = (Survey) toolContentObject; // adding all existing conditions allAnswersDefinition.setDefaultConditions(new ArrayList(survey.getConditions())); @@ -127,9 +129,9 @@ if (isTextSearchConditionName(name)) { // user answers are loaded from the DB and array of strings is created - //Survey survey = surveyService.getSurveyBySessionId(toolSessionId); - //Set questions = survey.getQuestions(); - //String[] textAnswers = new String[questions.size()]; + // Survey survey = surveyService.getSurveyBySessionId(toolSessionId); + // Set questions = survey.getQuestions(); + // String[] textAnswers = new String[questions.size()]; String[] textAnswers = null; List answersList = new ArrayList(); SurveyUser user = surveyService.getUserByIDAndSession(learnerId, toolSessionId); @@ -139,12 +141,13 @@ SurveyAnswer surveyAnswer = answerDTO.getAnswer(); if (surveyAnswer != null) { // check for optional questions SurveyQuestion question = surveyAnswer.getSurveyQuestion(); - if (question.getType() == SurveyConstants.QUESTION_TYPE_TEXT_ENTRY) + if (question.getType() == SurveyConstants.QUESTION_TYPE_TEXT_ENTRY) { answersList.add(surveyAnswer.getAnswerText()); + } } } } - textAnswers = (String[]) answersList.toArray(new String [answersList.size()]); + textAnswers = answersList.toArray(new String[answersList.size()]); return new ToolOutput(name, getI18NText(SurveyConstants.TEXT_SEARCH_DEFINITION_NAME, true), textAnswers, false); } Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java,v diff -u -r1.27 -r1.28 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java 2 Jul 2009 13:00:24 -0000 1.27 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/service/SurveyServiceImpl.java 26 Jul 2009 22:19:46 -0000 1.28 @@ -1160,4 +1160,8 @@ public void deleteCondition(SurveyCondition condition) { surveyDao.deleteCondition(condition); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getSurveyOutputFactory().getSupportedDefinitionClasses(definitionType); + } } \ No newline at end of file Index: lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java,v diff -u -r1.27 -r1.28 --- lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java 2 Jul 2009 13:04:20 -0000 1.27 +++ lams_tool_task/src/java/org/lamsfoundation/lams/tool/taskList/service/TaskListServiceImpl.java 26 Jul 2009 22:17:42 -0000 1.28 @@ -1299,4 +1299,8 @@ throw new TaskListException("Login failed." + e.getMessage()); } } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getTaskListOutputFactory().getSupportedDefinitionClasses(definitionType); + } } 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.8 -r1.9 --- lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java 2 Jul 2009 13:04:03 -0000 1.8 +++ lams_tool_videorecorder/src/java/org/lamsfoundation/lams/tool/videoRecorder/service/VideoRecorderService.java 26 Jul 2009 22:18:01 -0000 1.9 @@ -961,4 +961,8 @@ public String getMessage(String key) { return messageService.getMessage(key); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getVideoRecorderOutputFactory().getSupportedDefinitionClasses(definitionType); + } } \ No newline at end of file Index: lams_tool_vote/build.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/build.properties,v diff -u -r1.14 -r1.15 --- lams_tool_vote/build.properties 9 Dec 2008 05:38:14 -0000 1.14 +++ lams_tool_vote/build.properties 26 Jul 2009 22:21:11 -0000 1.15 @@ -4,7 +4,7 @@ signature=lavote11 #project version -tool.version=20081203 +tool.version=20090726 # hide tool option hideTool=false Index: lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/Attic/VoteContent.hbm.xml,v diff -u -r1.10 -r1.11 --- lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml 2 Jul 2009 13:02:04 -0000 1.10 +++ lams_tool_vote/conf/hibernate/mappings/org/lamsfoundation/lams/tool/vote/VoteContent.hbm.xml 26 Jul 2009 22:21:11 -0000 1.11 @@ -166,6 +166,21 @@ column="assigned_data_flow_object" length="1" /> + + + + getToolOutputDefinitions(Object toolContentObject, int definitionType) { - - TreeMap definitionMap = new TreeMap(); + protected static final String OUTPUT_NAME_NOMINATION_SELECTION = "learner.selection"; + protected static final int FREE_TEXT_NOM_SELECTION = 0; + protected static final String FREE_TEXT_NOM_SELECTION_STR = "0"; - if ( toolContentObject != null ) { + /** + * @see org.lamsfoundation.lams.tool.OutputDefinitionFactory#getToolOutputDefinitions(java.lang.Object) + */ + @Override + public SortedMap getToolOutputDefinitions(Object toolContentObject, int definitionType) { - VoteContent content = (VoteContent) toolContentObject; - - if ( content.getMaxNominationCount() != null && ! content.getMaxNominationCount().equals("1") ) { - log.error("Unable to build output definitions for Voting if the user can have more than one nomination. Vote "+content); - } else { - - ToolOutputDefinition definition = buildBooleanSetOutputDefinition(OUTPUT_NAME_NOMINATION_SELECTION); - if ( definition.getDefaultConditions() == null ) - definition.setDefaultConditions(new ArrayList()); - - List defaultConditions = definition.getDefaultConditions(); - String trueString = Boolean.TRUE.toString(); - int conditionOrderId = 1; - - if ( content.isAllowText() ) { - defaultConditions.add(new BranchCondition(null, null, new Integer(conditionOrderId++), - buildConditionName(OUTPUT_NAME_NOMINATION_SELECTION,FREE_TEXT_NOM_SELECTION_STR), - getI18NText("label.open.vote", false), - OutputType.OUTPUT_BOOLEAN.toString(), - null, - null, - trueString)); - } - - Iterator iter = content.getVoteQueContents().iterator(); - while ( iter.hasNext() ) { - VoteQueContent nomination = (VoteQueContent) iter.next(); - int displayOrder = nomination.getDisplayOrder(); - String name = buildConditionName(OUTPUT_NAME_NOMINATION_SELECTION,new Integer(displayOrder).toString()); - defaultConditions.add(new BranchCondition(null, null, new Integer(conditionOrderId++), name, - VoteUtils.stripHTML(nomination.getQuestion()), - OutputType.OUTPUT_BOOLEAN.toString(), - null, - null, - trueString)); - } - definition.setShowConditionNameOnly(Boolean.TRUE); + TreeMap definitionMap = new TreeMap(); - definitionMap.put(OUTPUT_NAME_NOMINATION_SELECTION, definition); - } - } else { - log.error("Unable to build output definitions for Vote as no tool content object supplied."); + if (toolContentObject != null) { + + VoteContent content = (VoteContent) toolContentObject; + + if (content.getMaxNominationCount() != null && !content.getMaxNominationCount().equals("1")) { + log + .error("Unable to build output definitions for Voting if the user can have more than one nomination. Vote " + + content); + } else { + + ToolOutputDefinition definition = buildBooleanSetOutputDefinition(VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION); + if (definition.getDefaultConditions() == null) { + definition.setDefaultConditions(new ArrayList()); } - return definitionMap; - } + List defaultConditions = definition.getDefaultConditions(); + String trueString = Boolean.TRUE.toString(); + int conditionOrderId = 1; - public SortedMap getToolOutput(List names, IVoteService voteService, Long toolSessionId, Long learnerId) { - - TreeMap output = null; - if ( names == null ) { - output = createAllDisplayOrderOutputs(voteService, toolSessionId, learnerId); - } else { - output = new TreeMap(); - for ( String name: names) { - ToolOutput newOutput = getToolOutput(name, voteService, toolSessionId, learnerId); - if ( newOutput != null ) - output.put(name, newOutput); - } + if (content.isAllowText()) { + defaultConditions.add(new BranchCondition(null, null, new Integer(conditionOrderId++), + buildConditionName(VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION, + VoteOutputFactory.FREE_TEXT_NOM_SELECTION_STR), getI18NText("label.open.vote", + false), OutputType.OUTPUT_BOOLEAN.toString(), null, null, trueString)); } - return output; + + Iterator iter = content.getVoteQueContents().iterator(); + while (iter.hasNext()) { + VoteQueContent nomination = (VoteQueContent) iter.next(); + int displayOrder = nomination.getDisplayOrder(); + String name = buildConditionName(VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION, new Integer( + displayOrder).toString()); + defaultConditions.add(new BranchCondition(null, null, new Integer(conditionOrderId++), name, + VoteUtils.stripHTML(nomination.getQuestion()), OutputType.OUTPUT_BOOLEAN.toString(), null, + null, trueString)); + } + definition.setShowConditionNameOnly(Boolean.TRUE); + + definitionMap.put(VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION, definition); + } + } else { + log.error("Unable to build output definitions for Vote as no tool content object supplied."); } - public ToolOutput getToolOutput(String name, IVoteService voteService, Long toolSessionId, Long learnerId) { - if ( name != null && name.startsWith(OUTPUT_NAME_NOMINATION_SELECTION)) { - VoteSession session = voteService.findVoteSessionById(toolSessionId); - VoteQueUsr queUser = voteService.getVoteUserBySession(learnerId, session.getUid()); + return definitionMap; + } - return new ToolOutput(name, getI18NText(OUTPUT_NAME_NOMINATION_SELECTION, true), checkDisplayOrderOfVoteQueContent(name, queUser)); + public SortedMap getToolOutput(List names, IVoteService voteService, + Long toolSessionId, Long learnerId) { + + TreeMap output = null; + if (names == null) { + output = createAllDisplayOrderOutputs(voteService, toolSessionId, learnerId); + } else { + output = new TreeMap(); + for (String name : names) { + ToolOutput newOutput = getToolOutput(name, voteService, toolSessionId, learnerId); + if (newOutput != null) { + output.put(name, newOutput); } - return null; + } } - - /** - * Check the display order embedded in the condition name. The name MUST start with OUTPUT_NAME_NOMINATION_SELECTION. - */ - private boolean checkDisplayOrderOfVoteQueContent(String name, VoteQueUsr queUser) { - - String[] dcNames = splitConditionName(name); - if ( dcNames[1] == null || dcNames[1].length() == 0) { - log.error("Unable to convert the display order to an int for tool output "+ OUTPUT_NAME_NOMINATION_SELECTION+". Returning false. Name doesn't contain the display order. Condition name was: "+name); - return false; - } + return output; + } - int displayOrder = 0; - try { - displayOrder = new Integer(dcNames[1]).intValue(); - } catch ( NumberFormatException e) { - log.error("Unable to convert the display order to an int for tool output "+ OUTPUT_NAME_NOMINATION_SELECTION+". Returning false. Number format exception thrown. Condition name was: "+name,e); - return false; + public ToolOutput getToolOutput(String name, IVoteService voteService, Long toolSessionId, Long learnerId) { + if (name != null && name.startsWith(VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION)) { + VoteSession session = voteService.findVoteSessionById(toolSessionId); + VoteQueUsr queUser = voteService.getVoteUserBySession(learnerId, session.getUid()); + + return new ToolOutput(name, getI18NText(VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION, true), + checkDisplayOrderOfVoteQueContent(name, queUser)); + } + return null; + } + + /** + * Check the display order embedded in the condition name. The name MUST start with + * OUTPUT_NAME_NOMINATION_SELECTION. + */ + private boolean checkDisplayOrderOfVoteQueContent(String name, VoteQueUsr queUser) { + + String[] dcNames = splitConditionName(name); + if (dcNames[1] == null || dcNames[1].length() == 0) { + log.error("Unable to convert the display order to an int for tool output " + + VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION + + ". Returning false. Name doesn't contain the display order. Condition name was: " + name); + return false; + } + + int displayOrder = 0; + try { + displayOrder = new Integer(dcNames[1]).intValue(); + } catch (NumberFormatException e) { + log.error("Unable to convert the display order to an int for tool output " + + VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION + + ". Returning false. Number format exception thrown. Condition name was: " + name, e); + return false; + } + + if (queUser != null) { + Set voteAttempts = queUser.getVoteUsrAttempts(); + if (voteAttempts.size() > 0) { + if (voteAttempts.size() > 1) { + log + .error("Attempting to match on nomination, but more than one nomination selected for this user. Will try to match on the given display order. User " + + queUser); } - - if ( queUser != null ) { - Set voteAttempts = queUser.getVoteUsrAttempts(); - if ( voteAttempts.size() > 0 ) { - if ( voteAttempts.size() > 1) - log.error("Attempting to match on nomination, but more than one nomination selected for this user. Will try to match on the given display order. User "+queUser); - Iterator iter = voteAttempts.iterator(); - while ( iter.hasNext() ) { - VoteUsrAttempt attempt = (VoteUsrAttempt) iter.next(); - if ( attempt.getVoteQueContentId().longValue() == 1 && displayOrder == FREE_TEXT_NOM_SELECTION) { - // VoteQueContentId == 1 indicates that it is a free text entry - return true; - } else { - VoteQueContent nomination = attempt.getVoteQueContent(); - if (nomination.getDisplayOrder() == displayOrder ) - return true; - } - } + Iterator iter = voteAttempts.iterator(); + while (iter.hasNext()) { + VoteUsrAttempt attempt = (VoteUsrAttempt) iter.next(); + if (attempt.getVoteQueContentId().longValue() == 1 + && displayOrder == VoteOutputFactory.FREE_TEXT_NOM_SELECTION) { + // VoteQueContentId == 1 indicates that it is a free text entry + return true; + } else { + VoteQueContent nomination = attempt.getVoteQueContent(); + if (nomination.getDisplayOrder() == displayOrder) { + return true; } + } } - return false; + } } + return false; + } - /** - * Check the display order embedded in the condition name. The name MUST start with OUTPUT_NAME_NOMINATION_SELECTION. - */ - private TreeMap createAllDisplayOrderOutputs(IVoteService voteService, Long toolSessionId, Long learnerId) { - - TreeMap output = null; + /** + * Check the display order embedded in the condition name. The name MUST start with + * OUTPUT_NAME_NOMINATION_SELECTION. + */ + private TreeMap createAllDisplayOrderOutputs(IVoteService voteService, Long toolSessionId, + Long learnerId) { - VoteSession session = voteService.findVoteSessionById(toolSessionId); - VoteContent content = session.getVoteContent(); - VoteQueUsr queUser = voteService.getVoteUserBySession(learnerId, session.getUid()); - String i18nDescription = getI18NText(OUTPUT_NAME_NOMINATION_SELECTION, true); - - // create a false condition for all of them to start with, then create a true for the ones that are correct. - if ( content.isAllowText() ) { - boolean found = false; - if ( queUser != null ) { - Set voteAttempts = queUser.getVoteUsrAttempts(); - Iterator iter = voteAttempts.iterator(); - while ( iter.hasNext() && !found ) { - VoteUsrAttempt attempt = (VoteUsrAttempt) iter.next(); - found = ( attempt.getVoteQueContentId().longValue() == 1 ); - } - } - String name = buildConditionName(OUTPUT_NAME_NOMINATION_SELECTION,FREE_TEXT_NOM_SELECTION_STR); - output.put(name, new ToolOutput(name, i18nDescription, found)); + TreeMap output = null; + + VoteSession session = voteService.findVoteSessionById(toolSessionId); + VoteContent content = session.getVoteContent(); + VoteQueUsr queUser = voteService.getVoteUserBySession(learnerId, session.getUid()); + String i18nDescription = getI18NText(VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION, true); + + // create a false condition for all of them to start with, then create a true for the ones that are correct. + if (content.isAllowText()) { + boolean found = false; + if (queUser != null) { + Set voteAttempts = queUser.getVoteUsrAttempts(); + Iterator iter = voteAttempts.iterator(); + while (iter.hasNext() && !found) { + VoteUsrAttempt attempt = (VoteUsrAttempt) iter.next(); + found = attempt.getVoteQueContentId().longValue() == 1; } - - Iterator contentIter = content.getVoteQueContents().iterator(); - while ( contentIter.hasNext() ) { - VoteQueContent nomination = (VoteQueContent) contentIter.next(); - int displayOrder = nomination.getDisplayOrder(); - String name = buildConditionName(OUTPUT_NAME_NOMINATION_SELECTION,new Integer(displayOrder).toString()); - boolean found = false; - if ( queUser != null ) { - Set voteAttempts = queUser.getVoteUsrAttempts(); - Iterator iter = voteAttempts.iterator(); - while ( iter.hasNext() && !found ) { - VoteUsrAttempt attempt = (VoteUsrAttempt) iter.next(); - found = ( attempt.getVoteQueContent().getDisplayOrder() == displayOrder ); - } - } - output.put(name, new ToolOutput(name, i18nDescription, found)); - } + } + String name = buildConditionName(VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION, + VoteOutputFactory.FREE_TEXT_NOM_SELECTION_STR); + output.put(name, new ToolOutput(name, i18nDescription, found)); + } - return output; + Iterator contentIter = content.getVoteQueContents().iterator(); + while (contentIter.hasNext()) { + VoteQueContent nomination = (VoteQueContent) contentIter.next(); + int displayOrder = nomination.getDisplayOrder(); + String name = buildConditionName(VoteOutputFactory.OUTPUT_NAME_NOMINATION_SELECTION, new Integer( + displayOrder).toString()); + boolean found = false; + if (queUser != null) { + Set voteAttempts = queUser.getVoteUsrAttempts(); + Iterator iter = voteAttempts.iterator(); + while (iter.hasNext() && !found) { + VoteUsrAttempt attempt = (VoteUsrAttempt) iter.next(); + found = attempt.getVoteQueContent().getDisplayOrder() == displayOrder; + } + } + output.put(name, new ToolOutput(name, i18nDescription, found)); } + return output; + } + @Override + public Class[] getSupportedDefinitionClasses(int definitionType) { + if (ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_DATA_FLOW == definitionType) { + // currently array of strings and array of arrays of strings are supported + Class stringArrayClass = String[].class; + + Class arrayOfStringArrays = String[][].class; + return new Class[] { stringArrayClass, arrayOfStringArrays }; + } + return super.getSupportedDefinitionClasses(definitionType); + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java,v diff -u -r1.66 -r1.67 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 2 Jul 2009 13:02:03 -0000 1.66 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java 26 Jul 2009 22:21:10 -0000 1.67 @@ -2214,4 +2214,8 @@ public List getDataFlowObjects(Long toolContentId) { return dataFlowDAO.getDataFlowObjectsByToolContentId(toolContentId); } + + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getVoteOutputFactory().getSupportedDefinitionClasses(definitionType); + } } \ No newline at end of file Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java,v diff -u -r1.22 -r1.23 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java 2 Jul 2009 13:02:04 -0000 1.22 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java 26 Jul 2009 22:21:10 -0000 1.23 @@ -661,6 +661,8 @@ String showResults = request.getParameter("showResults"); + String maxInputs = request.getParameter("maxInputs"); + String reflect = request.getParameter(VoteAppConstants.REFLECT); AuthoringUtil.logger.debug("reflect: " + reflect); @@ -689,6 +691,7 @@ boolean allowTextBoolean = false; boolean reflectBoolean = false; boolean showResultsBoolean = false; + short maxInputsShort = 0; if (lockOnFinish != null && lockOnFinish.equalsIgnoreCase("1")) { lockedOnFinishBoolean = true; @@ -706,6 +709,10 @@ showResultsBoolean = true; } + if (!"0".equals(maxInputs)) { + maxInputsShort = Short.parseShort(maxInputs); + } + long userId = 0; if (toolUser != null) { userId = toolUser.getUserID().longValue(); @@ -758,6 +765,7 @@ voteContent.setMaxNominationCount(maxNomcount); voteContent.setOnlineInstructions(richTextOnlineInstructions); voteContent.setOfflineInstructions(richTextOfflineInstructions); + voteContent.setMaxInputs(maxInputsShort); } voteContent.setAssignedDataFlowObject(assignedDataFlowObject != null); @@ -1329,14 +1337,6 @@ voteContent.setReflectionSubject(reflectionSubject); } - // If we use tool input, we clear any existing user created nominations - if (assignedDataFlowObject == null) { - voteContent.setAssignedDataFlowObject(true); - voteContent.setVoteQueContents(null); - } else { - voteContent.setAssignedDataFlowObject(false); - } - if (newContent) { AuthoringUtil.logger.debug("will create: " + voteContent); voteService.createVote(voteContent); @@ -1349,9 +1349,7 @@ AuthoringUtil.logger.debug("voteContent: " + voteContent); - if (!voteContent.getAssignedDataFlowObject()) { - voteContent = createQuestionContent(mapQuestionContent, mapFeedback, voteService, voteContent); - } + voteContent = createQuestionContent(mapQuestionContent, mapFeedback, voteService, voteContent); voteService.saveDataFlowObjectAssigment(assignedDataFlowObject); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/Attic/LearningUtil.java,v diff -u -r1.21 -r1.22 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java 2 Jul 2009 13:02:04 -0000 1.21 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java 26 Jul 2009 22:21:10 -0000 1.22 @@ -72,12 +72,13 @@ Map mapQuestionsContent = new TreeMap(new VoteComparator()); Set nominations = voteContent.getVoteQueContents(); if (Boolean.TRUE.equals(voteContent.getAssignedDataFlowObject()) - && (nominations == null || nominations.isEmpty())) { - // If we are using tool input rather that previously defined nominations, we need to get this input now and + && !Boolean.TRUE.equals(voteContent.getDataFlowObjectUsed())) { + // If we are using tool input, we need to get it now and // create questions. Once they are created, they will be not altered, no matter if another learner gets to // this point and the tool input changed createQuestionsFromToolInput(voteContent, voteService); nominations = voteContent.getVoteQueContents(); + voteContent.setDataFlowObjectUsed(true); } Iterator contentIterator = nominations.iterator(); @@ -324,18 +325,54 @@ ToolOutput toolInput = voteService.getToolInput(voteContent.getVoteContentId(), VoteUtils.getUserId() .intValue()); Object value = toolInput.getValue().getComplex(); - // If the input is array of strings, it's pretty straightforward - if (value instanceof String[]) { - String[] stringList = (String[]) value; - voteContent.getVoteQueContents().clear(); - for (int nominationIndex = 1; nominationIndex <= stringList.length; nominationIndex++) { + // The input is an array (users) of arrays of strings (their answers) + if (value instanceof String[][]) { + if (value != null) { + String[][] usersAndAnswers = (String[][]) value; + int nominationIndex = voteContent.getVoteQueContents().size() + 1; + Short maxInputs = voteContent.getMaxInputs(); + short inputCount = 0; + for (String[] userAnswers : usersAndAnswers) { + if (userAnswers != null) { + if (maxInputs != null && maxInputs > 0 && inputCount >= maxInputs) { + // if we reached the maximum number of inputs, i.e. number of students that will be taken + // into + // account + break; + } + boolean anyAnswersAdded = false; + for (String questionText : userAnswers) { + if (questionText != null) { + VoteQueContent nomination = new VoteQueContent(); + nomination.setDisplayOrder(nominationIndex); + nomination.setMcContent(voteContent); + nomination.setQuestion(questionText); + voteService.saveOrUpdateVoteQueContent(nomination); + voteContent.getVoteQueContents().add(nomination); + nominationIndex++; + anyAnswersAdded = true; + } + } + if (anyAnswersAdded) { + inputCount++; + } + } + } + } + } else if (value instanceof String[]) { + // the input is a list of strings (questions, for example) + int nominationIndex = voteContent.getVoteQueContents().size() + 1; + String[] userAnswers = (String[]) value; + for (String questionText : userAnswers) { VoteQueContent nomination = new VoteQueContent(); nomination.setDisplayOrder(nominationIndex); nomination.setMcContent(voteContent); - nomination.setQuestion(stringList[nominationIndex - 1]); + nomination.setQuestion(questionText); voteService.saveOrUpdateVoteQueContent(nomination); voteContent.getVoteQueContents().add(nomination); + nominationIndex++; } + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java,v diff -u -r1.39 -r1.40 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 2 Jul 2009 13:02:04 -0000 1.39 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 26 Jul 2009 22:21:10 -0000 1.40 @@ -757,6 +757,13 @@ VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); voteAuthoringForm.setOnlineInstructions(onlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); + + String maxInputs = request.getParameter(VoteAppConstants.MAX_INPUTS); + VoteAction.logger.debug("maxInputs: " + maxInputs); + if (maxInputs == null) { + maxInputs = "0"; + } + voteAuthoringForm.setMaxInputs(new Short(maxInputs)); } /** @@ -1783,7 +1790,9 @@ ActionMessages errors = new ActionMessages(); VoteAction.logger.debug("mapNominationContent size: " + mapNominationContent.size()); - if (mapNominationContent.size() == 0) { + if (mapNominationContent.size() == 0 + && (voteAuthoringForm.getAssignedDataFlowObject() == null || voteAuthoringForm + .getAssignedDataFlowObject() == 0)) { ActionMessage error = new ActionMessage("nominations.none.submitted"); errors.add(ActionMessages.GLOBAL_MESSAGE, error); } @@ -1825,6 +1834,8 @@ VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); + DataFlowObject assignedDataFlowObject = null; + VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { List attachmentListBackup = new ArrayList(); @@ -1855,6 +1866,28 @@ voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); + List dataFlowObjects = voteService.getDataFlowObjects(new Long(strToolContentID)); + List dataFlowObjectNames = null; + if (dataFlowObjects != null) { + dataFlowObjectNames = new ArrayList(dataFlowObjects.size()); + int objectIndex = 1; + for (DataFlowObject dataFlowObject : dataFlowObjects) { + dataFlowObjectNames.add(dataFlowObject.getDisplayName()); + if (VoteAppConstants.DATA_FLOW_OBJECT_ASSIGMENT_ID.equals(dataFlowObject.getToolAssigmentId())) { + voteAuthoringForm.setAssignedDataFlowObject(objectIndex); + } + objectIndex++; + + } + + } + + voteGeneralAuthoringDTO.setDataFlowObjectNames(dataFlowObjectNames); + + if (voteAuthoringForm.getAssignedDataFlowObject() != null + && voteAuthoringForm.getAssignedDataFlowObject() != 0) { + assignedDataFlowObject = dataFlowObjects.get(voteAuthoringForm.getAssignedDataFlowObject() - 1); + } } voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); @@ -1897,12 +1930,6 @@ authoringUtil.removeRedundantNominations(mapNominationContent, voteService, voteAuthoringForm, request, strToolContentID); VoteAction.logger.debug("end of removing unused entries... "); - DataFlowObject assignedDataFlowObject = null; - if (voteAuthoringForm.getAssignedDataFlowObject() != null - && voteAuthoringForm.getAssignedDataFlowObject() != 0) { - List dataFlowObjects = voteService.getDataFlowObjects(new Long(strToolContentID)); - assignedDataFlowObject = dataFlowObjects.get(voteAuthoringForm.getAssignedDataFlowObject() - 1); - } voteContent = authoringUtil.saveOrUpdateVoteContent(mapNominationContent, mapFeedback, voteService, voteAuthoringForm, request, voteContentTest, strToolContentID, assignedDataFlowObject); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/Attic/VoteAuthoringForm.java,v diff -u -r1.21 -r1.22 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java 2 Jul 2009 13:02:04 -0000 1.21 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java 26 Jul 2009 22:21:10 -0000 1.22 @@ -124,6 +124,7 @@ private String editQuestionBoxRequest; protected Integer assignedDataFlowObject; + private Short maxInputs; public Integer getAssignedDataFlowObject() { return assignedDataFlowObject; @@ -209,6 +210,8 @@ submit = null; submissionAttempt = null; sbmtSuccess = null; + + maxInputs = 0; } public void resetRadioBoxes() { @@ -1170,4 +1173,12 @@ public void setShowResults(String showResults) { this.showResults = showResults; } + + public Short getMaxInputs() { + return maxInputs; + } + + public void setMaxInputs(Short maxInputs) { + this.maxInputs = maxInputs; + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java,v diff -u -r1.36 -r1.37 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java 2 Jul 2009 13:02:04 -0000 1.36 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java 26 Jul 2009 22:21:10 -0000 1.37 @@ -548,6 +548,12 @@ voteAuthoringForm.setOfflineInstructions(voteContent.getOfflineInstructions()); voteAuthoringForm.setOnlineInstructions(voteContent.getOnlineInstructions()); + Short maxInputs = voteContent.getMaxInputs(); + if (maxInputs == null) { + maxInputs = 0; + } + voteAuthoringForm.setMaxInputs(maxInputs); + if (voteContent.getOnlineInstructions() == null || voteContent.getOnlineInstructions().length() == 0) { voteGeneralAuthoringDTO.setRichTextOnlineInstructions(VoteAppConstants.DEFAULT_ONLINE_INST); voteAuthoringForm.setOnlineInstructions(VoteAppConstants.DEFAULT_ONLINE_INST); Index: lams_tool_vote/web/authoring/AdvancedContent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/authoring/AdvancedContent.jsp,v diff -u -r1.25 -r1.26 --- lams_tool_vote/web/authoring/AdvancedContent.jsp 26 Mar 2008 04:08:48 -0000 1.25 +++ lams_tool_vote/web/authoring/AdvancedContent.jsp 26 Jul 2009 22:21:10 -0000 1.26 @@ -50,6 +50,21 @@

+ +

+ + + + + + + ${index} + + +

+
+

Index: lams_tool_vote/web/authoring/AuthoringMaincontent.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/web/authoring/AuthoringMaincontent.jsp,v diff -u -r1.32 -r1.33 --- lams_tool_vote/web/authoring/AuthoringMaincontent.jsp 8 Jun 2007 01:43:32 -0000 1.32 +++ lams_tool_vote/web/authoring/AuthoringMaincontent.jsp 26 Jul 2009 22:21:10 -0000 1.33 @@ -48,7 +48,8 @@ @@ -137,23 +129,23 @@

- ');" + ');" class="button-add-item"> ');" + href="showMessage('');" class="button-add-item"> - + ${dataFlowObject} Index: lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java,v diff -u -r1.13 -r1.14 --- lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java 2 Jul 2009 13:02:55 -0000 1.13 +++ lams_tool_wiki/src/java/org/lamsfoundation/lams/tool/wiki/service/WikiService.java 26 Jul 2009 22:20:19 -0000 1.14 @@ -48,7 +48,6 @@ 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.RepositoryProxy; import org.lamsfoundation.lams.contentrepository.service.SimpleCredentials; import org.lamsfoundation.lams.events.IEventNotificationService; import org.lamsfoundation.lams.learning.service.ILearnerService; @@ -150,8 +149,8 @@ * java.lang.Long) */ public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException { - if (logger.isDebugEnabled()) { - logger.debug("entering method createToolSession:" + " toolSessionId = " + toolSessionId + if (WikiService.logger.isDebugEnabled()) { + WikiService.logger.debug("entering method createToolSession:" + " toolSessionId = " + toolSessionId + " toolSessionName = " + toolSessionName + " toolContentId = " + toolContentId); } @@ -273,9 +272,9 @@ */ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { - if (logger.isDebugEnabled()) { - logger.debug("entering method copyToolContent:" + " fromContentId=" + fromContentId + " toContentId=" - + toContentId); + if (WikiService.logger.isDebugEnabled()) { + WikiService.logger.debug("entering method copyToolContent:" + " fromContentId=" + fromContentId + + " toContentId=" + toContentId); } if (toContentId == null) { @@ -514,8 +513,8 @@ retBuf.append(""); } } - logger.debug("Result:"); - logger.debug(retBuf); + WikiService.logger.debug("Result:"); + WikiService.logger.debug(retBuf); return retBuf.toString(); } @@ -529,7 +528,7 @@ toolContentId = new Long(toolService.getToolDefaultContentIdBySignature(toolSignature)); if (toolContentId == null) { String error = "Could not retrieve default content id for this tool"; - logger.error(error); + WikiService.logger.error(error); throw new WikiException(error); } return toolContentId; @@ -545,7 +544,7 @@ Wiki defaultContent = getWikiByContentId(defaultContentID); if (defaultContent == null) { String error = "Could not retrieve default content record for this tool"; - logger.error(error); + WikiService.logger.error(error); throw new WikiException(error); } return defaultContent; @@ -560,7 +559,7 @@ if (newContentID == null) { String error = "Cannot copy the Wiki tools default content: + " + "newContentID is null"; - logger.error(error); + WikiService.logger.error(error); throw new WikiException(error); } @@ -611,15 +610,15 @@ public Wiki getWikiByContentId(Long toolContentID) { Wiki wiki = wikiDAO.getByContentId(toolContentID); if (wiki == null) { - logger.debug("Could not find the content with toolContentID:" + toolContentID); + WikiService.logger.debug("Could not find the content with toolContentID:" + toolContentID); } return wiki; } public WikiSession getSessionBySessionId(Long toolSessionId) { WikiSession wikiSession = wikiSessionDAO.getBySessionId(toolSessionId); if (wikiSession == null) { - logger.debug("Could not find the wiki session with toolSessionID:" + toolSessionId); + WikiService.logger.debug("Could not find the wiki session with toolSessionID:" + toolSessionId); } return wikiSession; } @@ -939,7 +938,7 @@ public void setReflectiveData(Long toolContentId, String title, String description) throws ToolException, DataMissingException { - logger + WikiService.logger .warn("Setting the reflective field on a wiki. This doesn't make sense as the wiki is for reflection and we don't reflect on reflection!"); Wiki wiki = getWikiByContentId(toolContentId); if (wiki == null) { @@ -1093,4 +1092,7 @@ this.repositoryService = repositoryService; } + public Class[] getSupportedToolOutputDefinitionClasses(int definitionType) { + return getWikiOutputFactory().getSupportedDefinitionClasses(definitionType); + } }