mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 10:34:25 +00:00
[DS-968] XML configurable workflow
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6526 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -39,6 +39,8 @@ import org.dspace.storage.rdbms.DatabaseManager;
|
||||
import org.dspace.storage.rdbms.TableRow;
|
||||
import org.dspace.storage.rdbms.TableRowIterator;
|
||||
import org.dspace.workflow.WorkflowItem;
|
||||
import org.dspace.xmlworkflow.storedcomponents.CollectionRole;
|
||||
import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem;
|
||||
|
||||
/**
|
||||
* Class representing a collection.
|
||||
@@ -1121,25 +1123,38 @@ public class Collection extends DSpaceObject
|
||||
// Remove all authorization policies
|
||||
AuthorizeManager.removeAllPolicies(ourContext, this);
|
||||
|
||||
// Remove any WorkflowItems
|
||||
WorkflowItem[] wfarray = WorkflowItem
|
||||
.findByCollection(ourContext, this);
|
||||
if(ConfigurationManager.getProperty("workflow","workflow.framework").equals("xmlworkflow")){
|
||||
// Remove any xml_WorkflowItems
|
||||
XmlWorkflowItem[] xmlWfarray = XmlWorkflowItem
|
||||
.findByCollection(ourContext, this);
|
||||
|
||||
for (int x = 0; x < wfarray.length; x++)
|
||||
{
|
||||
// remove the workflowitem first, then the item
|
||||
Item myItem = wfarray[x].getItem();
|
||||
wfarray[x].deleteWrapper();
|
||||
myItem.delete();
|
||||
for (XmlWorkflowItem aXmlWfarray : xmlWfarray) {
|
||||
// remove the workflowitem first, then the item
|
||||
Item myItem = aXmlWfarray.getItem();
|
||||
aXmlWfarray.deleteWrapper();
|
||||
myItem.delete();
|
||||
}
|
||||
}else{
|
||||
// Remove any WorkflowItems
|
||||
WorkflowItem[] wfarray = WorkflowItem
|
||||
.findByCollection(ourContext, this);
|
||||
|
||||
for (WorkflowItem aWfarray : wfarray) {
|
||||
// remove the workflowitem first, then the item
|
||||
Item myItem = aWfarray.getItem();
|
||||
aWfarray.deleteWrapper();
|
||||
myItem.delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Remove any WorkspaceItems
|
||||
WorkspaceItem[] wsarray = WorkspaceItem.findByCollection(ourContext,
|
||||
this);
|
||||
|
||||
for (int x = 0; x < wsarray.length; x++)
|
||||
{
|
||||
wsarray[x].deleteAll();
|
||||
for (WorkspaceItem aWsarray : wsarray) {
|
||||
aWsarray.deleteAll();
|
||||
}
|
||||
|
||||
// get rid of the content count cache if it exists
|
||||
@@ -1157,7 +1172,14 @@ public class Collection extends DSpaceObject
|
||||
|
||||
// Remove any Handle
|
||||
HandleManager.unbindHandle(ourContext, this);
|
||||
|
||||
|
||||
if(ConfigurationManager.getProperty("workflow","workflow.framework").equals("xmlworkflow")){
|
||||
// delete all CollectionRoles for this Collection
|
||||
for (CollectionRole collectionRole : CollectionRole.findByCollection(ourContext, this.getID())) {
|
||||
collectionRole.delete();
|
||||
}
|
||||
}
|
||||
|
||||
// Delete collection row
|
||||
DatabaseManager.delete(ourContext, collectionRow);
|
||||
|
||||
|
Reference in New Issue
Block a user