org.apache.cocoon.sitemap
Class AbstractSitemap

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.sitemap.AbstractSitemap
All Implemented Interfaces:
CompiledComponent, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.logger.Loggable, Modifiable, Processor, Sitemap, org.apache.avalon.framework.thread.ThreadSafe

public abstract class AbstractSitemap
extends org.apache.avalon.framework.logger.AbstractLoggable
implements Sitemap, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.thread.ThreadSafe

Base class for generated Sitemap classes

Version:
CVS $Id: AbstractSitemap.java,v 1.10.2.4 2002/09/21 03:01:13 vgritsenko Exp $
Author:
Giacomo Pati, Vadim Gritsenko

Field Summary
protected  DefaultSitemapComponentSelector actions
           
protected  long dateCreated
          The creation date
protected  DefaultSitemapComponentSelector generators
           
protected  CocoonComponentManager manager
          The component manager instance
protected  DefaultSitemapComponentSelector matchers
           
protected  DefaultSitemapComponentSelector readers
           
protected  DefaultSitemapComponentSelector selectors
           
protected  DefaultSitemapComponentSelector serializers
           
protected  Manager sitemapManager
          The sitemap manager instance
protected  DefaultSitemapComponentSelector sitemaps
           
protected  DefaultSitemapComponentSelector transformers
           
protected  URLFactory urlFactory
          The URLFactory instance
 
Fields inherited from interface org.apache.cocoon.sitemap.Sitemap
ACTION, GENERATOR, MATCHER, READER, SELECTOR, SERIALIZER, TRANSFORMER
 
Fields inherited from interface org.apache.cocoon.Processor
ROLE
 
Constructor Summary
AbstractSitemap()
           
 
Method Summary
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
          Set the current ComponentManager instance used by this Composable.
 void contextualize(org.apache.avalon.framework.context.Context context)
           
 void dispose()
          dispose
protected  void dumpParameters(java.util.List list)
          Dumps all sitemap parameters to log
 org.apache.avalon.framework.component.ComponentManager getComponentManager()
          Return the component manager for this sitemap
protected  boolean invoke(Environment environment, java.lang.String prefix, java.lang.String source, boolean checkReload, boolean reloadAsync, long checkDelay)
           
protected  boolean invoke(Environment environment, java.lang.String prefix, java.lang.String source, boolean checkReload, boolean reloadAsync, long checkDelay, StreamPipeline pipeline, EventPipeline eventPipeline)
           
protected  boolean invokeMethod(java.lang.String methodName, java.lang.Class[] argTypes, java.lang.Object[] argValues)
          Invokes a method of this class using Java Reflection
 void load_component(int type, java.lang.Object hint, java.lang.String classURL, org.apache.avalon.framework.configuration.Configuration configuration, java.lang.String mime_type)
          Loads a class specified in a sitemap component definition and initialize it
 boolean modifiedSince(long date)
          Determines whether this generator's source files have changed
abstract  boolean process(Environment environment)
          Constructs a resource for the Environment arguments.
abstract  boolean process(Environment environment, StreamPipeline pipeline, EventPipeline eventPipeline)
          Constructs a resource for the Environment arguments.
static void setLogKitManager(org.apache.avalon.excalibur.logger.LogKitManager logkit)
          Set the logkit manager
static void setRoleManager(org.apache.avalon.excalibur.component.RoleManager roles, org.apache.avalon.framework.configuration.Configuration config)
          Set the role manager
protected  java.lang.String substitute(java.util.List list, java.lang.String expr, Environment environment)
          Replaces occurences of xpath like expressions in an argument String with content from a List of Maps
protected  boolean tryResetResponse(java.util.Map objectModel)
          Deprecated. Use the tryResetResponse on the Environment instead.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, 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.avalon.framework.configuration.Configurable
configure
 

Field Detail

manager

protected CocoonComponentManager manager
The component manager instance

sitemapManager

protected Manager sitemapManager
The sitemap manager instance

urlFactory

protected URLFactory urlFactory
The URLFactory instance

dateCreated

protected long dateCreated
The creation date

generators

protected DefaultSitemapComponentSelector generators

transformers

protected DefaultSitemapComponentSelector transformers

serializers

protected DefaultSitemapComponentSelector serializers

readers

protected DefaultSitemapComponentSelector readers

actions

protected DefaultSitemapComponentSelector actions

matchers

protected DefaultSitemapComponentSelector matchers

selectors

protected DefaultSitemapComponentSelector selectors

sitemaps

protected DefaultSitemapComponentSelector sitemaps
Constructor Detail

AbstractSitemap

public AbstractSitemap()
Method Detail

setRoleManager

public static void setRoleManager(org.apache.avalon.excalibur.component.RoleManager roles,
                                  org.apache.avalon.framework.configuration.Configuration config)
Set the role manager

setLogKitManager

public static void setLogKitManager(org.apache.avalon.excalibur.logger.LogKitManager logkit)
Set the logkit manager

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Set the current ComponentManager instance used by this Composable.
Specified by:
compose in interface org.apache.avalon.framework.component.Composable

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable

getComponentManager

public org.apache.avalon.framework.component.ComponentManager getComponentManager()
Return the component manager for this sitemap
Specified by:
getComponentManager in interface Sitemap

modifiedSince

public final boolean modifiedSince(long date)
Determines whether this generator's source files have changed
Specified by:
modifiedSince in interface Modifiable
Returns:
Whether any of the files this sitemap depends on has changed since it was created

load_component

public void load_component(int type,
                           java.lang.Object hint,
                           java.lang.String classURL,
                           org.apache.avalon.framework.configuration.Configuration configuration,
                           java.lang.String mime_type)
                    throws java.lang.Exception
Loads a class specified in a sitemap component definition and initialize it

invoke

protected boolean invoke(Environment environment,
                         java.lang.String prefix,
                         java.lang.String source,
                         boolean checkReload,
                         boolean reloadAsync,
                         long checkDelay)
                  throws java.lang.Exception

invoke

protected boolean invoke(Environment environment,
                         java.lang.String prefix,
                         java.lang.String source,
                         boolean checkReload,
                         boolean reloadAsync,
                         long checkDelay,
                         StreamPipeline pipeline,
                         EventPipeline eventPipeline)
                  throws java.lang.Exception

substitute

protected java.lang.String substitute(java.util.List list,
                                      java.lang.String expr,
                                      Environment environment)
                               throws PatternException,
                                      java.lang.NumberFormatException
Replaces occurences of xpath like expressions in an argument String with content from a List of Maps

dumpParameters

protected void dumpParameters(java.util.List list)
Dumps all sitemap parameters to log

process

public abstract boolean process(Environment environment)
                         throws java.lang.Exception
Constructs a resource for the Environment arguments. This method is supplied by the generated Sitemap.
Specified by:
process in interface Sitemap
Following copied from interface: org.apache.cocoon.Processor
Returns:
If the processing is successfull true is returned. If not match is found in the sitemap false is returned.
Throws:
ResourceNotFoundException - If a sitemap component tries to access a resource which can not be found, e.g. the generator ConnectionResetException If the connection was reset

process

public abstract boolean process(Environment environment,
                                StreamPipeline pipeline,
                                EventPipeline eventPipeline)
                         throws java.lang.Exception
Constructs a resource for the Environment arguments. This method is supplied by the generated Sitemap.
Specified by:
process in interface Sitemap

invokeMethod

protected boolean invokeMethod(java.lang.String methodName,
                               java.lang.Class[] argTypes,
                               java.lang.Object[] argValues)
                        throws java.lang.Exception
Invokes a method of this class using Java Reflection
Parameters:
methodName - The name of the method to be invoked
argTypes - The array of class types of the method attributes
argTypes - The array of values of the method attributes
Throws:
java.lang.Exception - If an error occurs during method invocation

dispose

public void dispose()
dispose
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

tryResetResponse

protected boolean tryResetResponse(java.util.Map objectModel)
Deprecated. Use the tryResetResponse on the Environment instead.

Reset the response if possible. This allows error handlers to have a higher chance to produce clean output if the pipeline that raised the error has already output some data.
Parameters:
objectModel - the object model
Returns:
true if the response was successfully reset


Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.