public final class UpdateUtility extends Object
IResource. Depending on the underlying
repository, the same operation might fail on one resource and work on
another resource in another repository. This class will catch the
WcmExceptions thrown by the framework and pack them in the
Result class, so they can conviniently be used by the
calling classes. Versioning and locking are both supported by this class| Constructor and Description |
|---|
UpdateUtility(IContent content,
String newName,
IResource source)
uses all parameter needed for the actual update of the given
IResource |
UpdateUtility(IResource source,
IPropertyMap properties,
IContent content)
uses all parameter needed for the actual update of the given
IResource |
| Modifier and Type | Method and Description |
|---|---|
Result |
update(boolean preserveExtension)
updates the
IResource of this class with the given
IPropertyMap or String and IContent. |
Result |
update(boolean preserveExtension,
boolean keeplocked) |
public UpdateUtility(IResource source, IPropertyMap properties, IContent content) throws WcmException
IResourcesource - the resource to be moved, must not be null.properties - the properties to update the resource with, might be null.
If the map is not null, but does not hold the displayname-property, although
the resource currently has a displayname, the constructor will ad the current displayname
of the resource to this map. This ensures that the displayname property will not be lost
by the call of this class. This is not true for other properties of the resource!
If the resource does not support properties, but a not-empty propertymap is supplied,
the constructor will throw an IllegalArgumentException.
If the displayname property only contains space-characters "".equals(displayname.trim() IllegalArgumentException will be throwncontent - the new content of the resource, might be nullWcmException - no descriptionpublic UpdateUtility(IContent content, String newName, IResource source) throws WcmException
IResourcesource - the resource to be moved, must not be null.newName - the newName for the resource. If it consists only of space-characters, "".equals(newName.trim()), IllegalArgumentException is thrown.content - the new content of the resource, might be nullWcmException - no descriptionpublic Result update(boolean preserveExtension)
IResource of this class with the given
IPropertyMap or String and IContent.
If both arguments are null, a Result with
Status.WARNING will be returned, stating that no information to update
was provided. If the resource is locked by another user, a Status.ERROR
will be returned.
If the resource does not support properties, but the name has to be changed and Status.ERROR is returned.
Exceptions, thrown in the repository framework, will be wrapped in a
Result with Status.ERROR as well.
In case the given flag is true, the method will presever the extension,
if the given resource is not a folder or a linkpreserveExtension - no descriptionpublic Result update(boolean preserveExtension, boolean keeplocked)
| 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 2017 SAP AG Complete Copyright Notice