Class QueryHandler
- All Implemented Interfaces:
JcmsConstants,JaliosConstants
- Direct Known Subclasses:
PortletQueryForeachQueryHandler,PubChooserHandler,QueryAppHandler,WebPageQueryHandler
There is two main use cases :
- in a jsp, as a java bean form handler (such as in
search.jsporrefine.jsp).
TheQueryHandleris instanciated with the request property which initializes the bean exactly like aJcmsJspContextinstance, with all contextual informations (specially the logged member). Therefore the query will be performed using access right of theloggedMemberaccessing the JSP.<jsp:useBean id="myQueryHandler" scope="page" class="com.jalios.jcms.handler.QueryHandler"> <jsp:setProperty name="myQueryHandler" property="request" value="<%= request %>"/> <jsp:setProperty name="myQueryHandler" property="*" /> </jsp:useBean> <% Set<Publication> resultSet = myQueryHandler.getResultSet(); %>
- in a jsp or in java, as a parameter holder, using default constructor and proper setters.
When used a POJO, all parameters must be defined manually, specially, if access right verification is required do not forget to specify theloggedMemberto use to perform the query.QueryHandler myQH = new QueryHandler(); myQH.setLoggedMember( someMember ); // optional Member to be used for access right check myQH.setTypes(Article.class.getName()); myQH.setText("hello"); Set<Publication> helloArticleSet = myQH.getResultSet();
If you need to perform a custom query in a jsp, use the jsp tag <jalios:query ... /> which delegates to this class and performs all the processing needed.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jalios.jcms.handler.AbstractQueryHandler
AbstractQueryHandler.HiddenParamQhPrinter, AbstractQueryHandler.QueryHandlerPrinter, AbstractQueryHandler.QueryStringQhPrinter -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringThe mode value to use to perform a text search with advanced search syntax (wildcard, field, etc).
Value :"advanced".static final StringThe mode value to use to perform a text search matching all the words of the search string.
Value :"all".static final StringThe mode value to use to perform a text search matching at least one of the words of the search string.
Value :"any".static final StringThe mode value to use to perform a text search matching the exact phrase specified in the search string.
Value :"exact".Fields inherited from class com.jalios.jcms.handler.JcmsFormHandler
contextMap, csrfValidationEnabled, editFieldSet, formStep, noRedirect, noSendRedirect, op, openTabId, opFinish, opNext, opPrevious, popupEdition, redirect, redirectOnClosePopup, workspaceForcedFields inherited from class com.jalios.jcms.context.JcmsJspContext
AJAX_REQUEST_ATTRIBUTES, BODY_HEADER, CSS_FOOTER, CSS_HEADER, cssboMap, cssfoMap, CUSTOM_HEADER, editIcon, HTTPEQUIV_HEADER, httpequivMap, HTTPNAME_HEADER, httpnameMap, initEditIcon, JAVASCRIPT_CODE_SET_ATTRIBUTE, JAVASCRIPT_MODULE_SET_ATTRIBUTE, JAVASCRIPT_SET_ATTRIBUTE, jsboSet, jsfoSet, out, pageContext, SHOW_EDIT_ICON, STYLE_HEADERFields inherited from class com.jalios.jcms.context.JcmsContext
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isDebugTemplatePath, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, userZoneId, workspaceFields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEARFields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, CLASS_PROPERTY, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CS_TYPOLOGY_ROOT_CAT_VID, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DATA_DIRECTORY, DEFAULT_PHOTO_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GENERATIONAL_STORE_DIRECTORY, GLYPH_ICON_PREFIX, ICON_ARCHIVE, ICON_ICON_PREFIX, ICON_LOCK, ICON_LOCK_STRONG, ICON_PREFIX_PROP, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, IS_IN_FRONT_OFFICE, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JCMS_TOASTR_COLLECTION, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LANG_SPRITE, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, ORGANIZATION_ROOT_GROUP_PROP, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_PROP_PREFIX, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_PROP_PREFIX, PHOTO_LARGE_WIDTH, PHOTO_MINI, PHOTO_MINI_HEIGHT, PHOTO_MINI_PROP_PREFIX, PHOTO_MINI_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_PROP_PREFIX, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_PROP_PREFIX, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_PROP_PREFIX, PHOTO_TINY_WIDTH, PHOTO_XLARGE, PHOTO_XLARGE_HEIGHT, PHOTO_XLARGE_PROP_PREFIX, PHOTO_XLARGE_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, RAW_CONTENT_ICON_PREFIX, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SECURITY_LOG_FILE, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, SVGSPRITE_ICON_PREFIX, TEMPLATE_TAB, THEME_DIR, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TTCARD_MEDIA_HEIGHT, TTCARD_MEDIA_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, TYPES_UNKNOWN_CLASS_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, UPLOAD_PERMISSION_COUNT_PROP_PREFIX, UPLOAD_PERMISSION_SIZE_PROP_PREFIX, URL_REGEXP, VID_LOGGED_MEMBER, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor, builds a newQueryHandlerwith default value.QueryHandler(QueryHandler original) Create a QueryHandler by copying all fields of the specified original QueryHandler, omitting all information linked to the current request.QueryHandler(String queryString) Constructs a newQueryHandlerby parsing the specified query string.QueryHandler(String text, String mode, boolean catName, boolean exactCat, boolean searchInPub, boolean searchInFile, String[] cids, String[] cidsOff, String[] mids, String[] midsOff, String[] gids, String[] gidsOff, Date beginDate, int beginDay, int beginMonth, int beginYear, Date endDate, int endDay, int endMonth, int endYear, String dateType, int dateSince, String[] types, String[] typesOff, boolean exactType, String[] pstatus, boolean checkPstatus, String[] langs) Constructs a newQueryHandler, settings all the specified values.QueryHandler(String queryString, javax.servlet.http.HttpServletRequest request) Constructs a newQueryHandlerby parsing the specified query string and using informations available from the specified request (logged member, user language, etc). -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHighlightAttributes(javax.servlet.http.HttpServletRequest request) Add highlight attributes to the given request.voidappendAdvanced(String key, Object value) voidappendAdvanced(String key, Object[] values) Check if the query represented by this QueryHandler is valid.voidclearHighlightAttributes(javax.servlet.http.HttpServletRequest request) Remove highlight attributes of the given request.Retrieves the current the portal element's ability defined for this QueryHandler.Returns all the cids contained in this query and all historized queries.Date[]Compute begin and end date of a query from QueryHandler values.Retrieve the begin date used in range search.intintintgetCategorySet(String inputName) Retrieve the mode to use when dealing with categories.booleanbooleanString[]getCids()String[]String[]Retrieve the classification levels that publications must match in order to be found.Retrieve the classification levels that publications must match in order to be found.HashSet<Class<? extends Publication>> Return a set of classes corresponding to the 'typesOff' attributesHashSet<Class<? extends Publication>> Return a set of classes corresponding to the 'types' attributesString[]Retrieve the language in which text search is performed.Retrieve the content type to use for the specified document kindintRetrieve the date type being used for date range search.Returns a description of the query in the language defined by userLang of this handler.getDescription(String lang) Returns a description of the query in the specified language.String[]Retrieve the kind of document defined for this QueryHandlergetDocumentKindsGroupMap(String userLang) Retrieve a map of all document kind group defined in properties.getDocumentKindsMap(String userLang, String kindGroup) Retrieve a map of all document kind for the specified kind group.Retrieve the end date being used in range searchintintintbooleanbooleanString[]getGids()String[]getHist()intNot set : - before the query method has been called.int[]Retrieves the current pstatus values to be searched by this query.String[]getLangs()Retrieve the language in which publications must have been translated to be part of the results.protected org.apache.log4j.LoggerString[]getMids()String[]String[]Retrieve the opAuthor that publication must match in order to be foundgetMode()Retrieve the string representation of the current text mode being to perform the text search.protected String[]protected static voidgetMostRecentTextInHistoryVisitor(String[] textAndMode, QueryHandler qh) Internal recursive method used to look for most recent text.booleanintString[]String[]Retrieves the pstatus values to be searched by this query.Get the Workspace for this request.Retrieve the Set of Workspace on which the query is refined.Return results of a query done using thisQueryHandler.booleanString[]Retrieves the lucene fields in which the text search is being performed for publications.booleanbooleanbooleanbooleanbooleanGets whether search is performed on the exact specified workspace(s) or by also including their children.booleanGet option indicating if content in trash are included in result or not.getSort()intgetStart()getText()Retrieve the current text being searched in this query.booleanChecks if this query is mainly a text search.String[]getTypes()static Class<? extends Publication> getTypesCommonSuperClass(QueryHandler... queryHandlers) Retrieve the common super class of types specified in the QueryHandler.String[]String[]Retrieve the language in which text search is performed.String[]Retrieve the language in which publications must have been translated to be part of the results.Retrieves the user lang variable for this context.
Fast: this method is cached using initDone (it is recomputed only on forceUpdate() or setRequest()).getWfId()Retrieve the Set of Workspace on which the query was initially refined.booleanisExpanded(Category cat, String inputName) booleanReturns true if this is an hybrid search (i.e.booleanChecks if the current text mode is to perform the search using advanced search syntaxt.booleanChecks if the current text mode is to find all words of the search string.booleanChecks if the current text mode is to find at least one word of the search string.booleanChecks if the current text mode is to find the exact phrase specified in the search string.protected voidparseQueryStringParam(String key, String[] values) Method to be implemented by subclass to decode parameter from queryString.protected StringPrint current QueryHandler params using specified QueryHandlerPrinter.voidsetAbility(String ability) Sets the portal element's ability to match when PortalElement are found.voidsetAdvanced(String advanced) voidsetBeginDate(Date date) Set the begin date for range search.voidsetBeginDateStr(String dateStr) Set the begin date using value received from a JCMS date chooser in the current user language.voidsetBeginDateW3c(String dateW3c) Set the begin date to be used in this query.voidsetBeginDay(int v) voidsetBeginMonth(int v) voidsetBeginYear(int v) voidsetCatMode(String v) Define the mode to use when dealing with categories.voidsetCatName(boolean v) voidsetCheckPstatus(boolean v) voidvoidsetCidsOff(String... v) voidsetClassificationLevel(String... levels) Sets the classification levels that publications must match in order to be found.voidsetClassificationLevelSet(Set<Integer> levelSet) Sets the classification levels that publications must match in order to be found.voidsetContentLangs(String... langArray) The language(s) in which text search will be performed, that is, the language(s) of the publications' fields values in which to search for the specified text.voidsetDateSince(int v) voidvoidsetDateType(String type) Set the date type being used for date range search.voidsetDocumentKinds(String... kinds) Set the kind of document to match for this QueryHandlervoidsetEndDate(Date date) Set the end date for range search.voidsetEndDateStr(String dateStr) Set the end date using value received from a JCMS date chooser in the current user language.voidsetEndDateW3c(String dateW3c) Set the end date to be used in this query.voidsetEndDay(int v) voidsetEndMonth(int v) voidsetEndYear(int v) voidsetExactCat(boolean v) voidsetExactType(boolean v) voidvoidsetGidsOff(String... v) voidvoidsetHistLevel(int v) voidsetHistoryList(List<String> historyList) Set the list of descriptions of the query and the query recursively in "hist" request param.voidsetIgnoreDefaultTypes(boolean ignoreDefaultTypes) voidThe language(s) in which publications must have been translated to be part of the results.voidvoidsetMidsOff(String... v) voidsetMidsOpAuthor(String... ids) Set opAuthor that publication must match in order to be found.voidDefine the text mode to use to perform the text search.voidsetPagerAll(boolean pagerAll) voidsetPageSize(int pageSize) voidsetPortalIds(String... v) voidsetPstatus(String... pstatus) Sets the pstatus values to be searched by this query.voidsetReverse(boolean v) voidsetSearchedFields(String... searchedFields) Defines the (lucene) publications fields in which to perform the text search.voidsetSearchInDB(boolean v) voidsetSearchInFiles(boolean v) voidsetSearchInMembers(boolean v) voidsetSearchInPub(boolean v) voidsetSearchInSubWorkspaces(boolean searchInSubWorkspaces) Set whether to perform search on the exact specified workspace(s) or on their children too.voidsetSearchInTrash(boolean searchInTrash) Set option indicating if content in trash are included in result or not.voidvoidsetStart(int start) voidSets the text to search in this query. Default value isnull.voidsetTextSearch(boolean textSearch) Indicate whether the search being performed through this query is a mainly a text search prior to other things. Default value isfalse.voidvoidsetTypesOff(String... typesOff) voidvoidsetWorkspace(Workspace wspc) Set the only workspace that publication must belong.voidsetWorkspaceSet(Set<Workspace> wsSet) Set the Workspaces that publication must belong.voidSet the workspaces ids that publication must belong.voidtoString()protected static String[]validateTypesArray(String[] types) Validate the specified types arrayMethods inherited from class com.jalios.jcms.handler.AbstractQueryHandler
getAttribute, getAttributeMap, getDataSet, getHiddenParams, getQueryString, init, parseQueryString, removeAttribute, setAttribute, setDataSetMethods inherited from class com.jalios.jcms.handler.JcmsFormHandler
afterValidation, canStartProcess, checkMissingField, getAvailableMainLanguage, getBackgroundProcess, getClosePopupUrl, getControllerContext, getEditFieldSet, getFormStep, getFormStepCount, getFormStepFinishLabel, getFormStepHiddenFields, getFormStepLabels, getFormStepPrefixProp, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenFieldML, getMainLangValue, getMainLangValueArray, getMLMap, getMLMapArray, getModalRedirect, getMonolingualValue, getMonolingualValueArray, getMultilingualMainValue, getMultilingualMainValueArray, getMultilingualMLMap, getMultilingualMLMapArray, getOpenTabId, getRedirect, getRedirectOnClosePopup, getWorkspace, init, isFieldEdition, isFieldMissing, isFormStepClickable, isPartialFieldEdition, isPopupEdition, isWorkspaceForced, mapStringArrayToMapStringList, mapStringListToMapStringArray, mustSendForbiddenOnCSRF, performFinish, performNext, performPrevious, processAction, processStatus, sanitize, sanitize, sendRedirect, sendRedirect, setEditField, setFormStep, setNoRedirect, setNoSendRedirect, setOpenTabId, setOpFinish, setOpNext, setOpPrevious, setPopupEdition, setRedirect, setRedirectOnClosePopup, showCancelButton, showFinishButton, showNextButton, showPreviousButton, startProcess, updateUploadedFields, validate, validateCSRF, validateFinish, validateNext, validatePreviousMethods inherited from class com.jalios.jcms.context.JcmsJspContext
addAvoidanceLink, addBodyAttributes, addCSSHeader, addCSSHeader, addCSSHeader, addCSSHeader, addCustomHeader, addHandlebarTemplate, addHttpEquivHeader, addHttpNameHeader, addJavaScript, addJavaScript, addJavaScript, addJavaScriptCode, addJavaScriptModule, addPrefetchHeader, addStyleHeader, addStyleHeader, addSvgSpriteIcon, addWebAssets, canAccessAdminArea, checkAccess, checkAccess, checkCSRF, debugDisplayContext, disablePacker, forceEditIcon, forceUpdate, getAjaxRequestAttribute, getAjaxRequestId, getAllHeadersDiffMap, getAllHeadersMap, getAvoidanceLinks, getBackOfficeCSSHeader, getBackOfficeJavaScriptSet, getBodyAttributes, getContentForm, getCSSHeaders, getCtxCategories, getCurrentCategory, getCustomHeaders, getDocType, getFinalCSSFooterMap, getFinalCSSMap, getFinalJavaScriptModuleSet, getFinalJavaScriptSet, getFrontOfficeCSSHeader, getFrontOfficeJavaScriptSet, getHandlebarTemplates, getHttpEquivHeaders, getHttpNameHeaders, getJavaScriptCodeSet, getJavaScriptModuleSet, getJavaScriptSet, getPageContext, getPageTitle, getPageZone, getPortal, getPortalCategory, getPortlet, getPublication, getStyleHeaders, getSvgSprites, getSvgSpritesHtml, getTemplateUsage, internalSetupEmptyHeader, isEditIcon, isEditIcon, isEditIconForPublish, isEditIconForPublish, isPrintView, registerDisplayContext, removeAjaxRequestAttribute, setAjaxRequestAttribute, setAjaxRequestId, setAllHeadersDiffMap, setDocType, setEditIcon, setPageContext, setPageTitle, setPageZone, setShowEditIcon, setTemplateUsage, showEditIcon, showEditIcon, showEditIconMethods inherited from class com.jalios.jcms.context.JcmsContext
addMsg, addMsg, addMsgSession, addMsgSession, addToastr, addToastr, addToastrSession, addToastrSession, applySelector, canAccessAdminArea, copyMsgListToMsgSessionList, forceWorkspaceUpdate, getBaseUrl, getBrowser, getCaddy, getContextPath, getErrorMsg, getErrorMsgList, getErrorMsgSession, getErrorMsgSessionList, getInfoMsg, getInfoMsgList, getInfoMsgSession, getInfoMsgSessionList, getLoggedMember, getMsgList, getMsgSessionList, getRequest, getResponse, getSession, getSuccessMsg, getSuccessMsgList, getSuccessMsgSession, getSuccessMsgSessionList, getToastrCollection, getToastrSessionCollection, getUploadedFiles, getUploadedFiles, getUrlWithCommonUpdatedParams, getUserCountry, getUserLocale, getUserZoneId, getWarningMsg, getWarningMsgList, getWarningMsgSession, getWarningMsgSessionList, glp, isAdmin, isAdminZone, isAjaxRequest, isDBMember, isDebug, isDebugTemplate, isInFrontOffice, isLogged, isWorkZone, removeMessage, removeMessage, removeMsg, select, sendError, sendError, sendForbidden, sendForbidden, sendRedirect, sendRedirect, sendRedirect, setErrorMsg, setErrorMsg, setErrorMsgSession, setErrorMsgSession, setInfoMsg, setInfoMsg, setInfoMsgSession, setInfoMsgSession, setLoggedMember, setRequest, setResponse, setSuccessMsg, setSuccessMsg, setSuccessMsgSession, setSuccessMsgSession, setWarningMsg, setWarningMsg, setWarningMsgSession, setWarningMsgSession, updateWorkspace, validateRegexp, validateSchedule
-
Field Details
-
TEXT_MODE_ALL_WORDS
The mode value to use to perform a text search matching all the words of the search string.
Value :"all".- Since:
- jcms-5.6.2
- See Also:
-
TEXT_MODE_ANY_WORD
The mode value to use to perform a text search matching at least one of the words of the search string.
Value :"any".- Since:
- jcms-5.6.2
- See Also:
-
TEXT_MODE_EXACT
The mode value to use to perform a text search matching the exact phrase specified in the search string.
Value :"exact".- Since:
- jcms-5.6.2
- See Also:
-
TEXT_MODE_ADVANCED
The mode value to use to perform a text search with advanced search syntax (wildcard, field, etc).
Value :"advanced".- Since:
- jcms-5.6.2
- See Also:
-
CLASSIFICATION_LEVEL_FILTER_PARAM
- See Also:
-
-
Constructor Details
-
QueryHandler
public QueryHandler()Default constructor, builds a newQueryHandlerwith default value. This constructor is required to use this class as a java bean. -
QueryHandler
public QueryHandler(String text, String mode, boolean catName, boolean exactCat, boolean searchInPub, boolean searchInFile, String[] cids, String[] cidsOff, String[] mids, String[] midsOff, String[] gids, String[] gidsOff, Date beginDate, int beginDay, int beginMonth, int beginYear, Date endDate, int endDay, int endMonth, int endYear, String dateType, int dateSince, String[] types, String[] typesOff, boolean exactType, String[] pstatus, boolean checkPstatus, String[] langs) Constructs a newQueryHandler, settings all the specified values.This constructors, while not deprecated, should not be used. Prefer the default constructor, followed by calls to the propers setters.
- Parameters:
text- the text to be search, seesetText(String)mode- the text search mode to use, seesetMode(String)catName- whether to perform text search in categories, seesetCatName(boolean)exactCat- whether to find publication only when they have one of the category tosetCatName(boolean)searchInPub- whether to perform text search in publication, seesetSearchInPub(boolean)searchInFile- whether to perform text search in files, seesetSearchInFiles(boolean)cids- an array of Category's ids that publication must match to be found, seesetCids(String...)cidsOff- an array of Category's ids that publication must NOT match to be found, seesetCidsOff(String...)mids- an array of Member's ids defining the authors the publication must match to be found, seesetMids(String...)midsOff- an array of Member's ids defining the authors the publication must NOT match to be found, seesetMidsOff(String...)gids- an array of Group's ids defining the group that the author of the publication must belong to in order for a publication to be found, seesetGids(String...)gidsOff- an array of Group's ids defining the group that the author of the publication must NOT belong to in order for a publication to be found, seesetGidsOff(String...)beginDate- the begin datebeginDay- the begin daybeginMonth- the begin monthbeginYear- the begin yearendDate- the end dateendDay- the end dayendMonth- the end monthendYear- the end yeardateType- the date typedateSince- the date since valuetypes- an array of types that publication must match to be foundtypesOff- an array of types that publication must NOT match to be foundexactType- search only for exact type (no sub types)pstatus- the pstatus searchedcheckPstatus- should the pstatus be checkedlangs- the languages
-
QueryHandler
Constructs a newQueryHandlerby parsing the specified query string.See
QueryHandler(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&cids=j_42&cids=j_78"
-
QueryHandler
Constructs a newQueryHandlerby 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.
"text":setText(String)"mode":setMode(String)"catName":setCatName(boolean)"exactCat":setExactCat(boolean)"searchInPub":setSearchInPub(boolean)"searchInFiles":setSearchInFiles(boolean)"catMode":setCatMode(String)"cids":setCids(String...)"cidsOff":setCidsOff(String...)"mids":setMids(String...)"midsOff":setMidsOff(String...)"gids":setGids(String...)"gidsOff":setGidsOff(String...)"portalIds":setPortalIds(String...)"dateType":setDateType(String)"dateSince":setDateSince(String)"beginDay":setBeginDay(int)"beginMonth":setBeginMonth(int)"beginYear":setBeginYear(int)"beginDateW3c":setBeginDateW3c(String)"endDay":setEndDay(int)"endMonth":setEndMonth(int)"endYear":setEndYear(int)"endDateW3c":setEndDateW3c(String)"hist":setHist(String)"sort":setSort(String)"types":setTypes(String...)"typesOff":setTypesOff(String...)"exactType":setExactType(boolean)"pstatus":setPstatus(String...)"langs":setLangs(String...)"contentLangs":setContentLangs(String...)"wrkspc":setWrkspc(String...)"searchedFields":setSearchedFields(String...)"ability":setAbility(String)"searchInSubWorkspaces":setSearchInSubWorkspaces(boolean)
- 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&cids=j_42&cids=j_78"
request- theHttpServletRequestto use to retrieveloggedMember,userLang,userLocalethat will be used by this handler, ignored if null.
-
QueryHandler
Create a QueryHandler by copying all fields of the specified original QueryHandler, omitting all information linked to the current request.As of current implementation the following parameters are copied :
- All fields managed by the querystring
- data set, see
AbstractQueryHandler.setDataSet(Set) - logged member, see
JcmsContext.setLoggedMember(Member) - workspaceSet if available, see
setWorkspaceSet(Set), else workspace, seesetWorkspace(Workspace) - check pstatus option, see
setCheckPstatus(boolean) - all attributes, see
AbstractQueryHandler.getAttributeMap()
- Parameters:
original- the original QueryHandler from which to retrieve parameters- Since:
- jcms-5.7.2
-
-
Method Details
-
getLogger
protected org.apache.log4j.Logger getLogger()- Specified by:
getLoggerin classAbstractQueryHandler<Publication>
-
parseQueryStringParam
Description copied from class:AbstractQueryHandlerMethod to be implemented by subclass to decode parameter from queryString.- Specified by:
parseQueryStringParamin classAbstractQueryHandler<Publication>- Parameters:
key- the parameter name, never null nor empty.values- the parameter values, NEVER NULL NOR EMPTY. You can safely invokeparamValues[0]
-
printParams
Print current QueryHandler params using specified QueryHandlerPrinter.- Specified by:
printParamsin classAbstractQueryHandler<Publication>- 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
-
getResultSet
Return results of a query done using thisQueryHandler.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
QueryResultSetcontaining all results of this query, it is aHashSetand therefore it is NOT sorted. use eithergetAsSortedSet()orgetAsSortedSet(Comparator)to obtain a sorted Set. - Since:
- jcms-5.0.0
-
getCategorySet
-
isExpanded
-
setIgnoreDefaultTypes
public void setIgnoreDefaultTypes(boolean ignoreDefaultTypes) - Parameters:
ignoreDefaultTypes- if true, getTypes() and getTypesOff() won't check the properties for default query types and types off.- Since:
- jcms-5.0.0
-
getRefinedWorkspace
Get the Workspace for this request.- Returns:
- a Workspace
-
getWorkspaceSet
Retrieve the Set of Workspace on which the query was initially refined.- Returns:
- a Set of Workspace. Return an empty set when searching in all workspace or in logged member workspace, never return null.
- Since:
- jcms-7.1.3, jcms-8.0.0, JCMS-3331
-
getResolvedWorkspaceSet
Retrieve the Set of Workspace on which the query is refined.This set is computed :
- from value(s) specified to one (and only one) of the following method :
setWs(String),setWrkspc(String...),setWorkspace(Workspace)andsetWorkspaceSet(Set). - the state of the
setSearchInSubWorkspaces(boolean)option
- Returns:
- a Set of Workspace. Return an empty set when searching in all workspace, never return null.
- Since:
- jcms-7.1.3, jcms-8.0.0, JCMS-3331
- from value(s) specified to one (and only one) of the following method :
-
setWs
- Overrides:
setWsin classJcmsFormHandler
-
setWrkspc
Set the workspaces ids that publication must belong.This method also accepts the unique
"user"value to trigger a search in the workspaces the logged member belong (cf improvement JCMS-4857).Default behavior of query handler is to search in all workspaces.
This method is exclusive with
setWs(String),setWorkspace(Workspace)andsetWorkspaceSet(Set).- Parameters:
wsIds- one or several ids of Workspace, unique value"user"to search in logged member workspaces, or null/empty values to search in all workspaces- See Also:
-
setWorkspace
Set the only workspace that publication must belong.Default behavior of query handler is to search in all workspaces.
This method is exclusive with
setWrkspc(String...),setWs(String), andsetWorkspaceSet(Set).- Overrides:
setWorkspacein classJcmsFormHandler- Parameters:
wspc- a Workspace or null to search in all workspaces- Since:
- jcms-7.1.3, jcms-8.0.0
- See Also:
-
setWorkspaceSet
Set the Workspaces that publication must belong.Default behavior of query handler is to search in all workspaces.
This method is exclusive with
setWrkspc(String...),setWs(String), andsetWorkspace(Workspace).- Parameters:
wsSet- a Set of Workspace to refine on.- Since:
- jcms-7.1.3, jcms-8.0.0, JCMS-3331
- See Also:
-
getAllCidSet
Returns all the cids contained in this query and all historized queries.- Returns:
- a set of cids
-
getUserLang
Description copied from class:JcmsContextRetrieves the user lang variable for this context.
Fast: this method is cached using initDone (it is recomputed only on forceUpdate() or setRequest()).- Overrides:
getUserLangin classJcmsContext- Returns:
- the user lang (define in InitFilter, guessed either from logged member lang, userLang portlet action, http request Accept-Language header, or defaut channel language
-
getDescription
Returns a description of the query in the language defined by userLang of this handler.- Returns:
- the string of the description
-
getDescription
Returns a description of the query in the specified language.- Parameters:
lang- the ISO-639 code of the language in which to retrieve the query description- Returns:
- the string of the description
-
getBeginAndEndDates
Compute begin and end date of a query from QueryHandler values.- Returns:
- an array of two
Date, the first is the begin date, the second the end Date.
-
getHighlightedMember
-
getClassSet
Return a set of classes corresponding to the 'types' attributes- Returns:
- a set of class
-
getClassOffSet
Return a set of classes corresponding to the 'typesOff' attributes- Returns:
- a set of class
-
getMostRecentTextInHistoryVisitor
Internal recursive method used to look for most recent text.- Parameters:
textAndMode- MUST be an allocated array of String[2] that will be filled with the text and mode if available.qh- the QueryHandler
-
getMostRecentTextAndModeInHistory
- Returns:
- the most recent text in the search history and the mode used, as an array of 2 String, with text as first and mode as second. this method is NOT CACHED and quite SLOW, cache the result yourself. (Used by highlight).
-
addHighlightAttributes
public void addHighlightAttributes(javax.servlet.http.HttpServletRequest request) Add highlight attributes to the given request.- Parameters:
request- the current request
-
clearHighlightAttributes
public void clearHighlightAttributes(javax.servlet.http.HttpServletRequest request) Remove highlight attributes of the given request.- Parameters:
request- the current request
-
setMode
Define the text mode to use to perform the text search.- Parameters:
m- a string representing the mode to use, from one of those values : The specified string will be kept only if choosen from thoses values.
-
getMode
Retrieve the string representation of the current text mode being to perform the text search.- Returns:
- a string from one of the valid values in
- See Also:
-
isModeAll
public boolean isModeAll()Checks if the current text mode is to find all words of the search string.- Returns:
- true if
getMode()equalsTEXT_MODE_ALL_WORDS, false otherwise. - Since:
- jcms-5.6.2
-
isModeAny
public boolean isModeAny()Checks if the current text mode is to find at least one word of the search string.- Returns:
- true if
getMode()equalsTEXT_MODE_ANY_WORD, false otherwise. - Since:
- jcms-5.6.2
-
isModeExact
public boolean isModeExact()Checks if the current text mode is to find the exact phrase specified in the search string.- Returns:
- true if
getMode()equalsTEXT_MODE_EXACT, false otherwise. - Since:
- jcms-5.6.2
-
isModeAdvanced
public boolean isModeAdvanced()Checks if the current text mode is to perform the search using advanced search syntaxt.- Returns:
- true if
getMode()equalsTEXT_MODE_ADVANCED, false otherwise. - Since:
- jcms-5.6.2
-
setText
Sets the text to search in this query. Default value isnull.The specified text will be search in publications/categories/archives/files depending on other parameters of this query, see
setSearchInPub(boolean),setCatName(boolean).The specified text will be search in various way depending on the search mode, see
setMode(String)for more information.- Parameters:
text- a String to be searched
-
getText
Retrieve the current text being searched in this query.- Returns:
- a String, may be null if no text search is being performed.
-
setTextSearch
public void setTextSearch(boolean textSearch) Indicate whether the search being performed through this query is a mainly a text search prior to other things. Default value isfalse.The changing behavior occurs when setting the text to null or an empty string : if set to
true, the query will returns an empty result set, if set tofalsethe query will be performed with other parameters.- Parameters:
textSearch-trueto indicate that this query is a text search,falseotherwise.
-
getTextSearch
public boolean getTextSearch()Checks if this query is mainly a text search.- Returns:
- true if this query is mainly a text search, false if this query is not specifically decicated to text search.
- See Also:
-
getCatName
public boolean getCatName() -
setCatName
public void setCatName(boolean v) -
getExactCat
public boolean getExactCat() -
setExactCat
public void setExactCat(boolean v) -
getSearchInPub
public boolean getSearchInPub() -
setSearchInPub
public void setSearchInPub(boolean v) -
getSearchInFiles
public boolean getSearchInFiles() -
setSearchInFiles
public void setSearchInFiles(boolean v) -
getSearchInDB
public boolean getSearchInDB() -
setSearchInDB
public void setSearchInDB(boolean v) -
getSearchInMembers
public boolean getSearchInMembers() -
setSearchInMembers
public void setSearchInMembers(boolean v) -
getSearchInSubWorkspaces
public boolean getSearchInSubWorkspaces()Gets whether search is performed on the exact specified workspace(s) or by also including their children.- Returns:
- true to search in children workspace(s) of the workspace(s) specified, false to search only in the exact workspace(s) specified.
- Since:
- jcms-7.1.3, jcms-8.0.0, JCMS-3331
- See Also:
-
setSearchInSubWorkspaces
public void setSearchInSubWorkspaces(boolean searchInSubWorkspaces) Set whether to perform search on the exact specified workspace(s) or on their children too.Default behavior is to search only in the exact workspaces specified (if any).
- Parameters:
searchInSubWorkspaces- set to true to search in children workspace(s) of the workspace(s) specified, false to search only in the exact workspace(s) specified.- Since:
- jcms-7.1.3, jcms-8.0.0, JCMS-3331
- See Also:
-
getCids
-
setCids
-
getCidsOff
-
setCidsOff
-
getMids
-
setMids
-
getMidsOff
-
setMidsOff
-
getMidsOpAuthor
Retrieve the opAuthor that publication must match in order to be found- Returns:
- the current opAuthor refinement ids
- Since:
- jcms-10.0.5 / JCMS-8387
-
setMidsOpAuthor
Set opAuthor that publication must match in order to be found.Value
"loggedMember"may be set to query the Publication whose opAuthor is current logged Member.- Parameters:
ids- Member ids- Since:
- jcms-10.0.5 / JCMS-8387
-
getGids
-
setGids
-
getGidsOff
-
setGidsOff
-
getPortalIds
-
setPortalIds
-
getBeginDate
Retrieve the begin date used in range search.- Returns:
- the begin date being used
-
setBeginDate
Set the begin date for range search.Setting this date will automatically update the begin day, begin month and begin year values accordingly so that begin date is kept in query string (behavior introduce in JCMS 9)
- Parameters:
date- the end date to use in date range search
-
setBeginDateStr
Set the begin date using value received from a JCMS date chooser in the current user language.- Parameters:
dateStr- the date (as formatted by a date chooser)- See Also:
-
setBeginDateW3c
Set the begin date to be used in this query.Setting this date will automatically update the begin day, end month and end year values accordingly so that begin date is kept in query string (behavior introduce in JCMS 9)
- Parameters:
dateW3c- a date formatted using W3C format, seeDateUtil.parseW3cDate(String)for more information on this format.- Since:
- jcms-5.7.2
- See Also:
-
getEndDate
Retrieve the end date being used in range search- Returns:
- the end date being used
-
setEndDate
Set the end date for range search.Setting this date will automatically update the end day, end month and end year values accordingly so that end date is kept in query string (behavior introduce in JCMS 9)
- Parameters:
date- the end date to use in date range search
-
setEndDateStr
Set the end date using value received from a JCMS date chooser in the current user language.Setting this date will automatically update the end day, end month and end year values accordingly so that end date is kept in query string (behavior introduce in JCMS 9)
- Parameters:
dateStr- the date (as formatted by a date chooser)- Since:
- jcms-9.0
- See Also:
-
setEndDateW3c
Set the end date to be used in this query.Setting this date will automatically update the end day, end month and end year values accordingly so that end date is kept in query string (behavior introduce in JCMS 9)
- Parameters:
dateW3c- a date formatted using W3C format, seeDateUtil.parseW3cDate(String)for more information on this format.- Since:
- jcms-5.7.2
- See Also:
-
getBeginDay
public int getBeginDay() -
setBeginDay
public void setBeginDay(int v) -
getBeginMonth
public int getBeginMonth() -
setBeginMonth
public void setBeginMonth(int v) -
getBeginYear
public int getBeginYear() -
setBeginYear
public void setBeginYear(int v) -
getEndDay
public int getEndDay() -
setEndDay
public void setEndDay(int v) -
getEndMonth
public int getEndMonth() -
setEndMonth
public void setEndMonth(int v) -
getEndYear
public int getEndYear() -
setEndYear
public void setEndYear(int v) -
getDateType
Retrieve the date type being used for date range search.- Returns:
- a value matching common date identifier. eg
cdate(default type if empty or invalid),pdate,mdate,edate, ...
-
setDateType
Set the date type being used for date range search.- Parameters:
type- a value matching common date identifier. egcdate(default type if empty or invalid),pdate,mdate,edate, ...
-
setCatMode
Define the mode to use when dealing with categories.You can specify any of the following value:
"or": Union of categories"and": Intersection of categories (default mode if empty or invalid)
- Parameters:
v- "or" or "and"
-
getCatMode
Retrieve the mode to use when dealing with categories.- Returns:
"or"for Union of categories,"and"for Intersection of categories (default mode if empty or invalid).
-
getDateSinceInt
public int getDateSinceInt() -
setDateSince
-
setDateSince
public void setDateSince(int v) -
getHist
-
setHist
-
getHistLevel
public int getHistLevel() -
setHistLevel
public void setHistLevel(int v) -
getSort
-
setSort
-
getReverse
public boolean getReverse() -
setReverse
public void setReverse(boolean v) -
getTypes
-
setTypes
-
validateTypesArray
Validate the specified types array- Parameters:
types-- Returns:
- a new array
-
getTypesOff
-
setTypesOff
-
getExactType
public boolean getExactType() -
setExactType
public void setExactType(boolean v) -
getWfId
-
setWfId
-
getPstatus
Retrieves the pstatus values to be searched by this query.This method returns the original value defined with the setter
setPstatus(String...), usegetIntPstatus()to retrieve the resolved pstatus values as an int array.- Returns:
- an array of String, each string representing a pstatus value (int) to be searched for
- Since:
- jcms-2.1
- See Also:
-
setPstatus
Sets the pstatus values to be searched by this query.- Parameters:
pstatus- an array of String, each string representing a pstatus value (int) to be searched for empty values in the array are ignored, if given array is null, pstatus search is reset.- Since:
- jcms-2.1
-
getIntPstatus
public int[] getIntPstatus()Retrieves the current pstatus values to be searched by this query.- Returns:
- an array of int, each int is a pstatus value to be searched for
- Since:
- jcms-2.1
-
getCheckPstatus
public boolean getCheckPstatus() -
setCheckPstatus
public void setCheckPstatus(boolean v) -
setLangs
The language(s) in which publications must have been translated to be part of the results.A publication is considered translated in a language according to rules defines by
Publication.checkLang(String), ie if the title or the abstract have been specified in the language.Default behavior is to search for all content, without restriction on the translated language.
Not to be confused with
setContentLangs(String...)- Parameters:
langArray- an array containing ISO-639 language code and/or"user"value which is replaced with the current user lang as retieved bygetUserLang().
-
getLangs
Retrieve the language in which publications must have been translated to be part of the results.If the
"user"value was specified insetLangs(String...)this method will return the user language resolved at the time of the setter invocation.- Returns:
- an array containing ISO-639 language code, null if default behavior was applied
-
getUnresolvedLangs
Retrieve the language in which publications must have been translated to be part of the results.This method is said to return an "unresolved" language value because if the
"user"value was specified insetLangs(String...)it will be returned as is (contrary to methodgetLangs()which return the user language resolved at the time of the setter invocation)- Returns:
- an array containing ISO-639 language code and/or
"user"value, null if default behavior was applied
-
setContentLangs
The language(s) in which text search will be performed, that is, the language(s) of the publications' fields values in which to search for the specified text.Default behavior is to search for the specified text in all language variation of the publications' fields.
If
"user"is specified as a paramter value, it is replaced with the current user lang as retieved bygetUserLang()ugetUserLang()).Not to be confused with
setLangs(String...)- Parameters:
langArray- an array containing ISO-639 language code and/or"user"value which is replaced with the current user lang as retieved bygetUserLang().- Since:
- jcms-8.0.0
-
getContentLangs
Retrieve the language in which text search is performed.If the
"user"value was specified insetContentLangs(String...)this method will return the user language resolved at the time of the setter invocation.Not to be confused with
getLangs()- Returns:
- an array containing ISO-639 language code, null if default behavior was applied
- Since:
- jcms-8.0.0
-
getUnresolvedContentLangs
Retrieve the language in which text search is performed.This method is said to return an "unresolved" language value because if the
"user"value was specified insetContentLangs(String...)it will be returned as is (contrary to methodgetContentLangs()which return the user language resolved at the time of the setter invocation)Not to be confused with
getUnresolvedLangs()- Returns:
- an array containing ISO-639 language code and/or
"user"value, null if default behavior was applied - Since:
- jcms-8.0.0
-
getSearchedFields
Retrieves the lucene fields in which the text search is being performed for publications.- Returns:
- an array of lucene field name in which to do the text search. (if null or empty default behavior is used)
-
setSearchedFields
Defines the (lucene) publications fields in which to perform the text search.- Parameters:
searchedFields- an array of lucene field name in which to do the text search. if null or empty will use default behavior.
-
setAbility
Sets the portal element's ability to match when PortalElement are found.- Parameters:
ability- an ability choosen from values returned byPortalElement.getAllAbilities(), or"noabilities"for portlet without any ability, or"hasabilities"for portlet with any ability.
-
getAbility
Retrieves the current the portal element's ability defined for this QueryHandler.- Returns:
- the ability defined for this query.
-
getStart
public int getStart() -
setStart
public void setStart(int start) -
getPageSize
public int getPageSize() -
setPageSize
public void setPageSize(int pageSize) -
getPagerAll
public boolean getPagerAll() -
setPagerAll
public void setPagerAll(boolean pagerAll) -
getHistoryList
Not set : - before the query method has been called. - for internal queryHandlers used for refinement in QueryManager.query processing.- Returns:
- the list of the descriptions of the current query and the query recursively in "hist" request param.
-
setHistoryList
Set the list of descriptions of the query and the query recursively in "hist" request param.- Parameters:
historyList- the history list
-
setDocumentKinds
Set the kind of document to match for this QueryHandler- Parameters:
kinds- an array of document kind (e.g "pdf", "image", "spreadsheet", ...)- Since:
- jcms-6.1
-
getDocumentKinds
Retrieve the kind of document defined for this QueryHandler- Returns:
- a set of content type, never return null
- Since:
- jcms-6.1
-
getAdvanced
-
setAdvanced
-
appendAdvanced
-
appendAdvanced
-
getDocumentKindsGroupMap
Retrieve a map of all document kind group defined in properties.- Parameters:
userLang- the ISO-639 language code in which to retrieve labels- Returns:
- a Map of group kind name (e.g. "office", "media", "misc") to document kind group label (e.g "Office documents", "Medias", "Other", ...)
- Since:
- jcms-6.1
-
getDocumentKindsMap
Retrieve a map of all document kind for the specified kind group.- Parameters:
userLang- the ISO-639 language code in which to retrieve labelskindGroup- document kind group as retrieve in key of map returned bygetDocumentKindsGroupMap(String)- Returns:
- a Map of kind name (e.g. "spreasheet", "wordprocessing", ...) to document kind label (e.g "Spreadsheet", "Word processing", ...)
- Since:
- jcms-6.1
-
getContentTypesFromDocumentKind
Retrieve the content type to use for the specified document kind- Parameters:
kind- a document kind, as retrieved bygetDocumentKindsMap(String, String)- Returns:
- an list of content types
- Since:
- jcms-6.1
-
isHybridSearch
public boolean isHybridSearch()Returns true if this is an hybrid search (i.e. JStore and JcmsDB).- Returns:
- true if this is an hybrid search (i.e. JStore and JcmsDB).
- Since:
- jcms-6.2.0
-
getTypesCommonSuperClass
Retrieve the common super class of types specified in the QueryHandler.Eg :
assertEquals(Publication.class, QueryHandler.getTypesCommonSuperClass((QueryHandler[]) null)); assertEquals(Article.class, QueryHandler.getTypesCommonSuperClass(new QueryHandler("types=Article"))); assertEquals(Content.class, QueryHandler.getTypesCommonSuperClass(new QueryHandler("types=Article&types=SmallNews"))); assertEquals(AbstractPortletSkinable.class, QueryHandler.getTypesCommonSuperClass(new QueryHandler("types=PortletJsp&types=PortletQueryForeachDetail"))); assertEquals(Publication.class, QueryHandler.getTypesCommonSuperClass(new QueryHandler("types=Article&types=PortletJsp")));- Parameters:
queryHandlers- one or several QueryHandler which will be used to extract the common super class of the specified types parameter- Returns:
- a Class, never return null (default to Publication.class in case class could not be found )
- Since:
- jcms-7.1.0
-
getQueryFilterContext
-
getSearchInTrash
public boolean getSearchInTrash()Get option indicating if content in trash are included in result or not.Default is to exclude trashed publication from result.
- Returns:
- true if trashed publication will be included in result, false if they are excluded (default)
- Since:
- jcms-10.0.5 / JCMS-8353
-
setSearchInTrash
public void setSearchInTrash(boolean searchInTrash) Set option indicating if content in trash are included in result or not.Default is to exclude trashed publication from result.
- Parameters:
searchInTrash- true if trashed publication are to be included in result, false if they are to be excluded (default)- Since:
- jcms-10.0.5 / JCMS-8353
-
getClassificationLevel
Retrieve the classification levels that publications must match in order to be found.- Returns:
- an array of publication classification level (the string representation of the level int value) or null if there is no filter on Publication's classification level
- Since:
- 10.0.8 / JCMS-10746
-
getClassificationLevelSet
Retrieve the classification levels that publications must match in order to be found.- Returns:
- a Set of publication classification levels to match, never return null (an empty set mean there is no filter on Publication's classification level)
- Since:
- 10.0.8 / JCMS-10746
-
setClassificationLevelSet
Sets the classification levels that publications must match in order to be found.- Parameters:
levelSet- a Set of publication classification level, if null or empty, no filter on Publication's classification level will be applied- Since:
- 10.0.8 / JCMS-10746
-
setClassificationLevel
Sets the classification levels that publications must match in order to be found.- Parameters:
levels- an array of publication classification level (the string representation of the level int value) or null if there is no filter on Publication's classification level- Since:
- 10.0.8 / JCMS-10746
-
checkQuery
Check if the query represented by this QueryHandler is valid.When a query is not valid, it will not return any results.
Implementation details:
A query is considered invalid when all ids specified for one of the following filter parameters were invalid :setWrkspc(String...)setWs(String)setCids(String...)setCidsOff(String...)setMids(String...)setMidsOff(String...)setMidsOpAuthor(String...)setGids(String...)setGidsOff(String...)
"wrkpsc=<a-valid-id>": query is valid"wrkpsc=<a-valid-id>&wrkpsc=<a-valid-id>": query is valid"wrkpsc=<a-valid-id>&wrkpsc=<an-invalid-id>": query is invalid"wrkpsc=<an-invalid-id>&wrkpsc=<an-invalid-id>": query is invalid"cids=<a-valid-id>&wrkpsc=<an-invalid-id>": query is invalid
- Returns:
- a ControllerStatus indicating the validation failure if any, or
ControllerStatus.OKif query is valid. (never return null) - Since:
- 10.0.9 / JCMS-11150
-