mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- AWC-1090: Resources not added or removed to/from the package if the transition buttons were clicked before Save Changes.
- Fix for popup summary panel since dojo upgrade git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4986 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -160,31 +160,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("Saving task with parameters: " + params);
|
||||
|
||||
// remove any items the user selected to remove
|
||||
if (this.workflowPackage != null && this.packageItemsToRemove != null &&
|
||||
this.packageItemsToRemove.size() > 0)
|
||||
{
|
||||
for (String removedItem : this.packageItemsToRemove)
|
||||
{
|
||||
this.nodeService.removeChild(this.workflowPackage, new NodeRef(removedItem));
|
||||
}
|
||||
}
|
||||
|
||||
// add any items the user selected to add
|
||||
if (this.workflowPackage != null && this.packageItemsToAdd != null &&
|
||||
this.packageItemsToAdd.size() > 0)
|
||||
{
|
||||
for (String addedItem : this.packageItemsToAdd)
|
||||
{
|
||||
NodeRef addedNodeRef = new NodeRef(addedItem);
|
||||
this.nodeService.addChild(this.workflowPackage, addedNodeRef,
|
||||
ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
|
||||
QName.createValidLocalName((String)this.nodeService.getProperty(
|
||||
addedNodeRef, ContentModel.PROP_NAME))));
|
||||
}
|
||||
}
|
||||
|
||||
// update the task with the updated parameters
|
||||
// update the task with the updated parameters and resources
|
||||
updateResources();
|
||||
this.workflowService.updateTask(this.task.id, params, null, null);
|
||||
|
||||
return outcome;
|
||||
@@ -285,7 +262,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
Map<QName, Serializable> params = new HashMap<QName, Serializable>();
|
||||
params.put(ContentModel.PROP_OWNER, userName);
|
||||
|
||||
// update the task with the updated parameters
|
||||
// update the task with the updated parameters and resources
|
||||
updateResources();
|
||||
this.workflowService.updateTask(this.task.id, params, null, null);
|
||||
|
||||
// commit the changes
|
||||
@@ -322,7 +300,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
Map<QName, Serializable> params = new HashMap<QName, Serializable>();
|
||||
params.put(ContentModel.PROP_OWNER, null);
|
||||
|
||||
// update the task with the updated parameters
|
||||
// update the task with the updated parameters and resources
|
||||
updateResources();
|
||||
this.workflowService.updateTask(this.task.id, params, null, null);
|
||||
|
||||
// commit the changes
|
||||
@@ -378,7 +357,8 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
if (LOGGER.isDebugEnabled())
|
||||
LOGGER.debug("Transitioning task with parameters: " + params);
|
||||
|
||||
// update the task with the updated parameters
|
||||
// update the task with the updated parameters and resources
|
||||
updateResources();
|
||||
this.workflowService.updateTask(this.task.id, params, null, null);
|
||||
|
||||
// signal the selected transition to the workflow task
|
||||
@@ -827,6 +807,33 @@ public class ManageTaskDialog extends BaseDialogBean
|
||||
this.resources.add(node);
|
||||
}
|
||||
|
||||
protected void updateResources()
|
||||
{
|
||||
// remove any items the user selected to remove
|
||||
if (this.workflowPackage != null && this.packageItemsToRemove != null &&
|
||||
this.packageItemsToRemove.size() > 0)
|
||||
{
|
||||
for (String removedItem : this.packageItemsToRemove)
|
||||
{
|
||||
this.nodeService.removeChild(this.workflowPackage, new NodeRef(removedItem));
|
||||
}
|
||||
}
|
||||
|
||||
// add any items the user selected to add
|
||||
if (this.workflowPackage != null && this.packageItemsToAdd != null &&
|
||||
this.packageItemsToAdd.size() > 0)
|
||||
{
|
||||
for (String addedItem : this.packageItemsToAdd)
|
||||
{
|
||||
NodeRef addedNodeRef = new NodeRef(addedItem);
|
||||
this.nodeService.addChild(this.workflowPackage, addedNodeRef,
|
||||
ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
|
||||
QName.createValidLocalName((String)this.nodeService.getProperty(
|
||||
addedNodeRef, ContentModel.PROP_NAME))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Inner classes
|
||||
|
||||
|
Reference in New Issue
Block a user