public class PublicationCriteria extends java.lang.Object implements JaliosConstants, DBConstants
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
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
ALL_CATEGORIES_SET_FIELD, ATTACH_WS_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_ATTACH_WS_FIELD, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_HAS_ATTACH_WS, HIBERNATE_MAPPING_HASNOREADRIGHTS, HIBERNATE_MAPPING_MAININSTANCE_ID, HIBERNATE_MAPPING_MAJORVERSION, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_MERGE_DATE, HIBERNATE_MAPPING_MERGE_ID, HIBERNATE_MAPPING_MINORVERSION, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_READERCOUNT, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_TRACKED, HIBERNATE_MAPPING_UDATE, HIBERNATE_MAPPING_VOTECOUNT, HIBERNATE_MAPPING_VOTESCORE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MAX_HIBERNATE_MAPPING_PUBLICATION, MDATE_FIELD, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
Constructor and Description |
---|
PublicationCriteria(java.lang.Class<? extends Publication> clazz) |
PublicationCriteria(java.lang.Class<? extends Publication> clazz,
QueryHandler qh) |
Modifier and Type | Method and Description |
---|---|
org.hibernate.Criteria |
buildCriteria(boolean count)
Build an hibernate Criteria object from all settings specified in this PublicationCriteria.
|
boolean |
checkPublicationCategories(Publication pub)
Returns true if the given publication matches the required categories (must be called if isPartialCategoryRestriction()).
|
boolean |
checkReadRights() |
protected void |
clearQueryFilterContext() |
java.lang.String |
getAuthorId()
Retrieve the author id publication MUST match to be found.
|
java.lang.String[] |
getAuthorIds()
Retrieve the authors ids that publication MUST match to be found.
|
java.lang.String[] |
getAuthorIdsOff()
Retrieve the authors ids that publication MUST NOT match to be found.
|
java.util.Date |
getBeginDate()
Retrieve begin date to use during search.
|
java.lang.String |
getDateType()
Retrieve the date field used for date filtering.
|
java.util.Date |
getEndDate()
Retrieve end date to use during search.
|
int |
getFirstResult() |
int |
getMaxResults() |
Member |
getMember()
Retrieve the expected author for this query
|
java.util.Comparator |
getMergeComparator()
Returns the merge comparator used to sort hybrid search.
|
java.lang.String |
getOrder()
Retrieve field name used for sorting.
|
int[] |
getPstatusArray()
Retrieve the pstatus publication must match or not match to be found.
|
java.lang.Class<? extends Publication> |
getPubClass() |
java.util.Map<java.lang.String,java.lang.Object> |
getQueryFilterContext() |
QueryHandler |
getQueryHandler() |
java.lang.String |
getText()
Retrieve text publication must contain to be found.
|
java.lang.String |
getWorkspaceId()
Use instead
getWorkspaceIdSet() . |
java.util.Set<java.lang.String> |
getWorkspaceIdSet() |
boolean |
isAscendingOrder()
Checks ordering arrangement.
|
boolean |
isHybridSearch() |
boolean |
isIncludePstatus()
Retrieve boolean indicating how pstatus specified in
setPstatusArray(int...) must be used. |
boolean |
isPartialCategoryRestriction()
Returns true if the category restriction is partial.
|
boolean |
isPolymorphicQuery() |
boolean |
isScrollRequired() |
boolean |
isTextSearch()
Returns true if the text parameter has been setup.
|
int |
queryCount() |
PublicationCriteria |
setAscendingOrder(boolean ascendingOrder)
Set the arrangement, ascending or descending, to used to use during ordering.
|
PublicationCriteria |
setAuthor(Member author)
Set the author of publication to found.
|
PublicationCriteria |
setAuthorId(java.lang.String authorId)
Set the author id publication MUST match to be found.
|
PublicationCriteria |
setAuthorIds(java.lang.String... mbrIds)
Set the authors of publication to found.
|
PublicationCriteria |
setAuthorIdsOff(java.lang.String... mbrIds)
Set the authors ids that publication MUST NOT match to be found.
|
PublicationCriteria |
setBeginDate(java.util.Date beginDate)
Set the date to use as lower value accepted for date search.
|
void |
setCheckReadRights(boolean checkReadRights) |
PublicationCriteria |
setCustomCriterion(org.hibernate.criterion.Criterion customCriterion)
Set additionnal Hibernate criterion to use during query
|
PublicationCriteria |
setDateType(java.lang.String dateType)
Set the date field used for date filtering.
|
PublicationCriteria |
setDocumentKinds(java.lang.String... kinds)
Set the kind of document to match.
|
PublicationCriteria |
setEndDate(java.util.Date endDate)
Set the date to use as upper value accepted for date search.
|
void |
setFilterOnMemberWorkspaces(boolean filterOnMemberWorkspaces) |
PublicationCriteria |
setFirstResult(int firstResult) |
void |
setHybridSearch(boolean isHybridSearch)
Set whether this PublicationCriteria was used as part of an hybrid search (both JStore and JcmsDB) or JcmsDB only.
|
PublicationCriteria |
setIncludePstatus(boolean includePstatus)
Set how pstatus specified in
setPstatusArray(int...) must be used. |
PublicationCriteria |
setMaxResults(int maxResults) |
void |
setMember(Member member)
Set the author of publication to be found.
|
PublicationCriteria |
setMergeComparator(java.util.Comparator mergeComparator)
Set the merge comparator to be used to sort hybrid search (and set the isHybridSearch flag)
|
PublicationCriteria |
setOrder(java.lang.String order)
Set the field name to use for sorting.
|
PublicationCriteria |
setPstatusArray(int... pstatusArray)
Set the pstatus publication must match or not match to be found.
|
PublicationCriteria |
setPubClass(java.lang.Class<? extends Publication> clazz) |
PublicationCriteria |
setQueryHandler(QueryHandler qh) |
PublicationCriteria |
setRowIdSet(java.util.Set<java.lang.Long> rowIdSet) |
PublicationCriteria |
setSearchInAttachWS(boolean searchInAttachWS) |
PublicationCriteria |
setText(java.lang.String text)
Set the text to look for in publication.
|
PublicationCriteria |
setWorkspace(Workspace workspace)
Use instead
setWorkspaceIdSet(Collection) . |
PublicationCriteria |
setWorkspaceId(java.lang.String workspaceId)
Use instead
setWorkspaceIdSet(Collection) . |
void |
setWorkspaceIdSet(java.util.Collection<java.lang.String> wsIds) |
java.lang.String |
toString() |
public static final java.lang.String REVISION
public PublicationCriteria(java.lang.Class<? extends Publication> clazz)
public PublicationCriteria(java.lang.Class<? extends Publication> clazz, QueryHandler qh)
public java.lang.String toString()
toString
in class java.lang.Object
public org.hibernate.Criteria buildCriteria(boolean count)
count
- true to build a Critera for an efficient counting query (i.e. without sorting),
false to build a Criteria complying with all criterion (ie sort order is applied with proper order by clause)Criteria
instance. Warning: may return null !public boolean isTextSearch()
public java.lang.Class<? extends Publication> getPubClass()
public PublicationCriteria setPubClass(java.lang.Class<? extends Publication> clazz)
public QueryHandler getQueryHandler()
public PublicationCriteria setQueryHandler(QueryHandler qh)
public java.lang.String getWorkspaceId()
getWorkspaceIdSet()
.public PublicationCriteria setWorkspaceId(java.lang.String workspaceId)
setWorkspaceIdSet(Collection)
.workspaceId
- the workspace id to refine on.public PublicationCriteria setWorkspace(Workspace workspace)
setWorkspaceIdSet(Collection)
.workspace
- the workspace to refine on.public void setWorkspaceIdSet(java.util.Collection<java.lang.String> wsIds)
wsIds
- the set of workspace's ids to refine on.public java.util.Set<java.lang.String> getWorkspaceIdSet()
public java.lang.String getAuthorId()
public PublicationCriteria setAuthorId(java.lang.String authorId)
setAuthorIds(String...)
and setAuthor(Member)
authorId
- the Member id the authors the publication must match to be foundpublic PublicationCriteria setAuthor(Member author)
setAuthorIds(String...)
and setAuthorId(String)
author
- the Member the authors the publication must match to be foundpublic java.lang.String[] getAuthorIds()
public PublicationCriteria setAuthorIds(java.lang.String... mbrIds)
setAuthor(Member)
and setAuthorId(String)
mbrIds
- an array of Member's ids defining the authors the publication must match to be foundpublic java.lang.String[] getAuthorIdsOff()
public PublicationCriteria setAuthorIdsOff(java.lang.String... mbrIds)
mbrIds
- an array of Member's ids defining the authors the publication must NOT match to be foundpublic void setFilterOnMemberWorkspaces(boolean filterOnMemberWorkspaces)
public int[] getPstatusArray()
setPstatusArray(int...)
,
setIncludePstatus(boolean)
public PublicationCriteria setPstatusArray(int... pstatusArray)
Set setIncludePstatus(boolean)
simultaneously to control how those values are being used.
Examples :
To find all publication in the published state :
pubCriteria.setIncludePstatus(true); pubCriteria.setPstatusArray(WorkflowConstants.PUBLISHED_PSTATUS);To find all publication which are NOT expired :
pubCriteria.setIncludePstatus(false); pubCriteria.setPstatusArray(WorkflowConstants.EXPIRED_PSTATUS);
pstatusArray
- one or more workflow pstatus to use in the criterionsetIncludePstatus(boolean)
public boolean isIncludePstatus()
setPstatusArray(int...)
must be used.getPstatusArray()
are required, false if values are excluded.setPstatusArray(int...)
,
setIncludePstatus(boolean)
public PublicationCriteria setIncludePstatus(boolean includePstatus)
setPstatusArray(int...)
must be used.
Default value is true if a QueryHandler
was specified on this PublicationCriteria (through constructor or setter), false otherwise.
includePstatus
- true if value specified in getPstatusArray()
are required ; publication will match only if their pstatus IS one of the specified value, setPstatusArray(int...)
public java.lang.String getText()
public PublicationCriteria setText(java.lang.String text)
text
- a search string, as supported by lucene full text search.public PublicationCriteria setDocumentKinds(java.lang.String... kinds)
kinds
- an array of document kind (e.g "pdf", "image", "spreadsheet", ...)public java.util.Date getBeginDate()
setBeginDate(Date)
,
setDateType(String)
public PublicationCriteria setBeginDate(java.util.Date beginDate)
Set setDateType(String)
simultaneously to control which date field is being used.
beginDate
- the date to use as lower boundsetDateType(String)
public java.util.Date getEndDate()
setEndDate(Date)
,
setDateType(String)
public PublicationCriteria setEndDate(java.util.Date endDate)
Set setDateType(String)
simultaneously to control which date field is being used.
endDate
- the date to use as upper boundsetDateType(String)
public java.lang.String getDateType()
public PublicationCriteria setDateType(java.lang.String dateType)
"cdate" is the default value and fallback if an invalid type is specified.
Accepted values are :
dateType
- a date type from accepted values as described above.setBeginDate(Date)
,
setEndDate(Date)
public PublicationCriteria setRowIdSet(java.util.Set<java.lang.Long> rowIdSet)
public void setMember(Member member)
member
- a Member (or null to reset this filter)public Member getMember()
public boolean checkReadRights()
public void setCheckReadRights(boolean checkReadRights)
public int getFirstResult()
public PublicationCriteria setFirstResult(int firstResult)
public int getMaxResults()
public PublicationCriteria setMaxResults(int maxResults)
public java.lang.String getOrder()
public PublicationCriteria setOrder(java.lang.String order)
Set setAscendingOrder(boolean)
simultaneously to control which arrangement should be used during ordering.
Accepted values includes :
order
- a field namepublic boolean isAscendingOrder()
setAscendingOrder(boolean)
public PublicationCriteria setAscendingOrder(boolean ascendingOrder)
ascendingOrder
- true to use ascending order, false to use descending order.setOrder(String)
public PublicationCriteria setCustomCriterion(org.hibernate.criterion.Criterion customCriterion)
customCriterion
- an hibernate Criterion
or null to reset valuepublic java.util.Comparator getMergeComparator()
getOrder()
and isAscendingOrder()
.public PublicationCriteria setMergeComparator(java.util.Comparator mergeComparator)
mergeComparator
- the merge comparatorpublic boolean isHybridSearch()
public void setHybridSearch(boolean isHybridSearch)
isHybridSearch
- true for hybrid search, false for JcmsDB search only.setMergeComparator(Comparator)
public boolean isPolymorphicQuery()
public boolean isScrollRequired()
public int queryCount()
public boolean isPartialCategoryRestriction()
public boolean checkPublicationCategories(Publication pub)
pub
- the publicationpublic java.util.Map<java.lang.String,java.lang.Object> getQueryFilterContext()
protected void clearQueryFilterContext()
public PublicationCriteria setSearchInAttachWS(boolean searchInAttachWS)
Copyright © 2001-2018 Jalios SA. All Rights Reserved.