public class QueryHandler extends AbstractQueryHandler<Publication>
There is two main use cases :
search.jsp
or refine.jsp
).QueryHandler
is instanciated with the request property which initializes the
bean exactly like a JcmsJspContext
instance, with all contextual informations (specially the logged member).
Therefore the query will be performed using access right of the loggedMember
accessing 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 resultSet = myQueryHandler.getResultSet(); %>
loggedMember
to use to perform the query.
QueryHandler myQH = new QueryHandler(); myQH.setLoggedMember( someMember ); // optionnal Member to be used for access right check myQH.setTypes(new String[] { Article.class.getName() } ); myQH.setText("hello"); Set 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.
AbstractQueryHandler.HiddenParamQhPrinter, AbstractQueryHandler.QueryHandlerPrinter, AbstractQueryHandler.QueryStringQhPrinter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
static java.lang.String |
TEXT_MODE_ADVANCED
The mode value to use to perform a text search
with advanced search syntax (wildcard, field, etc).
|
static java.lang.String |
TEXT_MODE_ALL_WORDS
The mode value to use to perform a text search
matching all the words of the search string.
|
static java.lang.String |
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.
|
static java.lang.String |
TEXT_MODE_EXACT
The mode value to use to perform a text search
matching the exact phrase specified in the search string.
|
contextMap, editFieldSet, noRedirect, noSendRedirect, popupEdition, redirect, redirectOnClosePopup, workspaceForced
AJAX_REQUEST_ATTRIBUTES, BODY_HEADER, CSS_HEADER, cssboMap, cssfoMap, CUSTOM_HEADER, editIcon, HTTPEQUIV_HEADER, httpequivMap, HTTPNAME_HEADER, httpnameMap, initEditIcon, JAVASCRIPT_CODE_SET_ATTRIBUTE, JAVASCRIPT_SET_ATTRIBUTE, jsboSet, jsfoSet, out, pageContext, SHOW_EDIT_ICON, STYLE_HEADER
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, workspace
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, 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, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
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_YEAR
Constructor and Description |
---|
QueryHandler()
Default constructor, builds a new
QueryHandler with 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(java.lang.String queryString)
Constructs a new
QueryHandler by parsing the specified query string. |
QueryHandler(java.lang.String queryString,
javax.servlet.http.HttpServletRequest request)
Constructs a new
QueryHandler by parsing the
specified query string and using informations available
from the specified request (logged member, user language, etc). |
QueryHandler(java.lang.String text,
java.lang.String mode,
boolean catName,
boolean exactCat,
boolean searchInPub,
boolean searchInFile,
java.lang.String[] cids,
java.lang.String[] cidsOff,
java.lang.String[] mids,
java.lang.String[] midsOff,
java.lang.String[] gids,
java.lang.String[] gidsOff,
java.util.Date beginDate,
int beginDay,
int beginMonth,
int beginYear,
java.util.Date endDate,
int endDay,
int endMonth,
int endYear,
java.lang.String dateType,
int dateSince,
java.lang.String[] types,
java.lang.String[] typesOff,
boolean exactType,
java.lang.String[] pstatus,
boolean checkPstatus,
java.lang.String[] langs,
boolean replaceFileDoc)
Constructs a new
QueryHandler , settings all the specified values. |
Modifier and Type | Method and Description |
---|---|
void |
addHighlightAttributes(javax.servlet.http.HttpServletRequest request)
Add highlight attributes to the given request.
|
void |
clearHighlightAttributes(javax.servlet.http.HttpServletRequest request)
Remove highlight attributes of the given request.
|
java.lang.String |
getAbility()
Retrieves the current the portal element's ability defined for this QueryHandler.
|
java.util.Set<java.lang.String> |
getAllCidSet()
Returns all the cids contained in this query and all historized queries.
|
java.util.Date[] |
getBeginAndEndDates()
Compute begin and end date of a query from QueryHandler values.
|
java.util.Date |
getBeginDate() |
int |
getBeginDay() |
int |
getBeginMonth() |
int |
getBeginYear() |
java.util.Set<Category> |
getCategorySet(java.lang.String inputName) |
java.lang.String |
getCatMode() |
boolean |
getCatName() |
boolean |
getCheckPstatus() |
java.lang.String[] |
getCids() |
java.lang.String[] |
getCidsOff() |
java.util.HashSet<java.lang.Class<? extends Publication>> |
getClassOffSet()
Return a set of classes corresponding to the 'typesOff' attributes
|
java.util.HashSet<java.lang.Class<? extends Publication>> |
getClassSet()
Return a set of classes corresponding to the 'types' attributes
|
java.lang.String[] |
getContentLangs()
Retrieve the language in which text search is performed.
|
static java.util.List<java.lang.String> |
getContentTypesFromDocumentKind(java.lang.String kind)
Retrieve the content type to use for the specified document kind
|
int |
getDateSinceInt() |
java.lang.String |
getDateType() |
java.lang.String |
getDescription()
Returns a description of the query in the language defined
by userLang of this handler.
|
java.lang.String |
getDescription(java.lang.String lang)
Returns a description of the query in the specified language.
|
java.lang.String[] |
getDocumentKinds()
Retrieve the kind of document defined for this QueryHandler
|
static java.util.Map<java.lang.String,java.lang.String> |
getDocumentKindsGroupMap(java.lang.String userLang)
Retrieve a map of all document kind group defined in properties.
|
static java.util.Map<java.lang.String,java.lang.String> |
getDocumentKindsMap(java.lang.String userLang,
java.lang.String kindGroup)
Retrieve a map of all document kind for the specified kind group.
|
java.util.Date |
getEndDate() |
int |
getEndDay() |
int |
getEndMonth() |
int |
getEndYear() |
boolean |
getExactCat() |
boolean |
getExactType() |
java.lang.String[] |
getGids() |
java.lang.String[] |
getGidsOff() |
Member |
getHighlightedMember() |
java.lang.String |
getHist() |
int |
getHistLevel() |
java.util.List<java.lang.String> |
getHistoryList()
Not set :
- before the query method has been called
|
int[] |
getIntPstatus()
Retrieves the current pstatus values to be searched by this query.
|
java.lang.String[] |
getLangs()
Retrieve the language in which publications must have been
translated to be part of the results.
|
protected org.apache.log4j.Logger |
getLogger() |
java.lang.String[] |
getMids() |
java.lang.String[] |
getMidsOff() |
java.lang.String |
getMode()
Retrieve the string representation of the current text mode
being to perform the text search.
|
protected java.lang.String[] |
getMostRecentTextAndModeInHistory() |
protected static void |
getMostRecentTextInHistoryVisitor(java.lang.String[] textAndMode,
QueryHandler qh)
Internal recursive method used to look for most recent text.
|
boolean |
getPagerAll() |
int |
getPageSize() |
java.lang.String[] |
getPortalIds() |
java.lang.String[] |
getPstatus()
Retrieves the pstatus values to be searched by this query.
|
Workspace |
getRefinedWorkspace()
Get the Workspace for this request.
|
boolean |
getReplaceFileDoc() |
java.util.Set<Workspace> |
getResolvedWorkspaceSet()
Retrieve the Set of Workspace on which the query is refined.
|
QueryResultSet |
getResultSet()
Return results of a query done using this
QueryHandler . |
boolean |
getReverse() |
java.lang.String[] |
getSearchedFields()
Retrieves the lucene fields in which the text search is being
performed for publications.
|
boolean |
getSearchInDB() |
boolean |
getSearchInFiles() |
boolean |
getSearchInMembers() |
boolean |
getSearchInPub() |
boolean |
getSearchInSubWorkspaces() |
java.lang.String |
getSort() |
int |
getStart() |
java.lang.String |
getText()
Retrieve the current text being searched in this query.
|
boolean |
getTextSearch()
Checks if this query is mainly a text search.
|
java.lang.String[] |
getTypes() |
static java.lang.Class<? extends Publication> |
getTypesCommonSuperClass(QueryHandler... queryHandlers)
Retrieve the common super class of types specified in the QueryHandler.
|
java.lang.String[] |
getTypesOff() |
java.lang.String[] |
getUnresolvedContentLangs()
Retrieve the language in which text search is performed.
|
java.lang.String[] |
getUnresolvedLangs()
Retrieve the language in which publications must have been
translated to be part of the results.
|
java.util.Set<Workspace> |
getWorkspaceSet()
Retrieve the Set of Workspace on which the query was initially refined.
|
boolean |
isExpanded(Category cat,
java.lang.String inputName) |
boolean |
isHybridSearch()
Returns true if this is an hybrid search (i.e.
|
boolean |
isModeAdvanced()
Checks if the current text mode is to perform the search using advanced search syntaxt.
|
boolean |
isModeAll()
Checks if the current text mode is to find all words of the search string.
|
boolean |
isModeAny()
Checks if the current text mode is to find at least one word of the search string.
|
boolean |
isModeExact()
Checks if the current text mode is to find the exact phrase specified in the search string.
|
protected void |
parseQueryStringParam(java.lang.String key,
java.lang.String[] values)
Method to be implemented by subclass to decode parameter from queryString.
|
protected java.lang.String |
printParams(AbstractQueryHandler.QueryHandlerPrinter printer)
Print current QueryHandler params using specified QueryHandlerPrinter.
|
void |
setAbility(java.lang.String ability)
Sets the portal element's ability to match when PortalElement are found.
|
void |
setBeginDate(java.util.Date v) |
void |
setBeginDateW3c(java.lang.String dateW3c)
Set the begin date to be used in this query.
|
void |
setBeginDay(int v) |
void |
setBeginMonth(int v) |
void |
setBeginYear(int v) |
void |
setCatMode(java.lang.String v)
Define the mode to use when dealing with categories.
|
void |
setCatName(boolean v) |
void |
setCheckPstatus(boolean v) |
void |
setCids(java.lang.String... v) |
void |
setCidsOff(java.lang.String... v) |
void |
setContentLangs(java.lang.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.
|
void |
setDateSince(java.lang.String v) |
void |
setDateType(java.lang.String v) |
void |
setDocumentKinds(java.lang.String... kinds)
Set the kind of document to match for this QueryHandler
|
void |
setEndDate(java.util.Date v) |
void |
setEndDateW3c(java.lang.String dateW3c)
Set the end date to be used in this query.
|
void |
setEndDay(int v) |
void |
setEndMonth(int v) |
void |
setEndYear(int v) |
void |
setExactCat(boolean v) |
void |
setExactType(boolean v) |
void |
setGids(java.lang.String... v) |
void |
setGidsOff(java.lang.String... v) |
void |
setHist(java.lang.String v) |
void |
setHistLevel(int v) |
void |
setHistoryList(java.util.List<java.lang.String> historyList)
Set the list of descriptions of the query and the query recursively in "hist" request param.
|
void |
setIgnoreDefaultTypes(boolean ignoreDefaultTypes) |
void |
setLangs(java.lang.String... langArray)
The language(s) in which publications must have been
translated to be part of the results.
|
void |
setMids(java.lang.String... v) |
void |
setMidsOff(java.lang.String... v) |
void |
setMode(java.lang.String m)
Define the text mode to use to perform the text search.
|
void |
setPagerAll(boolean pagerAll) |
void |
setPageSize(int pageSize) |
void |
setPortalIds(java.lang.String... v) |
void |
setPstatus(java.lang.String... pstatus)
Sets the pstatus values to be searched by this query.
|
void |
setReplaceFileDoc(boolean v) |
void |
setReverse(boolean v) |
void |
setSearchedFields(java.lang.String... searchedFields)
Defines the (lucene) publications fields in which to perform the text search.
|
void |
setSearchInDB(boolean v) |
void |
setSearchInFiles(boolean v) |
void |
setSearchInMembers(boolean v) |
void |
setSearchInPub(boolean v) |
void |
setSearchInSubWorkspaces(boolean v) |
void |
setSort(java.lang.String sort) |
void |
setStart(int start) |
void |
setText(java.lang.String text)
Sets the text to search in this query.
|
void |
setTextSearch(boolean textSearch)
Indicate whether the search being performed through this query
is a mainly a text search prior to other things.
|
void |
setTypes(java.lang.String... types) |
void |
setTypesOff(java.lang.String... typesOff) |
void |
setWorkspace(Workspace wspc) |
void |
setWorkspaceSet(java.util.Set<Workspace> wsSet)
Specifies a Set of Workspaces to refine the query on.
|
void |
setWrkspc(java.lang.String... wsIds) |
java.lang.String |
toString() |
getAttribute, getAttributeMap, getDataSet, getHiddenParams, getQueryString, init, parseQueryString, removeAttribute, setAttribute, setDataSet
afterValidation, checkMissingField, getControllerContext, getEditFieldSet, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenFieldML, getMainLangValue, getMainLangValueArray, getMLMap, getMLMapArray, getRedirect, getRedirectOnClosePopup, getWorkspace, init, isFieldEdition, isFieldMissing, isPartialFieldEdition, isPopupEdition, isWorkspaceForced, processAction, processStatus, sendRedirect, sendRedirect, setEditField, setNoRedirect, setNoSendRedirect, setPopupEdition, setRedirect, setRedirectOnClosePopup, setWs, updateUploadedField, updateUploadedFields, validate
addBodyAttributes, addCSSHeader, addCSSHeader, addCSSHeader, addCSSHeader, addCustomHeader, addHttpEquivHeader, addHttpNameHeader, addJavaScript, addJavaScript, addJavaScript, addJavaScriptCode, addPrefetchHeader, addStyleHeader, addStyleHeader, checkAccess, checkAccess, checkCSRF, debugDisplayContext, disablePacker, forceEditIcon, forceUpdate, getAjaxRequestAttribute, getAjaxRequestId, getAllHeadersDiffMap, getAllHeadersMap, getBackOfficeCSSHeader, getBackOfficeJavaScriptSet, getBodyAttributes, getContentForm, getCSSHeaders, getCtxCategories, getCurrentCategory, getCustomHeaders, getDocType, getFinalCSSMap, getFinalJavaScriptSet, getFormElementCount, getFrontOfficeCSSHeader, getFrontOfficeJavaScriptSet, getHttpEquivHeaders, getHttpNameHeaders, getJavaScriptCodeSet, getJavaScriptSet, getJSONBridge, getPackVersion, getPageContext, getPageTitle, getPageZone, getPortal, getPortalCategory, getPortlet, getPublication, getStyleHeaders, getTemplateUsage, internalSetupEmptyHeader, isEditIcon, isEditIcon, isPrintView, registerDisplayContext, removeAjaxRequestAttribute, setAjaxRequestAttribute, setAjaxRequestId, setAllHeadersDiffMap, setDocType, setEditIcon, setFormElementCount, setPageContext, setPageTitle, setPageZone, setShowEditIcon, setTemplateUsage, showEditIcon, showEditIcon, workaroundBrowserBaseHrefBug
addCookie, addMsg, addMsg, addMsgSession, addMsgSession, applySelector, forceWorkspaceUpdate, getBaseUrl, getBrowser, getCaddy, getContextPath, getErrorMsg, getErrorMsgList, getErrorMsgSession, getErrorMsgSessionList, getInfoMsg, getInfoMsgList, getInfoMsgSession, getInfoMsgSessionList, getLoggedMember, getMsgList, getMsgSessionList, getRequest, getResponse, getSession, getUploadedFile, getUploadedFileList, getUrlWithCommonUpdatedParams, getUserCountry, getUserLang, getUserLocale, getWarningMsg, getWarningMsgList, getWarningMsgSession, getWarningMsgSessionList, glp, isAdmin, isAjaxRequest, isDBMember, isDebug, isInFrontOffice, isLogged, isWebdavAccess, removeMessage, removeMessage, retrieveUploadedFile, select, sendForbidden, sendForbidden, sendRedirect, sendRedirect, sendRedirect, setErrorMsg, setErrorMsg, setErrorMsgSession, setErrorMsgSession, setInfoMsg, setInfoMsg, setInfoMsgSession, setInfoMsgSession, setLoggedMember, setRequest, setResponse, setWarningMsg, setWarningMsg, setWarningMsgSession, setWarningMsgSession, validateRegexp, validateSchedule
public static final java.lang.String REVISION
public static final java.lang.String TEXT_MODE_ALL_WORDS
"all"
.setMode(String)
,
Constant Field Valuespublic static final java.lang.String TEXT_MODE_ANY_WORD
"any"
.setMode(String)
,
Constant Field Valuespublic static final java.lang.String TEXT_MODE_EXACT
"exact"
.setMode(String)
,
Constant Field Valuespublic static final java.lang.String TEXT_MODE_ADVANCED
"advanced"
.setMode(String)
,
Constant Field Valuespublic QueryHandler()
QueryHandler
with default value.
This constructor is required to use this class as a java bean.public QueryHandler(java.lang.String text, java.lang.String mode, boolean catName, boolean exactCat, boolean searchInPub, boolean searchInFile, java.lang.String[] cids, java.lang.String[] cidsOff, java.lang.String[] mids, java.lang.String[] midsOff, java.lang.String[] gids, java.lang.String[] gidsOff, java.util.Date beginDate, int beginDay, int beginMonth, int beginYear, java.util.Date endDate, int endDay, int endMonth, int endYear, java.lang.String dateType, int dateSince, java.lang.String[] types, java.lang.String[] typesOff, boolean exactType, java.lang.String[] pstatus, boolean checkPstatus, java.lang.String[] langs, boolean replaceFileDoc)
QueryHandler
, 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.
text
- the text to be search, see setText(String)
mode
- the text search mode to use, see setMode(String)
catName
- whether to perform text search in categories, see setCatName(boolean)
exactCat
- whether to find publication only when they have one of
the category to setCatName(boolean)
searchInPub
- whether to perform text search in publication, see setSearchInPub(boolean)
searchInFile
- whether to perform text search in files, see setSearchInFiles(boolean)
cids
- an array of Category's ids that publication must match to be found, see setCids(String...)
cidsOff
- an array of Category's ids that publication must NOT match to be found, see setCidsOff(String...)
mids
- an array of Member's ids defining the authors the publication must match to be found, see setMids(String...)
midsOff
- an array of Member's ids defining the authors the publication must NOT match to be found, see setMidsOff(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, see setGids(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, see setGidsOff(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 languagesreplaceFileDoc
- should the FileDocument be replaced by their refererespublic QueryHandler(java.lang.String queryString)
QueryHandler
by parsing the specified query string.
See QueryHandler(String, HttpServletRequest)
for a list of the
decoded parameters.
queryString
- a query String consisting of parameters (key=value) to be set in this handler.
"text=welcome&cids=j_42&cids=j_78"
public QueryHandler(java.lang.String queryString, javax.servlet.http.HttpServletRequest request)
QueryHandler
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.
"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...)
"replaceFileDoc"
: setReplaceFileDoc(boolean)
"wrkspc"
: setWrkspc(String...)
"searchedFields"
: setSearchedFields(String...)
"ability"
: setAbility(String)
"searchInSubWorkspaces"
: setSearchInSubWorkspaces(boolean)
queryString
- a query String consisting of parameters (key=value) to be set in this handler.
"text=welcome&cids=j_42&cids=j_78"
request
- the HttpServletRequest
to use to
retrieve loggedMember
, userLang
,
userLocale
that will be used by this handler,
ignored if null.public QueryHandler(QueryHandler original)
As of current implementation the following parameters are copied :
AbstractQueryHandler.setDataSet(Set)
JcmsContext.setLoggedMember(Member)
setWorkspaceSet(Set)
, else workspace, see setWorkspace(Workspace)
setCheckPstatus(boolean)
AbstractQueryHandler.getAttributeMap()
original
- the original QueryHandler from which to retrieve parametersprotected org.apache.log4j.Logger getLogger()
getLogger
in class AbstractQueryHandler<Publication>
protected void parseQueryStringParam(java.lang.String key, java.lang.String[] values)
AbstractQueryHandler
parseQueryStringParam
in class AbstractQueryHandler<Publication>
key
- the parameter name, never null nor empty.values
- the parameter values, NEVER NULL NOR EMPTY.
You can safely invoke paramValues[0]
protected java.lang.String printParams(AbstractQueryHandler.QueryHandlerPrinter printer)
printParams
in class AbstractQueryHandler<Publication>
printer
- a QueryHandlerPrinter to usepublic java.lang.String toString()
toString
in class java.lang.Object
public QueryResultSet getResultSet()
QueryHandler
.
Warning: This method process the query each time it is invoked, therefore do not call it multiple times if you don't need it.
QueryResultSet
containing all results of this query,
it is a HashSet
and therefore it is NOT sorted.
use either getAsSortedSet()
or
getAsSortedSet(Comparator)
to obtain a sorted Set.public java.util.Set<Category> getCategorySet(java.lang.String inputName)
public boolean isExpanded(Category cat, java.lang.String inputName)
public void setIgnoreDefaultTypes(boolean ignoreDefaultTypes)
ignoreDefaultTypes
- if true, getTypes() and getTypesOff() won't check the properties for default query types and types off.public Workspace getRefinedWorkspace()
public java.util.Set<Workspace> getWorkspaceSet()
public java.util.Set<Workspace> getResolvedWorkspaceSet()
public void setWrkspc(java.lang.String... wsIds)
public void setWorkspace(Workspace wspc)
setWorkspace
in class JcmsFormHandler
JcmsFormHandler.setWorkspace(com.jalios.jcms.workspace.Workspace)
public void setWorkspaceSet(java.util.Set<Workspace> wsSet)
wsSet
- a Set of Workspace to refine on.public java.util.Set<java.lang.String> getAllCidSet()
public java.lang.String getDescription()
public java.lang.String getDescription(java.lang.String lang)
lang
- the ISO-639 code of the language in which to retrieve the query descriptionpublic java.util.Date[] getBeginAndEndDates()
Date
, the first is the begin date, the second the end Date.public Member getHighlightedMember()
public java.util.HashSet<java.lang.Class<? extends Publication>> getClassSet()
public java.util.HashSet<java.lang.Class<? extends Publication>> getClassOffSet()
protected static void getMostRecentTextInHistoryVisitor(java.lang.String[] textAndMode, QueryHandler qh)
textAndMode
- MUST be an allocated array of String[2] that will be
filled with the text and mode if available.qh
- the QueryHandlerprotected java.lang.String[] getMostRecentTextAndModeInHistory()
public void addHighlightAttributes(javax.servlet.http.HttpServletRequest request)
request
- the current requestpublic void clearHighlightAttributes(javax.servlet.http.HttpServletRequest request)
request
- the current requestpublic void setMode(java.lang.String m)
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.public java.lang.String getMode()
setMode(String)
public boolean isModeAll()
getMode()
equals TEXT_MODE_ALL_WORDS
, false otherwise.public boolean isModeAny()
getMode()
equals TEXT_MODE_ANY_WORD
, false otherwise.public boolean isModeExact()
getMode()
equals TEXT_MODE_EXACT
, false otherwise.public boolean isModeAdvanced()
getMode()
equals TEXT_MODE_ADVANCED
, false otherwise.public void setText(java.lang.String text)
null
.
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.
text
- a String to be searchedpublic java.lang.String getText()
public void setTextSearch(boolean textSearch)
false
.
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 to false
the query will be
performed with other parameters.
textSearch
- true
to indicate that this query is a
text search, false
otherwise.public boolean getTextSearch()
setTextSearch(boolean)
public boolean getCatName()
public void setCatName(boolean v)
public boolean getExactCat()
public void setExactCat(boolean v)
public boolean getSearchInPub()
public void setSearchInPub(boolean v)
public boolean getSearchInFiles()
public void setSearchInFiles(boolean v)
public boolean getSearchInDB()
public void setSearchInDB(boolean v)
public boolean getSearchInMembers()
public void setSearchInMembers(boolean v)
public boolean getSearchInSubWorkspaces()
public void setSearchInSubWorkspaces(boolean v)
public java.lang.String[] getCids()
public void setCids(java.lang.String... v)
public java.lang.String[] getCidsOff()
public void setCidsOff(java.lang.String... v)
public java.lang.String[] getMids()
public void setMids(java.lang.String... v)
public java.lang.String[] getMidsOff()
public void setMidsOff(java.lang.String... v)
public java.lang.String[] getGids()
public void setGids(java.lang.String... v)
public java.lang.String[] getGidsOff()
public void setGidsOff(java.lang.String... v)
public java.lang.String[] getPortalIds()
public void setPortalIds(java.lang.String... v)
public java.util.Date getBeginDate()
public void setBeginDate(java.util.Date v)
public void setBeginDateW3c(java.lang.String dateW3c)
dateW3c
- a date formatted using W3C format, see
DateUtil.parseW3cDate(String)
for more information on this format.setBeginDate(Date)
public java.util.Date getEndDate()
public void setEndDate(java.util.Date v)
public void setEndDateW3c(java.lang.String dateW3c)
dateW3c
- a date formatted using W3C format, see
DateUtil.parseW3cDate(String)
for more information on this format.setEndDate(Date)
public int getBeginDay()
public void setBeginDay(int v)
public int getBeginMonth()
public void setBeginMonth(int v)
public int getBeginYear()
public void setBeginYear(int v)
public int getEndDay()
public void setEndDay(int v)
public int getEndMonth()
public void setEndMonth(int v)
public int getEndYear()
public void setEndYear(int v)
public java.lang.String getDateType()
public void setDateType(java.lang.String v)
public void setCatMode(java.lang.String v)
v
- "or" or "and"public java.lang.String getCatMode()
public int getDateSinceInt()
public void setDateSince(java.lang.String v)
public java.lang.String getHist()
public void setHist(java.lang.String v)
public int getHistLevel()
public void setHistLevel(int v)
public java.lang.String getSort()
public void setSort(java.lang.String sort)
public boolean getReverse()
public void setReverse(boolean v)
public java.lang.String[] getTypes()
public void setTypes(java.lang.String... types)
public java.lang.String[] getTypesOff()
public void setTypesOff(java.lang.String... typesOff)
public boolean getExactType()
public void setExactType(boolean v)
public java.lang.String[] getPstatus()
This method returns the original value defined with the setter setPstatus(String...)
,
use getIntPstatus()
to retrieve the resolved pstatus values as an int array.
getIntPstatus()
public void setPstatus(java.lang.String... pstatus)
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.public int[] getIntPstatus()
public boolean getCheckPstatus()
public void setCheckPstatus(boolean v)
public void setLangs(java.lang.String... langArray)
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...)
langArray
- an array containing ISO-639 language code
and/or "user" value which is replaced with the
current user lang as retieved by JcmsContext.getUserLang()
.public java.lang.String[] getLangs()
If the "user" value was specified in setLangs(String...)
this method will return the user language resolved at the time of the
setter invocation.
public java.lang.String[] getUnresolvedLangs()
This method is said to return an "unresolved" language value because
if the "user" value was specified in setLangs(String...)
it will be returned as is (contrary to method getLangs()
which
return the user language resolved at the time of the setter invocation)
public void setContentLangs(java.lang.String... langArray)
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 by JcmsContext.getUserLang()
ugetUserLang()).
Not to be confused with setLangs(String...)
langArray
- an array containing ISO-639 language code
and/or "user" value which is replaced with the
current user lang as retieved by JcmsContext.getUserLang()
.public java.lang.String[] getContentLangs()
If the "user" value was specified in setContentLangs(String...)
this method will return the user language resolved at the time of the
setter invocation.
Not to be confused with getLangs()
public java.lang.String[] getUnresolvedContentLangs()
This method is said to return an "unresolved" language value because
if the "user" value was specified in setContentLangs(String...)
it will be returned as is (contrary to method getContentLangs()
which
return the user language resolved at the time of the setter invocation)
Not to be confused with getUnresolvedLangs()
public boolean getReplaceFileDoc()
public void setReplaceFileDoc(boolean v)
public java.lang.String[] getSearchedFields()
public void setSearchedFields(java.lang.String... searchedFields)
searchedFields
- an array of lucene field name in which to do the
text search. if null or empty will use default behavior.public void setAbility(java.lang.String ability)
ability
- an ability choosen from values returned by
PortalElement.getAllAbilities()
, or
"noabilities"
for portlet without any ability, or
"hasabilities"
for portlet with any ability.public java.lang.String getAbility()
public int getStart()
public void setStart(int start)
public int getPageSize()
public void setPageSize(int pageSize)
public boolean getPagerAll()
public void setPagerAll(boolean pagerAll)
public java.util.List<java.lang.String> getHistoryList()
public void setHistoryList(java.util.List<java.lang.String> historyList)
historyList
- the history listpublic void setDocumentKinds(java.lang.String... kinds)
kinds
- an array of document kind (e.g "pdf", "image", "spreadsheet", ...)public java.lang.String[] getDocumentKinds()
public static java.util.Map<java.lang.String,java.lang.String> getDocumentKindsGroupMap(java.lang.String userLang)
userLang
- the ISO-639 language code in which to retrieve labelspublic static java.util.Map<java.lang.String,java.lang.String> getDocumentKindsMap(java.lang.String userLang, java.lang.String kindGroup)
userLang
- the ISO-639 language code in which to retrieve labelskindGroup
- document kind group as retrieve in key of map returned by getDocumentKindsGroupMap(String)
public static java.util.List<java.lang.String> getContentTypesFromDocumentKind(java.lang.String kind)
kind
- a document kind, as retrieved by getDocumentKindsMap(String, String)
public boolean isHybridSearch()
public static java.lang.Class<? extends Publication> getTypesCommonSuperClass(QueryHandler... queryHandlers)
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")));
queryHandlers
- one or several QueryHandler which will be used to extract the common super class of the specified types parameterCopyright © 2001-2010 Jalios SA. All Rights Reserved.