Adempiere 3.5.2a

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, MediaBroadcast, RequestServlet, 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 String buildDate
          special application templates ssometimes depend on a special version, this is to give them an idea.
protected static org.compiere.cm.cache.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 org.compiere.cm.cache.Container containerCache
          ContainerCache is storing the containers's often used by the system, to reduce DB lookups
protected static org.compiere.cm.cache.ContainerElement containerElementCache
          ContainerElementCache is storing the container's elements often used by the system, to reduce DB lookups
protected static org.compiere.cm.cache.ContainerTree containerTreeCache
          ContainerTreeCache is storing the container's tree often used by the system, to reduce DB lookups
protected  Properties ctx
          Context of this Servlet
protected static org.compiere.cm.cache.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 org.compiere.cm.cache.MediaServer mediaServerCache
          MediaServerCache is storing the project's media server in combination with Request Info
protected static org.compiere.cm.cache.Template templateCache
          TemplateCache stores the oftens used templates
protected static org.compiere.cm.cache.WebProject webProjectCache
          WebProject is storing the projects often used by the system, to reduce DB lookups
protected static org.compiere.cm.cache.XML xmlCache
          XMLCache stores the oftens used templates
 
Constructor Summary
HttpServletCM()
           
 
Method Summary
 String getBuildDate()
          Returns the current build version/date of the servlet engine, this is used by special application templates which depend on certain functionality to check for their availability.
 org.compiere.cm.cache.Chat getChatCache()
          Returns the ChatCache Object
 org.compiere.cm.cache.Container getContainerCache()
          Returns the ContainerCache Object
 org.compiere.cm.cache.ContainerElement getContainerElementCache()
          Returns the ContainerElementCache Object
 org.compiere.cm.cache.ContainerTree getContainerTreeCache()
          Returns the ContainerTreeCache Object
 Properties getCtx()
          Returns the Context of the current session.
 org.compiere.cm.cache.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
 org.compiere.cm.cache.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
 org.compiere.cm.cache.Template getTemplateCache()
          Returns the Template Object
 org.compiere.cm.cache.WebProject getWebProjectCache()
          Returns the WebProjectCache Object
 org.compiere.cm.cache.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


buildDate

protected static String buildDate
special application templates ssometimes depend on a special version, this is to give them an idea. Is included in the XML Code.


domainCache

protected static org.compiere.cm.cache.Domain domainCache
DomainCache is storing the domains of the system, to reduce DB lookups


webProjectCache

protected static org.compiere.cm.cache.WebProject webProjectCache
WebProject is storing the projects often used by the system, to reduce DB lookups


chatCache

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


containerCache

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


containerElementCache

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


containerTreeCache

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


mediaServerCache

protected static org.compiere.cm.cache.MediaServer mediaServerCache
MediaServerCache is storing the project's media server in combination with Request Info


templateCache

protected static org.compiere.cm.cache.Template templateCache
TemplateCache stores the oftens used templates


xmlCache

protected static org.compiere.cm.cache.XML xmlCache
XMLCache stores the oftens used templates


ctx

protected Properties 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

getBuildDate

public String getBuildDate()
Returns the current build version/date of the servlet engine, this is used by special application templates which depend on certain functionality to check for their availability.

Returns:
the Build Date as a string in format YYYYMMDDHHMM

getContainerCache

public org.compiere.cm.cache.Container getContainerCache()
Returns the ContainerCache Object

Returns:
CO Object Container

getChatCache

public org.compiere.cm.cache.Chat getChatCache()
Returns the ChatCache Object

Returns:
CO Object Chat

getContainerElementCache

public org.compiere.cm.cache.ContainerElement getContainerElementCache()
Returns the ContainerElementCache Object

Returns:
CO Object ContainerElement

getContainerTreeCache

public org.compiere.cm.cache.ContainerTree getContainerTreeCache()
Returns the ContainerTreeCache Object

Returns:
CO Object ContainerElement

getDomainCache

public org.compiere.cm.cache.Domain getDomainCache()
Returns the DomainCache Object

Returns:
CO Object Domain

getMediaServerCache

public org.compiere.cm.cache.MediaServer getMediaServerCache()
Returns the MediaServerCache Object

Returns:
CO Object MediaServer

getWebProjectCache

public org.compiere.cm.cache.WebProject getWebProjectCache()
Returns the WebProjectCache Object

Returns:
CO Object WebProject

getTemplateCache

public org.compiere.cm.cache.Template getTemplateCache()
Returns the Template Object

Returns:
CO Object Template

getXMLCache

public org.compiere.cm.cache.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 Properties 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

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.