diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/action/running-action.lib.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/action/running-action.lib.ftl
new file mode 100644
index 0000000000..a141834873
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/action/running-action.lib.ftl
@@ -0,0 +1,14 @@
+<#-- Renders the details of a running action. -->
+<#macro runningActionJSON action>
+<#escape x as jsonUtils.encodeJSONString(x)>
+ {
+ "actionId": "${action.id}",
+ "actionType": "${action.type}",
+ "actionInstance": "${action.instance?string}",
+ "actionNodeRef": <#if action.nodeRef??>"${action.nodeRef.nodeRef}"<#else>null#if>,
+ "startedAt": "${action.startedAt}",
+ "cancelRequested": "${action.cancelRequested?string}",
+ "details": "${"/api/running-action/" + action.key}",
+ }
+#escape>
+#macro>
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/action/running-actions.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/repository/action/running-actions.get.desc.xml
new file mode 100644
index 0000000000..9430524fb4
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/action/running-actions.get.desc.xml
@@ -0,0 +1,10 @@
+
+ List Running Actions
+
+ Returns (limited) details on all currently running actions.
+
+ /api/running-actions?type={type?}&nodeRef={nodeRef?}
+
+ admin
+ required
+
diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/action/running-actions.get.json.ftl b/config/alfresco/templates/webscripts/org/alfresco/repository/action/running-actions.get.json.ftl
new file mode 100644
index 0000000000..f371f36b3e
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/repository/action/running-actions.get.json.ftl
@@ -0,0 +1,10 @@
+<#import "running-action.lib.ftl" as actionLib />
+{
+ "data":
+ [
+ <#list runningActions as action>
+ <@actionLib.runningActionJSON action=action />
+ <#if action_has_next>,#if>
+ #list>
+ ]
+}
diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml
index cf27e0cfb2..2943bea73f 100644
--- a/config/alfresco/web-scripts-application-context.xml
+++ b/config/alfresco/web-scripts-application-context.xml
@@ -839,9 +839,9 @@
parent="abstractAuditWebScript">
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/java/org/alfresco/repo/web/scripts/action/RunningActionModelBuilder.java b/source/java/org/alfresco/repo/web/scripts/action/RunningActionModelBuilder.java
index 440dc6bfef..57e69b8218 100644
--- a/source/java/org/alfresco/repo/web/scripts/action/RunningActionModelBuilder.java
+++ b/source/java/org/alfresco/repo/web/scripts/action/RunningActionModelBuilder.java
@@ -18,9 +18,19 @@
*/
package org.alfresco.repo.web.scripts.action;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.alfresco.service.cmr.action.ActionService;
import org.alfresco.service.cmr.action.ActionTrackingService;
+import org.alfresco.service.cmr.action.ExecutionDetails;
+import org.alfresco.service.cmr.action.ExecutionSummary;
+import org.alfresco.service.cmr.replication.ReplicationDefinition;
import org.alfresco.service.cmr.repository.NodeService;
+import org.alfresco.util.ISO8601DateFormat;
/**
* Builds up models for running actions
@@ -33,6 +43,15 @@ public class RunningActionModelBuilder
protected static final String MODEL_DATA_ITEM = "runningAction";
protected static final String MODEL_DATA_LIST = "runningActions";
+ protected static final String ACTION_ID = "id";
+ protected static final String ACTION_TYPE = "type";
+ protected static final String ACTION_INSTANCE = "instance";
+ protected static final String ACTION_NODE_REF = "nodeRef";
+ protected static final String ACTION_STARTED_AT = "startedAt";
+ protected static final String ACTION_RUNNING_ON = "runningOn";
+ protected static final String ACTION_CANCEL_REQUESTED = "cancelRequested";
+ protected static final String ACTION_KEY = "key";
+
protected NodeService nodeService;
protected ActionService actionService;
@@ -45,4 +64,40 @@ public class RunningActionModelBuilder
this.actionService = actionService;
this.actionTrackingService = actionTrackingService;
}
+
+
+ /**
+ * Build a model containing a list of running actions for the given
+ * list of Running Actions
+ */
+ protected Map buildSimpleList(List runningActions)
+ {
+ List