Class AccessConditionOption

java.lang.Object
org.dspace.submit.model.AccessConditionOption

public class AccessConditionOption extends Object
This class represents an option available in the submission upload section to set permission on a file. An option is defined by a name such as "open access", "embargo", "restricted access", etc. and some optional attributes to better clarify the constraints and input available to the user. For instance an embargo option could allow to set a start date not longer than 3 years.
Author:
Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it)
  • Constructor Details

    • AccessConditionOption

      public AccessConditionOption()
  • Method Details

    • getName

      public String getName()
    • setName

      public void setName(String type)
    • getGroupName

      public String getGroupName()
    • setGroupName

      public void setGroupName(String groupName)
    • getHasStartDate

      public Boolean getHasStartDate()
    • setHasStartDate

      public void setHasStartDate(Boolean hasStartDate)
    • getHasEndDate

      public Boolean getHasEndDate()
    • setHasEndDate

      public void setHasEndDate(Boolean hasEndDate)
    • getStartDateLimit

      public String getStartDateLimit()
      Explanation see: startDateLimit
      Returns:
      startDateLimit
    • setStartDateLimit

      public void setStartDateLimit(String startDateLimit)
    • getEndDateLimit

      public String getEndDateLimit()
      Explanation see: endDateLimit
      Returns:
      endDateLimit
    • setEndDateLimit

      public void setEndDateLimit(String endDateLimit)
    • createResourcePolicy

      public void createResourcePolicy(Context context, DSpaceObject obj, String name, String description, LocalDate startDate, LocalDate endDate) throws SQLException, AuthorizeException, ParseException
      Create a new resource policy for a DSpaceObject
      Parameters:
      context - DSpace context
      obj - DSpaceObject for which resource policy is created
      name - name of the resource policy
      description - description of the resource policy
      startDate - start date of the resource policy. If getHasStartDate() returns false, startDate should be null. Otherwise startDate may not be null.
      endDate - end date of the resource policy. If getHasEndDate() returns false, endDate should be null. Otherwise endDate may not be null.
      Throws:
      SQLException - passed through.
      AuthorizeException - passed through.
      ParseException - passed through (indicates problem with a date).
    • updateResourcePolicy

      public void updateResourcePolicy(Context context, ResourcePolicy resourcePolicy) throws SQLException, AuthorizeException, ParseException
      Validate ResourcePolicy and after update it
      Parameters:
      context - DSpace context
      resourcePolicy - ResourcePolicy to update
      Throws:
      SQLException - If database error
      AuthorizeException - If authorize error
      ParseException - If parser error
    • validateResourcePolicy

      public void validateResourcePolicy(Context context, String name, LocalDate startDate, LocalDate endDate) throws IllegalStateException, ParseException
      Validate the policy properties, throws exceptions if any is not valid.
      Parameters:
      context - DSpace context.
      name - Name of the resource policy.
      startDate - Start date of the resource policy. If getHasStartDate() returns false, startDate should be null. Otherwise startDate may not be null.
      endDate - End date of the resource policy. If getHasEndDate() returns false, endDate should be null. Otherwise endDate may not be null.
      Throws:
      IllegalStateException - if a date is required and absent, a date is not required and present, or a date exceeds its configured maximum.
      ParseException - passed through.