mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
REPO-1309: Execute an action asynchronously
- targetId is now optional, however, currently targetId must be a valid node ID.
This commit is contained in:
@@ -216,18 +216,17 @@ public class ActionsImpl implements Actions
|
|||||||
throw new EntityNotFoundException(action.getActionDefinitionId());
|
throw new EntityNotFoundException(action.getActionDefinitionId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check target id.
|
// targetId is optional, however, currently targetId must be a valid node ID.
|
||||||
|
NodeRef actionedUponNodeRef = null;
|
||||||
if (action.getTargetId() == null || action.getTargetId().isEmpty())
|
if (action.getTargetId() != null && !action.getTargetId().isEmpty())
|
||||||
{
|
{
|
||||||
throw new InvalidArgumentException("targetId missing");
|
// Does it exist in the repo?
|
||||||
}
|
actionedUponNodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, action.getTargetId());
|
||||||
|
|
||||||
// Does it exist in the repo?
|
if (!nodeService.exists(actionedUponNodeRef))
|
||||||
NodeRef actionedUponNodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, action.getTargetId());
|
{
|
||||||
if (!nodeService.exists(actionedUponNodeRef))
|
throw new EntityNotFoundException(action.getTargetId());
|
||||||
{
|
}
|
||||||
throw new EntityNotFoundException(action.getTargetId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
org.alfresco.service.cmr.action.Action cmrAction;
|
org.alfresco.service.cmr.action.Action cmrAction;
|
||||||
|
@@ -536,14 +536,6 @@ public class TestActions extends AbstractBaseApiTest
|
|||||||
actions.executeAction(action, emptyParams, 404);
|
actions.executeAction(action, emptyParams, 404);
|
||||||
}
|
}
|
||||||
|
|
||||||
// targetId missing but required by the action.
|
|
||||||
{
|
|
||||||
Action action = new Action();
|
|
||||||
action.setActionDefinitionId(AddFeaturesActionExecuter.NAME);
|
|
||||||
|
|
||||||
actions.executeAction(action, emptyParams, 400);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Non-existent targetId
|
// Non-existent targetId
|
||||||
{
|
{
|
||||||
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, "750a2867-ecfa-478c-8343-fa0e39d27be3");
|
NodeRef nodeRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, "750a2867-ecfa-478c-8343-fa0e39d27be3");
|
||||||
|
Reference in New Issue
Block a user