Package org.dspace.xmlworkflow.storedcomponents

Examples of org.dspace.xmlworkflow.storedcomponents.CollectionRole


    /*
     * Creates a role for a collection by linking a group of epersons to a role ID
     */
    public static void createCollectionWorkflowRole(Context context, int collectionId, String roleId, Group group) throws AuthorizeException, SQLException {
        CollectionRole ass = CollectionRole.create(context);
        ass.setCollectionId(collectionId);
        ass.setRoleId(roleId);
        ass.setGroupId(group);
        ass.update();
    }
View Full Code Here


     */
    public static void deleteRoleGroup(Context context, Collection collection, String roleID) throws SQLException, IOException, WorkflowConfigurationException {
        Workflow workflow = WorkflowFactory.getWorkflow(collection);
        Role role = workflow.getRoles().get(roleID);
        if(role.getScope() == Role.Scope.COLLECTION){
            CollectionRole ass = CollectionRole.find(context, collection.getID(), roleID);
            ass.delete();
        }
    }
View Full Code Here

    public static Group getRoleGroup(Context context, int collectionId, Role role) throws SQLException {
        if(role.getScope() == Role.Scope.REPOSITORY){
            return Group.findByName(context, role.getName());
        }else
        if(role.getScope() == Role.Scope.COLLECTION){
            CollectionRole collectionRole = CollectionRole.find(context, collectionId, role.getId());
        if(collectionRole == null)
            return null;

            return collectionRole.getGroup();
        }else
        if(role.getScope() == Role.Scope.ITEM){

        }
        return null;
View Full Code Here

TOP

Related Classes of org.dspace.xmlworkflow.storedcomponents.CollectionRole

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.