com.sapportals.wcm.rfadapter

Class ResourceCreator

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

public final class ResourceCreator
extends Object

offers different convinience-levels (and therefore performance-levels) to create an IResource in a given ICollection. The different methods will yield different results, when for example an ID-clash occurs while creating the IResource. The returned ICreationResult provides detailed information about the results of the call.

Since:
EP6, FP3

Constructor Summary
ResourceCreator(ICollection parent, DataPack dp)
           
 
Method Summary
 Result create()
          creates a new IResource in the specifed folder of the class.
 Result create(boolean requireDisplayname)
          checks, if the id for the resource would differ from the name supplied by the DataPack before trying to create the new IResource.
 Result create(boolean ignorePropertiesFailure, boolean resolveIDClash)
          creates a new IResource in the specifed folder of the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCreator

public ResourceCreator(ICollection parent,
                       DataPack dp)
Method Detail

create

public Result create()
creates a new IResource in the specifed folder of the class. If the new IResource can not be created, the method will fail without trying anew. The returned object holds information if the creation succeeded or not. If the given DataPack holds an IPropertyMap, this method will fail, if the given collection does not support properties

Returns:
Result data object that holds information about create operation.

create

public Result create(boolean ignorePropertiesFailure,
                     boolean resolveIDClash)
creates a new IResource in the specifed folder of the class. If the new IResource can not be created, the method will fail without trying anew. The returned object holds information if the creation succeeded or not. If the given DataPack holds an IPropertyMap, but the given collection does not support properties, this method will not set any properties, if the ignorePropertiesFailure flag is set to true. If the flag resolveIDClash is set to true, this method will try 5 times to create the resource with a new id, and only then give up.
As this method already checks all ids in the current folder before it creates the ID for the new IResource, an ID clash is unlikely. It might result, however, if
- another thread added an item with this ID in the meantime
- the current user is not allowed to see all resources of the current folder. One of the resources the user is not allowed to see, has the given ID
If the calling class locks the folder, the first point becomes invalid.

Returns:
Result data object that holds information about create operation.

create

public Result create(boolean requireDisplayname)
checks, if the id for the resource would differ from the name supplied by the DataPack before trying to create the new IResource. If the id would differ, but the parent folder does not allow to set properties, the IResource would only be visible with its id. If this is not wanted, the requireDisplayname parameter must be set to true. The method will not create a new IResource but return an error message.

Parameters:
requireDisplayname - tells, if the IResource may only be created if its displayname-property can be set.
Returns:
Result data object that holds information about create 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