Class ListInput

    • Field Detail

      • request

        protected final javax.servlet.http.HttpServletRequest request
      • bagManager

        protected final BagManager bagManager
      • profile

        protected final Profile profile
      • SUBTRACT_PARAM

        public static final java.lang.String SUBTRACT_PARAM
        Things to subtract
        See Also:
        Constant Field Values
      • NAME_PARAMETER

        public static final java.lang.String NAME_PARAMETER
        The name of the new list
        See Also:
        Constant Field Values
      • ALT_NAME_PARAM

        public static final java.lang.String ALT_NAME_PARAM
        The name of the new list (synonym)
        See Also:
        Constant Field Values
      • LISTS_PARAMETER

        public static final java.lang.String LISTS_PARAMETER
        The lists to operate on
        See Also:
        Constant Field Values
      • REFERENCE_PARAMETER

        public static final java.lang.String REFERENCE_PARAMETER
        The lists to subtract from
        See Also:
        Constant Field Values
      • TAGS_PARAMETER

        public static final java.lang.String TAGS_PARAMETER
        Tags to apply
        See Also:
        Constant Field Values
      • TYPE_PARAMETER

        public static final java.lang.String TYPE_PARAMETER
        The type of the list
        See Also:
        Constant Field Values
      • DESCRIPTION_PARAMETER

        public static final java.lang.String DESCRIPTION_PARAMETER
        The description
        See Also:
        Constant Field Values
      • REPLACE_PARAMETER

        public static final java.lang.String REPLACE_PARAMETER
        Whether to overwrite existing lists of the same name
        See Also:
        Constant Field Values
      • TEMP_SUFFIX

        public static final java.lang.String TEMP_SUFFIX
        A suffix to attach to temporary lists
        See Also:
        Constant Field Values
      • EXTRA_PARAMETER

        public static final java.lang.String EXTRA_PARAMETER
        extra value parameter
        See Also:
        Constant Field Values
      • LIST_SEPARATOR

        public static final java.lang.String LIST_SEPARATOR
        The separator used between lists when passed joined together.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ListInput

        public ListInput​(javax.servlet.http.HttpServletRequest request,
                         BagManager bagManager,
                         Profile profile)
        Parse the values from the request, and validate them.
        Parameters:
        request - The request.
        bagManager - A service for fetching bags.
        profile - The profile of the current user.
    • Method Detail

      • produceName

        protected java.lang.String produceName()
        Returns:
        a name for the new list
      • getListName

        public java.lang.String getListName()
        Returns:
        the list name
      • getExtraValue

        public java.lang.String getExtraValue()
        Returns:
        the extra value
      • getTemporaryListName

        public java.lang.String getTemporaryListName()
        Returns:
        the temporary list name
      • getDescription

        public java.lang.String getDescription()
        Returns:
        the description
      • getType

        public java.lang.String getType()
        Returns:
        the type of the list.
      • getLists

        public java.util.Set<InterMineBag> getLists()
        Returns:
        the lists to operate on
      • getReferenceLists

        public java.util.Set<InterMineBag> getReferenceLists()
        Returns:
        the reference set of lists
      • getSubtractLists

        public java.util.Set<InterMineBag> getSubtractLists()
        Returns:
        the lists to subtract
      • getTags

        public java.util.Set<java.lang.String> getTags()
        Returns:
        the tags to apply
      • doReplace

        public boolean doReplace()
        Returns:
        whether or not we should overwrite existing lists.
      • init

        protected void init()
        Initialise this structure
      • populateList

        protected void populateList​(java.util.List<java.lang.String> list,
                                    java.lang.String param)
        read the parameters into a list.
        Parameters:
        list - The list to fill with values.
        param - The parameter to read from.
      • populateNormedList

        protected void populateNormedList​(java.util.List<java.lang.String> list,
                                          java.lang.String param)
        Read parameters into a list, normalising the values.
        Parameters:
        list - The list to fill.
        param - The parameter to read from.
      • populateListMap

        protected void populateListMap​(java.util.Map<java.lang.String,​InterMineBag> map,
                                       java.lang.String param)
        Fill a map with intermine bags from the names in a parameter.
        Parameters:
        map - The map to fill.
        param - The parameter to read names from.
      • validateRequiredParams

        protected void validateRequiredParams()
        Check that the required parameters are there
      • checkLists

        protected void checkLists​(java.util.Map<java.lang.String,​InterMineBag> map,
                                  java.util.List<java.lang.String> errors)
        Make sure that any lists names exist.
        Parameters:
        map - The lists we have available to us.
        errors - A collector for accumulating errors.