org.ametys.plugins.datainclusion.transformation
Class DataInclusionEnhancementHandler

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.ametys.cms.transformation.EnhancementHandler
          extended by org.ametys.plugins.datainclusion.transformation.DataInclusionEnhancementHandler
All Implemented Interfaces:
org.ametys.runtime.plugin.component.PluginAware, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, ContentHandler, LexicalHandler

public class DataInclusionEnhancementHandler
extends org.ametys.cms.transformation.EnhancementHandler
implements org.apache.avalon.framework.component.Component, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.context.Contextualizable, org.ametys.runtime.plugin.component.PluginAware

DataInclusion enhancement handler : transform a query tag into its results.


Field Summary
protected  org.apache.avalon.framework.context.Context _context
          The avalon context.
protected  org.apache.avalon.framework.logger.Logger _logger
          The logger
protected  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.EnhancementHandler
_contentHandler, _inUnmodifiableContent, _lexicalHandler, PROCESSING_INSTRUCTION_UNMODIFIABLE
 
Constructor Summary
DataInclusionEnhancementHandler()
           
 
Method Summary
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(org.apache.avalon.framework.context.Context context)
           
 void enableLogging(org.apache.avalon.framework.logger.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(org.apache.avalon.framework.service.ServiceManager serviceManager)
           
 void setPluginInfo(String pluginName, String featureName)
           
 void startElement(String uri, String localName, String qName, Attributes atts)
           
 
Methods inherited from class org.ametys.cms.transformation.EnhancementHandler
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
 

Field Detail

ROLE

public static final String ROLE
The Avalon role.


_queryDao

protected QueryDao _queryDao
The Query DAO.


_context

protected org.apache.avalon.framework.context.Context _context
The avalon context.


_pluginName

protected String _pluginName
The plugin name.


_logger

protected org.apache.avalon.framework.logger.Logger _logger
The logger

Constructor Detail

DataInclusionEnhancementHandler

public DataInclusionEnhancementHandler()
Method Detail

service

public void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Throws:
org.apache.avalon.framework.context.ContextException

setPluginInfo

public void setPluginInfo(String pluginName,
                          String featureName)
Specified by:
setPluginInfo in interface org.ametys.runtime.plugin.component.PluginAware

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled
Overrides:
enableLogging in class org.apache.avalon.framework.logger.AbstractLogEnabled

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes atts)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class org.ametys.cms.transformation.EnhancementHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class org.ametys.cms.transformation.EnhancementHandler
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

_saxSingleResult

protected void _saxSingleResult(Query query,
                                QueryResult result)
                         throws SAXException
Sax a single query result.

Parameters:
query -
result -
Throws:
SAXException

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.


Copyright © 2010 Anyware Services. All Rights Reserved.