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;
}