public class CreativeCommonsServiceImpl extends Object implements CreativeCommonsService, org.springframework.beans.factory.InitializingBean
| Modifier and Type | Field and Description |
|---|---|
protected BitstreamFormatService |
bitstreamFormatService |
protected BitstreamService |
bitstreamService |
protected static String |
BSN_LICENSE_RDF |
protected static String |
BSN_LICENSE_TEXT
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)
|
protected static String |
BSN_LICENSE_URL
Deprecated.
use the metadata retrieved at
CreativeCommonsService.getCCField(String) (see https://jira.duraspace.org/browse/DS-2604) |
protected BundleService |
bundleService |
protected static String |
CC_BS_SOURCE
The Bundle Name
|
protected ConfigurationService |
configurationService |
protected ItemService |
itemService |
protected Templates |
templates |
CC_BUNDLE_NAME| Modifier | Constructor and Description |
|---|---|
protected |
CreativeCommonsServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
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.
|
protected Bitstream |
getBitstream(Item item,
String bitstream_name)
This helper method retrieves the bytes of a bitstream for an item under
the CC bundle, with the given bitstream name
|
protected byte[] |
getBytesFromBitstream(Context context,
Item item,
String bitstream_name) |
protected Bundle |
getCcBundle(Context context,
Item item) |
LicenseMetadataValue |
getCCField(String fieldId)
Returns a metadata field handle for given field Id
|
String |
getLicenseRDF(Context context,
Item item) |
Bitstream |
getLicenseRdfBitstream(Item item)
Get Creative Commons license RDF, returning Bitstream object.
|
Bitstream |
getLicenseTextBitstream(Item item)
Deprecated.
|
String |
getLicenseURL(Context context,
Item item) |
protected String |
getStringFromBitstream(Context context,
Item item,
String bitstream_name)
This helper method wraps a String around a byte array returned from the
bitstream method further down
|
boolean |
hasLicense(Context context,
Item item) |
boolean |
isEnabled()
Simple accessor for enabling of CC
|
void |
removeLicense(Context context,
Item item) |
void |
removeLicense(Context context,
LicenseMetadataValue uriField,
LicenseMetadataValue nameField,
Item item)
Remove license information, delete also the bitstream
|
protected void |
setBitstreamFromBytes(Context context,
Item item,
Bundle bundle,
String bitstream_name,
BitstreamFormat format,
byte[] bytes)
This helper method takes some bytes and stores them as a bitstream for an
item, under the CC bundle, with the given bitstream name
|
void |
setLicense(Context context,
Item item,
InputStream licenseStm,
String mimeType)
Used by DSpaceMetsIngester
|
void |
setLicenseRDF(Context context,
Item item,
String licenseRdf)
setLicenseRDF
CC Web Service method for setting the RDF bitstream
|
protected static final String CC_BS_SOURCE
@Deprecated protected static final String BSN_LICENSE_URL
CreativeCommonsService.getCCField(String) (see https://jira.duraspace.org/browse/DS-2604)@Deprecated protected static final String BSN_LICENSE_TEXT
protected static final String BSN_LICENSE_RDF
protected Templates templates
@Autowired(required=true) protected BitstreamService bitstreamService
@Autowired(required=true) protected BitstreamFormatService bitstreamFormatService
@Autowired(required=true) protected BundleService bundleService
@Autowired(required=true) protected ItemService itemService
protected ConfigurationService configurationService
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic boolean isEnabled()
CreativeCommonsServiceisEnabled in interface CreativeCommonsServiceprotected Bundle getCcBundle(Context context, Item item) throws SQLException, AuthorizeException, IOException
public void setLicenseRDF(Context context, Item item, String licenseRdf) throws SQLException, IOException, AuthorizeException
CreativeCommonsServicesetLicenseRDF in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic void setLicense(Context context, Item item, InputStream licenseStm, String mimeType) throws SQLException, IOException, AuthorizeException
CreativeCommonsServicesetLicense in interface CreativeCommonsServiceSQLException - if database errorIOException - if IO errorAuthorizeException - if authorization error
* // PATCHED 12/01 FROM JIRA re: mimetypes for CCLicense and License RDF wjbpublic void removeLicense(Context context, Item item) throws SQLException, IOException, AuthorizeException
removeLicense in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic boolean hasLicense(Context context, Item item) throws SQLException, IOException
hasLicense in interface CreativeCommonsServiceSQLExceptionIOExceptionpublic String getLicenseRDF(Context context, Item item) throws SQLException, IOException, AuthorizeException
getLicenseRDF in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic Bitstream getLicenseRdfBitstream(Item item) throws SQLException, IOException, AuthorizeException
CreativeCommonsServicegetLicenseRdfBitstream in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeException@Deprecated public Bitstream getLicenseTextBitstream(Item item) throws SQLException, IOException, AuthorizeException
CreativeCommonsServicegetLicenseTextBitstream in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic String getLicenseURL(Context context, Item item) throws SQLException, IOException, AuthorizeException
getLicenseURL in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic String fetchLicenseRDF(org.jdom.Document license)
CreativeCommonsServicefetchLicenseRDF in interface CreativeCommonsServicelicense - - an element that could be contains as part of your content
the license rdfprotected void setBitstreamFromBytes(Context context, Item item, Bundle bundle, String bitstream_name, BitstreamFormat format, byte[] bytes) throws SQLException, IOException, AuthorizeException
protected String getStringFromBitstream(Context context, Item item, String bitstream_name) throws SQLException, IOException, AuthorizeException
protected Bitstream getBitstream(Item item, String bitstream_name) throws SQLException, IOException, AuthorizeException
protected byte[] getBytesFromBitstream(Context context, Item item, String bitstream_name) throws SQLException, IOException, AuthorizeException
public LicenseMetadataValue getCCField(String fieldId)
getCCField in interface CreativeCommonsServicepublic void removeLicense(Context context, LicenseMetadataValue uriField, LicenseMetadataValue nameField, Item item) throws AuthorizeException, IOException, SQLException
CreativeCommonsServiceremoveLicense in interface CreativeCommonsServicecontext - - DSpace ContexturiField - - the metadata field for license urinameField - - the metadata field for license nameitem - - the itemAuthorizeExceptionIOExceptionSQLExceptionCopyright © 2016 DuraSpace. All rights reserved.