public class QueryManager extends java.lang.Object implements JcmsConstants
Modifier and Type | Class and Description |
---|---|
static class |
QueryManager.QueryPublicationSelector |
static class |
QueryManager.QueryStep
Query manager steps, used to determintate which query processing is being performed.
|
Modifier and Type | Field and Description |
---|---|
protected int |
idCount |
static java.lang.String |
QUERY_MANAGER_STEP_ATTRIBUTE
QueryHandler attribute key of the current QueryManager processing step of the QueryManager.
|
protected java.util.Set<QueryFilter> |
queryFilterSet |
static java.lang.String |
REVISION |
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, 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, 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, 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_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, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, SUCCESS_MSG, TEMPLATE_TAB, 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, 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
Modifier and Type | Method and Description |
---|---|
void |
addQueryFilter(QueryFilter qf)
Add the given QueryFilter
|
boolean |
callFilterDBResult(PublicationCriteria pubCriteria) |
boolean |
filterDBResult(Publication pub,
java.util.Map context) |
protected java.util.Date[] |
getBeginAndEndDates(QueryHandler qh)
Compute begin and end date of a query from QueryHandler values.
|
CategorySearchEngine |
getCategorySearchEngine() |
protected static int |
getDateType(QueryHandler qh)
Return an integer describing the type of search date from a QueryHandler.
|
static QueryManager |
getInstance() |
PublicationSearchEngine |
getPublicationSearchEngine() |
protected java.util.HashSet<Category> |
getQueryAvoidCategorySet(QueryHandler qh)
Compute a
HashSet of Category to exclude
during query from the "cidsOff" value of the given QueryHandler. |
protected java.util.HashSet<java.lang.Class<? extends Publication>> |
getQueryAvoidClassSet(QueryHandler qh)
Compute a
HashSet of Class (type) to include
during query from the "typesOff" value of the given QueryHandler. |
protected java.util.HashSet<Group> |
getQueryAvoidGroupSet(QueryHandler qh)
Compute a
HashSet of Group to exclude
during query from the "gidsOff" value of the given QueryHandler. |
protected java.util.HashSet<Member> |
getQueryAvoidMemberSet(QueryHandler qh)
Compute a
HashSet of Member to exclude
during query from the "midsOff" value of the given QueryHandler. |
protected java.util.HashSet<Category> |
getQueryCategorySet(QueryHandler qh)
Compute a
HashSet of Category to include
during query from the "cids" value of the given QueryHandler. |
protected java.util.HashSet<java.lang.Class<? extends Publication>> |
getQueryClassSet(QueryHandler qh,
boolean addFileDoc)
Compute a
HashSet of Class (type) to include
during query from the "types" value of the given QueryHandler. |
java.util.Set<QueryFilter> |
getQueryFilterSet()
Returns all the query filter.
|
protected java.util.HashSet<Group> |
getQueryGroupSet(QueryHandler qh)
Compute a
HashSet of Group to include
during query from the "gids" value of the given QueryHandler. |
static QueryManager |
getQueryManager() |
protected java.util.HashSet<Member> |
getQueryMemberSet(QueryHandler qh)
Compute a
HashSet of Member to include
during query from the "mids" value of the given QueryHandler. |
protected java.util.HashSet<PortalElement> |
getQueryPortalElementSet(QueryHandler qh)
Compute a
HashSet of PortalElement including all
portal ands its children from the "portalIds" value of the given QueryHandler. |
java.util.SortedSet<? extends Publication> |
getRelatedPublicationSet(Publication pub,
QueryHandler qh)
Returns a set of publications related to the given publication and the given query handler.
|
java.util.SortedSet<? extends Publication> |
getRelatedPublicationSet(java.util.Set<Category> catSet,
QueryHandler qh,
java.util.Comparator<? extends Publication> superComparator)
Returns a set of publications related to the given category set and the given query handler.
|
static boolean |
matchLucenePublicationRefinement(QueryHandler qh,
Publication pub) |
protected QueryResultSet |
performJStoreQuery(QueryHandler qh,
javax.servlet.http.HttpServletRequest request,
java.util.Set<? extends Publication> proposedDataSet) |
void |
prepareExternalResult(Publication pub)
Prepare the given publication to be displayed in the result list.
|
QueryResultSet |
query(QueryHandler qh,
javax.servlet.ServletRequest request,
java.util.Set<? extends Publication> proposedDataSet)
Perform a query using parameters specified in the given
QueryHandler . |
protected void |
reduceDataSetWithCategories(QueryHandler qh,
java.util.HashSet<Publication> dataToKeepSet,
java.util.HashSet<Publication> dataToExcludeSet,
boolean[] indexUsed)
Fill the given
HashSet with Data to keep and to exclude
using Categories options (cids/cidsOff) of the QueryHandler. |
protected QueryResultSet |
reduceDataSetWithHistoryRefinement(QueryHandler qh,
java.util.Set<? extends Publication> proposedDataSet,
javax.servlet.http.HttpServletRequest request,
java.util.HashSet<Publication> dataToKeepSet,
java.util.HashSet<Publication> dataToExcludeSet,
boolean[] indexUsed)
Fill the given
HashSet with Data to keep and to exclude
using query History (hist) of the QueryHandler. |
protected void |
reduceDataSetWithMembers(QueryHandler qh,
java.util.HashSet<Publication> dataToKeepSet,
java.util.HashSet<Publication> dataToExcludeSet,
boolean[] indexUsed)
Fill the given
HashSet with Data to keep and to exclude
using Members options (mids/midsOff) of the QueryHandler. |
protected void |
reduceDataSetWithPortalElements(QueryHandler qh,
java.util.HashSet<Publication> dataToKeepSet,
java.util.HashSet<Publication> dataToExcludeSet,
boolean[] indexUsed)
Fill the given
HashSet with Data to keep and to exclude
using PortalElement options (mids/midsOff) of the QueryHandler. |
protected void |
reduceDataSetWithTextEngine(QueryHandler qh,
java.util.HashSet<Publication> dataToKeepSet,
java.util.HashSet<Publication> dataToExcludeSet,
boolean[] indexUsed)
Fill the given
HashSet with Data to keep and to exclude
using Text Search options of the QueryHandler. |
protected boolean |
reduceDataSetWithTypes(QueryHandler qh,
java.util.HashSet<Publication> dataToKeepSet,
java.util.HashSet<Publication> dataToExcludeSet,
boolean[] indexUsed)
Fill the given
HashSet with Data to keep and to exclude
using Types options (types/typesOff) of the QueryHandler. |
void |
removeQueryFilter(QueryFilter qf)
Remove the given QueryFilter
|
protected void |
replaceFileDocByReferrers(QueryHandler qh,
QueryResultSet resultSet,
DataSelector replacedFileDocSelector)
This method replace any FileDocuments inside the given
QueryResultSet by
their referrer (see getLinkIndexedDataSet(Publication.class)). |
protected boolean |
searchFulltext(QueryHandler qh,
java.util.HashSet<Publication> dataSet,
QueryResultSet resultSet)
Perform a full-text search.
|
public static final java.lang.String REVISION
public static final java.lang.String QUERY_MANAGER_STEP_ATTRIBUTE
QueryManager.QueryStep
,
Constant Field Valuesprotected java.util.Set<QueryFilter> queryFilterSet
protected int idCount
public static QueryManager getQueryManager()
public static QueryManager getInstance()
public PublicationSearchEngine getPublicationSearchEngine()
public CategorySearchEngine getCategorySearchEngine()
public void addQueryFilter(QueryFilter qf)
qf
- the QueryFilter to be addedpublic void removeQueryFilter(QueryFilter qf)
qf
- the QueryFilter to be removedpublic java.util.Set<QueryFilter> getQueryFilterSet()
public void prepareExternalResult(Publication pub)
pub
- the publication to be preparedpublic QueryResultSet query(QueryHandler qh, javax.servlet.ServletRequest request, java.util.Set<? extends Publication> proposedDataSet)
QueryHandler
. Collection
of Publication
or in
all Publication
if not specified.qh
- the QueryHandler
from which to retrieve the query
parameters, MUST NOT be null.request
- the ServletHttpRequest
used to set some error
or warning messages in the attributes, can be null.proposedDataSet
- the Collection
of Publication
in which to search and apply query parameters, if null, search is done
in all Publication
.QueryResultSet
containing all results of this query,
it is a HashSet
and therefore it is NOT sorted.
use either QueryResultSet.getAsSortedSet()
or
QueryResultSet.getAsSortedSet(java.util.Comparator)
to obtain a sorted Set.protected QueryResultSet performJStoreQuery(QueryHandler qh, javax.servlet.http.HttpServletRequest request, java.util.Set<? extends Publication> proposedDataSet)
qh
- the queryHandlerrequest
- the requestproposedDataSet
- the proposed data setquery(QueryHandler, ServletRequest, Set)
protected static int getDateType(QueryHandler qh)
qh
- the QueryHandler
to use.protected java.util.Date[] getBeginAndEndDates(QueryHandler qh)
qh
- the QueryHandler
to use.Date
, the first is the begin date, the second the end Date.protected java.util.HashSet<Category> getQueryCategorySet(QueryHandler qh)
HashSet
of Category
to include
during query from the "cids" value of the given QueryHandler.qh
- the QueryHandlerHashSet
of Category
protected java.util.HashSet<Category> getQueryAvoidCategorySet(QueryHandler qh)
HashSet
of Category
to exclude
during query from the "cidsOff" value of the given QueryHandler.qh
- the QueryHandlerHashSet
of Category
protected java.util.HashSet<Member> getQueryMemberSet(QueryHandler qh)
HashSet
of Member
to include
during query from the "mids" value of the given QueryHandler.qh
- the QueryHandlerHashSet
of Member
protected java.util.HashSet<Member> getQueryAvoidMemberSet(QueryHandler qh)
HashSet
of Member
to exclude
during query from the "midsOff" value of the given QueryHandler.qh
- the QueryHandlerHashSet
of Member
protected java.util.HashSet<Group> getQueryGroupSet(QueryHandler qh)
HashSet
of Group
to include
during query from the "gids" value of the given QueryHandler.
Return null if the computed hashset is empty.qh
- the QueryHandlerHashSet
of Group
protected java.util.HashSet<Group> getQueryAvoidGroupSet(QueryHandler qh)
HashSet
of Group
to exclude
during query from the "gidsOff" value of the given QueryHandler.qh
- the QueryHandlerHashSet
of Group
protected java.util.HashSet<PortalElement> getQueryPortalElementSet(QueryHandler qh)
HashSet
of PortalElement
including all
portal ands its children from the "portalIds" value of the given QueryHandler.qh
- the QueryHandlerHashSet
of PortalElement
protected java.util.HashSet<java.lang.Class<? extends Publication>> getQueryClassSet(QueryHandler qh, boolean addFileDoc)
HashSet
of Class
(type) to include
during query from the "types" value of the given QueryHandler.qh
- the QueryHandleraddFileDoc
- if true add the FileDocument classHashSet
of Class
protected java.util.HashSet<java.lang.Class<? extends Publication>> getQueryAvoidClassSet(QueryHandler qh)
HashSet
of Class
(type) to include
during query from the "typesOff" value of the given QueryHandler.qh
- the QueryHandlerHashSet
of Class
protected void reduceDataSetWithTextEngine(QueryHandler qh, java.util.HashSet<Publication> dataToKeepSet, java.util.HashSet<Publication> dataToExcludeSet, boolean[] indexUsed)
HashSet
with Data
to keep and to exclude
using Text Search options of the QueryHandler.qh
- the QueryHandlerdataToKeepSet
- the set of data to keepdataToExcludeSet
- the set of data to excludeindexUsed
- a flag to mark if data set is to keep or to excludeprotected boolean reduceDataSetWithTypes(QueryHandler qh, java.util.HashSet<Publication> dataToKeepSet, java.util.HashSet<Publication> dataToExcludeSet, boolean[] indexUsed)
HashSet
with Data
to keep and to exclude
using Types options (types/typesOff) of the QueryHandler.qh
- the QueryHandlerdataToKeepSet
- the set of data to keepdataToExcludeSet
- the set of data to excludeindexUsed
- a flag to mark if data set is to keep or to excludeprotected void reduceDataSetWithCategories(QueryHandler qh, java.util.HashSet<Publication> dataToKeepSet, java.util.HashSet<Publication> dataToExcludeSet, boolean[] indexUsed)
HashSet
with Data
to keep and to exclude
using Categories options (cids/cidsOff) of the QueryHandler.qh
- the QueryHandlerdataToKeepSet
- the set of data to keepdataToExcludeSet
- the set of data to excludeindexUsed
- a flag to mark if data set is to keep or to excludeprotected void reduceDataSetWithMembers(QueryHandler qh, java.util.HashSet<Publication> dataToKeepSet, java.util.HashSet<Publication> dataToExcludeSet, boolean[] indexUsed)
HashSet
with Data
to keep and to exclude
using Members options (mids/midsOff) of the QueryHandler.qh
- the QueryHandlerdataToKeepSet
- the set of data to keepdataToExcludeSet
- the set of data to excludeindexUsed
- a flag to mark if data set is to keep or to excludeprotected void reduceDataSetWithPortalElements(QueryHandler qh, java.util.HashSet<Publication> dataToKeepSet, java.util.HashSet<Publication> dataToExcludeSet, boolean[] indexUsed)
HashSet
with Data
to keep and to exclude
using PortalElement options (mids/midsOff) of the QueryHandler.qh
- the QueryHandlerdataToKeepSet
- the set of data to keepdataToExcludeSet
- the set of data to excludeindexUsed
- a flag to mark if data set is to keep or to excludeprotected QueryResultSet reduceDataSetWithHistoryRefinement(QueryHandler qh, java.util.Set<? extends Publication> proposedDataSet, javax.servlet.http.HttpServletRequest request, java.util.HashSet<Publication> dataToKeepSet, java.util.HashSet<Publication> dataToExcludeSet, boolean[] indexUsed)
HashSet
with Data
to keep and to exclude
using query History (hist) of the QueryHandler.qh
- the QueryHandlerproposedDataSet
- the proposed set of data to seach on.request
- the requestdataToKeepSet
- the set of data to keepdataToExcludeSet
- the set of data to excludeindexUsed
- a flag to mark if data set is to keep or to excludeprotected void replaceFileDocByReferrers(QueryHandler qh, QueryResultSet resultSet, DataSelector replacedFileDocSelector)
QueryResultSet
by
their referrer (see getLinkIndexedDataSet(Publication.class)).
It keeps score of original FileDocument (except if the publication was already part of the result.
It removes FileDocument from the resultSet and add other Publications (if they match authorization and query params).
qh
- the QueryHandlerresultSet
- the QueryResultSetreplacedFileDocSelector
- a DataSelectorprotected boolean searchFulltext(QueryHandler qh, java.util.HashSet<Publication> dataSet, QueryResultSet resultSet)
resultSet
with results from the dataSet matching critera of qh.qh
- the QueryhandlerdataSet
- a HashSet
containing all the publication to search.resultSet
- a QueryResultSet
in which to put all the results.public static boolean matchLucenePublicationRefinement(QueryHandler qh, Publication pub)
public boolean callFilterDBResult(PublicationCriteria pubCriteria)
public boolean filterDBResult(Publication pub, java.util.Map context)
public java.util.SortedSet<? extends Publication> getRelatedPublicationSet(Publication pub, QueryHandler qh)
pub
- the publication to search related publications.qh
- the QueryHandlerpublic java.util.SortedSet<? extends Publication> getRelatedPublicationSet(java.util.Set<Category> catSet, QueryHandler qh, java.util.Comparator<? extends Publication> superComparator)
catSet
- the set of category to search related publications.qh
- the QueryHandlersuperComparator
- if not null use this comparator in case of equality on the common category count.Copyright © 2001-2017 Jalios SA. All Rights Reserved.