Class BitstreamResourcePolicyUtils
java.lang.Object
org.dspace.app.rest.submit.factory.impl.BitstreamResourcePolicyUtils
Utility class to reuse methods related to bitstream resource-policies
These methods are applicable in the submission when adding or editing bitstreams, and the resource policies
have to be applied
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidfindApplyResourcePolicy(Context context, UploadConfiguration uploadConfiguration, DSpaceObject obj, String name, String description, LocalDate startDate, LocalDate endDate) Based on the given name, find the resource policy to apply on the given DSpace object This function applies the resource policies.The description, start date and end date are applied as wellstatic voidfindApplyResourcePolicy(Context context, UploadConfiguration uploadConfiguration, DSpaceObject obj, List<AccessConditionDTO> newAccessConditions) Based on the given access condition, find the resource policy to apply on the given DSpace object This function applies the resource policies.
-
Method Details
-
findApplyResourcePolicy
public static void findApplyResourcePolicy(Context context, UploadConfiguration uploadConfiguration, DSpaceObject obj, List<AccessConditionDTO> newAccessConditions) throws SQLException, AuthorizeException, ParseException Based on the given access condition, find the resource policy to apply on the given DSpace object This function applies the resource policies.- Parameters:
context- The relevant DSpace Context.uploadConfiguration- The configured UploadConfigurationobj- The applicable DSpace object whose policies should be determinednewAccessConditions- The access condition containing the details for the desired policies- Throws:
SQLException- If a database error occursAuthorizeException- If the user is not authorizedParseException- If parse error
-
findApplyResourcePolicy
public static void findApplyResourcePolicy(Context context, UploadConfiguration uploadConfiguration, DSpaceObject obj, String name, String description, LocalDate startDate, LocalDate endDate) throws SQLException, AuthorizeException, ParseException Based on the given name, find the resource policy to apply on the given DSpace object This function applies the resource policies.The description, start date and end date are applied as well- Parameters:
context- The relevant DSpace Context.uploadConfiguration- The configured UploadConfigurationobj- The applicable DSpace object whose policies should be determinedname- The name of the access condition matching the desired policiesdescription- An optional description for the policiesstartDate- An optional start date for the policiesendDate- An optional end date for the policies- Throws:
SQLException- If a database error occursAuthorizeException- If the user is not authorizedParseException- If parse error
-