From 350b8883efd340820de6aab40be7334ab9399dae Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 12 Feb 2014 10:12:44 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud) 60032: Merged BRANCHES/DEV/43UIDEV to HEAD-BUG-FIX: This branch contained the Aikau and Surf framework updates implemented during the development hiatus post-4.2 completion. This features the change of Surf from 1.2.0 to Surf 1.2.1 which is for v4.3 releases only. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62260 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/model/shareUiModel.xml | 43 +++++++++++++++++++ pom.xml | 11 ++--- .../org/alfresco/repo/jscript/Search.java | 2 + .../alfresco/repo/jscript/ValueConverter.java | 10 ++++- 4 files changed, 59 insertions(+), 7 deletions(-) diff --git a/config/alfresco/model/shareUiModel.xml b/config/alfresco/model/shareUiModel.xml index d301988b34..e712b3df97 100644 --- a/config/alfresco/model/shareUiModel.xml +++ b/config/alfresco/model/shareUiModel.xml @@ -21,6 +21,49 @@ Surf AMD Page cm:content + + + + Surf Application Type + cm:folder + + + d:text + true + false + + false + + + + d:text + false + false + + false + + + + + + + + Surf Application Instance + cm:folder + + + + false + true + + + surf:applicationType + true + false + + + + diff --git a/pom.xml b/pom.xml index 8983fafe97..294c64d584 100644 --- a/pom.xml +++ b/pom.xml @@ -146,10 +146,11 @@ + - rhino - js - 1.6R7-patched + org.mozilla + rhino + 1.7R4-alfresco-patched org.springframework @@ -373,9 +374,9 @@ - org.freemarker + org.alfresco freemarker - 2.3.18-alfresco-patched-2 + 2.3.20-alfresco-patched org.apache.cxf diff --git a/source/java/org/alfresco/repo/jscript/Search.java b/source/java/org/alfresco/repo/jscript/Search.java index d6087119be..386e62742d 100644 --- a/source/java/org/alfresco/repo/jscript/Search.java +++ b/source/java/org/alfresco/repo/jscript/Search.java @@ -533,6 +533,8 @@ public class Search extends BaseScopableProcessorExtension { Object[] results = null; + // convert values from JS to Java - may contain native JS object such as ConsString etc. + search = new ValueConverter().convertValueForJava(search); if (search instanceof Serializable) { Serializable obj = new ValueConverter().convertValueForRepo((Serializable)search); diff --git a/source/java/org/alfresco/repo/jscript/ValueConverter.java b/source/java/org/alfresco/repo/jscript/ValueConverter.java index b0dcb3e374..47c549f7ac 100644 --- a/source/java/org/alfresco/repo/jscript/ValueConverter.java +++ b/source/java/org/alfresco/repo/jscript/ValueConverter.java @@ -158,11 +158,11 @@ public class ValueConverter } else if (value instanceof ChildAssociation) { - value = ((ChildAssociation)value).getChildAssociationRef(); + value = ((ChildAssociation)value).getChildAssociationRef(); } else if (value instanceof Association) { - value = ((Association)value).getAssociationRef(); + value = ((Association)value).getAssociationRef(); } else if (value instanceof Wrapper) { @@ -275,6 +275,12 @@ public class ValueConverter } value = list; } + else if (value instanceof CharSequence) + { + // Rhino has some interesting internal classes such as ConsString which cannot be cast to String + // but fortunately are instanceof CharSequence so we can toString() them. + value = value.toString(); + } return value; }