com.sap.netweaver.bc.uwl.connect

Interface IActionHandler


public interface IActionHandler

The IActionHandler interface defines methods relevant for executing actions on Items. This interface has to be implemented by all action handlers.

Action handlers belong to one of the following two types:

  1. One that directly communicates with the provider system and return the result of performing the action. This type of Action Handlers should implement performAction() method and return false in isLauncher() method.
  2. Lauch a new application and not worry returning the result directly back to UWL. This type of Action Handlers should return true in their isLauncher() method and implement getUrl() method.
IActionHandler implementations are expected to be stateless and thread safe.

For details on pre shipped IActionHandlers refer to Action javadoc. Breif information about different Action Handlers is present in ActionHandlers documentation

See Also:
Action, IProviderConnector.getActionHandler(java.lang.String)

Method Summary
 String getId()
          Identifer for this Action handler.
 String getUrl(UWLContext context, Item item, Action action, Map properties)
          Constructs and returns a fully qualified URL based upon the Item and properties defined for the Action.
 boolean isLauncher()
          An Action Handler can just launch a new application and not worry about communicating the result back to UWL.
 boolean needsItemValidation()
          Method that specifies if this Action Handler needs to verify if item is still valid before performing an action.
 ProviderStatus performAction(UWLContext context, Item item, Action action, Map properties)
          Method that gets called to execute an Action on the Item.
 

Method Detail

getId

public String getId()
Identifer for this Action handler. Every IActionHandler should identify itself with a unique identifer. This id is corresponds to getHandler() of Action object. This id is case sensitive.

Returns:
non null identifier

isLauncher

public boolean isLauncher()
An Action Handler can just launch a new application and not worry about communicating the result back to UWL. These types of Action Handler are called Launchers. And they should return true for isLauncher() method.

Returns:
true if it is a launcher,false otherwise
See Also:
getUrl(com.sap.netweaver.bc.uwl.UWLContext, com.sap.netweaver.bc.uwl.Item, com.sap.netweaver.bc.uwl.config.Action, java.util.Map)

needsItemValidation

public boolean needsItemValidation()
Method that specifies if this Action Handler needs to verify if item is still valid before performing an action. If return is true, Provider Connector is called to verify the validity of Item before action is performed.

Returns:
true if this type of ActionHandler requires Items to be validated before any action is to performed on the Item.
See Also:
IProviderConnector.isItemValid(com.sap.netweaver.bc.uwl.UWLContext, com.sap.netweaver.bc.uwl.Item)

getUrl

public String getUrl(UWLContext context,
                     Item item,
                     Action action,
                     Map properties)
              throws UWLException
Constructs and returns a fully qualified URL based upon the Item and properties defined for the Action. Method getUrl is called only if isLauncher() returns true.

Parameters:
context - not null
item - not null
action - not null
properties - not null. If there are dynamic properties defined for that action, they are first computed and then passed in the properties map.
Returns:
a fully qualified url which could be launched in the browser. To allow the navigation to leave a bread crumb in the portal return the keyword "ROLES://" with the location of the iview as the URL. The UI code will look for this keyword and call the doNavigate() javascript if found else it will redirect to the specified URL.
Throws:
UWLException - in case expected parameters are missing or URL can not be constructed.
See Also:
Action

performAction

public ProviderStatus performAction(UWLContext context,
                                    Item item,
                                    Action action,
                                    Map properties)
                             throws ConnectorException
Method that gets called to execute an Action on the Item. This performAction() is called only if isLauncher() returns false. This method should take care of performing the Action and returning the result of action on item. Action Handler code may optionally update the item in UWL storage by using IPushChannel apis.

Parameters:
context - not null
item - item on which action is performed
action -
properties - not null. If there are dynamic properties defined for that action, they are first computed and then passed in the properties.
Returns:
status of execution containing messages, success or failure etc..
Throws:
ConnectorException - in case of provided related problems
See Also:
Action


Copyright 2006 SAP AG Complete Copyright Notice