org.apache.cocoon.bean
Class CocoonBean

java.lang.Object
  extended by org.apache.cocoon.bean.CocoonWrapper
      extended by org.apache.cocoon.bean.CocoonBean

public class CocoonBean
extends CocoonWrapper

The Cocoon Bean simplifies usage of the Cocoon object. Allows to create, configure Cocoon instance and process requests, one by one or multiple with link traversal.

WARNING: This interface is not stable and could be changed in backward incompatible way without prior notice.

Version:
CVS $Id: CocoonBean.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Stefano Mazzocchi, Nicola Ken Barozzi, Vadim Gritsenko, Upayavira

Field Summary
 
Fields inherited from class org.apache.cocoon.bean.CocoonWrapper
accept, cliContext, cocoon, context, DEFAULT_ACCEPT, DEFAULT_USER_AGENT, log, logger, logLevel, userAgent
 
Constructor Summary
CocoonBean()
           
 
Method Summary
 void addExcludePattern(String pattern)
           
 void addIncludeLinkExtension(String extension)
           
 void addIncludePattern(String pattern)
           
 void addListener(BeanListener listener)
           
 void addTarget(String sourceURI, String destURI)
           
 void addTarget(String type, String sourceURI, String destURI)
           
 void addTarget(String type, String root, String sourceURI, String destURI)
          Adds a target for processing
 void addTarget(String type, String root, String sourceURI, String destURI, boolean followLinks, boolean confirmExtension, String logger)
           
 void addTargets(List uris, String destURI)
           
 boolean confirmExtensions()
           
 void dispose()
           
protected  void finalize()
           
 boolean followLinks()
           
 long getLastModified(Target target)
           
static String getProlog()
          Print a description of the software before running
 ModifiableSource getSource(Target target)
           
 int getTargetCount()
           
 void initialize()
           
 boolean isPrecompileOnly()
           
 void pageGenerated(String sourceURI, String destURI, int pageSize, int linksInPage, int newLinksInPage, int pagesRemaining, int pagesComplete, long timeTaken)
           
 void pageSkipped(String uri, String message)
           
 void process()
          Process the URI list and process them all independently.
 void releaseSource(Source source)
           
 void sendBrokenLinkWarning(String uri, String warning)
           
 void sendMessage(String msg)
           
 void sendWarning(String uri, String warning)
           
 void setBrokenLinkExtension(String brokenLinkExtension)
           
 void setBrokenLinkGenerate(boolean brokenLinkGenerate)
           
 void setChecksumURI(String uri)
           
 void setConfirmExtensions(boolean confirmExtension)
           
 void setDefaultFilename(String filename)
           
 void setFollowLinks(boolean follow)
           
 void setPrecompileOnly(boolean precompileOnly)
           
 void setVerbose(boolean verbose)
           
 
Methods inherited from class org.apache.cocoon.bean.CocoonWrapper
addLoadedClass, addLoadedClasses, getClassPath, getComponentManager, getLinks, getLoggerName, getPage, getPage, getType, loadClasses, processURI, processURI, setAcceptOptions, setAgentOptions, setConfigFile, setContextDir, setLogger, setLogKit, setLogLevel, setUseExistingCocoon, setWorkDir
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CocoonBean

public CocoonBean()
Method Detail

initialize

public void initialize()
                throws Exception
Overrides:
initialize in class CocoonWrapper
Throws:
Exception

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class CocoonWrapper
Throws:
Throwable

setFollowLinks

public void setFollowLinks(boolean follow)

setConfirmExtensions

public void setConfirmExtensions(boolean confirmExtension)

setPrecompileOnly

public void setPrecompileOnly(boolean precompileOnly)

isPrecompileOnly

public boolean isPrecompileOnly()

setVerbose

public void setVerbose(boolean verbose)

setDefaultFilename

public void setDefaultFilename(String filename)

setBrokenLinkGenerate

public void setBrokenLinkGenerate(boolean brokenLinkGenerate)

setBrokenLinkExtension

public void setBrokenLinkExtension(String brokenLinkExtension)

setChecksumURI

public void setChecksumURI(String uri)

followLinks

public boolean followLinks()

confirmExtensions

public boolean confirmExtensions()

addTarget

public void addTarget(String type,
                      String root,
                      String sourceURI,
                      String destURI)
               throws IllegalArgumentException
Adds a target for processing

Parameters:
type - Type of target - append, replace, insert.
root -
sourceURI - URI of the starting page
destURI - URI specifying destination for the generated pages.
Throws:
IllegalArgumentException - if destURI is missing

addTarget

public void addTarget(String type,
                      String sourceURI,
                      String destURI)
               throws IllegalArgumentException
Throws:
IllegalArgumentException

addTarget

public void addTarget(String sourceURI,
                      String destURI)
               throws IllegalArgumentException
Throws:
IllegalArgumentException

addTargets

public void addTargets(List uris,
                       String destURI)
                throws IllegalArgumentException
Throws:
IllegalArgumentException

addTarget

public void addTarget(String type,
                      String root,
                      String sourceURI,
                      String destURI,
                      boolean followLinks,
                      boolean confirmExtension,
                      String logger)
               throws IllegalArgumentException
Throws:
IllegalArgumentException

getTargetCount

public int getTargetCount()

addExcludePattern

public void addExcludePattern(String pattern)

addIncludePattern

public void addIncludePattern(String pattern)

addIncludeLinkExtension

public void addIncludeLinkExtension(String extension)

addListener

public void addListener(BeanListener listener)

pageGenerated

public void pageGenerated(String sourceURI,
                          String destURI,
                          int pageSize,
                          int linksInPage,
                          int newLinksInPage,
                          int pagesRemaining,
                          int pagesComplete,
                          long timeTaken)

sendMessage

public void sendMessage(String msg)

sendWarning

public void sendWarning(String uri,
                        String warning)

sendBrokenLinkWarning

public void sendBrokenLinkWarning(String uri,
                                  String warning)

pageSkipped

public void pageSkipped(String uri,
                        String message)

dispose

public void dispose()
Overrides:
dispose in class CocoonWrapper

process

public void process()
             throws Exception
Process the URI list and process them all independently.

Throws:
Exception - if an error occurs

getSource

public ModifiableSource getSource(Target target)
                           throws IOException,
                                  ProcessingException
Throws:
IOException
ProcessingException

getLastModified

public long getLastModified(Target target)
                     throws IOException,
                            ProcessingException
Throws:
IOException
ProcessingException

releaseSource

public void releaseSource(Source source)

getProlog

public static String getProlog()
Print a description of the software before running



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