public class SearchGenerator extends AbstractSearchGenerator
AbstractSearchGenerator.Criterion
Modifier and Type | Field and Description |
---|---|
protected static String |
CONTENT_TYPE_CHOICE_CHECKBOX
Constants for content type's choice : checkbox then filter
|
protected static String |
CONTENT_TYPE_CHOICE_CHECKBOX_AND_FILTER
Constants for content type's choice : checkbox then filter
|
protected static String |
CONTENT_TYPE_CHOICE_FILTER
Constants for content type's choice : filter
|
protected static String |
CONTENT_TYPE_CHOICE_LIST
Constants for content type's choice : list
|
protected static String |
CONTENT_TYPE_CHOICE_NONE
Constants for content type's choice : none
|
_contentHelper, _contentTypesHelper, _context, _cTypeExtPt, _dcProvider, _metadataManager, _parser, _resolver, _searcherFactory, _siteManager, _tagExtPt, _TEXTFIELD_PATTERN, _uriResolverEP
manager
objectModel, parameters, resolver, source
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
ANCESTOR_IDS, CONTENT_IDS, CONTENT_INTERESTING_DATES, DATE_FOR_SORTING, DATES_FACET, LASTNAME_FOR_SORTING, LONG_TITLE, ORPHAN, PAGE_DEPTH, PAGE_ID, PAGE_IDS, PAGE_TYPE, PRIVACY, SECTION_PAGE_TITLE, SERVICE_IDS, SHARED, SITE_NAME, SITEMAP_NAME, TEMPLATE, TITLE, TITLE_FOR_SORTING, TYPE_PAGE, TYPE_PAGE_RESOURCE
ACL_READ_ALLOW_ANONYMOUS, ACL_READ_ALLOW_ANY_CONNECTED_USER, ACL_READ_ALLOWED_GROUPS, ACL_READ_ALLOWED_USERS, ACL_READ_DENIED_GROUPS, ACL_READ_DENIED_USERS, ALL_CONTENT_TYPES, ALL_MIXIN_TYPES, ALL_TAGS, CONTENT_COMMENTS, CONTENT_COMMENTS_NONVALIDATED, CONTENT_COMMENTS_VALIDATED, CONTENT_CREATOR, CONTENT_LANGUAGE, CONTENT_LANGUAGES, CONTENT_LAST_CONTRIBUTOR, CONTENT_NAME, CONTENT_TITLES, CONTENT_TYPE_RESOURCE, CONTENT_TYPES, 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, EXCERPT, FILENAME, FULL_EXACT_WS, FULL_GENERAL, FULL_PREFIX, FULL_STEMMED_PREFIX, ID, LAST_MAJOR_VALIDATION, LAST_MODIFIED, LAST_VALIDATION, LENGTH, MIME_TYPES, MIXIN_TYPES, PATH, REPEATER_ENTRY_POSITION, RESOURCE_CREATOR, RESOURCE_DATE, RESOURCE_LAST_MODIFIED, RESOURCE_ROOT_ID, SUB_CONTENT, TAGS, TITLE_SORT, TYPE_CONTENT, 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, WORKFLOW_STEP_ACTIONID, WORKFLOW_STEP_CALLER, WORKFLOW_STEP_DUEDATE, WORKFLOW_STEP_FINISHDATE, WORKFLOW_STEP_ID, WORKFLOW_STEP_OWNER, WORKFLOW_STEP_STARTDATE, WORKFLOW_STEP_STATUS
Constructor and Description |
---|
SearchGenerator() |
Modifier and Type | Method and Description |
---|---|
private void |
_addAllWordsTextFieldQuery(Collection<Query> queries,
String language,
Request request) |
private void |
_addContentTypeQuery(Collection<Query> queries,
Request request) |
private void |
_addDateQuery(Collection<Query> queries,
Request request) |
private void |
_addExactWordingTextFieldQuery(Collection<Query> queries,
String language,
Request request) |
private void |
_addNoWordsTextFieldQuery(Collection<Query> queries,
String language,
Request request) |
private void |
_addPagesQuery(Collection<Query> queries,
Request request) |
private void |
_addTagsQuery(Collection<Query> queries,
Request request) |
private void |
_addTextFieldQuery(Collection<Query> queries,
String language,
Request request) |
private String |
_escapeQueryCharsButNotQuotes(String text) |
private Set<String> |
_getAllContentTypes() |
private Collection<String> |
_getAvailableContentTypes() |
private void |
_saxAllWords(Request request) |
private void |
_saxContentType(Request request) |
private void |
_saxContentTypeCriteria() |
private void |
_saxDates(Request request) |
private void |
_saxExactWording(Request request) |
private void |
_saxMetadataCriteria(Request request) |
private void |
_saxMetadataValues(Request request) |
private void |
_saxMultisite(Request request) |
private void |
_saxNoWords(Request request) |
private void |
_saxPages(Request request) |
private void |
_saxSitemapCriteria() |
private void |
_saxTag(Tag tag,
boolean recursive) |
private void |
_saxTags(Request request) |
private void |
_saxTagsCriteria(String siteName) |
private void |
_saxTextField(Request request) |
private Date |
_toDate(String dateStr) |
protected void |
addMetadataQuery(Collection<Query> queries,
String language,
Request request)
Add query for each metadata
|
protected String |
getContentTypeFilterValue(Request request)
Get the content type's filter value
|
protected Collection<String> |
getContentTypes(Request request)
Get the content type's
|
protected Map<String,AbstractSearchGenerator.Criterion> |
getCriteria(Request request,
String siteName,
String lang)
Get the criteria with their value list.
|
protected Collection<String> |
getDocumentTypes(Request request)
Get the document types.
|
protected Collection<String> |
getFields()
Get the searchable fields
|
protected Collection<Query> |
getFilterQueries(Request request,
Collection<String> siteNames,
String language)
Get the filter queries from the request parameters.
|
protected Collection<Query> |
getFixedCTypeFilterQueries(Request request,
String cType,
Collection<String> siteNames,
String language)
Get the filter queries for a single fixed content type.
|
protected List<Sort> |
getPrimarySortFields(Request request)
Get the primary sort fields
|
protected Query |
getQuery(Request request,
Collection<String> siteNames,
String language)
Get the query from request parameters
|
protected Sort |
getSortField(Request request)
Get the sort field
|
protected void |
saxEnumeratorValueForMetadata(MetadataDefinition metadataDef,
String metadataPath)
Sax enumeration value for enum metadata
|
protected void |
saxFormFields(Request request,
SearchResults<AmetysObject> searchResults,
String siteName,
String lang)
SAX the form search criteria
|
protected void |
saxFormValues(Request request,
SearchResults<AmetysObject> searchResults,
int start,
int offset)
SAX the form search criteria values
|
protected void |
saxHits(SearchResults<AmetysObject> results,
int start,
int maxResults)
SAX the result hits
|
protected void |
saxMetadataDef(MetadataDefinition metadataDef,
String metadataPath)
Sax metadata set information for metadata
|
protected SearchResults<AmetysObject> |
search(Request request,
Collection<String> siteNames,
String language,
int pageIndex,
int start,
int maxResults)
Search
|
_additionalSearchProcessing, contextualize, generate, getCriteriaValues, getDocumentTypesQuery, getPageIndex, getSearchMode, isInputValid, saxAdditionalInfos, saxAdditionalInfosOnPageHit, saxContent, saxCriteria, saxCriterion, saxFormParameters, saxPageHit, saxPagination, saxResourceHit, saxServiceIdentifiers, search, service
dispose
recycle, setup
setConsumer, setContentHandler, setLexicalHandler
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setConsumer
protected static final String CONTENT_TYPE_CHOICE_FILTER
protected static final String CONTENT_TYPE_CHOICE_LIST
protected static final String CONTENT_TYPE_CHOICE_CHECKBOX
protected static final String CONTENT_TYPE_CHOICE_CHECKBOX_AND_FILTER
protected static final String CONTENT_TYPE_CHOICE_NONE
public SearchGenerator()
protected SearchResults<AmetysObject> search(Request request, Collection<String> siteNames, String language, int pageIndex, int start, int maxResults) throws Exception
AbstractSearchGenerator
search
in class AbstractSearchGenerator
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 resultsException
- If an error occurred during searchprotected Query getQuery(Request request, Collection<String> siteNames, String language) throws IllegalArgumentException
AbstractSearchGenerator
getQuery
in class AbstractSearchGenerator
request
- The requestsiteNames
- The site names.language
- The languageIllegalArgumentException
- If the search field is invalid.protected Collection<Query> getFilterQueries(Request request, Collection<String> siteNames, String language) throws IllegalArgumentException
AbstractSearchGenerator
getFilterQueries
in class AbstractSearchGenerator
request
- The request.siteNames
- The site names.language
- The language.IllegalArgumentException
- If a search field is invalid.protected Collection<Query> getFixedCTypeFilterQueries(Request request, String cType, Collection<String> siteNames, String language)
request
- The request.cType
- The fixed content type.siteNames
- the site names.language
- The language.protected Collection<String> getDocumentTypes(Request request)
AbstractSearchGenerator
getDocumentTypes
in class AbstractSearchGenerator
request
- The request.protected Collection<String> getFields()
AbstractSearchGenerator
getFields
in class AbstractSearchGenerator
protected Map<String,AbstractSearchGenerator.Criterion> getCriteria(Request request, String siteName, String lang)
AbstractSearchGenerator
getCriteria
in class AbstractSearchGenerator
request
- the request.siteName
- the site name.lang
- the languageprotected void saxHits(SearchResults<AmetysObject> results, int start, int maxResults) throws SAXException, IOException
AbstractSearchGenerator
saxHits
in class AbstractSearchGenerator
results
- The search results.start
- The start indexmaxResults
- The number of results to generate.SAXException
- If an error occurs while SAXingIOException
- If there is a low-level IO errorprotected Sort getSortField(Request request)
AbstractSearchGenerator
getSortField
in class AbstractSearchGenerator
request
- The requestprotected List<Sort> getPrimarySortFields(Request request)
AbstractSearchGenerator
getPrimarySortFields
in class AbstractSearchGenerator
request
- The requestprotected void saxFormFields(Request request, SearchResults<AmetysObject> searchResults, String siteName, String lang) throws SAXException
AbstractSearchGenerator
saxFormFields
in class AbstractSearchGenerator
request
- The requestsearchResults
- The search resultssiteName
- The current site namelang
- The current languageSAXException
- if an error occurs while SAXingprivate void _saxMetadataCriteria(Request request) throws SAXException
SAXException
protected void saxMetadataDef(MetadataDefinition metadataDef, String metadataPath) throws SAXException
metadataDef
- The metadata definition.metadataPath
- The metadata pathSAXException
- If an error occurred while saxingprotected void saxEnumeratorValueForMetadata(MetadataDefinition metadataDef, String metadataPath) throws SAXException
metadataDef
- The metadata definition.metadataPath
- The metadata pathSAXException
- If an error occurred while saxingprotected void saxFormValues(Request request, SearchResults<AmetysObject> searchResults, int start, int offset) throws SAXException
AbstractSearchGenerator
saxFormValues
in class AbstractSearchGenerator
request
- The requestsearchResults
- The search resultsstart
- The start indexoffset
- The number of resultsSAXException
- if an error occurs while SAXingprivate void _saxDates(Request request) throws SAXException
SAXException
private void _saxTextField(Request request) throws SAXException
SAXException
private void _saxMetadataValues(Request request) throws SAXException
SAXException
private void _saxAllWords(Request request) throws SAXException
SAXException
private void _saxExactWording(Request request) throws SAXException
SAXException
private void _saxNoWords(Request request) throws SAXException
SAXException
private void _saxContentType(Request request) throws SAXException
SAXException
private void _saxTags(Request request) throws SAXException
SAXException
private void _saxPages(Request request) throws SAXException
SAXException
private void _saxMultisite(Request request) throws SAXException
SAXException
protected Collection<String> getContentTypes(Request request)
request
- The requestprivate Collection<String> _getAvailableContentTypes()
private Set<String> _getAllContentTypes()
private void _saxContentTypeCriteria() throws SAXException
SAXException
private void _saxTagsCriteria(String siteName) throws SAXException
SAXException
private void _saxTag(Tag tag, boolean recursive) throws SAXException
SAXException
private void _saxSitemapCriteria() throws SAXException
SAXException
protected String getContentTypeFilterValue(Request request)
request
- The requestprivate void _addTextFieldQuery(Collection<Query> queries, String language, Request request) throws IllegalArgumentException
IllegalArgumentException
private String _escapeQueryCharsButNotQuotes(String text)
protected void addMetadataQuery(Collection<Query> queries, String language, Request request) throws IllegalArgumentException
queries
- The list of querylanguage
- The langrequest
- The requestIllegalArgumentException
- If an error occurredprivate void _addAllWordsTextFieldQuery(Collection<Query> queries, String language, Request request) throws IllegalArgumentException
IllegalArgumentException
private void _addExactWordingTextFieldQuery(Collection<Query> queries, String language, Request request) throws IllegalArgumentException
IllegalArgumentException
private void _addNoWordsTextFieldQuery(Collection<Query> queries, String language, Request request) throws IllegalArgumentException
IllegalArgumentException
private void _addContentTypeQuery(Collection<Query> queries, Request request)
private void _addTagsQuery(Collection<Query> queries, Request request)
private void _addPagesQuery(Collection<Query> queries, Request request)
private void _addDateQuery(Collection<Query> queries, Request request)