com.sap.workspaces.indexing

Class ItemInfoHelper

java.lang.Object
  extended by com.sap.workspaces.indexing.ItemInfoHelper

public class ItemInfoHelper
extends Object

A helper class for handling of the ItemInfo object

Since:
1.1

Field Summary
static String INDEXING_URL_PREFIX
           
static String URL_SEPARATOR
           
 
Constructor Summary
ItemInfoHelper()
           
 
Method Summary
static ItemInfo createItemInfoFromIndexingURL(String indexingURL)
          Parses the specified URL and converts it into an ItemInfo:
If the URL starts with 'workspaces' prefix, the prefix is ignored.
static ItemInfo createModuleItemInfo(IModuleContext moduleContext)
          Creates an ItemInfo object of the module instance.
static String createResourceIndexingURL(ItemInfo itemInfo, String resourceID, Map resourceParams)
          Creates the URL for indexing of the specified module resource related to the specified ItemInfo.
static String getIndexingURL(ItemInfo itemInfo)
          Creates the URL of the specified InfoItem for indexing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_SEPARATOR

public static final String URL_SEPARATOR
See Also:
Constant Field Values

INDEXING_URL_PREFIX

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

ItemInfoHelper

public ItemInfoHelper()
Method Detail

createModuleItemInfo

public static ItemInfo createModuleItemInfo(IModuleContext moduleContext)
Creates an ItemInfo object of the module instance.

Parameters:
moduleContext - the module context
Returns:
An ItemInfo object of the module

getIndexingURL

public static String getIndexingURL(ItemInfo itemInfo)
Creates the URL of the specified InfoItem for indexing.
For example: workspaces/shared/ws01/page01/module01

Parameters:
itemInfo - the ItemInfo that contains the data for creating the URL
Returns:
The URL of the ItemInfo for indexing

createItemInfoFromIndexingURL

public static ItemInfo createItemInfoFromIndexingURL(String indexingURL)
Parses the specified URL and converts it into an ItemInfo:
If the URL starts with 'workspaces' prefix, the prefix is ignored.
The 1st token is parsed as workspace type, which can be either 'personal' or 'shared'.
The 2nd token is parsed as workspace ID.
The 3rd token is parsed as page ID.
The 4th token is parsed as module ID.
The rest of the string starting with the 5th token is ignored.
Examples of valid URLs:
- 'workspaces/shared/ws01/page01/module01/resource01?param1=x¶m2=y'
- 'personal/ws01/page01/module01/resource01?param1=x¶m2=y'
- 'shared/ws01/page01/module01'
- 'workspaces/personal/ws01/page01/module01'
- 'personal/ws01/page01'
- 'shared/ws01'

Parameters:
indexingURL - string to parse.
Returns:
An ItemInfo object on success, null on failure.

createResourceIndexingURL

public static String createResourceIndexingURL(ItemInfo itemInfo,
                                               String resourceID,
                                               Map resourceParams)
Creates the URL for indexing of the specified module resource related to the specified ItemInfo.

Parameters:
itemInfo - the ItemInfo that contains the data for creating the URL
resourceID - the ID of the resource for which to create the URL
resourceParams - the parameters of the resource
Returns:
The URL of the resource for indexing


Copyright 2011 SAP AG Complete Copyright Notice