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.2 -r1.3 --- lams_common/src/java/org/lamsfoundation/lams/tool/OutputFactory.java 15 Jan 2008 02:21:20 -0000 1.2 +++ lams_common/src/java/org/lamsfoundation/lams/tool/OutputFactory.java 26 Mar 2008 06:23:37 -0000 1.3 @@ -169,45 +169,46 @@ /** Generic method for building a tool output definition. It will get the definition's description * from the I18N file 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) { + protected ToolOutputDefinition buildDefinition(String definitionName, OutputType type, Object startValue, Object endValue, Object complexValue, Boolean showConditionNameOnly) { ToolOutputDefinition definition = new ToolOutputDefinition(); definition.setName(definitionName); definition.setDescription(getDescription(definitionName)); definition.setType(type); definition.setStartValue( startValue ); definition.setEndValue( endValue ); definition.setComplexDefinition( complexValue ); + definition.setShowConditionNameOnly( showConditionNameOnly ); return definition; } /** Build a tool definition designed for a range of integer 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, Long startValue, Long endValue) { - return buildDefinition(definitionName, OutputType.OUTPUT_LONG, startValue, endValue, null); + return buildDefinition(definitionName, OutputType.OUTPUT_LONG, startValue, endValue, null, Boolean.FALSE); } /** 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); + return buildDefinition(definitionName, OutputType.OUTPUT_STRING, startValue, endValue, null, Boolean.FALSE); } /** Build a tool definition designed for a single double value, which is likely to be a statistic number of * questions answered * It will get the definition's description from the I18N file using the getDescription() method and * set the type to OUTPUT_LONG. */ protected ToolOutputDefinition buildLongOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_LONG, null, null, null); + return buildDefinition(definitionName, OutputType.OUTPUT_LONG, null, null, null, Boolean.FALSE); } /** Build a tool definition designed for a single double value, which is likely to be a statistic such as average * number of posts. * It will get the definition's description from the I18N file using the getDescription() method and * set the type to OUTPUT_DOUBLE. */ protected ToolOutputDefinition buildDoubleOutputDefinition(String definitionName) { - return buildDefinition(definitionName, OutputType.OUTPUT_DOUBLE, null, null, null); + return buildDefinition(definitionName, OutputType.OUTPUT_DOUBLE, null, null, null, Boolean.FALSE); } /** Build a tool definition designed for a single boolean value, which is likely to be a test such as @@ -216,7 +217,7 @@ * true and false conditions. The code will automatically look for two strings in the I18N file * output.desc..true and output.desc..false */ protected ToolOutputDefinition buildBooleanOutputDefinition(String definitionName) { - ToolOutputDefinition definition = buildDefinition(definitionName, OutputType.OUTPUT_BOOLEAN, null, null, null); + ToolOutputDefinition definition = buildDefinition(definitionName, OutputType.OUTPUT_BOOLEAN, null, null, null, Boolean.FALSE); List defaultConditions = new ArrayList(); defaultConditions.add(new BranchCondition(null, null, new Integer(1), definitionName, @@ -236,14 +237,14 @@ * It will get the definition's description from the 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); + return buildDefinition(definitionName, OutputType.OUTPUT_STRING, null, null, null, Boolean.FALSE); } /** 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); + return buildDefinition(definitionName, OutputType.OUTPUT_COMPLEX, null, null, null, Boolean.FALSE); } } 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.3 -r1.4 --- lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java 15 Jan 2008 02:21:20 -0000 1.3 +++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputDefinition.java 26 Mar 2008 06:23:37 -0000 1.4 @@ -61,6 +61,7 @@ private Object startValue; private Object endValue; private Object complexDefinition; + private Boolean showConditionNameOnly; private List defaultConditions; /** Name must be unique within the current tool content. This will be used to identify the output. @@ -163,6 +164,16 @@ public void setDefaultConditions(List defaultConditions) { this.defaultConditions = defaultConditions; } + /** + * Should Flash show the definition of the branch conditions (e.g. Range from blah to blah) or just the name of the condition. + * Set to true if the definition relates to an internal parameter and will mean nothing to the user + */ + public Boolean isShowConditionNameOnly() { + return showConditionNameOnly; + } + public void setShowConditionNameOnly(Boolean showConditionNameOnly) { + this.showConditionNameOnly = showConditionNameOnly; + } } Index: lams_common/src/java/org/lamsfoundation/lams/tool/dto/ToolOutputDefinitionDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/tool/dto/ToolOutputDefinitionDTO.java,v diff -u -r1.5 -r1.6 --- lams_common/src/java/org/lamsfoundation/lams/tool/dto/ToolOutputDefinitionDTO.java 15 Jan 2008 02:21:21 -0000 1.5 +++ lams_common/src/java/org/lamsfoundation/lams/tool/dto/ToolOutputDefinitionDTO.java 26 Mar 2008 06:23:37 -0000 1.6 @@ -46,9 +46,10 @@ private String startValue; private String endValue; private String complexDefinition; + private Boolean showConditionNameOnly; private ArrayList defaultConditions; - public ToolOutputDefinitionDTO(String name, String description, String type, String startValue, String endValue, String complexDefinition) { + public ToolOutputDefinitionDTO(String name, String description, String type, String startValue, String endValue, String complexDefinition, Boolean showConditionNameOnly) { super(); this.name = name; this.description = description; @@ -58,6 +59,8 @@ this.endValue = endValue; this.complexDefinition = complexDefinition; + + this.showConditionNameOnly = showConditionNameOnly; } public ToolOutputDefinitionDTO(ToolOutputDefinition definition) { @@ -70,7 +73,8 @@ this.endValue = (definition.getEndValue() != null) ? definition.getEndValue().toString() : null; this.complexDefinition = (definition.getComplexDefinition() != null) ? definition.getComplexDefinition().toString() : null; - + + this.showConditionNameOnly = definition.isShowConditionNameOnly(); if ( definition.getDefaultConditions() != null && definition.getDefaultConditions().size() > 0 ) { defaultConditions = new ArrayList(); for ( BranchCondition condition : definition.getDefaultConditions() ) { @@ -135,6 +139,13 @@ this.defaultConditions = defaultConditions; } + public Boolean getShowConditionNameOnly() { + return showConditionNameOnly; + } + public void setShowConditionNameOnly(Boolean showConditionNameOnly) { + this.showConditionNameOnly = showConditionNameOnly; + } + public String toString() { return new ToStringBuilder(this) .append("name", name)