Class FrontODFSearch
- All Implemented Interfaces:
SolrFieldNames
,SolrWebFieldNames
,Poolable
,Recyclable
,Disposable
,Component
,Contextualizable
,LogEnabled
,Serviceable
,Generator
,SitemapModelComponent
,XMLProducer
ODF search results
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration for display subprogram modeNested classes/interfaces inherited from class org.ametys.web.frontoffice.SearchGenerator
SearchGenerator.ContentTypeSearch
Nested classes/interfaces inherited from class org.ametys.web.frontoffice.AbstractSearchGenerator
AbstractSearchGenerator.AttributeFacetField, AbstractSearchGenerator.ContentTypeFacetField, AbstractSearchGenerator.FacetField
-
Field Summary
Modifier and TypeFieldDescriptionThe matching subprogramsFields inherited from class org.ametys.web.frontoffice.SearchGenerator
_queryAdapterFOSearchEP, _siteTypeEP
Fields inherited from class org.ametys.web.frontoffice.AbstractSearchGenerator
_contentTypesHelper, _context, _cTypeExtPt, _resolver, _searcherFactory, _searchHelper, _siteManager, _tagExtPt, _TEXTFIELD_PATTERN, _uriResolverEP, DOCUMENT_TYPE_IS_PAGE_RESOURCE_FACET_NAME
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Fields inherited from interface org.ametys.cms.content.indexing.solr.SolrFieldNames
ACL_INIT_VALUE_ALLOWED_GROUPS, ACL_INIT_VALUE_ALLOWED_USERS, ACL_INIT_VALUE_ANONYMOUS, ACL_INIT_VALUE_ANYCONNECTED, ACL_INIT_VALUE_DENIED_GROUPS, ACL_INIT_VALUE_DENIED_USERS, ALL_CONTENT_TYPES, ALL_MIXIN_TYPES, ALL_TAGS, ATTACHMENT_CONTENT_ID, CONTENT_COMMENTS_NONVALIDATED, CONTENT_COMMENTS_VALIDATED, CONTENT_CREATOR, CONTENT_FIRST_VALIDATOR, CONTENT_LANGUAGE, CONTENT_LANGUAGES, CONTENT_LAST_CONTRIBUTOR, CONTENT_LAST_MAJOR_VALIDATOR, CONTENT_LAST_VALIDATOR, CONTENT_NAME, CONTENT_OUTGOING_REFEERENCES_RESOURCE_IDS, CONTENT_TITLES, CONTENT_TYPE_RESOURCE, CONTENT_TYPES, CONTENT_VISIBLE_ATTACHMENT_RESOURCE_IDS, CREATION_DATE, DC_CONTRIBUTOR, DC_COVERAGE, DC_CREATOR, DC_DATE, DC_DESCRIPTION, DC_FORMAT, DC_IDENTIFIER, DC_LANGUAGE, DC_PUBLISHER, DC_RELATION, DC_RIGHTS, DC_SOURCE, DC_SUBJECT, DC_TITLE, DC_TYPE, DOCUMENT_TYPE, EXACT_WS_OPERATOR, EXCERPT, FILENAME, FULL, ID, IS_AMETYS_OBJECT, LANGUAGE_SEPARATOR, LAST_MODIFIED, LENGTH, MIME_TYPES, MIXIN_TYPES, PATH, PSEUDO_CONTENT_TYPE_VALUE_RESOURCE, PSEUDO_CONTENT_TYPES, REPEATER_ENTRY_POSITION, RESOURCE_ANCESTOR_AND_SELF_IDS, RESOURCE_ANCESTOR_IDS, RESOURCE_CREATOR, RESOURCE_DATE, RESOURCE_LAST_MODIFIED, RESOURCE_MIME_TYPE_GROUP, RESOURCE_ROOT_ID, SIMPLE_CONTENT_PARENTS, STEMMED_OPERATOR, SUB_CONTENT, SYSTEM_FULL, TAGS, TITLE, TITLE_SORT, TYPE_CONTENT, TYPE_CONTENT_ATTACHMENT_RESOURCE, TYPE_CONTENT_ATTRIBUTE_RESOURCE, TYPE_REPEATER, TYPE_RESOURCE, TYPE_WF_ENTRY, TYPE_WF_STEP, WORKFLOW_CURRENT_STEPS, WORKFLOW_CURRENT_STEPS_DV, WORKFLOW_ENTRY_STATE, WORKFLOW_HISTORY_STEPS, WORKFLOW_HISTORY_STEPS_DV, WORKFLOW_NAME, WORKFLOW_REF, WORKFLOW_REF_DV, WORKFLOW_STEP_ACTIONID, WORKFLOW_STEP_CALLER, WORKFLOW_STEP_DUEDATE, WORKFLOW_STEP_FINISHDATE, WORKFLOW_STEP_ID, WORKFLOW_STEP_OWNER, WORKFLOW_STEP_STARTDATE, WORKFLOW_STEP_STATUS
Fields inherited from interface org.ametys.web.indexing.solr.SolrWebFieldNames
ATTACHMENT_PAGE_ID, CONTENT_IDS, CONTENT_INTERESTING_DATES, DATE_FOR_SORTING, DATES_FACET, FACETABLE_CONTENT_FIELD_PREFIX, LASTNAME_FOR_SORTING, PAGE_ANCESTOR_IDS, PAGE_CONTENT_TYPES, PAGE_DEPTH, PAGE_IDS, PAGE_LONG_TITLE, PAGE_OUTGOING_REFEERENCES_RESOURCE_IDS, PAGE_PARENT_ID, PAGE_TITLE, PAGE_TYPE, PAGE_VISIBLE_ATTACHMENT_RESOURCE_IDS, SECTION_PAGE_TITLE, SERVICE_IDS, SHARED, SITE_NAME, SITE_TYPE, SITEMAP_NAME, TEMPLATE, TYPE_PAGE, TYPE_PAGE_RESOURCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Determines the search should be executed on subprogramsprotected void
addContentTypeQuery
(Collection<Query> queries, Request request) Add the content type queryvoid
generate()
getContentQueries
(Request request, Collection<String> siteNames, String language) Get the queries to be apply on joined contents ONLYprotected Collection<String>
getContentTypes
(Request request) Get the content type'sprotected FrontODFSearch.DisplaySubprogramMode
Get the display mode for subprogramsprotected Query
getQuery
(Request request, Collection<String> siteNames, String language) Get the query from request parametersprotected Query
getSubProgramPageQuery
(Query contentQuery) Get the page query to execute for subprogram's pagesgetSubProgramsMatchingSearch
(Request request, Collection<String> siteNames, String language) Get the ids of subprograms matching the current searchprotected void
SAX additional information on page hitprotected SearchResults<AmetysObject>
search
(Request request, Collection<String> siteNames, String language, int pageIndex, int start, int maxResults, boolean saxResults) Searchvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.web.frontoffice.SearchGenerator
_addAttributeFacet, _additionalSearchProcessing, _getStringAttributeQuery, addAllWordsTextFieldQuery, addAttributeQuery, addDateQuery, addExactWordingTextFieldQuery, addNoWordsTextFieldQuery, addPagesQuery, addTagsQuery, addTextFieldQuery, getContentResourcesOrAttachmentQueries, getContentTypeFilterValue, getContentTypeSearch, getContentValues, getDocumentTypes, getFacets, getFacetValues, getFields, getFilterQueries, getFixedCTypeFilterQueries, getPageQueries, getPageResourcesOrAttachmentQueries, getPrimarySortFields, getQueryFacets, getQueryFacetValues, getSortField, getWordingQueries, saxAttributeDefinition, saxEnumeratorValueForAttribute, saxFormFields, saxFormValues, saxHits, search
Methods inherited from class org.ametys.web.frontoffice.AbstractSearchGenerator
_checkRights, contextualize, getDocumentTypesQuery, getPageIndex, getSearchMode, getZoneItem, isInputValid, saxAdditionalInfos, saxContent, saxFacets, saxFormParameters, saxPageHit, saxPagination, saxResourceHit, saxRichTextExcerpt, saxServiceIdentifiers, saxSort, useFacets
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setup
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
Field Details
-
_matchingSubProgramIds
The matching subprograms
-
-
Constructor Details
-
FrontODFSearch
public FrontODFSearch()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classSearchGenerator
- Throws:
ServiceException
-
getContentTypes
Description copied from class:SearchGenerator
Get the content type's- Overrides:
getContentTypes
in classSearchGenerator
- Parameters:
request
- The request- Returns:
- the content type's
-
generate
- Specified by:
generate
in interfaceGenerator
- Overrides:
generate
in classAbstractSearchGenerator
- Throws:
IOException
SAXException
ProcessingException
-
getContentQueries
protected List<Query> getContentQueries(Request request, Collection<String> siteNames, String language) Description copied from class:SearchGenerator
Get the queries to be apply on joined contents ONLY- Overrides:
getContentQueries
in classSearchGenerator
- Parameters:
request
- the requestsiteNames
- the site nameslanguage
- the language- Returns:
- the queries for contents only
-
getQuery
protected Query getQuery(Request request, Collection<String> siteNames, String language) throws IllegalArgumentException Description copied from class:AbstractSearchGenerator
Get the query from request parameters- Overrides:
getQuery
in classSearchGenerator
- Parameters:
request
- The requestsiteNames
- The site names.language
- The language- Returns:
- The query object.
- Throws:
IllegalArgumentException
- If the search field is invalid.
-
search
protected SearchResults<AmetysObject> search(Request request, Collection<String> siteNames, String language, int pageIndex, int start, int maxResults, boolean saxResults) throws Exception Description copied from class:AbstractSearchGenerator
Search- Overrides:
search
in classAbstractSearchGenerator
- Parameters:
request
- the requestsiteNames
- The name of the sites to search inlanguage
- The language code to searchpageIndex
- the page indexstart
- The offset for search resultsmaxResults
- The maximum number of resultssaxResults
- false to not sax results- Returns:
- The search results
- Throws:
Exception
- If an error occurred during search
-
getSubProgramsMatchingSearch
protected List<String> getSubProgramsMatchingSearch(Request request, Collection<String> siteNames, String language) throws Exception Get the ids of subprograms matching the current search- Parameters:
request
- The requestsiteNames
- The site nameslanguage
- The languages- Returns:
- the ids of matching subprograms
- Throws:
Exception
- if failed to execute search
-
getSubProgramPageQuery
Get the page query to execute for subprogram's pages- Parameters:
contentQuery
- the initial content query- Returns:
- the page query for subprogram
-
saxAdditionalInfosOnPageHit
Description copied from class:AbstractSearchGenerator
SAX additional information on page hit- Overrides:
saxAdditionalInfosOnPageHit
in classAbstractSearchGenerator
- Parameters:
page
- the page- Throws:
SAXException
- if something goes wrong when saxing the information
-
getDisplaySubProgramMode
Get the display mode for subprograms- Returns:
- the display mode
-
_searchOnSubPrograms
Determines the search should be executed on subprograms- Returns:
- true to execute search also on subprograms
-
addContentTypeQuery
Description copied from class:SearchGenerator
Add the content type query- Overrides:
addContentTypeQuery
in classSearchGenerator
- Parameters:
queries
- The queriesrequest
- The request
-