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
Modifier and TypeFieldDescriptionprotected Context
The avalon context.protected Logger
The loggerprotected String
The plugin name.protected QueryDao
The Query DAO.static final String
The Avalon role.Fields inherited from class org.ametys.cms.transformation.AbstractEnhancementHandler
_contentHandler, _inUnmodifiableContent, _lexicalHandler, PROCESSING_INSTRUCTION_UNMODIFIABLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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) 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
ROLE
The Avalon role. -
_queryDao
The Query DAO. -
_context
The avalon context. -
_pluginName
The plugin name. -
_logger
The logger
-
-
Constructor Details
-
DataInclusionEnhancementHandler
public DataInclusionEnhancementHandler()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
setPluginInfo
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
- 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
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classAbstractEnhancementHandler
- Throws:
SAXException
-
_saxResult
Sax a query result.- Parameters:
query
- the query.result
- the result to generate.- Throws:
SAXException
- if an error occurs while saxing
-
_saxSingleResult
Sax a single query result.- Parameters:
query
- the queryresult
- the query's result- Throws:
SAXException
- if an error occurs while saxing
-
getParameters
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.
-