org.apache.cocoon.components.flow.javascript.fom
Class AO_FOM_Cocoon

java.lang.Object
  extended byorg.mozilla.javascript.ScriptableObject
      extended byorg.apache.cocoon.components.flow.javascript.fom.AO_FOM_Cocoon
All Implemented Interfaces:
org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable, Serializable

public class AO_FOM_Cocoon
extends org.mozilla.javascript.ScriptableObject

Implementation of FOM (Flow Object Model).

Since:
2.1
Version:
CVS $Id: AO_FOM_Cocoon.java 106091 2004-11-21 14:20:13Z lgawron $
Author:
Christopher Oliver, Reinhard Poetz
See Also:
Serialized Form

Nested Class Summary
static class AO_FOM_Cocoon.FOM_Context
           
static class AO_FOM_Cocoon.FOM_Cookie
           
static class AO_FOM_Cocoon.FOM_Log
           
static class AO_FOM_Cocoon.FOM_Request
           
static class AO_FOM_Cocoon.FOM_Response
           
static class AO_FOM_Cocoon.FOM_Session
           
 
Field Summary
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
DONTENUM, EMPTY, PERMANENT, READONLY
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
AO_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
 Map getObjectModel()
          Get the current object model
 Request getRequest()
          Get the current request
 Response getResponse()
          Get the current response
 Session getSession()
          Get the current session
 void handleContinuation(String kontId, org.mozilla.javascript.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.
 void jsFunction_apply(String script)
          Dummy function for apply methods which does nothing - only necessary to make it easy to switch between the interception aware interpreter (intercepted-javascript) and the other (javascript).
 Object jsFunction_getComponent(String id)
          Access components.
 Object jsFunction_load(String filename)
          Load the script file specified as argument.
 void jsFunction_processPipelineTo(String uri, Object map, Object outputStream)
           
 void jsFunction_redirectTo(String uri)
           
 void jsFunction_releaseComponent(Object component)
          Release pooled components.
 FOM_WebContinuation jsFunction_sendPage(String uri, Object obj, Object continuation)
           
 AO_FOM_Cocoon.FOM_Context jsGet_context()
           
 AO_FOM_Cocoon.FOM_Log jsGet_log()
           
 org.mozilla.javascript.Scriptable jsGet_parameters()
          Get Sitemap parameters
 AO_FOM_Cocoon.FOM_Request jsGet_request()
           
 AO_FOM_Cocoon.FOM_Response jsGet_response()
           
 AO_FOM_Cocoon.FOM_Session jsGet_session()
           
 FOM_WebContinuation makeWebContinuation(org.mozilla.javascript.continuations.Continuation k, FOM_WebContinuation parent, int timeToLive)
          Create a Web Continuation from a JS Continuation
protected static Object unwrap(Object obj)
           
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, callMethod, callMethod, 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
 

Constructor Detail

AO_FOM_Cocoon

public AO_FOM_Cocoon()
Method Detail

getClassName

public String getClassName()

jsFunction_sendPage

public FOM_WebContinuation jsFunction_sendPage(String uri,
                                               Object obj,
                                               Object continuation)
                                        throws Exception
Throws:
Exception

jsFunction_processPipelineTo

public void jsFunction_processPipelineTo(String uri,
                                         Object map,
                                         Object outputStream)
                                  throws Exception
Throws:
Exception

jsFunction_redirectTo

public void jsFunction_redirectTo(String uri)
                           throws Exception
Throws:
Exception

jsFunction_getComponent

public Object jsFunction_getComponent(String id)
                               throws Exception
Access components.

Parameters:
id - - role name of the component
Throws:
Exception

jsFunction_releaseComponent

public void jsFunction_releaseComponent(Object component)
                                 throws Exception
Release pooled components.

Parameters:
component - - an Object that is an instance of org.apache.avalon.framework.component.Component
Throws:
Exception

jsFunction_apply

public void jsFunction_apply(String script)
Dummy function for apply methods which does nothing - only necessary to make it easy to switch between the interception aware interpreter (intercepted-javascript) and the other (javascript). See cocoon.xconf for details.


jsFunction_load

public Object jsFunction_load(String filename)
                       throws Exception
Load the script file specified as argument.

Parameters:
filename - a String value
Returns:
an Object value
Throws:
org.mozilla.javascript.JavaScriptException - if an error occurs
Exception

jsGet_request

public AO_FOM_Cocoon.FOM_Request jsGet_request()

jsGet_response

public AO_FOM_Cocoon.FOM_Response jsGet_response()

jsGet_log

public AO_FOM_Cocoon.FOM_Log jsGet_log()

jsGet_context

public AO_FOM_Cocoon.FOM_Context jsGet_context()

jsGet_session

public AO_FOM_Cocoon.FOM_Session jsGet_session()

jsGet_parameters

public org.mozilla.javascript.Scriptable jsGet_parameters()
Get Sitemap parameters

Returns:
a Scriptable value whose properties represent the Sitemap parameters from

unwrap

protected static Object unwrap(Object obj)

getRequest

public Request getRequest()
Get the current request

Returns:
The request

getSession

public Session getSession()
Get the current session

Returns:
The session (may be null)

getResponse

public Response getResponse()
Get the current response

Returns:
The response

getContext

public Context getContext()
Get the current context

Returns:
The context

getObjectModel

public Map getObjectModel()
Get the current object model

Returns:
The object model

forwardTo

public void forwardTo(String uri,
                      Object bean,
                      FOM_WebContinuation fom_wk)
               throws Exception
Call the Cocoon Sitemap to process a page

Parameters:
uri - Uri to match
bean - Input to page
fom_wk - Current Web continuation (may be null)
Throws:
Exception

handleContinuation

public void handleContinuation(String kontId,
                               org.mozilla.javascript.Scriptable parameters)
                        throws Exception
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 - Any parameters you want to pass to the continuation (may be null)
Throws:
Exception

makeWebContinuation

public FOM_WebContinuation makeWebContinuation(org.mozilla.javascript.continuations.Continuation k,
                                               FOM_WebContinuation parent,
                                               int timeToLive)
                                        throws Exception
Create a Web Continuation from a JS Continuation

Parameters:
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)
Throws:
Exception


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.