diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/action.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/action.lib.ftl
deleted file mode 100644
index a82dc36217..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/action.lib.ftl
+++ /dev/null
@@ -1,48 +0,0 @@
-<#import "condition.lib.ftl" as conditionLib/>
-
-<#macro actionJSON action rule>
-{
- "id" : "${action.id}",
- "actionDefinitionName" : "${action.actionDefinitionName}",
- <#if action.title?exists>
- "title" : "${action.title}",
- #if>
- <#if action.description?exists>
- "description" : "${action.description}",
- #if>
- "executeAsync" : "${action.executeAsychronously?string("true", "false")}",
- <#if action.parameterValues?exists>
- "parameterValues" :
- {
- <#list action.parameterValues?keys as parameterKey>
- "${parameterKey}" : "${action.parameterValues[parameterKey]}"
- <#if parameterKey_has_next>,#if>
- #list>
- },
- #if>
- <#if action.actions?exists>
- "actions" :
- {
- <#list action.actions as nestedAction>
- "${nestedAction.id}" : <@actionJSON action=nestedAction rule=rule/>
- <#if nestedAction_has_next>,#if>
- #list>
- },
- #if>
- <#if action.actionConditions?exists>
- "conditions" :
- {
- <#list action.actionConditions as condition>
- "${condition.id}" : <@conditionLib.conditionJSON condition=condition rule=rule/>
- <#if condition_has_next>,#if>
- #list>
- },
- #if>
- <#if action.compensatingAction?exists>
- "compensatingAction" : <@actionJSON action=action.compensatingAction/>,
- #if>
- "url" : "${url.serviceContext + "/api/rules/" + rule.nodeRef.storeRef.protocol + "/"
- + rule.nodeRef.storeRef.identifier + "/" + rule.nodeRef.id + "/actions/"
- + action.id}"
-}
-#macro>
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondef.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondef.get.desc.xml
deleted file mode 100644
index fbceaeb12b..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondef.get.desc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
- Get Action Definition
- Get an action definition given its name
- /api/rules/actiondefs/{actionDefinitionName}
- argument
- user
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondef.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondef.get.json.ftl
deleted file mode 100644
index 0835b86e12..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondef.get.json.ftl
+++ /dev/null
@@ -1,4 +0,0 @@
-<#import "actiondef.lib.ftl" as actionDefLib/>
-
-<@actionDefLib.actionDefJSON actiondef=actiondef/>
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondef.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondef.lib.ftl
deleted file mode 100644
index 24d93f8bd2..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondef.lib.ftl
+++ /dev/null
@@ -1,33 +0,0 @@
-<#import "paramdef.lib.ftl" as paramDefLib/>
-
-<#macro actionDefJSON actiondef>
- <#escape x as jsonUtils.encodeJSONString(x)>
- {
- "name" : "${actiondef.name}",
- <#if actiondef.title?exists>
- "title" : "${actiondef.title}",
- #if>
- <#if actiondef.description?exists>
- "description" : "${actiondef.description}",
- #if>
- "adhocPropertiesAllowed" : "${actiondef.adhocPropertiesAllowed?string("true", "false")}",
- "applicableTypes" :
- [
- <#list actiondef.applicableTypes as applicableType>
- "${applicableType.getLocalName()}"
- <#if applicableType_has_next>,#if>
- #list>
- ],
- <#if actiondef.parameterDefinitions?exists>
- "parameterDefinitions" :
- [
- <#list actiondef.parameterDefinitions as paramDef>
- <@paramDefLib.paramDefJSON paramDef=paramDef/>
- <#if paramDef_has_next>,#if>
- #list>
- ],
- #if>
- "url" : "${url.serviceContext + "/api/rules/actiondefs/" + actiondef.name}"
- }
- #escape>
-#macro>
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondefs.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondefs.get.desc.xml
deleted file mode 100644
index ac02a62d07..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondefs.get.desc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
- Get Action Definitions
- Get the collection of action definitions, optionally scoped by node reference or path
- /api/rules/actiondefs
- /api/node/{store_type}/{store_id}/{id}/actiondefs
- /api/path/{store_type}/{store_id}/{id}/actiondefs
- argument
- user
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondefs.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondefs.get.json.ftl
deleted file mode 100644
index 58ce3fbe19..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actiondefs.get.json.ftl
+++ /dev/null
@@ -1,8 +0,0 @@
-<#import "actiondef.lib.ftl" as actionDefLib/>
-
-[
- <#list actiondefs as actiondef>
- <@actionDefLib.actionDefJSON actiondef=actiondef/>
- <#if actiondef_has_next>,#if>
- #list>
-]
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actionqueue.post.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actionqueue.post.desc.xml
deleted file mode 100644
index f8b9e58c86..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actionqueue.post.desc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
- Add to Action Queue
- Add an Action Queue Item to the Action Queue for execution
- /api/actionqueue
- argument
- user
- required
-
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actionqueue.post.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actionqueue.post.json.ftl
deleted file mode 100644
index ca79ae0516..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actionqueue.post.json.ftl
+++ /dev/null
@@ -1,3 +0,0 @@
-<#import "actionqueueitemstatus.lib.ftl" as actionQItemStatusLib/>
-
-<@actionQItemStatusLib.actionQItemStatusJSON actionQItemStatus=actionQItemStatus/>
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actionqueueitemstatus.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actionqueueitemstatus.lib.ftl
deleted file mode 100644
index 9c337a12c3..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/actionqueueitemstatus.lib.ftl
+++ /dev/null
@@ -1,11 +0,0 @@
-<#macro actionQItemStatusJSON actionQItemStatus>
- <#escape x as jsonUtils.encodeJSONString(x)>
- {
- "actionQueueItemStatusUrl" : "${url.serviceContext + "/api/actionqueue/items/"
- + actionQItemStatus.actionQueueItemId + "/status"}",
- "actionQueueItemId" : "{actionQItemStatus.actionQueueItemId}",
- "status" : "${actionQItemStatus.status}",
- "actionId" : "${actionQItemStatus.actionId}"
- }
- #escape>
-#macro>
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/condition.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/condition.lib.ftl
deleted file mode 100644
index 384ded2747..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/condition.lib.ftl
+++ /dev/null
@@ -1,17 +0,0 @@
-<#macro conditionJSON condition rule>
-{
- "id" : "${condition.id}",
- "conditionDefinitionName" : "${condition.actionConditionDefinitionName}",
- "invertCondition" : "${condition.invertCondition?string("true", "false")}",
- "parameterValues" :
- {
- <#list condition.parameterValues?keys as parameterKey>
- "${parameterKey}" : "${condition.parameterValues[parameterKey]}"
- <#if parameterKey_has_next>,#if>
- #list>
- },
- "url" : "${url.serviceContext + "/api/rules/" + rule.nodeRef.storeRef.protocol + "/"
- + rule.nodeRef.storeRef.identifier + "/" + rule.nodeRef.id + "/conditions/"
- + condition.id}"
- }
-#macro>
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondef.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondef.get.desc.xml
deleted file mode 100644
index 1720a92ad8..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondef.get.desc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
- Get Condition Definition
- Get a condition definition given its name
- /api/rules/conditiondefs/{conditionDefinitionName}
- argument
- user
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondef.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondef.get.json.ftl
deleted file mode 100644
index bac65e023c..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondef.get.json.ftl
+++ /dev/null
@@ -1,4 +0,0 @@
-<#import "conditiondef.lib.ftl" as conditionDefLib/>
-
-<@conditionDefLib.conditionDefJSON conditiondef=conditiondef/>
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondef.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondef.lib.ftl
deleted file mode 100644
index e902d7c35f..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondef.lib.ftl
+++ /dev/null
@@ -1,26 +0,0 @@
-<#import "paramdef.lib.ftl" as paramDefLib/>
-
-<#macro conditionDefJSON conditiondef>
- <#escape x as jsonUtils.encodeJSONString(x)>
- {
- "name" : "${conditiondef.name}",
- <#if conditiondef.title?exists>
- "title" : "${conditiondef.title}",
- #if>
- <#if conditiondef.description?exists>
- "description" : "${conditiondef.description}",
- #if>
- "adhocPropertiesAllowed" : "${conditiondef.adhocPropertiesAllowed?string("true", "false")}",
- <#if conditiondef.parameterDefinitions?exists>
- "parameterDefinitions" :
- [
- <#list conditiondef.parameterDefinitions as paramDef>
- <@paramDefLib.paramDefJSON paramDef=paramDef/>
- <#if paramDef_has_next>,#if>
- #list>
- ],
- #if>
- "url" : "${url.serviceContext + "/api/rules/conditiondefs/" + conditiondef.name}"
- }
- #escape>
-#macro>
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondefs.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondefs.get.desc.xml
deleted file mode 100644
index 1413d7b3cb..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondefs.get.desc.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
- Get Condition Definitions
- Get the collection of condition definitions
- /api/rules/conditiondefs
- argument
- user
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondefs.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondefs.get.json.ftl
deleted file mode 100644
index 296f33a61d..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/conditiondefs.get.json.ftl
+++ /dev/null
@@ -1,8 +0,0 @@
-<#import "conditiondef.lib.ftl" as conditionDefLib/>
-
-[
- <#list conditiondefs as conditiondef>
- <@conditionDefLib.conditionDefJSON conditiondef=conditiondef/>
- <#if conditiondef_has_next>,#if>
- #list>
-]
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/paramdef.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/paramdef.lib.ftl
deleted file mode 100644
index 16121763ff..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/paramdef.lib.ftl
+++ /dev/null
@@ -1,12 +0,0 @@
-<#macro paramDefJSON paramDef>
-{
- "name" : "${paramDef.name}",
- <#if paramDef.displayLabel?exists>
- "displayLabel" : "${paramDef.displayLabel}",
- #if>
- "type" : "${paramDef.type}",
- "multiValued" : ${paramDef.multiValued?string("true", "false")},
- "mandatory" : "${paramDef.mandatory?string("true", "false")}",
- "url" : "${url.serviceContext + "/api/rules/parameterdefs/" + paramDef.name}"
- }
-#macro>
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.delete.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.delete.desc.xml
deleted file mode 100644
index 51ac1bf85d..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.delete.desc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
- Delete Rule
- Delete the rule identified by the specified rule node id.
- /api/rules/{store_type}/{store_id}/{rule_id}
- /api/node/{store_type}/{store_id}/{id}/rules/{rule_id}
- /api/path/{store_type}/{store_id}/{id}/rules/{rule_id}
- argument
- user
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.delete.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.delete.json.ftl
deleted file mode 100644
index f81dc51f8d..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.delete.json.ftl
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "success": true
-}
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.get.desc.xml
deleted file mode 100644
index 309d8903a7..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.get.desc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
- Get Rule
- Get the rule identified by the specified rule node reference.
- /api/rules/{store_type}/{store_id}/{rule_id}
- /api/node/{store_type}/{store_id}/{id}/rules/{rule_id}
- /api/path/{store_type}/{store_id}/{id}/rules/{rule_id}
- argument
- user
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.get.json.ftl
deleted file mode 100644
index 71a03617ae..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.get.json.ftl
+++ /dev/null
@@ -1,2 +0,0 @@
-<#import "rule.lib.ftl" as ruleLib/>
-<@ruleLib.ruleJSON rule=rule owningNodeRef=owningNodeRef/>
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.lib.ftl
deleted file mode 100644
index be962e2380..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.lib.ftl
+++ /dev/null
@@ -1,25 +0,0 @@
-<#import "action.lib.ftl" as actionLib/>
-
-<#macro ruleJSON rule owningNodeRef>
- <#escape x as jsonUtils.encodeJSONString(x)>
- {
- "ruleNodeRef" : "${rule.nodeRef}",
- "title" : "${rule.title}",
- "description" : "${rule.description}",
- "ruleTypes" :
- [
- <#list rule.ruleTypes as ruleType>
- "${ruleType}"
- <#if ruleType_has_next>,#if>
- #list>
- ],
- "action" : <@actionLib.actionJSON action=rule.action rule=rule/>,
- "owningNodeRef" : "${owningNodeRef}",
- "executeAsync" : ${rule.executeAsynchronously?string("true", "false")},
- "ruleDisabled" : ${rule.ruleDisabled?string("true", "false")},
- "appliedToChildren" : ${rule.appliedToChildren?string("true", "false")},
- "url" : "${url.serviceContext + "/api/rules/" + rule.nodeRef.storeRef.protocol + "/"
- + rule.nodeRef.storeRef.identifier + "/" + rule.nodeRef.id}"
- }
- #escape>
-#macro>
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.put.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.put.desc.xml
deleted file mode 100644
index d775144db6..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.put.desc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
- Put Rule
- Update the rule identified by the specified rule node reference.
- /api/rules/{store_type}/{store_id}/{rule_id}
- /api/node/{store_type}/{store_id}/{id}/rules/{rule_id}
- /api/path/{store_type}/{store_id}/{id}/rules/{rule_id}
- argument
- user
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.put.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.put.json.ftl
deleted file mode 100644
index 71a03617ae..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rule.put.json.ftl
+++ /dev/null
@@ -1,2 +0,0 @@
-<#import "rule.lib.ftl" as ruleLib/>
-<@ruleLib.ruleJSON rule=rule owningNodeRef=owningNodeRef/>
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.delete.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.delete.desc.xml
deleted file mode 100644
index 5601bde72d..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.delete.desc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
- Delete Rules
- Delete the collection of rules which have been applied to the given rule owning node node.
- /api/node/{store_type}/{store_id}/{id}/rules
- /api/path/{store_type}/{store_id}/{id}/rules
- /api/rules/appliedtonode/{store_type}/{store_id}/{id}
- argument
- user
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.delete.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.delete.json.ftl
deleted file mode 100644
index f81dc51f8d..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.delete.json.ftl
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "success": true
-}
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.get.desc.xml
deleted file mode 100644
index 64ca127a67..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.get.desc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
- Get Rules
- Get the collection of rules which have been applied to the given (actionable) node. If the optional 'includeInherited' parameter is not provided, then rules inherited from the given node's parents are included by default. If the optional 'ruleTypeName' parameter is provided, then only rules of that specific given rule type are returned
- /api/node/{store_type}/{store_id}/{id}/rules?includeInherited={includeInherited?}&ruleTypeName={ruleTypeName?}
- /api/path/{store_type}/{store_id}/{id}/rules?includeInherited={includeInherited?}&ruleTypeName={ruleTypeName?}
- /api/rules/appliedtonode/{store_type}/{store_id}/{id}?includeInherited={includeInherited?}&ruleTypeName={ruleTypeName?}
- argument
- user
- required
-
\ No newline at end of file
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.get.json.ftl
deleted file mode 100644
index 6a5e1c6ee8..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.get.json.ftl
+++ /dev/null
@@ -1,8 +0,0 @@
-<#import "rule.lib.ftl" as ruleLib/>
-
-[
- <#list rules as rule>
- <@ruleLib.ruleJSON rule=rule owningNodeRef=owningNodeRef/>
- <#if rule_has_next>,#if>
- #list>
-]
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.post.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.post.desc.xml
deleted file mode 100644
index a03b1f7df3..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.post.desc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
- Create Rule
- Creates a rule in the rule collection associated with the given actionable node
- /api/node/{store_type}/{store_id}/{id}/rules
- /api/path/{store_type}/{store_id}/{id}/rules
- /api/rules/appliedtonode/{store_type}/{store_id}/{id}
- argument
- user
- required
-
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.post.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.post.json.ftl
deleted file mode 100644
index 71a03617ae..0000000000
--- a/config/alfresco/templates/webscripts/org/alfresco/repository/rule/rules.post.json.ftl
+++ /dev/null
@@ -1,2 +0,0 @@
-<#import "rule.lib.ftl" as ruleLib/>
-<@ruleLib.ruleJSON rule=rule owningNodeRef=owningNodeRef/>
\ No newline at end of file
diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml
index 33d4b4f60f..d3474ecb44 100644
--- a/config/alfresco/web-scripts-application-context.xml
+++ b/config/alfresco/web-scripts-application-context.xml
@@ -536,102 +536,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/ActionDefGet.java b/source/java/org/alfresco/repo/web/scripts/rule/ActionDefGet.java
deleted file mode 100644
index b16731311d..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/ActionDefGet.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.alfresco.service.cmr.action.ActionDefinition;
-import org.alfresco.service.cmr.action.ActionService;
-import org.springframework.extensions.webscripts.DeclarativeWebScript;
-import org.springframework.extensions.webscripts.Status;
-import org.springframework.extensions.webscripts.WebScriptException;
-import org.springframework.extensions.webscripts.WebScriptRequest;
-
-/**
- * Web Script to GET an action definition given its name
- *
- * @author glen johnson at alfresco dot com
- */
-public class ActionDefGet extends DeclarativeWebScript
-{
- // model property keys
- private static final String MODEL_PROP_KEY_ACTION_DEF = "actiondef";
-
- // private constants
- private static final String REQ_PARAM_ACTION_DEF_NAME = "actionDefinitionName";
-
- // properties for services
- private ActionService actionService;
-
- /**
- * Set the actionService property.
- *
- * @param actionService The action service instance to set
- */
- public void setActionService(ActionService actionService)
- {
- this.actionService = actionService;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(
- * org.alfresco.web.scripts.WebScriptRequest,
- * org.alfresco.web.scripts.WebScriptResponse)
- */
- @Override
- protected Map executeImpl(WebScriptRequest req,
- Status status)
- {
- // initialise model to pass on for template to render
- Map model = new HashMap();
-
- // get actionDefinitionName URL template variable
- String actionDefName = req.getServiceMatch().getTemplateVars().get(REQ_PARAM_ACTION_DEF_NAME);
- if ((actionDefName == null) || (actionDefName.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'actionDefinitionName' URL parameter has not been provided in URL");
- }
-
- // get an action definition with the given action definition name
- ActionDefinition actionDef = this.actionService.getActionDefinition(actionDefName);
-
- // add objects to model for the template to render
- model.put(MODEL_PROP_KEY_ACTION_DEF, actionDef);
-
- return model;
- }
-}
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/ActionDefsGet.java b/source/java/org/alfresco/repo/web/scripts/rule/ActionDefsGet.java
deleted file mode 100644
index 9b2c8c672a..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/ActionDefsGet.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.alfresco.service.cmr.action.ActionDefinition;
-import org.alfresco.service.cmr.action.ActionService;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.springframework.extensions.webscripts.DeclarativeWebScript;
-import org.springframework.extensions.webscripts.Status;
-import org.springframework.extensions.webscripts.WebScriptRequest;
-
-/**
- * Web Script to GET the action definition collection
- * This can optionally be scoped by by either
- * - a node reference in the form /api/node/{store_type}/{store_id}/{id} on the URL
- * - a node path in the form /api/path/{store_type}/{store_id}/{id} on the URL
- *
- * @author glen johnson at alfresco dot com
- */
-public class ActionDefsGet extends DeclarativeWebScript
-{
- // private constants
- private static final String REQ_URL_TEMPL_VAR_STORE_TYPE = "store_type";
- private static final String REQ_URL_TEMPL_VAR_STORE_ID = "store_id";
- private static final String REQ_URL_TEMPL_VAR_ID = "id";
-
- // model property keys
- private static final String MODEL_PROP_KEY_ACTION_DEFS = "actiondefs";
-
- // properties for services & dependencies
- private ActionService actionService;
- private RulesHelper rulesHelper;
-
- /**
- * Set the actionService property.
- *
- * @param actionService The action service instance to set
- */
- public void setActionService(ActionService actionService)
- {
- this.actionService = actionService;
- }
-
- /**
- * Set the rules helper
- *
- * @param rulesHelper the rulesHelper to set
- */
- public void setRulesHelper(RulesHelper rulesHelper)
- {
- this.rulesHelper = rulesHelper;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(
- * org.alfresco.web.scripts.WebScriptRequest,
- * org.alfresco.web.scripts.WebScriptResponse)
- */
- @Override
- protected Map executeImpl(WebScriptRequest req,
- Status status)
- {
- // initialise model to pass on for template to render
- Map model = new HashMap();
-
- // get the template variables for store_type, store_id and id
- String storeType = req.getServiceMatch().getTemplateVars().get(REQ_URL_TEMPL_VAR_STORE_TYPE);
- String storeId = req.getServiceMatch().getTemplateVars().get(REQ_URL_TEMPL_VAR_STORE_ID);
- String id = req.getServiceMatch().getTemplateVars().get(REQ_URL_TEMPL_VAR_ID);
-
- // work out which of storeType, storeId, id template variables have been given
- boolean storeTypeGiven = (storeType != null) && (storeType.length() > 0);
- boolean storeIdGiven = (storeId != null) && (storeId.length() > 0);
- boolean idGiven = (id != null) && (id.length() > 0);
-
- List actionDefs = null;
-
- //
- // if either a node reference or path are provided to scope the action
- // definition collection by, then obtain a reference to that node
- //
- if ((storeTypeGiven && storeIdGiven && idGiven))
- {
- // get the node reference to scope the action definitions by
- NodeRef scopeByNodeRef = this.rulesHelper.getNodeRefFromWebScriptUrl(req, storeType, storeId, id);
-
- // get all the action definitions that are applicable for the node reference
- actionDefs = this.actionService.getActionDefinitions(scopeByNodeRef);
- }
- // else not scoped by noderef, so get all the condition definitions
- else
- {
- actionDefs = this.actionService.getActionDefinitions();
- }
-
- // add objects to model for the template to render
- model.put(MODEL_PROP_KEY_ACTION_DEFS, actionDefs);
-
- return model;
- }
-}
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/ActionQueueItemStatus.java b/source/java/org/alfresco/repo/web/scripts/rule/ActionQueueItemStatus.java
deleted file mode 100644
index 9b35a7c355..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/ActionQueueItemStatus.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-/**
- * This class defines a bean that encapsulates the
- * properties present in ActionQueueItemStatus Details
- * returned from the Action Queue resource
- *
- * @author glen johnson at alfresco com
- */
-public class ActionQueueItemStatus
-{
- // bean property member variables
-
- /**
- * ID allocated to the action queue item when it is added to the action queue resource
- */
- private String actionQueueItemId;
-
- /**
- * Execution status for the respective action queue item
- * Value is one of "PENDING", "COMPLETE"
- */
- private String status = null;
-
- /**
- * ID of the action (associated with this status) which is part of the action queue item
- */
- private String actionId;
-
- /**
- * Return the ID of the action queue item
- *
- * @return the action queue item ID
- */
- public String getActionQueueItemId()
- {
- return actionQueueItemId;
- }
-
- /**
- * Sets the ID of the action queue item
- *
- * @param actionQueueItemId the action queue item id to set
- */
- public void setActionQueueItemId(String actionQueueItemId)
- {
- this.actionQueueItemId = actionQueueItemId;
- }
-
- /**
- * Get the status
- *
- * @return the status
- */
- public String getStatus()
- {
- return status;
- }
-
- /**
- * Set the status
- *
- * @param status the status to set
- */
- public void setStatus(String status)
- {
- this.status = status;
- }
-
- /**
- * Get the action id
- *
- * @return the actionId
- */
- public String getActionId()
- {
- return actionId;
- }
-
- /**
- * Set the action ID
- *
- * @param actionId the actionId to set
- */
- public void setActionId(String actionId)
- {
- this.actionId = actionId;
- }
-}
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/ActionQueuePost.java b/source/java/org/alfresco/repo/web/scripts/rule/ActionQueuePost.java
deleted file mode 100644
index 9d31aa7d70..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/ActionQueuePost.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.alfresco.service.cmr.action.Action;
-import org.alfresco.service.cmr.action.ActionService;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.springframework.extensions.webscripts.DeclarativeWebScript;
-import org.springframework.extensions.webscripts.Status;
-import org.springframework.extensions.webscripts.WebScriptException;
-import org.springframework.extensions.webscripts.WebScriptRequest;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Web Script to POST an Action Queue Item onto the Action Queue
- *
- * @author glen johnson at alfresco dot com
- */
-public class ActionQueuePost extends DeclarativeWebScript
-{
- // model property keys
- private static final String MODEL_PROP_KEY_ACTION_Q_ITEM_STATUS = "actionQItemStatus";
-
- // properties for services
- private ActionService actionService;
-
- // properties for dependencies
- private RulesHelper rulesHelper;
-
- /**
- * @param actionService the actionService to set
- */
- public void setActionService(ActionService actionService)
- {
- this.actionService = actionService;
- }
-
- /**
- * Set the rules helper property
- *
- * @param rulesHelper the rulesHelper to set
- */
- public void setRulesHelper(RulesHelper rulesHelper)
- {
- this.rulesHelper = rulesHelper;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(
- * org.alfresco.web.scripts.WebScriptRequest,
- * org.alfresco.web.scripts.WebScriptResponse)
- */
- @SuppressWarnings("unchecked")
- @Override
- protected Map executeImpl(WebScriptRequest req,
- Status status)
- {
- // initialise model to pass on to template for rendering
- Map model = new HashMap();
-
- // get the posted action queue item JSON object by parsing request content
- Object contentObj = req.parseContent();
- if (contentObj == null || !(contentObj instanceof JSONObject))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Web Script request content must be a JSON Object. "
- + "Request content is either a JSON Array or not of MIME-type application/json");
- }
-
- JSONObject actionJson = null;
- Action action = null;
- boolean checkConditions = true;
- boolean executeAsynchronously = false;
- NodeRef actionedUponNodeRef = null;
- try
- {
- // get action queue item JSON object cast from contentObj
- JSONObject actionQueueItemJson = (JSONObject)contentObj;
-
- // get action JSON object from actionQueueItem JSON
- actionJson = actionQueueItemJson.getJSONObject("action");
-
- // get the action from the action JSON object
- action = this.rulesHelper.getActionFromJson(actionJson, null);
-
- // Get 'checkConditions' and 'executeAsynchronously' properties off action queue item
- checkConditions = actionQueueItemJson.optBoolean("checkConditions", true);
- executeAsynchronously = actionQueueItemJson.optBoolean(
- "executeAsync", action.getExecuteAsychronously());
-
- // get the actioned-upon node reference
- String nodeRefStr = actionQueueItemJson.getString("nodeRef");
- actionedUponNodeRef = new NodeRef(nodeRefStr);
- }
- catch (JSONException je)
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "Problem retrieving properties from ActionQueueItem Details sent in the request content.", je);
- }
-
- // apply rule to actionable node
- this.actionService.executeAction(action, actionedUponNodeRef, checkConditions, executeAsynchronously);
-
- // create the action queue item status bean
- // to be rendered by the template
- ActionQueueItemStatus actionQItemStatus = new ActionQueueItemStatus();
-
- //
- // set the action queue item id on the action queue item status bean
- //
-
- String actionedUponNodeId = actionedUponNodeRef.getId();
- String actionId = action.getId();
- String actionQItemId = actionId + ":" + actionedUponNodeId;
- actionQItemStatus.setActionQueueItemId(actionQItemId);
-
- // set the action id on the action queue item status bean
- actionQItemStatus.setActionId(actionId);
-
- // set the status on the action queue item status bean
- if (executeAsynchronously == true)
- {
- actionQItemStatus.setStatus(RulesHelper.ACTION_QUEUE_ITEM_STATUS_PENDING);
- }
- else
- {
- actionQItemStatus.setStatus(RulesHelper.ACTION_QUEUE_ITEM_STATUS_COMPLETE);
- }
-
- // add objects to model for the template to render
- model.put(MODEL_PROP_KEY_ACTION_Q_ITEM_STATUS, actionQItemStatus);
-
- return model;
- }
-}
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/ConditionDefGet.java b/source/java/org/alfresco/repo/web/scripts/rule/ConditionDefGet.java
deleted file mode 100644
index 16f73bb321..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/ConditionDefGet.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.alfresco.service.cmr.action.ActionConditionDefinition;
-import org.alfresco.service.cmr.action.ActionService;
-import org.springframework.extensions.webscripts.DeclarativeWebScript;
-import org.springframework.extensions.webscripts.Status;
-import org.springframework.extensions.webscripts.WebScriptException;
-import org.springframework.extensions.webscripts.WebScriptRequest;
-
-/**
- * Web Script to GET a condition definition given its name
- *
- * @author glen johnson at alfresco dot com
- */
-public class ConditionDefGet extends DeclarativeWebScript
-{
- // model property keys
- private static final String MODEL_PROP_KEY_CONDITION_DEF = "conditiondef";
-
- // private constants
- private static final String REQ_PARAM_CONDITION_DEF_NAME = "conditionDefinitionName";
-
- // properties for services
- private ActionService actionService;
-
- /**
- * Set the actionService property.
- *
- * @param actionService The action service instance to set
- */
- public void setActionService(ActionService actionService)
- {
- this.actionService = actionService;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(
- * org.alfresco.web.scripts.WebScriptRequest,
- * org.alfresco.web.scripts.WebScriptResponse)
- */
- @Override
- protected Map executeImpl(WebScriptRequest req,
- Status status)
- {
- // initialise model to pass on for template to render
- Map model = new HashMap();
-
- // get conditionDefinitionName URL template variable
- String conditionDefName = req.getServiceMatch().getTemplateVars().get(REQ_PARAM_CONDITION_DEF_NAME);
- if ((conditionDefName == null) || (conditionDefName.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'conditionDefinitionName' URL parameter has not been provided in URL");
- }
-
- // get a condition definition with the given condition definition name
- ActionConditionDefinition conditionDef = this.actionService.getActionConditionDefinition(conditionDefName);
-
- // add objects to model for the template to render
- model.put(MODEL_PROP_KEY_CONDITION_DEF, conditionDef);
-
- return model;
- }
-}
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/ConditionDefsGet.java b/source/java/org/alfresco/repo/web/scripts/rule/ConditionDefsGet.java
deleted file mode 100644
index 7b43cb6217..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/ConditionDefsGet.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.alfresco.service.cmr.action.ActionConditionDefinition;
-import org.alfresco.service.cmr.action.ActionService;
-import org.springframework.extensions.webscripts.DeclarativeWebScript;
-import org.springframework.extensions.webscripts.Status;
-import org.springframework.extensions.webscripts.WebScriptRequest;
-
-/**
- * Web Script to GET the condition definition collection
- *
- * @author glen johnson at alfresco dot com
- */
-public class ConditionDefsGet extends DeclarativeWebScript
-{
- // model property keys
- private static final String MODEL_PROP_KEY_CONDITION_DEFS = "conditiondefs";
-
- // properties for services
- private ActionService actionService;
-
- /**
- * Set the actionService property.
- *
- * @param actionService The action service instance to set
- */
- public void setActionService(ActionService actionService)
- {
- this.actionService = actionService;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(
- * org.alfresco.web.scripts.WebScriptRequest,
- * org.alfresco.web.scripts.WebScriptResponse)
- */
- @Override
- protected Map executeImpl(WebScriptRequest req,
- Status status)
- {
- // initialise model to pass on for template to render
- Map model = new HashMap();
-
- // get all the condition definitions
- List conditionDefs = this.actionService.getActionConditionDefinitions();
-
- // add objects to model for the template to render
- model.put(MODEL_PROP_KEY_CONDITION_DEFS, conditionDefs);
-
- return model;
- }
-}
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/RuleDelete.java b/source/java/org/alfresco/repo/web/scripts/rule/RuleDelete.java
deleted file mode 100644
index a488c908c8..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/RuleDelete.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-import java.util.Map;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.rule.Rule;
-import org.alfresco.service.cmr.rule.RuleService;
-import org.springframework.extensions.webscripts.DeclarativeWebScript;
-import org.springframework.extensions.webscripts.Status;
-import org.springframework.extensions.webscripts.WebScriptException;
-import org.springframework.extensions.webscripts.WebScriptRequest;
-
-/**
- * Web Script to DELETE the rule identified by the given rule node id.
- *
- * NOTE -
- * that if a value is provided for the 'id' URL template variable {id},
- * i.e. either of the following URL patterns have been used
- * /api/node/{store_type}/{store_id}/{id}/rules/{rule_id} or
- * /api/path/{store_type}/{store_id}/{id}/rules/{rule_id}
- * then the rule owning node ref supplied therein will be ignored,
- * as these URL templates are just provided for convenience and the
- * rule owning node ref is retrieved by using the rule's identifying node
- * ref (supplied in {rule_id})
- *
- * @author glen johnson at alfresco dot com
- */
-public class RuleDelete extends DeclarativeWebScript
-{
- // private constants
- private static final String REQ_TEMPL_VAR_STORE_TYPE = "store_type";
- private static final String REQ_TEMPL_VAR_STORE_ID = "store_id";
- private static final String REQ_TEMPL_VAR_RULE_NODE_ID = "rule_id";
-
- // properties for services
- private RuleService ruleService;
-
- // dependencies
- private RulesHelper rulesHelper;
-
- /**
- * Set the ruleService property.
- *
- * @param ruleService The rule service instance to set
- */
- public void setRuleService(RuleService ruleService)
- {
- this.ruleService = ruleService;
- }
-
- /**
- * Set the rules helper property
- *
- * @param rulesHelper the rulesHelper to set
- */
- public void setRulesHelper(RulesHelper rulesHelper)
- {
- this.rulesHelper = rulesHelper;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(
- * org.alfresco.web.scripts.WebScriptRequest,
- * org.alfresco.web.scripts.WebScriptResponse)
- */
- @Override
- protected Map executeImpl(WebScriptRequest req,
- Status status)
- {
- String storeType = req.getServiceMatch().getTemplateVars().get(REQ_TEMPL_VAR_STORE_TYPE);
- // Handle if 'store_type' URL template token not provided
- if ((storeType == null) || (storeType.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'store_type' URL template token has not been provided in URL");
- }
-
- String storeId = req.getServiceMatch().getTemplateVars().get(REQ_TEMPL_VAR_STORE_ID);
- // Handle if 'storeId' URL template token not provided
- if ((storeId == null) || (storeId.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'storeId' URL template token has not been provided in URL");
- }
-
- String ruleNodeId = req.getServiceMatch().getTemplateVars().get(REQ_TEMPL_VAR_RULE_NODE_ID);
- // Handle if 'rule_id' URL template token not provided
- if ((ruleNodeId == null) || (ruleNodeId.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'rule_id' URL template token has not been provided in URL");
- }
-
- // create the rule's identifying node reference from the given
- // URL template tokens
- NodeRef ruleNodeRef = this.rulesHelper.getNodeRefFromWebScriptUrl(req, storeType, storeId, ruleNodeId);
-
- // if ruleNodeRef referred to by {store_type} {store_id} {rule_id} is 'null' then the rule identified by that
- // given node id or node path no longer exists
- if (ruleNodeRef == null)
- {
- throw new WebScriptException(Status.STATUS_NOT_FOUND, "Rule identified by rule node/path - 'store_type': "
- + storeType + " 'store_id': " + storeId + " and 'rule_id': " + ruleNodeId + " could not be found");
- }
-
- Rule rule = this.ruleService.getRule(ruleNodeRef);
- NodeRef ruleOwningNodeRef = this.ruleService.getOwningNodeRef(rule);
-
- // delete rule
- this.ruleService.removeRule(ruleOwningNodeRef, rule);
-
- return null;
- }
-}
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/RuleGet.java b/source/java/org/alfresco/repo/web/scripts/rule/RuleGet.java
deleted file mode 100644
index cebbb91b93..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/RuleGet.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.rule.Rule;
-import org.alfresco.service.cmr.rule.RuleService;
-import org.springframework.extensions.webscripts.DeclarativeWebScript;
-import org.springframework.extensions.webscripts.Status;
-import org.springframework.extensions.webscripts.WebScriptException;
-import org.springframework.extensions.webscripts.WebScriptRequest;
-
-/**
- * Web Script to GET the rule identified by the given rule node reference.
- *
- * NOTE -
- * that if a value is provided for the 'id' URL template variable {id},
- * i.e. either of the following URL patterns have been used
- * /api/node/{store_type}/{store_id}/{id}/rules/{rule_id} or
- * /api/path/{store_type}/{store_id}/{id}/rules/{rule_id}
- * then the rule owning node ref supplied therein will be ignored,
- * as these URL templates are just provided for convenience and the
- * rule owning node ref is retrieved by using the rule's identifying node
- * ref (supplied in {rule_id})
- *
- * @author glen johnson at alfresco dot com
- */
-public class RuleGet extends DeclarativeWebScript
-{
- // private constants
- private static final String REQ_TEMPL_VAR_STORE_TYPE = "store_type";
- private static final String REQ_TEMPL_VAR_STORE_ID = "store_id";
- private static final String REQ_TEMPL_VAR_RULE_NODE_ID = "rule_id";
-
- // model property keys
- private static final String MODEL_PROP_KEY_RULE = "rule";
- private static final String MODEL_PROP_KEY_OWNING_NODE_REF = "owningNodeRef";
-
- // properties for services
- private RuleService ruleService;
-
- // dependencies
- private RulesHelper rulesHelper;
-
- /**
- * Set the ruleService property.
- *
- * @param ruleService The rule service instance to set
- */
- public void setRuleService(RuleService ruleService)
- {
- this.ruleService = ruleService;
- }
-
- /**
- * Set the rules helper property
- *
- * @param rulesHelper the rulesHelper to set
- */
- public void setRulesHelper(RulesHelper rulesHelper)
- {
- this.rulesHelper = rulesHelper;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(
- * org.alfresco.web.scripts.WebScriptRequest,
- * org.alfresco.web.scripts.WebScriptResponse)
- */
- @Override
- protected Map executeImpl(WebScriptRequest req,
- Status status)
- {
- // initialise model to pass on for template to render
- Map model = new HashMap();
-
- String storeType = req.getServiceMatch().getTemplateVars().get(REQ_TEMPL_VAR_STORE_TYPE);
- // Handle if 'store_type' URL template token not provided
- if ((storeType == null) || (storeType.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'store_type' URL template token has not been provided in URL");
- }
-
- String storeId = req.getServiceMatch().getTemplateVars().get(REQ_TEMPL_VAR_STORE_ID);
- // Handle if 'storeId' URL template token not provided
- if ((storeId == null) || (storeId.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'storeId' URL template token has not been provided in URL");
- }
-
- String ruleNodeId = req.getServiceMatch().getTemplateVars().get(REQ_TEMPL_VAR_RULE_NODE_ID);
- // Handle if 'ruleNodeId' URL template token not provided
- if ((ruleNodeId == null) || (ruleNodeId.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'ruleNodeId' URL template token has not been provided in URL");
- }
-
- // create the rule node reference from the given
- // URL template tokens
- NodeRef ruleNodeRef = this.rulesHelper.getNodeRefFromWebScriptUrl(req, storeType, storeId, ruleNodeId);
-
- // if ruleNodeRef referred to by {store_type} {store_id} {rule_id} is 'null' then the rule identified by that
- // given node id or node path no longer exists
- if (ruleNodeRef == null)
- {
- throw new WebScriptException(Status.STATUS_NOT_FOUND, "Rule identified by rule node/path - 'store_type': "
- + storeType + " 'store_id': " + storeId + " and 'rule_id': " + ruleNodeId + " could not be found");
- }
-
- // get rule identified by the given rule node reference
- Rule rule = this.ruleService.getRule(ruleNodeRef);
-
- // get rule's owning node
- NodeRef ruleOwningNodeRef = this.ruleService.getOwningNodeRef(rule);
-
- // add objects to model for the template to render
- model.put(MODEL_PROP_KEY_RULE, rule);
- model.put(MODEL_PROP_KEY_OWNING_NODE_REF, ruleOwningNodeRef.toString());
-
- return model;
- }
-}
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/RulePut.java b/source/java/org/alfresco/repo/web/scripts/rule/RulePut.java
deleted file mode 100644
index b0b7faa108..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/RulePut.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.rule.Rule;
-import org.alfresco.service.cmr.rule.RuleService;
-import org.springframework.extensions.webscripts.DeclarativeWebScript;
-import org.springframework.extensions.webscripts.Status;
-import org.springframework.extensions.webscripts.WebScriptException;
-import org.springframework.extensions.webscripts.WebScriptRequest;
-import org.json.JSONObject;
-
-/**
- * Web Script to PUT (update) the rule identified by the given rule node reference.
- *
- * NOTE -
- * that if a value is provided for the 'id' URL template variable {id},
- * i.e. either of the following URL patterns have been used
- * /api/node/{store_type}/{store_id}/{id}/rules/{rule_id} or
- * /api/path/{store_type}/{store_id}/{id}/rules/{rule_id}
- * then the rule owning node ref supplied therein will be ignored,
- * as these URL templates are just provided for convenience and the
- * rule owning node ref is retrieved by using the rule's identifying node
- * ref (supplied in {rule_id})
- *
- * @author glen johnson at alfresco dot com
- */
-public class RulePut extends DeclarativeWebScript
-{
- // private constants
- private static final String REQ_TEMPL_VAR_STORE_TYPE = "store_type";
- private static final String REQ_TEMPL_VAR_STORE_ID = "store_id";
- private static final String REQ_TEMPL_VAR_RULE_NODE_ID = "rule_id";
-
- // model property keys
- private static final String MODEL_PROP_KEY_RULE = "rule";
- private static final String MODEL_PROP_KEY_OWNING_NODE_REF = "owningNodeRef";
-
- // properties for services
- private RuleService ruleService;
-
- // dependencies
- private RulesHelper rulesHelper;
-
- /**
- * Set the ruleService property.
- *
- * @param ruleService The rule service instance to set
- */
- public void setRuleService(RuleService ruleService)
- {
- this.ruleService = ruleService;
- }
-
- /**
- * Set the rules helper
- *
- * @param rulesHelper the rulesHelper to set
- */
- public void setRulesHelper(RulesHelper rulesHelper)
- {
- this.rulesHelper = rulesHelper;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(
- * org.alfresco.web.scripts.WebScriptRequest,
- * org.alfresco.web.scripts.WebScriptResponse)
- */
- @SuppressWarnings("unchecked")
- @Override
- protected Map executeImpl(WebScriptRequest req,
- Status status)
- {
- // initialise model to pass on for template to render
- Map model = new HashMap();
-
- String storeType = req.getServiceMatch().getTemplateVars().get(REQ_TEMPL_VAR_STORE_TYPE);
- // Handle if 'store_type' URL template token not provided
- if ((storeType == null) || (storeType.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'store_type' URL template token has not been provided in URL");
- }
-
- String storeId = req.getServiceMatch().getTemplateVars().get(REQ_TEMPL_VAR_STORE_ID);
- // Handle if 'storeId' URL template token not provided
- if ((storeId == null) || (storeId.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'storeId' URL template token has not been provided in URL");
- }
-
- String ruleNodeId = req.getServiceMatch().getTemplateVars().get(REQ_TEMPL_VAR_RULE_NODE_ID);
- // Handle if 'ruleNodeId' URL template token not provided
- if ((ruleNodeId == null) || (ruleNodeId.length() == 0))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST,
- "The 'ruleNodeId' URL template token has not been provided in URL");
- }
-
- // create the rule node reference from the given
- // URL template tokens
- NodeRef ruleNodeRef = this.rulesHelper.getNodeRefFromWebScriptUrl(req, storeType, storeId, ruleNodeId);
-
- // if ruleNodeRef referred to by {store_type} {store_id} {rule_id} is 'null' then the rule identified by that
- // given node id or node path no longer exists
- if (ruleNodeRef == null)
- {
- throw new WebScriptException(Status.STATUS_NOT_FOUND, "Rule identified by rule node/path - 'store_type': "
- + storeType + " 'store_id': " + storeId + " and 'rule_id': " + ruleNodeId + " could not be found");
- }
-
- // get the rule JSON object sent in the request content (when PUTting the Rule)
- Object contentObj = req.parseContent();
- if (contentObj == null || !(contentObj instanceof JSONObject))
- {
- throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Web Script request content must be a JSON Object. "
- + "Request content is either a JSON Array or not of MIME-type application/json");
- }
- JSONObject ruleJson = (JSONObject)contentObj;
-
- // update the rule object identified by the given rule node reference
- // with the details in the rule JSON
- Rule rule = this.rulesHelper.getRuleFromJson(ruleJson, ruleNodeRef);
-
- // get owning node ref that rule was
- // previous applied to
- NodeRef ruleOwningNodeRef = this.ruleService.getOwningNodeRef(rule);
-
- // re-apply rule to owning node
- this.ruleService.saveRule(ruleOwningNodeRef, rule);
-
- // add objects to model for the template to render
- model.put(MODEL_PROP_KEY_RULE, rule);
- model.put(MODEL_PROP_KEY_OWNING_NODE_REF, ruleOwningNodeRef.toString());
-
- return model;
- }
-}
diff --git a/source/java/org/alfresco/repo/web/scripts/rule/RuleServiceTest.java b/source/java/org/alfresco/repo/web/scripts/rule/RuleServiceTest.java
deleted file mode 100644
index 999c63f793..0000000000
--- a/source/java/org/alfresco/repo/web/scripts/rule/RuleServiceTest.java
+++ /dev/null
@@ -1,1180 +0,0 @@
-/*
- * Copyright (C) 2005-2007 Alfresco Software Limited.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- * As a special exception to the terms and conditions of version 2.0 of
- * the GPL, you may redistribute this Program in connection with Free/Libre
- * and Open Source Software ("FLOSS") applications as described in Alfresco's
- * FLOSS exception. You should have received a copy of the text describing
- * the FLOSS exception, and it is also available here:
- * http://www.alfresco.com/legal/licensing"
- */
-package org.alfresco.repo.web.scripts.rule;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.alfresco.model.ContentModel;
-import org.alfresco.repo.action.evaluator.CompareMimeTypeEvaluator;
-import org.alfresco.repo.action.evaluator.ComparePropertyValueEvaluator;
-import org.alfresco.repo.action.executer.CompositeActionExecuter;
-import org.alfresco.repo.action.executer.CopyActionExecuter;
-import org.alfresco.repo.action.executer.MoveActionExecuter;
-import org.alfresco.repo.security.authentication.AuthenticationComponent;
-import org.alfresco.repo.security.authentication.AuthenticationUtil;
-import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
-import org.alfresco.repo.web.scripts.BaseWebScriptTest;
-import org.alfresco.service.cmr.repository.NodeRef;
-import org.alfresco.service.cmr.repository.NodeService;
-import org.alfresco.service.cmr.rule.RuleType;
-import org.alfresco.service.cmr.security.AuthenticationService;
-import org.alfresco.service.cmr.security.PersonService;
-import org.alfresco.service.namespace.NamespaceService;
-import org.alfresco.service.namespace.QName;
-import org.alfresco.util.PropertyMap;
-import org.springframework.extensions.webscripts.Status;
-import org.springframework.extensions.webscripts.TestWebScriptServer.DeleteRequest;
-import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest;
-import org.springframework.extensions.webscripts.TestWebScriptServer.PostRequest;
-import org.springframework.extensions.webscripts.TestWebScriptServer.PutRequest;
-import org.springframework.extensions.webscripts.TestWebScriptServer.Response;
-import org.json.JSONArray;
-import org.json.JSONObject;
-
-/**
- * Test Case class with unit tests for Rule REST API
- *
- * @author Glen Johnson at Alfresco dot com
- */
-public class RuleServiceTest extends BaseWebScriptTest
-{
- // member variables for service instances
- private AuthenticationService authenticationService;
- private AuthenticationComponent authenticationComponent;
- private NodeService nodeService;
- private PersonService personService;
-
- private NodeRef owningNodeRef1;
- private NodeRef testDestFolder1;
- private NodeRef testDestFolder2;
-
- // private constants
- private static final String RULES_USER = "Rules.User";
- private static final String RULES_USER_PASSWORD = "password";
- private static final String RULES_TEST_OWNING_FOLDER_1 = "rulesTestOwningFolder1";
- private static final String RULES_TEST_DEST_FOLDER_1 = "rulesTestDestinationFolder1";
- private static final String RULES_TEST_DEST_FOLDER_2 = "rulesTestDestinationFolder2";
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- // get references to services
- this.authenticationService = (AuthenticationService) getServer().getApplicationContext().getBean(
- "AuthenticationService");
- this.authenticationComponent = (AuthenticationComponent) getServer().getApplicationContext().getBean(
- "AuthenticationComponent");
- this.nodeService = (NodeService) getServer().getApplicationContext().getBean("NodeService");
- this.personService = (PersonService) getServer().getApplicationContext().getBean("PersonService");
-
- //
- // various setup operations which need to be run as system user
- //
- AuthenticationUtil.runAs(new RunAsWork