Package org.dspace.license
Class CCLicenseConnectorServiceImpl
java.lang.Object
org.dspace.license.CCLicenseConnectorServiceImpl
- All Implemented Interfaces:
CCLicenseConnectorService,InitializingBean
public class CCLicenseConnectorServiceImpl
extends Object
implements CCLicenseConnectorService, InitializingBean
Implementation for the Creative commons license connector service.
This class is responsible for all the calls to the CC license API and parsing the response
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidretrieveLicenseName(org.jdom2.Document doc) Retrieve the license Name from the license documentorg.jdom2.DocumentretrieveLicenseRDFDoc(String licenseURI) Retrieve the license RDF document based on the license URIretrieveLicenses(String language) Retrieves the CC Licenses for the provided language from the CC License APIRetrieve the CC License URI based on the provided license id, language and answers to the field questions from the CC License API
-
Field Details
-
parser
protected org.jdom2.input.SAXBuilder parser
-
-
Constructor Details
-
CCLicenseConnectorServiceImpl
public CCLicenseConnectorServiceImpl()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
Exception
-
retrieveLicenses
Retrieves the CC Licenses for the provided language from the CC License API- Specified by:
retrieveLicensesin interfaceCCLicenseConnectorService- Parameters:
language- - the language to retrieve the licenses for- Returns:
- a map of licenses with the id and the license for the provided language
-
retrieveRightsByQuestion
public String retrieveRightsByQuestion(String licenseId, String language, Map<String, String> answerMap) Retrieve the CC License URI based on the provided license id, language and answers to the field questions from the CC License API- Specified by:
retrieveRightsByQuestionin interfaceCCLicenseConnectorService- Parameters:
licenseId- - the ID of the licenselanguage- - the language for which to retrieve the full answerMapanswerMap- - the answers to the different field questions- Returns:
- the CC License URI
-
retrieveLicenseRDFDoc
Retrieve the license RDF document based on the license URI- Specified by:
retrieveLicenseRDFDocin interfaceCCLicenseConnectorService- Parameters:
licenseURI- - The license URI for which to retrieve the license RDF document- Returns:
- the license RDF document
- Throws:
IOException
-
retrieveLicenseName
Retrieve the license Name from the license document- Specified by:
retrieveLicenseNamein interfaceCCLicenseConnectorService- Parameters:
doc- - The license document from which to retrieve the license name- Returns:
- the license name
-