Class BagItRolesUtil


  • public class BagItRolesUtil
    extends Object
    Create a DSpaceRoles for a BagIt bag Uses RoleDisseminator as a reference for obtaining groups/epeople
    Author:
    mikejritter
    • Constructor Detail

      • BagItRolesUtil

        public BagItRolesUtil()
    • Method Detail

      • getDSpaceRoles

        public static DSpaceRoles getDSpaceRoles​(org.dspace.core.Context context,
                                                 org.dspace.content.Site site)
                                          throws SQLException,
                                                 org.dspace.content.packager.PackageException
        Retrieve all roles in a DSpace site. Gets all Groups and EPersons.
        Parameters:
        context - the context to use
        site - the Site to get all roles for
        Returns:
        the DSpaceRoles
        Throws:
        SQLException - if there are any errors querying the database
        org.dspace.content.packager.PackageException - if there are any errors translating group names
      • getDSpaceRoles

        public static DSpaceRoles getDSpaceRoles​(org.dspace.core.Context context,
                                                 org.dspace.content.Community community)
                                          throws SQLException,
                                                 org.dspace.content.packager.PackageException
        Retrieve all roles for a Community. Only queries for Groups which belong to the given Community.
        Parameters:
        context - the context to use
        community - the community to retrieve the roles for
        Returns:
        the DSpaceRoles
        Throws:
        SQLException - if there is an error querying the database
        org.dspace.content.packager.PackageException - if there is an error translating group names
      • getDSpaceRoles

        public static DSpaceRoles getDSpaceRoles​(org.dspace.core.Context context,
                                                 org.dspace.content.Collection collection)
                                          throws SQLException,
                                                 org.dspace.content.packager.PackageException
        Retrieve all roles for a Collection. Only queries for Groups which belong to the given Collection.
        Parameters:
        context - the context to use
        collection - the collection to get the roles for
        Returns:
        the DSpaceRoles
        Throws:
        SQLException - if there is an error querying the database
        org.dspace.content.packager.PackageException - if there is an error translating group names
      • ingest

        public static void ingest​(org.dspace.core.Context context,
                                  org.dspace.content.DSpaceObject dso,
                                  Path xml)
                           throws IOException,
                                  SQLException,
                                  org.dspace.content.packager.PackageException,
                                  org.dspace.authorize.AuthorizeException
        Ingest an xml file and search for any DSpaceRoles. This is essentially a pass through to RoleIngester.ingestStream(org.dspace.core.Context, org.dspace.content.DSpaceObject, org.dspace.content.packager.PackageParameters, java.io.InputStream) as the DSpaceRoles schema is well defined.
        Parameters:
        context - the context to use
        dso - the DSpaceObject to ingest roles on
        xml - the path to the xml files containing the DSpaceRoles
        Throws:
        IOException - if there is an error reading the xml file
        SQLException - if there is an error querying the database
        org.dspace.content.packager.PackageException - if there is an error translating a group name
        org.dspace.authorize.AuthorizeException - if there is an authorization error