com.sap.netweaver.bc.rf.mi.variant

Interface IVariantManagerContextInfo


public interface IVariantManagerContextInfo

This interfaces must be implemented to provide meta information on the available context properties.


Method Summary
 Map getDefaultContext()
          Returns a map which contains a default value for each context property. keys: IPropertyName, values: IProperty.
 PropertyType getType(IPropertyName name)
          Returns the type of the property or null if the name is unknown.
 Object[] getValues(IPropertyName name)
          Returns an array of allowed values or null if the name is unknown.
 Object[] getValuesSubSet(IPropertyName name, Map otherPropertyValues)
          Returns an array containing a subset of allowed values.
 boolean hasProperty(IPropertyName name)
          Returns true if meta informtion exists for the given property name.
 List listNames()
          Returns an read-only iterator for all known context property names.
 void validateContext(Map properties)
          Validates the map of context properties.
 

Method Detail

listNames

List listNames()
               throws RepositoryException
Returns an read-only iterator for all known context property names. The list must not be null or empty and must contain IPropertyName objects.

Returns:
Throws:
RepositoryException

getType

PropertyType getType(IPropertyName name)
                     throws RepositoryException
Returns the type of the property or null if the name is unknown.

Parameters:
name - A property name (one of the names returned by the listNames().
Returns:
Throws:
RepositoryException

getValues

Object[] getValues(IPropertyName name)
                   throws RepositoryException
Returns an array of allowed values or null if the name is unknown. The array must contain at least one value and he following classes must be used depending on the PropertyType: STRING: String, INT: Integer, LONG: Long, DATETIME: Date, BOOLEAN: Boolean, XML: String.

Parameters:
name - A property name (one of the names returned by listNames().
Returns:
Throws:
RepositoryException

getValuesSubSet

Object[] getValuesSubSet(IPropertyName name,
                         Map otherPropertyValues)
                         throws RepositoryException
Returns an array containing a subset of allowed values. The returned values are depending on the values of other properties provided in the second parameter. The retured array may be empty but not null.

Parameters:
name - A property name (one of the names returned by listNames().
otherPropertyValues - keys: IPropertyName, values: Object representing a value depending on the property type. The value of the first parameter must not be used in the map. The map must not be null but may be empty. It must contain values for all properties with a lower index (in the list returned by listNames()) than the name given in the first argument. If the map is empty the method must return all allowed values (see getValues(IPropertyName)).
Returns:
Throws:
IllegalArgumentException - If the second argument (map) contains invalid entries: invalid values, illegal combinations of values, etc.
RepositoryException
See Also:
getValues(IPropertyName)

getDefaultContext

Map getDefaultContext()
                      throws RepositoryException
Returns a map which contains a default value for each context property. keys: IPropertyName, values: IProperty.

Returns:
Throws:
RepositoryException

hasProperty

boolean hasProperty(IPropertyName name)
                    throws RepositoryException
Returns true if meta informtion exists for the given property name.

Parameters:
name - A property name.
Returns:
Throws:
RepositoryException

validateContext

void validateContext(Map properties)
                     throws InvalidVariantContextException,
                            RepositoryException
Validates the map of context properties. Whether an incomplete context (map does not contain all properties) might be considered as valid depends on the repository implementation - a repository might be able to use default values for the missing ones. The implementation must ignore unknown (name not returned by listNames() method) properties contained in the map.

Parameters:
properties - A map containing context properties.
Throws:
InvalidVariantContextException - If the some of the context properties are invalid (wrong type, is multi-valued, value not allowed, invalid combination of values).
RepositoryException
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM


Copyright 2011 SAP AG Complete Copyright Notice