Skip navigation links

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


oracle.webcenter.webcenterapp.context
Class WCApplicationContext

java.lang.Object
  extended by oracle.webcenter.framework.application.context.WebCenterApplicationContext
      extended by oracle.webcenter.webcenterapp.context.WCApplicationContext


public abstract class WCApplicationContext
extends oracle.webcenter.framework.application.context.WebCenterApplicationContext

WCApplicationContext is responsible for managing WebCenter Application Context across the WebCenter Application. It contains all the context/state information related to WebCenter Application.


Nested Class Summary

 

Nested classes/interfaces inherited from class oracle.webcenter.framework.application.context.WebCenterApplicationContext
oracle.webcenter.framework.application.context.WebCenterApplicationContext.Mode

 

Field Summary

 

Fields inherited from class oracle.webcenter.framework.application.context.WebCenterApplicationContext
CURRENT_SELECTED_RESOURCE, SRM_CURR_RESOURCE_TYPE

 

Constructor Summary
WCApplicationContext()
           

 

Method Summary
abstract  oracle.mds.core.MDSSession createCustomizeModeMDSSession()
          Create and return a new MDS Session based on the customize mode mappings.
abstract  oracle.mds.core.MDSSession createEditModeMDSSession()
          Create and return a new MDS Session based on the edit mode mappings.
abstract  oracle.mds.core.MDSSession createMDSSession()
          Create and return a new MDS Session based on the view mode mappings.
abstract  void displayError(oracle.webcenter.webcenterapp.WebCenterException ex)
          This method logs the error and display it in UI.
abstract  void displayWarning(java.lang.String resourceBundleClassName, java.lang.String key, java.lang.String[] args)
          This method display the warning
abstract
<T> T
evaluateExpression(java.lang.String expression, java.lang.Class<T> returnType)
          This API evaluates a given expression
 WCApplication getApplication()
          Return the WCApplication instance associated with this web application.
abstract  java.lang.String getApplicationURL()
          Gets the application's URL - http[s]://host:port/webcenter.
abstract  java.lang.String getChromeLevelForCurrentRequest()
          Returns the chrome-level to be used, if it can be determined from the current request or page.
static WCApplicationContext getCurrentInstance()
          Return the WCApplicationContext instance for the request that is being processed by the current thread, if any.
abstract  oracle.webcenter.portalframework.genericsiteresources.GenericSiteResource getCurrentPageTemplate()
          Returns a page template object of type GenericSiteResource used for current request.
abstract  oracle.webcenter.framework.service.Scope getCurrentScope()
          Returns a scope object corresponding to the current WC context.
abstract  java.lang.String getCurrentScopedWebCenterURI()
          Returns a URI that represents the current request (including request parameters recognized by WebCenter) in the context of the current scope.
abstract  java.lang.String getCurrentTaskFlowID()
          get the current taskflow id.
abstract  java.lang.String getCurrentWebCenterURI()
          Method to get the a URI that represents the current request (including request parameters that are recognized by WebCenter).
abstract  oracle.mds.core.MetadataObject getEditModeMO(oracle.mds.core.MDSSession session, java.lang.String documentPath, boolean isPersonalizeMode)
          Returns the edit only MetadataObject for a particular document.
abstract  java.util.Map<java.lang.String,java.lang.Object> getEnvProperties()
          Returns a map of the current WebCenter application's environment configuration properties.
abstract  java.lang.String getGroupSpaceURL(java.lang.String GroupSpaceName)
          return the pretty url for the named Group Space
abstract  java.lang.String getGSTemplateURL(java.lang.String templateName)
          return the pretty url for the named TemplateName
 oracle.mds.core.MDSSession getMDSSession()
          Returns an MDS session associated with the current WCApplicationContext.
abstract  java.lang.String getNavigableURL(javax.servlet.http.HttpServletRequest hreq, java.lang.String destinationURI)
          Determines the URL with all the request parameters propagated to the new URL for the given destinationURI
abstract  java.lang.String getNavigableURL(java.lang.String viewIdWithParams)
          Constructs a URL suitable for navigation within the context of the current WebCenter App, based on the specified URI.
abstract  java.lang.String getNavigableURL(java.lang.String viewIdWithParams, java.util.Map<java.lang.String,java.lang.String> overridingNavigationParams)
          Similar to getNavigbleURL(viewIdWithParams) but provides the option to override the parameters that would appear in the constructed URL.
abstract  PreferencesManager getPreferencesManager()
           
abstract  oracle.webcenter.portalframework.genericsiteresources.GenericSiteResource getPreviouslySetPageTemplate()
          Returns a site template object of type GenericSiteResource used for previous request.
abstract  java.lang.String getProtocol()
          Gets the application's protocol scheme - http[s]://
abstract  java.lang.String getRequestProperty(java.lang.String key, java.util.Map parameterMap, java.util.Map sessionMap)
          Return the value of the known webcenter param.
abstract  java.util.Map getRequestScopeMap()
          This method returns the session scope map for the current thread.
abstract  java.lang.String getServicesScriptsUrl()
          Return the path of webcenter services script url
abstract  java.util.Map<java.lang.String,java.lang.Object> getSessionProperties()
          Returns a place for WebCenter can use to store and retrieve information during the lifetime of the current user session.
abstract  oracle.mds.core.MDSSession getSiteCCSession(java.lang.String documentPath)
          Definition of an abstract method to get MDSSession with oracle.webcenter.webcenterapp.internal.metadata.WebCenterSiteCC customization.
abstract  java.lang.String getSpacesResourcesPath()
          Returns the servlet path for WebCenter Spaces resources whose loading is controlled specifically by the application, such as custom logos and icons uploaded by users.
abstract  java.lang.String getSpacesScriptsUrl()
          Return the path of webcenter spaces script url
abstract  java.lang.String getSpacesURL()
          return the pretty url for Personal Space
abstract  oracle.mds.core.MDSSession getTFISiteCCSession(java.lang.String documentPath)
          Definition of an abstract method to get MDSSession with oracle.webcenter.webcenterapp.internal.metadata.WebCenterTFISiteCC customization.
abstract  oracle.mds.core.MetadataObject getViewModeMO(oracle.mds.core.MDSSession session, java.lang.String documentPath, boolean isPersonalizeMode)
          Returns the view only MetadataObject for a particular document.
abstract  oracle.webcenter.webcenterapp.concurrent.WCLockManager getWCLockManager()
           This API gets the lock manager for current instance
static boolean isWCApplicationCustomized()
          Checks if the WCApplication has been customized, if yes then returns true, false otherwise.
abstract  void launchInEditMode(java.lang.String viewIdWithParams)
          Launches the specified page in edit mode.
abstract  void navigateToURI(java.lang.String viewIdWithParams)
          Navigate to the specified URI in the context of the current WebCenter App.
abstract  void navigateToURI(java.lang.String viewIdWithParams, java.util.Map<java.lang.String,java.lang.String> overridingNavigationParams)
          Similar to navigateToURI(viewIdWithParams) but provides the option to override the URL parameters that would be used during navigation.
static void releaseCachedContext()
          Release all the cached WCApplication Context instances which are specific to local threads
protected static void setCurrentInstance(WCApplicationContext context)
          Set the WCApplicationContext instance for the request that is being processed by the current thread.

 

Methods inherited from class oracle.webcenter.framework.application.context.WebCenterApplicationContext
getEditLayer, getHomeURL, navigateToURI, setEditLayer, unsetEditLayer

 

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

 

Constructor Detail

WCApplicationContext

public WCApplicationContext()

Method Detail

getPreferencesManager

public abstract PreferencesManager getPreferencesManager()

releaseCachedContext

public static void releaseCachedContext()

Release all the cached WCApplication Context instances which are specific to local threads


getApplication

public WCApplication getApplication()

Return the WCApplication instance associated with this web application.

EL: #{WCAppContext.application}

Returns:
an instance of WCApplication object associated with the web application.

getMDSSession

public oracle.mds.core.MDSSession getMDSSession()
Returns an MDS session associated with the current WCApplicationContext. It has the same properties (cust config, user state handler) as that of an MDS session obtained from the current ADF context. It is initialized in the first call to this method on the current instance, and returned on that and subsequent calls on the current instance.
Returns:
MDS session associated with the current app context.

getCurrentInstance

public static WCApplicationContext getCurrentInstance()
Return the WCApplicationContext instance for the request that is being processed by the current thread, if any.

EL: #{WCAppContext}

Returns:
an object providing an access point for all WebCenter application-related information in the context of the current web request.

getSpacesURL

public abstract java.lang.String getSpacesURL()

return the pretty url for Personal Space


createMDSSession

public abstract oracle.mds.core.MDSSession createMDSSession()
Create and return a new MDS Session based on the view mode mappings. This is different from getMDSSession which returns the same MDSSession for the request.
Returns:
new mds session

createEditModeMDSSession

public abstract oracle.mds.core.MDSSession createEditModeMDSSession()
Create and return a new MDS Session based on the edit mode mappings. This is different from getMDSSession which returns the same MDSSession for the request.
Specified by:
createEditModeMDSSession in class oracle.webcenter.framework.application.context.WebCenterApplicationContext
Returns:
new mds session

createCustomizeModeMDSSession

public abstract oracle.mds.core.MDSSession createCustomizeModeMDSSession()
Create and return a new MDS Session based on the customize mode mappings. This is different from getMDSSession which returns the same MDSSession for the request.
Returns:
new mds session

getViewModeMO

public abstract oracle.mds.core.MetadataObject getViewModeMO(oracle.mds.core.MDSSession session,
                                                             java.lang.String documentPath,
                                                             boolean isPersonalizeMode)
                                                      throws oracle.webcenter.webcenterapp.WebCenterException
Returns the view only MetadataObject for a particular document.
Throws:
oracle.webcenter.webcenterapp.WebCenterException

getEditModeMO

public abstract oracle.mds.core.MetadataObject getEditModeMO(oracle.mds.core.MDSSession session,
                                                             java.lang.String documentPath,
                                                             boolean isPersonalizeMode)
                                                      throws oracle.webcenter.webcenterapp.WebCenterException
Returns the edit only MetadataObject for a particular document.
Throws:
oracle.webcenter.webcenterapp.WebCenterException

getSpacesResourcesPath

public abstract java.lang.String getSpacesResourcesPath()
Returns the servlet path for WebCenter Spaces resources whose loading is controlled specifically by the application, such as custom logos and icons uploaded by users.

EL: #{WCAppContext.spacesResourcesPath}

Returns:
Servlet path for WebCenter Spaces resources whose loading is controlled specifically by the application, such as custom logos and icons uploaded by users.

getSpacesScriptsUrl

public abstract java.lang.String getSpacesScriptsUrl()
Return the path of webcenter spaces script url

getServicesScriptsUrl

public abstract java.lang.String getServicesScriptsUrl()
Return the path of webcenter services script url

getCurrentTaskFlowID

public abstract java.lang.String getCurrentTaskFlowID()
get the current taskflow id.
Returns:
the taskflow you are in and null if not inside any taskflow.

getRequestProperty

public abstract java.lang.String getRequestProperty(java.lang.String key,
                                                    java.util.Map parameterMap,
                                                    java.util.Map sessionMap)
Return the value of the known webcenter param.
Parameters:
key - the known webcenter parameter name like we.contextURL.
parameterMap - parameters
sessionMap -
Returns:
the value of the parameter

getChromeLevelForCurrentRequest

public abstract java.lang.String getChromeLevelForCurrentRequest()
Returns the chrome-level to be used, if it can be determined from the current request or page.
Returns:
The chrome-level to be used, if it can be determined from the current request or page.

getGroupSpaceURL

public abstract java.lang.String getGroupSpaceURL(java.lang.String GroupSpaceName)

return the pretty url for the named Group Space


getGSTemplateURL

public abstract java.lang.String getGSTemplateURL(java.lang.String templateName)

return the pretty url for the named TemplateName


getWCLockManager

public abstract oracle.webcenter.webcenterapp.concurrent.WCLockManager getWCLockManager()

This API gets the lock manager for current instance


getCurrentScope

public abstract oracle.webcenter.framework.service.Scope getCurrentScope()
Returns a scope object corresponding to the current WC context.

EL: #{WCAppContext.currentScope}

Returns:
A scope object corresponding to the current WC context.

getRequestScopeMap

public abstract java.util.Map getRequestScopeMap()
This method returns the session scope map for the current thread. This method returns the sesion scoped map for the current thread.This map can be used to store different constants, values. It is important to clean up the entries from the map once they are used.
Returns:
a map of (String, object).

getSessionProperties

public abstract java.util.Map<java.lang.String,java.lang.Object> getSessionProperties()
Returns a place for WebCenter can use to store and retrieve information during the lifetime of the current user session.
Returns:
Map of WebCenter session-level properties

getCurrentWebCenterURI

public abstract java.lang.String getCurrentWebCenterURI()
Method to get the a URI that represents the current request (including request parameters that are recognized by WebCenter).

EL: #{WCAppContext.currentWebCenterURI}

Returns:
A URI, starting from after the servlet path, that represents the current HTTP request.

getCurrentScopedWebCenterURI

public abstract java.lang.String getCurrentScopedWebCenterURI()
Returns a URI that represents the current request (including request parameters recognized by WebCenter) in the context of the current scope.

The URI returned by this method would not provide any explicit indication about what WebCenter scope the current request represents.

Returns:
A URI, starting from after servlet path, that represents the the current HTTP request in the context of the current scope.

getNavigableURL

public abstract java.lang.String getNavigableURL(java.lang.String viewIdWithParams)
Constructs a URL suitable for navigation within the context of the current WebCenter App, based on the specified URI.
Parameters:
viewIdWithParams - The URI to be navigated to. It is expected to be a JSF view-id (i.e. an ADFc view-id or physical page path), and can also contain parameters through a HTTP URL-like syntax which will get evaluated as HTTP request parameters after the redirection is done. Examples:
  • "/defaultScope_something?someParam=someValue"
  • "/oracle/webcenter/somePage.jspx?p1=v1&p2=v2"
  • "/xyz?a=b"

getNavigableURL

public abstract java.lang.String getNavigableURL(javax.servlet.http.HttpServletRequest hreq,
                                                 java.lang.String destinationURI)
Determines the URL with all the request parameters propagated to the new URL for the given destinationURI
Parameters:
hreq - the request object
destinationURI - the URI for which page path ahs to be determined
Returns:
URL of the page path for the given URI

getNavigableURL

public abstract java.lang.String getNavigableURL(java.lang.String viewIdWithParams,
                                                 java.util.Map<java.lang.String,java.lang.String> overridingNavigationParams)
Similar to getNavigbleURL(viewIdWithParams) but provides the option to override the parameters that would appear in the constructed URL.

For any parameter that may find appearance in the constructed URL, if its value has been specified in overridingparams then that value would be used, otherwise a default would be used for it.

Parameters:
viewIdWithParams - Same as for getNavigateURL(viewIdWithParams).
overridingNavigationParams - Map specifying values of parameters that should override the default parameters in the constructed URL.

navigateToURI

public abstract void navigateToURI(java.lang.String viewIdWithParams)
Navigate to the specified URI in the context of the current WebCenter App.
Parameters:
viewIdWithParams - The URI to be navigated to. It is expected to be a JSF view-id (i.e. an ADFc view-id or physical page path), and can also contain parameters through a HTTP URL-like syntax which will get evaluated as HTTP request parameters after the redirection is done. Examples:
  • "/defaultScope_something?someParam=someValue"
  • "/oracle/webcenter/somePage.jspx?p1=v1&p2=v2"
  • "/xyz?a=b"

navigateToURI

public abstract void navigateToURI(java.lang.String viewIdWithParams,
                                   java.util.Map<java.lang.String,java.lang.String> overridingNavigationParams)
Similar to navigateToURI(viewIdWithParams) but provides the option to override the URL parameters that would be used during navigation.

For any URL parameter that may find appearance in the destination URL, if its value has been specified in overridingparams then that value would be used, otherwise a default would be used for it.

Parameters:
viewIdWithParams - Same as for navigateToURI(viewIdWithParams).
overridingNavigationParams - Map specifying values of parameters that should override the default parameters in the navigation destination URL.

launchInEditMode

public abstract void launchInEditMode(java.lang.String viewIdWithParams)
Launches the specified page in edit mode.
Parameters:
viewIdWithParams - The URI to be navigated to. It is expected to be a JSF view-id (i.e. an ADFc view-id or physical page path), and can also contain parameters through a HTTP URL-like syntax which will get evaluated as HTTP request parameters after the redirection is done. Examples:
  • "/defaultScope_something?someParam=someValue"
  • "/oracle/webcenter/somePage.jspx?p1=v1&p2=v2"
  • "/xyz?a=b"

getEnvProperties

public abstract java.util.Map<java.lang.String,java.lang.Object> getEnvProperties()
Returns a map of the current WebCenter application's environment configuration properties.
Returns:
Map of the current WebCenter application's environment configuration properties.

displayError

public abstract void displayError(oracle.webcenter.webcenterapp.WebCenterException ex)
This method logs the error and display it in UI.

displayWarning

public abstract void displayWarning(java.lang.String resourceBundleClassName,
                                    java.lang.String key,
                                    java.lang.String[] args)
This method display the warning

getApplicationURL

public abstract java.lang.String getApplicationURL()
Gets the application's URL - http[s]://host:port/webcenter.

EL: #{WCAppContext.applicationURL}

Returns:
the application's URL.

getProtocol

public abstract java.lang.String getProtocol()
Gets the application's protocol scheme - http[s]://

isWCApplicationCustomized

public static final boolean isWCApplicationCustomized()
Checks if the WCApplication has been customized, if yes then returns true, false otherwise.

setCurrentInstance

protected static void setCurrentInstance(WCApplicationContext context)

Set the WCApplicationContext instance for the request that is being processed by the current thread.

Parameters:
context - The WCApplicationContext instance for the current thread, or null if this thread no longer has a WCApplicationContext instance.

getSiteCCSession

public abstract oracle.mds.core.MDSSession getSiteCCSession(java.lang.String documentPath)
Definition of an abstract method to get MDSSession with oracle.webcenter.webcenterapp.internal.metadata.WebCenterSiteCC customization.
Parameters:
documentPath - - The document for which the MDSSession is requested
Returns:
- an instance of MDSSession object

getTFISiteCCSession

public abstract oracle.mds.core.MDSSession getTFISiteCCSession(java.lang.String documentPath)
Definition of an abstract method to get MDSSession with oracle.webcenter.webcenterapp.internal.metadata.WebCenterTFISiteCC customization.
Parameters:
documentPath - - The document for which the MDSSession is requested
Returns:
- an instance of MDSSession object

getCurrentPageTemplate

public abstract oracle.webcenter.portalframework.genericsiteresources.GenericSiteResource getCurrentPageTemplate()
Returns a page template object of type GenericSiteResource used for current request.

EL: #{WCAppContext.currentPageTemplate}

Returns:
a page template of type GenericSiteResource object used for current request.

getPreviouslySetPageTemplate

public abstract oracle.webcenter.portalframework.genericsiteresources.GenericSiteResource getPreviouslySetPageTemplate()
Returns a site template object of type GenericSiteResource used for previous request.

EL: #{WCAppContext.previouslySetPageTemplate}

Returns:
a page template of type GenericSiteResource object used for the previous request.

evaluateExpression

public abstract <T> T evaluateExpression(java.lang.String expression,
                                         java.lang.Class<T> returnType)
This API evaluates a given expression
Type Parameters:
T - T The type of the object the expresssion will evalate to
Parameters:
expresssion - the expression to be evaluated
Returns:
the evaluated result

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.