|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compiere.util.WebUtil
public final class WebUtil
Servlet Utilities
| Constructor Summary | |
|---|---|
WebUtil()
|
|
| Method Summary | |
|---|---|
static void |
addCookieWebUser(HttpServletRequest request,
HttpServletResponse response,
String webUser,
String COOKIE_NAME)
Add Cookie with web user |
static org.apache.ecs.xhtml.option[] |
convertToOption(NamePair[] list,
String default_ID)
Convert Array of NamePair to HTTP Option Array. |
static org.apache.ecs.xhtml.input |
createClosePopupButton()
Get Close PopUp Buton |
static void |
createErrorPage(HttpServletRequest request,
HttpServletResponse response,
HttpServlet servlet,
String message)
Create Error Message |
static org.apache.ecs.xhtml.tr |
createField(org.apache.ecs.xhtml.tr line,
String FORMNAME,
String PARAMETER,
String labelText,
String inputType,
Object value,
int sizeDisplay,
int size,
boolean longField,
boolean mandatory,
String onChange,
StringBuffer script)
Create label/field table row |
static void |
createForwardPage(HttpServletResponse response,
String title,
String forwardURL,
int delaySec)
Create Forward Page |
static void |
createLoginPage(HttpServletRequest request,
HttpServletResponse response,
HttpServlet servlet,
Ctx ctx,
String AD_Message)
Create Exit Page "Log-off". |
static void |
createResponse(HttpServletRequest request,
HttpServletResponse response,
HttpServlet servlet,
Properties cookieProperties,
WebDoc doc,
boolean debug)
Create Standard Response Header with optional Cookie and print document. |
static void |
createTimeoutPage(HttpServletRequest request,
HttpServletResponse response,
HttpServlet servlet,
String message)
Create Timeout Message |
static void |
deleteCookieWebUser(HttpServletRequest request,
HttpServletResponse response,
String COOKIE_NAME)
Remove Cookie with web user by setting user to _ |
static boolean |
exists(HttpServletRequest request,
String parameter)
Does Parameter exist |
static boolean |
exists(String test)
Does Test exist |
static org.apache.ecs.xhtml.script |
getClearFrame(String targetFrame)
Create Java Script to clear Target frame |
static Properties |
getCookieProperties(HttpServletRequest request)
Get Cookie Properties |
static HtmlCode |
getForward(String url,
int delaySec)
Return a link and script with new location. |
static String |
getFrom(HttpServletRequest request)
Get Remote From info |
static org.apache.ecs.xhtml.button |
getLoginButton(Ctx ctx)
Create Login Button - replace Window |
static String |
getParameter(HttpServletRequest request,
String parameter)
Get String Parameter. |
static BigDecimal |
getParameterAsBD(HttpServletRequest request,
String parameter)
Get numeric Parameter - 0 if not defined |
static boolean |
getParameterAsBoolean(HttpServletRequest request,
String parameter)
Get boolean Parameter. |
static boolean |
getParameterAsBoolean(HttpServletRequest request,
String parameter,
String expected)
Get boolean Parameter. |
static Timestamp |
getParameterAsDate(HttpServletRequest request,
String parameter)
Get date Parameter - null if not defined. |
static Timestamp |
getParameterAsDate(HttpServletRequest request,
String parameter,
Language language)
Get date Parameter - null if not defined. |
static int |
getParameterAsInt(HttpServletRequest request,
String parameter)
Get integer Parameter - 0 if not defined. |
static String[] |
getParameterValues(HttpServletRequest request,
String parameter)
Get String Parameter. |
static String |
getParamOrNull(HttpServletRequest request,
String parameter)
get Parameter or Null fi empty |
static boolean |
isEmailValid(String email)
Is EMail address valid |
static Properties |
propertiesDecode(String data)
Decode data String (URL encoded) into Properties |
static String |
propertiesEncode(Properties pp)
Decode Properties into String (URL encoded) |
static void |
reload(String logMessage,
String jsp,
HttpSession session,
HttpServletRequest request,
HttpServletResponse response,
ServletContext thisContext)
reload |
static void |
resendCode(HttpServletRequest request,
WebUser wu)
Resend Validation Code |
static String |
sendEMail(HttpServletRequest request,
WebUser to,
String msgType,
Object[] parameter)
Send EMail |
static String |
streamAttachment(HttpServletResponse response,
MAttachment attachment,
int attachmentIndex)
Stream Attachment Entry |
static String |
streamFile(HttpServletResponse response,
File file)
Stream File |
static boolean |
updateFields(HttpServletRequest request,
WebUser wu,
boolean updateEMailPwd)
Update Web User |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebUtil()
| Method Detail |
|---|
public static void createTimeoutPage(HttpServletRequest request,
HttpServletResponse response,
HttpServlet servlet,
String message)
throws ServletException,
IOException
request - requestresponse - responseservlet - servletmessage - - optional message
ServletException
IOException
public static void createErrorPage(HttpServletRequest request,
HttpServletResponse response,
HttpServlet servlet,
String message)
throws ServletException,
IOException
request - requestresponse - responseservlet - servletmessage - message
ServletException
IOException
public static void createLoginPage(HttpServletRequest request,
HttpServletResponse response,
HttpServlet servlet,
Ctx ctx,
String AD_Message)
throws ServletException,
IOException
- End Session - Go to start page (e.g. /compiere/index.html)
request - requestresponse - responseservlet - servletctx - contextAD_Message - messahe
ServletException
IOExceptionpublic static org.apache.ecs.xhtml.button getLoginButton(Ctx ctx)
ctx - context
public static Properties getCookieProperties(HttpServletRequest request)
request - request
public static String getParameter(HttpServletRequest request,
String parameter)
request - requestparameter - parameter
public static String[] getParameterValues(HttpServletRequest request,
String parameter)
request - requestparameter - parameter
public static int getParameterAsInt(HttpServletRequest request,
String parameter)
request - requestparameter - parameter
public static BigDecimal getParameterAsBD(HttpServletRequest request,
String parameter)
request - requestparameter - parameter
public static Timestamp getParameterAsDate(HttpServletRequest request,
String parameter)
request - requestparameter - parameter
public static Timestamp getParameterAsDate(HttpServletRequest request,
String parameter,
Language language)
request - requestparameter - parameterlanguage - optional language
public static boolean getParameterAsBoolean(HttpServletRequest request,
String parameter)
request - requestparameter - parameter
public static boolean getParameterAsBoolean(HttpServletRequest request,
String parameter,
String expected)
request - requestparameter - parameterexpected - optional expected value
public static String getParamOrNull(HttpServletRequest request,
String parameter)
request - requestparameter - parameter
public static void reload(String logMessage,
String jsp,
HttpSession session,
HttpServletRequest request,
HttpServletResponse response,
ServletContext thisContext)
throws ServletException,
IOException
logMessage - jsp - session - request - response - thisContext -
ServletException
IOException
public static void createResponse(HttpServletRequest request,
HttpServletResponse response,
HttpServlet servlet,
Properties cookieProperties,
WebDoc doc,
boolean debug)
throws IOException
request - requestresponse - responseservlet - servletcookieProperties - cookie propertiesdoc - docdebug - debug
IOExceptionpublic static org.apache.ecs.xhtml.script getClearFrame(String targetFrame)
targetFrame - target frame
public static HtmlCode getForward(String url,
int delaySec)
url - forward urldelaySec - delay in seconds (default 3)
public static void createForwardPage(HttpServletResponse response,
String title,
String forwardURL,
int delaySec)
throws ServletException,
IOException
response - responsetitle - page titleforwardURL - urldelaySec - delay in seconds (default 3)
ServletException
IOExceptionpublic static boolean exists(String test)
test - string
public static boolean exists(HttpServletRequest request,
String parameter)
request - requestparameter - string
public static boolean isEmailValid(String email)
email - mail address
public static String propertiesEncode(Properties pp)
pp - properties
public static Properties propertiesDecode(String data)
data - data
public static org.apache.ecs.xhtml.option[] convertToOption(NamePair[] list,
String default_ID)
If the ArrayList does not contain NamePairs, the String value is used
list - ArrayList containing NamePair valuesdefault_ID - Sets the default if the key/ID value is found.
If the value is null or empty, the first value is selected
NamePair
public static org.apache.ecs.xhtml.tr createField(org.apache.ecs.xhtml.tr line,
String FORMNAME,
String PARAMETER,
String labelText,
String inputType,
Object value,
int sizeDisplay,
int size,
boolean longField,
boolean mandatory,
String onChange,
StringBuffer script)
line - - null for new line (table row)FORMNAME - form namePARAMETER - parameter namelabelText - labelinputType - HTML input typevalue - data valuesizeDisplay - display sizesize - data sizelongField - field spanning two columnsmandatory - mark as mandatoryonChange - onChange callscript - script
public static org.apache.ecs.xhtml.input createClosePopupButton()
public static String streamAttachment(HttpServletResponse response,
MAttachment attachment,
int attachmentIndex)
response - responseattachment - attachmentattachmentIndex - logical index
public static String streamFile(HttpServletResponse response,
File file)
response - responsefile - file to stream
public static void deleteCookieWebUser(HttpServletRequest request,
HttpServletResponse response,
String COOKIE_NAME)
request - request (for context path)response - response to add cookie
public static String sendEMail(HttpServletRequest request,
WebUser to,
String msgType,
Object[] parameter)
request - requestto - web usermsgType - see MMailMsg.MAILMSGTYPE_*parameter - object array with parameters
public static String getFrom(HttpServletRequest request)
request - request
public static void addCookieWebUser(HttpServletRequest request,
HttpServletResponse response,
String webUser,
String COOKIE_NAME)
request - request (for context path)response - response to add cookiewebUser - email address
public static void resendCode(HttpServletRequest request,
WebUser wu)
request - requestwu - user
public static boolean updateFields(HttpServletRequest request,
WebUser wu,
boolean updateEMailPwd)
request - requestwu - userupdateEMailPwd - if true, change email/password
|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||