FIXED : ALF-11176: Untranslated stings in Group Review and Approve Task form

I've changed the way task descriptions are retrieved. You can now enter translations for them.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32943 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2011-12-22 12:44:41 +00:00
parent 977cb25b90
commit dcc0956e9b
3 changed files with 24 additions and 18 deletions

View File

@@ -96,9 +96,10 @@ activitiAdhoc.workflow.description=Assign arbitrary task to colleague using Acti
#
# Activiti Review And Approve Workflow
#
activitiReview.workflow.title=Review And Approve
activitiReview.workflow.description=Review and approval of content using Activiti workflow engine
activitiReview.task.approved.description=The document was reviewed and approved.
activitiReview.task.rejected.description=The document was reviewed and rejected.
#
# Parallel Review Workflow
@@ -106,6 +107,8 @@ activitiReview.workflow.description=Review and approval of content using Activit
activitiParallelReview.workflow.title=Parallel Review And Approve
activitiParallelReview.workflow.description=Parallel Review and approval of content using Activiti workflow engine
activitiParallelReview.task.approved.description=The document was reviewed and approved.
activitiParallelReview.task.rejected.description=The document was reviewed and rejected.
#
# Activiti Pooled Review Workflow
@@ -113,6 +116,8 @@ activitiParallelReview.workflow.description=Parallel Review and approval of cont
activitiReviewPooled.workflow.title=Pooled Review And Approve
activitiReviewPooled.workflow.description=Pooled review and approval of content using Activiti workflow engine
activitiReviewPooled.task.approved.description=The document was reviewed and approved.
activitiReviewPooled.task.rejected.description=The document was reviewed and rejected.
#
# Activiti Parallel Group Review Workflow
@@ -120,6 +125,8 @@ activitiReviewPooled.workflow.description=Pooled review and approval of content
activitiParallelGroupReview.workflow.title=Group Review And Approve
activitiParallelGroupReview.workflow.description=Group review and approval of content using Activiti workflow engine
activitiParallelGroupReview.task.approved.description=The document was reviewed and approved.
activitiParallelGroupReview.task.rejected.description=The document was reviewed and rejected.
#
# Activiti Publish Web Content Workflow

View File

@@ -268,7 +268,7 @@ public class WorkflowObjectFactory
public String getTaskDescription(TypeDefinition typeDefinition, String defName, String defaultDescription, String title)
{
String displayId = getProcessKey(defName) + ".task." + title;
return getLabel(displayId, DESC_LABEL, defaultDescription, typeDefinition.getTitle(), title);
return getLabel(displayId, DESC_LABEL, defaultDescription);
}

View File

@@ -238,7 +238,6 @@ public class ActivitiPropertyConverter
// Map activiti task instance fields to properties
properties.put(WorkflowModel.PROP_TASK_ID, task.getId());
properties.put(WorkflowModel.PROP_DESCRIPTION, task.getDescription());
// Since the task is never started explicitally, we use the create time
properties.put(WorkflowModel.PROP_START_DATE, task.getCreateTime());
@@ -405,21 +404,21 @@ public class ActivitiPropertyConverter
String description = (String) existingValues.get(WorkflowModel.PROP_DESCRIPTION);
if (description == null || description.length() == 0)
{
// Use the shared description set in the workflowinstance
//Try the localised task description first
String processDefinitionKey = ((ProcessDefinition) ((TaskEntity)task).getExecution().getProcessDefinition()).getKey();
description = factory.getTaskDescription(typeDefinition, factory.buildGlobalId(processDefinitionKey), null, task.getTaskDefinitionKey());
if (description != null && description.length() > 0) {
defaultValues.put(WorkflowModel.PROP_DESCRIPTION, description);
} else {
String descriptionKey = factory.mapQNameToName(WorkflowModel.PROP_WORKFLOW_DESCRIPTION);
description = (String) task.getExecution().getVariable(descriptionKey);
if (description != null && description.length() > 0)
{
if (description != null && description.length() > 0) {
defaultValues.put(WorkflowModel.PROP_DESCRIPTION, description);
} else {
defaultValues.put(WorkflowModel.PROP_DESCRIPTION, task.getName());
}
}
else
{
String processDefinitionKey = ((TaskEntity)task).getExecution().getProcessDefinition().getId();
// Revert to title in metaData
String title = factory.getTaskTitle(typeDefinition, factory.buildGlobalId(processDefinitionKey), task.getName(), task.getName());
defaultValues.put(WorkflowModel.PROP_DESCRIPTION, title);
}
}
// Assign the default values to the task
@@ -884,7 +883,7 @@ public class ActivitiPropertyConverter
ReadOnlyProcessDefinition deployedDef = activitiUtil.getDeployedProcessDefinition(processDefId);
String startEventName = deployedDef.getInitial().getId();
String wfDefKey = factory.buildGlobalId(procDefKey);
factory.getTaskDescription(startTaskType, wfDefKey, wfDescription, startEventName);
description = factory.getTaskDescription(startTaskType, wfDefKey, wfDescription, startEventName);
defaultProperties.put(WorkflowModel.PROP_DESCRIPTION, description);
}
return handlerRegistry.handleVariablesToSet(defaultProperties, startTaskType, null, Void.class);