Class DirectorySearchProvider

All Implemented Interfaces:
IPageFlowScopeAdapter, IAddressableTableContentProvider, IContentProvider, IRefreshable, IRefreshableContentProvider, IReorderableTableContentProvider, ISelectableTableContentProvider, ISortableTableContentProvider, ITableContentProvider, IUpdateableContentProvider, IUpdateableTableContentProvider, Serializable

public class DirectorySearchProvider extends SelectableListTableContentProvider
Directory Search Provider for searching on users/groups/roles principles. The provider extends a list Table content provider.
Since:
7.0
See Also:
  • Field Details

    • fMaxResults

      protected Integer fMaxResults
    • fSearchType

      protected Integer fSearchType
    • fDirService

      protected String fDirService
    • fQueryString

      protected String fQueryString
    • fExcludePrincipalsList

      protected List<IPrincipalProvider> fExcludePrincipalsList
  • Constructor Details

  • Method Details

    • getDirService

      public String getDirService()
      Get the directory service for the search query.
      Returns:
      The dirService.
    • setDirService

      public void setDirService(String dirService)
      Set the directory service in the search query.
      Parameters:
      dirService - The dirService to set.
    • getMaxResults

      public Integer getMaxResults()
      Set the directory service in the search query.
      Parameters:
      dirService - The dirService to set.
    • setMaxResults

      public void setMaxResults(Integer maxResults)
      Deprecated.
      Use field on fSearchQuery instead.
      Set the maximum number of results allowed in the search results.
      Parameters:
      maxResults - The maxResults to set.
    • getQueryString

      public String getQueryString()
      Deprecated.
      Use field on fSearchQuery instead
      Gets the raw value of the query string.
      Returns:
      the queryString
    • setQueryString

      public void setQueryString(String queryString)
      Deprecated.
      use field on fSearchQuery instead
      Set the raw value of the query string.
      Parameters:
      queryString - the queryString to set
    • getSearchType

      public Integer getSearchType()
      Get the search type to search for.
      Returns:
      The searchType is -1 (null), IDirConstants.TYPE_USER, IDirConstants.TYPE_ROLE, or IDirConstants.TYPE_GROUP.
    • setSearchType

      public void setSearchType(Integer searchType)
      Parameters:
      searchType - The search type to set.
    • setExcludePrincipalsList

      public void setExcludePrincipalsList(List<IPrincipalProvider> excludePrincipalsList)
      Set the list of principal to exclude.
      Parameters:
      excludePrincipalsList - the excludePrincipalsList to set
    • sort

      protected void sort()
      Sort is handled by the refresh method.
      Overrides:
      sort in class SelectableListTableContentProvider
      See Also:
    • setSort

      public void setSort(ISortInfo sort)
      Set the sort information for this provider. If it has changed then refresh the table.
      Specified by:
      setSort in interface ISortableTableContentProvider
      Overrides:
      setSort in class ListTableContentProvider
      Parameters:
      sort - The table sort information.
      See Also:
    • isPrincipleExcluded

      protected boolean isPrincipleExcluded(IURI principalURI) throws PortalException
      Is the principal URI in the list of excluded principals.
      Parameters:
      principalURI - The principal URI to check.
      Returns:
      True if in the list excluded principal list.
      Throws:
      PortalException
    • isPrincipleExcluded

      protected boolean isPrincipleExcluded(IDirPrincipal principal) throws PortalException
      Is the directory principal in the list of excluded principals.
      Parameters:
      principal - The directory principal to check.
      Returns:
      True if in the list excluded principal list.
      Throws:
      PortalException
    • refresh

      public void refresh()
      Refresh the list of search results.
      Specified by:
      refresh in interface IRefreshable
      Overrides:
      refresh in class SelectableListTableContentProvider
      See Also:
    • getSortValue

      public static String getSortValue(Object obj, String propertyExpression)
      Get the value of the property used to sort the principal.
      Parameters:
      obj - The target to evaluate.
      propertyExpression - The value expression (ie '{name}').
    • getAsString

      protected String getAsString(Object o, String defaultValue)
      Get a String for the object or use the default value. If the object is not null then get the to string value.
      Parameters:
      o -
      defaultValue - The value to return if o is null.
      Returns:
      The parsed or default value.
    • getAsInt

      protected int getAsInt(Object o, int defaultValue)
      Get an integer for the object or use the default value. If the object is a Sting or Integer try to convert the object to an int.
      Parameters:
      o -
      defaultValue - The value to return if o is not a String or Integer.
      Returns:
      The parsed or default value.
    • getDirectoryServices

      protected IThingIDList getDirectoryServices() throws PortalException
      Get the directory services from the portal system.
      Returns:
      The directory services.
      Throws:
      PortalException