org.apache.cocoon.sitemap
Interface SitemapExecutor


public interface SitemapExecutor

The sitemap executor executes all sitemap statements, so it actually calls an action, adds a generator to the pipeline etc. By separating this functionality into a single object it is easier to plugin custom profiling or debugging tools. TODO - This is not finished yet! TODO - we should add invocation of a Redirector as well

Since:
2.2
Version:
$Id: SitemapExecutor.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Nested Class Summary
static class SitemapExecutor.PipelineComponentDescription
           
 
Field Summary
static String ROLE
          The component role
 
Method Summary
 SitemapExecutor.PipelineComponentDescription addGenerator(ExecutionContext context, Map objectModel, SitemapExecutor.PipelineComponentDescription desc)
          Add a generator
 SitemapExecutor.PipelineComponentDescription addReader(ExecutionContext context, Map objectModel, SitemapExecutor.PipelineComponentDescription desc)
          Add a reader
 SitemapExecutor.PipelineComponentDescription addSerializer(ExecutionContext context, Map objectModel, SitemapExecutor.PipelineComponentDescription desc)
          Add a serializer
 SitemapExecutor.PipelineComponentDescription addTransformer(ExecutionContext context, Map objectModel, SitemapExecutor.PipelineComponentDescription desc)
          Add a transformer
 SitemapExecutor.PipelineComponentDescription enteringPipeline(ExecutionContext context, Map objectModel, SitemapExecutor.PipelineComponentDescription desc)
          This informs the executor about a new pipeline section.
 void enterSitemap(ExecutionContext context, Map objectModel, String source)
          Enter a new sitemap
 Map invokeAction(ExecutionContext context, Map objectModel, Action action, org.apache.cocoon.environment.Redirector redirector, org.apache.cocoon.environment.SourceResolver resolver, String source, Parameters parameters)
          Invoke an action and return the result.
 Map invokeMatcher(ExecutionContext context, Map objectModel, Matcher matcher, String pattern, Parameters parameters)
          Invoke a match and return the result
 Map invokePreparableMatcher(ExecutionContext context, Map objectModel, PreparableMatcher matcher, String pattern, Object preparedPattern, Parameters parameters)
          Invoke a match and return the result
 boolean invokeSelector(ExecutionContext context, Map objectModel, Selector selector, String expression, Parameters parameters)
          Invoke a selector
 boolean invokeSwitchSelector(ExecutionContext context, Map objectModel, SwitchSelector selector, String expression, Parameters parameters, Object selectorContext)
          Invoke a switch selector
 void leaveSitemap(ExecutionContext context, Map objectModel)
          Leaves a sitemap.
 void popVariables(ExecutionContext context, Map objectModel)
          Pop a map of information from the context stack.
 Map pushVariables(ExecutionContext context, Map objectModel, String key, Map variables)
          Push map of information on the context stack.
 String redirectTo(ExecutionContext context, Map objectModel, String uri, boolean createSession, boolean global, boolean permanent)
          Informs about a redirect.
 

Field Detail

ROLE

public static final String ROLE
The component role

Method Detail

invokeAction

public Map invokeAction(ExecutionContext context,
                        Map objectModel,
                        Action action,
                        org.apache.cocoon.environment.Redirector redirector,
                        org.apache.cocoon.environment.SourceResolver resolver,
                        String source,
                        Parameters parameters)
                 throws Exception
Invoke an action and return the result.

Throws:
Exception

invokeMatcher

public Map invokeMatcher(ExecutionContext context,
                         Map objectModel,
                         Matcher matcher,
                         String pattern,
                         Parameters parameters)
                  throws PatternException
Invoke a match and return the result

Throws:
PatternException

invokePreparableMatcher

public Map invokePreparableMatcher(ExecutionContext context,
                                   Map objectModel,
                                   PreparableMatcher matcher,
                                   String pattern,
                                   Object preparedPattern,
                                   Parameters parameters)
                            throws PatternException
Invoke a match and return the result

Throws:
PatternException

invokeSelector

public boolean invokeSelector(ExecutionContext context,
                              Map objectModel,
                              Selector selector,
                              String expression,
                              Parameters parameters)
Invoke a selector

Parameters:
context -
objectModel -
selector -
expression -
parameters -
Returns:
True if the selector did match.

invokeSwitchSelector

public boolean invokeSwitchSelector(ExecutionContext context,
                                    Map objectModel,
                                    SwitchSelector selector,
                                    String expression,
                                    Parameters parameters,
                                    Object selectorContext)
Invoke a switch selector

Parameters:
context -
objectModel -
selector -
expression -
parameters -
selectorContext - The context object for the switch selector
Returns:
True if the selector did match.

pushVariables

public Map pushVariables(ExecutionContext context,
                         Map objectModel,
                         String key,
                         Map variables)
Push map of information on the context stack.

Parameters:
context - The execution context
objectModel - The object model
key - A key that can be used to identify this map (can be null)
variables - The variables as key/value pairs
Returns:
The variables that are used in the sitemap. The executor can modify the set of available variables by returning a different map.

popVariables

public void popVariables(ExecutionContext context,
                         Map objectModel)
Pop a map of information from the context stack.

Parameters:
context - The execution context
objectModel - The object model

enterSitemap

public void enterSitemap(ExecutionContext context,
                         Map objectModel,
                         String source)
Enter a new sitemap

Parameters:
context - The execution context
objectModel - The object model
source - The uri of the sitemap

leaveSitemap

public void leaveSitemap(ExecutionContext context,
                         Map objectModel)
Leaves a sitemap.


addGenerator

public SitemapExecutor.PipelineComponentDescription addGenerator(ExecutionContext context,
                                                                 Map objectModel,
                                                                 SitemapExecutor.PipelineComponentDescription desc)
Add a generator

Parameters:
context -
objectModel -
desc - The descrption of the component
Returns:
The desc of the component to use

addTransformer

public SitemapExecutor.PipelineComponentDescription addTransformer(ExecutionContext context,
                                                                   Map objectModel,
                                                                   SitemapExecutor.PipelineComponentDescription desc)
Add a transformer

Parameters:
context -
objectModel -
desc - The descrption of the component
Returns:
The desc of the component to use

addSerializer

public SitemapExecutor.PipelineComponentDescription addSerializer(ExecutionContext context,
                                                                  Map objectModel,
                                                                  SitemapExecutor.PipelineComponentDescription desc)
Add a serializer

Parameters:
context -
objectModel -
desc - The descrption of the component
Returns:
The desc of the component to use

addReader

public SitemapExecutor.PipelineComponentDescription addReader(ExecutionContext context,
                                                              Map objectModel,
                                                              SitemapExecutor.PipelineComponentDescription desc)
Add a reader

Parameters:
context -
objectModel -
desc - The descrption of the component
Returns:
The desc of the component to use

enteringPipeline

public SitemapExecutor.PipelineComponentDescription enteringPipeline(ExecutionContext context,
                                                                     Map objectModel,
                                                                     SitemapExecutor.PipelineComponentDescription desc)
This informs the executor about a new pipeline section.

Parameters:
context -
objectModel -
desc -
Returns:
A (new) description for the pipeline component to use.

redirectTo

public String redirectTo(ExecutionContext context,
                         Map objectModel,
                         String uri,
                         boolean createSession,
                         boolean global,
                         boolean permanent)
Informs about a redirect.

Returns:
The uri to redirect to.


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.