Class GroupQueryHandler

All Implemented Interfaces:
JcmsConstants, JaliosConstants

public class GroupQueryHandler extends AbstractQueryHandler<Group>
Holder class and form handler of all parameters to be used for a query of groups.

Since:
jcms-5.7.4
Author:
Olivier Jaquemet
  • Field Details

  • Constructor Details

    • GroupQueryHandler

      public GroupQueryHandler()
      Constructs a new empty GroupQueryHandler with default option.
      Since:
      jcms-5.7.4
    • GroupQueryHandler

      public GroupQueryHandler(String queryString)
      Constructs a new GroupQueryHandler by parsing the specified query string.

      See GroupQueryHandler(String, HttpServletRequest) for a list of the decoded parameters.

      Parameters:
      queryString - a query String consisting of parameters (key=value) to be set in this handler.
      • Parameters must be separated with ampersand (&).
      • Values must be encoded in UTF-8.
      • Query must not starts with question mark (?) e.g : "groupText=welcome&gid=j_42"
      Since:
      jcms-5.7.4
    • GroupQueryHandler

      public GroupQueryHandler(String queryString, javax.servlet.http.HttpServletRequest request)
      Constructs a new GroupQueryHandler by parsing the specified query string and using informations available from the specified request (logged member, user language, etc).

      The following parameters (and only those listed here) will be automatically decoded from the specified query string. Other parameters should be set using apropriate setters.

      Parameters:
      queryString - a query String consisting of parameters (key=value) to be set in this handler.
      • Parameters must be separated with ampersand (&).
      • Values must be encoded in UTF-8.
      • Query must not starts with question mark (?) e.g : "groupText=welcome&gid=j_42"
      request - the HttpServletRequest to use to retrieve loggedMember, userLang, userLocale that will be used by this handler, ignored if null.
      Since:
      jcms-5.7.4
  • Method Details

    • getLogger

      protected org.apache.log4j.Logger getLogger()
      Specified by:
      getLogger in class AbstractQueryHandler<Group>
    • 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<Group>
      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<Group>
      Parameters:
      printer - a QueryHandlerPrinter to use
      Returns:
      a string containing all parameters of this handler printed using specified QueryHandlerPrinter.
      Since:
      jcms-5.7.4
    • toString

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

      public Set<Group> getResultSet()
      Return results of a query done using this GroupQueryHandler.

      Warning: This method process the query each time it is invoked, therefore do not call it multiple times if you don't need it.

      Returns:
      a new Set containing all Group found by this query.
    • getResultSet

      public Set<Group> getResultSet(Comparator<? super Group> comparator)
      Return results of a query done using this GroupQueryHandler.

      Warning: This method process the query each time it is invoked, therefore do not call it multiple times if you don't need it.

      Parameters:
      comparator - the optional Comparator to sort the return collection
      Returns:
      a new Set containing all Group found by this query, sorted using specified comparator if any.
    • getGroupFilter

      public String getGroupFilter()
      Retrieve the current group filter being used by this GroupQueryHandler.
      Returns:
      a string indicating the filter being applied
      Since:
      jcms-5.7.4
      See Also:
    • setGroupFilter

      public void setGroupFilter(String groupFilter)
      Define the groupFilter to use in this GroupQueryHandler.
      Parameters:
      groupFilter - a string indicating the filter being applied, see constructor Group.WorkspaceSelector for more information on possible values
    • setWrkspc

      public void setWrkspc(String wsId)
      Sets the Workspace that groups must belong to in order to be found.
      Parameters:
      wsId - an id of Workspace or null to disable filter on Group's Workspace
      Since:
      jcms-7.0.2 jcms-7.1
    • getRefinedWorkspace

      public Workspace getRefinedWorkspace()
      Retrieves the Workspace being used to filter groups in this Query.
      Returns:
      a Workspace or null if no workspace is being used
      Since:
      jcms-5.7.4
    • getGroupText

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

      public void setGroupText(String groupText)
      Set the text to search in Group
      Parameters:
      groupText - any string to look for in Group's name
    • getGid

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

      public void setGid(String parentGid)
      Sets the parent group id to be used during query
      Parameters:
      parentGid - an id of Group or null to disable filter on parent Group
    • getParentGroup

      public Group getParentGroup()
      Retrieves the parent group used by this query, as specified using setGid(String).
      Returns:
      a Group or null if there is no filter on parent Group
    • getLdap

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

      public void setLdap(Boolean v)
      Parameters:
      v - set filter on LDAP groups only
      Since:
      jcms-10.0.8 / JCMS-10227
    • getGlobal

      public Boolean getGlobal()
      Returns:
      true to filter on global groups only, false on workspace groups
      Since:
      jcms-10.0.8 / JCMS-10641
    • setGlobal

      public void setGlobal(Boolean v)
      Parameters:
      v - set filter on global groups only
      Since:
      jcms-10.0.8 / JCMS-10641
    • getOrganization

      public Boolean getOrganization()
      Returns:
      true to filter on organization groups only
      Since:
      jcms-10.0.8 / JCMS-10641
    • setOrganization

      public void setOrganization(Boolean v)
      Parameters:
      v - set filter on organization groups only
      Since:
      jcms-10.0.8 / JCMS-10641
    • getVisibility

      public Integer getVisibility()
      Returns:
      visibility filter to apply
      Since:
      jcms-10.0.8 / JCMS-10641
    • setVisibility

      public void setVisibility(Integer v)
      Parameters:
      v - set filter on group visibility
      Since:
      jcms-10.0.8 / JCMS-10641
    • getProfiling

      public Boolean getProfiling()
      Returns:
      true to filter on profiling groups only
      Since:
      jcms-10.0.9 / JCMS-11117
    • setProfiling

      public void setProfiling(Boolean v)
      Parameters:
      v - set filter on profiling groups only
      Since:
      jcms-10.0.9 / JCMS-11117
    • 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
      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