Class AbstractMemberQueryHandler<E>

Type Parameters:
E - The type of Member being manipulated by the implementation of AbstractMemberQueryHandler
All Implemented Interfaces:
JcmsConstants, JaliosConstants
Direct Known Subclasses:
AllMemberQueryHandler, DBMemberQueryHandler, MemberQueryHandler

public abstract class AbstractMemberQueryHandler<E> extends AbstractQueryHandler<E>
Superclass of member query handlers.
Since:
JCMS-6619
  • Field Details

    • GUEST_FILTER_PARAM

      protected static final String GUEST_FILTER_PARAM
      Parameter name to filter on only guests or only not guests.
      Since:
      jcms-10.0.8 JCMS-10433
      See Also:
    • LDAP_FILTER_PARAM

      public static final String LDAP_FILTER_PARAM
      See Also:
    • CLEARANCE_LEVEL_FILTER_PARAM

      public static final String CLEARANCE_LEVEL_FILTER_PARAM
      See Also:
    • groupSet

      protected Set<Group> groupSet
    • groupOffSet

      protected Set<Group> groupOffSet
    • sort

      protected String sort
    • reverse

      protected boolean reverse
    • pageStart

      protected int pageStart
    • pageSize

      protected int pageSize
    • pagerAll

      protected boolean pagerAll
    • isMissingCriteria

      protected boolean isMissingCriteria
  • Constructor Details

    • AbstractMemberQueryHandler

      public AbstractMemberQueryHandler()
  • Method Details

    • parseQueryStringParam

      protected void parseQueryStringParam(String key, String[] values)
      Description copied from class: AbstractQueryHandler
      Method to be implemented by subclass to decode parameter from queryString.
      Specified by:
      parseQueryStringParam in class AbstractQueryHandler<E>
      Parameters:
      key - the parameter name, never null nor empty.
      values - the parameter values, NEVER NULL NOR EMPTY. You can safely invoke paramValues[0]
    • printParams

      protected String printParams(AbstractQueryHandler.QueryHandlerPrinter printer)
      Print current QueryHandler params using specified QueryHandlerPrinter.
      Specified by:
      printParams in class AbstractQueryHandler<E>
      Parameters:
      printer - a QueryHandlerPrinter to use
      Returns:
      a string containing all parameters of this handler printed using specified QueryHandlerPrinter.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getText

      public String getText()
      Retrieves the text being search in this query
      Returns:
      a string or null if no text is being searched
    • setText

      public void setText(String text)
      Set the text to search in Member
      Parameters:
      text - any string to look for in Members
    • getGid

      public String getGid()
      Retrieve the group id used by this Query
      Returns:
      an id of Group or null if there is no filter on Member's Group
    • setGid

      public void setGid(String gid)
      Sets the group that members must belong to in order to be found.
      Parameters:
      gid - an id of Group or null to disable filter on Member's Group
    • getGids

      public String[] getGids()
      Retrieve the groups id that members must belong to in order to be found.
      Returns:
      an array of id of Group or null if there is no filter on Member's Group
    • setGids

      public void setGids(String[] gids)
      Sets the group that members must belong to in order to be found.

      Member must belong to at least one of them.

      Parameters:
      gids - an array of id of Group or null to disable filter on Member's Group
    • setGroupSet

      public void setGroupSet(Set<Group> groupSet)
      Sets the group set that members must belong to in order to be found.
      Parameters:
      groupSet - the group set.
    • getGroupSet

      public Set<Group> getGroupSet()
      Retrieves the groups that members must belong to in order to be found.

      Member must belong to at least one of them.

      Returns:
      a set of Group or null if there is no filter on Group
    • setUsage

      public void setUsage(int usage)
      Set the usage that members must be in order to be found.
      Parameters:
      usage - the usage to match
    • getUsage

      public int getUsage()
      Retrieve the usage that members must be in order to be found.
      Returns:
      a usage or -1 if none was defined
    • setWrkspc

      public void setWrkspc(String wsId)
      Sets the Workspace that members must belong to in order to be found.
      Parameters:
      wsId - an id of Workspace or null to disable filter on Member's Workspace
    • setWorkspace

      public void setWorkspace(Workspace wspc)
      Overrides:
      setWorkspace in class JcmsFormHandler
    • getRefinedWorkspace

      public Workspace getRefinedWorkspace()
      Retrieves the Workspace that members must belong to in order to be found.
      Returns:
      a Workspace or null if there is no filter on workspace
    • getGidsOff

      public String[] getGidsOff()
      Retrieve the groups id that members must NOT belong to in order to be found.
      Returns:
      an array of id of Group or null if there is no filter on Member's Group
    • setGidsOff

      public void setGidsOff(String... gids)
      Sets the group that members must NOT belong to in order to be found.

      Member must belong to at least one of them.

      Parameters:
      gids - an array of id of Group or null to disable filter on Member's Group
    • setGroupOffSet

      public void setGroupOffSet(Set<Group> groupSet)
      Sets the group set that members must NOT belong to in order to be found.
      Parameters:
      groupSet - the group set.
    • getGroupOffSet

      public Set<Group> getGroupOffSet()
      Retrieves the groups that members must NOT belong to in order to be found.

      Member must NOT belong to at least one of them.

      Returns:
      a set of Group or null if there is no filter on Group
    • setExactGroup

      public void setExactGroup(Boolean exactGroup)
      Set how member search should behave regarding group search.
      Parameters:
      exactGroup - to search members exactly in the group specified, false or null to search members in groups specified and their subgroups.
      Since:
      10.0.7 / JCMS-9425
    • getExactGroup

      public Boolean getExactGroup()
      Retrieve wether members are search exactly in the group specified or in group and subgroups (the default behavior).
      Returns:
      true if members are search exactly in the group specified, false or null if members are searched in groups specified and their subgroups.
      Since:
      10.0.7 / JCMS-9425
    • searchInSubGroup

      public boolean searchInSubGroup()
      Utility method for implementors of member search to quickly retrieve the behavior to apply for exact group search.
      Returns:
      true if members are searched in groups specified and their subgroups (default), false if members are search exactly in the group specified (only if exactGroupe=true was specified).
      Since:
      10.0.7 / JCMS-9425
    • setEnabled

      public void setEnabled(Boolean status)
      Sets the enabled/disabled state that members must be in order to be found.

      Default behavior is to NOT refine on the enabled/disabled state.

      Parameters:
      status - true to search for enabled members, false to search for disabled members
    • getEnabled

      public Boolean getEnabled()
      Retrieves the enabled/disabled state that members must be in order to be found.
      Returns:
      true to search for enabled members, false to search for disabled members
    • getExternalAuth

      public Boolean getExternalAuth()
      Retrieves the authentication filter applied in this query
      Returns:
      true to search for member using external authentication only, false to search for member using both local and external auth, null if no auth filter is being applied
      Since:
      jcms-10.0.6 / JCMS-9072
    • setExternalAuth

      public void setExternalAuth(Boolean externalAuth)
      Set type of authentication to search in Member
      Parameters:
      externalAuth - true to search for member using external authentication only, false to search for member using both local and external auth, null to omit this filter.
      Since:
      jcms-10.0.6 / JCMS-9072
    • getLdap

      public Boolean getLdap()
      Returns:
      true to filter on LDAP members only
      Since:
      jcms-10.0.8 / JCMS-10223
    • setLdap

      public void setLdap(Boolean v)
      Parameters:
      v - set filter on LDAP members only
      Since:
      jcms-10.0.8 / JCMS-10223
    • setGuest

      public void setGuest(Boolean status)
      Parameters:
      status - whether to filter only on guests (true), or only on not guests (false)
      Since:
      jcms-10.0.6
    • setGuests

      public void setGuests(Boolean status)
      Defaults on setGuest(Boolean)
      Parameters:
      status - whether to filter only on guests (true), or only on not guests (false)
      Since:
      jcms-10.0.8 / JCMS-10433
      See Also:
    • getGuest

      public Boolean getGuest()
      Returns:
      true to show only guest, false to show only not guests, null otherwise
      Since:
      jcms-10.0.6
    • isGuestFilterAvailable

      public boolean isGuestFilterAvailable()
      Checks that guest feature is enabled.
      Returns:
      true if guest filter can be used
      Since:
      jcms-10.0.6
    • getClearanceLevel

      public String[] getClearanceLevel()
      Retrieve the clearance levels that members must match in order to be found.
      Returns:
      an array of member clearance level (the string representation of the level int value) or null if there is no filter on Member's clearance level
      Since:
      10.0.8 / JCMS-10746
    • getClearanceLevelSet

      public Set<Integer> getClearanceLevelSet()
      Retrieve the clearance levels that members must match in order to be found.
      Returns:
      a Set of member clearance levels to match, never return null (an empty set mean there is no filter on Member's clearance level)
      Since:
      10.0.8 / JCMS-10746
    • setClearanceLevelSet

      public void setClearanceLevelSet(Set<Integer> levelSet)
      Sets the clearance levels that members must match in order to be found.
      Parameters:
      levelSet - a Set of member clearance level, if null or empty, no filter on Member's clearance level will be applied
      Since:
      10.0.8 / JCMS-10746
    • setClearanceLevel

      public void setClearanceLevel(String... levels)
      Sets the clearance levels that members must match in order to be found.
      Parameters:
      levels - an array of member clearance level (the string representation of the level int value) or null if there is no filter on Member's clearance level
      Since:
      10.0.8 / JCMS-10746
    • setStart

      public void setStart(int start)
      Set the start index to use for paging
      Parameters:
      start - the index of the first member to be displayed in current page
    • getStart

      public int getStart()
      Get the start index to use for paging
      Returns:
      the index of the first member to be displayed in current page
    • setPageSize

      public void setPageSize(int pageSize)
      Set the page size
      Parameters:
      pageSize - the number of element to be displayed
    • getPageSize

      public int getPageSize()
      Get the page size
      Returns:
      the number of element to be displayed
    • setSort

      public void setSort(String sort)
      Set the sorting criteria

      Possible sorting option :

      • "id" : Member id (quite useless when working with both Member and DBMember as they do not compare)
      • "cdate" : Member creation date
      • "login" : Member's login
      • "firstname" : Member's firstname
      • "name" or "lastname" : Member's lastname
      • "usage" : Member's usage (account / contact)
      Parameters:
      sort - a field name that should be used for sorting
    • getSort

      public String getSort()
      Retrieve current sorting criteria
      Returns:
      a lucene field name that should be used for sorting
    • setReverse

      public void setReverse(boolean reverse)
      Set the ordering of the sort criteria
      Parameters:
      reverse - true if the reverse order should be used
    • isReverse

      public boolean isReverse()
      Check the ordering of the sort criteria
      Returns:
      true if the reverse order should be used
    • setPagerAll

      public void setPagerAll(boolean pagerAll)
      Set the pagerAll option of this handler
      Parameters:
      pagerAll - true if all item should be displayed
    • isPagerAll

      public boolean isPagerAll()
      Get the paging option of this handler
      Returns:
      true if all item should be displayed
    • isMissingCriteria

      public boolean isMissingCriteria()
      Check if at least one search criteria has been specified for this handler
      Returns:
      false if no criteria was specified, true if at least one criteria was specified and search can be performed