D4CRIS-338 add implementation to grant license

This commit is contained in:
Luigi Andrea Pascarelli
2017-11-15 00:31:30 +01:00
parent 1e1416143d
commit fc13ad5725
10 changed files with 70 additions and 23 deletions

View File

@@ -10,6 +10,7 @@ package org.dspace.content;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.dspace.content.factory.ContentServiceFactory;
@@ -437,4 +438,16 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
return hash;
}
/**
* Add date for bitstream granted (used into the use case for license grant the {@link LicenseUtils#grantLicense(Context, Item, String, String)}
*
* @param context
* the dspace context
* @param acceptanceDate the granted date
* @throws SQLException
*/
public void setAcceptanceDate(Context context, DCDate acceptanceDate) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "rights", "date", null, acceptanceDate.toString());
}
}