org.apache.cocoon.generation
Class ScriptGenerator

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.generation.AbstractGenerator
              extended byorg.apache.cocoon.generation.ServiceableGenerator
                  extended byorg.apache.cocoon.generation.ScriptGenerator
All Implemented Interfaces:
Configurable, Disposable, Generator, LogEnabled, Poolable, Recyclable, Serviceable, SitemapModelComponent, XMLProducer

public class ScriptGenerator
extends ServiceableGenerator
implements Configurable

The Scriptgenerator executes arbitraty scripts using the BSF framework and additional interpreter (Rhino, Jython, etc.) as a Cocoon Generator. Additional language support can be added during configuration, eg using:

   <add-languages>
     <language name="potatoscript" src="edu.purdue.cs.bsf.engines.Potatoscript">
       <extension>pos</extension>
       <extension>psc</extension>
     <language>
     <language name="kawa-scheme" src="org.gnu.kawa.bsf.engines.KawaEngine">
       <extension>scm</extension>
     <language>
   </add-languages>
 

Version:
CVS $Id: ScriptGenerator.java 30941 2004-07-29 19:56:58Z vgritsenko $
Author:
Jason Foster

Nested Class Summary
protected  class ScriptGenerator.BSFLanguage
           
 
Field Summary
protected  ScriptGenerator.BSFLanguage[] additionalLanguages
           
 
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
ScriptGenerator()
           
 
Method Summary
 void configure(Configuration conf)
           
 void generate()
          Generate the XML and stream it into the pipeline
 void recycle()
          Recycle the generator by removing references
 
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose, service
 
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
setup
 
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

additionalLanguages

protected ScriptGenerator.BSFLanguage[] additionalLanguages
Constructor Detail

ScriptGenerator

public ScriptGenerator()
Method Detail

configure

public void configure(Configuration conf)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException

recycle

public void recycle()
Description copied from class: AbstractGenerator
Recycle the generator by removing references

Specified by:
recycle in interface Recyclable
Overrides:
recycle in class AbstractGenerator

generate

public void generate()
              throws ProcessingException
Description copied from interface: Generator
Generate the XML and stream it into the pipeline

Specified by:
generate in interface Generator
Throws:
ProcessingException


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.