com.sapportals.wcm.rfadapter

Class LinkDataPack

java.lang.Object
  extended by com.sapportals.wcm.rfadapter.DataPack
      extended by com.sapportals.wcm.rfadapter.LinkDataPack

public final class LinkDataPack
extends DataPack

combines all information needed to create an internal or external link in an ICollection. This class is immutable. If the target resource is itself a link, the data pack will use the IResource.getTargetResource() method to retrieve the target of that link. This target will then be used as target for the newly created link. This is only applicable, if the link to be created is of LinkType.INTERNAL


Constructor Summary
LinkDataPack(IPropertyMap properties, IResource target)
          convinience constructor to create a link of type LinkType.INTERNAL.
LinkDataPack(String name, IPropertyMap properties, IResource target)
          convinience constructor to create a link of type LinkType.INTERNAL.
LinkDataPack(String name, IPropertyMap properties, LinkType type, URL target, IResourceContext context)
          standard constructor for this class.
 
Method Summary
 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.
 boolean generateDisplayNameProperty()
          returns false if it is an LinkType.INTERNAL For these internal links, the default link generation must not create a displayname property, if the target has a displayname, because the link should show its targets displayname as displayname.
 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.
 URL target()
           
 LinkType type()
           
 
Methods inherited from class com.sapportals.wcm.rfadapter.DataPack
addProperty, modifyProperty, name, properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkDataPack

public LinkDataPack(String name,
                    IPropertyMap properties,
                    LinkType type,
                    URL target,
                    IResourceContext context)
standard constructor for this class. Other constructors will call this one internally

Parameters:
name - the name the link should have, must not be null
properties - properties to be set for the link, might be null
type - specifies if a link to an object within the repository framework LinkType.INTERNAL or to an object outside the framework, LinkType.EXTERNAL, should be created. Must not be null
target - the adress of the object the link should point at. Must not be null

LinkDataPack

public LinkDataPack(String name,
                    IPropertyMap properties,
                    IResource target)
             throws ResourceException
convinience constructor to create a link of type LinkType.INTERNAL. The needed URL object will be created using the given target's RID

Parameters:
name - the name the link should have, must not be null
properties - properties to be set for the link, might be null
target - the IResource the link should point at, msut not be null
Throws:
ResourceException, - if the target's RID is not retrievable
ResourceException

LinkDataPack

public LinkDataPack(IPropertyMap properties,
                    IResource target)
             throws ResourceException
convinience constructor to create a link of type LinkType.INTERNAL. The needed URL object will be created using the given target's RID, the name of the link will be the name of the target

Parameters:
properties - properties to be set for the link, might be null
target - the IResource the link should point at, msut not be null
Throws:
ResourceException, - if the target's RID is not retrievable
ResourceException
Method Detail

generateDisplayNameProperty

public boolean generateDisplayNameProperty()
returns false if it is an LinkType.INTERNAL For these internal links, the default link generation must not create a displayname property, if the target has a displayname, because the link should show its targets displayname as displayname. For external links, a displayname property is wanted, because the external link cannot be used as a displayname-provider.

Overrides:
generateDisplayNameProperty in class DataPack
Returns:
always true.

type

public LinkType type()

target

public URL target()

modify

public DataPack modify(IProperty property)
Description copied from class: DataPack
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.

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

add

public DataPack add(IProperty property)
Description copied from class: DataPack
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.

Specified by:
add in class DataPack
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