();
+ // initialise global script variables
+ JBPMNode companyHome = (JBPMNode)executionContext.getContextInstance().getVariable("companyhome");
+ if (companyHome != null)
+ {
+ NodeRef companyHomeRef = companyHome.getNodeRef();
+ inputMap.put("search", new Search(services, companyHomeRef.getStoreRef(), null));
+ inputMap.put("session", new Session(services, null));
+ inputMap.put("classification", new Classification(services, companyHomeRef.getStoreRef(), null));
+ }
+
// initialise process variables
Token token = executionContext.getToken();
inputMap.put("executionContext", executionContext);
diff --git a/source/java/org/alfresco/service/cmr/repository/NodeService.java b/source/java/org/alfresco/service/cmr/repository/NodeService.java
index 936afe1892..4398cfd981 100644
--- a/source/java/org/alfresco/service/cmr/repository/NodeService.java
+++ b/source/java/org/alfresco/service/cmr/repository/NodeService.java
@@ -30,6 +30,24 @@ import org.alfresco.service.namespace.QNamePattern;
/**
* Interface for public and internal node and store operations.
+ *
+ * Amongst other things, this service must enforce the unique name check as mandated
+ * by the duplicate entity in the model.
+ *
+ *
+ * ...
+ *
+ *
+ * ...
+ * false
+ *
+ *
+ *
+ *
+ * When duplicates are not allowed, and the cm:name property of a node changes,
+ * then the {@link org.alfresco.service.cmr.repository.DuplicateChildNodeNameException}
+ * exception must be thrown. Client code can catch this exception and deal with it
+ * appropriately.
*
* @author Derek Hulley
*/
diff --git a/source/java/org/alfresco/service/cmr/repository/ScriptLocation.java b/source/java/org/alfresco/service/cmr/repository/ScriptLocation.java
new file mode 100644
index 0000000000..b1bbe8bb4d
--- /dev/null
+++ b/source/java/org/alfresco/service/cmr/repository/ScriptLocation.java
@@ -0,0 +1,22 @@
+/**
+ *
+ */
+package org.alfresco.service.cmr.repository;
+
+import java.io.Reader;
+
+/**
+ * Interface encapsulating the location of a script and provding access to it.
+ *
+ * @author Roy Wetherall
+ *
+ */
+public interface ScriptLocation
+{
+ /**
+ * Returns a reader to the contents of the script
+ *
+ * @return the reader
+ */
+ Reader getReader();
+}
diff --git a/source/java/org/alfresco/service/cmr/repository/ScriptService.java b/source/java/org/alfresco/service/cmr/repository/ScriptService.java
index 80112477f7..0338bfa6cb 100644
--- a/source/java/org/alfresco/service/cmr/repository/ScriptService.java
+++ b/source/java/org/alfresco/service/cmr/repository/ScriptService.java
@@ -70,6 +70,20 @@ public interface ScriptService
public Object executeScript(NodeRef scriptRef, QName contentProp, Map model)
throws ScriptException;
+ /**
+ * Process a script against the supplied data model.
+ *
+ * @param scriptLocation object representing the script location
+ * @param model Object model to process script against
+ *
+ * @return output of the script (may be null or any other valid wrapped JavaScript object)
+ *
+ * @throws ScriptException
+ */
+ @Auditable(parameters = {"scriptLocation", "model"})
+ public Object executeScript(ScriptLocation scriptLocation, Map model)
+ throws ScriptException;
+
/**
* Process a script against the supplied data model.
*
diff --git a/source/java/org/alfresco/service/cmr/search/LimitBy.java b/source/java/org/alfresco/service/cmr/search/LimitBy.java
index f275298840..f7831c369b 100644
--- a/source/java/org/alfresco/service/cmr/search/LimitBy.java
+++ b/source/java/org/alfresco/service/cmr/search/LimitBy.java
@@ -7,5 +7,18 @@ package org.alfresco.service.cmr.search;
*/
public enum LimitBy
{
- UNLIMITED, FINAL_SIZE; // NUMBER_OF_PERMISSION_EVALUATIONS
+ /**
+ * The final number of search results is not important.
+ */
+ UNLIMITED,
+ /**
+ * Limit the total number of search results returned after pruning by permissions.
+ */
+ FINAL_SIZE,
+ /**
+ * Limit the number of results that will be passed through for permission checks.
+ * Used internally to prevent excessive permission checking
+ * (see property lucene.query.maxInitialSearchResults).
+ */
+ NUMBER_OF_PERMISSION_EVALUATIONS;
}
\ No newline at end of file