|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mozilla.javascript.ScriptableObject org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon
public class FOM_Cocoon
Implementation of FOM (Flow Object Model).
Nested Class Summary | |
---|---|
static class |
FOM_Cocoon.FOM_Context
JS wrapper for Cocoon's context object. |
static class |
FOM_Cocoon.FOM_Request
JS wrapper for Cocoon's request object. |
static class |
FOM_Cocoon.FOM_Session
JS wrapper for Cocoon's session object. |
Field Summary | |
---|---|
protected PageLocalScopeHolder |
pageLocal
|
Fields inherited from class org.mozilla.javascript.ScriptableObject |
---|
DONTENUM, EMPTY, PERMANENT, READONLY |
Fields inherited from interface org.mozilla.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
FOM_Cocoon()
|
Method Summary | |
---|---|
void |
forwardTo(String uri,
Object bean,
FOM_WebContinuation fom_wk)
Call the Cocoon Sitemap to process a page |
String |
getClassName()
|
Context |
getContext()
Get the current context |
String |
getInterpreterId()
Required by FOM_WebContinuation. |
protected Logger |
getLogger()
|
Map |
getObjectModel()
Get the current object model |
org.mozilla.javascript.Scriptable |
getParameters()
|
Request |
getRequest()
Get the current request |
Response |
getResponse()
Get the current response |
ServiceManager |
getServiceManager()
|
Session |
getSession()
Get the current session |
void |
handleContinuation(String kontId,
org.mozilla.javascript.Scriptable parameters)
Perform the behavior of |
Object |
jsFunction_createObject(Object classObj)
Create and setup an object so that it can access the information provided to regular components. |
org.mozilla.javascript.Scriptable |
jsFunction_createPageLocal()
|
void |
jsFunction_disposeObject(Object obj)
Dispose an object that has been created using jsFunction_createObject(Object) . |
Object |
jsFunction_getComponent(String id)
Access components. |
Object |
jsFunction_load(String filename)
Load the script file specified as argument. |
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. |
void |
jsFunction_processPipelineTo(String uri,
Object map,
Object outputStream)
|
void |
jsFunction_redirectTo(String uri,
boolean isGlobal)
|
void |
jsFunction_releaseComponent(Object component)
Release pooled components. |
FOM_WebContinuation |
jsFunction_sendPage(String uri,
Object obj,
Object wk)
|
void |
jsFunction_sendStatus(int sc)
|
Object |
jsFunction_setupObject(Object obj)
Setup an object so that it can access the information provided to regular components. |
org.mozilla.javascript.Scriptable |
jsGet_context()
|
FOM_WebContinuation |
jsGet_continuation()
|
org.mozilla.javascript.Scriptable |
jsGet_log()
|
org.mozilla.javascript.Scriptable |
jsGet_parameters()
Get Sitemap parameters |
org.mozilla.javascript.Scriptable |
jsGet_request()
|
org.mozilla.javascript.Scriptable |
jsGet_response()
|
org.mozilla.javascript.Scriptable |
jsGet_session()
|
void |
jsSet_continuation(Object obj)
|
FOM_WebContinuation |
makeWebContinuation(org.mozilla.javascript.continuations.Continuation k,
FOM_WebContinuation parent,
int timeToLive)
Create a Web Continuation from a JS Continuation |
void |
popCallContext()
|
void |
pushCallContext(FOM_JavaScriptInterpreter interp,
Redirector redirector,
ServiceManager manager,
Context avalonContext,
Logger logger,
WebContinuation lastContinuation)
|
Methods inherited from class org.mozilla.javascript.ScriptableObject |
---|
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isSealed, put, put, putProperty, putProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PageLocalScopeHolder pageLocal
Constructor Detail |
---|
public FOM_Cocoon()
Method Detail |
---|
public String getClassName()
getClassName
in interface org.mozilla.javascript.Scriptable
getClassName
in class org.mozilla.javascript.ScriptableObject
public void pushCallContext(FOM_JavaScriptInterpreter interp, Redirector redirector, ServiceManager manager, Context avalonContext, Logger logger, WebContinuation lastContinuation)
public void popCallContext()
public FOM_WebContinuation jsGet_continuation()
public void jsSet_continuation(Object obj)
public FOM_WebContinuation jsFunction_sendPage(String uri, Object obj, Object wk) throws Exception
Exception
public org.mozilla.javascript.Scriptable jsFunction_createPageLocal()
public void jsFunction_processPipelineTo(String uri, Object map, Object outputStream) throws Exception
Exception
public void jsFunction_redirectTo(String uri, boolean isGlobal) throws Exception
Exception
public void jsFunction_sendStatus(int sc)
public Object jsFunction_getComponent(String id) throws Exception
Exception
public void jsFunction_releaseComponent(Object component) throws Exception
component
- a component
Exception
public Object jsFunction_load(String filename) throws Exception
filename
- a String
value
Object
value
org.mozilla.javascript.JavaScriptException
- if an error occurs
Exception
public Object jsFunction_setupObject(Object obj) throws Exception
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 ContextHelper
class.
Note that Configurable
is ignored, as no configuration exists in a flowscript that
can be passed to the object.
obj
- the object to setup
var foo = cocoon.setupObject(new Foo());
).
Exception
- if something goes wrong during setup.public Object jsFunction_createObject(Object classObj) throws Exception
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 ContextHelper
class.
Note that Configurable
is ignored, as no configuration exists in a flowscript that
can be passed to the object.
classObj
- the class to instantiate, either as a String or a Rhino NativeJavaClass object
clazz
Exception
- if something goes wrong either during instantiation or setup.public void jsFunction_disposeObject(Object obj) throws Exception
jsFunction_createObject(Object)
.
obj
-
Exception
public org.mozilla.javascript.Scriptable jsGet_request()
public org.mozilla.javascript.Scriptable jsGet_response()
public org.mozilla.javascript.Scriptable jsGet_log()
public org.mozilla.javascript.Scriptable jsGet_context()
public org.mozilla.javascript.Scriptable jsGet_session()
public org.mozilla.javascript.Scriptable jsGet_parameters()
Scriptable
value whose properties represent
the Sitemap parameters from public org.mozilla.javascript.Scriptable getParameters()
public Request getRequest()
public Session getSession()
public Response getResponse()
public Context getContext()
public Map getObjectModel()
protected Logger getLogger()
public ServiceManager getServiceManager()
public String getInterpreterId()
public void forwardTo(String uri, Object bean, FOM_WebContinuation fom_wk) throws Exception
uri
- Uri to matchbean
- Input to pagefom_wk
- Current Web continuation (may be null)
Exception
public void handleContinuation(String kontId, org.mozilla.javascript.Scriptable parameters) throws Exception
kontId
- The continuation idparameters
- Any parameters you want to pass to the continuation (may be null)
Exception
public FOM_WebContinuation jsFunction_makeWebContinuation(Object k, Object ttl) throws Exception
k
- The JS continuationttl
- Lifetime for this continuation (zero means no limit)
Exception
public FOM_WebContinuation makeWebContinuation(org.mozilla.javascript.continuations.Continuation k, FOM_WebContinuation parent, int timeToLive) throws Exception
k
- The JS continuation (may be null - null will be returned in that case)parent
- The parent of this continuation (may be null)timeToLive
- Lifetime for this continuation (zero means no limit)
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |