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 |
protected static String |
BSN_LICENSE_URL
Some BitStream Names (BSN)
|
protected BundleService |
bundleService |
protected static String |
CC_BS_SOURCE
The Bundle Name
|
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(String ccResult) |
String |
fetchLicenseRDF(String license_url) |
String |
fetchLicenseText(String license_url)
Get a few license-specific properties.
|
protected byte[] |
fetchURL(String url_string)
Fetch the contents of a URL
|
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.
|
String |
getLicenseText(Context context,
Item item) |
Bitstream |
getLicenseTextBitstream(Item item)
Get Creative Commons license Text, returning Bitstream object.
|
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) |
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 |
setLicense(Context context,
Item item,
String cc_license_url)
This is a bit of the "do-the-right-thing" method for CC stuff in an item
|
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
protected static final String BSN_LICENSE_URL
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
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, String cc_license_url) throws SQLException, IOException, AuthorizeException
CreativeCommonsServicesetLicense in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic void setLicense(Context context, Item item, InputStream licenseStm, String mimeType) throws SQLException, IOException, AuthorizeException
CreativeCommonsServicesetLicense in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeException - * // 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 getLicenseURL(Context context, Item item) throws SQLException, IOException, AuthorizeException
getLicenseURL in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic String getLicenseText(Context context, Item item) throws SQLException, IOException, AuthorizeException
getLicenseText in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic 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 CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic Bitstream getLicenseTextBitstream(Item item) throws SQLException, IOException, AuthorizeException
CreativeCommonsServicegetLicenseTextBitstream in interface CreativeCommonsServiceSQLExceptionIOExceptionAuthorizeExceptionpublic String fetchLicenseRdf(String ccResult)
fetchLicenseRdf in interface CreativeCommonsServicepublic String fetchLicenseText(String license_url)
CreativeCommonsServicefetchLicenseText in interface CreativeCommonsServicepublic String fetchLicenseRDF(String license_url)
fetchLicenseRDF in interface CreativeCommonsServiceprotected 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
protected byte[] fetchURL(String url_string)
public LicenseMetadataValue getCCField(String fieldId)
getCCField in interface CreativeCommonsServiceCopyright © 2016 DuraSpace. All Rights Reserved.