com.sap.portal.obn.service

Interface IOBNMetadata

All Known Subinterfaces:
IOBNImplementationMD, IOBNOperationMD

public interface IOBNMetadata

An interface that represents OBN metadata, that can then be used to trigger navigation or explore OBN data for the specified metadata.

An OBN metadata instance specifies the following:

An OBN metadata instance can be created in one of the following ways:
After initializing the OBN metadata instance, you may add parameters that can affect the navigation (see below). All parameters are part of the OBN URL.

The next step could be one of the following: When exploring, the next step would be to create an IOBNResolvingContainer using this metadata. Once you have an IOBNResolvingContainer object, you can retrieve OBN information, for example: There are two types of parameters defined by an OBN metadata object: The only OBN reserved parameter that can be set by the user is NAVIGATION_PARAM_NAVIGATE_MODE. When using OBN for navigation, the OBN search is done according to all user's roles. You can narrow down the search scope to the role the user started his navigation with by setting the NAVIGATION_PARAM_NAVIGATE_MODE to NAVIGATE_MODE_SOURCE_ROLE. When exploring OBN data via IOBNResolvingContainer, however, the navigation mode will not affect your search. If you want to narrow your search scope when exploring to specific folders, roles or worksets, use getOBNResolvingContainer(List, IOBNMetadata).

The following example shows how to set the navigation mode of myMetaData to source-role mode:
        String navModeName = com.sap.portal.obn.service.IOBNConstants.IOBNUrl.IParameters.NAVIGATION_PARAM_NAVIGATE_MODE;
        String sourceRoleValue = com.sap.portal.obn.service.IOBNConstants.IOBNUrl.IParameters.IParametersValues.NAVIGATE_MODE_SOURCE_ROLE; 
        IOBNParameterData sourceNavModeParam = myOBNFactory.createOBNParameterData(sourceRoleValue);
        myMetaData.setParameter(navModeName , sourceNavModeParam);
 


When navigating, you may want to use the Navigation by Attributes feature. When using Navigation by Attributes, the target application retrieved in runtime depends on the value defined for a specific attribute of the semantic object.

For example, assume your customers (which are represented as a business object) are categorized as: Gold, Silver and Standard customers. When looking at the customers details (an operation), you may want to have different UIs for each type of customer. You can define an attribute ("Type_Of_Customer" for example) that labels each semantic object with a value ("Gold", for example) Attributes are implemented as parameters that carry a mark.

To use Navigation by Attributes, do the following:


Field Summary
static String NAVIGATION_PARAM_EVALUATE_EXPRESSION
          A constant that represents a reserved OBN parameter that is passed to the OBN metadata when performing Navigation by Attributes.
 
Method Summary
 IBusinessObject getBOAttributesObject()
          Returns a semantic object that holds details of the business object of this OBN metadata.
 String getBusinessObject()
          Returns the ID of the business object defined by this OBN metadata.
 String getOBNUrl(boolean withParameters)
          Returns the OBN URL for this OBN metadata.
 String getOBNUrlParametersString()
          Returns the parameters part of the OBN URL.
 String getOperation()
          Returns the ID of the operation defined by this OBN metadata.
 IOperation getOperationAttributesObject()
          Returns a semantic object that holds details of the operation of this OBN metadata.
 IOBNParameterData getParameter(String name)
          Returns the value and other data for a specified parameter.
 Set getParametersNames(boolean withOBNImplicitParameters)
          Returns the names of the business and reserved parameters of this OBN metadata.
 String getSystemAlias()
          Returns the system alias of the business object defined by this metadata.
 com.sap.security.api.IPrincipal getUser()
          Returns the user for accessing the PCD.
 boolean isExpressionToEvaluate()
          Indicates whether this metadata is used for Navigation by Attributes.
 void setParameter(String name, IOBNParameterData obnParamData)
          Adds a parameter to this OBN metadata.
 

Field Detail

NAVIGATION_PARAM_EVALUATE_EXPRESSION

static final String NAVIGATION_PARAM_EVALUATE_EXPRESSION
A constant that represents a reserved OBN parameter that is passed to the OBN metadata when performing Navigation by Attributes.

For internal use only.

See Also:
Constant Field Values
Method Detail

getSystemAlias

String getSystemAlias()
Returns the system alias of the business object defined by this metadata.

In case this OBN metadata represents a context business object, meaning it has no system alias, null is returned.

Returns:
the system alias of the business object

getBusinessObject

String getBusinessObject()
Returns the ID of the business object defined by this OBN metadata.

Returns:
the ID of the business object

getOperation

String getOperation()
Returns the ID of the operation defined by this OBN metadata.

Returns:
the ID of the operation, or null if this metadata does not represent an operation

getUser

com.sap.security.api.IPrincipal getUser()
Returns the user for accessing the PCD.

Returns:
the user that was specified in intialization

setParameter

void setParameter(String name,
                  IOBNParameterData obnParamData)
                  throws OBNException
Adds a parameter to this OBN metadata.

Parameters:
name - the parameter name
obnParamData - the values to be set for this parameter
Throws:
OBNException - if a name of a reserved OBN parameter was specified
See Also:
IOBNParameterData.setValue(String), IOBNParameterData.setValues(Set)

getParameter

IOBNParameterData getParameter(String name)
Returns the value and other data for a specified parameter.

To change the parameter's value, use setParameter(String, IOBNParameterData).

Parameters:
name - the name of the parameter
Returns:
a copy of the data of the specified parameter

getParametersNames

Set getParametersNames(boolean withOBNImplicitParameters)
Returns the names of the business and reserved parameters of this OBN metadata.

Parameters:
withOBNImplicitParameters - if true, the returned set contains OBN reserved parameters
Returns:
a set of strings, each of which is a parameter name

getOBNUrl

String getOBNUrl(boolean withParameters)
Returns the OBN URL for this OBN metadata.

When using applications that require an OBN URL without parameters, for example Web Dynpro applications, pass false as a parameter in this method and then use getOBNUrlParametersString() to get the parameters separately.

The format of an OBN URL is:

OBN://BOTechnicalName=<BOTecnicalName>/BOSystemAlias=<BOSystemAlias>/Operation=<operation>?
   <parameterName>=<parameterValue1>[&<parameterName>=<parameterValue2>[&...]][&<parameterName1>=<parameterValue1>][&...]

Parameters:
withParameters - if true, the returned URL includes all parameters of this OBN metadata; otherwise, the base OBN URL is returned with neither reserved nor business parameters
Returns:
the OBN URL representing the OBN metadata

getOBNUrlParametersString

String getOBNUrlParametersString()
Returns the parameters part of the OBN URL.

The returned string contains all the business and reserved parameters of this OBN metadata.

The format of the returned string is:

   <parameterName>=<parameterValue1>[&<parameterName>=<parameterValue2>[&...]][&<parameterName1>=<parameterValue1>][&...]

Returns:
the parameters part of the OBN URL.

getBOAttributesObject

IBusinessObject getBOAttributesObject()
                                      throws OBNException
Returns a semantic object that holds details of the business object of this OBN metadata.

The returned instance can be used to get the properties of the business object.

Returns:
the semantic object representing the business object of this OBN metadata
Throws:
OBNException - if the semantic object was not found in the PCD

getOperationAttributesObject

IOperation getOperationAttributesObject()
                                        throws OBNException
Returns a semantic object that holds details of the operation of this OBN metadata.

The returned instance can be used to get the properties of the operation.

Returns:
the semantic object representing the operation of this OBN metadata, or null if this metadata does not represent an operation
Throws:
OBNException - if the semantic object was not found in the PCD

isExpressionToEvaluate

boolean isExpressionToEvaluate()
Indicates whether this metadata is used for Navigation by Attributes.

Returns:
true if there are parameters marked with setUseForResolving(true) in this metadata
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-RUNTIME [sap.com] tc/ep/navigation/api api EP-PIN


Copyright 2011 SAP AG Complete Copyright Notice