|
SAP NetWeaver 2004S SPS 10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
The IUWLItemManager class provides functionality regarding retrieval and execution of Itemss.
Methods in this class contain retrieving Items, their attachments, sorting or filtering them and performing Actions
on them.
A handle to IUWLItemManager is got by calling IUWLService.getItemManager() method.
Implementation of this interface is thread safe.
Usually many of the ItemManager methods need connection to the back end, for example getting the
attachments or Description for the item. For performance reasons very first time when the user loads the
UWL, client of UWL Service could optionally set uwlContext.setAllowBackEndConnections(false)
and this forces UWL to take everything from cache for that method invocation and not to initiate any
back end connections.
IUWLService,
QueryProperties,
QueryResult.isPossiblyOutDated(),
UWLContext.isBackEndConnectionsAllowed()| Method Summary | |
ItemCollection |
filterItems(UWLContext context,
ItemCollection items,
CompoundExpression filter)
Filters items based upon the filter passed. |
Action |
getActionForItem(UWLContext ctx,
Item item,
String actionName)
Searches for the action in the the configuration. |
Action |
getActionForItem(UWLContext ctx,
long itemId,
String actionName)
Looks in the configuration whether action is defined. |
IActionHandler |
getActionHandler(String handlerId)
Look up registered action handler by its id. |
Map |
getActionProperties(UWLContext context,
Item item,
Action action,
Map actionProperties,
boolean needsItemValidation)
This method should be called only if Action is registered with the UI. |
String |
getActionUrl(UWLContext context,
Item item,
Action action,
Map actionProperties)
This method should be called only if isActionLaunchable() returs true. |
String |
getActionUrl(UWLContext context,
long[] itemIds,
String action)
Method that could be called to get one single url for launching multiple items. |
String |
getActionUrl(UWLContext context,
long item,
String action)
This method should be called only if isActionLaunchable() returs true. |
Map |
getAllActionsForItem(UWLContext context,
Item item)
Returns all the possible actions on that item, taken from the configuration and the provider connector itself. |
Attachment[] |
getAttachmentHeaders(UWLContext context,
Item item)
Retreives the attachment headers for this item. |
Action |
getDefaultActionForItem(UWLContext ctx,
Item item)
Searches in the configuration for default action defined for the Item's Itemtype. |
WorkLog |
getHistoryForItem(UWLContext context,
Item item)
Return the history log data of the item, retrieved from the provider connector. |
Item |
getItemByExternalId(UWLContext context,
String connectorId,
String systemId,
String externalId)
|
Item |
getItemByUwlId(UWLContext context,
long uwlId)
Same as getItemByUwlId(context,uwlId,true,true) |
Item |
getItemByUwlId(UWLContext context,
long uwlId,
boolean fillAllAttributes,
boolean fillDescription,
boolean fillAttachmentHeaders)
Method to retrieve an item. |
QueryResult |
getItems(UWLContext context,
QueryProperties queryProps,
CompoundExpression filter)
Method to retrieve Items. |
QueryResult |
getItemsForItemType(UWLContext context,
String itemType,
QueryProperties queryProps,
CompoundExpression viewFilter)
Method to retrieve Items for a particular item type passed.If returned items are not fully uptodate, isPossiblyOutDated()
on the result return true. |
QueryResult |
getItemsForView(UWLContext context,
UWLView view,
QueryProperties queryProps,
CompoundExpression filter)
Method to retrieve Items for a particular View.If returned items are not fully uptodate, isPossiblyOutDated()
on the result return true. |
String |
getItemTypeForItem(UWLContext context,
long itemId)
Finds item type for the item identified by itemId. |
ItemTypeCount[] |
getItemTypesBySize(UWLContext ctx,
String configurationGroup,
String substitutedUser)
Returns most popular item types and their count. |
Attachment |
getPopulatedAttachment(UWLContext context,
long itemId,
String internalAttachmentId)
Locates an attachment identified by the internalAttachmentId for the item and populates it and returns. |
Item |
getSubProcessTrackingItem(UWLContext context,
Item parentItem)
Retrieves the sub process tracking item. |
Set |
getSubstitutedForUsersWithItems(UWLContext ctx,
String itemType)
Returns only those user ids for which the current user has substitued and has items for them. |
int[] |
getTotalAndEmphasizedItemCountForView(UWLContext context,
UWLView view,
String configurationGroup,
String substitutedUser)
Returns items that need to be emphasized and total items in a particular View. |
boolean |
isActionLaunchable(UWLContext context,
Item item,
Action action)
Finds if action passed for the item is of launchable type. |
ProviderStatus |
performAction(UWLContext context,
Item item,
Action action,
Map actionProperties)
Call this method if and only if isActionLaunchable() returns false. |
ProviderStatus |
performAction(UWLContext context,
Item item,
String action)
Performs action on the item passed. |
ProviderStatus[] |
performAction(UWLContext context,
long[] itemKeys,
String action,
Map actionProperties)
Performs action on all the items whose keys are passed. |
ProviderStatus |
performAction(UWLContext context,
long itemId,
Action action,
Map actionProperties)
Call this method if and only if isActionLaunchable() returns false. |
ProviderStatus |
performAction(UWLContext context,
String externalItemId,
String systemId,
String connector,
String action,
Map actionProperties)
Call this method if and only if isActionLaunchable() returns false. |
void |
populateAttachmentContent(UWLContext context,
Item item,
Attachment hollowAttachment)
Fills the content of the hollowAttachment depending upon the attachment type. |
void |
populateAttachmentContents(UWLContext context,
Item item,
Attachment[] hollowAttachments)
Fills the content of the hollowAttachments depending upon the attachment type. |
Item |
refreshAndGetItemByUwlId(UWLContext context,
long uwlId)
This method refreshes the item from the backend and returns it. |
QueryResult |
refreshCacheAndGetItems(UWLContext context,
UWLView view,
QueryProperties queryProps,
CompoundExpression viewFilter)
Connects to all providerConnectors and gets items from them. |
QueryResult |
search(UWLContext context,
String textToSearch,
UWLView view,
QueryProperties queryProps,
CompoundExpression filter)
Search in the cache for items matching the text. |
void |
sortItems(UWLContext context,
ItemCollection items,
String[] sortKeys,
boolean[] sortOrder)
Method to explicitly sort the items based on the sort fields and the order passed. |
| Method Detail |
public QueryResult getItems(UWLContext context,
QueryProperties queryProps,
CompoundExpression filter)
throws UWLException
isPossiblyOutDated()
on the result return true. In such a situation, this method needs to be called again if possibly through a timer set for
few seconds to get the updated items. If end user needs recent items another option is to call refreshCacheAndGetItems() however
that comes with the performance penalty since connections need to made to the provider systems.
context - , required, not null. Should have the valid portalRequest
set inside it.
getItemByUwlId() method.
UWLException - if items could not be retreived.QueryResult.isPossiblyOutDated(),
UWLContext.isBackEndConnectionsAllowed()
public QueryResult getItemsForView(UWLContext context,
UWLView view,
QueryProperties queryProps,
CompoundExpression filter)
throws UWLException
isPossiblyOutDated()
on the result return true. In such a situation, this method needs to be called again if possibly through a timer set for
few seconds to get the updated items. If end user needs recent items another option is to call refreshCacheAndGetItems() however
that comes with the performance penalty since connections need to made to the provider systems.
context - , required, not null.
getItemByUwlId() method.
UWLException - if items could not be retreived.QueryResult.isPossiblyOutDated(),
UWLContext.isBackEndConnectionsAllowed()
public QueryResult getItemsForItemType(UWLContext context,
String itemType,
QueryProperties queryProps,
CompoundExpression viewFilter)
throws UWLException
isPossiblyOutDated()
on the result return true.
context - , required, not null. Should have the valid portalRequest
set inside it.
getItemByUwlId() method.
UWLException - if items could not be retreived.QueryResult.isPossiblyOutDated(),
UWLContext.isBackEndConnectionsAllowed()
public QueryResult refreshCacheAndGetItems(UWLContext context,
UWLView view,
QueryProperties queryProps,
CompoundExpression viewFilter)
throws UWLException
context - , required, not null. Should have the valid portalRequest
set inside it.
getItemByUwlId() method.
UWLException - if items could not be retreived.
public ItemCollection filterItems(UWLContext context,
ItemCollection items,
CompoundExpression filter)
throws UWLException
getItems()methods.
context -
UWLException - if session is invalid.
public QueryResult search(UWLContext context,
String textToSearch,
UWLView view,
QueryProperties queryProps,
CompoundExpression filter)
throws UWLException
context -
UWLException
public void sortItems(UWLContext context,
ItemCollection items,
String[] sortKeys,
boolean[] sortOrder)
throws UWLException
Item
documentation.
It is more performant to sort while getting items itself by passing
the sort information thro QueryProperties.
context - items - sortKeys - see Item for valid sort keys.sortOrder - every entry corresponding to sortKey, if true ascending, else descending.
UWLException
public int[] getTotalAndEmphasizedItemCountForView(UWLContext context,
UWLView view,
String configurationGroup,
String substitutedUser)
throws UWLException
If cache is invalid for at least one of the item types contained in the view passed, return values contain -1,-1 respectively. This method doesnt make connections to the ProviderConnectors for performance reasons.
context - configurationGroup - optionalsubstitutedUser - optional. If null ignored. If set to current user, only current users
count is returned, if set to a substituted users, only items for this count is returned.view - not null, contains metadata on emphasized mode.
UWLException - if there is any database related error.UWLView.setEmphasizedItems(java.lang.String),
QueryProperties.setSubstitutedUser(java.lang.String)
public ItemTypeCount[] getItemTypesBySize(UWLContext ctx,
String configurationGroup,
String substitutedUser)
throws UWLException
ctx - configurationGroup - optionalsubstitutedUser - optional. If null ignored. If set to current user, only current users
count is returned, if set to a substituted users, only items for this count is returned.
UWLException - if there is any errorQueryProperties.setSubstitutedUser(java.lang.String),
ItemType
public Set getSubstitutedForUsersWithItems(UWLContext ctx,
String itemType)
throws UWLException
ctx - not nullitemType - could be null. Use this to restrict to particular item type. If not
specified all item types are considered.
UWLException - if there are system problems.IUser,
QueryProperties.setSubstitutedUser(java.lang.String),
QueryResult.getSubstitutingUsers()
public Attachment[] getAttachmentHeaders(UWLContext context,
Item item)
throws UWLException
context - not nullitem - not null
populateAttachmentContent to fill the content
of an attachment. This return value is not null.
UWLExceptionpopulateAttachmentContent(com.sap.netweaver.bc.uwl.UWLContext, com.sap.netweaver.bc.uwl.Item, com.sap.netweaver.bc.uwl.Attachment)
public void populateAttachmentContent(UWLContext context,
Item item,
Attachment hollowAttachment)
throws UWLException
context - item - hollowAttachment - not null
UWLExceptionAttachment
public void populateAttachmentContents(UWLContext context,
Item item,
Attachment[] hollowAttachments)
throws UWLException
context - item - hollowAttachments -
UWLException
public Attachment getPopulatedAttachment(UWLContext context,
long itemId,
String internalAttachmentId)
throws UWLException
context - requrieditemId - identifier of the item that owns the attachmentinternalAttachmentId - should match the attachment.getInternalId()
UWLException
public Item getItemByUwlId(UWLContext context,
long uwlId,
boolean fillAllAttributes,
boolean fillDescription,
boolean fillAttachmentHeaders)
throws UWLException
context - uwlId - fillAttachmentHeaders -
UWLException - if no item is found
public Item getItemByExternalId(UWLContext context,
String connectorId,
String systemId,
String externalId)
throws UWLException
context - needed. Contains Users informationconnectorId - needed. Specifies the Connector which fetched the itemsystemId - system to which the item belogsexternalId - identifier of the item in the sytem
UWLException
public Item getSubProcessTrackingItem(UWLContext context,
Item parentItem)
throws UWLException
UWLException - in case of errors.
public Item getItemByUwlId(UWLContext context,
long uwlId)
throws UWLException
getItemByUwlId(context,uwlId,true,true)
UWLException
public Item refreshAndGetItemByUwlId(UWLContext context,
long uwlId)
throws UWLException
context - not nulluwlId -
UWLException - if item is not found
public String getItemTypeForItem(UWLContext context,
long itemId)
throws UWLException
context - required
UWLException - if item is not found
public ProviderStatus[] performAction(UWLContext context,
long[] itemKeys,
String action,
Map actionProperties)
throws UWLException
context - not nullaction - required, not null
UWLException
public ProviderStatus performAction(UWLContext context,
Item item,
String action)
throws UWLException
context - item - not nullaction - not null
UWLException
public ProviderStatus performAction(UWLContext context,
long itemId,
Action action,
Map actionProperties)
throws UWLException
isActionLaunchable() returns false.
context - action -
UWLException
public ProviderStatus performAction(UWLContext context,
Item item,
Action action,
Map actionProperties)
throws UWLException
isActionLaunchable() returns false.
context - item - action - actionProperties -
UWLException
public ProviderStatus performAction(UWLContext context,
String externalItemId,
String systemId,
String connector,
String action,
Map actionProperties)
throws UWLException
isActionLaunchable() returns false.
context - externalItemId - systemId - connector - action - actionProperties -
UWLException
public IActionHandler getActionHandler(String handlerId)
throws UWLException
handlerId - id of the action handler. See Action class.
UWLException - Thrown if not foundIActionHandler,
Action
public String getActionUrl(UWLContext context,
Item item,
Action action,
Map actionProperties)
throws UWLException
isActionLaunchable() returs true.
context - not nullitem - neededaction - not null
UWLException
public String getActionUrl(UWLContext context,
long[] itemIds,
String action)
throws UWLException
IMultiItemLaucher interface.
context - neededitemIds - neededaction - needed
UWLExceptionIMultiItemLauncher
public String getActionUrl(UWLContext context,
long item,
String action)
throws UWLException
isActionLaunchable() returs true.
context - not nullitem - identifier for the itemaction - action name for which URL is to be launched.
UWLException - in case of system problems or if Item is not found
public Map getActionProperties(UWLContext context,
Item item,
Action action,
Map actionProperties,
boolean needsItemValidation)
throws UWLException
context - not nullitem - neededaction - not nullneedsItemValidation - - flag indicating that the item passed has to be validated
UWLException
public boolean isActionLaunchable(UWLContext context,
Item item,
Action action)
throws UWLException
Action) documentation.
context - item - not nullaction - not null
UWLExceptionIActionHandler
public Action getActionForItem(UWLContext ctx,
Item item,
String actionName)
throws UWLException
item - not nullactionName - not null
UWLException
public Action getDefaultActionForItem(UWLContext ctx,
Item item)
throws UWLException
item - not null
UWLExceptionItemType.getDefaultAction()
public Action getActionForItem(UWLContext ctx,
long itemId,
String actionName)
throws UWLException
ctx - itemId - actionName -
UWLException
public Map getAllActionsForItem(UWLContext context,
Item item)
throws UWLException
isBackEndConnectionsAllowed() value from the context.
context - neededitem - not null needed
UWLExceptioncom.sap.netweaver.bc.uwl.connect.IProivderConnector#getAllActionsForItem
public WorkLog getHistoryForItem(UWLContext context,
Item item)
throws UWLException
context - requireditem - not null, required
UWLExceptionWorkLog
|
SAP NetWeaver 2004S SPS 10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||