org.apache.cocoon.generation
Class BlogGenerator

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.generation.AbstractGenerator
              extended by org.apache.cocoon.generation.ServiceableGenerator
                  extended by org.apache.cocoon.generation.BlogGenerator
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.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.generation.Generator, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.xml.XMLProducer

public class BlogGenerator
extends org.apache.cocoon.generation.ServiceableGenerator

Blog entry generator


Field Summary
protected  java.lang.String area
          The Lenya-Area where the generator should work on
protected  org.xml.sax.helpers.AttributesImpl attributes
          Convenience object, so we don't need to create an AttributesImpl for every element.
protected static java.lang.String BLOG_NODE_NAME
          Node and attribute names
protected static java.lang.String ENTRY_NODE_NAME
           
protected static java.lang.String LASTMOD_ATTR_NAME
           
protected  int numrecent
          Only generate the #numrecent entries
protected static java.lang.String PATH_ATTR_NAME
           
protected static java.lang.String PREFIX
          The namespace prefix for this namespace.
protected  boolean recent
           
protected static java.lang.String URI
          The URI of the namespace of this generator.
 
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
 
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.generation.Generator
ROLE
 
Constructor Summary
BlogGenerator()
           
 
Method Summary
 void generate()
          Generate XML data.
 void setup(org.apache.cocoon.environment.SourceResolver resolver, java.util.Map objectModel, java.lang.String src, org.apache.avalon.framework.parameters.Parameters par)
          Set the request parameters.
 
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose, service
 
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle
 
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

URI

protected static final java.lang.String URI
The URI of the namespace of this generator.

See Also:
Constant Field Values

PREFIX

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

See Also:
Constant Field Values

BLOG_NODE_NAME

protected static final java.lang.String BLOG_NODE_NAME
Node and attribute names

See Also:
Constant Field Values

ENTRY_NODE_NAME

protected static final java.lang.String ENTRY_NODE_NAME
See Also:
Constant Field Values

PATH_ATTR_NAME

protected static final java.lang.String PATH_ATTR_NAME
See Also:
Constant Field Values

LASTMOD_ATTR_NAME

protected static final java.lang.String LASTMOD_ATTR_NAME
See Also:
Constant Field Values

attributes

protected org.xml.sax.helpers.AttributesImpl attributes
Convenience object, so we don't need to create an AttributesImpl for every element.


area

protected java.lang.String area
The Lenya-Area where the generator should work on


recent

protected boolean recent

numrecent

protected int numrecent
Only generate the #numrecent entries

Constructor Detail

BlogGenerator

public BlogGenerator()
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
Set the request parameters. Must be called before the generate method.

Specified by:
setup in interface org.apache.cocoon.sitemap.SitemapModelComponent
Overrides:
setup in class org.apache.cocoon.generation.AbstractGenerator
Parameters:
resolver - the SourceResolver object
objectModel - a Map containing model object
src - the source URI (ignored)
par - configuration parameters
Throws:
org.apache.cocoon.ProcessingException
org.xml.sax.SAXException
java.io.IOException

generate

public void generate()
              throws org.xml.sax.SAXException,
                     org.apache.cocoon.ProcessingException
Generate XML data.

Throws:
org.xml.sax.SAXException - if an error occurs while outputting the document
org.apache.cocoon.ProcessingException


Copyright $ Apache Software Foundation. All Rights Reserved.