Package org.compiere.util
Class WebEnv
- java.lang.Object
-
- org.compiere.util.WebEnv
-
public class WebEnv extends Object
Web Environment and debugging- Version:
- $Id: WebEnv.java,v 1.2 2006/07/30 00:51:05 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHARSETCharacter Set (iso-8859-1 - utf-8)static StringCOOKIE_INFOCookie Namestatic booleanDEBUGAdd HTML Debug Infostatic StringDIR_BASEBase Directory links http://localhost:8080/adempiere to the physical %adempiere_HOME%/jetty/webroot/adempiere directorystatic StringENCODINGEncoding (ISO-8859-1 - UTF-8)static StringNBSPNot Braking Spacestatic StringTARGET_CMDFrame name for Commands - WCmdstatic StringTARGET_MENUFrame name for Menu - WMenustatic StringTARGET_POPUPFrame name for Apps PopUp - WPopUpstatic StringTARGET_WINDOWFrame name for Apps Window - WWindowstatic intTIMEOUTTimeout - 15 Minutes
-
Constructor Summary
Constructors Constructor Description WebEnv()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddFooter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServlet servlet, org.apache.ecs.xhtml.body body)Add Footer (with diagnostics)static voiddump(javax.servlet.http.HttpServletRequest request)Dump Requeststatic voiddump(javax.servlet.http.HttpSession session)Dump Sessionstatic voiddump(javax.servlet.ServletConfig config)Dump Servlet Configstatic voiddump(javax.servlet.ServletContext ctx)Dump Sessionstatic StringgetBaseDirectory(String entry)Get Base Directory entry.static StringgetCellContent(int content)Get Cell Contentstatic StringgetCellContent(Object content)Get Cell Contentstatic StringgetImageDirectory(String entry)Get Image Directory entry.static org.apache.ecs.xhtml.imggetLogo()Get Logo Image HTML tag.static StringgetLogoURL()Get Logo Path.static StringgetStoreDirectory(String entry)Get Store Directory entry.static StringgetStylesheetURL()Get Stylesheet Path.static booleaninitWeb(javax.servlet.ServletConfig config)Init Web Environment.static booleaninitWeb(javax.servlet.ServletContext context)Init Web.
-
-
-
Field Detail
-
DEBUG
public static boolean DEBUG
Add HTML Debug Info
-
DIR_BASE
public static final String DIR_BASE
Base Directory links http://localhost:8080/adempiere to the physical %adempiere_HOME%/jetty/webroot/adempiere directory- See Also:
- Constant Field Values
-
TARGET_CMD
public static final String TARGET_CMD
Frame name for Commands - WCmd- See Also:
- Constant Field Values
-
TARGET_MENU
public static final String TARGET_MENU
Frame name for Menu - WMenu- See Also:
- Constant Field Values
-
TARGET_WINDOW
public static final String TARGET_WINDOW
Frame name for Apps Window - WWindow- See Also:
- Constant Field Values
-
TARGET_POPUP
public static final String TARGET_POPUP
Frame name for Apps PopUp - WPopUp- See Also:
- Constant Field Values
-
CHARSET
public static final String CHARSET
Character Set (iso-8859-1 - utf-8)- See Also:
- Constant Field Values
-
ENCODING
public static final String ENCODING
Encoding (ISO-8859-1 - UTF-8)- See Also:
- Constant Field Values
-
COOKIE_INFO
public static final String COOKIE_INFO
Cookie Name- See Also:
- Constant Field Values
-
TIMEOUT
public static final int TIMEOUT
Timeout - 15 Minutes- See Also:
- Constant Field Values
-
NBSP
public static String NBSP
Not Braking Space
-
-
Method Detail
-
initWeb
public static boolean initWeb(javax.servlet.ServletConfig config)
Init Web Environment. To be called from every Servlet in the init method or any other Web resource to make sure that the environment is properly set.- Parameters:
config- config- Returns:
- false if initialization problems
-
initWeb
public static boolean initWeb(javax.servlet.ServletContext context)
Init Web. Only call directly for Filters, etc.- Parameters:
context- servlet context- Returns:
- false if initialization problems
-
getBaseDirectory
public static String getBaseDirectory(String entry)
Get Base Directory entry.
/adempiere/- Parameters:
entry- file entry or path- Returns:
- url to entry in base directory
-
getImageDirectory
public static String getImageDirectory(String entry)
Get Image Directory entry.
/adempiere/images- Parameters:
entry- file entry or path- Returns:
- url to entry in image directory
-
getStoreDirectory
public static String getStoreDirectory(String entry)
Get Store Directory entry.
/adempiere/store- Parameters:
entry- file entry or path- Returns:
- url to entry in store directory
-
getLogoURL
public static String getLogoURL()
Get Logo Path./adempiere/LogoSmall.gif
- Returns:
- url to logo
-
getLogo
public static org.apache.ecs.xhtml.img getLogo()
Get Logo Image HTML tag.- Returns:
- Image
-
getStylesheetURL
public static String getStylesheetURL()
Get Stylesheet Path./adempiere/standard.css
- Returns:
- url of Stylesheet
-
getCellContent
public static String getCellContent(Object content)
Get Cell Content- Parameters:
content- optional content- Returns:
- string content or non breaking space
-
getCellContent
public static String getCellContent(int content)
Get Cell Content- Parameters:
content- optional content- Returns:
- string content
-
dump
public static void dump(javax.servlet.ServletConfig config)
Dump Servlet Config- Parameters:
config- config
-
dump
public static void dump(javax.servlet.ServletContext ctx)
Dump Session- Parameters:
ctx- servlet context
-
dump
public static void dump(javax.servlet.http.HttpSession session)
Dump Session- Parameters:
session- session
-
dump
public static void dump(javax.servlet.http.HttpServletRequest request)
Dump Request- Parameters:
request- request
-
addFooter
public static void addFooter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpServlet servlet, org.apache.ecs.xhtml.body body)Add Footer (with diagnostics)- Parameters:
request- requestresponse- responseservlet- servletbody- - Body to add footer
-
-