Forwarding to dspace-tech.

---------- Forwarded message ----------
From: Jonathan Blood <[email protected]>
Date: Thu, Oct 11, 2012 at 1:14 PM
Subject: Re: [Dspace-tech] error with cwf_collectionrole
To: [email protected]


Hi,

I had this issue happen also. The "cwf_collectionrole" relation
doesn't exist. The configurable XMLWorkflow is disabled so references
to this table shouldn't happen. I ran the possible fix above and it
didn't work or I misunderstood the fix. I managed to fix the problem
myself with the following code changes in FlowContainerUtils.java :
Replace the method processDeleteCollectionRole with:
/**
* Delete one of collection's roles
*
* @param context The current DSpace context.
* @param collectionID The collection id.
* @param roleName ADMIN, WF_STEP1, WF_STEP2, WF_STEP3, SUBMIT, DEFAULT_READ.
* @param groupID The id of the group associated with this role.
* @return A process result's object.
*/
public static FlowResult processDeleteCollectionRole(Context context,
int collectionID, String roleName, int groupID) throws SQLException,
UIException, IOException, AuthorizeException
{
FlowResult result = new FlowResult();

Collection collection = Collection.find(context, collectionID);
Group role = Group.find(context, groupID);

// First, Unregister the role
if (ROLE_ADMIN.equals(roleName))
{
collection.removeAdministrators();
}
else if (ROLE_SUBMIT.equals(roleName))
{
collection.removeSubmitters();
}

if (ConfigurationManager.getProperty("workflow",
"workflow.framework").equals("xmlworkflow"))
{
WorkflowUtils.deleteRoleGroup(context, collectionID, roleName);
}
else
{
if (ROLE_WF_STEP1.equals(roleName))
{
collection.setWorkflowGroup(1, null);
}
else if (ROLE_WF_STEP2.equals(roleName))
{
collection.setWorkflowGroup(2, null);
}
else if (ROLE_WF_STEP3.equals(roleName))
{
collection.setWorkflowGroup(3, null);
}
}

// Second, remove all authorizations for this role by searching for
all policies that this
// group has on the collection and remove them otherwise the delete
will fail because
// there are dependencies.
@SuppressWarnings("unchecked") // the cast is correct
List<ResourcePolicy> policies = AuthorizeManager.getPolicies(context,
collection);
for (ResourcePolicy policy : policies)
{
if (policy.getGroupID() == groupID)
{
policy.delete();
}
}

// Finally, Delete the role's actual group.
collection.update();
role.delete();
context.commit();

result.setContinue(true);
result.setOutcome(true);
result.setMessage(new Message("default", "The role was successfully deleted."));
return result;
}

--
Developer
Enovation Solutions Ltd
The Friary, Bow Street, Dublin 7. (www.enovation.ie)
Skype:blood_jonathan

18 Rue Pasquier, Paris, 75008. (www.enovationsolutions.fr)

P: +33 (0)1 78 41 51 48  F: +33 (0)1 78 41 44 40

ISO 9001:2008 Quality Management Certification –Hosting, Project
Management Services and Delivery of Open Source Solutions

eLearning Solutions – Certified Moodle Partner
Enterprise Document Management – Certified Alfresco Partner
Web Content Management Solutions – Integrated Drupal Solutions

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to