public class UIUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
The IBM copyright notice field.
|
Constructor and Description |
---|
UIUtil() |
Modifier and Type | Method and Description |
---|---|
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(javax.servlet.http.HttpServletRequest req)
Returns the web application path.
|
static java.lang.String |
getWebPrefix(javax.servlet.http.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 storage 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 a URL.
|
static java.lang.String |
replaceWebVariables(java.lang.String path)
Replaces static and dynamic web path in XML files
|
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
an 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.
|
static java.lang.String |
toJSVector1(java.lang.String key,
java.lang.Object target) |
public static final java.lang.String COPYRIGHT
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
local
- the local for which the Cascading Style Sheets
file should be fetchedECSystemException
- If an error occurs, throw an exception.public static java.lang.String getFulfillmentCenterId(javax.servlet.http.HttpServletRequest request) throws ECSystemException
request
- the HTTP requestECSystemException
- If an error occurs, throw an exception.public static final void processParameters(TypedProperty property) throws ECSystemException
property
- the request objectECSystemException
- 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 replacedECSystemException
- 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 replacedlocale
- the localeECSystemException
- 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 JavaScriptECSystemException
- 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 classECSystemException
- 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 JavaScriptECSystemException
- If an error occurs, throw an exception.public static java.lang.String toJSVector1(java.lang.String key, java.lang.Object target) throws ECSystemException
ECSystemException
public static void setNonJSConvertibleMethods(java.util.Vector methods)
addToJS
,methods
- method names to be ignored in a vectorpublic static java.lang.String getWebPrefix(javax.servlet.http.HttpServletRequest req)
req
- the request objectpublic static java.lang.String getWebappPath(javax.servlet.http.HttpServletRequest req)
req
- the request objectpublic static java.lang.String replaceWebVariables(java.lang.String path)
path
- the path to be substituted