Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


oracle.webcenter.framework.resource.view
Class AbstractResourceActionHandler

java.lang.Object
  extended by oracle.webcenter.framework.resource.view.AbstractResourceActionHandler

All Implemented Interfaces:
ResourceActionHandler
Direct Known Subclasses:
DefaultResourceActionHandler, PopUpResourceActionHandler

public abstract class AbstractResourceActionHandler
extends java.lang.Object
implements ResourceActionHandler

Provides an abstract base class implementing ResourceActionHandler for custom resource action handlers to be written. This class also provides some utility functions which may be of use when developing a resource action handler.
WebCenter provides two resource action handlers which extend this class:

The resource action handler can be specified in adf-config.xml as follows:

 <wpsC:adf-service-config xmlns="http://xmlns.oracle.com/webcenter/framework/service">
   <resource-handler
     class="oracle.webcenter.framework.resource.view.PopUpResourceActionHandler"/>
 </wpsC:adf-service-config>
 

If no class is specified, the DefaultResourceActionHandler is used.
The resourceActioned() API can be overridden in the concrete resource action handler to invoke the ADF inline popup or RAH navigation APIs when the resource is actioned. By default, resourceActioned() returns DEFAULT so that the built in ADF inline pop-up behavior can be controlled via the attribute display-as-popup in the <resource-handler> element in adf-config. The ADF inline pop-up is provided by the WebCenter RAH system itself but is disabled by default in WebCenter Portal applications, add the attribute display-as-popup="true" to enable it, or override resourceActioned() to give the handler more control over whether to display the inline popup or perform an RAH navigation.
The display-as-popup value in adf-config.xml can be overridden in a taskflow's usage of RAH in the resourceActionBehavior tag via the useResourcePopup attribute which takes the values: "never", "appDefault" or "always".
WebCenter Service Taskflows can be customized to change this value if it is not appropriate for the specific use case in the Portal application.
This allows complex decisions to be made on a service, referrer or resource basis using a combination of the resourceActioned() API, display-as-popup setting and the resourceActionBehavior useResourcePopup attribute.
When writing a custom ResourceActionHandler, extend this class and implement the launchDialog() method to perform the desired navigation action for the given resource and viewId.

Since:
11.1.1.4.0

Nested Class Summary

 

Nested classes/interfaces inherited from interface oracle.webcenter.framework.resource.view.ResourceActionHandler
ResourceActionHandler.ResourceActionedResult

 

Field Summary
protected static java.lang.String DIALOG_RESOURCE_TITLE
          The constant used in the Dialog parameters to represent the resource title.
protected static java.lang.String DIALOG_TASKFLOW_PARAMETERS_MAP
          The constant used in the Dialog parameters to represent the Map of task flow parameters.
protected static java.lang.String DIALOG_VIEW_RENDERER
          The constant used in the Dialog parameters to represent the View Renderer.
static java.lang.String INLINE_POPUP_REFERER
          Resource Referer used for when the inline ADF resource viewer popup invokes the full screen view of the resource via RAH.
protected static java.lang.String REFRESH_NEEDED
          Add the boolean value true to the page flow scope using this key to explicitly tell the pageDef of the launching source view to refresh itself so that the view port handling will be done successfully.
protected static TaskFlowId RESOURCE_VIEWER_TASKFLOW_ID
          The TaskFlow representing the built-in resourceViewer.
protected static java.lang.String RESOURCE_VIEWER_TASKFLOW_LOCAL_ID
          The id of the built-in resource viewer taskflow which contains a dynamically assigned taskflow used to display the resource view of a service invoked by RAH.
protected static java.lang.String RESOURCE_VIEWER_TASKFLOW_PATH
          The path to the built-in resource viewer taskflow which contains a dynamically assigned taskflow used to display the resource view of a service invoked by RAH.
protected static java.lang.String URL_PARAM_RESOURCE_ID
          The URL parameter that represents the resource id.
protected static java.lang.String URL_PARAM_RESOURCE_REFERER
          The URL parameter that represents the resource referrer.
protected static java.lang.String URL_PARAM_RESOURCE_SCOPE
          The URL parameter that represents the resource scope.
protected static java.lang.String URL_PARAM_RESOURCE_TYPE
          The URL parameter that represents the resource type.

 

Constructor Summary
AbstractResourceActionHandler()
           

 

Method Summary
protected  void appendURIParameter(java.lang.StringBuilder targetURI, java.lang.String name, java.lang.String value)
          A utility method which is used to append url parameters to the given targetURI modifying the targetURI by appending either a ? or & followed by the name parameter value and the URL encoded value.
protected  java.util.Map<java.lang.String,java.lang.Object> getDialogParams(java.lang.String viewRenderer, java.lang.String resourceTitle, java.util.Map<java.lang.String,java.lang.Object> taskFlowParams)
          Returns a Map of Strings and objects which may be passed to the dialog after the navigation has occurred.
protected  java.util.Map<java.lang.String,java.lang.Object> getTaskFlowParams(ResourceActionRenderContext resource)
          Returns a Map of task flow parameters which may be passed down to the resource view taskflow after navigation has occurred.
protected  java.util.Map<java.lang.String,java.lang.Object> getValueMapParams(ResourceActionRenderContext resource)
          Returns a Map of the serializable value map parameters which may be added to either the task flow parameters or the dialog parameters as appropriate.
protected abstract  void launchDialog(ResourceActionRenderContext resource, java.lang.String viewId)
          Abstract API which should be implemented by subclasses to perform the navigation action with the given resource and viewId.
 ResourceActionHandler.ResourceActionedResult resourceActioned(javax.faces.event.ActionEvent action, ResourceActionRenderContext resource)
          Override this API to allow the resource action handler to specify whether the resource being actioned will open in the ADF inline popup (where available) or that the resource action handler should be invoked via viewTaskflow(), viewPage(), or viewResourceAsPage() in the RAH class.
 void viewPage(ResourceActionRenderContext resource)
          This is how the handler will implement the viewing of a page, if the service declares its Resource View to be a page.
 void viewResourceAsPage(ResourceActionRenderContext resource)
          This is how the handler will implement the viewing of a resource when interpreted as a page, if the service declares no Resource Views and the service ID is understood to allow for this to happen.
 void viewTaskFlow(ResourceActionRenderContext resource, TaskFlowId taskFlowId)
          This is how the handler will implement the viewing of a task flow, if the service declares its Resource View to be a task flow.

 

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

 

Field Detail

INLINE_POPUP_REFERER

public static final java.lang.String INLINE_POPUP_REFERER
Resource Referer used for when the inline ADF resource viewer popup invokes the full screen view of the resource via RAH.
See Also:
Constant Field Values

REFRESH_NEEDED

protected static final java.lang.String REFRESH_NEEDED
Add the boolean value true to the page flow scope using this key to explicitly tell the pageDef of the launching source view to refresh itself so that the view port handling will be done successfully.
See Also:
Constant Field Values

DIALOG_TASKFLOW_PARAMETERS_MAP

protected static final java.lang.String DIALOG_TASKFLOW_PARAMETERS_MAP
The constant used in the Dialog parameters to represent the Map of task flow parameters.
See Also:
Constant Field Values

DIALOG_VIEW_RENDERER

protected static final java.lang.String DIALOG_VIEW_RENDERER
The constant used in the Dialog parameters to represent the View Renderer.
See Also:
Constant Field Values

DIALOG_RESOURCE_TITLE

protected static final java.lang.String DIALOG_RESOURCE_TITLE
The constant used in the Dialog parameters to represent the resource title.
See Also:
Constant Field Values

RESOURCE_VIEWER_TASKFLOW_PATH

protected static final java.lang.String RESOURCE_VIEWER_TASKFLOW_PATH
The path to the built-in resource viewer taskflow which contains a dynamically assigned taskflow used to display the resource view of a service invoked by RAH.
See Also:
Constant Field Values

RESOURCE_VIEWER_TASKFLOW_LOCAL_ID

protected static final java.lang.String RESOURCE_VIEWER_TASKFLOW_LOCAL_ID
The id of the built-in resource viewer taskflow which contains a dynamically assigned taskflow used to display the resource view of a service invoked by RAH.
See Also:
Constant Field Values

RESOURCE_VIEWER_TASKFLOW_ID

protected static final TaskFlowId RESOURCE_VIEWER_TASKFLOW_ID
The TaskFlow representing the built-in resourceViewer.

URL_PARAM_RESOURCE_ID

protected static final java.lang.String URL_PARAM_RESOURCE_ID
The URL parameter that represents the resource id.
See Also:
Constant Field Values

URL_PARAM_RESOURCE_TYPE

protected static final java.lang.String URL_PARAM_RESOURCE_TYPE
The URL parameter that represents the resource type.
See Also:
Constant Field Values

URL_PARAM_RESOURCE_SCOPE

protected static final java.lang.String URL_PARAM_RESOURCE_SCOPE
The URL parameter that represents the resource scope.
See Also:
Constant Field Values

URL_PARAM_RESOURCE_REFERER

protected static final java.lang.String URL_PARAM_RESOURCE_REFERER
The URL parameter that represents the resource referrer.
See Also:
Constant Field Values

Constructor Detail

AbstractResourceActionHandler

public AbstractResourceActionHandler()

Method Detail

launchDialog

protected abstract void launchDialog(ResourceActionRenderContext resource,
                                     java.lang.String viewId)
Abstract API which should be implemented by subclasses to perform the navigation action with the given resource and viewId. This is called by viewTaskflow(), viewPage() and viewResourceAsPage() after setting the context.
This API should typically:

appendURIParameter

protected void appendURIParameter(java.lang.StringBuilder targetURI,
                                  java.lang.String name,
                                  java.lang.String value)
A utility method which is used to append url parameters to the given targetURI modifying the targetURI by appending either a ? or & followed by the name parameter value and the URL encoded value.
Parameters:
targetURI - the URI to append to
name - the parameter name to append
value - the parameter value to append (this will be encoded by this API).

getDialogParams

protected java.util.Map<java.lang.String,java.lang.Object> getDialogParams(java.lang.String viewRenderer,
                                                                           java.lang.String resourceTitle,
                                                                           java.util.Map<java.lang.String,java.lang.Object> taskFlowParams)
Returns a Map of Strings and objects which may be passed to the dialog after the navigation has occurred. This will consist of the DIALOG_TASKFLOW_PARAMETERS_MAP containing the taskFlowParams, DIALOG_RESOURCE_TITLE containing the resource title, and DIALOG_VIEW_RENDERER containing the viewRenderer.
Parameters:
viewRenderer - the view renderer usually obtained using resource.getViewRenderer()
resourceTitle - the title of resource being navigated to
taskFlowParams - the Map of parameters to pass to the taskflow
Returns:
a Map of parameters to pass to the dialog (including the task flow parameters passed to the taskflow displayed by the dialog.)

getTaskFlowParams

protected java.util.Map<java.lang.String,java.lang.Object> getTaskFlowParams(ResourceActionRenderContext resource)
Returns a Map of task flow parameters which may be passed down to the resource view taskflow after navigation has occurred. This will consist of the resource id, type, scope and referer with Map keys based on the ResourceRow.ATTR constants.
Parameters:
resource - The resource being navigated to
Returns:
a Map of parameters to pass to the taskflow

getValueMapParams

protected java.util.Map<java.lang.String,java.lang.Object> getValueMapParams(ResourceActionRenderContext resource)
Returns a Map of the serializable value map parameters which may be added to either the task flow parameters or the dialog parameters as appropriate. If the resource viewer is a taskflow they should be added to the taskflow parameters Map, otherwise they should be added to the dialog parameters Map.
Parameters:
resource - The resource being navigated to
Returns:
a Map of serializable value parameters from the resource

viewTaskFlow

public void viewTaskFlow(ResourceActionRenderContext resource,
                         TaskFlowId taskFlowId)
This is how the handler will implement the viewing of a task flow, if the service declares its Resource View to be a task flow.
Specified by:
viewTaskFlow in interface ResourceActionHandler
Parameters:
resource - The necessary information on how the rendering of the resource will take place
taskFlowId - The ID of the task flow to be viewed

viewPage

public void viewPage(ResourceActionRenderContext resource)
This is how the handler will implement the viewing of a page, if the service declares its Resource View to be a page.
Specified by:
viewPage in interface ResourceActionHandler
Parameters:
resource - The necessary information on how the rendering of the resource will take place

viewResourceAsPage

public void viewResourceAsPage(ResourceActionRenderContext resource)
This is how the handler will implement the viewing of a resource when interpreted as a page, if the service declares no Resource Views and the service ID is understood to allow for this to happen.
Specified by:
viewResourceAsPage in interface ResourceActionHandler
Parameters:
resource - The necessary information on how the rendering of the resource will take place

resourceActioned

public ResourceActionHandler.ResourceActionedResult resourceActioned(javax.faces.event.ActionEvent action,
                                                                     ResourceActionRenderContext resource)
Override this API to allow the resource action handler to specify whether the resource being actioned will open in the ADF inline popup (where available) or that the resource action handler should be invoked via viewTaskflow(), viewPage(), or viewResourceAsPage() in the RAH class. The default implementation returns ResourceActionedResult.DEFAULT. This API can also be overridden to perform the navigation itself in which case it should return ResourceActionedResult.HANDLED.
Specified by:
resourceActioned in interface ResourceActionHandler
Parameters:
action - The UI ActionEvent object
resource - The resource being actioned
Returns:
ResourceActionedResult.DEFAULT to use the default action specified in adf-config or on the RAH link itself, ResourceActionedResult.DO_POPUP to open in the ADF inline popup, ResourceActionedResult.DO_NAVIGATION to invoke the configured RAH handler, ResourceActionedResult.HANDLED if this API has already handled the navigation

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


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