From fe624f7f675410a7dd6d7356b6ebae3f180bacf5 Mon Sep 17 00:00:00 2001 From: Luigi Andrea Pascarelli Date: Mon, 26 Sep 2016 19:07:47 +0200 Subject: [PATCH] DS-2604 add some comment --- ...mmonsTextStreamDisseminationCrosswalk.java | 2 ++ .../license/CreativeCommonsServiceImpl.java | 7 ++++- .../service/CreativeCommonsService.java | 29 ++++++++++++++++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/CreativeCommonsTextStreamDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/CreativeCommonsTextStreamDisseminationCrosswalk.java index f9dd100c4a..7304366f50 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/CreativeCommonsTextStreamDisseminationCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/CreativeCommonsTextStreamDisseminationCrosswalk.java @@ -30,6 +30,8 @@ import org.dspace.license.service.CreativeCommonsService; * * @author Larry Stone * @version $Revision: 1.0 $ + * + * @deprecated to make uniform JSPUI and XMLUI approach the bitstream with the license in the textual format it is no longer stored (see https://jira.duraspace.org/browse/DS-2604) */ public class CreativeCommonsTextStreamDisseminationCrosswalk implements StreamDisseminationCrosswalk 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 7f0c13a889..88c1dac2c7 100644 --- a/dspace-api/src/main/java/org/dspace/license/CreativeCommonsServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/license/CreativeCommonsServiceImpl.java @@ -57,10 +57,15 @@ public class CreativeCommonsServiceImpl implements CreativeCommonsService, Initi /** * Some BitStream Names (BSN) + * + * @deprecated use the metadata retrieved at {@link CreativeCommonsService#getCCField(String)} (see https://jira.duraspace.org/browse/DS-2604) */ @Deprecated protected static final String BSN_LICENSE_URL = "license_url"; + /** + * @deprecated to make uniform JSPUI and XMLUI approach the bitstream with the license in the textual format it is no longer stored (see https://jira.duraspace.org/browse/DS-2604) + */ @Deprecated protected static final String BSN_LICENSE_TEXT = "license_text"; @@ -244,7 +249,7 @@ public class CreativeCommonsServiceImpl implements CreativeCommonsService, Initi return licenseUri; } - //backward compatibility + // JSPUI backward compatibility see https://jira.duraspace.org/browse/DS-2604 return getStringFromBitstream(context, item, BSN_LICENSE_URL); } 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 3eb361f235..e0c188f6a0 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 @@ -79,8 +79,9 @@ public interface CreativeCommonsService { /** * Get Creative Commons license Text, returning Bitstream object. - * @Deprecated + * * @return bitstream or null. + * @deprecated to make uniform JSPUI and XMLUI approach the bitstream with the license in the textual format it is no longer stored (see https://jira.duraspace.org/browse/DS-2604) */ public Bitstream getLicenseTextBitstream(Item item) throws SQLException, IOException, AuthorizeException; @@ -92,7 +93,33 @@ public interface CreativeCommonsService { public LicenseMetadataValue 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 + * + * @param context + * - DSpace Context + * @param uriField + * - the metadata field for license uri + * @param nameField + * - the metadata field for license name + * @param item + * - the item + * @throws AuthorizeException + * @throws IOException + * @throws SQLException + */ public void removeLicense(Context context, LicenseMetadataValue uriField, LicenseMetadataValue nameField, Item item) throws AuthorizeException, IOException, SQLException; } \ No newline at end of file