Class URLUtils
java.lang.Object
com.webmethods.caf.faces.render.util.URLUtils
URL utility functions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static interface
static interface
static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
addAppVersionToUrl
(FacesContext context, String url) Adds app version param (v=) to specified url.static String
appendURLParameters
(String url, Map<String, ?> parameters) Append parameters specified by map to existing url.static IURL
createRenderURL
(FacesContext context) Creates a PortletURL based on the current request, even if request isn't a portlet request.static String
createSharedResourceURL
(FacesContext context, String path) Creates url to CAF shared resource.static String
createSharedResourceURL
(FacesContext context, String base, String path) Creates url to CAF resource in a war other than wm_cafshared.createSharedResourceURLEncoder
(Object encoderDelegate) createSharedResourceURLEncoder
(String frontEndUrl, String sharedContexPath, Object encoderDelegate) static String
createSharedResourceURLforFe
(FacesContext context, String path) static String
Decodes from URL-escaped format.static String
encodeImageURL
(FacesContext context, String url) Encodes unencoded image url.static String
Encode a string to the "x-www-form-urlencoded" form, enhanced with the UTF-8-in-URL proposal.static String
getFrontEndURL
(Object delegate) Calculate front-end url for current request, up to but not including context path for current war.static String
getSharedContextPath
(FacesContext context) static String
getSharedResourceBase
(FacesContext context, String base) static boolean
isImageSkinned
(FacesContext context, String imageName) Returns true if the image is skinned, false if un-skinned.static boolean
isRenderRequest
(FacesContext context) static boolean
isSafeURLScheme
(String url) True if url uses safe scheme (like "http:", "ftp:", etc.), false if null, empty string, or not sure.static void
registerURLFactory
(URLUtils.IURLFactory urlFactory, boolean highPriority)
-
Field Details
-
ATTR_FRONT_END_URL
- See Also:
-
INIT_PARAM_SHARED_CONTEXT_PATH
- See Also:
-
MWS_ROOT_CONTEXT
- See Also:
-
SHARED_CONTEXT
- See Also:
-
PATH_SHARED_CONTEXT
- See Also:
-
QUERY_LOCALE
- See Also:
-
RE_FE_URL
-
RE_SAFE_URL_SCHEME
-
hex
-
-
Constructor Details
-
URLUtils
public URLUtils()
-
-
Method Details
-
registerURLFactory
-
createRenderURL
Creates a PortletURL based on the current request, even if request isn't a portlet request. (If it isn't a portlet request, the PortletURL parameters are 'global'). -
isRenderRequest
-
encodeImageURL
Encodes unencoded image url. Also maps a named skinned image to its concrete image url.- Parameters:
context
- Current context.url
- Unencoded image url.- Returns:
- Encoded, absolute url reference.
-
addAppVersionToUrl
Adds app version param (v=) to specified url.- Parameters:
context
- Current context.url
- Url to add.- Returns:
- Url with added version param.
-
isImageSkinned
Returns true if the image is skinned, false if un-skinned.- Parameters:
context
- Current context.imageName
- Image name, like "SelectAll.gif" (not "images/SelectAll.gif" or "/skin/images/SelectAll.gif").- Returns:
- True if image exists in current skin.
-
getFrontEndURL
Calculate front-end url for current request, up to but not including context path for current war. Must not include a trailing slash. Ex: "http://foo", "https://foo.example.com:8443", "http://foo/portal". -
isSafeURLScheme
True if url uses safe scheme (like "http:", "ftp:", etc.), false if null, empty string, or not sure. -
appendURLParameters
Append parameters specified by map to existing url. Does not check for paramaters already exsting in url.- Parameters:
url
- Url. May be null or empty. May include query part.parameters
- Map of parameters. May be null or empty.- Returns:
- Url with appended paramaters. Never null.
-
encodeURIComponent
Encode a string to the "x-www-form-urlencoded" form, enhanced with the UTF-8-in-URL proposal. This is what happens:The ASCII characters 'a' through 'z', 'A' through 'Z', and '0' through '9' remain the same.
The unreserved characters - _ . ! ~ * ' ( ) remain the same.
The space character ' ' is not converted into a plus sign '+'.
All other ASCII characters are converted into the 3-character string "%xy", where xy is the two-digit hexadecimal representation of the character code
All non-ASCII characters are encoded in two steps: first to a sequence of 2 or 3 bytes, using the UTF-8 algorithm; secondly each of these bytes is encoded as "%xx".
-
decodeURIComponent
Decodes from URL-escaped format.
-