Interface CreativeCommonsService

  • All Known Implementing Classes:
    CreativeCommonsServiceImpl

    public interface CreativeCommonsService
    Service interface class for the Creative commons licensing. The implementation of this class is responsible for all business logic calls for the Creative commons licensing and is autowired by spring
    Author:
    kevinvandevelde at atmire.com
    • Method Detail

      • isEnabled

        boolean isEnabled()
        Simple accessor for enabling of CC
        Returns:
        is CC enabled?
      • setLicenseRDF

        void setLicenseRDF​(Context context,
                           Item item,
                           String licenseRdf)
                    throws SQLException,
                           IOException,
                           AuthorizeException
        setLicenseRDF CC Web Service method for setting the RDF bitstream
        Parameters:
        context - The relevant DSpace Context.
        item - The item to set license on.
        licenseRdf - license RDF string
        Throws:
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        SQLException - An exception that provides information on a database access error or other errors.
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
      • setLicense

        void setLicense​(Context context,
                        Item item,
                        InputStream licenseStm,
                        String mimeType)
                 throws SQLException,
                        IOException,
                        AuthorizeException
        Used by DSpaceMetsIngester
        Parameters:
        context - The relevant DSpace Context.
        item - The item to set license on.
        licenseStm - InputStream with the license text.
        mimeType - License text file MIME type ("text/xml", "text/rdf" or generic)
        Throws:
        SQLException - if database error An exception that provides information on a database access error or other errors.
        IOException - if IO error A general class of exceptions produced by failed or interrupted I/O operations.
        AuthorizeException - if authorization error Exception indicating the current user of the context does not have permission to perform a particular action. * // PATCHED 12/01 FROM JIRA re: mimetypes for CCLicense and License RDF wjb
      • getLicenseRdfBitstream

        Bitstream getLicenseRdfBitstream​(Item item)
                                  throws SQLException,
                                         IOException,
                                         AuthorizeException
        Get Creative Commons license RDF, returning Bitstream object.
        Parameters:
        item - bitstream's parent item
        Returns:
        bitstream or null.
        Throws:
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        SQLException - An exception that provides information on a database access error or other errors.
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
      • getLicenseTextBitstream

        Bitstream getLicenseTextBitstream​(Item item)
                                   throws SQLException,
                                          IOException,
                                          AuthorizeException
        Deprecated.
        to make uniform JSPUI and XMLUI approach the bitstream with the license in the textual format it is no longer stored (see https://jira.duraspace.org/browse/DS-2604)
        Get Creative Commons license Text, returning Bitstream object.
        Parameters:
        item - bitstream's parent item
        Returns:
        bitstream or null.
        Throws:
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        SQLException - An exception that provides information on a database access error or other errors.
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
      • getCCField

        LicenseMetadataValue getCCField​(String fieldId)
        Get a few license-specific properties. We expect these to be cached at least per server run.
        Parameters:
        fieldId - name of the property.
        Returns:
        its value.
      • fetchLicenseRDF

        String fetchLicenseRDF​(org.jdom.Document license)
        Apply same transformation on the document to retrieve only the most relevant part of the document passed as parameter. If no transformation is needed then take in consideration to empty the CreativeCommons.xml
        Parameters:
        license - - an element that could be contains as part of your content the license rdf
        Returns:
        the document license in textual format after the transformation
      • removeLicense

        void removeLicense​(Context context,
                           LicenseMetadataValue uriField,
                           LicenseMetadataValue nameField,
                           Item item)
                    throws AuthorizeException,
                           IOException,
                           SQLException
        Remove license information, delete also the bitstream
        Parameters:
        context - - DSpace Context
        uriField - - the metadata field for license uri
        nameField - - the metadata field for license name
        item - - the item
        Throws:
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        SQLException - An exception that provides information on a database access error or other errors.