public class SearchServiceGenerator extends ServiceableGenerator
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
SearchServiceGenerator.SearchComponentError |
managerobjectModel, parameters, resolver, sourcecontentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer| Constructor and Description |
|---|
SearchServiceGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected SearchComponentArguments |
_buildArguments(Request request)
Builds
SearchComponentArguments |
protected int |
_computeResultsPerPage(SearchServiceInstance serviceInstance)
Computes the number of results per page
|
protected int |
_computeStartIndex(int pageIndex,
SearchServiceInstance serviceInstance)
Computes the start index (i.e.
|
protected SearchServiceDebugModeHelper.DebugMode |
_debugMode(Request request)
Gets the debug mode if activated
|
protected String |
_getRequestIdentifier(Request request)
Gets the identifier of the request for display debug purposes only
|
protected void |
_handleErrors(List<SearchServiceGenerator.SearchComponentError> errors)
Handles errors of
SearchComponents |
protected boolean |
_inputValid(Request request,
SearchServiceInstance serviceInstance,
SearchServiceDebugModeHelper.DebugMode debugMode)
Checks if inputs are valid
|
protected boolean |
_isFormSubmitted(Request request)
Checks if the form was submitted
|
protected Optional<Integer> |
_resultsPerPage(SearchServiceInstance serviceInstance)
Gets the number of results per page
|
protected String |
_retrieveCurrentLang(Request request,
Page page)
Retrieves the current lang
|
protected Page |
_retrieveCurrentPage(Request request,
String zoneItemId)
Retrieves the current page
|
protected Site |
_retrieveCurrentSite(Request request,
Page page)
Retrieves the current site
|
protected int |
_retrievePageIndex(Request request)
Retrieves the current page index of the search
|
protected String |
_retrieveZoneItemId(Request request)
Retrieves the current zone item id
|
void |
enableLogging(Logger logger) |
void |
generate() |
protected SearchServiceInstance |
getInstance(Request request,
String zoneItemId)
Gets the
SearchServiceInstance being processed |
void |
service(ServiceManager smanager) |
void |
setup(SourceResolver sourceResolver,
Map objModel,
String src,
Parameters par) |
disposerecyclesetConsumer, setContentHandler, setLexicalHandlergetLogger, setupLogger, setupLogger, setupLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetConsumerstatic final String __ZONE_ITEM_REQUEST_PARAM_NAME
static final String __ZONE_ITEM_GENERATOR_PARAM_NAME
static final String __PAGINATION_GENERATOR_PARAM_NAME
static final String __SUBMIT_FORM_PARAM_NAME
protected SearchServiceInstanceManager _searchServiceInstanceManager
SearchServiceInstancesprotected SearchService _searchService
Serviceprotected SiteManager _siteManager
protected SearcherFactory _searcherFactory
protected SearchComponentExtensionPoint _searchComponentEP
SearchComponentsprotected RenderingContextHandler _renderingContextHandler
protected AmetysObjectResolver _ametysObjectResolver
protected SearchUserInputsRetriever _searchUserInputsRetriever
protected SearchServiceRequestAttributeSetter _requestAttributeSetter
public SearchServiceGenerator()
public void enableLogging(Logger logger)
enableLogging in interface LogEnabledenableLogging in class AbstractLogEnabledpublic void service(ServiceManager smanager) throws ServiceException
service in interface Serviceableservice in class ServiceableGeneratorServiceExceptionpublic void setup(SourceResolver sourceResolver, Map objModel, String src, Parameters par) throws ProcessingException, SAXException, IOException
setup in interface SitemapModelComponentsetup in class AbstractGeneratorProcessingExceptionSAXExceptionIOExceptionprotected SearchComponentArguments _buildArguments(Request request) throws ProcessingException
SearchComponentArgumentsrequest - The requestSearchComponentArgumentsProcessingException - If an error occured when processing the requestpublic void generate() throws IOException, SAXException, ProcessingException
protected String _retrieveZoneItemId(Request request)
request - the requestprotected SearchServiceInstance getInstance(Request request, String zoneItemId)
SearchServiceInstance being processedrequest - the requestzoneItemId - The zone item idSearchServiceInstance being processedprotected int _retrievePageIndex(Request request) throws ProcessingException
request - the requestProcessingException - If an error occured when retrieving the page indexprotected Optional<Integer> _resultsPerPage(SearchServiceInstance serviceInstance)
serviceInstance - the search service instanceprotected int _computeStartIndex(int pageIndex, SearchServiceInstance serviceInstance)
pageIndex - the page indexserviceInstance - the search service instanceprotected int _computeResultsPerPage(SearchServiceInstance serviceInstance)
serviceInstance - the search service instanceprotected Page _retrieveCurrentPage(Request request, String zoneItemId)
request - the requestzoneItemId - The zone item idprotected Site _retrieveCurrentSite(Request request, Page page)
request - the requestpage - the pageprotected String _retrieveCurrentLang(Request request, Page page)
request - the requestpage - the pageprotected boolean _isFormSubmitted(Request request)
request - The requesttrue if the form was submittedprotected boolean _inputValid(Request request, SearchServiceInstance serviceInstance, SearchServiceDebugModeHelper.DebugMode debugMode)
request - The requestserviceInstance - The service instance being processeddebugMode - The debug modetrue if inputs are validprotected SearchServiceDebugModeHelper.DebugMode _debugMode(Request request)
request - The requestprotected String _getRequestIdentifier(Request request)
request - the requestprotected void _handleErrors(List<SearchServiceGenerator.SearchComponentError> errors) throws ProcessingException
SearchComponentserrors - The errorsProcessingException - if the SearchServiceGenerator.SearchComponentErrors lead to a need to throw an exception