diff --git a/dspace-api/src/main/java/org/dspace/license/CCLicenseCSVRepository.java b/dspace-api/src/main/java/org/dspace/license/CCLicenseCSVRepository.java
new file mode 100644
index 000000000000..259515a9c44a
--- /dev/null
+++ b/dspace-api/src/main/java/org/dspace/license/CCLicenseCSVRepository.java
@@ -0,0 +1,197 @@
+/**
+ * The contents of this file are subject to the license and copyright
+ * detailed in the LICENSE and NOTICE files at the root of the source
+ * tree and available online at
+ *
+ * http://www.dspace.org/license/
+ */
+package org.dspace.license;
+
+import java.io.FileReader;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import com.opencsv.CSVReader;
+import org.dspace.services.ConfigurationService;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * Loads the entire CSV into this bean that way we don't have to keep calling it and can utilize helper functions
+ */
+public class CCLicenseCSVRepository implements InitializingBean {
+
+ @Autowired
+ private ConfigurationService configurationService;
+
+ private List rows;
+
+ private Map> byVersion = new HashMap<>();
+ private Map byIdentifier = new HashMap<>();
+ private Map byUri = new HashMap<>();
+ private List entryPoints = new ArrayList<>();
+ private Map licenseUriIndex = new HashMap<>();
+
+ @Override
+ public void afterPropertiesSet() throws Exception {
+ loadCsv();
+ buildIndexes();
+ }
+
+ /**
+ * Loads the Creative Commons license CSV file from the configured path and
+ * converts each row into a {@link CCLicenseCSVRow}.
+ *
+ * The CSV header is used to dynamically map column names to indices.
+ * All parsed rows are stored in memory for later indexing and lookup.
+ *
+ * @throws Exception if the CSV file cannot be read or parsed
+ */
+ private void loadCsv() throws Exception {
+ String csvPath = configurationService.getProperty("dspace.cc-license.csv");
+
+ List result = new ArrayList<>();
+
+ try (CSVReader reader = new CSVReader(new FileReader(csvPath, StandardCharsets.UTF_8))) {
+ String[] header = reader.readNext();
+ Map col = mapHeader(header);
+
+ int i = 1;
+ String[] row;
+ while ((row = reader.readNext()) != null) {
+ CCLicenseCSVRow r = new CCLicenseCSVRow();
+ r.setId("license" + i);
+ r.setCategory(row[col.get("CATEGORY")]);
+ r.setVersion(row[col.get("VERSION")]);
+ r.setUnit(row[col.get("UNIT")]);
+ r.setJurisdiction(row[col.get("JURISDICTION")]);
+ r.setUrl(row[col.get("CANONICAL_URL")]);
+ r.setIdentifier(row[col.get("IDENTIFIER")]);
+ r.setTitle(row[col.get("TITLE")]);
+ r.setEntryPoint(row[col.get("ENTRY_POINT")]);
+ i++;
+ result.add(r);
+ }
+ }
+
+ this.rows = List.copyOf(result);
+ }
+
+ /**
+ * Builds in-memory lookup indexes from the loaded CSV rows.
+ *
+ * This method populates:
+ *
+ * {@code byVersion} for grouping licenses by version
+ * {@code byIdentifier} for direct lookup of special licenses
+ * {@code entryPoints} for UI entry-point licenses
+ * {@code licenseUriIndex} for fast version/unit/jurisdiction lookup
+ *
+ *
+ */
+ private void buildIndexes() {
+ for (CCLicenseCSVRow row : rows) {
+
+ // version grouping (for CC)
+ byVersion.computeIfAbsent(row.getVersion(), k -> new ArrayList<>()).add(row);
+
+ // identifier lookup (for PD)
+ byIdentifier.put(row.getId(), row);
+
+ byUri.put(normalizeUri(row.getUrl()), row);
+
+ // entry points
+ if (row.getEntryPoint() != null && !row.getEntryPoint().isBlank()) {
+ entryPoints.add(row);
+ }
+
+ String key = buildKey(row.getVersion(), row.getUnit(), row.getJurisdiction());
+ licenseUriIndex.put(key, row.getUrl());
+ }
+ }
+
+ /**
+ * Builds a composite lookup key for license URI indexing.
+ *
+ * The key format is:
+ *
+ * version|unit|jurisdiction
+ *
+ *
+ * Null values are normalized to empty strings and all parts are trimmed.
+ *
+ * @param version the Creative Commons version (e.g., "4.0", "3.0")
+ * @param unit the license unit (e.g., "by-nc-sa")
+ * @param jurisdiction the jurisdiction code (e.g., "us", "de"), may be empty
+ * @return a normalized composite key used for internal map lookups
+ */
+ private String buildKey(String version, String unit, String jurisdiction) {
+ return (version == null ? "" : version.trim()) + "|" +
+ (unit == null ? "" : unit.trim()) + "|" +
+ (jurisdiction == null ? "" : jurisdiction.trim());
+ }
+
+ public List getEntryPoints() {
+ return entryPoints;
+ }
+
+ public CCLicenseCSVRow getByIdentifier(String id) {
+ return byIdentifier.get(id);
+ }
+
+ public String findUri(String version, String unit, String jurisdiction) {
+ String key = buildKey(version, unit, jurisdiction);
+ return licenseUriIndex.get(key);
+ }
+
+ public List getJurisdictionsByVersion(String version) {
+ return rows.stream()
+ .filter(r -> version.equals(r.getVersion()))
+ .map(CCLicenseCSVRow::getJurisdiction)
+ .filter(j -> j != null && !j.isBlank())
+ .distinct()
+ .collect(Collectors.toList());
+ }
+
+ public CCLicenseCSVRow getByURI(String uri) {
+ return byUri.get(normalizeUri(uri));
+ }
+
+ /**
+ * Normalises a license URI for lookup. The retired CC API issued http URIs, which existing items still
+ * carry, and URIs entered by hand often lack the trailing slash; the CSV holds the canonical https form.
+ *
+ * @param uri the license URI
+ * @return the URI with an https scheme and a trailing slash, or null for a null URI
+ */
+ private static String normalizeUri(String uri) {
+ if (uri == null) {
+ return null;
+ }
+ String normalized = uri.trim().replaceFirst("(?i)^http://", "https://");
+ return normalized.endsWith("/") ? normalized : normalized + "/";
+ }
+
+ /**
+ * Maps CSV header column names to their corresponding index positions.
+ *
+ * This allows the CSV parser to reference columns by name rather than
+ * relying on fixed ordering.
+ *
+ * Header values are normalized by removing surrounding quotation marks.
+ *
+ * @param header the first row of the CSV file containing column names
+ * @return a map of column name to zero-based column index
+ */
+ private Map mapHeader(String[] header) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < header.length; i++) {
+ map.put(header[i].replace("\"", ""), i);
+ }
+ return map;
+ }
+}
diff --git a/dspace-api/src/main/java/org/dspace/license/CCLicenseCSVRow.java b/dspace-api/src/main/java/org/dspace/license/CCLicenseCSVRow.java
new file mode 100644
index 000000000000..35db72a20a04
--- /dev/null
+++ b/dspace-api/src/main/java/org/dspace/license/CCLicenseCSVRow.java
@@ -0,0 +1,101 @@
+/**
+ * The contents of this file are subject to the license and copyright
+ * detailed in the LICENSE and NOTICE files at the root of the source
+ * tree and available online at
+ *
+ * http://www.dspace.org/license/
+ */
+package org.dspace.license;
+
+/**
+ * Represents a single row in the Creative Commons license CSV configuration.
+ *
+ * This class is used as an in-memory representation of the CSV schema and
+ * acts as the source of truth for CC license metadata loaded at startup.
+ *
+ * Each instance maps directly to one row in the CSV file and is used to
+ * build lookup indexes for license resolution (version, unit, jurisdiction).
+ */
+public class CCLicenseCSVRow {
+ private String id;
+ private String category;
+ private String version;
+ private String unit;
+ private String jurisdiction;
+ private String url;
+ private String identifier;
+ private String title;
+ private String entryPoint;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public String getUnit() {
+ return unit;
+ }
+
+ public void setUnit(String unit) {
+ this.unit = unit;
+ }
+
+ public String getJurisdiction() {
+ return jurisdiction;
+ }
+
+ public void setJurisdiction(String jurisdiction) {
+ this.jurisdiction = jurisdiction;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getIdentifier() {
+ return identifier;
+ }
+
+ public void setIdentifier(String identifier) {
+ this.identifier = identifier;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getEntryPoint() {
+ return entryPoint;
+ }
+
+ public void setEntryPoint(String entryPoint) {
+ this.entryPoint = entryPoint;
+ }
+}
diff --git a/dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorService.java b/dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorService.java
index 64450b796c17..9c5456ef2ef9 100644
--- a/dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorService.java
+++ b/dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorService.java
@@ -7,20 +7,17 @@
*/
package org.dspace.license;
-import java.io.IOException;
import java.util.Map;
-import org.jdom2.Document;
-
/**
* Service interface class for the Creative commons license connector service.
- * The implementation of this class is responsible for all the calls to the CC license API and parsing the response
+ * The implementation of this class is responsible for providing the CC licenses from the configured CSV
* The service is autowired by spring
*/
public interface CCLicenseConnectorService {
/**
- * Retrieves the CC Licenses for the provided language from the CC License API
+ * Retrieves the CC Licenses for the provided language from the configured CSV
*
* @param language - the language to retrieve the licenses for
* @return a map of licenses with the id and the license for the provided language
@@ -29,7 +26,7 @@ public interface CCLicenseConnectorService {
/**
* Retrieve the CC License URI based on the provided license id, language and answers to the field questions from
- * the CC License API
+ * the configured CSV
*
* @param licenseId - the ID of the license
* @param language - the language for which to retrieve the full answerMap
@@ -41,20 +38,11 @@ public String retrieveRightsByQuestion(String licenseId,
Map answerMap);
/**
- * Retrieve the license RDF document based on the license URI
- *
- * @param licenseURI - The license URI for which to retrieve the license RDF document
- * @return the license RDF document
- * @throws IOException
- */
- public Document retrieveLicenseRDFDoc(String licenseURI) throws IOException;
-
- /**
- * Retrieve the license Name from the license document
+ * Retrieves the CC License name of the given licenseURI from the CCLicenseCSVRow
*
- * @param doc - The license document from which to retrieve the license name
- * @return the license name
+ * @param licenseURI - The license URI
+ * @return - The license name
*/
- public String retrieveLicenseName(final Document doc);
+ public String retrieveLicenseName(String licenseURI);
}
diff --git a/dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorServiceImpl.java b/dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorServiceImpl.java
index 3c9088bda5df..36c7ffa7bb23 100644
--- a/dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/license/CCLicenseConnectorServiceImpl.java
@@ -7,346 +7,338 @@
*/
package org.dspace.license;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.entity.mime.MultipartEntityBuilder;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.util.EntityUtils;
import org.apache.logging.log4j.Logger;
-import org.dspace.app.client.DSpaceHttpClientFactory;
-import org.dspace.app.util.XMLUtils;
import org.dspace.services.ConfigurationService;
-import org.jdom2.Attribute;
-import org.jdom2.Document;
-import org.jdom2.Element;
-import org.jdom2.JDOMException;
-import org.jdom2.filter.Filters;
-import org.jdom2.input.SAXBuilder;
-import org.jdom2.xpath.XPathExpression;
-import org.jdom2.xpath.XPathFactory;
-import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
-import org.xml.sax.InputSource;
/**
- * 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
+ * Implementation for the Creative Commons license connector service.
+ *
+ * This service builds Creative Commons license definitions from a local CSV
+ * configuration and resolves license URIs based on user-selected field values.
+ *
+ * It does not perform any outbound HTTP calls. All license metadata is derived
+ * from local configuration files:
+ *
+ * {@code dspace.cc-license.csv} — license definitions and URL mappings
+ *
+ *
+ * The service also applies business rules for mapping user selections
+ * (commercial use, derivatives, jurisdiction) into CC license units.
*/
-public class CCLicenseConnectorServiceImpl implements CCLicenseConnectorService, InitializingBean {
+public class CCLicenseConnectorServiceImpl implements CCLicenseConnectorService {
private Logger log = org.apache.logging.log4j.LogManager.getLogger(CCLicenseConnectorServiceImpl.class);
- private CloseableHttpClient client;
- protected SAXBuilder parser = XMLUtils.getSAXBuilder();
-
- private String postArgument = "answers";
- private String postAnswerFormat =
- " " +
- "{1} " +
- "" +
- "{2}" +
- " " +
- " ";
-
+ @Autowired
+ private CCLicenseCSVRepository csvRepo;
+
+ // Answer map keys
+ private static final String FIELD_COMMERCIAL = "commercial";
+ private static final String FIELD_DERIVATIVES = "derivatives";
+ private static final String FIELD_JURISDICTION = "jurisdiction";
+ private static final String FIELD_SAMPLING = "sampling";
+
+ // Sampling (recombo) answers mapped to their CC unit. The answers don't contain a '+' as it would be
+ // decoded to a space in the query parameters of the REST API.
+ private static final Map SAMPLING_UNITS = Map.of(
+ "sampling", "sampling",
+ "samplingplus", "sampling+",
+ "ncsamplingplus", "nc-sampling+"
+ );
@Autowired
private ConfigurationService configurationService;
- @Override
- public void afterPropertiesSet() throws Exception {
- client = DSpaceHttpClientFactory.getInstance().buildWithoutAutomaticRetries(5);
-
- // disallow DTD parsing to ensure no XXE attacks can occur.
- // See https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html
- parser.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
- }
-
/**
- * Retrieves the CC Licenses for the provided language from the CC License API
+ * Builds the list of available license options for the UI.
+ *
+ * Licenses are grouped based on the CSV {@code ENTRY_POINT} column:
+ *
+ * {@code CC_GROUP} — grouped Creative Commons license families (e.g. CC 3.0, 4.0)
+ * {@code RECOMBO_GROUP} — the retired Creative Commons Sampling licenses (version 1.0)
+ * {@code DIRECT} — standalone licenses (e.g. public domain tools)
+ *
*
- * @param language - the language to retrieve the licenses for
- * @return a map of licenses with the id and the license for the provided language
+ * CC_GROUP entries share a common license structure but differ in version and optional jurisdiction support.
+ *
+ * @param language the current language in the ui
+ *
+ * @return A map of licenseId's to CCLicense
*/
+ @Override
public Map retrieveLicenses(String language) {
- String ccLicenseUrl = configurationService.getProperty("cc.api.rooturl");
-
- String uri = ccLicenseUrl + "/?locale=" + language;
- HttpGet httpGet = new HttpGet(uri);
-
- List licenses;
- try (CloseableHttpResponse response = client.execute(httpGet)) {
- licenses = retrieveLicenses(response);
- } catch (JDOMException | IOException e) {
- log.error("Error while retrieving the license details using url: " + uri, e);
- licenses = Collections.emptyList();
- }
+ List excluded = Arrays.asList(configurationService.getArrayProperty("cc.license.classfilter"));
+ Map licenses = new LinkedHashMap<>();
- Map ccLicenses = new HashMap<>();
+ for (CCLicenseCSVRow row : csvRepo.getEntryPoints()) {
- for (String license : licenses) {
-
- String licenseUri = ccLicenseUrl + "/license/" + license + "?locale=" + language;
- HttpGet licenseHttpGet = new HttpGet(licenseUri);
- try (CloseableHttpResponse response = client.execute(licenseHttpGet)) {
- CCLicense ccLicense = retrieveLicenseObject(license, response);
- ccLicenses.put(ccLicense.getLicenseId(), ccLicense);
- } catch (JDOMException | IOException e) {
- log.error("Error while retrieving the license details using url: " + licenseUri, e);
+ if ("CC_GROUP".equals(row.getEntryPoint())) {
+ // "standard" excludes every CC version, "CC" (e.g. CC3.0) excludes a single one
+ if (excluded.contains("standard") || excluded.contains("CC" + row.getVersion())) {
+ continue;
+ }
+ boolean includeJurisdiction = "3.0".equals(row.getVersion());
+
+ // The row ID is used as license ID because the IDENTIFIER column contains spaces,
+ // which the REST repository does not accept
+ licenses.put(row.getId(),
+ buildCCLicense(
+ row.getId(),
+ "Creative Commons License (" + row.getVersion() + ")",
+ includeJurisdiction
+ )
+ );
+ } else if ("RECOMBO_GROUP".equals(row.getEntryPoint())) {
+ if (excluded.contains("recombo")) {
+ continue;
+ }
+ licenses.put(row.getId(), buildSamplingLicense(row.getId(),
+ "Creative Commons Sampling License (" + row.getVersion() + ")"));
+ } else if ("DIRECT".equals(row.getEntryPoint())) {
+ // Direct licenses are excluded individually by their unit (e.g. zero, mark, certification)
+ if (excluded.contains(row.getUnit())) {
+ continue;
+ }
+ licenses.put(
+ row.getId(),
+ new CCLicense(
+ row.getId(),
+ row.getTitle(),
+ Collections.emptyList()
+ )
+ );
}
}
- return ccLicenses;
+ return licenses;
}
/**
- * Retrieve the list of licenses from the response from the CC License API and remove the licenses configured
- * to be excluded
+ * Builds a CC license with the standard commercial/derivatives fields,
+ * and optionally a jurisdiction field for 3.0.
+ *
+ * @param id The ID of the CC License
+ * @param label The Label to user for the License
+ * @param includeJurisdiction If Jurisdiction information should be included only used for 3.0
*
- * @param response The response from the API
- * @return a list of license identifiers for which details need to be retrieved
- * @throws IOException
- * @throws JDOMException
+ * @return Created CCLicense
*/
- private List retrieveLicenses(CloseableHttpResponse response)
- throws IOException, JDOMException {
-
- List domains = new LinkedList<>();
- String[] excludedLicenses = configurationService.getArrayProperty("cc.license.classfilter");
-
- String responseString = EntityUtils.toString(response.getEntity());
- XPathExpression licenseClassXpath =
- XPathFactory.instance().compile("//licenses/license", Filters.element());
-
- try (StringReader stringReader = new StringReader(responseString)) {
- InputSource is = new InputSource(stringReader);
- org.jdom2.Document classDoc = this.parser.build(is);
-
- List elements = licenseClassXpath.evaluate(classDoc);
- for (Element element : elements) {
- String licenseId = getSingleNodeValue(element, "@id");
- if (StringUtils.isNotBlank(licenseId) && !ArrayUtils.contains(excludedLicenses, licenseId)) {
- domains.add(licenseId);
- }
- }
+ private CCLicense buildCCLicense(String id, String label, boolean includeJurisdiction) {
+ CCLicenseField commercial = new CCLicenseField(
+ FIELD_COMMERCIAL,
+ "cc-license.commercial.label",
+ "cc-license.commercial.hint",
+ List.of(
+ new CCLicenseFieldEnum("y", "cc-license.commercial.option.yes.label",
+ "cc-license.commercial.option.yes.hint"),
+ new CCLicenseFieldEnum("n", "cc-license.commercial.option.no.label",
+ "cc-license.commercial.option.no.hint")
+ )
+ );
+
+ CCLicenseField derivatives = new CCLicenseField(
+ FIELD_DERIVATIVES,
+ "cc-license.derivatives.label",
+ "cc-license.derivatives.hint",
+ List.of(
+ new CCLicenseFieldEnum("y", "cc-license.derivatives.option.yes.label",
+ "cc-license.derivatives.option.yes.hint"),
+ new CCLicenseFieldEnum("sa", "cc-license.derivatives.option.sharealike.label",
+ "cc-license.derivatives.option.sharealike.hint"),
+ new CCLicenseFieldEnum("n", "cc-license.derivatives.option.no.label",
+ "cc-license.derivatives.option.no.hint")
+ )
+ );
+
+ if (!includeJurisdiction) {
+ return new CCLicense(id, label, List.of(commercial, derivatives));
}
- return domains;
+ // Build jurisdiction enum from the CSV — all distinct non-blank jurisdiction
+ // codes that appear under version 3.0 in the CSV.
+ CCLicenseField jurisdiction = new CCLicenseField(
+ FIELD_JURISDICTION,
+ "cc-license.jurisdiction.label",
+ "cc-license.jurisdiction.hint",
+ buildJurisdictionEnums()
+ );
+ return new CCLicense(id, label, List.of(commercial, derivatives, jurisdiction));
}
/**
- * Parse the response for a single CC License and return the corresponding CC License Object
+ * Builds the CC Sampling (recombo) license, which has a single field to choose the sampling variant.
*
- * @param licenseId the license id of the CC License to retrieve
- * @param response for a specific CC License response
- * @return the corresponding CC License Object
- * @throws IOException
- * @throws JDOMException
+ * @param id The ID of the CC License
+ * @param label The Label to use for the License
+ *
+ * @return Created CCLicense
*/
- private CCLicense retrieveLicenseObject(final String licenseId, CloseableHttpResponse response)
- throws IOException, JDOMException {
-
- String responseString = EntityUtils.toString(response.getEntity());
-
- XPathExpression licenseClassXpath =
- XPathFactory.instance().compile("//licenseclass", Filters.fpassthrough());
- XPathExpression licenseFieldXpath =
- XPathFactory.instance().compile("field", Filters.element());
-
- try (StringReader stringReader = new StringReader(responseString)) {
- InputSource is = new InputSource(stringReader);
-
- org.jdom2.Document classDoc = this.parser.build(is);
-
- Object element = licenseClassXpath.evaluateFirst(classDoc);
- String licenseLabel = getSingleNodeValue(element, "label");
-
- List ccLicenseFields = new LinkedList<>();
-
- List licenseFields = licenseFieldXpath.evaluate(element);
- for (Element licenseField : licenseFields) {
- CCLicenseField ccLicenseField = parseLicenseField(licenseField);
- ccLicenseFields.add(ccLicenseField);
- }
-
- return new CCLicense(licenseId, licenseLabel, ccLicenseFields);
- }
+ private CCLicense buildSamplingLicense(String id, String label) {
+ CCLicenseField sampling = new CCLicenseField(
+ FIELD_SAMPLING,
+ "cc-license.sampling.label",
+ "cc-license.sampling.hint",
+ List.of(
+ new CCLicenseFieldEnum("sampling", "cc-license.sampling.option.sampling.label",
+ "cc-license.sampling.option.sampling.hint"),
+ new CCLicenseFieldEnum("samplingplus", "cc-license.sampling.option.samplingplus.label",
+ "cc-license.sampling.option.samplingplus.hint"),
+ new CCLicenseFieldEnum("ncsamplingplus", "cc-license.sampling.option.ncsamplingplus.label",
+ "cc-license.sampling.option.ncsamplingplus.hint")
+ )
+ );
+ return new CCLicense(id, label, List.of(sampling));
}
- private CCLicenseField parseLicenseField(final Element licenseField) {
- String id = getSingleNodeValue(licenseField, "@id");
- String label = getSingleNodeValue(licenseField, "label");
- String description = getSingleNodeValue(licenseField, "description");
-
- XPathExpression enumXpath =
- XPathFactory.instance().compile("enum", Filters.element());
- List enums = enumXpath.evaluate(licenseField);
-
- List ccLicenseFieldEnumList = new LinkedList<>();
+ /**
+ * Builds the list of jurisdiction options for the CC 3.0 license, based on {@code cc.license.jurisdiction}.
+ *
+ * The options are aligned with {@link CreativeCommonsServiceImpl#retrieveFullAnswerMap}, which replaces the
+ * submitted jurisdiction with the configured one unless it is set to {@code none}:
+ *
+ * not set or blank — only the generic (unported) option
+ * {@code none} — the generic option followed by all 3.0 jurisdictions from the CSV
+ * any other value — only the configured jurisdiction
+ *
+ *
+ * @return Valid CCLicenseFieldEnum's
+ */
+ private List buildJurisdictionEnums() {
+ String configured = StringUtils.trimToEmpty(configurationService.getProperty("cc.license.jurisdiction"));
+ CCLicenseFieldEnum unported = new CCLicenseFieldEnum("", "cc-license.jurisdiction.option.unported.label", "");
- for (Element enumElement : enums) {
- CCLicenseFieldEnum ccLicenseFieldEnum = parseEnum(enumElement);
- ccLicenseFieldEnumList.add(ccLicenseFieldEnum);
+ if (configured.isEmpty()) {
+ return List.of(unported);
}
-
- return new CCLicenseField(id, label, description, ccLicenseFieldEnumList);
-
- }
-
- private CCLicenseFieldEnum parseEnum(final Element enumElement) {
- String id = getSingleNodeValue(enumElement, "@id");
- String label = getSingleNodeValue(enumElement, "label");
- String description = getSingleNodeValue(enumElement, "description");
-
- return new CCLicenseFieldEnum(id, label, description);
- }
-
-
- private String getNodeValue(final Object el) {
- if (el instanceof Element) {
- return ((Element) el).getValue();
- } else if (el instanceof Attribute) {
- return ((Attribute) el).getValue();
- } else if (el instanceof String) {
- return (String) el;
- } else {
- return null;
+ if (!"none".equals(configured)) {
+ return List.of(new CCLicenseFieldEnum(configured, configured.toUpperCase(), ""));
}
- }
- private String getSingleNodeValue(final Object t, String query) {
- XPathExpression xpath =
- XPathFactory.instance().compile(query, Filters.fpassthrough());
- Object singleNode = xpath.evaluateFirst(t);
-
- return getNodeValue(singleNode);
+ List enums = new ArrayList<>();
+ enums.add(unported);
+ for (String code : csvRepo.getJurisdictionsByVersion("3.0")) {
+ enums.add(new CCLicenseFieldEnum(code, code.toUpperCase(), ""));
+ }
+ return enums;
}
/**
- * Retrieve the CC License URI based on the provided license id, language and answers to the field questions from
- * the CC License API
+ * Resolves the canonical URL for a license selection.
+ *
+ * For CC0, PDM, and PDUS the URL is looked up directly by IDENTIFIER in the CSV.
*
- * @param licenseId - the ID of the license
- * @param language - the language for which to retrieve the full answerMap
- * @param answerMap - the answers to the different field questions
- * @return the CC License URI
+ * For CC 4.0 and CC 3.0, the {@code commercial} and {@code derivatives}
+ * answers are mapped to a CC unit string (e.g. {@code by-nc-sa}), then the
+ * CSV is searched for a row matching version + unit + jurisdiction.
+ *
+ * @param licenseId The id of the given license
+ * @param language The current language
+ * @param answerMap The current answers
+ *
+ * @return The canonical URL for a license selection
*/
- public String retrieveRightsByQuestion(String licenseId,
- String language,
+ @Override
+ public String retrieveRightsByQuestion(String licenseId, String language,
Map answerMap) {
- String ccLicenseUrl = configurationService.getProperty("cc.api.rooturl");
+ CCLicenseCSVRow entry = csvRepo.getByIdentifier(licenseId);
+ if (entry == null) {
+ log.warn("Unknown licenseId: {}", licenseId);
+ return null;
+ }
- HttpPost httpPost = new HttpPost(ccLicenseUrl + "/license/" + licenseId + "/issue");
+ // Direct lookup licenses (CC0, PDM, PDUS, etc.)
+ if (isDirectLicense(entry)) {
+ return entry.getUrl();
+ }
+ // CC Sampling licenses (recombo)
+ if ("RECOMBO_GROUP".equals(entry.getEntryPoint())) {
+ String unit = SAMPLING_UNITS.get(answerMap.get(FIELD_SAMPLING));
+ return unit == null ? null : csvRepo.findUri(entry.getVersion(), unit, "");
+ }
- String answers = createAnswerString(answerMap);
- MultipartEntityBuilder builder = MultipartEntityBuilder.create();
- String text = MessageFormat.format(postAnswerFormat, licenseId, language, answers);
- builder.addTextBody(postArgument, text);
+ // CC licenses (3.0 / 4.0)
+ if (isCreativeCommons(entry)) {
+ String version = entry.getVersion();
+ String commercial = answerMap.get(FIELD_COMMERCIAL);
+ String derivatives = answerMap.get(FIELD_DERIVATIVES);
- HttpEntity multipart = builder.build();
+ String unit = resolveUnit(commercial, derivatives);
- httpPost.setEntity(multipart);
+ String jurisdiction = "";
+ if ("3.0".equals(version)) {
+ jurisdiction = answerMap.get(FIELD_JURISDICTION);
+ }
- try (CloseableHttpResponse response = client.execute(httpPost)) {
- return retrieveLicenseUri(response);
- } catch (JDOMException | IOException e) {
- log.error("Error while retrieving the license uri for license : " + licenseId + " with answers "
- + answerMap.toString(), e);
+ return csvRepo.findUri(version, unit, jurisdiction);
}
+
+ log.warn("Unhandled license type: {}", licenseId);
return null;
}
/**
- * Parse the response for the CC License URI request and return the corresponding CC License URI
+ * Maps user answers for commercial use and derivative permissions into a
+ * Creative Commons license unit identifier.
+ *
+ * This method encodes the Creative Commons license decision matrix and
+ * determines the correct license component string (e.g. {@code by-nc-sa}).
*
- * @param response for a specific CC License URI response
- * @return the corresponding CC License URI as a string
- * @throws IOException
- * @throws JDOMException
+ * Valid combinations correspond to standard CC license variants.
+ * @param commercial the commercial license
+ * @param derivatives the derivative answers of that license
+ * @return The license usage string
*/
- private String retrieveLicenseUri(final CloseableHttpResponse response)
- throws IOException, JDOMException {
-
- String responseString = EntityUtils.toString(response.getEntity());
- XPathExpression licenseClassXpath =
- XPathFactory.instance().compile("//result/license-uri", Filters.fpassthrough());
+ private String resolveUnit(String commercial, String derivatives) {
+ boolean allowCommercial = "y".equals(commercial);
+ boolean allowDerivatives = "y".equals(derivatives);
+ boolean shareAlike = "sa".equals(derivatives);
- try (StringReader stringReader = new StringReader(responseString)) {
- InputSource is = new InputSource(stringReader);
- org.jdom2.Document classDoc = this.parser.build(is);
-
- Object node = licenseClassXpath.evaluateFirst(classDoc);
- String nodeValue = getNodeValue(node);
-
- if (StringUtils.isNotBlank(nodeValue)) {
- return nodeValue;
- }
+ if (allowCommercial && allowDerivatives) {
+ return "by";
}
- return null;
- }
-
- private String createAnswerString(final Map parameterMap) {
- StringBuilder sb = new StringBuilder();
- for (String key : parameterMap.keySet()) {
- sb.append("<");
- sb.append(key);
- sb.append(">");
- sb.append(parameterMap.get(key));
- sb.append("");
- sb.append(key);
- sb.append(">");
+ if (allowCommercial && shareAlike) {
+ return "by-sa";
+ }
+ if (allowCommercial) {
+ return "by-nd";
+ }
+ if (allowDerivatives) {
+ return "by-nc";
}
- return sb.toString();
+ if (shareAlike) {
+ return "by-nc-sa";
+ }
+ return "by-nc-nd";
}
- /**
- * Retrieve the license RDF document based on the license URI
- *
- * @param licenseURI - The license URI for which to retrieve the license RDF document
- * @return the license RDF document
- * @throws IOException
- */
@Override
- public Document retrieveLicenseRDFDoc(String licenseURI) throws IOException {
- String ccLicenseUrl = configurationService.getProperty("cc.api.rooturl");
- String issueUrl = ccLicenseUrl + "/details?license-uri=" + licenseURI;
- try (CloseableHttpClient httpClient = DSpaceHttpClientFactory.getInstance().build()) {
- CloseableHttpResponse httpResponse = httpClient.execute(new HttpPost(issueUrl));
- // parsing document from input stream
- InputStream stream = httpResponse.getEntity().getContent();
- Document doc = parser.build(stream);
- return doc;
- } catch (Exception e) {
- log.error("Error while retrieving the license document for URI: " + licenseURI, e);
+ public String retrieveLicenseName(final String licenseURI) {
+ CCLicenseCSVRow row = csvRepo.getByURI(licenseURI);
+ if (row == null) {
+ log.warn("Unknown license URI: {}", licenseURI);
+ return null;
}
- return null;
+ return row.getTitle();
}
- /**
- * Retrieve the license Name from the license document
- *
- * @param doc - The license document from which to retrieve the license name
- * @return the license name
- */
- public String retrieveLicenseName(final Document doc) {
- return getSingleNodeValue(doc, "//result/license-name");
+ private boolean isDirectLicense(CCLicenseCSVRow row) {
+ return "publicdomain".equalsIgnoreCase(row.getCategory());
}
+ private boolean isCreativeCommons(CCLicenseCSVRow row) {
+ return "licenses".equalsIgnoreCase(row.getCategory());
+ }
}
diff --git a/dspace-api/src/main/java/org/dspace/license/CreativeCommonsServiceImpl.java b/dspace-api/src/main/java/org/dspace/license/CreativeCommonsServiceImpl.java
index c9c8127d1844..e246ea3c5a2b 100644
--- a/dspace-api/src/main/java/org/dspace/license/CreativeCommonsServiceImpl.java
+++ b/dspace-api/src/main/java/org/dspace/license/CreativeCommonsServiceImpl.java
@@ -7,22 +7,14 @@
*/
package org.dspace.license;
-import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.StringWriter;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import javax.xml.transform.Templates;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Logger;
@@ -40,8 +32,6 @@
import org.dspace.license.service.CreativeCommonsService;
import org.dspace.services.ConfigurationService;
import org.dspace.services.factory.DSpaceServicesFactory;
-import org.jdom2.Document;
-import org.jdom2.transform.JDOMSource;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
@@ -75,8 +65,6 @@ public class CreativeCommonsServiceImpl implements CreativeCommonsService, Initi
protected static final String BSN_LICENSE_RDF = "license_rdf";
- protected Templates templates;
-
@Autowired(required = true)
protected BitstreamService bitstreamService;
@Autowired(required = true)
@@ -90,7 +78,8 @@ public class CreativeCommonsServiceImpl implements CreativeCommonsService, Initi
protected ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
- private String defaultLanguage;
+ // The license options are translated by the UI (i18n keys), so the language is no longer configurable
+ private static final String DEFAULT_LANGUAGE = "en";
private String jurisdiction;
private static final String JURISDICTION_KEY = "jurisdiction";
@@ -114,18 +103,7 @@ public void afterPropertiesSet() throws Exception {
}
ccLicenses = new HashMap<>();
- defaultLanguage = configurationService.getProperty("cc.license.locale", "en");
jurisdiction = configurationService.getProperty("cc.license.jurisdiction", "");
-
- try {
- templates = TransformerFactory.newInstance().newTemplates(
- new StreamSource(CreativeCommonsServiceImpl.class
- .getResourceAsStream("CreativeCommons.xsl")));
- } catch (TransformerConfigurationException e) {
- throw new RuntimeException(e.getMessage(), e);
- }
-
-
}
// create the CC bundle if it doesn't exist
@@ -140,18 +118,6 @@ protected Bundle getCcBundle(Context context, Item item)
return bundleService.create(context, item, CC_BUNDLE_NAME);
}
- @Override
- public void setLicenseRDF(Context context, Item item, String licenseRdf)
- throws SQLException, IOException,
- AuthorizeException {
- Bundle bundle = getCcBundle(context, item);
- // set the format
- BitstreamFormat bs_rdf_format = bitstreamFormatService.findByShortDescription(context, "RDF XML");
- // set the RDF bitstream
- setBitstreamFromBytes(context, item, bundle, BSN_LICENSE_RDF, bs_rdf_format, licenseRdf.getBytes());
- }
-
-
@Override
public void setLicense(Context context, Item item,
InputStream licenseStm, String mimeType)
@@ -259,54 +225,6 @@ public String getLicenseName( Item item) {
return null;
}
- @Override
- public String fetchLicenseRDF(Document license) {
- StringWriter result = new StringWriter();
-
- try {
- templates.newTransformer().transform(
- new JDOMSource(license),
- new StreamResult(result)
- );
- } catch (TransformerException e) {
- throw new IllegalStateException(e.getMessage(), e);
- }
-
- return result.getBuffer().toString();
- }
-
- /**
- * This helper method takes some bytes and stores them as a bitstream for an
- * item, under the CC bundle, with the given bitstream name
- *
- * Note: This helper method assumes that the CC
- * bitstreams are short and easily expressed as byte arrays in RAM
- *
- * @param context The relevant DSpace Context.
- * @param item parent item
- * @param bundle parent bundle
- * @param bitstream_name bitstream name to set
- * @param format bitstream format
- * @param bytes bitstream data
- * @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
- * @throws SQLException An exception that provides information on a database access error or other errors.
- * @throws AuthorizeException Exception indicating the current user of the context does not have permission
- * to perform a particular action.
- */
- protected void setBitstreamFromBytes(Context context, Item item, Bundle bundle,
- String bitstream_name, BitstreamFormat format, byte[] bytes)
- throws SQLException, IOException, AuthorizeException {
- ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- Bitstream bs = bitstreamService.create(context, bundle, bais);
-
- bs.setName(context, bitstream_name);
- bs.setSource(context, CC_BS_SOURCE);
- bs.setFormat(context, format);
-
- // commit everything
- bitstreamService.update(context, bs);
- }
-
/**
* This helper method wraps a String around a byte array returned from the
* bitstream method further down
@@ -418,9 +336,8 @@ public void removeLicense(Context context, Item item)
if (configurationService.getBooleanProperty("cc.submit.setname")) {
removeLicenseField(context, item, nameField);
}
- if (configurationService.getBooleanProperty("cc.submit.addbitstream")) {
- removeLicenseFile(context, item);
- }
+ // License RDF bitstreams are no longer generated, but remove the ones of previously stored licenses
+ removeLicenseFile(context, item);
}
}
@@ -444,7 +361,7 @@ private void addLicenseField(Context context, Item item, String field, String la
*/
@Override
public List findAllCCLicenses() {
- return findAllCCLicenses(defaultLanguage);
+ return findAllCCLicenses(DEFAULT_LANGUAGE);
}
/**
@@ -470,7 +387,7 @@ public List findAllCCLicenses(String language) {
*/
@Override
public CCLicense findOne(String id) {
- return findOne(id, defaultLanguage);
+ return findOne(id, DEFAULT_LANGUAGE);
}
/**
@@ -512,7 +429,7 @@ private void initLicenses(final String language) {
*/
@Override
public String retrieveLicenseUri(String licenseId, Map answerMap) {
- return retrieveLicenseUri(licenseId, defaultLanguage, answerMap);
+ return retrieveLicenseUri(licenseId, DEFAULT_LANGUAGE, answerMap);
}
@@ -540,7 +457,7 @@ public String retrieveLicenseUri(String licenseId, String language, Map fullAnswerMap) {
- return verifyLicenseInformation(licenseId, defaultLanguage, fullAnswerMap);
+ return verifyLicenseInformation(licenseId, DEFAULT_LANGUAGE, fullAnswerMap);
}
/**
@@ -580,7 +497,7 @@ public boolean verifyLicenseInformation(String licenseId, String language, Map retrieveFullAnswerMap(String licenseId, Map answerMap) {
- return retrieveFullAnswerMap(licenseId, defaultLanguage, answerMap);
+ return retrieveFullAnswerMap(licenseId, DEFAULT_LANGUAGE, answerMap);
}
/**
@@ -654,17 +571,13 @@ private CCLicenseField findCCLicenseField(final String field, final List iter = itemService.findAll(ctx);
-
- Properties props = new Properties();
-
- File processed = new File("license.processed");
-
- if (processed.exists()) {
- props.load(new FileInputStream(processed));
- }
-
- int i = 0;
-
- try {
- while (iter.hasNext()) {
- if (i == 100) {
- props.store(new FileOutputStream(processed),
- "processed license files, remove to restart processing from scratch");
- i = 0;
- }
-
- Item item = (Item) iter.next();
- log.info("checking: " + item.getID());
- if (!props.containsKey("I" + item.getID())) {
- handleItem(ctx, item);
- log.info("processed: " + item.getID());
- }
-
- props.put("I" + item.getID(), "done");
- i++;
- }
- } finally {
- props
- .store(new FileOutputStream(processed),
- "processed license files, remove to restart processing from scratch");
- }
- }
-
- /**
- * Process Item, correcting CC-License if encountered.
- *
- * @param context The relevant DSpace Context.
- * @param item The item to process
- * @throws SQLException if database error
- * @throws AuthorizeException if authorization error
- * @throws IOException if IO error
- */
- protected static void handleItem(Context context, Item item) throws SQLException,
- AuthorizeException, IOException {
- List bundles = itemService.getBundles(item, "CC-LICENSE");
-
- if (bundles == null || bundles.isEmpty()) {
- return;
- }
-
- Bundle bundle = bundles.get(0);
-
- Bitstream bitstream = bundleService.getBitstreamByName(bundle, "license_rdf");
-
- String license_rdf = new String(copy(context, bitstream), StandardCharsets.UTF_8);
-
- /* quickly fix xml by ripping out offensive parts */
- license_rdf = license_rdf.replaceFirst("", "");
-
- StringWriter result = new StringWriter();
-
- try {
- templates.newTransformer().transform(
- new StreamSource(new ByteArrayInputStream(license_rdf.getBytes(StandardCharsets.UTF_8))),
- new StreamResult(result));
- } catch (TransformerException e) {
- throw new IllegalStateException(e.getMessage(), e);
- }
-
- StringBuffer buffer = result.getBuffer();
-
- Bitstream newBitstream = bitstreamService
- .create(context, bundle, new ByteArrayInputStream(buffer.toString()
- .getBytes(StandardCharsets.UTF_8)));
-
- newBitstream.setName(context, bitstream.getName());
- newBitstream.setDescription(context, bitstream.getDescription());
- newBitstream.setFormat(context, bitstream.getFormat(context));
- newBitstream.setSource(context, bitstream.getSource());
- newBitstream.setUserFormatDescription(context, bitstream
- .getUserFormatDescription());
- bitstreamService.update(context, newBitstream);
-
- bundleService.removeBitstream(context, bundle, bitstream);
-
- bundleService.update(context, bundle);
- }
-
- static final int BUFF_SIZE = 100000;
-
- static final byte[] buffer = new byte[BUFF_SIZE];
-
- /**
- * Fast stream copy routine
- *
- * @param context The relevant DSpace Context.
- * @param b the Bitstream to be copied.
- * @return copy of the content of {@code b}.
- * @throws IOException if IO error
- * @throws SQLException if database error
- * @throws AuthorizeException if authorization error
- */
- public static byte[] copy(Context context, Bitstream b)
- throws IOException, SQLException, AuthorizeException {
- InputStream in = null;
- ByteArrayOutputStream out = null;
- try {
- in = bitstreamService.retrieve(context, b);
- out = new ByteArrayOutputStream();
- while (true) {
- synchronized (buffer) {
- int amountRead = in.read(buffer);
- if (amountRead == -1) {
- break;
- }
- out.write(buffer, 0, amountRead);
- }
- }
- } finally {
- if (in != null) {
- in.close();
- }
- if (out != null) {
- out.close();
- }
- }
-
- return out.toByteArray();
- }
-
-}
diff --git a/dspace-api/src/main/java/org/dspace/license/service/CreativeCommonsService.java b/dspace-api/src/main/java/org/dspace/license/service/CreativeCommonsService.java
index 0f4911aa3ec1..3d18865d5351 100644
--- a/dspace-api/src/main/java/org/dspace/license/service/CreativeCommonsService.java
+++ b/dspace-api/src/main/java/org/dspace/license/service/CreativeCommonsService.java
@@ -18,7 +18,6 @@
import org.dspace.content.Item;
import org.dspace.core.Context;
import org.dspace.license.CCLicense;
-import org.jdom2.Document;
/**
* Service interface class for the Creative commons licensing.
@@ -31,23 +30,6 @@ public interface CreativeCommonsService {
public static final String CC_BUNDLE_NAME = "CC-LICENSE";
- /**
- * setLicenseRDF
- *
- * CC Web Service method for setting the RDF bitstream
- *
- * @param context The relevant DSpace Context.
- * @param item The item to set license on.
- * @param licenseRdf license RDF string
- * @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
- * @throws SQLException An exception that provides information on a database access error or other errors.
- * @throws AuthorizeException Exception indicating the current user of the context does not have permission
- * to perform a particular action.
- */
- public void setLicenseRDF(Context context, Item item, String licenseRdf)
- throws SQLException, IOException, AuthorizeException;
-
-
/**
* Used by DSpaceMetsIngester
*
@@ -140,17 +122,6 @@ public Bitstream getLicenseTextBitstream(Item item)
*/
public String getCCField(String fieldId);
- /**
- * 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
- *
- * @param license - an element that could be contains as part of your content
- * the license rdf
- * @return the document license in textual format after the transformation
- */
- public String fetchLicenseRDF(Document license);
-
/**
* Remove license information, delete also the bitstream
*
@@ -278,11 +249,10 @@ public boolean updateLicense(final Context context, String licenseUri, final Ite
* @param item - The item to which the license will be added
* @param licenseUri - The license URI to add
* @param licenseName - The license name to add
- * @param doc - The license to document to add
* @throws SQLException
* @throws IOException
* @throws AuthorizeException
*/
- public void addLicense(Context context, Item item, String licenseUri, String licenseName, Document doc)
+ public void addLicense(Context context, Item item, String licenseUri, String licenseName)
throws SQLException, IOException, AuthorizeException;
}
diff --git a/dspace-api/src/main/resources/org/dspace/license/CreativeCommons.xsl b/dspace-api/src/main/resources/org/dspace/license/CreativeCommons.xsl
deleted file mode 100644
index d9f6cd361434..000000000000
--- a/dspace-api/src/main/resources/org/dspace/license/CreativeCommons.xsl
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/dspace-api/src/main/resources/org/dspace/license/LicenseCleanup.xsl b/dspace-api/src/main/resources/org/dspace/license/LicenseCleanup.xsl
deleted file mode 100644
index d9a9745a1b10..000000000000
--- a/dspace-api/src/main/resources/org/dspace/license/LicenseCleanup.xsl
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/dspace-api/src/test/data/dspaceFolder/config/local.cfg b/dspace-api/src/test/data/dspaceFolder/config/local.cfg
index 32ed8e42c386..2ac1cd6947df 100644
--- a/dspace-api/src/test/data/dspaceFolder/config/local.cfg
+++ b/dspace-api/src/test/data/dspaceFolder/config/local.cfg
@@ -386,3 +386,8 @@ choices.plugin.dc.contributor.author =
# Leaving this property empty (as below) means all vocabularies, including 'srsc', are enabled for browsing.
webui.browse.vocabularies.disabled =
+
+# VSB-TUO hides CC 3.0 and leaves the jurisdiction unset in dspace.cfg; the CC licence ITs expect the
+# upstream defaults
+cc.license.classfilter = recombo, mark, certification
+cc.license.jurisdiction = us
diff --git a/dspace-api/src/test/java/org/dspace/license/CCLicenseConnectorServiceImplIT.java b/dspace-api/src/test/java/org/dspace/license/CCLicenseConnectorServiceImplIT.java
new file mode 100644
index 000000000000..94f819ea3078
--- /dev/null
+++ b/dspace-api/src/test/java/org/dspace/license/CCLicenseConnectorServiceImplIT.java
@@ -0,0 +1,173 @@
+/**
+ * The contents of this file are subject to the license and copyright
+ * detailed in the LICENSE and NOTICE files at the root of the source
+ * tree and available online at
+ *
+ * http://www.dspace.org/license/
+ */
+package org.dspace.license;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.nullValue;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.dspace.AbstractIntegrationTestWithDatabase;
+import org.dspace.services.ConfigurationService;
+import org.dspace.services.factory.DSpaceServicesFactory;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Integration tests for {@link CCLicenseConnectorServiceImpl}, based on the configured CC license CSV.
+ */
+public class CCLicenseConnectorServiceImplIT extends AbstractIntegrationTestWithDatabase {
+
+ private static final String CC_30 = "license1";
+ private static final String CC_40 = "license265";
+ private static final String CC_ZERO = "license271";
+ private static final String MARK = "license272";
+ private static final String CERTIFICATION = "license273";
+ private static final String SAMPLING = "license274";
+
+ private CCLicenseConnectorService ccLicenseConnectorService;
+ private ConfigurationService configurationService;
+
+ @Before
+ public void init() {
+ ccLicenseConnectorService = DSpaceServicesFactory.getInstance().getServiceManager()
+ .getServicesByType(CCLicenseConnectorService.class).get(0);
+ configurationService = DSpaceServicesFactory.getInstance().getConfigurationService();
+ }
+
+ @Test
+ public void retrieveLicensesDefaultClassFilterTest() {
+ // Default cc.license.classfilter = recombo, mark, certification
+ Map licenses = ccLicenseConnectorService.retrieveLicenses("en");
+
+ assertThat(licenses.keySet(), containsInAnyOrder(CC_30, CC_40, CC_ZERO));
+ }
+
+ @Test
+ public void retrieveLicensesWithoutClassFilterTest() {
+ configurationService.setProperty("cc.license.classfilter", null);
+
+ Map licenses = ccLicenseConnectorService.retrieveLicenses("en");
+
+ assertThat(licenses.keySet(), containsInAnyOrder(CC_30, CC_40, CC_ZERO, MARK, CERTIFICATION, SAMPLING));
+ }
+
+ @Test
+ public void retrieveLicensesExcludeByCCVersionAndUnitTest() {
+ configurationService.setProperty("cc.license.classfilter", new String[] {"CC3.0", "zero"});
+
+ Map licenses = ccLicenseConnectorService.retrieveLicenses("en");
+
+ assertThat(licenses.keySet(), containsInAnyOrder(CC_40, MARK, CERTIFICATION, SAMPLING));
+ }
+
+ @Test
+ public void retrieveLicensesExcludeStandardTest() {
+ configurationService.setProperty("cc.license.classfilter", new String[] {"standard"});
+
+ Map licenses = ccLicenseConnectorService.retrieveLicenses("en");
+
+ assertThat(licenses.keySet(), containsInAnyOrder(CC_ZERO, MARK, CERTIFICATION, SAMPLING));
+ }
+
+ @Test
+ public void retrieveLicensesConfiguredJurisdictionTest() {
+ configurationService.setProperty("cc.license.jurisdiction", "de");
+
+ List enums = getJurisdictionEnums();
+
+ assertThat(enums.stream().map(CCLicenseFieldEnum::getId).collect(Collectors.toList()), contains("de"));
+ }
+
+ @Test
+ public void retrieveLicensesUnportedJurisdictionTest() {
+ configurationService.setProperty("cc.license.jurisdiction", null);
+
+ List enums = getJurisdictionEnums();
+
+ assertThat(enums.stream().map(CCLicenseFieldEnum::getId).collect(Collectors.toList()), contains(""));
+ }
+
+ @Test
+ public void retrieveLicensesUserSelectedJurisdictionTest() {
+ configurationService.setProperty("cc.license.jurisdiction", "none");
+
+ List ids = getJurisdictionEnums().stream().map(CCLicenseFieldEnum::getId).collect(Collectors.toList());
+
+ // generic/unported option first, followed by all 3.0 jurisdictions of the CSV
+ assertThat(ids, hasSize(44));
+ assertThat(ids.get(0), is(""));
+ assertThat(ids, hasItems("us", "de", "nz"));
+ }
+
+ @Test
+ public void retrieveRightsByQuestionTest() {
+ assertThat(ccLicenseConnectorService.retrieveRightsByQuestion(CC_40, "en",
+ Map.of("commercial", "n", "derivatives", "sa")),
+ is("https://creativecommons.org/licenses/by-nc-sa/4.0/"));
+ assertThat(ccLicenseConnectorService.retrieveRightsByQuestion(CC_30, "en",
+ Map.of("commercial", "y", "derivatives", "n", "jurisdiction", "us")),
+ is("https://creativecommons.org/licenses/by-nd/3.0/us/"));
+ assertThat(ccLicenseConnectorService.retrieveRightsByQuestion(CC_ZERO, "en", Map.of()),
+ is("https://creativecommons.org/publicdomain/zero/1.0/"));
+ }
+
+ @Test
+ public void retrieveSamplingLicenseTest() {
+ configurationService.setProperty("cc.license.classfilter", null);
+
+ CCLicense sampling = ccLicenseConnectorService.retrieveLicenses("en").get(SAMPLING);
+
+ assertThat(sampling.getCcLicenseFieldList(), hasSize(1));
+ assertThat(sampling.getCcLicenseFieldList().get(0).getFieldEnum().stream()
+ .map(CCLicenseFieldEnum::getId).collect(Collectors.toList()),
+ contains("sampling", "samplingplus", "ncsamplingplus"));
+ assertThat(ccLicenseConnectorService.retrieveRightsByQuestion(SAMPLING, "en", Map.of("sampling", "sampling")),
+ is("https://creativecommons.org/licenses/sampling/1.0/"));
+ assertThat(ccLicenseConnectorService.retrieveRightsByQuestion(SAMPLING, "en",
+ Map.of("sampling", "ncsamplingplus")),
+ is("https://creativecommons.org/licenses/nc-sampling+/1.0/"));
+ assertThat(ccLicenseConnectorService.retrieveLicenseName("https://creativecommons.org/licenses/sampling+/1.0/"),
+ is("Sampling Plus 1.0 Generic"));
+ }
+
+ @Test
+ public void retrieveLicenseNameTest() {
+ assertThat(ccLicenseConnectorService.retrieveLicenseName("https://creativecommons.org/licenses/by/4.0/"),
+ is("Attribution 4.0 International"));
+ assertThat(ccLicenseConnectorService.retrieveLicenseName("https://example.org/unknown-license"),
+ nullValue());
+ }
+
+ @Test
+ public void retrieveLicenseNameOfLegacyUriTest() {
+ // the retired CC API stored http URIs, and records typed by hand often lack the trailing slash
+ assertThat(ccLicenseConnectorService.retrieveLicenseName("http://creativecommons.org/licenses/by/4.0/"),
+ is("Attribution 4.0 International"));
+ assertThat(ccLicenseConnectorService.retrieveLicenseName("http://creativecommons.org/licenses/by/4.0"),
+ is("Attribution 4.0 International"));
+ assertThat(ccLicenseConnectorService.retrieveLicenseName("http://creativecommons.org/licenses/by/3.0/cz/"),
+ is("Uveďte autora 3.0 Česko"));
+ }
+
+ private List getJurisdictionEnums() {
+ CCLicense cc30 = ccLicenseConnectorService.retrieveLicenses("en").get(CC_30);
+ return cc30.getCcLicenseFieldList().stream()
+ .filter(field -> "jurisdiction".equals(field.getId()))
+ .findFirst()
+ .orElseThrow()
+ .getFieldEnum();
+ }
+}
diff --git a/dspace-api/src/test/java/org/dspace/license/MockCCLicenseConnectorServiceImpl.java b/dspace-api/src/test/java/org/dspace/license/MockCCLicenseConnectorServiceImpl.java
deleted file mode 100644
index 30a5a3a9b51d..000000000000
--- a/dspace-api/src/test/java/org/dspace/license/MockCCLicenseConnectorServiceImpl.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/**
- * The contents of this file are subject to the license and copyright
- * detailed in the LICENSE and NOTICE files at the root of the source
- * tree and available online at
- *
- * http://www.dspace.org/license/
- */
-package org.dspace.license;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.jdom2.Document;
-import org.jdom2.JDOMException;
-
-/**
- * Mock implementation for the Creative commons license connector service.
- * This class will return a structure of CC Licenses similar to the CC License API but without having to contact it
- */
-public class MockCCLicenseConnectorServiceImpl extends CCLicenseConnectorServiceImpl {
-
- /**
- * Retrieves mock CC Licenses for the provided language
- * @param language - the language
- * @return a map of mocked licenses with the id and the license
- */
- @Override
- public Map retrieveLicenses(String language) {
- Map ccLicenses = new HashMap<>();
- CCLicense mockLicense1 = createMockLicense(1, new int[]{3, 2, 3});
- CCLicense mockLicense2 = createMockLicense(2, new int[]{2});
- CCLicense mockLicense3 = createMockLicense(3, new int[]{});
-
- ccLicenses.put(mockLicense1.getLicenseId(), mockLicense1);
- ccLicenses.put(mockLicense2.getLicenseId(), mockLicense2);
- ccLicenses.put(mockLicense3.getLicenseId(), mockLicense3);
-
- return ccLicenses;
- }
-
- private CCLicense createMockLicense(int count, int[] amountOfFieldsAndEnums) {
- String licenseId = "license" + count;
- String licenseName = "License " + count + " - Name";
- List mockLicenseFields = createMockLicenseFields(count, amountOfFieldsAndEnums);
- return new CCLicense(licenseId, licenseName, mockLicenseFields);
- }
-
- private List createMockLicenseFields(int count, int[] amountOfFieldsAndEnums) {
- List ccLicenseFields = new ArrayList<>(amountOfFieldsAndEnums.length);
- for (int index = 0; index < amountOfFieldsAndEnums.length; index++) {
- String licenseFieldId = "license" + count + "-field" + index;
- String licenseFieldLabel = "License " + count + " - Field " + index + " - Label";
- String licenseFieldDescription = "License " + count + " - Field " + index + " - Description";
- List mockLicenseFields = createMockLicenseFields(count,
- index,
- amountOfFieldsAndEnums[index]);
- ccLicenseFields.add(new CCLicenseField(licenseFieldId,
- licenseFieldLabel,
- licenseFieldDescription,
- mockLicenseFields));
-
- }
-
- return ccLicenseFields;
- }
-
- private List createMockLicenseFields(int count, int index, int amountOfEnums) {
- List ccLicenseFieldEnumList = new ArrayList<>(amountOfEnums);
- for (int i = 0; i < amountOfEnums; i++) {
- String enumId = "license" + count + "-field" + index + "-enum" + i;
- String enumLabel = "License " + count + " - Field " + index + " - Enum " + i + " - Label";
- String enumDescription = "License " + count + " - Field " + index + " - Enum " + i + " - " +
- "Description";
- ccLicenseFieldEnumList.add(new CCLicenseFieldEnum(enumId, enumLabel, enumDescription));
- }
- return ccLicenseFieldEnumList;
-
- }
-
- /**
- * Retrieve a mock CC License URI
- *
- * @param licenseId - the ID of the license
- * @param language - the language for which to retrieve the full answerMap
- * @param answerMap - the answers to the different field questions
- * @return the CC License URI
- */
- @Override
- public String retrieveRightsByQuestion(final String licenseId,
- final String language,
- final Map answerMap) {
-
- return "mock-license-uri";
- }
-
- /**
- * Retrieve a mock license RDF document.
- * When the uri contains "invalid", null will be returned to simulate that no document was found for the provided
- * URI
- *
- * @param licenseURI - The license URI for which to retrieve the license RDF document
- * @return a mock license RDF document or null when the URI contains invalid
- * @throws IOException
- */
- @Override
- public Document retrieveLicenseRDFDoc(String licenseURI) throws IOException {
- if (!StringUtils.contains(licenseURI, "invalid")) {
- InputStream cclicense = null;
- try {
- cclicense = getClass().getResourceAsStream("cc-license-rdf.xml");
-
- Document doc = parser.build(cclicense);
- return doc;
- } catch (JDOMException e) {
- throw new RuntimeException(e);
- } finally {
- if (cclicense != null) {
- cclicense.close();
- }
- }
- }
- return null;
- }
-
-}
diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionCCLicenseRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionCCLicenseRestRepository.java
index 356b3f22bfc4..a77157cfc3a1 100644
--- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionCCLicenseRestRepository.java
+++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/SubmissionCCLicenseRestRepository.java
@@ -8,14 +8,11 @@
package org.dspace.app.rest.repository;
import java.util.List;
-import java.util.Locale;
-import org.apache.commons.lang3.StringUtils;
import org.dspace.app.rest.model.SubmissionCCLicenseRest;
import org.dspace.core.Context;
import org.dspace.license.CCLicense;
import org.dspace.license.service.CreativeCommonsService;
-import org.dspace.services.ConfigurationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -32,23 +29,11 @@ public class SubmissionCCLicenseRestRepository extends DSpaceRestRepository findAll(final Context context, final Pageable pageable) {
- String defaultCCLocale = configurationService.getProperty("cc.license.locale");
-
- Locale currentLocale = context.getCurrentLocale();
- List allCCLicenses;
- // when no default CC locale is defined, current locale is used
- if (currentLocale != null && StringUtils.isBlank(defaultCCLocale)) {
- allCCLicenses = creativeCommonsService.findAllCCLicenses(currentLocale.toString());
- } else {
- allCCLicenses = creativeCommonsService.findAllCCLicenses();
- }
+ List allCCLicenses = creativeCommonsService.findAllCCLicenses();
return converter.toRestPage(allCCLicenses, pageable, utils.obtainProjection());
}
diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/factory/impl/CCLicenseRemovePatchOperation.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/factory/impl/CCLicenseRemovePatchOperation.java
index b17749fe4e04..d8ab44fb59dd 100644
--- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/factory/impl/CCLicenseRemovePatchOperation.java
+++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/factory/impl/CCLicenseRemovePatchOperation.java
@@ -48,7 +48,8 @@ void remove(Context context, HttpServletRequest currentRequest, InProgressSubmis
Item item = source.getItem();
- if (StringUtils.isNotBlank(creativeCommonsService.getLicenseName(item))) {
+ // Check the license uri, as the name is only stored when cc.submit.setname is enabled
+ if (StringUtils.isNotBlank(creativeCommonsService.getLicenseURI(item))) {
creativeCommonsService.removeLicense(context, item);
} else {
throw new IllegalArgumentException("No CC license can be removed since none is present on submission: "
diff --git a/dspace-server-webapp/src/test/data/dspaceFolder/config/spring/api/core-services-mock.xml b/dspace-server-webapp/src/test/data/dspaceFolder/config/spring/api/core-services-mock.xml
index 8010d3e5d6e0..ff13e7f6b48a 100644
--- a/dspace-server-webapp/src/test/data/dspaceFolder/config/spring/api/core-services-mock.xml
+++ b/dspace-server-webapp/src/test/data/dspaceFolder/config/spring/api/core-services-mock.xml
@@ -6,5 +6,4 @@
-
diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CCLicenseAddPatchOperationIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CCLicenseAddPatchOperationIT.java
deleted file mode 100644
index eb49661259cc..000000000000
--- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CCLicenseAddPatchOperationIT.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * The contents of this file are subject to the license and copyright
- * detailed in the LICENSE and NOTICE files at the root of the source
- * tree and available online at
- *
- * http://www.dspace.org/license/
- */
-package org.dspace.app.rest;
-
-import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
-import static org.hamcrest.Matchers.allOf;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-
-import org.dspace.app.rest.model.patch.AddOperation;
-import org.dspace.app.rest.model.patch.Operation;
-import org.dspace.app.rest.test.AbstractControllerIntegrationTest;
-import org.dspace.builder.CollectionBuilder;
-import org.dspace.builder.CommunityBuilder;
-import org.dspace.builder.WorkspaceItemBuilder;
-import org.dspace.content.Collection;
-import org.dspace.content.Community;
-import org.dspace.content.WorkspaceItem;
-import org.junit.Test;
-
-/**
- * Class to test the methods from the CCLicenseAddPatchOperation
- * Since the CC Licenses are obtained from the CC License API, a mock service has been implemented
- * This mock service will return a fixed set of CC Licenses using a similar structure to the ones obtained from the
- * CC License API.
- * Refer to {@link org.dspace.license.MockCCLicenseConnectorServiceImpl} for more information
- */
-public class CCLicenseAddPatchOperationIT extends AbstractControllerIntegrationTest {
-
-
- @Test
- public void patchSubmissionCCLicense() throws Exception {
- context.turnOffAuthorisationSystem();
-
- Community community = CommunityBuilder.createCommunity(context)
- .withName("Community")
- .build();
-
- Collection collection = CollectionBuilder.createCollection(context, community)
- .withName("Collection")
- .build();
-
- WorkspaceItem workspaceItem = WorkspaceItemBuilder.createWorkspaceItem(context, collection)
- .withTitle("Workspace Item")
- .build();
-
- context.restoreAuthSystemState();
-
- String adminToken = getAuthToken(admin.getEmail(), password);
-
- List ops = new ArrayList<>();
- AddOperation addOperation = new AddOperation("/sections/cclicense/uri",
- "https://creativecommons.org/licenses/by-nc-sa/4.0/");
-
- ops.add(addOperation);
- String patchBody = getPatchContent(ops);
-
-
- getClient(adminToken).perform(patch("/api/submission/workspaceitems/" + workspaceItem.getID())
- .content(patchBody)
- .contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
- .andExpect(status().isOk())
- .andExpect(jsonPath("$.sections.cclicense", allOf(
- hasJsonPath("$.uri", is("https://creativecommons.org/licenses/by-nc-sa/4.0/")),
- hasJsonPath("$.rights",
- is("Attribution-NonCommercial-ShareAlike 4.0 International")),
- hasJsonPath("$.file.name", is("license_rdf"))
- )));
- }
-
- @Test
- public void patchSubmissionCCLicenseInvalid() throws Exception {
- context.turnOffAuthorisationSystem();
-
- Community community = CommunityBuilder.createCommunity(context)
- .withName("Community")
- .build();
-
- Collection collection = CollectionBuilder.createCollection(context, community)
- .withName("Collection")
- .build();
-
- WorkspaceItem workspaceItem = WorkspaceItemBuilder.createWorkspaceItem(context, collection)
- .withTitle("Workspace Item")
- .build();
-
- context.restoreAuthSystemState();
-
-
- String adminToken = getAuthToken(admin.getEmail(), password);
-
- List ops = new ArrayList<>();
- AddOperation addOperation = new AddOperation("/sections/cclicense/uri", "invalid-license-uri");
-
- ops.add(addOperation);
- String patchBody = getPatchContent(ops);
-
-
- getClient(adminToken).perform(patch("/api/submission/workspaceitems/" + workspaceItem.getID())
- .content(patchBody)
- .contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
- .andExpect(status().isInternalServerError());
-
- getClient(adminToken).perform(get("/api/submission/workspaceitems/" + workspaceItem.getID())
- .content(patchBody)
- .contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
- .andExpect(status().isOk())
- .andExpect(jsonPath("$.sections.cclicense", allOf(
- hasJsonPath("$.uri", nullValue()),
- hasJsonPath("$.rights",nullValue()),
- hasJsonPath("$.file", nullValue())
- )));
-
-
- }
-}
diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CCLicenseRemovePatchOperationIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CCLicenseRemovePatchOperationIT.java
deleted file mode 100644
index dd2b99d158b9..000000000000
--- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CCLicenseRemovePatchOperationIT.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/**
- * The contents of this file are subject to the license and copyright
- * detailed in the LICENSE and NOTICE files at the root of the source
- * tree and available online at
- *
- * http://www.dspace.org/license/
- */
-package org.dspace.app.rest;
-
-import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
-import static org.hamcrest.Matchers.allOf;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.core.MediaType;
-
-import org.dspace.app.rest.model.patch.AddOperation;
-import org.dspace.app.rest.model.patch.Operation;
-import org.dspace.app.rest.model.patch.RemoveOperation;
-import org.dspace.app.rest.test.AbstractControllerIntegrationTest;
-import org.dspace.builder.CollectionBuilder;
-import org.dspace.builder.CommunityBuilder;
-import org.dspace.builder.WorkspaceItemBuilder;
-import org.dspace.content.Collection;
-import org.dspace.content.Community;
-import org.dspace.content.WorkspaceItem;
-import org.junit.Test;
-
-/**
- * Class to test the methods from the CCLicenseRemovePatchOperation
- * Since the CC Licenses are obtained from the CC License API, a mock service has been implemented
- * This mock service will return a fixed set of CC Licenses using a similar structure to the ones obtained from the
- * CC License API.
- * Refer to {@link org.dspace.license.MockCCLicenseConnectorServiceImpl} for more information
- */
-public class CCLicenseRemovePatchOperationIT extends AbstractControllerIntegrationTest {
-
-
- @Test
- public void patchRemoveSubmissionCCLicense() throws Exception {
- context.turnOffAuthorisationSystem();
-
- Community community = CommunityBuilder.createCommunity(context)
- .withName("Community")
- .build();
-
- Collection collection = CollectionBuilder.createCollection(context, community)
- .withName("Collection")
- .build();
-
- WorkspaceItem workspaceItem = WorkspaceItemBuilder.createWorkspaceItem(context, collection)
- .withTitle("Workspace Item")
- .build();
-
- context.restoreAuthSystemState();
-
- String epersonToken = getAuthToken(eperson.getEmail(), password);
-
- // First add a license and verify it is added
- List ops = new ArrayList<>();
- AddOperation addOperation = new AddOperation("/sections/cclicense/uri",
- "https://creativecommons.org/licenses/by-nc-sa/4.0/");
-
- ops.add(addOperation);
- String patchBody = getPatchContent(ops);
-
-
- getClient(epersonToken).perform(patch("/api/submission/workspaceitems/" + workspaceItem.getID())
- .content(patchBody)
- .contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
- .andExpect(status().isOk())
- .andExpect(jsonPath("$.sections.cclicense", allOf(
- hasJsonPath("$.uri", is("https://creativecommons.org/licenses/by-nc-sa/4.0/")),
- hasJsonPath("$.rights",
- is("Attribution-NonCommercial-ShareAlike 4.0 International")),
- hasJsonPath("$.file.name", is("license_rdf"))
- )));
-
-
- // Remove the license again and verify it is removed
-
- List removeOps = new ArrayList<>();
- RemoveOperation removeOperation = new RemoveOperation("/sections/cclicense/uri");
-
- removeOps.add(removeOperation);
- String removePatch = getPatchContent(removeOps);
-
-
- getClient(epersonToken).perform(patch("/api/submission/workspaceitems/" + workspaceItem.getID())
- .content(removePatch)
- .contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
- .andExpect(status().isOk())
- .andExpect(jsonPath("$.sections.cclicense", allOf(
- hasJsonPath("$.uri", nullValue()),
- hasJsonPath("$.rights",nullValue()),
- hasJsonPath("$.file", nullValue())
- )));
- }
-
-
- @Test
- public void patchRemoveSubmissionCCLicenseNonExisting() throws Exception {
- context.turnOffAuthorisationSystem();
-
- Community community = CommunityBuilder.createCommunity(context)
- .withName("Community")
- .build();
-
- Collection collection = CollectionBuilder.createCollection(context, community)
- .withName("Collection")
- .build();
-
- WorkspaceItem workspaceItem = WorkspaceItemBuilder.createWorkspaceItem(context, collection)
- .withTitle("Workspace Item")
- .build();
-
- context.restoreAuthSystemState();
-
- String epersonToken = getAuthToken(eperson.getEmail(), password);
-
-
- List removeOps = new ArrayList<>();
- RemoveOperation removeOperation = new RemoveOperation("/sections/cclicense/uri");
-
- removeOps.add(removeOperation);
- String removePatch = getPatchContent(removeOps);
-
-
- getClient(epersonToken).perform(patch("/api/submission/workspaceitems/" + workspaceItem.getID())
- .content(removePatch)
- .contentType(MediaType.APPLICATION_JSON_PATCH_JSON))
- .andExpect(status().isInternalServerError());
- }
-}
diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseRestRepositoryIT.java
index 9267cef6c51f..ed8f767667dd 100644
--- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseRestRepositoryIT.java
+++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseRestRepositoryIT.java
@@ -19,10 +19,7 @@
/**
* Class to the methods from the SubmissionCCLicenseRestRepository
- * Since the CC Licenses are obtained from the CC License API, a mock service has been implemented
- * This mock service will return a fixed set of CC Licenses using a similar structure to the ones obtained from the
- * CC License API.
- * Refer to {@link org.dspace.license.MockCCLicenseConnectorServiceImpl} for more information
+ * CC License now grabs from a set csv and index.rdf for cc bundle license.
*/
public class SubmissionCCLicenseRestRepositoryIT extends AbstractControllerIntegrationTest {
@@ -36,26 +33,89 @@ public class SubmissionCCLicenseRestRepositoryIT extends AbstractControllerInteg
public void findAllTest() throws Exception {
String epersonToken = getAuthToken(eperson.getEmail(), password);
+ // Default cc.license.classfilter excludes "mark" and "certification"
getClient(epersonToken).perform(get("/api/config/submissioncclicenses"))
.andExpect(status().isOk())
.andExpect(content().contentType(contentType))
- .andExpect(jsonPath("$._embedded.submissioncclicenses", Matchers.containsInAnyOrder(
- SubmissionCCLicenseMatcher.matchLicenseEntry(1, new int[]{3, 2, 3}),
- SubmissionCCLicenseMatcher.matchLicenseEntry(2, new int[]{2}),
- SubmissionCCLicenseMatcher.matchLicenseEntry(3, new int[]{})
- )));
+ .andExpect(jsonPath("$._embedded.submissioncclicenses", Matchers.containsInAnyOrder(
+ SubmissionCCLicenseMatcher.matchLicenseEntry(
+ "license1",
+ "Creative Commons License (3.0)",
+ new int[]{2, 3, 1}
+ ),
+ SubmissionCCLicenseMatcher.matchLicenseEntry(
+ "license265",
+ "Creative Commons License (4.0)",
+ new int[]{2, 3}
+ ),
+ SubmissionCCLicenseMatcher.matchLicenseEntry(
+ "license271",
+ "CC0 1.0 Universal",
+ new int[]{}
+ )
+ )));
}
@Test
- public void findOneTest() throws Exception {
+ public void findOneCC40Test() throws Exception {
String epersonToken = getAuthToken(eperson.getEmail(), password);
+ getClient(epersonToken).perform(get("/api/config/submissioncclicenses/license265"))
+ .andExpect(status().isOk())
+ .andExpect(content().contentType(contentType))
+ .andExpect(jsonPath("$.id", Matchers.is("license265")))
+ .andExpect(jsonPath("$.name", Matchers.is("Creative Commons License (4.0)")))
+ .andExpect(jsonPath("$.fields", Matchers.hasSize(2)))
+ // commercial field
+ .andExpect(jsonPath("$.fields[0].id", Matchers.is("commercial")))
+ .andExpect(jsonPath("$.fields[0].enums", Matchers.hasSize(2)))
+ .andExpect(jsonPath("$.fields[0].enums[0].id", Matchers.is("y")))
+ .andExpect(jsonPath("$.fields[0].enums[1].id", Matchers.is("n")))
+ // derivatives field
+ .andExpect(jsonPath("$.fields[1].id", Matchers.is("derivatives")))
+ .andExpect(jsonPath("$.fields[1].enums", Matchers.hasSize(3)))
+ .andExpect(jsonPath("$.fields[1].enums[0].id", Matchers.is("y")))
+ .andExpect(jsonPath("$.fields[1].enums[1].id", Matchers.is("sa")))
+ .andExpect(jsonPath("$.fields[1].enums[2].id", Matchers.is("n")));
+ }
+
+ @Test
+ public void findOneCC30Test() throws Exception {
+ String epersonToken = getAuthToken(eperson.getEmail(), password);
+
+ // cc.license.jurisdiction = us, so only that jurisdiction can be selected
getClient(epersonToken).perform(get("/api/config/submissioncclicenses/license1"))
- .andExpect(status().isOk())
- .andExpect(content().contentType(contentType))
- .andExpect(jsonPath("$", Matchers.is(
- SubmissionCCLicenseMatcher.matchLicenseEntry(1, new int[]{3, 2, 3})
- )));
+ .andExpect(status().isOk())
+ .andExpect(content().contentType(contentType))
+ .andExpect(jsonPath("$.id", Matchers.is("license1")))
+ .andExpect(jsonPath("$.name", Matchers.is("Creative Commons License (3.0)")))
+ .andExpect(jsonPath("$.fields", Matchers.hasSize(3)))
+ .andExpect(jsonPath("$.fields[0].id", Matchers.is("commercial")))
+ .andExpect(jsonPath("$.fields[1].id", Matchers.is("derivatives")))
+ .andExpect(jsonPath("$.fields[2].id", Matchers.is("jurisdiction")))
+ .andExpect(jsonPath("$.fields[2].enums", Matchers.hasSize(1)))
+ .andExpect(jsonPath("$.fields[2].enums[0].id", Matchers.is("us")));
+ }
+
+ @Test
+ public void findOneExcludedLicenseTest() throws Exception {
+ String epersonToken = getAuthToken(eperson.getEmail(), password);
+
+ // "mark" is excluded by the default cc.license.classfilter
+ getClient(epersonToken).perform(get("/api/config/submissioncclicenses/license272"))
+ .andExpect(status().isNotFound());
+ }
+
+ @Test
+ public void findOneCC0Test() throws Exception {
+ String epersonToken = getAuthToken(eperson.getEmail(), password);
+
+ getClient(epersonToken).perform(get("/api/config/submissioncclicenses/license271"))
+ .andExpect(status().isOk())
+ .andExpect(content().contentType(contentType))
+ .andExpect(jsonPath("$.id", Matchers.is("license271")))
+ .andExpect(jsonPath("$.name", Matchers.is("CC0 1.0 Universal")))
+ .andExpect(jsonPath("$.fields", Matchers.hasSize(0)));
}
@Test
@@ -63,20 +123,19 @@ public void findOneTestNonExistingLicense() throws Exception {
String epersonToken = getAuthToken(eperson.getEmail(), password);
getClient(epersonToken).perform(get("/api/config/submissioncclicenses/non-existing-license"))
- .andExpect(status().isNotFound());
+ .andExpect(status().isNotFound());
}
@Test
public void findAllTestUnAuthorized() throws Exception {
getClient().perform(get("/api/config/submissioncclicenses"))
- .andExpect(status().isUnauthorized());
+ .andExpect(status().isUnauthorized());
}
@Test
public void findOneTestUnAuthorized() throws Exception {
-
getClient().perform(get("/api/config/submissioncclicenses/license1"))
- .andExpect(status().isUnauthorized());
+ .andExpect(status().isUnauthorized());
}
}
diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepositoryIT.java
index fddc094435f6..66955aa3f672 100644
--- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepositoryIT.java
+++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionCCLicenseUrlRepositoryIT.java
@@ -20,11 +20,8 @@
/**
* Class to the methods from the SubmissionCCLicenseUrlRepository
- * Since the CC Licenses and the corresponding URIs are obtained from the CC License API, a mock service has been
- * implemented.
- * This mock service will return a fixed set of CC Licenses using a similar structure to the ones obtained from the
- * CC License API.
- * Refer to {@link org.dspace.license.MockCCLicenseConnectorServiceImpl} for more information
+ * CC Licenses from questions are now gotten from index.rdf and
+ * return a document that would be put into the cc license bundle
*/
public class SubmissionCCLicenseUrlRepositoryIT extends AbstractControllerIntegrationTest {
@@ -34,15 +31,9 @@ public void searchRightsByQuestionsTest() throws Exception {
String epersonToken = getAuthToken(eperson.getEmail(), password);
getClient(epersonToken).perform(get(
- "/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license2&answer_license2-field0" +
- "=license2-field0-enum1"))
- .andExpect(status().isOk())
- .andExpect(jsonPath("$.url", is("mock-license-uri")))
- .andExpect(jsonPath("$.type", is("submissioncclicenseUrl")))
- .andExpect(jsonPath("$._links.self.href",
- is("http://localhost/api/config/submissioncclicenseUrls/search/rightsByQuestions" +
- "?license=license2" +
- "&answer_license2-field0=license2-field0-enum1")));
+ "/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license1&answer_commercial=n" +
+ "&answer_derivatives=sa&answer_jurisdiction=us"))
+ .andExpect(status().isOk());
}
@Test
@@ -50,13 +41,8 @@ public void searchRightsByQuestionsTestLicenseForLicenseWithoutQuestions() throw
String epersonToken = getAuthToken(eperson.getEmail(), password);
getClient(epersonToken)
- .perform(get("/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license3"))
- .andExpect(status().isOk())
- .andExpect(jsonPath("$.url", is("mock-license-uri")))
- .andExpect(jsonPath("$.type", is("submissioncclicenseUrl")))
- .andExpect(jsonPath("$._links.self.href",
- is("http://localhost/api/config/submissioncclicenseUrls/search/rightsByQuestions" +
- "?license=license3")));
+ .perform(get("/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license271"))
+ .andExpect(status().isOk());
}
@Test
@@ -65,7 +51,7 @@ public void searchRightsByQuestionsNonExistingLicense() throws Exception {
getClient(epersonToken).perform(get(
"/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=nonexisting-license" +
- "&answer_license2-field0=license2-field0-enum1"))
+ "&answer_derivatives=sa&answer_jurisdiction=us"))
.andExpect(status().isNotFound());
}
@@ -74,8 +60,8 @@ public void searchRightsByQuestionsMissingRequiredAnswer() throws Exception {
String epersonToken = getAuthToken(eperson.getEmail(), password);
getClient(epersonToken).perform(get(
- "/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license1&answer_license1field0" +
- "=license1field0enum1"))
+ "/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license1&answer_commercial=n" +
+ "&answer_jurisdiction=us"))
.andExpect(status().isBadRequest());
}
@@ -84,8 +70,8 @@ public void searchRightsByQuestionsAdditionalNonExistingAnswer() throws Exceptio
String epersonToken = getAuthToken(eperson.getEmail(), password);
getClient(epersonToken).perform(get(
- "/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license2" +
- "&answer_license2field0=license2field0enum1&answer_nonexisting=test"))
+ "/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license1&answer_commercial=n" +
+ "&answer_derivatives=sa&answer_jurisdiction=us&answer_fake=fake"))
.andExpect(status().isBadRequest());
}
@@ -93,8 +79,8 @@ public void searchRightsByQuestionsAdditionalNonExistingAnswer() throws Exceptio
public void searchRightsByQuestionsAdditionalUnAuthorized() throws Exception {
getClient().perform(get(
- "/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license2&answer_license2-field0" +
- "=license2-field0-enum1"))
+ "/api/config/submissioncclicenseUrls/search/rightsByQuestions?license=license1&answer_commercial=n" +
+ "&answer_derivatives=sa&answer_jurisdiction=us"))
.andExpect(status().isUnauthorized());
}
diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionCCLicenseMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionCCLicenseMatcher.java
index cdf0470b519c..2061fa43ffc7 100644
--- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionCCLicenseMatcher.java
+++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionCCLicenseMatcher.java
@@ -22,61 +22,31 @@ public class SubmissionCCLicenseMatcher {
private SubmissionCCLicenseMatcher() {
}
- public static Matcher super Object> matchLicenseEntry(int count, int[] amountOfFieldsAndEnums) {
+ public static Matcher super Object> matchLicenseEntry(
+ String id,
+ String name,
+ int[] enumsPerField
+ ) {
return allOf(
- matchLicenseProperties(count),
- matchFields(count, amountOfFieldsAndEnums)
+ hasJsonPath("$.id", is(id)),
+ hasJsonPath("$.name", is(name)),
+ matchFields(enumsPerField)
);
}
- private static Matcher super Object> matchFields(int count, int[] amountOfFieldsAndEnums) {
+ private static Matcher super Object> matchFields(int[] enumsPerField) {
List> matchers = new LinkedList<>();
- for (int index = 0; index < amountOfFieldsAndEnums.length; index++) {
- matchers.add(matchField(count, index, amountOfFieldsAndEnums[index]));
- }
- return hasJsonPath("$.fields", containsInAnyOrder(matchers));
- }
- private static Matcher super Object> matchField(int count, int fieldIndex, int amountOfEnums) {
- return allOf(
- matchLicenseFieldProperties(count, fieldIndex),
- matchEnums(count, fieldIndex, amountOfEnums)
- );
+ for (int i = 0; i < enumsPerField.length; i++) {
+ int enumCount = enumsPerField[i];
- }
-
- private static Matcher super Object> matchEnums(int count, int fieldIndex, int amountOfEnums) {
- List> matchers = new LinkedList<>();
- for (int index = 0; index < amountOfEnums; index++) {
- matchers.add(matchLicenseFieldEnumProperties(count, fieldIndex, index));
+ matchers.add(allOf(
+ hasJsonPath("$.id"),
+ hasJsonPath("$.label"),
+ hasJsonPath("$.enums.length()", is(enumCount))
+ ));
}
-// return hasJsonPath("$.enums");
- return hasJsonPath("$.enums", containsInAnyOrder(matchers));
- }
-
- public static Matcher super Object> matchLicenseProperties(int count) {
- return allOf(
- hasJsonPath("$.id", is("license" + count)),
- hasJsonPath("$.name", is("License " + count + " - Name"))
- );
- }
-
- public static Matcher super Object> matchLicenseFieldProperties(int count, int fieldIndex) {
- return allOf(
- hasJsonPath("$.id", is("license" + count + "-field" + fieldIndex)),
- hasJsonPath("$.label", is("License " + count + " - Field " + fieldIndex + " - Label")),
- hasJsonPath("$.description", is("License " + count + " - Field " + fieldIndex + " - Description"))
- );
- }
-
- public static Matcher super Object> matchLicenseFieldEnumProperties(int count, int fieldIndex, int enumIndex) {
- return allOf(
- hasJsonPath("$.id", is("license" + count + "-field" + fieldIndex + "-enum" + enumIndex)),
- hasJsonPath("$.label",
- is("License " + count + " - Field " + fieldIndex + " - Enum " + enumIndex + " - Label")),
- hasJsonPath("$.description",
- is("License " + count + " - Field " + fieldIndex + " - Enum " + enumIndex + " - " + "Description"))
- );
+ return hasJsonPath("$.fields", containsInAnyOrder(matchers));
}
}
diff --git a/dspace-server-webapp/src/test/java/org/dspace/license/MockCCLicenseConnectorServiceImpl.java b/dspace-server-webapp/src/test/java/org/dspace/license/MockCCLicenseConnectorServiceImpl.java
deleted file mode 100644
index d70499d096b8..000000000000
--- a/dspace-server-webapp/src/test/java/org/dspace/license/MockCCLicenseConnectorServiceImpl.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * The contents of this file are subject to the license and copyright
- * detailed in the LICENSE and NOTICE files at the root of the source
- * tree and available online at
- *
- * http://www.dspace.org/license/
- */
-package org.dspace.license;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.jdom2.Document;
-import org.jdom2.JDOMException;
-
-/**
- * Mock implementation for the Creative commons license connector service.
- * This class will return a structure of CC Licenses similar to the CC License API but without having to contact it
- */
-public class MockCCLicenseConnectorServiceImpl extends CCLicenseConnectorServiceImpl {
-
- /**
- * Retrieves mock CC Licenses for the provided language
- * @param language - the language
- * @return a map of mocked licenses with the id and the license
- */
- public Map retrieveLicenses(String language) {
- Map ccLicenses = new HashMap<>();
- CCLicense mockLicense1 = createMockLicense(1, new int[]{3, 2, 3});
- CCLicense mockLicense2 = createMockLicense(2, new int[]{2});
- CCLicense mockLicense3 = createMockLicense(3, new int[]{});
-
- ccLicenses.put(mockLicense1.getLicenseId(), mockLicense1);
- ccLicenses.put(mockLicense2.getLicenseId(), mockLicense2);
- ccLicenses.put(mockLicense3.getLicenseId(), mockLicense3);
-
- return ccLicenses;
- }
-
- private CCLicense createMockLicense(int count, int[] amountOfFieldsAndEnums) {
- String licenseId = "license" + count;
- String licenseName = "License " + count + " - Name";
- List mockLicenseFields = createMockLicenseFields(count, amountOfFieldsAndEnums);
- return new CCLicense(licenseId, licenseName, mockLicenseFields);
- }
-
- private List createMockLicenseFields(int count, int[] amountOfFieldsAndEnums) {
- List ccLicenseFields = new LinkedList<>();
- for (int index = 0; index < amountOfFieldsAndEnums.length; index++) {
- String licenseFieldId = "license" + count + "-field" + index;
- String licenseFieldLabel = "License " + count + " - Field " + index + " - Label";
- String licenseFieldDescription = "License " + count + " - Field " + index + " - Description";
- List mockLicenseFields = createMockLicenseFields(count,
- index,
- amountOfFieldsAndEnums[index]);
- ccLicenseFields.add(new CCLicenseField(licenseFieldId,
- licenseFieldLabel,
- licenseFieldDescription,
- mockLicenseFields));
-
- }
-
- return ccLicenseFields;
- }
-
- private List createMockLicenseFields(int count, int index, int amountOfEnums) {
- List ccLicenseFieldEnumList = new LinkedList<>();
- for (int i = 0; i < amountOfEnums; i++) {
- String enumId = "license" + count + "-field" + index + "-enum" + i;
- String enumLabel = "License " + count + " - Field " + index + " - Enum " + i + " - Label";
- String enumDescription = "License " + count + " - Field " + index + " - Enum " + i + " - " +
- "Description";
- ccLicenseFieldEnumList.add(new CCLicenseFieldEnum(enumId, enumLabel, enumDescription));
- }
- return ccLicenseFieldEnumList;
-
- }
-
- /**
- * Retrieve a mock CC License URI
- *
- * @param licenseId - the ID of the license
- * @param language - the language for which to retrieve the full answerMap
- * @param answerMap - the answers to the different field questions
- * @return the CC License URI
- */
- public String retrieveRightsByQuestion(final String licenseId,
- final String language,
- final Map answerMap) {
-
- return "mock-license-uri";
- }
-
- /**
- * Retrieve a mock license RDF document.
- * When the uri contains "invalid", null will be returned to simulate that no document was found for the provided
- * URI
- *
- * @param licenseURI - The license URI for which to retrieve the license RDF document
- * @return a mock license RDF document or null when the URI contains invalid
- * @throws IOException
- */
- public Document retrieveLicenseRDFDoc(String licenseURI) throws IOException {
- if (!StringUtils.contains(licenseURI, "invalid")) {
- InputStream cclicense = null;
- try {
- cclicense = getClass().getResourceAsStream("cc-license-rdf.xml");
-
- Document doc = parser.build(cclicense);
- return doc;
- } catch (JDOMException e) {
- throw new RuntimeException(e);
- } finally {
- if (cclicense != null) {
- cclicense.close();
- }
- }
- }
- return null;
- }
-
-}
diff --git a/dspace/config/cc-license/cc-legal-tools.csv b/dspace/config/cc-license/cc-legal-tools.csv
new file mode 100644
index 000000000000..05bef054c91c
--- /dev/null
+++ b/dspace/config/cc-license/cc-legal-tools.csv
@@ -0,0 +1,277 @@
+"CATEGORY","VERSION","UNIT","JURISDICTION","CANONICAL_URL","IDENTIFIER","SPDX_IDENTIFIER","TITLE","LANGUAGE_DEFAULT","ENTRY_POINT"
+"licenses","3.0","by","","https://creativecommons.org/licenses/by/3.0/","CC 3.0","CC-BY-3.0","Attribution 3.0 Unported","en","CC_GROUP"
+"licenses","3.0","by","am","https://creativecommons.org/licenses/by/3.0/am/","CC BY 3.0 AM","","Attribution 3.0 Armenia","en",
+"licenses","3.0","by","at","https://creativecommons.org/licenses/by/3.0/at/","CC BY 3.0 AT","CC-BY-3.0-AT","Namensnennung 3.0 Österreich","de",
+"licenses","3.0","by","au","https://creativecommons.org/licenses/by/3.0/au/","CC BY 3.0 AU","CC-BY-3.0-AU","Attribution 3.0 Australia","en",
+"licenses","3.0","by","az","https://creativecommons.org/licenses/by/3.0/az/","CC BY 3.0 AZ","","Müəllifliyin müəyyən edilməsi 3.0 Azərbaycan","az",
+"licenses","3.0","by","br","https://creativecommons.org/licenses/by/3.0/br/","CC BY 3.0 BR","","Atribuição 3.0 Brasil","pt-br",
+"licenses","3.0","by","ca","https://creativecommons.org/licenses/by/3.0/ca/","CC BY 3.0 CA","","Attribution 3.0 Canada","en",
+"licenses","3.0","by","ch","https://creativecommons.org/licenses/by/3.0/ch/","CC BY 3.0 CH","","Namensnennung (by) 3.0 Schweiz","de",
+"licenses","3.0","by","cl","https://creativecommons.org/licenses/by/3.0/cl/","CC BY 3.0 CL","","Atribución 3.0 Chile","es",
+"licenses","3.0","by","cn","https://creativecommons.org/licenses/by/3.0/cn/","CC BY 3.0 CN","","署名 3.0中国大陆","zh-hans",
+"licenses","3.0","by","cr","https://creativecommons.org/licenses/by/3.0/cr/","CC BY 3.0 CR","","Atribución 3.0 Costa Rica","es",
+"licenses","3.0","by","cz","https://creativecommons.org/licenses/by/3.0/cz/","CC BY 3.0 CZ","","Uveďte autora 3.0 Česko","cs",
+"licenses","3.0","by","de","https://creativecommons.org/licenses/by/3.0/de/","CC BY 3.0 DE","CC-BY-3.0-DE","Namensnennung 3.0 Deutschland","de",
+"licenses","3.0","by","ec","https://creativecommons.org/licenses/by/3.0/ec/","CC BY 3.0 EC","","Reconocimiento 3.0 Ecuador","es",
+"licenses","3.0","by","ee","https://creativecommons.org/licenses/by/3.0/ee/","CC BY 3.0 EE","","Autorile viitamine 3.0 Eesti","et",
+"licenses","3.0","by","eg","https://creativecommons.org/licenses/by/3.0/eg/","CC BY 3.0 EG","","نسب المصنف 3.0 مصر","ar",
+"licenses","3.0","by","es","https://creativecommons.org/licenses/by/3.0/es/","CC BY 3.0 ES","","Reconocimiento 3.0 España","es",
+"licenses","3.0","by","fr","https://creativecommons.org/licenses/by/3.0/fr/","CC BY 3.0 FR","","Creative Commons Attribution 3.0 France","fr",
+"licenses","3.0","by","ge","https://creativecommons.org/licenses/by/3.0/ge/","CC BY 3.0 GE","","Attribution 3.0 Georgia","en",
+"licenses","3.0","by","gr","https://creativecommons.org/licenses/by/3.0/gr/","CC BY 3.0 GR","","Αναφορά 3.0 Ελλάδα","el",
+"licenses","3.0","by","gt","https://creativecommons.org/licenses/by/3.0/gt/","CC BY 3.0 GT","","Reconocimiento 3.0 Guatemala","es",
+"licenses","3.0","by","hk","https://creativecommons.org/licenses/by/3.0/hk/","CC BY 3.0 HK","","Attribution 3.0 Hong Kong","en",
+"licenses","3.0","by","hr","https://creativecommons.org/licenses/by/3.0/hr/","CC BY 3.0 HR","","Imenovanje 3.0 Hrvatska","hr",
+"licenses","3.0","by","ie","https://creativecommons.org/licenses/by/3.0/ie/","CC BY 3.0 IE","","Attribution 3.0 Ireland","en",
+"licenses","3.0","by","igo","https://creativecommons.org/licenses/by/3.0/igo/","CC BY 3.0 IGO","CC-BY-3.0-IGO","Attribution 3.0 IGO","en",
+"licenses","3.0","by","it","https://creativecommons.org/licenses/by/3.0/it/","CC BY 3.0 IT","","Attribuzione 3.0 Italia","it",
+"licenses","3.0","by","lu","https://creativecommons.org/licenses/by/3.0/lu/","CC BY 3.0 LU","","Paternité 3.0 Luxembourg","fr",
+"licenses","3.0","by","nl","https://creativecommons.org/licenses/by/3.0/nl/","CC BY 3.0 NL","CC-BY-3.0-NL","Naamsvermelding 3.0","nl",
+"licenses","3.0","by","no","https://creativecommons.org/licenses/by/3.0/no/","CC BY 3.0 NO","","Navngivelse 3.0 Norge","no",
+"licenses","3.0","by","nz","https://creativecommons.org/licenses/by/3.0/nz/","CC BY 3.0 NZ","","Attribution 3.0 New Zealand","en",
+"licenses","3.0","by","ph","https://creativecommons.org/licenses/by/3.0/ph/","CC BY 3.0 PH","","Attribution 3.0 Philippines","en",
+"licenses","3.0","by","pl","https://creativecommons.org/licenses/by/3.0/pl/","CC BY 3.0 PL","","Uznanie autorstwa 3.0 Polska","pl",
+"licenses","3.0","by","pr","https://creativecommons.org/licenses/by/3.0/pr/","CC BY 3.0 PR","","Reconocimiento 3.0 Puerto Rico","es",
+"licenses","3.0","by","pt","https://creativecommons.org/licenses/by/3.0/pt/","CC BY 3.0 PT","","Atribuição 3.0 Portugal","pt",
+"licenses","3.0","by","ro","https://creativecommons.org/licenses/by/3.0/ro/","CC BY 3.0 RO","","Atribuire 3.0 România","ro",
+"licenses","3.0","by","rs","https://creativecommons.org/licenses/by/3.0/rs/","CC BY 3.0 RS","","Autorstvo 3.0 Srbija","sr-latn",
+"licenses","3.0","by","sg","https://creativecommons.org/licenses/by/3.0/sg/","CC BY 3.0 SG","","Attribution 3.0 Singapore","en",
+"licenses","3.0","by","th","https://creativecommons.org/licenses/by/3.0/th/","CC BY 3.0 TH","","Attribution 3.0 Thailand","en",
+"licenses","3.0","by","tw","https://creativecommons.org/licenses/by/3.0/tw/","CC BY 3.0 TW","","姓名標示 3.0 台灣","zh-hant",
+"licenses","3.0","by","ug","https://creativecommons.org/licenses/by/3.0/ug/","CC BY 3.0 UG","","Attribution 3.0 Uganda","en",
+"licenses","3.0","by","us","https://creativecommons.org/licenses/by/3.0/us/","CC BY 3.0 US","CC-BY-3.0-US","Attribution 3.0 United States","en",
+"licenses","3.0","by","ve","https://creativecommons.org/licenses/by/3.0/ve/","CC BY 3.0 VE","","Atribución 3.0 Venezuela","es",
+"licenses","3.0","by","vn","https://creativecommons.org/licenses/by/3.0/vn/","CC BY 3.0 VN","","Attribution 3.0 Vietnam","en",
+"licenses","3.0","by","za","https://creativecommons.org/licenses/by/3.0/za/","CC BY 3.0 ZA","","Attribution 3.0 South Africa","en",
+"licenses","3.0","by-nc","","https://creativecommons.org/licenses/by-nc/3.0/","CC BY-NC 3.0","CC-BY-NC-3.0","Attribution-NonCommercial 3.0 Unported","en",
+"licenses","3.0","by-nc","am","https://creativecommons.org/licenses/by-nc/3.0/am/","CC BY-NC 3.0 AM","","Attribution-NonCommercial 3.0 Armenia","en",
+"licenses","3.0","by-nc","at","https://creativecommons.org/licenses/by-nc/3.0/at/","CC BY-NC 3.0 AT","","Namensnennung - Keine kommerzielle Nutzung 3.0 Österreich","de",
+"licenses","3.0","by-nc","au","https://creativecommons.org/licenses/by-nc/3.0/au/","CC BY-NC 3.0 AU","","Attribution-NonCommercial 3.0 Australia","en",
+"licenses","3.0","by-nc","az","https://creativecommons.org/licenses/by-nc/3.0/az/","CC BY-NC 3.0 AZ","","Müəllifliyin müəyyən edilməsi, qeyri-kommersiya 3.0 Azərbaycan","az",
+"licenses","3.0","by-nc","br","https://creativecommons.org/licenses/by-nc/3.0/br/","CC BY-NC 3.0 BR","","Atribuição-Uso não-comercial 3.0 Brasil","pt-br",
+"licenses","3.0","by-nc","ca","https://creativecommons.org/licenses/by-nc/3.0/ca/","CC BY-NC 3.0 CA","","Attribution-NonCommercial 3.0 Canada","en",
+"licenses","3.0","by-nc","ch","https://creativecommons.org/licenses/by-nc/3.0/ch/","CC BY-NC 3.0 CH","","Namensnennung – Nicht-kommerziell (by-nc) 3.0 Schweiz","de",
+"licenses","3.0","by-nc","cl","https://creativecommons.org/licenses/by-nc/3.0/cl/","CC BY-NC 3.0 CL","","Atribución - NoComercial 3.0 Chile","es",
+"licenses","3.0","by-nc","cn","https://creativecommons.org/licenses/by-nc/3.0/cn/","CC BY-NC 3.0 CN","","署名-非商业性使用 3.0中国大陆","zh-hans",
+"licenses","3.0","by-nc","cr","https://creativecommons.org/licenses/by-nc/3.0/cr/","CC BY-NC 3.0 CR","","Atribución – NoComercial 3.0 Costa Rica","es",
+"licenses","3.0","by-nc","cz","https://creativecommons.org/licenses/by-nc/3.0/cz/","CC BY-NC 3.0 CZ","","Uveďte autora-Neužívejte komerčně 3.0 Česko","cs",
+"licenses","3.0","by-nc","de","https://creativecommons.org/licenses/by-nc/3.0/de/","CC BY-NC 3.0 DE","CC-BY-NC-3.0-DE","Namensnennung - Keine kommerzielle Nutzung 3.0 Deutschland","de",
+"licenses","3.0","by-nc","ec","https://creativecommons.org/licenses/by-nc/3.0/ec/","CC BY-NC 3.0 EC","","Reconocimiento – No Comercial 3.0 Ecuador","es",
+"licenses","3.0","by-nc","ee","https://creativecommons.org/licenses/by-nc/3.0/ee/","CC BY-NC 3.0 EE","","Autorile viitamine-Mitteäriline eesmärk 3.0 Eesti","et",
+"licenses","3.0","by-nc","eg","https://creativecommons.org/licenses/by-nc/3.0/eg/","CC BY-NC 3.0 EG","","نسب المصنف - غير تجاري 3.0 مصر","ar",
+"licenses","3.0","by-nc","es","https://creativecommons.org/licenses/by-nc/3.0/es/","CC BY-NC 3.0 ES","","Reconocimiento-NoComercial 3.0 España","es",
+"licenses","3.0","by-nc","fr","https://creativecommons.org/licenses/by-nc/3.0/fr/","CC BY-NC 3.0 FR","","Creative Commons Attribution Pas d'Utilisation Commerciale 3.0 France","fr",
+"licenses","3.0","by-nc","ge","https://creativecommons.org/licenses/by-nc/3.0/ge/","CC BY-NC 3.0 GE","","Attribution-NonCommercial 3.0 Georgia","en",
+"licenses","3.0","by-nc","gr","https://creativecommons.org/licenses/by-nc/3.0/gr/","CC BY-NC 3.0 GR","","Αναφορά-Μη-Εμπορική Χρήση 3.0 Ελλάδα","el",
+"licenses","3.0","by-nc","gt","https://creativecommons.org/licenses/by-nc/3.0/gt/","CC BY-NC 3.0 GT","","Reconocimiento – No Comercial 3.0 Guatemala","es",
+"licenses","3.0","by-nc","hk","https://creativecommons.org/licenses/by-nc/3.0/hk/","CC BY-NC 3.0 HK","","Attribution-NonCommercial 3.0 Hong Kong","en",
+"licenses","3.0","by-nc","hr","https://creativecommons.org/licenses/by-nc/3.0/hr/","CC BY-NC 3.0 HR","","Imenovanje-Nekomercijalno 3.0 Hrvatska","hr",
+"licenses","3.0","by-nc","ie","https://creativecommons.org/licenses/by-nc/3.0/ie/","CC BY-NC 3.0 IE","","Attribution-NonCommercial 3.0 Ireland","en",
+"licenses","3.0","by-nc","igo","https://creativecommons.org/licenses/by-nc/3.0/igo/","CC BY-NC 3.0 IGO","","Attribution-NonCommercial 3.0 IGO","en",
+"licenses","3.0","by-nc","it","https://creativecommons.org/licenses/by-nc/3.0/it/","CC BY-NC 3.0 IT","","Attribuzione - Non commerciale 3.0 Italia","it",
+"licenses","3.0","by-nc","lu","https://creativecommons.org/licenses/by-nc/3.0/lu/","CC BY-NC 3.0 LU","","Paternité - Pas d'Utilisation Commerciale 3.0 Luxembourg","fr",
+"licenses","3.0","by-nc","nl","https://creativecommons.org/licenses/by-nc/3.0/nl/","CC BY-NC 3.0 NL","","Naamsvermelding-NietCommercieel 3.0","nl",
+"licenses","3.0","by-nc","no","https://creativecommons.org/licenses/by-nc/3.0/no/","CC BY-NC 3.0 NO","","Navngivelse-Ikkekommersiell 3.0 Norge","no",
+"licenses","3.0","by-nc","nz","https://creativecommons.org/licenses/by-nc/3.0/nz/","CC BY-NC 3.0 NZ","","Attribution-NonCommercial 3.0 New Zealand","en",
+"licenses","3.0","by-nc","ph","https://creativecommons.org/licenses/by-nc/3.0/ph/","CC BY-NC 3.0 PH","","Attribution-NonCommercial 3.0 Philippines","en",
+"licenses","3.0","by-nc","pl","https://creativecommons.org/licenses/by-nc/3.0/pl/","CC BY-NC 3.0 PL","","Uznanie autorstwa - Użycie niekomercyjne 3.0 Polska","pl",
+"licenses","3.0","by-nc","pr","https://creativecommons.org/licenses/by-nc/3.0/pr/","CC BY-NC 3.0 PR","","Reconocimiento - No Comercial 3.0 Puerto Rico","es",
+"licenses","3.0","by-nc","pt","https://creativecommons.org/licenses/by-nc/3.0/pt/","CC BY-NC 3.0 PT","","Atribuição – NãoComercial 3.0 Portugal","pt",
+"licenses","3.0","by-nc","ro","https://creativecommons.org/licenses/by-nc/3.0/ro/","CC BY-NC 3.0 RO","","Atribuire–Necomercial 3.0 România","ro",
+"licenses","3.0","by-nc","rs","https://creativecommons.org/licenses/by-nc/3.0/rs/","CC BY-NC 3.0 RS","","Autorstvo-Nekomercijalno 3.0 Srbija","sr-latn",
+"licenses","3.0","by-nc","sg","https://creativecommons.org/licenses/by-nc/3.0/sg/","CC BY-NC 3.0 SG","","Attribution-NonCommercial 3.0 Singapore","en",
+"licenses","3.0","by-nc","th","https://creativecommons.org/licenses/by-nc/3.0/th/","CC BY-NC 3.0 TH","","Attribution-NonCommercial 3.0 Thailand","en",
+"licenses","3.0","by-nc","tw","https://creativecommons.org/licenses/by-nc/3.0/tw/","CC BY-NC 3.0 TW","","姓名標示─非商業性 3.0 台灣","zh-hant",
+"licenses","3.0","by-nc","ug","https://creativecommons.org/licenses/by-nc/3.0/ug/","CC BY-NC 3.0 UG","","Attribution-NonCommercial 3.0 Uganda","en",
+"licenses","3.0","by-nc","us","https://creativecommons.org/licenses/by-nc/3.0/us/","CC BY-NC 3.0 US","","Attribution-NonCommercial 3.0 United States","en",
+"licenses","3.0","by-nc","ve","https://creativecommons.org/licenses/by-nc/3.0/ve/","CC BY-NC 3.0 VE","","Atribución-NoComercial 3.0 Venezuela","es",
+"licenses","3.0","by-nc","vn","https://creativecommons.org/licenses/by-nc/3.0/vn/","CC BY-NC 3.0 VN","","Attribution-NonCommercial 3.0 Vietnam","en",
+"licenses","3.0","by-nc","za","https://creativecommons.org/licenses/by-nc/3.0/za/","CC BY-NC 3.0 ZA","","Attribution-NonCommercial 3.0 South Africa","en",
+"licenses","3.0","by-nc-nd","","https://creativecommons.org/licenses/by-nc-nd/3.0/","CC BY-NC-ND 3.0","CC-BY-NC-ND-3.0","Attribution-NonCommercial-NoDerivs 3.0 Unported","en",
+"licenses","3.0","by-nc-nd","am","https://creativecommons.org/licenses/by-nc-nd/3.0/am/","CC BY-NC-ND 3.0 AM","","Attribution-NonCommercial-NoDerivs 3.0 Armenia","en",
+"licenses","3.0","by-nc-nd","at","https://creativecommons.org/licenses/by-nc-nd/3.0/at/","CC BY-NC-ND 3.0 AT","","Namensnennung - Keine kommerzielle Nutzung - Keine Bearbeitungen 3.0 Österreich","de",
+"licenses","3.0","by-nc-nd","au","https://creativecommons.org/licenses/by-nc-nd/3.0/au/","CC BY-NC-ND 3.0 AU","","Attribution-NonCommercial-NoDerivs 3.0 Australia","en",
+"licenses","3.0","by-nc-nd","az","https://creativecommons.org/licenses/by-nc-nd/3.0/az/","CC BY-NC-ND 3.0 AZ","","Müəllifliyin müəyyən edilməsi, qeyri-kommersiya, qeyri-törəmə 3.0 Azərbaycan","az",
+"licenses","3.0","by-nc-nd","br","https://creativecommons.org/licenses/by-nc-nd/3.0/br/","CC BY-NC-ND 3.0 BR","","Atribuição-Uso não-comercial-Vedada a criação de obras derivadas 3.0 Brasil","pt-br",
+"licenses","3.0","by-nc-nd","ca","https://creativecommons.org/licenses/by-nc-nd/3.0/ca/","CC BY-NC-ND 3.0 CA","","Attribution-NonCommercial-NoDerivs 3.0 Canada","en",
+"licenses","3.0","by-nc-nd","ch","https://creativecommons.org/licenses/by-nc-nd/3.0/ch/","CC BY-NC-ND 3.0 CH","","Namensnennung – Nicht-kommerziell – Keine Bearbeitung (by-nc-nd) 3.0 Schweiz","de",
+"licenses","3.0","by-nc-nd","cl","https://creativecommons.org/licenses/by-nc-nd/3.0/cl/","CC BY-NC-ND 3.0 CL","","Atribución - NoComercial - SinDerivadas 3.0 Chile","es",
+"licenses","3.0","by-nc-nd","cn","https://creativecommons.org/licenses/by-nc-nd/3.0/cn/","CC BY-NC-ND 3.0 CN","","署名-非商业性使用-禁止演绎 3.0中国大陆","zh-hans",
+"licenses","3.0","by-nc-nd","cr","https://creativecommons.org/licenses/by-nc-nd/3.0/cr/","CC BY-NC-ND 3.0 CR","","Atribución – NoComercial – SinDerivadas 3.0 Costa Rica","es",
+"licenses","3.0","by-nc-nd","cz","https://creativecommons.org/licenses/by-nc-nd/3.0/cz/","CC BY-NC-ND 3.0 CZ","","Uveďte autora-Neužívejte komerčně-Nezasahujte do díla 3.0 Česko","cs",
+"licenses","3.0","by-nc-nd","de","https://creativecommons.org/licenses/by-nc-nd/3.0/de/","CC BY-NC-ND 3.0 DE","CC-BY-NC-ND-3.0-DE","Namensnennung - Keine kommerzielle Nutzung - Keine Bearbeitungen 3.0 Deutschland","de",
+"licenses","3.0","by-nc-nd","ec","https://creativecommons.org/licenses/by-nc-nd/3.0/ec/","CC BY-NC-ND 3.0 EC","","Reconocimiento – No Comercial – Sin Obras Derivadas 3.0 Ecuador","es",
+"licenses","3.0","by-nc-nd","ee","https://creativecommons.org/licenses/by-nc-nd/3.0/ee/","CC BY-NC-ND 3.0 EE","","Autorile viitamine-Mitteäriline eesmärk-Tuletatud teoste keeld 3.0 Eesti","et",
+"licenses","3.0","by-nc-nd","eg","https://creativecommons.org/licenses/by-nc-nd/3.0/eg/","CC BY-NC-ND 3.0 EG","","نسب المصنف - غير تجاري – منع الاشتقاق 3.0 مصر","ar",
+"licenses","3.0","by-nc-nd","es","https://creativecommons.org/licenses/by-nc-nd/3.0/es/","CC BY-NC-ND 3.0 ES","","Reconocimiento-NoComercial-SinObrasDerivadas 3.0 España","es",
+"licenses","3.0","by-nc-nd","fr","https://creativecommons.org/licenses/by-nc-nd/3.0/fr/","CC BY-NC-ND 3.0 FR","","Creative Commons Attribution Pas d'Utilisation Commerciale Pas de Modification 3.0 France","fr",
+"licenses","3.0","by-nc-nd","ge","https://creativecommons.org/licenses/by-nc-nd/3.0/ge/","CC BY-NC-ND 3.0 GE","","Attribution-NonCommercial-NoDerivs 3.0 Georgia","en",
+"licenses","3.0","by-nc-nd","gr","https://creativecommons.org/licenses/by-nc-nd/3.0/gr/","CC BY-NC-ND 3.0 GR","","Αναφορά-Μη-Εμπορική Χρήση-Όχι Παράγωγο Έργο 3.0 Ελλάδα","el",
+"licenses","3.0","by-nc-nd","gt","https://creativecommons.org/licenses/by-nc-nd/3.0/gt/","CC BY-NC-ND 3.0 GT","","Reconocimiento – No Comercial – Sin Obras Derivadas 3.0 Guatemala","es",
+"licenses","3.0","by-nc-nd","hk","https://creativecommons.org/licenses/by-nc-nd/3.0/hk/","CC BY-NC-ND 3.0 HK","","Attribution-NonCommercial-NoDerivs 3.0 Hong Kong","en",
+"licenses","3.0","by-nc-nd","hr","https://creativecommons.org/licenses/by-nc-nd/3.0/hr/","CC BY-NC-ND 3.0 HR","","Imenovanje-Nekomercijalno-Bez prerada 3.0 Hrvatska","hr",
+"licenses","3.0","by-nc-nd","ie","https://creativecommons.org/licenses/by-nc-nd/3.0/ie/","CC BY-NC-ND 3.0 IE","","Attribution-NonCommercial-NoDerivs 3.0 Ireland","en",
+"licenses","3.0","by-nc-nd","igo","https://creativecommons.org/licenses/by-nc-nd/3.0/igo/","CC BY-NC-ND 3.0 IGO","CC-BY-NC-ND-3.0-IGO","Attribution-NonCommercial-NoDerivs 3.0 IGO","en",
+"licenses","3.0","by-nc-nd","it","https://creativecommons.org/licenses/by-nc-nd/3.0/it/","CC BY-NC-ND 3.0 IT","","Attribuzione – Non commerciale – Non opere derivate 3.0 Italia","it",
+"licenses","3.0","by-nc-nd","lu","https://creativecommons.org/licenses/by-nc-nd/3.0/lu/","CC BY-NC-ND 3.0 LU","","Paternité - Pas d'Utilisation Commerciale - Pas de Modification 3.0 Luxembourg","fr",
+"licenses","3.0","by-nc-nd","nl","https://creativecommons.org/licenses/by-nc-nd/3.0/nl/","CC BY-NC-ND 3.0 NL","","Naamsvermelding-NietCommercieel-GeenAfgeleideWerken 3.0","nl",
+"licenses","3.0","by-nc-nd","no","https://creativecommons.org/licenses/by-nc-nd/3.0/no/","CC BY-NC-ND 3.0 NO","","Navngivelse-Ikkekommersiell-IngenBearbeidelse 3.0 Norge","no",
+"licenses","3.0","by-nc-nd","nz","https://creativecommons.org/licenses/by-nc-nd/3.0/nz/","CC BY-NC-ND 3.0 NZ","","Attribution-NonCommercial-NoDerivs 3.0 New Zealand","en",
+"licenses","3.0","by-nc-nd","ph","https://creativecommons.org/licenses/by-nc-nd/3.0/ph/","CC BY-NC-ND 3.0 PH","","Attribution-NonCommercial-NoDerivs 3.0 Philippines","en",
+"licenses","3.0","by-nc-nd","pl","https://creativecommons.org/licenses/by-nc-nd/3.0/pl/","CC BY-NC-ND 3.0 PL","","Uznanie autorstwa - Użycie niekomercyjne - Bez utworów zależnych 3.0 Polska","pl",
+"licenses","3.0","by-nc-nd","pr","https://creativecommons.org/licenses/by-nc-nd/3.0/pr/","CC BY-NC-ND 3.0 PR","","Reconocimiento - No Comercial - Sin Obras Derivadas 3.0 Puerto Rico","es",
+"licenses","3.0","by-nc-nd","pt","https://creativecommons.org/licenses/by-nc-nd/3.0/pt/","CC BY-NC-ND 3.0 PT","","Atribuição – NãoComercial – SemDerivados 3.0 Portugal","pt",
+"licenses","3.0","by-nc-nd","ro","https://creativecommons.org/licenses/by-nc-nd/3.0/ro/","CC BY-NC-ND 3.0 RO","","Atribuire–Necomercial–Fără Modificări 3.0 România","ro",
+"licenses","3.0","by-nc-nd","rs","https://creativecommons.org/licenses/by-nc-nd/3.0/rs/","CC BY-NC-ND 3.0 RS","","Autorstvo-Nekomercijalno-Bez prerada 3.0 Srbija","sr-latn",
+"licenses","3.0","by-nc-nd","sg","https://creativecommons.org/licenses/by-nc-nd/3.0/sg/","CC BY-NC-ND 3.0 SG","","Attribution-NonCommercial-NoDerivs 3.0 Singapore","en",
+"licenses","3.0","by-nc-nd","th","https://creativecommons.org/licenses/by-nc-nd/3.0/th/","CC BY-NC-ND 3.0 TH","","Attribution-NonCommercial-NoDerivs 3.0 Thailand","en",
+"licenses","3.0","by-nc-nd","tw","https://creativecommons.org/licenses/by-nc-nd/3.0/tw/","CC BY-NC-ND 3.0 TW","","姓名標示─非商業性─禁止改作 3.0 台灣","zh-hant",
+"licenses","3.0","by-nc-nd","ug","https://creativecommons.org/licenses/by-nc-nd/3.0/ug/","CC BY-NC-ND 3.0 UG","","Attribution-NonCommercial-NoDerivs 3.0 Uganda","en",
+"licenses","3.0","by-nc-nd","us","https://creativecommons.org/licenses/by-nc-nd/3.0/us/","CC BY-NC-ND 3.0 US","","Attribution-NonCommercial-NoDerivs 3.0 United States","en",
+"licenses","3.0","by-nc-nd","ve","https://creativecommons.org/licenses/by-nc-nd/3.0/ve/","CC BY-NC-ND 3.0 VE","","Atribución-NoComercial-SinDerivadas 3.0 Venezuela","es",
+"licenses","3.0","by-nc-nd","vn","https://creativecommons.org/licenses/by-nc-nd/3.0/vn/","CC BY-NC-ND 3.0 VN","","Attribution-NonCommercial-NoDerivs 3.0 Vietnam","en",
+"licenses","3.0","by-nc-nd","za","https://creativecommons.org/licenses/by-nc-nd/3.0/za/","CC BY-NC-ND 3.0 ZA","","Attribution-NonCommercial-NoDerivs 3.0 South Africa","en",
+"licenses","3.0","by-nc-sa","","https://creativecommons.org/licenses/by-nc-sa/3.0/","CC BY-NC-SA 3.0","CC-BY-NC-SA-3.0","Attribution-NonCommercial-ShareAlike 3.0 Unported","en",
+"licenses","3.0","by-nc-sa","am","https://creativecommons.org/licenses/by-nc-sa/3.0/am/","CC BY-NC-SA 3.0 AM","","Attribution-NonCommercial-ShareAlike 3.0 Armenia","en",
+"licenses","3.0","by-nc-sa","at","https://creativecommons.org/licenses/by-nc-sa/3.0/at/","CC BY-NC-SA 3.0 AT","","Namensnennung - Keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Österreich","de",
+"licenses","3.0","by-nc-sa","au","https://creativecommons.org/licenses/by-nc-sa/3.0/au/","CC BY-NC-SA 3.0 AU","","Attribution-NonCommercial-ShareAlike 3.0 Australia","en",
+"licenses","3.0","by-nc-sa","az","https://creativecommons.org/licenses/by-nc-sa/3.0/az/","CC BY-NC-SA 3.0 AZ","","Müəllifliyin müəyyən edilməsi, qeyri-kommersiya, bərabər istifadə hüquqlu 3.0","az",
+"licenses","3.0","by-nc-sa","br","https://creativecommons.org/licenses/by-nc-sa/3.0/br/","CC BY-NC-SA 3.0 BR","","Atribuição-Uso não-comercial-Compartilhamento pela mesma licença 3.0 Brasil","pt-br",
+"licenses","3.0","by-nc-sa","ca","https://creativecommons.org/licenses/by-nc-sa/3.0/ca/","CC BY-NC-SA 3.0 CA","","Attribution-NonCommercial-ShareAlike 3.0 Canada","en",
+"licenses","3.0","by-nc-sa","ch","https://creativecommons.org/licenses/by-nc-sa/3.0/ch/","CC BY-NC-SA 3.0 CH","","Namensnennung – Nicht-kommerziell – Weitergabe unter gleichen Bedingungen (by-nc-sa) 3.0 Schweiz","de",
+"licenses","3.0","by-nc-sa","cl","https://creativecommons.org/licenses/by-nc-sa/3.0/cl/","CC BY-NC-SA 3.0 CL","","Atribución - NoComercial - CompartirIgual 3.0 Chile","es",
+"licenses","3.0","by-nc-sa","cn","https://creativecommons.org/licenses/by-nc-sa/3.0/cn/","CC BY-NC-SA 3.0 CN","","署名-非商业性使用-相同方式共享 3.0中国大陆","zh-hans",
+"licenses","3.0","by-nc-sa","cr","https://creativecommons.org/licenses/by-nc-sa/3.0/cr/","CC BY-NC-SA 3.0 CR","","Atribución – NoComercial – CompartirIgual 3.0 Costa Rica","es",
+"licenses","3.0","by-nc-sa","cz","https://creativecommons.org/licenses/by-nc-sa/3.0/cz/","CC BY-NC-SA 3.0 CZ","","Uveďte autora-Neužívejte komerčně-Zachovejte licenci 3.0 Česko","cs",
+"licenses","3.0","by-nc-sa","de","https://creativecommons.org/licenses/by-nc-sa/3.0/de/","CC BY-NC-SA 3.0 DE","CC-BY-NC-SA-3.0-DE","Namensnennung - Keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Deutschland","de",
+"licenses","3.0","by-nc-sa","ec","https://creativecommons.org/licenses/by-nc-sa/3.0/ec/","CC BY-NC-SA 3.0 EC","","Reconocimiento – No Comercial – Compartir Igual 3.0 Ecuador","es",
+"licenses","3.0","by-nc-sa","ee","https://creativecommons.org/licenses/by-nc-sa/3.0/ee/","CC BY-NC-SA 3.0 EE","","Autorile viitamine-Mitteäriline eesmärk-Jagamine samadel tingimustel 3.0 Eesti","et",
+"licenses","3.0","by-nc-sa","eg","https://creativecommons.org/licenses/by-nc-sa/3.0/eg/","CC BY-NC-SA 3.0 EG","","نسب المصنف - غير تجاري – الترخيص بالمثل 3.0 مصر","ar",
+"licenses","3.0","by-nc-sa","es","https://creativecommons.org/licenses/by-nc-sa/3.0/es/","CC BY-NC-SA 3.0 ES","","Reconocimiento-NoComercial-CompartirIgual 3.0 España","es",
+"licenses","3.0","by-nc-sa","fr","https://creativecommons.org/licenses/by-nc-sa/3.0/fr/","CC BY-NC-SA 3.0 FR","","Creative Commons Attribution Pas d'Utilisation Commerciale Partage à l'Identique 3.0 France","fr",
+"licenses","3.0","by-nc-sa","ge","https://creativecommons.org/licenses/by-nc-sa/3.0/ge/","CC BY-NC-SA 3.0 GE","","Attribution-NonCommercial-ShareAlike 3.0 Georgia","en",
+"licenses","3.0","by-nc-sa","gr","https://creativecommons.org/licenses/by-nc-sa/3.0/gr/","CC BY-NC-SA 3.0 GR","","Αναφορά-Μη-Εμπορική Χρήση-Παρόμοια Διανομή 3.0 Ελλάδα","el",
+"licenses","3.0","by-nc-sa","gt","https://creativecommons.org/licenses/by-nc-sa/3.0/gt/","CC BY-NC-SA 3.0 GT","","Reconocimiento – No Comercial – Compartir Igual 3.0 Guatemala","es",
+"licenses","3.0","by-nc-sa","hk","https://creativecommons.org/licenses/by-nc-sa/3.0/hk/","CC BY-NC-SA 3.0 HK","","Attribution-NonCommercial-ShareAlike 3.0 Hong Kong","en",
+"licenses","3.0","by-nc-sa","hr","https://creativecommons.org/licenses/by-nc-sa/3.0/hr/","CC BY-NC-SA 3.0 HR","","Imenovanje-Nekomercijalno-Dijeli pod istim uvjetima 3.0 Hrvatska","hr",
+"licenses","3.0","by-nc-sa","ie","https://creativecommons.org/licenses/by-nc-sa/3.0/ie/","CC BY-NC-SA 3.0 IE","","Attribution-NonCommercial-ShareAlike 3.0 Ireland","en",
+"licenses","3.0","by-nc-sa","igo","https://creativecommons.org/licenses/by-nc-sa/3.0/igo/","CC BY-NC-SA 3.0 IGO","CC-BY-NC-SA-3.0-IGO","Attribution-NonCommercial-ShareAlike 3.0 IGO","en",
+"licenses","3.0","by-nc-sa","it","https://creativecommons.org/licenses/by-nc-sa/3.0/it/","CC BY-NC-SA 3.0 IT","","Attribuzione - Non commerciale - Condividi allo stesso modo 3.0 Italia","it",
+"licenses","3.0","by-nc-sa","lu","https://creativecommons.org/licenses/by-nc-sa/3.0/lu/","CC BY-NC-SA 3.0 LU","","Paternité - Pas d'Utilisation Commerciale - Partage à l'identique 3.0 Luxembourg","fr",
+"licenses","3.0","by-nc-sa","nl","https://creativecommons.org/licenses/by-nc-sa/3.0/nl/","CC BY-NC-SA 3.0 NL","","Naamsvermelding-NietCommercieel-GelijkDelen 3.0","nl",
+"licenses","3.0","by-nc-sa","no","https://creativecommons.org/licenses/by-nc-sa/3.0/no/","CC BY-NC-SA 3.0 NO","","Navngivelse-Ikkekommersiell-DelPåSammeVilkår 3.0 Norge","no",
+"licenses","3.0","by-nc-sa","nz","https://creativecommons.org/licenses/by-nc-sa/3.0/nz/","CC BY-NC-SA 3.0 NZ","","Attribution-NonCommercial-ShareAlike 3.0 New Zealand","en",
+"licenses","3.0","by-nc-sa","ph","https://creativecommons.org/licenses/by-nc-sa/3.0/ph/","CC BY-NC-SA 3.0 PH","","Attribution-NonCommercial-ShareAlike 3.0 Philippines","en",
+"licenses","3.0","by-nc-sa","pl","https://creativecommons.org/licenses/by-nc-sa/3.0/pl/","CC BY-NC-SA 3.0 PL","","Uznanie autorstwa - Użycie niekomercyjne - Na tych samych warunkach 3.0 Polska","pl",
+"licenses","3.0","by-nc-sa","pr","https://creativecommons.org/licenses/by-nc-sa/3.0/pr/","CC BY-NC-SA 3.0 PR","","Reconocimiento - No Comercial - Compartir Igual 3.0 Puerto Rico","es",
+"licenses","3.0","by-nc-sa","pt","https://creativecommons.org/licenses/by-nc-sa/3.0/pt/","CC BY-NC-SA 3.0 PT","","Atribuição – NãoComercial – CompartilhaIgual 3.0 Portugal","pt",
+"licenses","3.0","by-nc-sa","ro","https://creativecommons.org/licenses/by-nc-sa/3.0/ro/","CC BY-NC-SA 3.0 RO","","Atribuire–Necomercial–Distribuire în Condiţii Identice 3.0 România","ro",
+"licenses","3.0","by-nc-sa","rs","https://creativecommons.org/licenses/by-nc-sa/3.0/rs/","CC BY-NC-SA 3.0 RS","","Autorstvo-Nekomercijalno-Deliti pod istim uslovima 3.0 Srbija","sr-latn",
+"licenses","3.0","by-nc-sa","sg","https://creativecommons.org/licenses/by-nc-sa/3.0/sg/","CC BY-NC-SA 3.0 SG","","Attribution-NonCommercial-ShareAlike 3.0 Singapore","en",
+"licenses","3.0","by-nc-sa","th","https://creativecommons.org/licenses/by-nc-sa/3.0/th/","CC BY-NC-SA 3.0 TH","","Attribution-NonCommercial-ShareAlike 3.0 Thailand","en",
+"licenses","3.0","by-nc-sa","tw","https://creativecommons.org/licenses/by-nc-sa/3.0/tw/","CC BY-NC-SA 3.0 TW","","姓名標示─非商業性─相同方式分享 3.0 台灣","zh-hant",
+"licenses","3.0","by-nc-sa","ug","https://creativecommons.org/licenses/by-nc-sa/3.0/ug/","CC BY-NC-SA 3.0 UG","","Attribution-NonCommercial-ShareAlike 3.0 Uganda","en",
+"licenses","3.0","by-nc-sa","us","https://creativecommons.org/licenses/by-nc-sa/3.0/us/","CC BY-NC-SA 3.0 US","","Attribution-NonCommercial-ShareAlike 3.0 United States","en",
+"licenses","3.0","by-nc-sa","ve","https://creativecommons.org/licenses/by-nc-sa/3.0/ve/","CC BY-NC-SA 3.0 VE","","Atribución-NoComercial-CompartirIgual 3.0 Venezuela","es",
+"licenses","3.0","by-nc-sa","vn","https://creativecommons.org/licenses/by-nc-sa/3.0/vn/","CC BY-NC-SA 3.0 VN","","Attribution-NonCommercial-ShareAlike 3.0 Vietnam","en",
+"licenses","3.0","by-nc-sa","za","https://creativecommons.org/licenses/by-nc-sa/3.0/za/","CC BY-NC-SA 3.0 ZA","","Attribution-NonCommercial-ShareAlike 3.0 South Africa","en",
+"licenses","3.0","by-nd","","https://creativecommons.org/licenses/by-nd/3.0/","CC BY-ND 3.0","CC-BY-ND-3.0","Attribution-NoDerivs 3.0 Unported","en",
+"licenses","3.0","by-nd","am","https://creativecommons.org/licenses/by-nd/3.0/am/","CC BY-ND 3.0 AM","","Attribution-NoDerivs 3.0 Armenia","en",
+"licenses","3.0","by-nd","at","https://creativecommons.org/licenses/by-nd/3.0/at/","CC BY-ND 3.0 AT","","Namensnennung - Keine Bearbeitungen 3.0 Österreich","de",
+"licenses","3.0","by-nd","au","https://creativecommons.org/licenses/by-nd/3.0/au/","CC BY-ND 3.0 AU","","Attribution-NoDerivs 3.0 Australia","en",
+"licenses","3.0","by-nd","az","https://creativecommons.org/licenses/by-nd/3.0/az/","CC BY-ND 3.0 AZ","","Müəllifliyin müəyyən edilməsi, qeyri-törəmə 3.0 Azərbaycan","az",
+"licenses","3.0","by-nd","br","https://creativecommons.org/licenses/by-nd/3.0/br/","CC BY-ND 3.0 BR","","Atribuição-Vedada a criação de obras derivadas 3.0 Brasil","pt-br",
+"licenses","3.0","by-nd","ca","https://creativecommons.org/licenses/by-nd/3.0/ca/","CC BY-ND 3.0 CA","","Attribution-NoDerivs 3.0 Canada","en",
+"licenses","3.0","by-nd","ch","https://creativecommons.org/licenses/by-nd/3.0/ch/","CC BY-ND 3.0 CH","","Namensnennung – Keine Bearbeitung (by-nd) 3.0 Schweiz","de",
+"licenses","3.0","by-nd","cl","https://creativecommons.org/licenses/by-nd/3.0/cl/","CC BY-ND 3.0 CL","","Atribución - SinDerivadas 3.0 Chile","es",
+"licenses","3.0","by-nd","cn","https://creativecommons.org/licenses/by-nd/3.0/cn/","CC BY-ND 3.0 CN","","署名-禁止演绎 3.0中国大陆","zh-hans",
+"licenses","3.0","by-nd","cr","https://creativecommons.org/licenses/by-nd/3.0/cr/","CC BY-ND 3.0 CR","","Atribución – SinDerivadas 3.0 Costa Rica","es",
+"licenses","3.0","by-nd","cz","https://creativecommons.org/licenses/by-nd/3.0/cz/","CC BY-ND 3.0 CZ","","Uveďte autora-Nezasahujte do díla 3.0 Česko","cs",
+"licenses","3.0","by-nd","de","https://creativecommons.org/licenses/by-nd/3.0/de/","CC BY-ND 3.0 DE","CC-BY-ND-3.0-DE","Namensnennung - Keine Bearbeitungen 3.0 Deutschland","de",
+"licenses","3.0","by-nd","ec","https://creativecommons.org/licenses/by-nd/3.0/ec/","CC BY-ND 3.0 EC","","Reconocimiento – Sin Obras Derivadas 3.0 Ecuador","es",
+"licenses","3.0","by-nd","ee","https://creativecommons.org/licenses/by-nd/3.0/ee/","CC BY-ND 3.0 EE","","Autorile viitamine -Tuletatud teoste keeld 3.0 Eesti","et",
+"licenses","3.0","by-nd","eg","https://creativecommons.org/licenses/by-nd/3.0/eg/","CC BY-ND 3.0 EG","","نسب المصنف – منع الاشتقاق 3.0 مصر","ar",
+"licenses","3.0","by-nd","es","https://creativecommons.org/licenses/by-nd/3.0/es/","CC BY-ND 3.0 ES","","Reconocimiento-SinObrasDerivadas 3.0 España","es",
+"licenses","3.0","by-nd","fr","https://creativecommons.org/licenses/by-nd/3.0/fr/","CC BY-ND 3.0 FR","","Creative Commons Attribution Pas de Modification 3.0 France","fr",
+"licenses","3.0","by-nd","ge","https://creativecommons.org/licenses/by-nd/3.0/ge/","CC BY-ND 3.0 GE","","Attribution-NoDerivs 3.0 Georgia","en",
+"licenses","3.0","by-nd","gr","https://creativecommons.org/licenses/by-nd/3.0/gr/","CC BY-ND 3.0 GR","","Αναφορά-Όχι Παράγωγο Έργο 3.0 Ελλάδα","el",
+"licenses","3.0","by-nd","gt","https://creativecommons.org/licenses/by-nd/3.0/gt/","CC BY-ND 3.0 GT","","Reconocimiento - Sin Obras Derivadas 3.0 Guatemala","es",
+"licenses","3.0","by-nd","hk","https://creativecommons.org/licenses/by-nd/3.0/hk/","CC BY-ND 3.0 HK","","Attribution-NoDerivs 3.0 Hong Kong","en",
+"licenses","3.0","by-nd","hr","https://creativecommons.org/licenses/by-nd/3.0/hr/","CC BY-ND 3.0 HR","","Imenovanje-Bez prerada 3.0 Hrvatska","hr",
+"licenses","3.0","by-nd","ie","https://creativecommons.org/licenses/by-nd/3.0/ie/","CC BY-ND 3.0 IE","","Attribution-NoDerivs 3.0 Ireland","en",
+"licenses","3.0","by-nd","igo","https://creativecommons.org/licenses/by-nd/3.0/igo/","CC BY-ND 3.0 IGO","","Attribution-NoDerivs 3.0 IGO","en",
+"licenses","3.0","by-nd","it","https://creativecommons.org/licenses/by-nd/3.0/it/","CC BY-ND 3.0 IT","","Attribuzione - Non opere derivate 3.0 Italia","it",
+"licenses","3.0","by-nd","lu","https://creativecommons.org/licenses/by-nd/3.0/lu/","CC BY-ND 3.0 LU","","Paternité - Pas de Modification 3.0 Luxembourg","fr",
+"licenses","3.0","by-nd","nl","https://creativecommons.org/licenses/by-nd/3.0/nl/","CC BY-ND 3.0 NL","","Naamsvermelding-GeenAfgeleideWerken 3.0","nl",
+"licenses","3.0","by-nd","no","https://creativecommons.org/licenses/by-nd/3.0/no/","CC BY-ND 3.0 NO","","Navngivelse-IngenBearbeidelse 3.0 Norge","no",
+"licenses","3.0","by-nd","nz","https://creativecommons.org/licenses/by-nd/3.0/nz/","CC BY-ND 3.0 NZ","","Attribution-NoDerivs 3.0 New Zealand","en",
+"licenses","3.0","by-nd","ph","https://creativecommons.org/licenses/by-nd/3.0/ph/","CC BY-ND 3.0 PH","","Attribution-NoDerivs 3.0 Philippines","en",
+"licenses","3.0","by-nd","pl","https://creativecommons.org/licenses/by-nd/3.0/pl/","CC BY-ND 3.0 PL","","Uznanie autorstwa - Bez utworów zależnych 3.0 Polska","pl",
+"licenses","3.0","by-nd","pr","https://creativecommons.org/licenses/by-nd/3.0/pr/","CC BY-ND 3.0 PR","","Reconocimiento - Sin Obras Derivadas 3.0 Puerto Rico","es",
+"licenses","3.0","by-nd","pt","https://creativecommons.org/licenses/by-nd/3.0/pt/","CC BY-ND 3.0 PT","","Atribuição – SemDerivados 3.0 Portugal","pt",
+"licenses","3.0","by-nd","ro","https://creativecommons.org/licenses/by-nd/3.0/ro/","CC BY-ND 3.0 RO","","Atribuire–Fără Modificări 3.0 România","ro",
+"licenses","3.0","by-nd","rs","https://creativecommons.org/licenses/by-nd/3.0/rs/","CC BY-ND 3.0 RS","","Autorstvo-Bez prerada 3.0 Srbija","sr-latn",
+"licenses","3.0","by-nd","sg","https://creativecommons.org/licenses/by-nd/3.0/sg/","CC BY-ND 3.0 SG","","Attribution-NoDerivs 3.0 Singapore","en",
+"licenses","3.0","by-nd","th","https://creativecommons.org/licenses/by-nd/3.0/th/","CC BY-ND 3.0 TH","","Attribution-NoDerivs 3.0 Thailand","en",
+"licenses","3.0","by-nd","tw","https://creativecommons.org/licenses/by-nd/3.0/tw/","CC BY-ND 3.0 TW","","姓名標示─禁止改作 3.0 台灣","zh-hant",
+"licenses","3.0","by-nd","ug","https://creativecommons.org/licenses/by-nd/3.0/ug/","CC BY-ND 3.0 UG","","Attribution-NoDerivs 3.0 Uganda","en",
+"licenses","3.0","by-nd","us","https://creativecommons.org/licenses/by-nd/3.0/us/","CC BY-ND 3.0 US","","Attribution-NoDerivs 3.0 United States","en",
+"licenses","3.0","by-nd","ve","https://creativecommons.org/licenses/by-nd/3.0/ve/","CC BY-ND 3.0 VE","","Atribución-SinDerivadas 3.0 Venezuela","es",
+"licenses","3.0","by-nd","vn","https://creativecommons.org/licenses/by-nd/3.0/vn/","CC BY-ND 3.0 VN","","Attribution-NoDerivs 3.0 Vietnam","en",
+"licenses","3.0","by-nd","za","https://creativecommons.org/licenses/by-nd/3.0/za/","CC BY-ND 3.0 ZA","","Attribution-NoDerivs 3.0 South Africa","en",
+"licenses","3.0","by-sa","","https://creativecommons.org/licenses/by-sa/3.0/","CC BY-SA 3.0","CC-BY-SA-3.0","Attribution-ShareAlike 3.0 Unported","en",
+"licenses","3.0","by-sa","am","https://creativecommons.org/licenses/by-sa/3.0/am/","CC BY-SA 3.0 AM","","Attribution-ShareAlike 3.0 Armenia","en",
+"licenses","3.0","by-sa","at","https://creativecommons.org/licenses/by-sa/3.0/at/","CC BY-SA 3.0 AT","CC-BY-SA-3.0-AT","Namensnennung - Weitergabe unter gleichen Bedingungen 3.0 Österreich","de",
+"licenses","3.0","by-sa","au","https://creativecommons.org/licenses/by-sa/3.0/au/","CC BY-SA 3.0 AU","","Attribution-ShareAlike 3.0 Australia","en",
+"licenses","3.0","by-sa","az","https://creativecommons.org/licenses/by-sa/3.0/az/","CC BY-SA 3.0 AZ","","Müəllifliyin müəyyən edilməsi, bərabər istifadə hüquqlu 3.0","az",
+"licenses","3.0","by-sa","br","https://creativecommons.org/licenses/by-sa/3.0/br/","CC BY-SA 3.0 BR","","Atribuição-Compartilhamento pela mesma licença 3.0 Brasil","pt-br",
+"licenses","3.0","by-sa","ca","https://creativecommons.org/licenses/by-sa/3.0/ca/","CC BY-SA 3.0 CA","","Attribution-ShareAlike 3.0 Canada","en",
+"licenses","3.0","by-sa","ch","https://creativecommons.org/licenses/by-sa/3.0/ch/","CC BY-SA 3.0 CH","","Namensnennung – Weitergabe unter gleichen Bedingungen (by-sa) 3.0 Schweiz","de",
+"licenses","3.0","by-sa","cl","https://creativecommons.org/licenses/by-sa/3.0/cl/","CC BY-SA 3.0 CL","","Atribución - CompartirIgual 3.0 Chile","es",
+"licenses","3.0","by-sa","cn","https://creativecommons.org/licenses/by-sa/3.0/cn/","CC BY-SA 3.0 CN","","署名-相同方式共享 3.0中国大陆","zh-hans",
+"licenses","3.0","by-sa","cr","https://creativecommons.org/licenses/by-sa/3.0/cr/","CC BY-SA 3.0 CR","","Atribución – CompartirIgual 3.0 Costa Rica","es",
+"licenses","3.0","by-sa","cz","https://creativecommons.org/licenses/by-sa/3.0/cz/","CC BY-SA 3.0 CZ","","Uveďte autora- Zachovejte licenci 3.0 Česko","cs",
+"licenses","3.0","by-sa","de","https://creativecommons.org/licenses/by-sa/3.0/de/","CC BY-SA 3.0 DE","CC-BY-SA-3.0-DE","Namensnennung - Weitergabe unter gleichen Bedingungen 3.0 Deutschland","de",
+"licenses","3.0","by-sa","ec","https://creativecommons.org/licenses/by-sa/3.0/ec/","CC BY-SA 3.0 EC","","Reconocimiento – Compartir Igual 3.0 Ecuador","es",
+"licenses","3.0","by-sa","ee","https://creativecommons.org/licenses/by-sa/3.0/ee/","CC BY-SA 3.0 EE","","Autorile viitamine-Jagamine samadel tingimustel 3.0 Eesti","et",
+"licenses","3.0","by-sa","eg","https://creativecommons.org/licenses/by-sa/3.0/eg/","CC BY-SA 3.0 EG","","نسب المصنف – الترخيص بالمثل 3.0 مصر","ar",
+"licenses","3.0","by-sa","es","https://creativecommons.org/licenses/by-sa/3.0/es/","CC BY-SA 3.0 ES","","Reconocimiento-CompartirIgual 3.0 España","es",
+"licenses","3.0","by-sa","fr","https://creativecommons.org/licenses/by-sa/3.0/fr/","CC BY-SA 3.0 FR","","Creative Commons Attribution Partage à l'Identique 3.0 France","fr",
+"licenses","3.0","by-sa","ge","https://creativecommons.org/licenses/by-sa/3.0/ge/","CC BY-SA 3.0 GE","","Attribution-ShareAlike 3.0 Georgia","en",
+"licenses","3.0","by-sa","gr","https://creativecommons.org/licenses/by-sa/3.0/gr/","CC BY-SA 3.0 GR","","Αναφορά-Παρόμοια Διανομή 3.0 Ελλάδα","el",
+"licenses","3.0","by-sa","gt","https://creativecommons.org/licenses/by-sa/3.0/gt/","CC BY-SA 3.0 GT","","Reconocimiento – Compartir Igual 3.0 Guatemala","es",
+"licenses","3.0","by-sa","hk","https://creativecommons.org/licenses/by-sa/3.0/hk/","CC BY-SA 3.0 HK","","Attribution-ShareAlike 3.0 Hong Kong","en",
+"licenses","3.0","by-sa","hr","https://creativecommons.org/licenses/by-sa/3.0/hr/","CC BY-SA 3.0 HR","","Imenovanje-Dijeli pod istim uvjetima 3.0 Hrvatska","hr",
+"licenses","3.0","by-sa","ie","https://creativecommons.org/licenses/by-sa/3.0/ie/","CC BY-SA 3.0 IE","","Attribution-ShareAlike 3.0 Ireland","en",
+"licenses","3.0","by-sa","igo","https://creativecommons.org/licenses/by-sa/3.0/igo/","CC BY-SA 3.0 IGO","CC-BY-SA-3.0-IGO","Attribution-ShareAlike 3.0 IGO","en",
+"licenses","3.0","by-sa","it","https://creativecommons.org/licenses/by-sa/3.0/it/","CC BY-SA 3.0 IT","","Attribuzione - Condividi allo stesso modo 3.0 Italia","it",
+"licenses","3.0","by-sa","lu","https://creativecommons.org/licenses/by-sa/3.0/lu/","CC BY-SA 3.0 LU","","Paternité - Partage à l'identique 3.0 Luxembourg","fr",
+"licenses","3.0","by-sa","nl","https://creativecommons.org/licenses/by-sa/3.0/nl/","CC BY-SA 3.0 NL","","Naamsvermelding-GelijkDelen 3.0","nl",
+"licenses","3.0","by-sa","no","https://creativecommons.org/licenses/by-sa/3.0/no/","CC BY-SA 3.0 NO","","Navngivelse-DelPåSammeVilkår 3.0 Norge","no",
+"licenses","3.0","by-sa","nz","https://creativecommons.org/licenses/by-sa/3.0/nz/","CC BY-SA 3.0 NZ","","Attribution-ShareAlike 3.0 New Zealand","en",
+"licenses","3.0","by-sa","ph","https://creativecommons.org/licenses/by-sa/3.0/ph/","CC BY-SA 3.0 PH","","Attribution-ShareAlike 3.0 Philippines","en",
+"licenses","3.0","by-sa","pl","https://creativecommons.org/licenses/by-sa/3.0/pl/","CC BY-SA 3.0 PL","","Uznanie autorstwa - Na tych samych warunkach 3.0 Polska","pl",
+"licenses","3.0","by-sa","pr","https://creativecommons.org/licenses/by-sa/3.0/pr/","CC BY-SA 3.0 PR","","Reconocimiento - Compartir Igual 3.0 Puerto Rico","es",
+"licenses","3.0","by-sa","pt","https://creativecommons.org/licenses/by-sa/3.0/pt/","CC BY-SA 3.0 PT","","Atribuição – CompartilhaIgual 3.0 Portugal","pt",
+"licenses","3.0","by-sa","ro","https://creativecommons.org/licenses/by-sa/3.0/ro/","CC BY-SA 3.0 RO","","Atribuire–Distribuire în Condiţii Identice 3.0 România","ro",
+"licenses","3.0","by-sa","rs","https://creativecommons.org/licenses/by-sa/3.0/rs/","CC BY-SA 3.0 RS","","Autorstvo-Deliti pod istim uslovima 3.0 Srbija","sr-latn",
+"licenses","3.0","by-sa","sg","https://creativecommons.org/licenses/by-sa/3.0/sg/","CC BY-SA 3.0 SG","","Attribution-ShareAlike 3.0 Singapore","en",
+"licenses","3.0","by-sa","th","https://creativecommons.org/licenses/by-sa/3.0/th/","CC BY-SA 3.0 TH","","Attribution-ShareAlike 3.0 Thailand","en",
+"licenses","3.0","by-sa","tw","https://creativecommons.org/licenses/by-sa/3.0/tw/","CC BY-SA 3.0 TW","","姓名標示─相同方式分享 3.0 台灣","zh-hant",
+"licenses","3.0","by-sa","ug","https://creativecommons.org/licenses/by-sa/3.0/ug/","CC BY-SA 3.0 UG","","Attribution-ShareAlike 3.0 Uganda","en",
+"licenses","3.0","by-sa","us","https://creativecommons.org/licenses/by-sa/3.0/us/","CC BY-SA 3.0 US","","Attribution-ShareAlike 3.0 United States","en",
+"licenses","3.0","by-sa","ve","https://creativecommons.org/licenses/by-sa/3.0/ve/","CC BY-SA 3.0 VE","","Atribución-CompartirIgual 3.0 Venezuela","es",
+"licenses","3.0","by-sa","vn","https://creativecommons.org/licenses/by-sa/3.0/vn/","CC BY-SA 3.0 VN","","Attribution-ShareAlike 3.0 Vietnam","en",
+"licenses","3.0","by-sa","za","https://creativecommons.org/licenses/by-sa/3.0/za/","CC BY-SA 3.0 ZA","","Attribution-ShareAlike 3.0 South Africa","en",
+"licenses","4.0","by","","https://creativecommons.org/licenses/by/4.0/","CC 4.0","CC-BY-4.0","Attribution 4.0 International","en","CC_GROUP"
+"licenses","4.0","by-nc","","https://creativecommons.org/licenses/by-nc/4.0/","CC BY-NC 4.0","CC-BY-NC-4.0","Attribution-NonCommercial 4.0 International","en",
+"licenses","4.0","by-nc-nd","","https://creativecommons.org/licenses/by-nc-nd/4.0/","CC BY-NC-ND 4.0","CC-BY-NC-ND-4.0","Attribution-NonCommercial-NoDerivatives 4.0 International","en",
+"licenses","4.0","by-nc-sa","","https://creativecommons.org/licenses/by-nc-sa/4.0/","CC BY-NC-SA 4.0","CC-BY-NC-SA-4.0","Attribution-NonCommercial-ShareAlike 4.0 International","en",
+"licenses","4.0","by-nd","","https://creativecommons.org/licenses/by-nd/4.0/","CC BY-ND 4.0","CC-BY-ND-4.0","Attribution-NoDerivatives 4.0 International","en",
+"licenses","4.0","by-sa","","https://creativecommons.org/licenses/by-sa/4.0/","CC BY-SA 4.0","CC-BY-SA-4.0","Attribution-ShareAlike 4.0 International","en",
+"publicdomain","1.0","zero","","https://creativecommons.org/publicdomain/zero/1.0/","CC0 1.0","CC0-1.0","CC0 1.0 Universal","en","DIRECT"
+"publicdomain","1.0","mark","","https://creativecommons.org/publicdomain/mark/1.0/","PDM 1.0","CC-PDM-1.0","Public Domain Mark 1.0 Universal","en","DIRECT"
+"publicdomain","1.0","certification","us","https://creativecommons.org/publicdomain/certification/1.0/us/","CERTIFICATION 1.0 US","CC-PDDC","CERTIFICATION 1.0","en","DIRECT"
+"licenses","1.0","sampling","","https://creativecommons.org/licenses/sampling/1.0/","CC SAMPLING 1.0","","Sampling 1.0 Generic","en","RECOMBO_GROUP"
+"licenses","1.0","sampling+","","https://creativecommons.org/licenses/sampling+/1.0/","CC SAMPLING+ 1.0","","Sampling Plus 1.0 Generic","en",
+"licenses","1.0","nc-sampling+","","https://creativecommons.org/licenses/nc-sampling+/1.0/","CC NC-SAMPLING+ 1.0","","NonCommercial Sampling Plus 1.0 Generic","en",
diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg
index 6e1f58376535..9e910a2366f1 100644
--- a/dspace/config/dspace.cfg
+++ b/dspace/config/dspace.cfg
@@ -1042,9 +1042,9 @@ item.view.total.downloads.enabled = true
#submit.type-bind.field = dc.type
#### Creative Commons settings ######
-
-# The url to the web service API
-cc.api.rooturl = https://api.creativecommons.org/rest/1.5
+# CSV file containing the Creative Commons licenses (based on the CC legal tools)
+# that are available in the cclicense step of the submission process
+dspace.cc-license.csv = ${dspace.dir}/config/cc-license/cc-legal-tools.csv
# Metadata field to hold CC license URI of selected license
cc.license.uri = dc.rights.uri
@@ -1055,32 +1055,28 @@ cc.license.name = dc.rights
# Assign license name during web submission
cc.submit.setname = true
-# Store license bitstream (RDF license text) during web submission
-cc.submit.addbitstream = true
-
-# A list of license classes that should be excluded from selection process
-# class names - comma-separated list - must exactly match what service returns.
-# At time of implementation, these are:
-# publicdomain - "Public Domain" (this is now the same as CC0)
-# standard - "Creative Commons"
-# recombo - "Sampling"
-# zero - "CC0"
-# mark - "Public Domain Mark"
-cc.license.classfilter = publicdomain, recombo, mark
-
-# Jurisdiction of the creative commons license -- is it ported or not?
-# Use the key from the url seen in the response from the api call,
-# https://api.creativecommons.org/rest/1.5/support/jurisdictions
+# A list of licenses that should be excluded from the selection process
+# comma-separated list - values are case sensitive.
+# Creative Commons licenses can be excluded by "CC" + the VERSION column of the CSV:
+# standard - All "Creative Commons" licenses
+# CC3.0 - "Creative Commons License (3.0)"
+# CC4.0 - "Creative Commons License (4.0)"
+# The retired Creative Commons Sampling licenses can be excluded with:
+# recombo - "Creative Commons Sampling License (1.0)"
+# Public domain tools can be excluded by the UNIT column of the CSV:
+# zero - "CC0 1.0 Universal"
+# mark - "Public Domain Mark 1.0 Universal"
+# certification - "CERTIFICATION 1.0"
+# VSB-TUO offers only the international CC 4.0 licence and CC0 (see #1059), so CC 3.0 is hidden too
+cc.license.classfilter = CC3.0, recombo, mark, certification
+
+# Jurisdiction of the creative commons 3.0 license -- is it ported or not?
+# Use a value from the JURISDICTION column of the CSV for 3.0 licenses.
# Commented out means the license is unported.
-# (e.g. nz = New Zealand, uk = England and Wales, jp = Japan)
+# (e.g. nz = New Zealand, ie = Ireland, de = Germany)
# or set value none for user-selected jurisdiction
# cc.license.jurisdiction = cz
-# Locale for CC dialogs
-# A locale in the form language or language-country.
-# If no default locale is defined the current supported locale will be used
-cc.license.locale = cs
-
##### Settings for Thumbnail creation #####
diff --git a/dspace/config/spring/api/core-services.xml b/dspace/config/spring/api/core-services.xml
index 3e831cc6eafc..5f703338bebc 100644
--- a/dspace/config/spring/api/core-services.xml
+++ b/dspace/config/spring/api/core-services.xml
@@ -133,6 +133,7 @@
+