Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.4.0)
E15995-03


oracle.webcenter.framework.resource.external
Class ResourceUri

java.lang.Object
  extended by oracle.webcenter.framework.resource.external.ResourceUri


public class ResourceUri
extends java.lang.Object

Provides a static API to get absolute URLs to resources within WebCenter applications (Spaces and Portal applications). This class by default produces absolute urls where the scheme (protocol), host and port are the same for both Faces and non-Faces requests and that the webcenter Faces requests are made on /faces, RSS requests are made on /rss and REST requests are made on /rest URLs. If the host and port are not the same, or if the mount points of Faces, RSS or REST are not /faces, /rss and /rest, for example if RSS is using https on a different port to Faces requests, a section needs to be added to the adf-config.xml file as follows:

  <resource-uri
    rss-mount="/rss"
    faces-mount="/faces"
    wc-ctxroot="/webcenter"
    rest-ctxroot="/rest"
    rss-host="https://my.host.com:1234/myapp/my-rss-context-root"
    faces-host="http://a.different.host.com:5678/mywebcenterapp/jsf" />
 

where rss-mount is the mount point of the RSS Servlet for RSS requests (starting with a slash and not including the context root). This defaults to /rss and does not normally need to be set. faces-mount is the mount point of the Faces requests, and this defaults to /faces wc-ctxroot is the context root for the webcenter faces servlet. This defaults to /webcenter rest-ctxroot is the context root for the REST servlet. This defaults to /rest rss-host overrides the existing context and configuration settings by specifying the entire absolute URL to the RSS servlet. This is used to build up URLs to the RSS servlet from within the Faces servlet. In most cases rss-host should be null (see bug 6176139) which means that the current context is used to build up the URL. faces-mount overrides the existing context and configuration settings by specifying the entire absolute URL to the Faces servlet. This is used to build up URLs to the Faces servlet from outside of the FacesContext (for example, from the RSS servlet). In most cases this should be null (see bug 6176139) which means that the current context is used to build up the url. This implementation works both inside and outside of a Faces context, but it is designed to be used outside of the Faces Context (inside of a Faces request, the resourceHandler tag should be used)


Field Summary
static java.lang.String DISABLE_INTERCEPT
          Java boolean property used to disable the phase listener which intercepts requests to resourceExternal.jspx and owResource.jspx in order to invoke the Resource Action Handler.
static java.lang.String FACES_HOST_OVERRIDE
          Key in the adf-config configuration map to store the Faces scheme, hostname port number, context root and faces servlet mount point.
static java.lang.String FACES_MOUNT_POINT
          Key in the adf-config configuration map to store the Faces mount point.
static java.lang.String OWRESOURCE_JSPX
          The URL path used invoke the Resource Action Handler via the Resource External Phase Listener (since 11.1.1.4.0).
static java.lang.String RESOURCE_EXTERNAL_JSPX
          The Faces page used to invoke the Resource Action Handler when the Resource External Phase Listener is disabled.
static java.lang.String RESOURCE_EXTERNAL_REFERER
          The resource referer attribute value used by the Resource Action Handler when it is invoked by owResource.jspx so that View Handlers can handle incoming requests to the application differently to those which navigate within the application.
static java.lang.String REST_CTX_ROOT
          Key in the adf-config configuration map to store the REST Servlet context root.
static java.lang.String RSS_HOST_OVERRIDE
          Key in the adf-config configuration map to store the RSS scheme, hostname port, context root and rss servlet mount point.
static java.lang.String RSS_MOUNT_POINT
          Key in the adf-config configuration map to store the RSS mount point.
static java.lang.String URL_PARAM_RESOURCEID
           
static java.lang.String URL_PARAM_SCOPE
           
static java.lang.String URL_PARAM_SERVICEID
           
static java.lang.String URL_PARAM_TITLE
           
static java.lang.String URL_PARAM_TYPE
           
static java.lang.String URL_PARAM_Z
          The URL parameter used by /owResource.jspx to identify the resource to display.
static java.lang.String WC_CTX_ROOT
          Key in the adf-config configuration map to store the WebCenter context root.

 

Constructor Summary
ResourceUri()
           

 

Method Summary
static java.lang.String getAbsoluteContextRoot()
          Returns the absolute URL up to and including the current servlet context root (even if the FacesContext is not available).
static java.lang.String getAbsoluteWCContextRoot()
          Returns the absolute URL up to and including the servlet context root (even if the FacesContext is not available) of the WebCenter servlet.
static java.lang.StringBuilder getBaseUri(java.lang.String page)
          Returns the absolute URL to the specified containing page (even if the FacesContext is not available).
static java.lang.StringBuilder getRssBaseUri(java.lang.String path)
          Returns the absolute URL to the specified RSS path (even if not executed from within the RSS servlet).
static java.lang.String getURI(java.lang.String resourceId, java.lang.String serviceId, java.lang.String title)
          Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title.
static java.lang.String getURI(java.lang.String resourceId, java.lang.String serviceId, java.lang.String title, java.lang.String scope)
          Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title and scope.
static java.lang.String getURI(java.lang.String resourceId, java.lang.String serviceId, java.lang.String title, java.lang.String scope, boolean forceLogin)
          Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title and scope.
static java.lang.String getURI(java.lang.String resourceId, java.lang.String serviceId, java.lang.String scope, java.lang.String title, java.lang.String resourceType, boolean forceLogin, java.util.Map<java.lang.String,java.lang.String> params)
          Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title, scope, resourceType, action and a Map of the name-value parameters to add to the URL.
static java.lang.String getURI(java.lang.String resourceId, java.lang.String serviceId, java.lang.String scope, java.lang.String title, java.lang.String resourceType, java.util.Map<java.lang.String,java.lang.String> params)
          Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title, scope, resourceType, action and a Map of the name-value parameters to add to the URL.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

RSS_MOUNT_POINT

public static final java.lang.String RSS_MOUNT_POINT
Key in the adf-config configuration map to store the RSS mount point. For example /rss. The default is /rss
See Also:
Constant Field Values

FACES_MOUNT_POINT

public static final java.lang.String FACES_MOUNT_POINT
Key in the adf-config configuration map to store the Faces mount point. For example /faces. The default is /faces
See Also:
Constant Field Values

RSS_HOST_OVERRIDE

public static final java.lang.String RSS_HOST_OVERRIDE
Key in the adf-config configuration map to store the RSS scheme, hostname port, context root and rss servlet mount point. For example https://www.example.com:7777/webcenterapp/rss/ NOTE : In most cases this should be null, which means obtain the information from the current context instead - this setting exists only for special cases where the current context is not correct.
See Also:
Constant Field Values

FACES_HOST_OVERRIDE

public static final java.lang.String FACES_HOST_OVERRIDE
Key in the adf-config configuration map to store the Faces scheme, hostname port number, context root and faces servlet mount point. For example http://www.example.com:8888/webapp/jsfaces/ NOTE : In most cases this should be null, which means obtain the information from the current context instead - this setting exists only for special cases where the current context is not correct.
See Also:
Constant Field Values

WC_CTX_ROOT

public static final java.lang.String WC_CTX_ROOT
Key in the adf-config configuration map to store the WebCenter context root. For example /webcenter. The default is /webcenter
See Also:
Constant Field Values

REST_CTX_ROOT

public static final java.lang.String REST_CTX_ROOT
Key in the adf-config configuration map to store the REST Servlet context root. For example /rest. The default is /rest
See Also:
Constant Field Values

DISABLE_INTERCEPT

public static final java.lang.String DISABLE_INTERCEPT
Java boolean property used to disable the phase listener which intercepts requests to resourceExternal.jspx and owResource.jspx in order to invoke the Resource Action Handler. This java property should be set to true if the Resource External Phase Listener needs to be disabled. Once disabled, navigation to a WebCenter resource from an external application will occur by navigating to the resourceExternal.jspx and invoking the Resource Action Handler via an autosubmitted command link. This is not recommended.
See Also:
Constant Field Values

URL_PARAM_RESOURCEID

public static final java.lang.String URL_PARAM_RESOURCEID
See Also:
Constant Field Values

URL_PARAM_SERVICEID

public static final java.lang.String URL_PARAM_SERVICEID
See Also:
Constant Field Values

URL_PARAM_TYPE

public static final java.lang.String URL_PARAM_TYPE
See Also:
Constant Field Values

URL_PARAM_SCOPE

public static final java.lang.String URL_PARAM_SCOPE
See Also:
Constant Field Values

URL_PARAM_TITLE

public static final java.lang.String URL_PARAM_TITLE
See Also:
Constant Field Values

URL_PARAM_Z

public static final java.lang.String URL_PARAM_Z
The URL parameter used by /owResource.jspx to identify the resource to display.
See Also:
Constant Field Values

RESOURCE_EXTERNAL_JSPX

public static final java.lang.String RESOURCE_EXTERNAL_JSPX
The Faces page used to invoke the Resource Action Handler when the Resource External Phase Listener is disabled.
See Also:
Constant Field Values

OWRESOURCE_JSPX

public static final java.lang.String OWRESOURCE_JSPX
The URL path used invoke the Resource Action Handler via the Resource External Phase Listener (since 11.1.1.4.0).
See Also:
Constant Field Values

RESOURCE_EXTERNAL_REFERER

public static final java.lang.String RESOURCE_EXTERNAL_REFERER
The resource referer attribute value used by the Resource Action Handler when it is invoked by owResource.jspx so that View Handlers can handle incoming requests to the application differently to those which navigate within the application. For example, the view handler may wish to open a popup window for navigation within the application but open a full browser window when navigating to the application via owResource.jspx.
See Also:
Constant Field Values

Constructor Detail

ResourceUri

public ResourceUri()

Method Detail

getRssBaseUri

public static java.lang.StringBuilder getRssBaseUri(java.lang.String path)
Returns the absolute URL to the specified RSS path (even if not executed from within the RSS servlet). This method returns the absolute URL to the specified RSS path using the current context to build up the first parts of the url (protocol, host, port and context root) and the adf-config.xml configuration to find the RSS mount point, followed by the specified path. For example, getRssBaseUri("/myrss/url"); returns http://www.example.com/contextroot/rss/myrss/url
Parameters:
path - an RSS URL path accessible from a browser (may be null)
Returns:
the absolute URL to the specified RSS path

getAbsoluteContextRoot

public static java.lang.String getAbsoluteContextRoot()
Returns the absolute URL up to and including the current servlet context root (even if the FacesContext is not available). This method returns the absolute URL up to and including the context root using the current context to build up the protocol, host, port and context root. Note: This returns the current servlet context root, to obtain the WebCenter context root from another servlet use getAbsoluteWCContextRoot() If called from outside of a FacesContext it will return the webcenter faces servlet's context root. This returns a URL in the format: [protocol]://[host]:[port]/[ctxroot] such as http://www.example.com:8888/rest
Returns:
the absolute URL to the current context root

getAbsoluteWCContextRoot

public static java.lang.String getAbsoluteWCContextRoot()
Returns the absolute URL up to and including the servlet context root (even if the FacesContext is not available) of the WebCenter servlet. This method returns the absolute URL up to and including the context root of the WebCenter Servlet. This returns a URL in the format: [protocol]://[host]:[port]/[ctxroot] such as http://www.example.com:8888/webcenter
Returns:
the absolute url to the context root of the WebCenter servlet

getBaseUri

public static java.lang.StringBuilder getBaseUri(java.lang.String page)
Returns the absolute URL to the specified containing page (even if the FacesContext is not available). This method returns the absolute URL to the specified path using the current context to build up the first parts of the URL (protocol, host, port and context root) and the adf-config.xml configuration to find the faces mount point, followed by the specified path.
Parameters:
page - a jspx page accessible from a browser
Returns:
the absolute url to the specified containing page

getURI

public static java.lang.String getURI(java.lang.String resourceId,
                                      java.lang.String serviceId,
                                      java.lang.String title)
Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title. This API returns an absolute URL to be used in an a href target. The URL will point to the specified resource through its service's resource view surrounded by any application-specific container page.
Parameters:
resourceId - service-specific resource identifier
serviceId - the service identifier
title - title string used for viewing the resource, for example the title used on a new tab. This may be null
Returns:
an absolute URL to the specified resource

getURI

public static java.lang.String getURI(java.lang.String resourceId,
                                      java.lang.String serviceId,
                                      java.lang.String title,
                                      java.lang.String scope)
Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title and scope.
Parameters:
resourceId - service-specific resource identifier
serviceId - the service identifier
title - title string used for viewing the resource, for example the title used on a new tab. This may be null
scope - the scope GUID used for the resource

getURI

public static java.lang.String getURI(java.lang.String resourceId,
                                      java.lang.String serviceId,
                                      java.lang.String title,
                                      java.lang.String scope,
                                      boolean forceLogin)
Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title and scope.
Parameters:
resourceId - service-specific resource identifier
serviceId - the service identifier
title - title string used for viewing the resource, for example the title used on a new tab. This may be null
forceLogin - true to force users to login when accessing this url, false to allow public access
scope - the scope GUID used for the resource

getURI

public static java.lang.String getURI(java.lang.String resourceId,
                                      java.lang.String serviceId,
                                      java.lang.String scope,
                                      java.lang.String title,
                                      java.lang.String resourceType,
                                      java.util.Map<java.lang.String,java.lang.String> params)
Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title, scope, resourceType, action and a Map of the name-value parameters to add to the URL.
Parameters:
resourceId - service-specific resource identifier
serviceId - the service identifier
title - title string used for viewing the resource, for example the title used on a new tab. This may be null
scope - the scope GUID used for the resource
params - a Map of the name-value pairs, for example to set wc.chromelevel=nochrome

getURI

public static java.lang.String getURI(java.lang.String resourceId,
                                      java.lang.String serviceId,
                                      java.lang.String scope,
                                      java.lang.String title,
                                      java.lang.String resourceType,
                                      boolean forceLogin,
                                      java.util.Map<java.lang.String,java.lang.String> params)
Returns an absolute URL to the given resource identified by its service specific resource id and service identifier, using the given title, scope, resourceType, action and a Map of the name-value parameters to add to the URL.
Parameters:
resourceId - service-specific resource identifier
serviceId - the service identifier
title - title string used for viewing the resource, for example the title used on a new tab. This may be null
scope - the scope GUID used for the resource
forceLogin - true to force users to login when accessing this url, false to allow public access
params - a Map of the name-value pairs, for example to set wc.chromelevel=nochrome

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.4.0)
E15995-03


Copyright © 2009, 2011, Oracle and/or its affiliates. All rights reserved.