Class ArchiveQueryHandler

    • Field Detail

      • originalType

        protected short originalType
      • text

        protected java.lang.String text
      • mode

        protected java.lang.String mode
      • sort

        protected java.lang.String sort
      • reverse

        protected boolean reverse
      • pageStart

        protected int pageStart
      • pageSize

        protected int pageSize
      • pagerAll

        protected boolean pagerAll
    • Constructor Detail

      • ArchiveQueryHandler

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

        public ArchiveQueryHandler​(java.lang.String queryString)
        Constructs a new ArchiveQueryHandler by parsing the specified query string.

        See ArchiveQueryHandler(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 : "text=welcome&ws=j_42"
        Since:
        jcms-6.0
      • ArchiveQueryHandler

        public ArchiveQueryHandler​(java.lang.String queryString,
                                   javax.servlet.http.HttpServletRequest request)
        Constructs a new ArchiveQueryHandler 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 : "text=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-6.0
    • Method Detail

      • parseQueryStringParam

        protected void parseQueryStringParam​(java.lang.String key,
                                             java.lang.String[] values)
        Description copied from class: AbstractQueryHandler
        Method to be implemented by subclass to decode parameter from queryString.
        Specified by:
        parseQueryStringParam in class AbstractQueryHandler<ArchivedPublication>
        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 java.lang.String printParams​(AbstractQueryHandler.QueryHandlerPrinter printer)
        Description copied from class: AbstractQueryHandler
        Method to be implemented by subclass to provide params printing in query or hidden input format.
        Typical implementation :
         protected String printParams(QueryHandlerPrinter printer) {
           printer.printParam("foo", getFoo());
           printer.printParam("bar", getBar());
           return printer.toString();
         }
         
        Specified by:
        printParams in class AbstractQueryHandler<ArchivedPublication>
        Parameters:
        printer - a QueryHandlerPrinter to use
        Returns:
        a string containing all parameters of this handler printed using specified QueryHandlerPrinter.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getPageResult

        public PageResult<ArchivedPublication> getPageResult()
        Returns a new PageResult of archive for the current settings of this handler.
        Returns:
        a new PageResult
      • getText

        public java.lang.String getText()
        Retrieves the text being search in this query
        Returns:
        a string or null if no text is being searched
        Since:
        jcms-6.0
      • setText

        public void setText​(java.lang.String text)
        Set the text to search in Archive
        Parameters:
        text - any string to look for in Archive
        Since:
        jcms-6.0
      • setMode

        public void setMode​(java.lang.String mode)
      • getMode

        public java.lang.String getMode()
      • getOriginalType

        public java.lang.String getOriginalType()
        Retrieves the type of archive being search.
        Returns:
        "content" or "form"
      • setOriginalType

        public void setOriginalType​(java.lang.String originalTypeStr)
        Set the type of archive being search.
        Parameters:
        originalTypeStr - "content" or "form"
      • setOriginalTypeShort

        public void setOriginalTypeShort​(short originalType)
        Set the type of archive being search.
        Parameters:
        originalType - -1 for all archive, otherwise use ArchivedPublication.TYPE_CONTENT or ArchivedPublication.TYPE_FORM
      • setWrkspc

        public void setWrkspc​(java.lang.String wsId)
        Sets the Workspace that archive must belong to in order to be found.
        Parameters:
        wsId - an id of Workspace or null to disable filter on Archive's Workspace
        Since:
        jcms-6.0
      • getRefinedWorkspace

        public Workspace getRefinedWorkspace()
        Retrieves the Workspace that archives must belong to in order to be found.
        Returns:
        a Workspace or null if there is no filter on workspace
        Since:
        jcms-6.0
      • setSort

        public void setSort​(java.lang.String sort)
      • setReverse

        public void setReverse​(boolean reverse)
      • setStart

        public void setStart​(int start)
      • setPageSize

        public void setPageSize​(int pageSize)
      • setPagerAll

        public void setPagerAll​(boolean pagerAll)