com.sapportals.wcm.rfadapter

Class DataPack

java.lang.Object
  extended by com.sapportals.wcm.rfadapter.DataPack
Direct Known Subclasses:
CollectionDataPack, LinkDataPack, ResourceDataPack

public abstract class DataPack
extends Object

an immutable class to hold all information for any IResource to be created. Note that any implementation of this abstract class must ensure that it will be immutable as well.

Since:
EP6, FP3

Constructor Summary
DataPack(String name, IPropertyMap properties)
          abstract constructor which must be used by all implementing classes.
 
Method Summary
abstract  DataPack add(IProperty property)
          creates a new DataPack object that is a 1:1 copy of this instance but with the given parameter as additional property.
protected  IPropertyMap addProperty(IProperty property)
          convinience method for implementing classes to create a new IPropertyMap that includes the given property.
 boolean generateDisplayNameProperty()
          flag telling if for a resource created with this datapack should be created or not.
abstract  DataPack modify(IProperty property)
          creates a new DataPack object that is a 1:1 copy of this instance but with the given parameter as additional or modified property.
protected  IPropertyMap modifyProperty(IProperty property)
          convinience method for implementing classes to create a new IPropertyMap that includes the given property.
 String name()
           
 IPropertyMap properties()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataPack

public DataPack(String name,
                IPropertyMap properties)
abstract constructor which must be used by all implementing classes. The two parameters are accesible through the final methods name and properties. If the given map implements the IMutablePropertyMap interface, a IPropertyMap will be created from this map, so this class can ensure that only immutable maps are available from its properties method.

Parameters:
name - the name of the IResource to create. This must not be null and the expression name.trim().equals("") must not be true. If the name contains characters that are not usable for the RepositoryFramework, problems creating a resource with this datapack might occur. The classes ResourceCreator and MassResourceCreator in this package use the IDResolver to modify this name to ensure a valid id for the IResource
properties - the properties for the IResource to create, might be null.
Method Detail

name

public final String name()
Returns:
the name attribute as set in the constructor

properties

public final IPropertyMap properties()
Returns:
the properties attribute as set in the constructor

generateDisplayNameProperty

public boolean generateDisplayNameProperty()
flag telling if for a resource created with this datapack should be created or not. This abstract implementation will always return true

Returns:
always true.

modifyProperty

protected final IPropertyMap modifyProperty(IProperty property)
convinience method for implementing classes to create a new IPropertyMap that includes the given property. If the given property is null, the existing (or non-existing) map is returned. Otherwise, the property will be added and a new IPropertyMap is returned. The original property map of this instance will not be modified.

Parameters:
property - the property to be included in the map, might be null
Returns:
a new instance of an IPropertyMap that holds the given property or null, if both the property and the current map of this class are null or the existing propertymap of this instance if only the property is null

addProperty

protected final IPropertyMap addProperty(IProperty property)
convinience method for implementing classes to create a new IPropertyMap that includes the given property. The difference to the modify method is, that if the given property already exists in the propertymap, no changes will be done. Instead, the same propertymap will be returned

Parameters:
property - the property to be included in the map, might be null
Returns:
a new instance of an IPropertyMap that holds the given property or null, if both the property and the current map of this class are null or the existing propertymap of this instance if only the property is null or the map already includes this property

modify

public abstract DataPack modify(IProperty property)
creates a new DataPack object that is a 1:1 copy of this instance but with the given parameter as additional or modified property. If the property is null, all values will be equal.

Parameters:
property - the property to modify for the new datapack, might be null
Returns:
a new DataPack object

add

public abstract DataPack add(IProperty property)
creates a new DataPack object that is a 1:1 copy of this instance but with the given parameter as additional property. If the property is null, all values will be equal.

Parameters:
property - the property to add for the new datapack, might be null
Returns:
a new DataPack object
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