public interface ILogicalVariantResource
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). IResource methods).
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| Modifier and Type | Method and Description |
|---|---|
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.
|
IResource getPhysicalResource() throws ResourceException
ResourceExceptionIResource 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 propertiesPhysicalResourceAlreadyExistsException - 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.InvalidVariantContextExceptionOperationNotSupportedExceptionIResourceList 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.ResourceExceptionIProperty getInvariantProperty(IPropertyName name) throws ResourceException
null if it does not exist.name - a property namenull if it does not exist.ResourceExceptionvoid setInvariantProperty(IProperty property) throws ResourceException
property - The property to setResourceExceptionvoid 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.ResourceExceptionvoid deleteInvariantProperty(IPropertyName propertyName) throws ResourceException
propertyName - The name of the property to delete.ResourceException| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2021 SAP SE Complete Copyright Notice