| org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon
FOM_Cocoon | public class FOM_Cocoon extends ScriptableObject (Code) | | Implementation of FOM (Flow Object Model).
since: 2.1 author: Christopher Oliver author: Reinhard P\u00F6tz version: CVS $Id: FOM_Cocoon.java 518747 2007-03-15 20:30:03Z antonio $ |
Inner Class :class CallContext | |
Inner Class :public static class FOM_Request extends AttributeHolderJavaObject | |
Inner Class :public static class FOM_Session extends AttributeHolderJavaObject | |
Inner Class :public static class FOM_Context extends AttributeHolderJavaObject | |
Method Summary | |
public void | forwardTo(String uri, Object bean, FOM_WebContinuation fom_wk) | public String | getClassName() | public org.apache.cocoon.environment.Context | getContext() | public String | getInterpreterId() Required by FOM_WebContinuation. | public Map | getObjectModel() | public Scriptable | getParameters() | public Request | getRequest() | public Response | getResponse() | public ServiceManager | getServiceManager() | public Session | getSession() | public void | handleContinuation(String kontId, Scriptable parameters) Perform the behavior of
This can be used in cases where the continuation id is not encoded
in the request in a form convenient to access in the sitemap. | static void | init(Scriptable scope) | public Object | jsFunction_createObject(Object classObj) Create and setup an object so that it can access the information provided to regular components. | public Scriptable | jsFunction_createPageLocal() | public void | jsFunction_disposeObject(Object obj) Dispose an object that has been created using
FOM_Cocoon.jsFunction_createObject(Object) . | public Object | jsFunction_getComponent(String id) Access components. | public Object | jsFunction_load(String filename) Load the script file specified as argument. | public FOM_WebContinuation | jsFunction_makeWebContinuation(Object k, Object ttl) Create a Bookmark WebContinuation from a JS Continuation with the last
continuation of sendPageAndWait as its parent. | public void | jsFunction_processPipelineTo(String uri, Object map, Object outputStream) | public void | jsFunction_redirectTo(String uri, boolean isGlobal) | public void | jsFunction_releaseComponent(Object component) Release pooled components. | public FOM_WebContinuation | jsFunction_sendPage(String uri, Object obj, Object wk) | public void | jsFunction_sendStatus(int sc) | public Object | jsFunction_setupObject(Object obj) Setup an object so that it can access the information provided to regular components. | public Scriptable | jsGet_context() | public FOM_WebContinuation | jsGet_continuation() | public Scriptable | jsGet_log() | public Scriptable | jsGet_parameters() | public Scriptable | jsGet_request() | public Scriptable | jsGet_response() | public Scriptable | jsGet_session() | public void | jsSet_continuation(Object obj) | public FOM_WebContinuation | makeWebContinuation(Continuation k, FOM_WebContinuation parent, int timeToLive) | public void | popCallContext() | public void | pushCallContext(FOM_JavaScriptInterpreter interp, Redirector redirector, ServiceManager manager, Context avalonContext, Logger logger, WebContinuation lastContinuation) | void | setParameters(Scriptable value) |
forwardTo | public void forwardTo(String uri, Object bean, FOM_WebContinuation fom_wk) throws Exception(Code) | | Call the Cocoon Sitemap to process a page
Parameters: uri - Uri to match Parameters: bean - Input to page Parameters: fom_wk - Current Web continuation (may be null) |
getInterpreterId | public String getInterpreterId()(Code) | | Required by FOM_WebContinuation. This way we do not make whole Interpreter public
interpreter Id associated with this FOM. |
getObjectModel | public Map getObjectModel()(Code) | | Get the current object model
The object model |
getParameters | public Scriptable getParameters()(Code) | | |
getRequest | public Request getRequest()(Code) | | Get the current request
The request |
getResponse | public Response getResponse()(Code) | | Get the current response
The response |
getServiceManager | public ServiceManager getServiceManager()(Code) | | |
getSession | public Session getSession()(Code) | | Get the current session
The session (may be null) |
handleContinuation | public void handleContinuation(String kontId, Scriptable parameters) throws Exception(Code) | | Perform the behavior of
This can be used in cases where the continuation id is not encoded
in the request in a form convenient to access in the sitemap.
Your script can extract the id from the request and then call
this method to process it as normal.
Parameters: kontId - The continuation id Parameters: parameters - Any parameters you want to pass to the continuation (may be null) |
jsFunction_createObject | public Object jsFunction_createObject(Object classObj) throws Exception(Code) | | Create and setup an object so that it can access the information provided to regular components.
This is done by calling the various Avalon lifecycle interfaces implemented by the object, which
are LogEnabled , Contextualizable , Serviceable ,
Composable (even if deprecated) and Initializable .
Contextualizable is of primary importance as it gives access to the whole object model
(request, response, etc.) through the
org.apache.cocoon.components.ContextHelper class.
Note that Configurable is ignored, as no configuration exists in a flowscript that
can be passed to the object.
Parameters: classObj - the class to instantiate, either as a String or a Rhino NativeJavaClass object an set up instance of clazz throws: Exception - if something goes wrong either during instantiation or setup. |
jsFunction_createPageLocal | public Scriptable jsFunction_createPageLocal()(Code) | | |
jsFunction_getComponent | public Object jsFunction_getComponent(String id) throws Exception(Code) | | Access components.
TODO: Do we want to restrict the access of sitemap components? (RP)
TODO: Do we want to raise an error or return null? (RP)
|
jsFunction_load | public Object jsFunction_load(String filename) throws Exception(Code) | | Load the script file specified as argument.
Parameters: filename - a String value an Object value exception: JavaScriptException - if an error occurs |
jsFunction_makeWebContinuation | public FOM_WebContinuation jsFunction_makeWebContinuation(Object k, Object ttl) throws Exception(Code) | | Create a Bookmark WebContinuation from a JS Continuation with the last
continuation of sendPageAndWait as its parent.
PageLocal variables will be shared with the continuation of
the next call to sendPageAndWait().
Parameters: k - The JS continuation Parameters: ttl - Lifetime for this continuation (zero means no limit) |
jsFunction_redirectTo | public void jsFunction_redirectTo(String uri, boolean isGlobal) throws Exception(Code) | | |
jsFunction_releaseComponent | public void jsFunction_releaseComponent(Object component) throws Exception(Code) | | Release pooled components.
Parameters: component - a component |
jsFunction_sendStatus | public void jsFunction_sendStatus(int sc)(Code) | | |
jsFunction_setupObject | public Object jsFunction_setupObject(Object obj) throws Exception(Code) | | Setup an object so that it can access the information provided to regular components.
This is done by calling the various Avalon lifecycle interfaces implemented by the object, which
are LogEnabled , Contextualizable , Serviceable ,
Composable (even if deprecated) and Initializable .
Contextualizable is of primary importance as it gives access to the whole object model
(request, response, etc.) through the
org.apache.cocoon.components.ContextHelper class.
Note that Configurable is ignored, as no configuration exists in a flowscript that
can be passed to the object.
Parameters: obj - the object to setup the same object (convenience that allows to write var foo = cocoon.setupObject(new Foo()); ). throws: Exception - if something goes wrong during setup. |
jsGet_context | public Scriptable jsGet_context()(Code) | | |
jsGet_log | public Scriptable jsGet_log()(Code) | | |
jsGet_parameters | public Scriptable jsGet_parameters()(Code) | | Get Sitemap parameters
a Scriptable value whose properties representthe Sitemap parameters from |
jsGet_request | public Scriptable jsGet_request()(Code) | | |
jsGet_response | public Scriptable jsGet_response()(Code) | | |
jsGet_session | public Scriptable jsGet_session()(Code) | | |
jsSet_continuation | public void jsSet_continuation(Object obj)(Code) | | |
makeWebContinuation | public FOM_WebContinuation makeWebContinuation(Continuation k, FOM_WebContinuation parent, int timeToLive) throws Exception(Code) | | Create a Web Continuation from a JS Continuation
Parameters: k - The JS continuation (may be null - null will be returned in that case) Parameters: parent - The parent of this continuation (may be null) Parameters: timeToLive - Lifetime for this continuation (zero means no limit) |
popCallContext | public void popCallContext()(Code) | | |
setParameters | void setParameters(Scriptable value)(Code) | | |
|
|