Compiere 3.1

org.compiere.cm
Class HttpServletCM

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.compiere.cm.HttpServletCM
All Implemented Interfaces:
Serializable, Servlet, ServletConfig
Direct Known Subclasses:
AdRedirector, Broadcast, Community, Invoice, InvoiceServlet, MediaBroadcast, RequestServlet, Service, StageBroadcast, XMLBroadcast

public class HttpServletCM
extends HttpServlet

HttpServletCM we extended the normal HttpServlet to store some global environment and cache here

Version:
$Id$
Author:
Yves Sandfort
See Also:
Serialized Form

Field Summary
protected static Chat chatCache
          ChatCache is storing the chat's often used by the system, to reduce DB lookups
protected static boolean configLoaded
          status if config is loaded... true if loaded false is default after startup
protected static Container containerCache
          ContainerCache is storing the containers's often used by the system, to reduce DB lookups
protected static ContainerElement containerElementCache
          ContainerElementCache is storing the container's elements often used by the system, to reduce DB lookups
protected static ContainerTree containerTreeCache
          ContainerTreeCache is storing the container's tree often used by the system, to reduce DB lookups
protected  Ctx ctx
          Context of this Servlet
protected static Domain domainCache
          DomainCache is storing the domains of the system, to reduce DB lookups
protected static String ErrorMessage
          belongs to fatalError, should get a corresponding error message to display in the web frontend. null if no error
protected  String externalMediaURL
          String containing the external media URL
protected static boolean fatalError
          fatalError stores a shared variable which will be set to yes whenever a global Server Error from which we can not recover occurs.
protected  String internalMediaURL
          String containing the internal media path (should not be used for real page deployment) the normal broadcaster will replace this URL with the correct media server for this client
protected  CLogger log
          Logger
protected static MediaServer mediaServerCache
          MediaServerCache is storing the project's media server in combination with Request Info
protected static Template templateCache
          TemplateCache stores the oftens used templates
protected static WebProject webProjectCache
          WebProject is storing the projects often used by the system, to reduce DB lookups
protected static WikiToken wikiCache
          WikiCache stores the wiki tokens for faster resolution
protected static XML xmlCache
          XMLCache stores the oftens used templates
 
Constructor Summary
HttpServletCM()
           
 
Method Summary
 Chat getChatCache()
          Returns the ChatCache Object
 Container getContainerCache()
          Returns the ContainerCache Object
 ContainerElement getContainerElementCache()
          Returns the ContainerElementCache Object
 ContainerTree getContainerTreeCache()
          Returns the ContainerTreeCache Object
 Ctx getCtx()
          Returns the Context of the current session.
 Domain getDomainCache()
          Returns the DomainCache Object
 String getExternalMediaURL()
          Returns the current External Media URL be carefull this Function needs to be called after the URL is set!
 String getExternalMediaURL(int CM_WebProject_ID)
          Returns the current External Media URL for the Project
 String getInternalMediaURL()
          Returns the internalMediaURL for replacement
 CLogger getLogger()
          get Servlet Logger
 MediaServer getMediaServerCache()
          Returns the MediaServerCache Object
 String getSessionMediaURL(HttpServletRequest request, int CM_WebProject_ID)
          Returns the sessionMediaURL, this is the ideal Media URL for this Request
 Template getTemplateCache()
          Returns the Template Object
 WebProject getWebProjectCache()
          Returns the WebProjectCache Object
 WikiToken getWikiTokenCache()
          Returns the WikiToken Object
 XML getXMLCache()
          Returns the Template Object
 void init(ServletConfig config)
          Init
 void resetInternalMediaURL(HttpServletRequest request)
          Sets internal Media URL
 void setAD_Client_ID(int newVal)
          setAD_Client_ID to update AD_Client as soon System has recognized the Client
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configLoaded

protected static boolean configLoaded
status if config is loaded... true if loaded false is default after startup


fatalError

protected static boolean fatalError
fatalError stores a shared variable which will be set to yes whenever a global Server Error from which we can not recover occurs. You should not set it manually as will stop all servlet's and will not rerun them unless set back to false true if there is a global error false if there is no global error


ErrorMessage

protected static String ErrorMessage
belongs to fatalError, should get a corresponding error message to display in the web frontend. null if no error


domainCache

protected static Domain domainCache
DomainCache is storing the domains of the system, to reduce DB lookups


webProjectCache

protected static WebProject webProjectCache
WebProject is storing the projects often used by the system, to reduce DB lookups


chatCache

protected static Chat chatCache
ChatCache is storing the chat's often used by the system, to reduce DB lookups


containerCache

protected static Container containerCache
ContainerCache is storing the containers's often used by the system, to reduce DB lookups


containerElementCache

protected static ContainerElement containerElementCache
ContainerElementCache is storing the container's elements often used by the system, to reduce DB lookups


containerTreeCache

protected static ContainerTree containerTreeCache
ContainerTreeCache is storing the container's tree often used by the system, to reduce DB lookups


mediaServerCache

protected static MediaServer mediaServerCache
MediaServerCache is storing the project's media server in combination with Request Info


templateCache

protected static Template templateCache
TemplateCache stores the oftens used templates


wikiCache

protected static WikiToken wikiCache
WikiCache stores the wiki tokens for faster resolution


xmlCache

protected static XML xmlCache
XMLCache stores the oftens used templates


ctx

protected Ctx ctx
Context of this Servlet


internalMediaURL

protected String internalMediaURL
String containing the internal media path (should not be used for real page deployment) the normal broadcaster will replace this URL with the correct media server for this client


externalMediaURL

protected String externalMediaURL
String containing the external media URL


log

protected CLogger log
Logger

Constructor Detail

HttpServletCM

public HttpServletCM()
Method Detail

init

public void init(ServletConfig config)
          throws ServletException
Init

Specified by:
init in interface Servlet
Overrides:
init in class GenericServlet
Parameters:
config -
Throws:
ServletException

getContainerCache

public Container getContainerCache()
Returns the ContainerCache Object

Returns:
CO Object Container

getChatCache

public Chat getChatCache()
Returns the ChatCache Object

Returns:
CO Object Chat

getContainerElementCache

public ContainerElement getContainerElementCache()
Returns the ContainerElementCache Object

Returns:
CO Object ContainerElement

getContainerTreeCache

public ContainerTree getContainerTreeCache()
Returns the ContainerTreeCache Object

Returns:
CO Object ContainerElement

getDomainCache

public Domain getDomainCache()
Returns the DomainCache Object

Returns:
CO Object Domain

getMediaServerCache

public MediaServer getMediaServerCache()
Returns the MediaServerCache Object

Returns:
CO Object MediaServer

getWebProjectCache

public WebProject getWebProjectCache()
Returns the WebProjectCache Object

Returns:
CO Object WebProject

getTemplateCache

public Template getTemplateCache()
Returns the Template Object

Returns:
CO Object Template

getWikiTokenCache

public WikiToken getWikiTokenCache()
Returns the WikiToken Object

Returns:
CO Object WikiToken

getXMLCache

public XML getXMLCache()
Returns the Template Object

Returns:
CO Object Template

getInternalMediaURL

public String getInternalMediaURL()
Returns the internalMediaURL for replacement

Returns:
String with internal MediaURL normally context + "/" + media + "/"

getSessionMediaURL

public String getSessionMediaURL(HttpServletRequest request,
                                 int CM_WebProject_ID)
Returns the sessionMediaURL, this is the ideal Media URL for this Request

Parameters:
request - the Request for this
CM_WebProject_ID - Returns the WebProject ID
Returns:
String with session MediaURL, if none found we return the internal one

resetInternalMediaURL

public void resetInternalMediaURL(HttpServletRequest request)
Sets internal Media URL

Parameters:
request -

getCtx

public Ctx getCtx()
Returns the Context of the current session. This is a very sensitive function as we will take care of all parameters here!

Returns:
Context

getExternalMediaURL

public String getExternalMediaURL(int CM_WebProject_ID)
Returns the current External Media URL for the Project

Parameters:
CM_WebProject_ID - WebProject
Returns:
ExternalMediaURL as String

getExternalMediaURL

public String getExternalMediaURL()
Returns the current External Media URL be carefull this Function needs to be called after the URL is set!

Returns:
ExternalMediaURL as String

setAD_Client_ID

public void setAD_Client_ID(int newVal)
setAD_Client_ID to update AD_Client as soon System has recognized the Client

Parameters:
newVal -

getLogger

public CLogger getLogger()
get Servlet Logger

Returns:
CLooger log

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.