Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputValue.java =================================================================== diff -u -rd0b6f213cba1026b0c9fdbdaa5dd44a49eddd3aa -r4cc97e8648ee6ac8effeb8d502875d199f7219f1 --- lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputValue.java (.../ToolOutputValue.java) (revision d0b6f213cba1026b0c9fdbdaa5dd44a49eddd3aa) +++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolOutputValue.java (.../ToolOutputValue.java) (revision 4cc97e8648ee6ac8effeb8d502875d199f7219f1) @@ -20,7 +20,6 @@ * **************************************************************** */ - package org.lamsfoundation.lams.tool; /** @@ -33,7 +32,7 @@ /** * Create a ToolOutputValue based on a Boolean. This will create a value of type OUTPUT_BOOLEAN - * + * * @param val * mandatory */ @@ -44,7 +43,7 @@ /** * Create a ToolOutputValue based on a Long. This will create a value of type OUTPUT_LONG. - * + * * @param val * mandatory */ @@ -55,7 +54,7 @@ /** * Create a ToolOutputValue based on a Integer. This will create a value of type OUTPUT_LONG. - * + * * @param val * mandatory */ @@ -66,7 +65,7 @@ /** * Create a ToolOutputValue based on a Double. This will create a value of type OUTPUT_DOUBLE. - * + * * @param val * mandatory */ @@ -77,7 +76,7 @@ /** * Create a ToolOutputValue based on a Integer. This will create a value of type OUTPUT_DOUBLE. - * + * * @param val * mandatory */ @@ -88,7 +87,7 @@ /** * Create a ToolOutputValue based on a String. This will create a value of type OUTPUT_STRING. - * + * * @param val * mandatory */ @@ -99,7 +98,7 @@ /** * Create a ToolOutputValue based on a String. It tries to convert it to the type defined by the type. - * + * * @throws ToolOutputFormatException * If unable to convert the value to the requested type. * @param val @@ -135,7 +134,7 @@ * Create a Complex ToolOutputValue based on an Object. This will create a value of type OUTPUT_COMPLEX. The * junk parameter is to ensure this method isn't "accidently" in place of one of the other constructors. ie to stop * accidental bugs! - * + * * @param val * mandatory * @param junk @@ -164,12 +163,33 @@ /** * Returns a string representation of the value. Available for any type of output. - * + * * @throws ToolOutputFormatException * If unable to convert the value to a string. */ public String getString() throws ToolOutputFormatException { - return OutputType.OUTPUT_STRING.equals(type) ? (String) value : value.toString(); + switch (type) { + case OUTPUT_STRING: + return (String) value; + case OUTPUT_COMPLEX: + if (value instanceof Object[]) { + Object[] array = (Object[]) value; + StringBuilder result = new StringBuilder("["); + for (Object valuePart : array) { + result.append(valuePart.toString()).append(","); + } + if (array.length > 0) { + result.replace(result.length() - 1, result.length(), "]"); + } else { + result.append("]"); + } + + return result.toString(); + } + return value.toString(); + default: + return value.toString(); + } } /** Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookOutputFactory.java =================================================================== diff -u -r06f1eda511514e2a19e6b2857a3f9d642c03b92a -r4cc97e8648ee6ac8effeb8d502875d199f7219f1 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookOutputFactory.java (.../NotebookOutputFactory.java) (revision 06f1eda511514e2a19e6b2857a3f9d642c03b92a) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookOutputFactory.java (.../NotebookOutputFactory.java) (revision 4cc97e8648ee6ac8effeb8d502875d199f7219f1) @@ -67,6 +67,7 @@ notebookEntryDefinition.setShowConditionNameOnly(true); definitionMap.put(NotebookConstants.USER_ENTRY_DEFINITION_NAME, notebookEntryDefinition); } + break; case ToolOutputDefinition.DATA_OUTPUT_DEFINITION_TYPE_DATA_FLOW: ToolOutputDefinition allUsersEntriesDefinition = buildComplexOutputDefinition( NotebookConstants.ALL_USERS_ENTRIES_DEFINITION_NAME, stringArrayClass);