Changing workflow REST API URLs to be plural for consistency with other services and also some minor formatting of FTL

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21127 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2010-07-13 13:13:16 +00:00
parent e80119fe6c
commit 53cee95d12
5 changed files with 53 additions and 61 deletions

View File

@@ -4,14 +4,7 @@
Lists all Workflow Task Instances associated with an authority and of a given State. Lists all Workflow Task Instances associated with an authority and of a given State.
The list of returned tasks also includes pooled tasks which the specified authority is eligible to claim. The list of returned tasks also includes pooled tasks which the specified authority is eligible to claim.
</description> </description>
<url>/api/task-instance</url> <url>/api/task-instances?authority={authority?}&amp;state={state?}&amp;properties={properties?}</url>
<url>/api/task-instance?authority={authority?}</url>
<url>/api/task-instance?state={state?}</url>
<url>/api/task-instance?properties={properties?}</url>
<url>/api/task-instance?authority={authority?}&amp;?state={state?}</url>
<url>/api/task-instance?authority={authority?}&amp;?properties={properties?}</url>
<url>/api/task-instance?state={state?}&amp;?properties={properties?}</url>
<url>/api/task-instance?authority={authority?}&amp;?state={state?}&amp;?properties={properties?}</url>
<format default="json"/> <format default="json"/>
<authentication>user</authentication> <authentication>user</authentication>
<transaction allow="readonly">required</transaction> <transaction allow="readonly">required</transaction>

View File

@@ -2,7 +2,8 @@
<#import "task.lib.ftl" as taskLib /> <#import "task.lib.ftl" as taskLib />
{ {
"data": [ "data":
[
<#list taskInstances as task> <#list taskInstances as task>
<@taskLib.taskJSON task=task /> <@taskLib.taskJSON task=task />
<#if task_has_next>,</#if> <#if task_has_next>,</#if>

View File

@@ -51,5 +51,3 @@
</#list> </#list>
} }
</#macro> </#macro>

View File

@@ -232,12 +232,12 @@ public class WorkflowModelBuilder
private String getUrl(WorkflowTask task) private String getUrl(WorkflowTask task)
{ {
return "api/task-instance/" + task.id; return "api/task-instances/" + task.id;
} }
private String getUrl(WorkflowDefinition workflowDefinition) private String getUrl(WorkflowDefinition workflowDefinition)
{ {
return "api/workflow-definition/" + workflowDefinition.id; return "api/workflow-definitions/" + workflowDefinition.id;
} }
} }

View File

@@ -92,7 +92,7 @@ public class WorkflowModelBuilderTest extends TestCase
Object id = model.get(WorkflowModelBuilder.TASK_ID); Object id = model.get(WorkflowModelBuilder.TASK_ID);
assertEquals(task.id, id); assertEquals(task.id, id);
Object url = model.get(WorkflowModelBuilder.TASK_URL); Object url = model.get(WorkflowModelBuilder.TASK_URL);
assertEquals("api/task-instance/"+task.id, url); assertEquals("api/task-instances/"+task.id, url);
assertEquals(task.name, model.get(WorkflowModelBuilder.TASK_NAME)); assertEquals(task.name, model.get(WorkflowModelBuilder.TASK_NAME));
assertEquals(task.title, model.get(WorkflowModelBuilder.TASK_TITLE)); assertEquals(task.title, model.get(WorkflowModelBuilder.TASK_TITLE));
assertEquals(task.description, model.get(WorkflowModelBuilder.TASK_DESCRIPTION)); assertEquals(task.description, model.get(WorkflowModelBuilder.TASK_DESCRIPTION));
@@ -143,7 +143,7 @@ public class WorkflowModelBuilderTest extends TestCase
Map<String, Object> model = builder.buildSimple(workflowDefinition); Map<String, Object> model = builder.buildSimple(workflowDefinition);
assertEquals(workflowDefinition.id, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_ID)); assertEquals(workflowDefinition.id, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_ID));
assertEquals("api/workflow-definition/" + workflowDefinition.id, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_URL)); assertEquals("api/workflow-definitions/" + workflowDefinition.id, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_URL));
assertEquals(workflowDefinition.name, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_NAME)); assertEquals(workflowDefinition.name, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_NAME));
assertEquals(workflowDefinition.title, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_TITLE)); assertEquals(workflowDefinition.title, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_TITLE));
assertEquals(workflowDefinition.description, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_DESCRIPTION)); assertEquals(workflowDefinition.description, model.get(WorkflowModelBuilder.WORKFLOW_DEFINITION_DESCRIPTION));