mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
More fall out from Template/Script refactoring:
- fix to missing annotated service method (caused script command servlet to fail) - spelling mistakes in annotated service method parameters - cleanup in AbstractWebScript Added ValueConverter concept to Template API - similar to JavaScript API ValueConverter, for a consistent mechanism to recursively convert Alfresco node properties to template accessable objects. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5535 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -99,13 +99,14 @@ public class ValueConverter
|
||||
{
|
||||
// recursively convert each value in the collection
|
||||
Collection<Serializable> collection = (Collection<Serializable>)value;
|
||||
Serializable[] array = new Serializable[collection.size()];
|
||||
Object[] array = new Object[collection.size()];
|
||||
int index = 0;
|
||||
for (Serializable obj : collection)
|
||||
{
|
||||
array[index++] = convertValueForScript(services, scope, qname, obj);
|
||||
}
|
||||
value = array;
|
||||
// convert array to a native JavaScript Array
|
||||
value = (Serializable)Context.getCurrentContext().newArray(scope, array);
|
||||
}
|
||||
// simple numbers and strings are wrapped automatically by Rhino
|
||||
|
||||
|
Reference in New Issue
Block a user