mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +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:
@@ -975,6 +975,86 @@ public class EPerson extends DSpaceObject
|
||||
}
|
||||
}
|
||||
|
||||
if(ConfigurationManager.getProperty("workflow","workflow.framework").equals("xmlworkflow")){
|
||||
getXMLWorkflowConstraints(tableList);
|
||||
}else{
|
||||
getOriginalWorkflowConstraints(tableList);
|
||||
|
||||
}
|
||||
// the list of tables can be used to construct an error message
|
||||
// explaining to the user why the eperson cannot be deleted.
|
||||
return tableList;
|
||||
}
|
||||
|
||||
private void getXMLWorkflowConstraints(List<String> tableList) throws SQLException {
|
||||
TableRowIterator tri;
|
||||
// check for eperson in claimtask table
|
||||
tri = DatabaseManager.queryTable(myContext, "xmlwf_claimtask",
|
||||
"SELECT * from xmlwf_claimtask where owner_id= ? ",
|
||||
getID());
|
||||
|
||||
try
|
||||
{
|
||||
if (tri.hasNext())
|
||||
{
|
||||
tableList.add("xmlwf_claimtask");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
// close the TableRowIterator to free up resources
|
||||
if (tri != null)
|
||||
{
|
||||
tri.close();
|
||||
}
|
||||
}
|
||||
|
||||
// check for eperson in pooltask table
|
||||
tri = DatabaseManager.queryTable(myContext, "xmlwf_pooltask",
|
||||
"SELECT * from xmlwf_pooltask where eperson_id= ? ",
|
||||
getID());
|
||||
|
||||
try
|
||||
{
|
||||
if (tri.hasNext())
|
||||
{
|
||||
tableList.add("xmlwf_pooltask");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
// close the TableRowIterator to free up resources
|
||||
if (tri != null)
|
||||
{
|
||||
tri.close();
|
||||
}
|
||||
}
|
||||
|
||||
// check for eperson in workflowitemrole table
|
||||
tri = DatabaseManager.queryTable(myContext, "xmlwf_workflowitemrole",
|
||||
"SELECT * from xmlwf_workflowitemrole where eperson_id= ? ",
|
||||
getID());
|
||||
|
||||
try
|
||||
{
|
||||
if (tri.hasNext())
|
||||
{
|
||||
tableList.add("xmlwf_workflowitemrole");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
// close the TableRowIterator to free up resources
|
||||
if (tri != null)
|
||||
{
|
||||
tri.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void getOriginalWorkflowConstraints(List<String> tableList) throws SQLException {
|
||||
TableRowIterator tri;
|
||||
// check for eperson in workflowitem table
|
||||
tri = DatabaseManager.query(myContext,
|
||||
"SELECT * from workflowitem where owner= ? ",
|
||||
@@ -1016,10 +1096,6 @@ public class EPerson extends DSpaceObject
|
||||
tri.close();
|
||||
}
|
||||
}
|
||||
|
||||
// the list of tables can be used to construct an error message
|
||||
// explaining to the user why the eperson cannot be deleted.
|
||||
return tableList;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
|
Reference in New Issue
Block a user