java.lang.Object | +--com.ibm.commerce.tools.util.UIUtil
Utility class used by the UI Elements (in Java Server Pages and Entity Beans).
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT The IBM copyright notice field. |
Constructor Summary | |
---|---|
UIUtil() |
Method Summary | |
---|---|
static java.lang.String |
change(java.lang.String source, java.lang.String pattern,
java.lang.String replacement) Replaces the occurrences of a substring with a new substring |
static java.lang.String |
getCSSFile(java.util.Locale locale) Returns the Cascading Style Sheets filename depending on locale. |
static java.lang.String |
getFulfillmentCenterId(javax.servlet.http.HttpServletRequest request) Returns the fulfillment center ID, which is set in the cookies when WebSphere Commerce Accelerator is launched. |
static java.lang.String |
getWebappPath(HttpServletRequest req) Returns the webapp path. |
static java.lang.String |
getWebPrefix(HttpServletRequest req) Returns the web prefix. |
static void |
processParameters(
TypedProperty property) Parses the request for the XML and XMLObject properties and stores them in appropriate storeage variables. |
static java.lang.String |
replaceURLVariables(java.lang.String url) Replaces variables in a URL. |
static java.lang.String |
replaceURLVariables(java.lang.String url, java.util.Locale loc,
java.lang.Integer storeId) Replaces variables in an URL. |
static void |
setNonJSConvertibleMethods(java.util.Vector methods) Sets a list of method names that should not be converted to JavaScript during the calls of addToJS , |
static java.lang.String |
toHTML(java.lang.String result) Takes an input string and replaces the problem characters for a HTML input attribute value. |
static java.lang.String |
toJavaScript(java.lang.Object result) Converts target object to a string that is acceptable by JavaScript. |
static java.lang.String |
toJavaScript(java.lang.String result) Converts target string to a string acceptable by JavaScript. |
static java.lang.String |
toJS(java.lang.String key, java.lang.Object target) Converts the target model to a JavaScript representation of that model. |
static java.lang.String |
toJS(java.lang.String key, java.lang.Object target,
int stoplevel) Converts the target model to a JavaScript representation of that model. |
static java.lang.String |
toJSVector(java.lang.String key, java.lang.Object target) Converts the target model to a JavaScript representation of that model. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public UIUtil()
Method Detail |
---|
public static java.lang.String change(java.lang.String source, java.lang.String pattern, java.lang.String replacement)
source
- the original stringpattern
- the pattern to be replacedreplacement
- the replacement for patternpublic static java.lang.String getCSSFile(java.util.Locale locale) throws ECSystemException
ECSystemException
- If an error occurs, throw an
exception.public static java.lang.String getFulfillmentCenterId(javax.servlet.http.HttpServletRequest request) throws ECSystemException
request
- the HTTP request
ECSystemException
- If an error occurs, throw an
exception.public static final void processParameters(TypedProperty property) throws ECSystemException
property
- the request object
ECSystemException
- If an error occurs, throw an
exception.public static final java.lang.String replaceURLVariables(java.lang.String url) throws ECSystemException
url
- the url which needs its variables be replaced
ECSystemException
- If an error occurs, throw an
exception.public static final java.lang.String replaceURLVariables(java.lang.String url, java.util.Locale loc, java.lang.Integer storeId) throws ECSystemException
url
- the URL which needs its variables to be replaced
ECSystemException
- If an error occurs, throw an
exception.public static java.lang.String toHTML(java.lang.String result)
& replaced &
" replaced
&qout;
Note: All HTML attribute values are assumed to be delimited by double quote.
result
- the string to be convertedpublic static java.lang.String toJavaScript(java.lang.Object result)
result
- the object to be converted into JavaScript.public static java.lang.String toJavaScript(java.lang.String result)
result
- the object to be converted into JavaScriptpublic static final java.lang.String toJS(java.lang.String key, java.lang.Object target) throws ECSystemException
key
- the prefix you wish to have prepended to the creation of
the JavaScript objecttarget
- the object to be converted to JavaScript
ECSystemException
- If an error occurs, throw an
exception.public static final java.lang.String toJS(java.lang.String key, java.lang.Object target, int stoplevel) throws ECSystemException
key
- the prefix you wish to have prepended to the creation of
your JavaScript objecttarget
- the object to be converted to JavaScriptstoplevel
- the number of levels up to stop getting the
objects parents class
ECSystemException
- If an error occurs, throw an
exception.public static java.lang.String toJSVector(java.lang.String key, java.lang.Object target) throws ECSystemException
key
- the prefix to prepend to the creation of the JavaScript
objecttarget
- the object to be converted to JavaScript
ECSystemException
- If an error occurs, throw an
exception.public static void setNonJSConvertibleMethods(java.util.Vector methods)
addToJS
,
methods
- method names to be ignored in a
vectorpublic static java.lang.String getWebPrefix(HttpServletRequest req)
req
- the request objectpublic static java.lang.String getWebappPath(HttpServletRequest req)
req
- the request object