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

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.AccessControlSitetreeTransformer
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 AccessControlSitetreeTransformer
extends org.apache.cocoon.transformation.AbstractSAXTransformer
implements org.apache.avalon.framework.activity.Disposable

This transformer is applied to the sitetree. It marks the site element and all node elements the current identity is not allowed to access with a protected="true" attribute.


Field Summary
static java.lang.String ATTRIBUTE_PROTECTED
          ATTRIBUTE_PROTECTED The attribute for protected
static java.lang.String PARAMETER_AREA
          PARAMETER_AREA The area parameter
static java.lang.String PARAMETER_PUBLICATION_ID
          PARAMETER_PUBLICATION_ID The publication id parameter
 
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
AccessControlSitetreeTransformer()
           
 
Method Summary
 void dispose()
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String raw)
           
protected  boolean isFragmentNode(java.lang.String uri, java.lang.String localName)
          Returns if an element represents a fragment node.
protected  boolean isNode(java.lang.String uri, java.lang.String localName)
          Returns if an element represents a sitetree node.
 void setup(org.apache.cocoon.environment.SourceResolver _resolver, java.util.Map _objectModel, java.lang.String src, org.apache.avalon.framework.parameters.Parameters par)
           
 void startDocument()
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String raw, org.xml.sax.Attributes attr)
          (non-Javadoc)
 
Methods inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer
addRecorder, characters, comment, configure, 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, 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.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

ATTRIBUTE_PROTECTED

public static final java.lang.String ATTRIBUTE_PROTECTED
ATTRIBUTE_PROTECTED The attribute for protected

See Also:
Constant Field Values

PARAMETER_PUBLICATION_ID

public static final java.lang.String PARAMETER_PUBLICATION_ID
PARAMETER_PUBLICATION_ID The publication id parameter

See Also:
Constant Field Values

PARAMETER_AREA

public static final java.lang.String PARAMETER_AREA
PARAMETER_AREA The area parameter

See Also:
Constant Field Values
Constructor Detail

AccessControlSitetreeTransformer

public AccessControlSitetreeTransformer()
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
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
See Also:
SitemapModelComponent.setup(org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)

dispose

public void dispose()
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable
Overrides:
dispose in class org.apache.cocoon.transformation.AbstractSAXTransformer
See Also:
Disposable.dispose()

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.apache.cocoon.transformation.AbstractSAXTransformer
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.startDocument()

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String raw,
                         org.xml.sax.Attributes attr)
                  throws org.xml.sax.SAXException
(non-Javadoc)

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.apache.cocoon.transformation.AbstractSAXTransformer
Throws:
org.xml.sax.SAXException
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       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
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

isNode

protected boolean isNode(java.lang.String uri,
                         java.lang.String localName)
Returns if an element represents a sitetree node.

Parameters:
uri - The namespace URI.
localName - The local name.
Returns:
A boolean value.

isFragmentNode

protected boolean isFragmentNode(java.lang.String uri,
                                 java.lang.String localName)
Returns if an element represents a fragment node.

Parameters:
uri - The namespace URI.
localName - The local name.
Returns:
A boolean value.


Copyright $ Apache Software Foundation. All Rights Reserved.