com.sapportals.wcm.rfadapter

Class UpdateUtility

java.lang.Object
  extended by com.sapportals.wcm.rfadapter.UpdateUtility

public final class UpdateUtility
extends Object

encapsulates the update functionalities for the content as well as the properties of an 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 Summary
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
 
Method Summary
 Result update(boolean preserveExtension)
          updates the IResource of this class with the given IPropertyMap or String and IContent.
 Result update(boolean preserveExtension, boolean keeplocked)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateUtility

public UpdateUtility(IResource source,
                     IPropertyMap properties,
                     IContent content)
              throws WcmException
uses all parameter needed for the actual update of the given IResource

Parameters:
source - 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()
an IllegalArgumentException will be thrown
content - the new content of the resource, might be null
Throws:
WcmException

UpdateUtility

public UpdateUtility(IContent content,
                     String newName,
                     IResource source)
              throws WcmException
uses all parameter needed for the actual update of the given IResource

Parameters:
source - 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()),
an IllegalArgumentException is thrown.
content - the new content of the resource, might be null
Throws:
WcmException
Method Detail

update

public Result update(boolean preserveExtension)
updates the 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
- either the name contains invalid characters
- or the extension must be preserved, but the new name does not hold this extension
a 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 link

Returns:
the result, stating the success/ failure of the operation

update

public Result update(boolean preserveExtension,
                     boolean keeplocked)
Access Rights

This class can be accessed from:


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 2014 SAP AG Complete Copyright Notice