Package org.dspace.license.service
Interface CreativeCommonsService
-
- All Known Implementing Classes:
CreativeCommonsServiceImpl
public interface CreativeCommonsServiceService 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
-
-
Field Summary
Fields Modifier and Type Field Description static StringCC_BUNDLE_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description StringfetchLicenseRDF(org.jdom.Document license)Apply same transformation on the document to retrieve only the most relevant part of the document passed as parameter.LicenseMetadataValuegetCCField(String fieldId)Get a few license-specific properties.StringgetLicenseRDF(Context context, Item item)BitstreamgetLicenseRdfBitstream(Item item)Get Creative Commons license RDF, returning Bitstream object.BitstreamgetLicenseTextBitstream(Item item)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)StringgetLicenseURL(Context context, Item item)booleanhasLicense(Context context, Item item)booleanisEnabled()Simple accessor for enabling of CCvoidremoveLicense(Context context, Item item)voidremoveLicense(Context context, LicenseMetadataValue uriField, LicenseMetadataValue nameField, Item item)Remove license information, delete also the bitstreamvoidsetLicense(Context context, Item item, InputStream licenseStm, String mimeType)Used by DSpaceMetsIngestervoidsetLicenseRDF(Context context, Item item, String licenseRdf)setLicenseRDF CC Web Service method for setting the RDF bitstream
-
-
-
Field Detail
-
CC_BUNDLE_NAME
static final String CC_BUNDLE_NAME
- See Also:
- Constant Field Values
-
-
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
-
removeLicense
void removeLicense(Context context, Item item) throws SQLException, IOException, AuthorizeException
-
hasLicense
boolean hasLicense(Context context, Item item) throws SQLException, IOException
- Throws:
SQLExceptionIOException
-
getLicenseURL
String getLicenseURL(Context context, Item item) throws SQLException, IOException, AuthorizeException
-
getLicenseRDF
String getLicenseRDF(Context context, Item item) throws SQLException, IOException, AuthorizeException
-
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 ContexturiField- - the metadata field for license urinameField- - the metadata field for license nameitem- - 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.
-
-