org.apache.cocoon
Class Main
java.lang.Object
|
+--org.apache.cocoon.Main
- public class Main
- extends java.lang.Object
Command line entry point.
- Version:
- CVS $Revision: 1.4.2.24 $ $Date: 2001/10/25 17:58:00 $
- Author:
- Stefano Mazzocchi
Constructor Summary |
Main(Cocoon cocoon,
java.io.File context,
java.io.File destDir)
Creates the Main class |
Method Summary |
protected static java.lang.String |
getClassPath(java.lang.String context)
This builds the important ClassPath used by this class. |
protected java.util.Collection |
getLinks(java.lang.String deparameterizedURI,
java.util.Map parameters)
|
protected java.lang.String |
getPage(java.lang.String deparameterizedURI,
java.util.Map parameters,
java.util.Map links,
java.io.OutputStream stream)
|
protected java.lang.String |
getType(java.lang.String deparameterizedURI,
java.util.Map parameters)
|
static void |
main(java.lang.String[] args)
|
int |
process(java.util.Collection uris,
boolean xspOnly)
Process the URI list and process them all independently. |
static void |
processFile(java.lang.String filename,
java.util.List uris)
|
java.util.Collection |
processURI(java.lang.String uri)
Processes the given URI and return all links. |
void |
processXSP(java.lang.String uri)
|
void |
recursivelyProcessXSP(java.io.File contextDir,
java.io.File file)
Recurse the directory hierarchy and process the XSP's. |
java.lang.String |
translateURI(java.lang.String uri)
|
protected java.lang.String |
tree(int level)
|
void |
warmup()
Warms up the engine by accessing the root. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static org.apache.log.Logger log
HELP_OPT
protected static final int HELP_OPT
VERSION_OPT
protected static final int VERSION_OPT
LOG_KIT_OPT
protected static final int LOG_KIT_OPT
LOGGER_OPT
protected static final int LOGGER_OPT
LOG_LEVEL_OPT
protected static final int LOG_LEVEL_OPT
CONTEXT_DIR_OPT
protected static final int CONTEXT_DIR_OPT
DEST_DIR_OPT
protected static final int DEST_DIR_OPT
WORK_DIR_OPT
protected static final int WORK_DIR_OPT
XSP_OPT
protected static final int XSP_OPT
AGENT_OPT
protected static final int AGENT_OPT
ACCEPT_OPT
protected static final int ACCEPT_OPT
URI_FILE
protected static final int URI_FILE
FOLLOW_LINKS_OPT
protected static final int FOLLOW_LINKS_OPT
DEFAULT_USER_AGENT
protected static final java.lang.String DEFAULT_USER_AGENT
DEFAULT_ACCEPT
protected static final java.lang.String DEFAULT_ACCEPT
options
protected static final org.apache.avalon.excalibur.cli.CLOptionDescriptor[] options
Main
public Main(Cocoon cocoon,
java.io.File context,
java.io.File destDir)
- Creates the Main class
processFile
public static void processFile(java.lang.String filename,
java.util.List uris)
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
warmup
public void warmup()
throws java.lang.Exception
- Warms up the engine by accessing the root.
process
public int process(java.util.Collection uris,
boolean xspOnly)
throws java.lang.Exception
- Process the URI list and process them all independently.
recursivelyProcessXSP
public void recursivelyProcessXSP(java.io.File contextDir,
java.io.File file)
- Recurse the directory hierarchy and process the XSP's.
processXSP
public void processXSP(java.lang.String uri)
throws java.lang.Exception
processURI
public java.util.Collection processURI(java.lang.String uri)
throws java.lang.Exception
- Processes the given URI and return all links. The algorithm is the following:
- file name for the URI is generated. URI MIME type is checked for
consistency with the URI and, if the extension is inconsistent
or absent, the file name is changed
- the link view of the given URI is called and the file names for linked
resources are generated and stored.
- for each link, absolute file name is translated to relative path.
- after the complete list of links is translated, the link-translating
view of the resource is called to obtain a link-translated version
of the resource with the given link map
- list of absolute URI is returned, for every URI which is not yet
present in list of all translated URIs
translateURI
public java.lang.String translateURI(java.lang.String uri)
throws java.lang.Exception
tree
protected java.lang.String tree(int level)
getLinks
protected java.util.Collection getLinks(java.lang.String deparameterizedURI,
java.util.Map parameters)
throws java.lang.Exception
getPage
protected java.lang.String getPage(java.lang.String deparameterizedURI,
java.util.Map parameters,
java.util.Map links,
java.io.OutputStream stream)
throws java.lang.Exception
getType
protected java.lang.String getType(java.lang.String deparameterizedURI,
java.util.Map parameters)
throws java.lang.Exception
getClassPath
protected static java.lang.String getClassPath(java.lang.String context)
- This builds the important ClassPath used by this class. It
does so in a neutral way.
It iterates in alphabetical order through every file in the
lib directory and adds it to the classpath.
Also, we add the files to the ClassLoader for the Cocoon system.
In order to protect ourselves from skitzofrantic classloaders,
we need to work with a known one.
- Parameters:
context
- The context path
Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.