org.apache.cocoon.generation
Class ScriptGenerator

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.ScriptGenerator
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Component, Configurable, LogEnabled, Serviceable, Generator, SitemapModelComponent, XMLProducer

public class ScriptGenerator
extends ServiceableGenerator
implements Configurable

The Scriptgenerator executes arbitraty scripts using the BSF framework and additional interpreter (Rhino, Groovy, 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.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Jason Foster

Nested Class Summary
protected static 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-2010 The Apache Software Foundation. All Rights Reserved.