|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.portal.provider.v2.url.UrlUtils
public class UrlUtils
Contains utility methods and constants for urls. There are utility methods in this class that are suited to rendering HTML, and others that are suited to rendering Oracle mobile XML (MXML) i.e. the markup used to satisfy requests for mime-type of oracle.portal.provider.v2.render.PortletRenderer.TYPE_MOBILE. Those methods that are safe for use in a MXML context are explitly labeled as such.
Field Summary | |
---|---|
static int |
BACK_LINK
|
static int |
DESIGN_LINK
|
static int |
EVENT_LINK
|
static int |
LOGIN_LINK
|
static int |
PAGE_LINK
|
static int |
REFRESH_LINK
|
static int |
REQUEST_LINK
|
Constructor Summary | |
---|---|
UrlUtils()
|
Method Summary | |
---|---|
static java.lang.String |
absoluteLink(PortletRenderRequest pr,
java.lang.String relativePath)
Returns a fully-qualified URI for a path relative to the current request. |
static java.lang.String |
constructDetailHTMLLink(PortletRenderRequest pr,
NameValue[] params,
java.lang.String displayText,
java.lang.String otherHtmlAttributes,
boolean encodeParams,
boolean replaceParams)
Create a parameterized link for a portlet detail page By default, a portlet can have a single "detail" page that allows you to view portlet information in a full-screen mode. |
static java.lang.String |
constructHelpHTMLLink(PortletRenderRequest pr,
NameValue[] params,
java.lang.String displayText,
java.lang.String otherHtmlAttributes,
boolean encodeParams,
boolean replaceParams)
Create a parameterized link for a portlet help page By default, a portlet can have a single "help" page that allows you to display help information for your portlet in a full-screen mode. |
static java.lang.String |
constructHTMLLink(PortletRenderRequest pr,
int linkType,
java.lang.String displayText,
java.lang.String otherHtmlAttributes,
NameValue[] params,
boolean encodeParams,
boolean replaceParams)
Generic utility to build a HTML link. |
static java.lang.String |
constructHTMLLink(PortletRenderRequest pr,
int linkType,
java.lang.String displayText,
java.lang.String otherHtmlAttributes,
NameValuePair[] params,
boolean encodeParams,
boolean replaceParams)
Deprecated. use constructHTMLLink(PortletRenderRequest, int, String, String, NameValue[], boolean, boolean) |
static java.lang.String |
constructJavascriptLink(PortletRenderRequest pr,
int linkType,
NameValue[] params,
boolean encodeParams,
boolean replaceParams)
Generic utility to generate a javascript call that append parameters to a link. |
static java.lang.String |
constructLink(PortletRenderRequest pr,
int linkType,
NameValue[] params,
boolean encodeParams,
boolean replaceParams)
Generic utility to append parameters to a link. |
static java.lang.String |
constructLink(PortletRenderRequest pr,
java.lang.String link,
NameValue[] params,
boolean encodeParams,
boolean replaceParams)
Generic utility to append parameters to a link. |
static java.lang.String |
constructMXMLLink(PortletRenderRequest pr,
java.lang.String baseURI,
java.lang.String displayText,
java.lang.String otherAttributes,
NameValue[] params,
boolean encodeParams,
boolean replaceParams)
Generic utility to build a SimpleHref element. |
static java.lang.String |
constructResourceURL(PortletRenderRequest pr,
java.lang.String resource)
Utility to create a url that is proxied by portal to a resource Since there may be resources, such as images, that are accessible from the portal middle tier that are not available from the browser the user should be able to proxy requests through portal to get to these resources. |
static java.lang.String |
emitHiddenField(java.lang.String name,
java.lang.String value)
Utility to emit a single HTML hidden field with a specified name and value. |
static java.lang.String |
emitMxmlHiddenField(java.lang.String name,
java.lang.String value)
Utility to emit a single hidden SimpleFormItem field with a specified name and value (i.e. the markup used for satisfying requests of type oracle.portal.provider.v2.render.PortletRenderer.TYPE_MOBILE). |
static java.lang.String |
encodeParameter(java.lang.String param,
PortletRenderRequest pr)
Encodes a parameter for inclusion in a URL. |
static java.lang.String |
escapeString(java.lang.String text)
Escapes the characters in a text string. |
static java.lang.String |
escapeStringByFlag(java.lang.String text)
Escapes the characters in a text string. |
static java.lang.String |
htmlFormActionLink(PortletRenderRequest pr,
int linkType)
Transforms one of the various URIs known to the request into the appropriate form to be used in a FORM action tag. |
static java.lang.String |
htmlFormActionLink(java.lang.String ref)
Transforms a URI into the appropriate form to be used in a FORM action tag. |
static java.lang.String |
htmlFormHiddenFields(PortletRenderRequest pr,
int linkType)
Enables the parameters in the query string to be POSTED when the form is submited. |
static java.lang.String |
htmlFormHiddenFields(PortletRenderRequest pr,
int linkType,
java.lang.String formName)
Enables the parameters in the query string to be POSTED when the form is submited. |
static java.lang.String |
htmlFormHiddenFields(java.lang.String ref)
Encodes the parameters in the query string of the passed URL as hidden form fields. |
static java.lang.String |
htmlFormName(PortletRenderRequest pr,
java.lang.String formWithinPortletName)
Generic utility to construct a unique name for a form on a portlet page In spite of it's name, this method is suitable for MXML. |
static java.lang.String |
imageString(java.lang.String image,
java.lang.String imageAltText,
java.lang.String imageName)
Helper method for constructing an IMG HTML element |
static java.lang.String |
mxmlFormHiddenFields(java.lang.String ref)
Encodes the parameters in the query string of the passed URL as hidden form fields suitable for use in a SimpleForm element (i.e. |
static java.lang.String |
parameterizeLink(PortletRenderRequest pr,
int linkType,
java.lang.String queryString)
Adds new parameters to an existing link. |
static java.lang.String |
parameterizeLink(java.lang.String link,
java.lang.String queryString)
Adds new parameters to an existing link. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PAGE_LINK
public static final int DESIGN_LINK
public static final int REQUEST_LINK
public static final int LOGIN_LINK
public static final int BACK_LINK
public static final int EVENT_LINK
public static final int REFRESH_LINK
Constructor Detail |
---|
public UrlUtils()
Method Detail |
---|
public static java.lang.String imageString(java.lang.String image, java.lang.String imageAltText, java.lang.String imageName)
image
- name of the image to use.imageAltText
- Text description of the image, used by JAWS
so blind person can know what the image does.
can be null, empty or a string.imageName
- populates the "name" property - may be null.
public static java.lang.String constructResourceURL(PortletRenderRequest pr, java.lang.String resource) throws java.lang.IllegalArgumentException, java.io.IOException
pr
- render requestresource
- the link to the resource.
java.lang.IllegalArgumentException
java.io.IOException
public static java.lang.String constructHTMLLink(PortletRenderRequest pr, int linkType, java.lang.String displayText, java.lang.String otherHtmlAttributes, NameValue[] params, boolean encodeParams, boolean replaceParams) throws java.lang.IllegalArgumentException, java.io.IOException
<A onclick=javascriptMethod(params, replaceParams)
otherHtmlAttributes>displayText</A>
otherwise
<A href=link+params otherHtmlAttributes>displayText
</A>
either way the generated HTML links behave in the same way.
pr
- render requestlinkType
- the link to use. Constants representing these types are
defined in UrlUtils.displayText
- text displayed for this linkotherHtmlAttributes
- other attributes for the HTML link. No need
for pre or end spaces in the string.params
- array of NameValue objects representing the parametersencodeParams
- flag indicating whether parameter names and values
should be encodedreplaceParams
- flag indicating whether parameters contained in the
params array should replace existing parameters of
the same name. true = replace or overwrite existing
parameters. false = simply add parameters
<A ...>displayText</A>
java.lang.IllegalArgumentException
java.io.IOException
public static java.lang.String constructHTMLLink(PortletRenderRequest pr, int linkType, java.lang.String displayText, java.lang.String otherHtmlAttributes, NameValuePair[] params, boolean encodeParams, boolean replaceParams) throws java.lang.IllegalArgumentException, java.io.IOException
constructHTMLLink(PortletRenderRequest, int, String, String, NameValue[], boolean, boolean)
<A onclick=javascriptMethod(params, replaceParams)
otherHtmlAttributes>displayText</A>
otherwise
<A href=link+params otherHtmlAttributes>displayText
</A>
either way the generated HTML links behave in the same way.
pr
- render requestlinkType
- the link to use. Constants representing these types are
defined in UrlUtils.displayText
- text displayed for this linkotherHtmlAttributes
- other attributes for the HTML link. No need
for pre or end spaces in the string.params
- array of NameValuePair objects representing the parametersencodeParams
- flag indicating whether parameter names and values
should be encodedreplaceParams
- flag indicating whether parameters contained in the
params array should replace existing parameters of
the same name. true = replace or overwrite existing
parameters. false = simply add parameters
<A ...>displayText</A>
java.lang.IllegalArgumentException
java.io.IOException
public static java.lang.String constructJavascriptLink(PortletRenderRequest pr, int linkType, NameValue[] params, boolean encodeParams, boolean replaceParams) throws java.lang.IllegalArgumentException, java.io.IOException
pr
- render requestlinkType
- the link to use. Constants representing these types
are defined in UrlUtils.params
- array of NameValue objects representing the parametersencodeParams
- flag indicating whether parameter names and values
should be encodedreplaceParams
- flag indicating whether parameters contained in the
params array should replace existing parameters of
the same name. true = replace or overwrite existing
parameters. false = simply add parameters
java.lang.IllegalArgumentException
java.io.IOException
public static java.lang.String htmlFormName(PortletRenderRequest pr, java.lang.String formWithinPortletName)
pr
- render requestformWithinPortletName
- There may be more than one form per portlet
this name is used to destinguish between different
forms within a portlet. This may be null or empty
if there is only one form in a portlet.
public static java.lang.String constructLink(PortletRenderRequest pr, int linkType, NameValue[] params, boolean encodeParams, boolean replaceParams) throws java.lang.IllegalArgumentException, java.io.IOException
pr
- render requestlinkType
- the link to use. Constants representing these types are
defined in UrlUtils.params
- array of NameValue objects representing the parametersencodeParams
- flag indicating whether parameter names and values
should be encodedreplaceParams
- flag indicating whether parameters contained in the
params array should replace existing parameters of
the same name. true = replace or overwrite existing
parameters. false = simply add parameters
java.lang.IllegalArgumentException
java.io.IOException
public static java.lang.String constructLink(PortletRenderRequest pr, java.lang.String link, NameValue[] params, boolean encodeParams, boolean replaceParams) throws java.lang.IllegalArgumentException, java.io.IOException
pr
- render requestlink
- the link to be parameterizedparams
- array of NameValue objects representing the parametersencodeParams
- flag indicating whether parameter names and values
should be encodedreplaceParams
- flag indicating whether parameters contained in the
params array should replace existing parameters of
the same name. true = replace or overwrite existing
parameters. false = simply add parameters
java.lang.IllegalArgumentException
java.io.IOException
public static java.lang.String htmlFormHiddenFields(PortletRenderRequest pr, int linkType) throws java.lang.IllegalArgumentException
pr
- the requestlinkType
- the link to use. Constants representing these
types are defined in UrlUtils.
java.lang.IllegalArgumentException
public static java.lang.String htmlFormHiddenFields(PortletRenderRequest pr, int linkType, java.lang.String formName) throws java.lang.IllegalArgumentException
pr
- the requestlinkType
- the link to use. Constants representing these types
are defined in PortletRendererUtil.formName
- unique name of a form within a page. Use htmlFormName()
to generate this name.
java.lang.IllegalArgumentException
public static java.lang.String htmlFormHiddenFields(java.lang.String ref)
ref
- the URIpublic static java.lang.String emitHiddenField(java.lang.String name, java.lang.String value)
name
- the encoded name of the hidden fieldvalue
- the encoded value of the hidden field
public static java.lang.String encodeParameter(java.lang.String param, PortletRenderRequest pr) throws java.io.IOException
param
- the parameter to be encodedpr
- PortletRenderRequest object for this request
java.io.IOException
public static java.lang.String parameterizeLink(PortletRenderRequest pr, int linkType, java.lang.String queryString) throws java.lang.IllegalArgumentException
pr
- the request.linkType
- the id for the link we want to parameterize.
ID constants are defined IN UrlUtilsqueryString
- the parameters to be added in properly encodes
queryString form. the String should begin with the first parameter
name not a "?".
java.lang.IllegalArgumentException
public static java.lang.String parameterizeLink(java.lang.String link, java.lang.String queryString)
link
- the link to add parameters to.queryString
- the parameters to be added in properly encodes
queryString form. The String should begin with the first parameter
name not a "?".public static java.lang.String absoluteLink(PortletRenderRequest pr, java.lang.String relativePath)
pr
- the PortletRenderRequestrelativePath
- the path we want to make absolutepublic static java.lang.String htmlFormActionLink(java.lang.String ref)
ref
- the URI to be transformedpublic static java.lang.String htmlFormActionLink(PortletRenderRequest pr, int linkType) throws java.lang.IllegalArgumentException
pr
- the PortletRenderRequestlinkType
- the link in this request that should be used.
java.lang.IllegalArgumentException
public static java.lang.String constructDetailHTMLLink(PortletRenderRequest pr, NameValue[] params, java.lang.String displayText, java.lang.String otherHtmlAttributes, boolean encodeParams, boolean replaceParams) throws PortletException, java.io.IOException
pr
- the render request.params
- an array of NameValue objects representing the
parameter names and associated values. Names cannot be NULLdisplayText
- text displayed for this linkotherHtmlAttributes
- other attributes for the HTML link. No need
for pre or end spaces in the string.encodeParams
- flag indicating whether the parameter names and values
should be URL encoded using the multibyte URL encoder.replaceParams
- flag indicating whether parameters contained in the
params array should replace existing parameters of
the same name. true = replace or overwrite existing
parameters. false = simply add parameters
PortletException
java.io.IOException
public static java.lang.String constructHelpHTMLLink(PortletRenderRequest pr, NameValue[] params, java.lang.String displayText, java.lang.String otherHtmlAttributes, boolean encodeParams, boolean replaceParams) throws PortletException, java.io.IOException
pr
- the render request.params
- an array of NameValue objects representing the
parameter names and associated values. Names cannot be NULLdisplayText
- text displayed for this linkotherHtmlAttributes
- other attributes for the HTML link. No need
for pre or end spaces in the string.encodeParams
- flag indicating whether the parameter names and values
should be URL encoded using the multibyte URL encoder.replaceParams
- flag indicating whether parameters contained in the
params array should replace existing parameters of
the same name. true = replace or overwrite existing
parameters. false = simply add parameters
PortletException
java.io.IOException
public static java.lang.String mxmlFormHiddenFields(java.lang.String ref)
ref
- the URI containing the parameters to be included as hidden
fields in the form.public static java.lang.String emitMxmlHiddenField(java.lang.String name, java.lang.String value)
name
- the encoded name of the hidden fieldvalue
- the encoded value of the hidden field
public static java.lang.String constructMXMLLink(PortletRenderRequest pr, java.lang.String baseURI, java.lang.String displayText, java.lang.String otherAttributes, NameValue[] params, boolean encodeParams, boolean replaceParams) throws java.lang.IllegalArgumentException, java.io.IOException
pr
- the portlet render requestbaseURI
- the link on which to base the target of the SimpleHref.displayText
- text displayed for this linkotherAttributes
- other attributes for the SimpleHref's target.
No need for pre or end spaces in the string.params
- array of NameValue objects representing the parametersencodeParams
- flag indicating whether parameter names and values
should be encodedreplaceParams
- flag indicating whether parameters contained in the
params array should replace existing parameters of
the same name. true = replace or overwrite existing
parameters. false = simply add parameters
<SimpleHref target="http://...">displayText</SimpleHref>
java.lang.IllegalArgumentException
java.io.IOException
public static java.lang.String escapeString(java.lang.String text)
text
- the string that is to be escapedpublic static java.lang.String escapeStringByFlag(java.lang.String text)
escapeString(String)
should be used instead.
text
- the text to be escaped
|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |