Class PortalGroupContentSearchParameters


  • public final class PortalGroupContentSearchParameters
    extends java.lang.Object
    Contains search parameters suitable for finding portal items that belong to a portal group.

    You can create an instance using one of the factory methods that are designed for particular types of searches, or you can use one of the constructors and specify a custom query string. A number of properties are also available to customize various aspects of the search.

    A typical usage pattern is:

    1. Create a new PortalGroupContentSearchParameters object using a factory method or constructor.
    2. Optionally call one or more of the setter methods.
    3. Use the object by passing it to PortalGroup.findItemsAsync(PortalGroupContentSearchParameters).
    4. Optionally call PortalGroupContentSearchResultSet.getNextSearchParameters() to get a new PortalGroupContentSearchParameters object that can be used to 'find' the next batch of results.
    Since:
    100.7.0
    See Also:
    PortalGroup.findItemsAsync(PortalGroupContentSearchParameters)
    • Constructor Detail

      • PortalGroupContentSearchParameters

        public PortalGroupContentSearchParameters​(Envelope boundingBox)
        Constructor that sets a bounding box for a spatial search.
        Parameters:
        boundingBox - an Envelope specifying the bounding box
        Since:
        100.7.0
        See Also:
        getBoundingBox()
      • PortalGroupContentSearchParameters

        public PortalGroupContentSearchParameters​(java.lang.String query)
        Constructor that sets a custom query string to use.
        Parameters:
        query - the query string to use, for example "owner:username AND title:california"
        Since:
        100.7.0
      • PortalGroupContentSearchParameters

        public PortalGroupContentSearchParameters​(java.lang.String query,
                                                  Envelope boundingBox)
        Constructor that sets a custom query string to use and a bounding box for a spatial search.
        Parameters:
        query - the query string to use, for example "owner:username AND title:california"
        boundingBox - an Envelope specifying the bounding box
        Since:
        100.7.0
        See Also:
        getBoundingBox()
      • PortalGroupContentSearchParameters

        public PortalGroupContentSearchParameters​(java.lang.String query,
                                                  int limit)
        Constructor that sets a custom query string to use and a limit on the number of results to return.
        Parameters:
        query - the query string to use, for example "owner:username AND title:california"
        limit - the maximum number of results to be returned, must be in the range 1 - 100
        Throws:
        java.lang.IllegalArgumentException - if limit is not in the range 1 - 100
        Since:
        100.7.0
        See Also:
        getLimit()
    • Method Detail

      • createForItemsWithTypes

        public static PortalGroupContentSearchParameters createForItemsWithTypes​(java.lang.Iterable<PortalItem.Type> types,
                                                                                 java.lang.String owner,
                                                                                 java.lang.String searchString)
        Creates a PortalGroupContentSearchParameters that will find items with any one of a number of given types.

        Optionally restricts the search to items belonging to a specified owner. An optional search string can be used to restrict the search even further.

        Parameters:
        types - the item types to search for
        owner - the username of the owner of the items, or null to search for items with any owner
        searchString - a string specifying other criteria for the search, or null if there are none
        Returns:
        the PortalGroupContentSearchParameters
        Throws:
        java.lang.IllegalArgumentException - if types is null or empty
        Since:
        100.7.0
      • createForItemsWithTypeAndOwnerAndSearchString

        public static PortalGroupContentSearchParameters createForItemsWithTypeAndOwnerAndSearchString​(PortalItem.Type type,
                                                                                                       java.lang.String owner,
                                                                                                       java.lang.String searchString)
        Creates a PortalGroupContentSearchParameters that will find items with a particular type.

        Optionally restricts the search to items belonging to a specified owner. An optional search string can be used to restrict the search even further.

        Parameters:
        type - the item type to search for
        owner - the username of the owner of the items, or null to search for items with any owner
        searchString - a string specifying other criteria for the search, or null if there are none
        Returns:
        the PortalGroupContentSearchParameters
        Throws:
        java.lang.IllegalArgumentException - if type is null
        Since:
        100.7.0
      • createForItemsWithTypeAndSearchString

        public static PortalGroupContentSearchParameters createForItemsWithTypeAndSearchString​(PortalItem.Type type,
                                                                                               java.lang.String searchString)
        Creates a PortalGroupContentSearchParameters that will find items with a specified type and, optionally, that also match a specified search string.
        Parameters:
        type - item type to search for
        searchString - a string specifying other criteria for the search, or null if there are none
        Returns:
        the PortalGroupContentSearchParameters
        Throws:
        java.lang.IllegalArgumentException - if type is null
        Since:
        100.7.0
      • createForItemsWithOwner

        public static PortalGroupContentSearchParameters createForItemsWithOwner​(java.lang.String owner)
        Creates a PortalGroupContentSearchParameters that will find items belonging to a specified owner.
        Parameters:
        owner - the username of the owner of the items
        Returns:
        the PortalGroupContentSearchParameters
        Throws:
        java.lang.IllegalArgumentException - if owner is null or empty
        Since:
        100.7.0
      • createForItemWithId

        public static PortalGroupContentSearchParameters createForItemWithId​(java.lang.String itemId)
        Creates a PortalGroupContentSearchParameters that will find an item with a specified item ID.
        Parameters:
        itemId - the ID of the item
        Returns:
        the PortalGroupContentSearchParameters
        Throws:
        java.lang.IllegalArgumentException - if itemId is null or empty
        Since:
        100.7.0
      • getBoundingBox

        public Envelope getBoundingBox()
        Gets an Envelope specifying the bounding box for a spatial search.

        Spatial search is an overlaps/intersects function of the bounding box and the extent of the document. Documents that have no extent (for example mxds, 3dds, lyr) will not be found when doing a bounding box search. Document extent is assumed to be in the WGS84 geographic coordinate system.

        Returns:
        the bounding box, or null if none has been set
        Since:
        100.7.0
      • setBoundingBox

        public void setBoundingBox​(Envelope boundingBox)
        Sets an Envelope specifying the bounding box for a spatial search.

        Spatial search is an overlaps/intersects function of the bounding box and the extent of the document. Documents that have no extent (for example mxds, 3dds, lyr) will not be found when doing a bounding box search. Document extent is assumed to be in the WGS84 geographic coordinate system.

        Parameters:
        boundingBox - an Envelope specifying the bounding box; null is allowed and clears any bounding box that was previously set
        Since:
        100.7.0
      • getCategories

        public java.util.List<java.lang.String> getCategories()
        Gets a mutable List of content category specifications to use when searching for items.

        Each entry in the List is a String containing a comma-separated list of up to 8 group content categories. The full path of each category is required and an OR relationship is applied between the categories within a particular String.

        There can be up to 8 Strings with an AND relationship being applied between the different Strings.

        For example, to search for items belonging to either the Water or Forest categories, both within the US, specify two Strings as follows: "/Categories/Water,/Categories/Forest" and "/Region/US".

        Returns:
        a mutable List of content category specifications. Initially this List is empty and you can add content category specifications to it.
        Since:
        100.7.0
      • getLimit

        public int getLimit()
        Gets the maximum number of results to be included in the result set response.

        The limit, along with the getStartIndex(), can be used to paginate the search results. The default value is 10, and the maximum allowed value is 100.

        Note that the actual number of returned results may be less than the limit. This happens when the number of results remaining after the start index is less than the limit.

        Returns:
        the results limit to use when these PortalGroupContentSearchParameters are submitted
        Since:
        100.7.0
        See Also:
        PortalGroupContentSearchResultSet
      • setLimit

        public void setLimit​(int limit)
        Sets the maximum number of results to be included in the result set response.

        The limit, along with the getStartIndex(), can be used to paginate the search results. The default value is 10, and the maximum allowed value is 100.

        Note that the actual number of returned results may be less than the limit. This happens when the number of results remaining after the start index is less than the limit.

        Parameters:
        limit - the results limit to use when these PortalGroupContentSearchParameters are submitted
        Throws:
        java.lang.IllegalArgumentException - if limit is not in the range 1 - 100
        Since:
        100.7.0
        See Also:
        PortalGroupContentSearchResultSet
      • getQuery

        public java.lang.String getQuery()
        Gets the query string to use.
        Returns:
        the query string to use
        Since:
        100.7.0
      • isSearchPublic

        public boolean isSearchPublic()
        Indicates whether public items outside the organization may be included in the search results. Default behavior is they are included.
        Returns:
        true if items outside the organization may be included, false otherwise
        Since:
        100.7.0
      • setSearchPublic

        public void setSearchPublic​(boolean searchPublic)
        Sets whether public items outside the organization may be included in the search results. Default behavior is they are included.
        Parameters:
        searchPublic - true to include items outside the organization
        Since:
        100.7.0
      • getSortField

        public java.lang.String getSortField()
        Gets a string containing one or more fields names, comma separated, specifying the field(s) to sort the results by.

        Sort field names are case-insensitive. Supported field names are "title", "created", "type", "owner", "modified", "added", "avgrating", "numratings", "numcomments", and "numviews".

        Returns:
        a string containing one or more fields names, comma separated, or null if none
        Since:
        100.7.0
      • setSortField

        public void setSortField​(java.lang.String sortFieldNames)
        Sets the field(s) to sort the results by.

        Sort field names are case-insensitive. Supported field names are "title", "created", "type", "owner", "modified", "added", "avgrating", "numratings", "numcomments", and "numviews".

        Parameters:
        sortFieldNames - a string containing one or more fields names, comma separated, or null if none
        Since:
        100.7.0
      • getSortOrder

        public PortalGroup.SortOrder getSortOrder()
        Gets the sort order, indicating whether the results are returned in ascending or descending order. Default behavior is ascending order.
        Returns:
        the sort order
        Since:
        100.7.0
      • setSortOrder

        public void setSortOrder​(PortalGroup.SortOrder sortOrder)
        Sets the sort order, indicating whether the results are returned in ascending or descending order. Default behavior is ascending order.
        Parameters:
        sortOrder - the sort order to set
        Throws:
        java.lang.IllegalArgumentException - if sortOrder is null
        Since:
        100.7.0
      • getStartIndex

        public int getStartIndex()
        Gets the index within the entire set of results of the first entry in the current page.

        The start index, along with the getLimit(), can be used to paginate the search results. The index number is 1-based and the default value is 1.

        Returns:
        the start index to use when these PortalGroupContentSearchParameters are submitted
        Since:
        100.7.0
        See Also:
        PortalGroupContentSearchResultSet
      • setStartIndex

        public void setStartIndex​(int startIndex)
        Sets the index within the entire set of results of the first entry in the current page.

        The start index, along with the getLimit(), can be used to paginate the search results. The index number is 1-based and the default value is 1.

        Parameters:
        startIndex - the start index to use when these PortalGroupContentSearchParameters are submitted
        Throws:
        java.lang.IllegalArgumentException - if startIndex is <= 0
        Since:
        100.7.0
        See Also:
        PortalGroupContentSearchResultSet