com.netscape.cms.servlet.common
Class CMSGateway

java.lang.Object
  extended by com.netscape.cms.servlet.common.CMSGateway

public class CMSGateway
extends java.lang.Object

This class is to hold some general method for servlets.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Field Summary
protected static java.lang.String AUTHMGR_PARAM
           
static java.lang.String CERT_ATTR
           
protected static boolean mEnableFileServing
           
protected static CMSFileLoader mFileLoader
           
protected static ILogger mLogger
           
static java.lang.String PROP_CMSGATEWAY
           
 
Constructor Summary
CMSGateway()
           
 
Method Summary
static AuthToken checkAuthManager(javax.servlet.http.HttpServletRequest httpReq, IArgBlock httpParams, java.security.cert.X509Certificate cert, java.lang.String authMgrName)
           
static void disableAdminEnroll()
           
static AuthCredentials getAuthCreds(IAuthManager authMgr, IArgBlock argBlock, java.security.cert.X509Certificate clientCert)
          construct a authentication credentials to pass into authentication manager.
static boolean getEnableAdminEnroll()
           
static java.io.File getLangFile(javax.servlet.http.HttpServletRequest req, java.io.File realpathFile, java.util.Locale[] locale)
           
static java.util.Locale getLocale(java.lang.String lang)
           
protected static CMSTemplate getTemplate(java.lang.String templateName, javax.servlet.http.HttpServletRequest httpReq, javax.servlet.ServletConfig servletConfig, CMSFileLoader fileLoader, java.util.Locale[] locale)
          get a template
static boolean modifiedSince(javax.servlet.http.HttpServletRequest req, long lastModified)
          Get the If-Modified-Since header and compare it to the millisecond epoch value passed in.
static void renderTemplate(java.lang.String templateName, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, javax.servlet.ServletConfig servletConfig, CMSFileLoader fileLoader)
           
static void setEnableAdminEnroll(boolean enableAdminEnroll)
           
static java.util.Hashtable toHashtable(javax.servlet.http.HttpServletRequest req)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_CMSGATEWAY

public static final java.lang.String PROP_CMSGATEWAY
See Also:
Constant Field Values

CERT_ATTR

public static final java.lang.String CERT_ATTR
See Also:
Constant Field Values

mFileLoader

protected static CMSFileLoader mFileLoader

mEnableFileServing

protected static boolean mEnableFileServing

mLogger

protected static ILogger mLogger

AUTHMGR_PARAM

protected static final java.lang.String AUTHMGR_PARAM
See Also:
Constant Field Values
Constructor Detail

CMSGateway

public CMSGateway()
Method Detail

toHashtable

public static java.util.Hashtable toHashtable(javax.servlet.http.HttpServletRequest req)

getEnableAdminEnroll

public static boolean getEnableAdminEnroll()

setEnableAdminEnroll

public static void setEnableAdminEnroll(boolean enableAdminEnroll)
                                 throws EBaseException
Throws:
EBaseException

disableAdminEnroll

public static void disableAdminEnroll()
                               throws EBaseException
Throws:
EBaseException

getAuthCreds

public static AuthCredentials getAuthCreds(IAuthManager authMgr,
                                           IArgBlock argBlock,
                                           java.security.cert.X509Certificate clientCert)
                                    throws EBaseException
construct a authentication credentials to pass into authentication manager.

Throws:
EBaseException

checkAuthManager

public static AuthToken checkAuthManager(javax.servlet.http.HttpServletRequest httpReq,
                                         IArgBlock httpParams,
                                         java.security.cert.X509Certificate cert,
                                         java.lang.String authMgrName)
                                  throws EBaseException
Throws:
EBaseException

renderTemplate

public static void renderTemplate(java.lang.String templateName,
                                  javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse resp,
                                  javax.servlet.ServletConfig servletConfig,
                                  CMSFileLoader fileLoader)
                           throws EBaseException,
                                  java.io.IOException
Throws:
EBaseException
java.io.IOException

getLocale

public static java.util.Locale getLocale(java.lang.String lang)

getLangFile

public static java.io.File getLangFile(javax.servlet.http.HttpServletRequest req,
                                       java.io.File realpathFile,
                                       java.util.Locale[] locale)
                                throws java.io.IOException
Parameters:
req - http servlet request
realpathFile - the file to get.
locale - array of at least one to be filled with locale found.
Throws:
java.io.IOException

getTemplate

protected static CMSTemplate getTemplate(java.lang.String templateName,
                                         javax.servlet.http.HttpServletRequest httpReq,
                                         javax.servlet.ServletConfig servletConfig,
                                         CMSFileLoader fileLoader,
                                         java.util.Locale[] locale)
                                  throws EBaseException,
                                         java.io.IOException
get a template

Throws:
EBaseException
java.io.IOException

modifiedSince

public static boolean modifiedSince(javax.servlet.http.HttpServletRequest req,
                                    long lastModified)
Get the If-Modified-Since header and compare it to the millisecond epoch value passed in. If there is no header, or there is a problem parsing the value, or if the file has been modified this will return true, indicating the file has changed.

Parameters:
lastModified - The time value in milliseconds past the epoch to compare the If-Modified-Since header to.