org.apache.lenya.cms.cocoon.transformation
Class MetaDataTransformer

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.xml.AbstractXMLPipe
              extended by org.apache.cocoon.transformation.AbstractTransformer
                  extended by org.apache.cocoon.transformation.AbstractSAXTransformer
                      extended by org.apache.lenya.cms.cocoon.transformation.MetaDataTransformer
All Implemented Interfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.transformation.Transformer, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer, org.apache.excalibur.xml.sax.XMLConsumer, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler

public class MetaDataTransformer
extends org.apache.cocoon.transformation.AbstractSAXTransformer
implements org.apache.avalon.framework.activity.Disposable

Meta data transformer.


Field Summary
protected  java.lang.String area
           
static java.lang.String ELEMENT_ATT
          ELEMENT_ATT - which meta data key do we want to look up
static java.lang.String LANG_ATT
          LANG_ATT - in which language this is optional (when not found use publication default)
protected  java.lang.String language
           
static java.lang.String NAMESPACE_URI
          The namespace for the meta data is http://apache.org/lenya/meta/1.0
static java.lang.String NS_ATT
          NS_ATT - in which namespace should we look
static java.lang.String PREFIX
          The namespace prefix for this namespace.
protected  Publication pub
           
protected  java.lang.String publicationId
          Helper for lenya document retrival
protected  java.lang.String uuid
           
static java.lang.String UUID_ATT
          UUID_ATT - for which uuid?
static java.lang.String VALUE_ELEMENT
          The value element is getting the value for a specific ns and key.
 
Fields inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
context, defaultNamespaceURI, EMPTY_ATTRIBUTES, emptyAttributes, ignoreEmptyCharacters, ignoreEventsCount, ignoreHooksCount, ignoreWhitespaces, manager, namespaceURI, objectModel, parameters, recorderStack, request, resolver, response, source, stack
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.transformation.Transformer
ROLE
 
Constructor Summary
MetaDataTransformer()
           
 
Method Summary
 void endElement(java.lang.String uri, java.lang.String name, java.lang.String raw)
           
 void setup(org.apache.cocoon.environment.SourceResolver resolver, java.util.Map objectModel, java.lang.String src, org.apache.avalon.framework.parameters.Parameters par)
          Setup the MetaDataTransformer.
 void startElement(java.lang.String uri, java.lang.String name, java.lang.String raw, org.xml.sax.Attributes attr)
           
 
Methods inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
addRecorder, characters, comment, configure, dispose, endCDATA, endDocument, endDTD, endEntity, endParametersRecording, endParametersRecording, endPrefixMapping, endRecording, endSAXRecording, endSerializedXMLRecording, endTextRecording, endTransformingElement, findPrefixMapping, getMutableAttributes, ignorableWhitespace, processingInstruction, recycle, removeRecorder, sendEndElementEvent, sendEndElementEventNS, sendEndPrefixMapping, sendEvents, sendParametersEvents, sendStartElementEvent, sendStartElementEvent, sendStartElementEventNS, sendStartElementEventNS, sendStartPrefixMapping, sendTextEvent, service, setDocumentLocator, setupTransforming, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startParametersRecording, startPrefixMapping, startRecording, startSAXRecording, startSerializedXMLRecording, startTextRecording, startTransformingElement
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, 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.apache.avalon.framework.activity.Disposable
dispose
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

NAMESPACE_URI

public static final java.lang.String NAMESPACE_URI
The namespace for the meta data is http://apache.org/lenya/meta/1.0

See Also:
Constant Field Values

PREFIX

public static final java.lang.String PREFIX
The namespace prefix for this namespace.

See Also:
Constant Field Values

VALUE_ELEMENT

public static final java.lang.String VALUE_ELEMENT
The value element is getting the value for a specific ns and key. It is the only method implemented so far.

See Also:
Constant Field Values

ELEMENT_ATT

public static final java.lang.String ELEMENT_ATT
ELEMENT_ATT - which meta data key do we want to look up

See Also:
Constant Field Values

NS_ATT

public static final java.lang.String NS_ATT
NS_ATT - in which namespace should we look

See Also:
Constant Field Values

UUID_ATT

public static final java.lang.String UUID_ATT
UUID_ATT - for which uuid?

See Also:
Constant Field Values

LANG_ATT

public static final java.lang.String LANG_ATT
LANG_ATT - in which language this is optional (when not found use publication default)

See Also:
Constant Field Values

publicationId

protected java.lang.String publicationId
Helper for lenya document retrival


area

protected java.lang.String area

language

protected java.lang.String language

uuid

protected java.lang.String uuid

pub

protected Publication pub
Constructor Detail

MetaDataTransformer

public MetaDataTransformer()
Method Detail

setup

public void setup(org.apache.cocoon.environment.SourceResolver resolver,
                  java.util.Map objectModel,
                  java.lang.String src,
                  org.apache.avalon.framework.parameters.Parameters par)
           throws org.apache.cocoon.ProcessingException,
                  org.xml.sax.SAXException,
                  java.io.IOException
Setup the MetaDataTransformer.

Specified by:
setup in interface org.apache.cocoon.sitemap.SitemapModelComponent
Overrides:
setup in class org.apache.cocoon.transformation.AbstractSAXTransformer
Throws:
org.apache.cocoon.ProcessingException
org.xml.sax.SAXException
java.io.IOException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String name,
                         java.lang.String raw,
                         org.xml.sax.Attributes attr)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.apache.cocoon.transformation.AbstractSAXTransformer
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String name,
                       java.lang.String raw)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.apache.cocoon.transformation.AbstractSAXTransformer
Throws:
org.xml.sax.SAXException


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.