com.sap.netweaver.bc.uwl.config

Class ItemType

java.lang.Object
  extended bycom.sap.netweaver.bc.uwl.config.ItemType
All Implemented Interfaces:
Cloneable, Serializable

public final class ItemType
extends Object
implements Serializable, Cloneable

Class that represents a type of Item. It maps to ItemType tag in the configuration XML file. For more details refer to the DTD documentation.

See Also:
Serialized Form

Field Summary
static String EXEC_MODE_DEFAULT
           
static String EXEC_MODE_OPTIMISTIC
           
static String EXEC_MODE_PESSIMISTIC
           
static String UWL_ALERT
           
static String UWL_ITEM
           
static String UWL_ITEM_COMPLETEDREQUEST
           
static String UWL_ITEM_COMPLETEDTASK
           
static String UWL_ITEM_CONFIRMATION
           
static String UWL_ITEM_FORWARDEDTASK
           
static String UWL_ITEM_FUTURETASK
           
static String UWL_ITEM_NOTIFICATION
           
static String UWL_ITEM_REQUEST
           
static String UWL_ITEM_TASK
           
static String UWL_ITEM_TASK_APPROVAL
           
static String UWL_ITEM_TASK_EXECUTABLE
           
 
Constructor Summary
ItemType(String name, String connector, ItemTypeCriteria gpCriteria, CustomAttributes[] attrs, Action[] acs, String defaultAction, CacheSettings cs, String view, String execMode)
           
ItemType(String name, String connector, ItemTypeCriteria gpCriteria, CustomAttributes[] attrs, Action[] acs, String defaultAction, CacheSettings cs, String view, String execMode, MenuItemCollection menus)
          See the DTD documentation for details about what each means.
 
Method Summary
 Object clone()
           
 Action[] getActions()
          Returns the actions, shouldnt be modified by the caller
 Map getActionsMap()
           
 CacheSettings getCacheSettings()
           
 String getConnector()
           
 ItemTypeCriteria getCriteria()
           
 CustomAttributes[] getCustomAttributes()
           
 String getDefaultAction()
          Returns the defAction.
 String getExecutionMode()
          optimistic : Assume that item is valid unless otherwise.
 MenuItemCollection getMenuItemCollection()
           
 String getName()
           
 String getNamespace()
           
 String getViewName()
           
static boolean isAllTypes(String s)
          Specifies if the item type passed matches all types.
 boolean isExecutionModeOptimistic()
           
 boolean isExecutionModePessimistic()
           
static boolean matchType(String childItemType, String parentItemType)
          Helper function that calculates if childItemType is indeed child of parentItemType passed.
 void setCriteria(ItemTypeCriteria criteria)
           
 void setCustomAttributes(CustomAttributes[] attrs)
           
 void setItemTypeCriteria(ItemTypeCriteria cr)
          Used only for internal purpose, Typically Item type is an immutable object.
 void setMenuItemCollection(MenuItemCollection collection)
           
 void setName(String name)
          Used only for internal purpose.
 void setViewName(String viewName)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXEC_MODE_OPTIMISTIC

public static final String EXEC_MODE_OPTIMISTIC
See Also:
Constant Field Values

EXEC_MODE_PESSIMISTIC

public static final String EXEC_MODE_PESSIMISTIC
See Also:
Constant Field Values

EXEC_MODE_DEFAULT

public static final String EXEC_MODE_DEFAULT
See Also:
Constant Field Values

UWL_ITEM

public static final String UWL_ITEM
See Also:
Constant Field Values

UWL_ITEM_NOTIFICATION

public static final String UWL_ITEM_NOTIFICATION
See Also:
Constant Field Values

UWL_ITEM_TASK

public static final String UWL_ITEM_TASK
See Also:
Constant Field Values

UWL_ITEM_CONFIRMATION

public static final String UWL_ITEM_CONFIRMATION
See Also:
Constant Field Values

UWL_ITEM_TASK_APPROVAL

public static final String UWL_ITEM_TASK_APPROVAL
See Also:
Constant Field Values

UWL_ITEM_TASK_EXECUTABLE

public static final String UWL_ITEM_TASK_EXECUTABLE
See Also:
Constant Field Values

UWL_ITEM_REQUEST

public static final String UWL_ITEM_REQUEST
See Also:
Constant Field Values

UWL_ALERT

public static final String UWL_ALERT
See Also:
Constant Field Values

UWL_ITEM_COMPLETEDTASK

public static final String UWL_ITEM_COMPLETEDTASK
See Also:
Constant Field Values

UWL_ITEM_FORWARDEDTASK

public static final String UWL_ITEM_FORWARDEDTASK
See Also:
Constant Field Values

UWL_ITEM_FUTURETASK

public static final String UWL_ITEM_FUTURETASK
See Also:
Constant Field Values

UWL_ITEM_COMPLETEDREQUEST

public static final String UWL_ITEM_COMPLETEDREQUEST
See Also:
Constant Field Values
Constructor Detail

ItemType

public ItemType(String name,
                String connector,
                ItemTypeCriteria gpCriteria,
                CustomAttributes[] attrs,
                Action[] acs,
                String defaultAction,
                CacheSettings cs,
                String view,
                String execMode)

ItemType

public ItemType(String name,
                String connector,
                ItemTypeCriteria gpCriteria,
                CustomAttributes[] attrs,
                Action[] acs,
                String defaultAction,
                CacheSettings cs,
                String view,
                String execMode,
                MenuItemCollection menus)
See the DTD documentation for details about what each means.

Parameters:
name -
connector -
gpCriteria -
attrs -
acs - Actions should be Array of unique Action objects
defaultAction -
cs -
view -
execMode -
menus -
Method Detail

getCacheSettings

public CacheSettings getCacheSettings()

getViewName

public String getViewName()

getName

public String getName()

getConnector

public String getConnector()

getCriteria

public ItemTypeCriteria getCriteria()

getCustomAttributes

public CustomAttributes[] getCustomAttributes()

getActions

public Action[] getActions()
Returns the actions, shouldnt be modified by the caller

Returns:
Action[]

getActionsMap

public Map getActionsMap()
Returns:
unmodifiable map. Not to be modified by the caller

getDefaultAction

public String getDefaultAction()
Returns the defAction.

Returns:
String

getNamespace

public String getNamespace()

setName

public void setName(String name)
Used only for internal purpose. Typically Item Type is an immutable object.

Parameters:
name -

setItemTypeCriteria

public void setItemTypeCriteria(ItemTypeCriteria cr)
Used only for internal purpose, Typically Item type is an immutable object.

Parameters:
cr -

getExecutionMode

public String getExecutionMode()
optimistic : Assume that item is valid unless otherwise. Execute it, if there is an error it could be because item was invalid or the action itself failed for genuine reasons.. By default cache validity period in UWL is 4 minutes.(it is configurable). pessimistic: Assume that item is volatile and may change anytime. This would mean before any action is to performed on the item , ask ProviderConnector.isItemValid(Item) and if so proceed, or indicate a warning by removing the item. For this back end has to support the validity checking feature. And this will not be very performant ,for every item's execution has to be first checked and then executed.

Returns:
could be null , any of the EXEC_MODE constants..

isExecutionModeOptimistic

public boolean isExecutionModeOptimistic()

isExecutionModePessimistic

public boolean isExecutionModePessimistic()

getMenuItemCollection

public MenuItemCollection getMenuItemCollection()
Returns:

setMenuItemCollection

public void setMenuItemCollection(MenuItemCollection collection)
Parameters:
collection -

matchType

public static boolean matchType(String childItemType,
                                String parentItemType)
Helper function that calculates if childItemType is indeed child of parentItemType passed. For example matchType("uwl.task.coll","uwl.task") returns true.

Parameters:
childItemType - could be null, if so false is returned.
parentItemType - should not be null
Returns:

isAllTypes

public static boolean isAllTypes(String s)
Specifies if the item type passed matches all types.

Parameters:
s -
Returns:

setCustomAttributes

public void setCustomAttributes(CustomAttributes[] attrs)

setViewName

public void setViewName(String viewName)

setCriteria

public void setCriteria(ItemTypeCriteria criteria)

clone

public Object clone()
             throws CloneNotSupportedException
Throws:
CloneNotSupportedException


Copyright 2006 SAP AG Complete Copyright Notice