|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.environment.AbstractEnvironment
public abstract class AbstractEnvironment
Base class for any environment
| Field Summary | |
|---|---|
protected String |
action
The Action requested |
protected static Method |
avalonToCocoonSourceWrapper
The AvalonToCocoonSourceWrapper (this is for the deprecated support) |
protected String |
context
The Context path |
protected boolean |
initializedComponents
Do we have our components ? |
protected ComponentManager |
manager
The component manager |
protected HashMap |
objectModel
The servlet object model |
protected OutputStream |
outputStream
The real output stream |
protected StringBuffer |
prefix
The current prefix to strip off from the request uri |
protected String |
rootContext
The root context path |
protected BufferedOutputStream |
secureOutputStream
The secure Output Stream |
protected SourceResolver |
sourceResolver
The real source resolver |
protected String |
uris
The current uri in progress |
protected String |
view
The View requested |
| Fields inherited from interface org.apache.excalibur.source.SourceResolver |
|---|
METHOD, ROLE, URI_ENCODING, URI_PARAMETERS |
| Constructor Summary | |
|---|---|
AbstractEnvironment(String uri,
String view,
File file)
Constructs the abstract environment |
|
AbstractEnvironment(String uri,
String view,
File file,
String action)
Constructs the abstract environment |
|
AbstractEnvironment(String uri,
String view,
String context,
String action)
Constructs the abstract environment |
|
| Method Summary | |
|---|---|
void |
changeContext(String newPrefix,
String newContext)
Adds an prefix to the overall stripped off prefix from the request uri |
void |
commitResponse()
Commit the response |
protected static String |
extractAction(Request req)
Helper method to extract the action name from the request. |
protected static String |
extractView(Request request)
Helper method to extract the view name from the request. |
void |
finishingProcessing()
Notify that the processing is finished This can be used to cleanup the environment object |
String |
getAction()
Returns the request action |
Object |
getAttribute(String name)
Returns the object bound with the specified name, or null
if no object is bound under the name. |
Enumeration |
getAttributeNames()
Returns an Enumeration of String objects
containing the names of all the objects bound to this environment. |
String |
getContext()
Get the current Context |
Map |
getObjectModel()
Returns a Map containing environment specific objects |
OutputStream |
getOutputStream()
Deprecated. Use getOutputStream(int) instead. |
OutputStream |
getOutputStream(int bufferSize)
Get the output stream where to write the generated resource. |
String |
getRootContext()
Get the Root Context |
String |
getURI()
Returns the uri in progress. |
String |
getURIPrefix()
Get the prefix of the URI in progress |
String |
getView()
Returns the request view |
void |
globalRedirect(boolean sessionmode,
String newURL)
|
protected boolean |
hasAttribute(String name)
|
protected void |
initComponents()
Initialize the components for the environment This gets the source resolver and the xmlizer component |
boolean |
isInternalRedirect()
Is this an internal redirect? |
boolean |
isResponseModified(long lastModified)
Check if the response has been modified since the same "resource" was requested. |
void |
release(Source source)
Releases a resolved resource |
void |
removeAttribute(String name)
Removes the object bound with the specified name from this environment. |
Source |
resolve(String systemId)
Deprecated. Use the resolveURI methods instead |
Source |
resolveURI(String location)
Get a Source object. |
Source |
resolveURI(String location,
String baseURI,
Map parameters)
Get a Source object. |
protected void |
setAction(String action)
Allow implementations to set action later than in super() constructor Action can be set only once, and should be set in implementation's constructor. |
void |
setAttribute(String name,
Object value)
Binds an object to this environment, using the name specified. |
protected void |
setContext(String context)
Set the context. |
void |
setContext(String prefix,
String uri,
String context)
Set the context. |
void |
setResponseIsNotModified()
Mark the response as not modified. |
void |
setStatus(int statusCode)
Set a status code |
protected void |
setURIPrefix(String prefix)
Set the prefix of the URI in progress |
protected void |
setView(String view)
Allow implementations to set view later than in super() constructor. |
void |
startingProcessing()
Notify that the processing starts. |
boolean |
tryResetResponse()
Reset the response if possible. |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging, getLogger, 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.cocoon.environment.Environment |
|---|
getContentType, isExternal, redirect, setContentLength, setContentType |
| Field Detail |
|---|
protected String uris
protected StringBuffer prefix
protected String view
protected String action
protected String context
protected String rootContext
protected HashMap objectModel
protected SourceResolver sourceResolver
protected ComponentManager manager
protected BufferedOutputStream secureOutputStream
protected OutputStream outputStream
protected static Method avalonToCocoonSourceWrapper
protected boolean initializedComponents
| Constructor Detail |
|---|
public AbstractEnvironment(String uri,
String view,
File file)
throws MalformedURLException
MalformedURLException
public AbstractEnvironment(String uri,
String view,
File file,
String action)
throws MalformedURLException
MalformedURLException
public AbstractEnvironment(String uri,
String view,
String context,
String action)
throws MalformedURLException
MalformedURLException| Method Detail |
|---|
protected void setView(String view)
protected void setAction(String action)
protected static String extractView(Request request)
protected static String extractAction(Request req)
public String getURI()
getURI in interface Environmentpublic String getRootContext()
getRootContext in interface Environmentpublic String getContext()
getContext in interface Environmentpublic String getURIPrefix()
getURIPrefix in interface Environmentprotected void setURIPrefix(String prefix)
protected void setContext(String context)
public void setContext(String prefix,
String uri,
String context)
setContext in interface Environment
public void changeContext(String newPrefix,
String newContext)
throws IOException
changeContext in interface EnvironmentIOException
public void globalRedirect(boolean sessionmode,
String newURL)
throws IOException
IOExceptionpublic String getView()
getView in interface Environmentpublic String getAction()
getAction in interface Environmentpublic void setStatus(int statusCode)
setStatus in interface Environmentpublic Map getObjectModel()
getObjectModel in interface Environment
public Source resolve(String systemId)
throws ProcessingException,
SAXException,
IOException
systemId - This is either a system identifier
(java.net.URL or a local file.
ProcessingException
SAXException
IOExceptionpublic boolean isResponseModified(long lastModified)
isResponseModified in interface Environmentpublic void setResponseIsNotModified()
setResponseIsNotModified in interface Environmentpublic Object getAttribute(String name)
Environmentnull
if no object is bound under the name.
getAttribute in interface Environmentname - a string specifying the name of the object
public void setAttribute(String name,
Object value)
EnvironmentIf an object of the same name is already bound, the object is replaced.
setAttribute in interface Environmentname - the name to which the object is boundvalue - the object to be boundprotected boolean hasAttribute(String name)
public void removeAttribute(String name)
Environment
removeAttribute in interface Environmentname - the name of the object to removepublic Enumeration getAttributeNames()
EnvironmentEnumeration of String objects
containing the names of all the objects bound to this environment.
getAttributeNames in interface EnvironmentEnumeration of Strings.
public OutputStream getOutputStream()
throws IOException
getOutputStream(int) instead.
getOutputStream in interface EnvironmentIOException
public OutputStream getOutputStream(int bufferSize)
throws IOException
getOutputStream().
getOutputStream in interface EnvironmentIOException
public boolean tryResetResponse()
throws IOException
tryResetResponse in interface EnvironmentIOException
public void commitResponse()
throws IOException
commitResponse in interface EnvironmentIOException
public Source resolveURI(String location)
throws MalformedURLException,
IOException,
SourceException
Source object.
resolveURI in interface SourceResolverMalformedURLException
IOException
SourceException
public Source resolveURI(String location,
String baseURI,
Map parameters)
throws MalformedURLException,
IOException,
SourceException
Source object.
resolveURI in interface SourceResolverMalformedURLException
IOException
SourceExceptionpublic void release(Source source)
release in interface SourceResolverprotected void initComponents()
public void startingProcessing()
startingProcessing in interface Environmentpublic void finishingProcessing()
finishingProcessing in interface Environmentpublic boolean isInternalRedirect()
Environment
isInternalRedirect in interface Environment
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||