com.sapportals.wcm.rfadapter

Class RenameUtility

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

public final class RenameUtility
extends Object

encapsulates the rename functionality of the RepositoryFramework and modifies both the displayname property as well as the name attribute of the given IResource.


Constructor Summary
RenameUtility(IResource source, String newName)
          checks the validity of the given arguments.
 
Method Summary
protected  Result rename()
          modifies the displayname property of the IResource and updates its name-attribute.
 Result rename(boolean preserveExtension)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenameUtility

public RenameUtility(IResource source,
                     String newName)
              throws WcmException
checks the validity of the given arguments. A NullPointerException is thrown, if one of them is null, an IllegalArgumentException is thrown, if the newName argument consists of only space-characters:
"".equals(newName.trim())

Parameters:
source - the resource to be renamed
newName - the new name for the resource
Throws:
WcmException, - if the resource does not allow the setting of properties
WcmException
Method Detail

rename

protected Result rename()
modifies the displayname property of the IResource and updates its name-attribute. Since the newName-attribute of this class might contain invalid characters or might be non unique within the parent collection of the folder, this method uses the IDResolver to calculate a valid and unique ID for this IResource. If the IResource does nto support the SupportOption.SET_PROPERTIES, no modification will be done. Because two operations are carried out on the IResource, the method needs to lock it. If the IResource is locked by another user, the method will abort. If it is already locked by the current user, no further lock is acquired. If it is versioned, it will be checked out (if it is not already so). After the modifications have been done, the resource will be checked in again, if it is versioned and was checked out by this method. The lock will be released already by the IResource's method rename(String name), regardless if this method locked it or if it was locked before.

Returns:
will always contain the IResource. Its status-attribute will tell, if the modifications have been successful or not.

rename

public Result rename(boolean preserveExtension)
Parameters:
preserveExtension -
Returns:
Result data object that keeps resulting information about rename operation
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