First set of workflow UI changes following Linton's review.

- (No Message) now shown when the user did not enter a message when workflow was started (only for workflows at the moment, tasks TBD)
- Removed timestamps from due dates in workflow details

Also renamed task.lib.ftl to workflow.lib.ftl and combined with workflow-definition.lib.ftl

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22224 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2010-09-03 11:35:25 +00:00
parent 0ba2f894eb
commit c73b88bfae
12 changed files with 57 additions and 78 deletions

View File

@@ -72,7 +72,6 @@ public class WorkflowModelBuilder
public static final String TASK_DESCRIPTION = "description";
public static final String TASK_TITLE = "title";
public static final String TASK_NAME = "name";
public static final String TASK_TYPE = "type";
public static final String TASK_URL = "url";
public static final String TASK_IS_POOLED = "isPooled";
public static final String TASK_IS_EDITABLE = "isEditable";
@@ -94,7 +93,6 @@ public class WorkflowModelBuilder
public static final String TASK_WORKFLOW_INSTANCE_ID = "id";
public static final String TASK_WORKFLOW_INSTANCE_URL = "url";
public static final String TASK_WORKFLOW_INSTANCE_NAME = "name";
public static final String TASK_WORKFLOW_INSTANCE_TYPE = "type";
public static final String TASK_WORKFLOW_INSTANCE_TITLE = "title";
public static final String TASK_WORKFLOW_INSTANCE_DESCRIPTION = "description";
public static final String TASK_WORKFLOW_INSTANCE_MESSAGE = "message";
@@ -180,7 +178,6 @@ public class WorkflowModelBuilder
model.put(TASK_ID, task.getId());
model.put(TASK_URL, getUrl(task));
model.put(TASK_NAME, task.getName());
model.put(TASK_TYPE, task.getDefinition().getMetadata().getName().toPrefixString(this.namespaceService));
model.put(TASK_TITLE, task.getTitle());
model.put(TASK_DESCRIPTION, task.getDescription());
model.put(TASK_STATE, task.getState().name());
@@ -231,9 +228,9 @@ public class WorkflowModelBuilder
model.put(TASK_WORKFLOW_INSTANCE_ID, workflowInstance.getId());
model.put(TASK_WORKFLOW_INSTANCE_URL, getUrl(workflowInstance));
model.put(TASK_WORKFLOW_INSTANCE_NAME, workflowInstance.getDefinition().getName());
model.put(TASK_WORKFLOW_INSTANCE_TYPE, workflowInstance.getDefinition().getName());
model.put(TASK_WORKFLOW_INSTANCE_TITLE, workflowInstance.getDefinition().getTitle());
model.put(TASK_WORKFLOW_INSTANCE_DESCRIPTION, workflowInstance.getDefinition().getDescription());
model.put(TASK_WORKFLOW_INSTANCE_MESSAGE, workflowInstance.getDescription());
model.put(TASK_WORKFLOW_INSTANCE_IS_ACTIVE, workflowInstance.isActive());
model.put(TASK_WORKFLOW_INSTANCE_PRIORITY, workflowInstance.getPriority());
model.put(TASK_WORKFLOW_INSTANCE_DEFINITION_URL, getUrl(workflowInstance.getDefinition()));
@@ -283,16 +280,6 @@ public class WorkflowModelBuilder
{
model.put(TASK_WORKFLOW_INSTANCE_INITIATOR, getPersonModel(nodeService.getProperty(workflowInstance.initiator, ContentModel.PROP_USERNAME)));
}
String message = workflowInstance.getDescription();
if (message != null && message.length() > 0)
{
model.put(TASK_WORKFLOW_INSTANCE_MESSAGE, message);
}
else
{
model.put(TASK_WORKFLOW_INSTANCE_MESSAGE, workflowInstance.getDefinition().getTitle());
}
return model;
}

View File

@@ -88,8 +88,6 @@ public class WorkflowModelBuilderTest extends TestCase
assertEquals(task.getTitle(), model.get(WorkflowModelBuilder.TASK_TITLE));
assertEquals(task.getDescription(), model.get(WorkflowModelBuilder.TASK_DESCRIPTION));
assertEquals(task.getState().name(), model.get(WorkflowModelBuilder.TASK_STATE));
assertEquals(task.getDefinition().getMetadata().getName().toPrefixString(this.namespaceService),
model.get(WorkflowModelBuilder.TASK_TYPE));
assertNull(model.get(WorkflowModelBuilder.TASK_OUTCOME));
assertEquals(false, model.get(WorkflowModelBuilder.TASK_IS_POOLED));
assertEquals(false, model.get(WorkflowModelBuilder.TASK_IS_EDITABLE));
@@ -235,9 +233,9 @@ public class WorkflowModelBuilderTest extends TestCase
assertEquals(workflowInstance.getId(), model.get(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_ID));
assertTrue(model.containsKey(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_URL));
assertEquals(workflowInstance.getDefinition().getName(), model.get(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_NAME));
assertEquals(workflowInstance.getDefinition().getName(), model.get(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_TYPE));
assertEquals(workflowInstance.getDefinition().getTitle(), model.get(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_TITLE));
assertEquals(workflowInstance.getDefinition().getDescription(), model.get(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_DESCRIPTION));
assertEquals(workflowInstance.getDescription(), model.get(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_MESSAGE));
assertEquals(workflowInstance.isActive(), model.get(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_IS_ACTIVE));
assertEquals(ISO8601DateFormat.format(workflowInstance.getStartDate()), model.get(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_START_DATE));
assertEquals(ISO8601DateFormat.format(workflowInstance.getEndDate()), model.get(WorkflowModelBuilder.TASK_WORKFLOW_INSTANCE_END_DATE));

View File

@@ -136,8 +136,6 @@ public class WorkflowRestApiTest extends BaseWebScriptTest
assertEquals(task.title, result.getString("title"));
assertEquals(task.description, result.getString("description"));
assertEquals(task.state.name(), result.getString("state"));
assertEquals(task.definition.metadata.getName().toPrefixString(this.namespaceService),
result.getString("type"));
assertEquals( "api/workflow-paths/" + adhocPath.getId(), result.getString("path"));
assertFalse(result.getBoolean("isPooled"));
assertTrue(result.getBoolean("isEditable"));
@@ -186,7 +184,7 @@ public class WorkflowRestApiTest extends BaseWebScriptTest
{
JSONObject taskJSON = results.getJSONObject(i);
String type = taskJSON.getString("type");
String type = taskJSON.getString("name");
if (exclude.equals(type))
{
adhocTasksPresent = true;
@@ -234,7 +232,6 @@ public class WorkflowRestApiTest extends BaseWebScriptTest
assertEquals(startTask.title, result.getString("title"));
assertEquals(startTask.description, result.getString("description"));
assertEquals(startTask.state.name(), result.getString("state"));
assertEquals(startTask.name, result.getString("type"));
assertEquals("api/workflow-paths/" + adhocPath.getId(), result.getString("path"));
assertFalse(result.getBoolean("isPooled"));
assertTrue(result.getBoolean("isEditable"));
@@ -467,8 +464,8 @@ public class WorkflowRestApiTest extends BaseWebScriptTest
Map<QName, Serializable> params = new HashMap<QName, Serializable>();
params.put(WorkflowModel.ASSOC_ASSIGNEE, personManager.get(USER2));
Date dueDate = new Date();
params.put(WorkflowModel.PROP_DUE_DATE, dueDate);
params.put(WorkflowModel.PROP_PRIORITY, 1);
params.put(WorkflowModel.PROP_WORKFLOW_DUE_DATE, dueDate);
params.put(WorkflowModel.PROP_WORKFLOW_PRIORITY, 1);
params.put(WorkflowModel.ASSOC_PACKAGE, packageRef);
params.put(WorkflowModel.PROP_CONTEXT, packageRef);
@@ -486,15 +483,15 @@ public class WorkflowRestApiTest extends BaseWebScriptTest
assertNotNull(result);
assertEquals(adhocInstance.id, result.getString("id"));
assertTrue(result.opt("message").equals(JSONObject.NULL));
assertEquals(adhocInstance.definition.name, result.getString("name"));
assertEquals(adhocInstance.definition.name, result.getString("type"));
assertEquals(adhocInstance.definition.title, result.getString("title"));
assertEquals(adhocInstance.definition.description, result.getString("description"));
assertEquals(adhocInstance.active, result.getBoolean("isActive"));
assertEquals(ISO8601DateFormat.format(adhocInstance.startDate), result.getString("startDate"));
assertNotNull(result.getString("dueDate"));
assertNotNull(result.getString("endDate"));
assertEquals(2, result.getInt("priority"));
assertEquals(1, result.getInt("priority"));
JSONObject initiator = result.getJSONObject("initiator");
assertEquals(USER1, initiator.getString("userName"));
@@ -622,7 +619,7 @@ public class WorkflowRestApiTest extends BaseWebScriptTest
{
JSONObject workflowInstanceJSON = results.getJSONObject(i);
String type = workflowInstanceJSON.getString("type");
String type = workflowInstanceJSON.getString("name");
if (exclude.equals(type))
{
adhocWorkflowPresent = true;