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.javaee
Class ServletHelper

java.lang.Object
  extended by oracle.stellent.wcm.javaee.ServletHelper


public abstract class ServletHelper
extends java.lang.Object

Helper methods for working with servlet objects in the WCM environment.


Nested Class Summary
static class ServletHelper.ModeAndPath
           

 

Field Summary
protected static ILog s_log
           

 

Constructor Summary
ServletHelper()
           

 

Method Summary
static javax.servlet.http.Cookie getCookie(javax.servlet.ServletRequest request, java.lang.String cookieName)
          Retrieve the cookie
static oracle.stellent.ridc.IdcContext getIdentity(javax.servlet.ServletRequest request)
          Retrieve the identity on this request
static int getJspScope(java.lang.String name)
          Convert from the scope name to the int value
static ServletHelper.ModeAndPath getModeAndPath(javax.servlet.http.HttpServletRequest request, java.lang.String path)
          Determine the mode from the current path
static java.lang.String getOriginalRequestPath(javax.servlet.http.HttpServletRequest servletRequest)
          Retrieve the original request path (i.e.
static java.util.Map<java.lang.String,java.lang.String> getParameterMap(javax.servlet.http.HttpServletRequest request)
          Obtain a mapping of parameter name to values from the given request.
static java.lang.String getPreviewFromCookie(javax.servlet.ServletRequest request)
          Retrieve the designer mode from the cookie on the given request
static java.lang.String getRequestPath(javax.servlet.http.HttpServletRequest servletRequest)
           
static java.lang.String getServletContext(javax.servlet.http.HttpServletRequest request, boolean includeRequestContext)
          Retrieve the servlet context path when rendering a JSP; looks to see if this page was included by another web resource
static void initializeApplication(javax.servlet.ServletConfig servletConfig)
          Initialize the application environment
static void initializeApplication(javax.servlet.ServletContext servletContext)
          Deprecated. ServletContext doesn't have access to ServletConfig... it is the other way around
static boolean isContributorModeFromCookie(javax.servlet.ServletRequest request)
          Retrieve the site mode from the cookie on the given request
static boolean isDesignerFromCookie(javax.servlet.ServletRequest request)
          Retrieve the designer mode from the cookie on the given request
static boolean isMultipartPost(javax.servlet.http.HttpServletRequest request)
          Determine if the request is a multipart post

 

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

 

Field Detail

s_log

protected static ILog s_log

Constructor Detail

ServletHelper

public ServletHelper()

Method Detail

getModeAndPath

public static ServletHelper.ModeAndPath getModeAndPath(javax.servlet.http.HttpServletRequest request,
                                                       java.lang.String path)
Determine the mode from the current path
Parameters:
request - the http servlet request
path - the path
Returns:
the mode

getJspScope

public static int getJspScope(java.lang.String name)
Convert from the scope name to the int value
Parameters:
name - the scope name (page, request, session or application)
Returns:
the int value; returns PageContext.PAGE_SCOPE if no match is made

isContributorModeFromCookie

public static boolean isContributorModeFromCookie(javax.servlet.ServletRequest request)
Retrieve the site mode from the cookie on the given request
Parameters:
request - the current request
Returns:
true if the site is in contributor mode, false otherwise

isDesignerFromCookie

public static boolean isDesignerFromCookie(javax.servlet.ServletRequest request)
Retrieve the designer mode from the cookie on the given request
Parameters:
request - the current request
Returns:
true if the site is in contributor mode, false otherwise

getPreviewFromCookie

public static java.lang.String getPreviewFromCookie(javax.servlet.ServletRequest request)
Retrieve the designer mode from the cookie on the given request
Parameters:
request - the current request
Returns:
true if the site is in contributor mode, false otherwise

getCookie

public static javax.servlet.http.Cookie getCookie(javax.servlet.ServletRequest request,
                                                  java.lang.String cookieName)
Retrieve the cookie
Parameters:
request - the request
cookieName - the name of the cookie
Returns:
the cookie or null if not found

initializeApplication

@Deprecated
public static void initializeApplication(javax.servlet.ServletContext servletContext)
                                  throws javax.servlet.ServletException
Deprecated. ServletContext doesn't have access to ServletConfig... it is the other way around
Initialize the application environment
Parameters:
servletContext - the servlet context to initialize
Throws:
javax.servlet.ServletException

initializeApplication

public static void initializeApplication(javax.servlet.ServletConfig servletConfig)
                                  throws javax.servlet.ServletException
Initialize the application environment
Parameters:
servletConfig - the servlet context to initialize
Throws:
javax.servlet.ServletException

getIdentity

public static oracle.stellent.ridc.IdcContext getIdentity(javax.servlet.ServletRequest request)
Retrieve the identity on this request
Parameters:
request - the request to query
Returns:
the identity

getRequestPath

public static java.lang.String getRequestPath(javax.servlet.http.HttpServletRequest servletRequest)
Parameters:
servletRequest - the servlet request
Returns:
the site path

getOriginalRequestPath

public static java.lang.String getOriginalRequestPath(javax.servlet.http.HttpServletRequest servletRequest)
Retrieve the original request path (i.e. the request path of the item that included/forwarded this request)
Parameters:
servletRequest - the servlet request
Returns:
the site path

getParameterMap

public static java.util.Map<java.lang.String,java.lang.String> getParameterMap(javax.servlet.http.HttpServletRequest request)
Obtain a mapping of parameter name to values from the given request.
Parameters:
request - the request
Returns:
a mapping of parameter name to parameter value

getServletContext

public static java.lang.String getServletContext(javax.servlet.http.HttpServletRequest request,
                                                 boolean includeRequestContext)
Retrieve the servlet context path when rendering a JSP; looks to see if this page was included by another web resource
Parameters:
request - the servlet request
includeRequestContext - true to include the request context
Returns:
the context path

isMultipartPost

public static boolean isMultipartPost(javax.servlet.http.HttpServletRequest request)
Determine if the request is a multipart post
Parameters:
request - the current request
Returns:
true if this is a multipart post

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.