Class 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 Detail

      • AccessConditionOption

        public AccessConditionOption()
    • Method Detail

      • 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,
                                         Date startDate,
                                         Date 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).
      • validateResourcePolicy

        public void validateResourcePolicy​(Context context,
                                           String name,
                                           Date startDate,
                                           Date 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.