Class DataInclusionEnhancementHandler
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.cms.transformation.AbstractEnhancementHandler
-
- org.ametys.plugins.externaldata.transformation.DataInclusionEnhancementHandler
-
- All Implemented Interfaces:
PluginAware
,Component
,Contextualizable
,LogEnabled
,Serviceable
,ContentHandler
,LexicalHandler
public class DataInclusionEnhancementHandler extends AbstractEnhancementHandler implements Component, Serviceable, Contextualizable, PluginAware
DataInclusion enhancement handler : transform a query tag into its results.
-
-
Field Summary
Fields Modifier and Type Field Description protected Context
_context
The avalon context.protected Logger
_logger
The loggerprotected String
_pluginName
The plugin name.protected QueryDao
_queryDao
The Query DAO.static String
ROLE
The Avalon role.-
Fields inherited from class org.ametys.cms.transformation.AbstractEnhancementHandler
_contentHandler, _inUnmodifiableContent, _lexicalHandler, PROCESSING_INSTRUCTION_UNMODIFIABLE
-
-
Constructor Summary
Constructors Constructor Description DataInclusionEnhancementHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_saxResult(Query query, QueryResult result)
Sax a query result.protected void
_saxSingleResult(Query query, QueryResult result)
Sax a single query result.void
contextualize(Context context)
void
enableLogging(Logger logger)
void
endElement(String uri, String localName, String qName)
protected Map<String,String>
getParameters(Query query, Attributes atts)
Get the query parameter values from the query node attributes.void
service(ServiceManager serviceManager)
void
setPluginInfo(String pluginName, String featureName, String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.void
startElement(String uri, String localName, String qName, Attributes atts)
-
Methods inherited from class org.ametys.cms.transformation.AbstractEnhancementHandler
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, saxError, setContentHandler, setDocumentLocator, setLexicalHandler, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
DataInclusionEnhancementHandler
public DataInclusionEnhancementHandler()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
enableLogging
public void enableLogging(Logger logger)
- Specified by:
enableLogging
in interfaceLogEnabled
- Overrides:
enableLogging
in classAbstractLogEnabled
-
startElement
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classAbstractEnhancementHandler
- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classAbstractEnhancementHandler
- Throws:
SAXException
-
_saxResult
protected void _saxResult(Query query, QueryResult result) throws SAXException
Sax a query result.- Parameters:
query
- the query.result
- the result to generate.- Throws:
SAXException
- if an error occurs while saxing
-
_saxSingleResult
protected void _saxSingleResult(Query query, QueryResult result) throws SAXException
Sax a single query result.- Parameters:
query
- the queryresult
- the query's result- Throws:
SAXException
- if an error occurs while saxing
-
getParameters
protected Map<String,String> getParameters(Query query, Attributes atts)
Get the query parameter values from the query node attributes.- Parameters:
query
- the query.atts
- the query node attributes.- Returns:
- the parameters as a Map of parameter name -> value.
-
-