public class SearchGenerator extends ServiceableGenerator implements Contextualizable
SearchAction
.Modifier and Type | Field and Description |
---|---|
protected ContentResultSetHelper |
_contentRSH
Helper for saxing result
|
protected Context |
_context
Context
|
protected SearchUIModelExtensionPoint |
_searchModelManager
The search model manager
|
protected ServerCommHelper |
_serverCommHelper
The server comm helper
|
protected ContentValuesExtractorFactory |
_valuesExtractorFactory
The content values extractor factory.
|
static String |
CONTENT_VERSION_LABEL
Constant for getting content in specific version label
|
manager
objectModel, parameters, resolver, source
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Constructor and Description |
---|
SearchGenerator() |
Modifier and Type | Method and Description |
---|---|
void |
contextualize(Context context) |
void |
generate() |
protected List<CriteriaSearchUIModelWrapper.Column> |
getColumnsFromParameters(Map<String,Object> jsParameters)
Get the columns from JS parameters
|
protected void |
saxContent(Content content,
Collection<? extends ResultField> resultFields,
Locale defaultLocale)
SAX the result content
|
protected void |
saxContents(SearchModel model,
SearchResults<Content> results,
Collection<? extends ResultField> resultFields,
String versionLabel,
Map<String,Object> jsParameters,
Locale defaultLocale)
Sax a set of contents
|
void |
service(ServiceManager smanager) |
protected boolean |
switchToLabel(Content content,
String label)
Switch to the revision corresponding to the specified label.
|
dispose
recycle, setup
setConsumer, setContentHandler, setLexicalHandler
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setConsumer
public static final String CONTENT_VERSION_LABEL
protected ServerCommHelper _serverCommHelper
protected ContentValuesExtractorFactory _valuesExtractorFactory
protected ContentResultSetHelper _contentRSH
protected SearchUIModelExtensionPoint _searchModelManager
public SearchGenerator()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableGenerator
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void generate() throws IOException, SAXException, ProcessingException
generate
in interface Generator
IOException
SAXException
ProcessingException
protected void saxContents(SearchModel model, SearchResults<Content> results, Collection<? extends ResultField> resultFields, String versionLabel, Map<String,Object> jsParameters, Locale defaultLocale) throws SAXException, AmetysRepositoryException, IOException, ProcessingException
model
- search modelresults
- contentsresultFields
- fields to retreiveversionLabel
- version labeljsParameters
- parameters of the searchdefaultLocale
- The locale to use for localized values if content's language is null.SAXException
- if a error occurred during saxAmetysRepositoryException
- if a error occurredIOException
- if a error occurredProcessingException
- if a error occurredprotected List<CriteriaSearchUIModelWrapper.Column> getColumnsFromParameters(Map<String,Object> jsParameters)
jsParameters
- The JS parametersprotected boolean switchToLabel(Content content, String label)
content
- The contentlabel
- the label to switch totrue
if a revision with this label exists and the content was switch, false
otherwise.protected void saxContent(Content content, Collection<? extends ResultField> resultFields, Locale defaultLocale) throws SAXException, AmetysRepositoryException, IOException
content
- the resultresultFields
- the result fieldsdefaultLocale
- The locale to use for localized values if content's language is null.SAXException
- if a error occurred during saxAmetysRepositoryException
- if a error occurredIOException
- if a error occurred