Skip navigation links

Oracle® WebCenter Content Site Studio for External Applications Java API Reference
11g Release 1 (11.1.1)

E17273-03


oracle.stellent.wcm.client.script.vm
Class VelocityRequestContext

java.lang.Object
  extended by oracle.stellent.wcm.client.RequestContext
      extended by oracle.stellent.wcm.client.script.vm.VelocityRequestContext

All Implemented Interfaces:
org.apache.velocity.context.Context

public class VelocityRequestContext
extends RequestContext
implements org.apache.velocity.context.Context

Wrap the RequestContext and allow setting of attributes in current Velocity context instead of page context


Constructor Summary
VelocityRequestContext(RequestContext requestContext)
           

 

Method Summary
 boolean containsKey(java.lang.Object key)
          Indicates whether the specified key is in the context.
 java.lang.Object get(java.lang.String key)
          Gets the value corresponding to the provided key from the context.
 java.lang.Object getAttribute(java.lang.String name)
          Retrieve an attribute value
 java.util.Set<java.lang.String> getAttributeNames()
          Retrieve the attribute names for the given scope
 java.lang.String getContextPath()
           
 java.lang.Object[] getKeys()
          Get all the keys for the values in the context.
 java.util.Map<java.lang.String,java.lang.String> getParameters()
           
 java.lang.String getRequestPath()
           
 java.security.Principal getUserPrincipal()
           
 RequestContext getWrappedContext()
           
 java.io.Writer getWriter()
           
protected  void processImpl(java.lang.String path, boolean forward)
          Execute the path
 java.lang.Object put(java.lang.String key, java.lang.Object value)
          Adds a name/value pair to the context.
 java.lang.Object remove(java.lang.Object key)
          Removes the value associated with the specified key from the context.
 void sendRedirect(java.lang.String path)
          Send a redirect
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set an attribute value by name
 void setHeader(java.lang.String name, java.lang.String value)
          Set a response header

 

Methods inherited from class oracle.stellent.wcm.client.RequestContext
forward, getParameter, getSiteContext, include, process, setSiteContext, swapAttributes

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

VelocityRequestContext

public VelocityRequestContext(RequestContext requestContext)

Method Detail

getWrappedContext

public RequestContext getWrappedContext()

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
Adds a name/value pair to the context.
Specified by:
put in interface org.apache.velocity.context.Context
Parameters:
key - The name to key the provided value with.
value - The corresponding value.
Returns:
The old object or null if there was no old object.

get

public java.lang.Object get(java.lang.String key)
Gets the value corresponding to the provided key from the context.
Specified by:
get in interface org.apache.velocity.context.Context
Parameters:
key - The name of the desired value.
Returns:
The value corresponding to the provided key.

containsKey

public boolean containsKey(java.lang.Object key)
Indicates whether the specified key is in the context.
Specified by:
containsKey in interface org.apache.velocity.context.Context
Parameters:
key - The key to look for.
Returns:
Whether the key is in the context.

getKeys

public java.lang.Object[] getKeys()
Get all the keys for the values in the context.
Specified by:
getKeys in interface org.apache.velocity.context.Context
Returns:
All the keys for the values in the context.

remove

public java.lang.Object remove(java.lang.Object key)
Removes the value associated with the specified key from the context.
Specified by:
remove in interface org.apache.velocity.context.Context
Parameters:
key - The name of the value to remove.
Returns:
The value that the key was mapped to, or null if unmapped.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Set an attribute value by name
Specified by:
setAttribute in class RequestContext
Parameters:
name - the name
value - the value (null to remove)

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Retrieve an attribute value
Specified by:
getAttribute in class RequestContext
Parameters:
name - the name
Returns:
the value or null if not found

getParameters

public java.util.Map<java.lang.String,java.lang.String> getParameters()
Specified by:
getParameters in class RequestContext
Returns:
a map of all the request parameters

getContextPath

public java.lang.String getContextPath()
Specified by:
getContextPath in class RequestContext
Returns:
the context path all requests are rooted under
See Also:
HttpServletRequest.getContextPath()

getRequestPath

public java.lang.String getRequestPath()
Specified by:
getRequestPath in class RequestContext
Returns:
the path of the request

getUserPrincipal

public java.security.Principal getUserPrincipal()
Specified by:
getUserPrincipal in class RequestContext
Returns:
the security principal of the current user

sendRedirect

public void sendRedirect(java.lang.String path)
                  throws java.io.IOException
Send a redirect
Specified by:
sendRedirect in class RequestContext
Parameters:
path - the path to redirect
Throws:
java.io.IOException

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Set a response header
Specified by:
setHeader in class RequestContext
Parameters:
name - the name
value - the value

getWriter

public java.io.Writer getWriter()
                         throws java.io.IOException
Specified by:
getWriter in class RequestContext
Returns:
the writer for the given context
Throws:
java.io.IOException

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()
Retrieve the attribute names for the given scope
Specified by:
getAttributeNames in class RequestContext
Returns:
the set of attribute names

processImpl

protected void processImpl(java.lang.String path,
                           boolean forward)
                    throws java.lang.Exception
Execute the path
Specified by:
processImpl in class RequestContext
Parameters:
path - the web application page
forward - true to forward, false to include
Throws:
java.lang.Exception

Skip navigation links

Oracle® WebCenter Content Site Studio for External Applications Java API Reference
11g Release 1 (11.1.1)

E17273-03


Copyright © 2010, 2011, Oracle and/or its affiliates. All rights reserved.