| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jalios.jcms.QueryManager
public class QueryManager
This class manages queries on publications
| Nested Class Summary | |
|---|---|
| static class | QueryManager.QueryPublicationSelector | 
| static class | QueryManager.QueryStepQuery manager steps, used to determintate which query processing is being performed. | 
| Field Summary | |
|---|---|
| protected  int | idCount | 
| static String | LUCENE_QUERY_ATTRIBUTEQueryResultsSet Attribute key of the rewritten text search string for lucene; | 
| static String | QUERY_MANAGER_STEP_ATTRIBUTEQueryHandler attribute key of the current QueryManager processing step of the QueryManager. | 
| protected  Set<QueryFilter> | queryFilterSet | 
| static String | REVISION | 
| Fields 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_YEAR | 
| Method Summary | |
|---|---|
|  void | addQueryFilter(QueryFilter qf)Add the given QueryFilter | 
| protected  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. | 
|  FileSearchEngine | getFileSearchEngine() | 
| static String | getLuceneQuery(String text,
               String mode)Build a lucene query from the given parameters. | 
|  PublicationSearchEngine | getPublicationSearchEngine() | 
| protected  HashSet<Category> | getQueryAvoidCategorySet(QueryHandler qh)Compute a HashSetofCategoryto exclude
 during query grom the "cidsOff" value of the given QueryHandler. | 
| protected  HashSet<Class<? extends Publication>> | getQueryAvoidClassSet(QueryHandler qh)Compute a HashSetofClass(type) to include
 during query grom the "typesOff" value of the given QueryHandler. | 
| protected  HashSet<Group> | getQueryAvoidGroupSet(QueryHandler qh)Compute a HashSetofGroupto exclude
 during query grom the "gidsOff" value of the given QueryHandler. | 
| protected  HashSet<Member> | getQueryAvoidMemberSet(QueryHandler qh)Compute a HashSetofMemberto exclude
 during query grom the "midsOff" value of the given QueryHandler. | 
| protected  HashSet<Category> | getQueryCategorySet(QueryHandler qh)Compute a HashSetofCategoryto include
 during query grom the "cids" value of the given QueryHandler. | 
| protected  HashSet<Class<? extends Publication>> | getQueryClassSet(QueryHandler qh,
                 boolean addFileDoc)Compute a HashSetofClass(type) to include
 during query grom the "types" value of the given QueryHandler. | 
|  Set<QueryFilter> | getQueryFilterSet()Returns all the query filter. | 
| protected  HashSet<Group> | getQueryGroupSet(QueryHandler qh)Compute a HashSetofGroupto include
 during query grom the "gids" value of the given QueryHandler. | 
| static QueryManager | getQueryManager() | 
| protected  HashSet<Member> | getQueryMemberSet(QueryHandler qh)Compute a HashSetofMemberto include
 during query grom the "mids" value of the given QueryHandler. | 
| protected  HashSet<PortalElement> | getQueryPortalElementSet(QueryHandler qh)Compute a HashSetofPortalElementincluding all
 portal ands its children from the "portalIds" value of the given QueryHandler. | 
| static boolean | matchLucenePublicationRefinement(QueryHandler qh,
                                 Publication pub) | 
| protected  QueryResultSet | performJStoreQuery(QueryHandler qh,
                   javax.servlet.http.HttpServletRequest request,
                   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,
      Set<? extends Publication> proposedDataSet)Perform a query using parameters specified in the given QueryHandler. | 
| protected  void | reduceDataSetWithCategories(QueryHandler qh,
                            HashSet<Publication> dataToKeepSet,
                            HashSet<Publication> dataToExcludeSet,
                            boolean[] indexUsed)Fill the given HashSetwithDatato keep and to exclude
 using Categories options (cids/cidsOff) of the QueryHandler. | 
| protected  void | reduceDataSetWithHistoryRefinement(QueryHandler qh,
                                   Set<? extends Publication> proposedDataSet,
                                   javax.servlet.http.HttpServletRequest request,
                                   HashSet<Publication> dataToKeepSet,
                                   HashSet<Publication> dataToExcludeSet,
                                   boolean[] indexUsed)Fill the given HashSetwithDatato keep and to exclude
 using query History (hist) of the QueryHandler. | 
| protected  void | reduceDataSetWithMembers(QueryHandler qh,
                         HashSet<Publication> dataToKeepSet,
                         HashSet<Publication> dataToExcludeSet,
                         boolean[] indexUsed)Fill the given HashSetwithDatato keep and to exclude
 using Members options (mids/midsOff) of the QueryHandler. | 
| protected  void | reduceDataSetWithPortalElements(QueryHandler qh,
                                HashSet<Publication> dataToKeepSet,
                                HashSet<Publication> dataToExcludeSet,
                                boolean[] indexUsed)Fill the given HashSetwithDatato keep and to exclude
 using PortalElement options (mids/midsOff) of the QueryHandler. | 
| protected  void | reduceDataSetWithTextEngine(QueryHandler qh,
                            HashSet<Publication> dataToKeepSet,
                            HashSet<Publication> dataToExcludeSet,
                            boolean[] indexUsed)Fill the given HashSetwithDatato keep and to exclude
 using Text Search options of the QueryHandler. | 
| protected  boolean | reduceDataSetWithTypes(QueryHandler qh,
                       HashSet<Publication> dataToKeepSet,
                       HashSet<Publication> dataToExcludeSet,
                       boolean[] indexUsed)Fill the given HashSetwithDatato 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,
                          Member loggedMember,
                          Set<Class<? extends Publication>> classSet)This method replace any FileDocuments inside the given QueryResultSetby
 their referrer (see getLinkIndexedDataSet(Publication.class)). | 
| protected  boolean | searchFulltext(QueryHandler qh,
               HashSet<Publication> dataSet,
               QueryResultSet resultSet)Perform a full-text search. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String REVISION
public static final String LUCENE_QUERY_ATTRIBUTE
public static final String QUERY_MANAGER_STEP_ATTRIBUTE
QueryManager.QueryStep, 
Constant Field Valuesprotected Set<QueryFilter> queryFilterSet
protected int idCount
| Method Detail | 
|---|
public static QueryManager getQueryManager()
                                    throws Exception
Exceptionpublic FileSearchEngine getFileSearchEngine()
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 Set<QueryFilter> getQueryFilterSet()
public void prepareExternalResult(Publication pub)
pub - the publication to be prepared
public QueryResultSet query(QueryHandler qh,
                            javax.servlet.ServletRequest request,
                            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,
                                            Set<? extends Publication> proposedDataSet)
query(QueryHandler, ServletRequest, Set)protected static int getDateType(QueryHandler qh)
qh - the QueryHandler to use.
protected Date[] getBeginAndEndDates(QueryHandler qh)
qh - the QueryHandler to use.
Date, the first is the begin date, the second the end Date.protected HashSet<Category> getQueryCategorySet(QueryHandler qh)
HashSet of Category to include
 during query grom the "cids" value of the given QueryHandler.
protected HashSet<Category> getQueryAvoidCategorySet(QueryHandler qh)
HashSet of Category to exclude
 during query grom the "cidsOff" value of the given QueryHandler.
protected HashSet<Member> getQueryMemberSet(QueryHandler qh)
HashSet of Member to include
 during query grom the "mids" value of the given QueryHandler.
protected HashSet<Member> getQueryAvoidMemberSet(QueryHandler qh)
HashSet of Member to exclude
 during query grom the "midsOff" value of the given QueryHandler.
protected HashSet<Group> getQueryGroupSet(QueryHandler qh)
HashSet of Group to include
 during query grom the "gids" value of the given QueryHandler.
 Return null if the computed hashset is empty.
protected HashSet<Group> getQueryAvoidGroupSet(QueryHandler qh)
HashSet of Group to exclude
 during query grom the "gidsOff" value of the given QueryHandler.
protected HashSet<PortalElement> getQueryPortalElementSet(QueryHandler qh)
HashSet of PortalElement including all
 portal ands its children from the "portalIds" value of the given QueryHandler.
protected HashSet<Class<? extends Publication>> getQueryClassSet(QueryHandler qh,
                                                                 boolean addFileDoc)
HashSet of Class (type) to include
 during query grom the "types" value of the given QueryHandler.
protected HashSet<Class<? extends Publication>> getQueryAvoidClassSet(QueryHandler qh)
HashSet of Class (type) to include
 during query grom the "typesOff" value of the given QueryHandler.
protected void reduceDataSetWithTextEngine(QueryHandler qh,
                                           HashSet<Publication> dataToKeepSet,
                                           HashSet<Publication> dataToExcludeSet,
                                           boolean[] indexUsed)
HashSet with Data to keep and to exclude
 using Text Search options of the QueryHandler.
protected boolean reduceDataSetWithTypes(QueryHandler qh,
                                         HashSet<Publication> dataToKeepSet,
                                         HashSet<Publication> dataToExcludeSet,
                                         boolean[] indexUsed)
HashSet with Data to keep and to exclude
 using Types options (types/typesOff) of the QueryHandler.
protected void reduceDataSetWithCategories(QueryHandler qh,
                                           HashSet<Publication> dataToKeepSet,
                                           HashSet<Publication> dataToExcludeSet,
                                           boolean[] indexUsed)
HashSet with Data to keep and to exclude
 using Categories options (cids/cidsOff) of the QueryHandler.
protected void reduceDataSetWithMembers(QueryHandler qh,
                                        HashSet<Publication> dataToKeepSet,
                                        HashSet<Publication> dataToExcludeSet,
                                        boolean[] indexUsed)
HashSet with Data to keep and to exclude
 using Members options (mids/midsOff) of the QueryHandler.
protected void reduceDataSetWithPortalElements(QueryHandler qh,
                                               HashSet<Publication> dataToKeepSet,
                                               HashSet<Publication> dataToExcludeSet,
                                               boolean[] indexUsed)
HashSet with Data to keep and to exclude
 using PortalElement options (mids/midsOff) of the QueryHandler.
protected void reduceDataSetWithHistoryRefinement(QueryHandler qh,
                                                  Set<? extends Publication> proposedDataSet,
                                                  javax.servlet.http.HttpServletRequest request,
                                                  HashSet<Publication> dataToKeepSet,
                                                  HashSet<Publication> dataToExcludeSet,
                                                  boolean[] indexUsed)
HashSet with Data to keep and to exclude
 using query History (hist) of the QueryHandler.
protected void replaceFileDocByReferrers(QueryHandler qh,
                                         QueryResultSet resultSet,
                                         Member loggedMember,
                                         Set<Class<? extends Publication>> classSet)
QueryResultSet by
 their referrer (see getLinkIndexedDataSet(Publication.class)).
 It keeps score of original FileDocument
 It removes FileDocument from the resultSet and add other Publications.
protected boolean searchFulltext(QueryHandler qh,
                                 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 static String getLuceneQuery(String text,
                                    String mode)
text - the search stringmode - the query mode (all, any, word, exact)
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||