- 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:
Gavin Cornwell
2007-01-31 15:44:38 +00:00
parent 39f1eebcf0
commit 5b92ec9b0b
2 changed files with 37 additions and 30 deletions

View File

@@ -160,31 +160,8 @@ public class ManageTaskDialog extends BaseDialogBean
if (LOGGER.isDebugEnabled()) if (LOGGER.isDebugEnabled())
LOGGER.debug("Saving task with parameters: " + params); LOGGER.debug("Saving task with parameters: " + params);
// remove any items the user selected to remove // update the task with the updated parameters and resources
if (this.workflowPackage != null && this.packageItemsToRemove != null && updateResources();
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
this.workflowService.updateTask(this.task.id, params, null, null); this.workflowService.updateTask(this.task.id, params, null, null);
return outcome; return outcome;
@@ -285,7 +262,8 @@ public class ManageTaskDialog extends BaseDialogBean
Map<QName, Serializable> params = new HashMap<QName, Serializable>(); Map<QName, Serializable> params = new HashMap<QName, Serializable>();
params.put(ContentModel.PROP_OWNER, userName); 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); this.workflowService.updateTask(this.task.id, params, null, null);
// commit the changes // commit the changes
@@ -322,7 +300,8 @@ public class ManageTaskDialog extends BaseDialogBean
Map<QName, Serializable> params = new HashMap<QName, Serializable>(); Map<QName, Serializable> params = new HashMap<QName, Serializable>();
params.put(ContentModel.PROP_OWNER, null); 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); this.workflowService.updateTask(this.task.id, params, null, null);
// commit the changes // commit the changes
@@ -378,7 +357,8 @@ public class ManageTaskDialog extends BaseDialogBean
if (LOGGER.isDebugEnabled()) if (LOGGER.isDebugEnabled())
LOGGER.debug("Transitioning task with parameters: " + params); 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); this.workflowService.updateTask(this.task.id, params, null, null);
// signal the selected transition to the workflow task // signal the selected transition to the workflow task
@@ -827,6 +807,33 @@ public class ManageTaskDialog extends BaseDialogBean
this.resources.add(node); 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 // Inner classes

View File

@@ -38,7 +38,7 @@ function showNodeInfoHandler(type, data, evt)
var div = document.createElement("div"); var div = document.createElement("div");
// get the position of the element we are showing info for // get the position of the element we are showing info for
var pos = dojo.style.getAbsolutePosition(_launchElement, false); var pos = dojo.html.getAbsolutePosition(_launchElement, false);
// setup the div with the correct appearance // setup the div with the correct appearance
div.innerHTML = data; div.innerHTML = data;
@@ -52,7 +52,7 @@ function showNodeInfoHandler(type, data, evt)
// is there a better way of doing this, dojo.dom.insertBefore?? // is there a better way of doing this, dojo.dom.insertBefore??
var body = document.getElementsByTagName("body")[0]; var body = document.getElementsByTagName("body")[0];
dojo.style.setOpacity(div, 0); dojo.html.setOpacity(div, 0);
_popupElement = div; _popupElement = div;
body.appendChild(div); body.appendChild(div);