Google

Cocoon API: Class DCPProcessor

org.apache.cocoon.processor.dcp
Class DCPProcessor

java.lang.Object
  |
  +--org.apache.cocoon.framework.AbstractActor
        |
        +--org.apache.cocoon.processor.dcp.DCPProcessor
All Implemented Interfaces:
Actor, Changeable, Processor, Status

public class DCPProcessor
extends AbstractActor
implements Processor, Status

This class implements a DOM processor that expands XML documents replacing dynamic content generation processing instructions by the return value of user-supplied logic.

Version:
$Revision: 1.5 $ $Date: 2000/03/01 16:13:46 $
Author:
Ricardo Rocha

Fields inherited from class org.apache.cocoon.framework.AbstractActor
director
 
Constructor Summary
DCPProcessor()
           
 
Method Summary
 java.lang.String getStatus()
          Returns information about the status of the implementing class.
 boolean hasChanged(java.lang.Object context)
          This method is called by the cache system to evaluate the status of this changeable point for the given context (normally an HTTP request).
 org.w3c.dom.Document process(org.w3c.dom.Document document, java.util.Dictionary parameters)
          This method scans a DOM tree replacing <?dcp?> processing instructions by dynamic content generated by user-supplied programs.
 
Methods inherited from class org.apache.cocoon.framework.AbstractActor
init
 
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.framework.Actor
init
 

Constructor Detail

DCPProcessor

public DCPProcessor()
Method Detail

process

public org.w3c.dom.Document process(org.w3c.dom.Document document,
                                    java.util.Dictionary parameters)
                             throws java.lang.Exception
This method scans a DOM tree replacing <?dcp?> processing instructions by dynamic content generated by user-supplied programs. These programs are dynamically loaded according to directives contained in <?dcp-object?> processing instructions.
Specified by:
process in interface Processor
Parameters:
document - The document to be processed for dynamic content
parameters - The table of invocation environment variables to be used during processing
Returns:
The expanded document
Throws:
java.lang.Exception - When any error occurs during processing

hasChanged

public boolean hasChanged(java.lang.Object context)
This method is called by the cache system to evaluate the status of this changeable point for the given context (normally an HTTP request). Since even if the scripts didn't change we can't assume anything about it, this method is today left unimplemented (it always returns "true") but should call similar hooks inside the DCP components if available.
Specified by:
hasChanged in interface Changeable

getStatus

public java.lang.String getStatus()
Description copied from interface: Status
Returns information about the status of the implementing class. Note: this is use instead of the usual toString() method because some of these methods are declared final in some classes in JDK 1.1.
Specified by:
getStatus in interface Status


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.