org.dspace.app.xmlui.aspect.general
Class PageNotFoundTransformer

java.lang.Object
  extended by org.apache.cocoon.util.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.dspace.app.xmlui.wing.AbstractWingTransformer
                      extended by org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer
                          extended by org.dspace.app.xmlui.aspect.general.PageNotFoundTransformer
All Implemented Interfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.cocoon.caching.CacheableProcessingComponent, 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, DSpaceTransformer, WingTransformer, ContentHandler, LexicalHandler

public class PageNotFoundTransformer
extends AbstractDSpaceTransformer
implements org.apache.cocoon.caching.CacheableProcessingComponent

This special comonent checks to see if the body element is empty (has no sub elements) and if it is then displays some page not found text.

Author:
Scott Phillips, Kim Shepherd

Field Summary
 
Fields inherited from class org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer
context, contextPath, eperson, knot, objectModel, parameters, servletPath, sitemapURI, url
 
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
PageNotFoundTransformer()
           
 
Method Summary
 void addBody(Body body)
          What to add at the end of the body
 void addPageMeta(PageMeta pageMeta)
          What page metadata to add to the document
 void endElement(String namespaceURI, String localName, String qName)
          Process the SAX event.
 Serializable getKey()
          Generate the unique caching key.
 org.apache.excalibur.source.SourceValidity getValidity()
          Generate the cache validity object.
 void sendEvent(org.dspace.app.xmlui.aspect.general.PageNotFoundTransformer.SAXEvent event)
          Send the given recorded sax event.
 void startDocument()
          Receive notification of the beginning of a document.
 void startElement(String namespaceURI, String localName, String qName, Attributes attributes)
          Process the SAX event.
 
Methods inherited from class org.dspace.app.xmlui.cocoon.AbstractDSpaceTransformer
addOptions, addUserMeta, decodeFromURL, dispose, encodeForURL, generateURL, getComponentName, getObjectManager, handleException, recycle, setup
 
Methods inherited from class org.dspace.app.xmlui.wing.AbstractWingTransformer
createWingDocument, endDocument, endPrefixMapping, getDefaultMessageCatalogue, message, message, setupWing, startPrefixMapping
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDTD, endEntity, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDTD, startEntity
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
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
characters, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Constructor Detail

PageNotFoundTransformer

public PageNotFoundTransformer()
Method Detail

getKey

public Serializable getKey()
Generate the unique caching key. This key must be unique inside the space of this component.

Specified by:
getKey in interface org.apache.cocoon.caching.CacheableProcessingComponent

getValidity

public org.apache.excalibur.source.SourceValidity getValidity()
Generate the cache validity object. The cache is always valid.

Specified by:
getValidity in interface org.apache.cocoon.caching.CacheableProcessingComponent

startDocument

public void startDocument()
                   throws SAXException
Receive notification of the beginning of a document.

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class AbstractWingTransformer
Throws:
SAXException

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Process the SAX event.

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

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException
Process the SAX event.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class AbstractWingTransformer
Throws:
SAXException
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

addBody

public void addBody(Body body)
             throws SAXException,
                    WingException,
                    UIException,
                    SQLException,
                    IOException,
                    AuthorizeException,
                    org.apache.cocoon.ResourceNotFoundException
What to add at the end of the body

Specified by:
addBody in interface DSpaceTransformer
Specified by:
addBody in interface WingTransformer
Overrides:
addBody in class AbstractDSpaceTransformer
Throws:
SAXException
WingException
UIException
SQLException
IOException
AuthorizeException
org.apache.cocoon.ResourceNotFoundException

addPageMeta

public void addPageMeta(PageMeta pageMeta)
                 throws SAXException,
                        WingException,
                        UIException,
                        SQLException,
                        IOException,
                        AuthorizeException
What page metadata to add to the document

Specified by:
addPageMeta in interface DSpaceTransformer
Specified by:
addPageMeta in interface WingTransformer
Overrides:
addPageMeta in class AbstractDSpaceTransformer
Throws:
SAXException
WingException
UIException
SQLException
IOException
AuthorizeException

sendEvent

public void sendEvent(org.dspace.app.xmlui.aspect.general.PageNotFoundTransformer.SAXEvent event)
               throws SAXException
Send the given recorded sax event.

Throws:
SAXException


Copyright © 2012 DuraSpace. All Rights Reserved.