|
SAP NetWeaver 7.30 (SP05) KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ILogicalVariantResource
A logical variant resource is a type of resource whose content, properties and versions depend on the resource
context which contains a variant-context. An application can detect if a resource has variants by calling
resource.as(ILogicalVariantResource.class). Variants are supported for "plain" resources,
collections or links. Variants are not suppored for all other types of resources (e.g. Versions). For collections and
links only the properties may vary (but not the collections children or the links target).
A logical resource can have a set of properties which are called "invariant" properties. These properties are
persisted at the logical resource and can only be modified or retrieved with the methods in this interface (but not
the IResource methods).
In the following code example a variant-context is constructed which will be used by the repository to select one of
the available content and property variants. If an application is not aware of variants and no variant-context is
attached a repository-specific default handling will select one of the available variants.
IPropertyMap variantContext = new MutablePropertyMap();
variantContext.put(new Property(propertyName, "value");
IResourceContext ctxt = ResourceContext.getInstance(rid, variantContext);
IResource resource = ResourceFactory.getInstace().getResource(rid, ctxt);
ILogicalVariantResource lr = (ILogicalVariantResource)resource.as(ILogicalVariantResource.class);
if (lr != null) { ... }
IPhysicalVariantResource| Method Summary | |
|---|---|
IResource |
createPhysicalResource(IContent content,
IPropertyMap properties,
boolean ignorePropertyFailures)
Creates a new physical resource for this logical resource. |
void |
deleteInvariantProperty(IPropertyName propertyName)
Deletes the invariant property with the specified name if it exists. |
IResourceList |
findPhysicalResources(IPropertyMap properties)
Returns a list of resource instances of type IPhysicalVariantResource which match the given map of context
properties. |
IPropertyMap |
getInvariantProperties(IPropertyNameList list)
Returns a map of invariant properties with the specified names or all properties if the list is null. |
IProperty |
getInvariantProperty(IPropertyName name)
Returns an invariant property with the given name or null if it does not exist. |
IResource |
getPhysicalResource()
Returns the physical resource that was the result of the context resultion for this resource (at the time when this resource was created). |
void |
setInvariantProperty(IProperty property)
Sets the specified property as a invariant property of this logical resource. |
void |
updateInvariantProperties(List updates)
Updates the invariant properties of this resource. |
| Method Detail |
|---|
IResource getPhysicalResource()
throws ResourceException
ResourceException
IResource createPhysicalResource(IContent content,
IPropertyMap properties,
boolean ignorePropertyFailures)
throws ResourceException,
InvalidVariantContextException
null. The property map
must contain all context properties required by the repository. Whether it is required to specify all context
properties or not depends on the repository implementation. If these properties are not unique for this logical
resource (a physical resource with these context property values already exists) an exception is thrown.
content - The resource content. Must be null for collections and links.properties - A map of properties for the new resource. The map must contain the required context properties.ignorePropertyFailures - true: Ignore errors while setting the given properties
PhysicalResourceAlreadyExistsException - If a physical resource with the specified subset of context properties and values already exists.
ResourceException - If the type or value of a property is invalid, particularly if the value of a context property is not
contained in the list of allowed values. If the property map does not contain all context properties.
InvalidVariantContextException
OperationNotSupportedException
IResourceList findPhysicalResources(IPropertyMap properties)
throws ResourceException
IPhysicalVariantResource which match the given map of context
properties. A physical resource matches if the values of all properties in the map are equal to the values of the
resource properties. Properties that exist at the resource but are not contained in the map are used as "wildcard"
properties, that means they match any value. If the property map is empty or null the list will
contain all existing physical resources (at least one). If one of the properties in the map is not a context
property a ResourceException is thrown.
properties - A map of context properties to be used as a search condition.
IPhysicalVariantResource.
ResourceException - If one of the properties in the map is not a known context property.
IPropertyMap getInvariantProperties(IPropertyNameList list)
throws ResourceException
list - A list of property names - may be null.
null.
ResourceException
IProperty getInvariantProperty(IPropertyName name)
throws ResourceException
null if it does not exist.
name - A property name
ResourceException
void setInvariantProperty(IProperty property)
throws ResourceException
property - The property to set
ResourceException
void updateInvariantProperties(List updates)
throws ResourceException
updates - list of updates: contains IProperty entries for properties to be set and
IPropertyName entries for properties to be removed.
ResourceException
void deleteInvariantProperty(IPropertyName propertyName)
throws ResourceException
propertyName - The name of the property to delete.
ResourceException| Access Rights |
|---|
| 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
|
|
SAP NetWeaver 7.30 (SP05) KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||