com.sapportals.wcm.service.relation

Interface IRelationType

All Superinterfaces:
com.sapportals.wcm.util.name.IName
All Known Subinterfaces:
IOrderedRelationType

public interface IRelationType
extends com.sapportals.wcm.util.name.IName

The type of a relation.
The IRelationType is an abstraction of the 'relation-operation' (e.g. 'member-of') and. It implies also the types of the source- and target-operands (IRelationOperandType ). A RelationType is always registered to a unique namespace.


Method Summary
 boolean areAttributesMutable()
          Check if setAttributes(IRelationTypeAttributes) can be called or would throw an AccessDeniedException .
 IRelation createRelation(IOrderedRelationPosition position, IRelationOperand source, IRelationOperand target)
          a shortcut for createRelation(source, target, null).
 IRelation createRelation(IOrderedRelationPosition position, IRelationOperand source, IRelationOperand target, IPropertyMap properties)
          Create a new ordered relation from wrapped operands.
 IRelation createRelation(IOrderedRelationPosition position, Object source, Object target)
          a shortcut for createRelation(source, target, null).
 IRelation createRelation(IOrderedRelationPosition position, Object source, Object target, IPropertyMap properties)
          Create a ordered relation from operand values.
 IRelation createRelation(IRelationOperand source, IRelationOperand target)
          a shortcut for createRelation(source, target, null).
 IRelation createRelation(IRelationOperand source, IRelationOperand target, IPropertyMap properties)
          Create a new relation from wrapped operands.
 IRelation createRelation(Object source, Object target)
          a shortcut for createRelation(source, target, null).
 IRelation createRelation(Object source, Object target, IPropertyMap properties)
          Create a relation from operand values.
 void delete()
          Deregister this relation type and delete all of it's relations.
 IRelationTypeAttributes getAttributes()
          Get the effective attributes of this relation type.
 IResourceContext getContext()
          Get the context of this relation type.
 String getDescription()
          Get a description for this relation type.
 String getDescription(Locale locale)
          Get a description for this relation type for a given locale.
 String getName()
          Get the name of this relation type as used for registration.
 String getNamespace()
          Get the namespace for this relation type as used for registration.
 IRelation getRelation(IRelationOperand source, IRelationOperand target)
          Get the relation for a given wrapped source and target.
 IRelation getRelation(Object source, Object target)
          Get the relation for a given source and target value.
 IRelation getRelation(String id)
          Get a specific relation for a given type and id.
 IRelationList getRelations()
          Get all availabe relations for this type.
 IRelationList getRelations(IRelationOperand source)
          Deprecated. as of NW04. Please use getRelationsBySource instead Get all the relations of this type for the given source operand.
 IRelationList getRelations(IRelationQuery query)
          Get the relations for this type, which match a given query expression.
 IRelationList getRelations(IRelationQuery query, IRelationQueryOrder order)
          Get the relations for this type, which match a given query expression.
 IRelationList getRelations(Object source)
          Deprecated. as of NW04. Please use gteRelationsBySource instead Get all the relations of this type for the given source operand value.
 IRelationList getRelationsBySource(IRelationOperand source)
          Get all the relations of this type for the given source operand.
 IRelationList getRelationsBySource(Object source)
          Get all the relations of this type for the given source operand value.
 IRelationList getRelationsByTarget(IRelationOperand target)
          Get all the relations of this type for the given target operand.
 IRelationList getRelationsByTarget(Object target)
          Get all the relations of this type for the given target operand value.
 IRelationOperandType getSourceType()
          Get the source operand's type.
 IRelationOperandType getTargetType()
          Get the target operand's type.
 void reorder(IOrderedRelationPositioningList ordering)
          Reorder the relations for this type.
 IRelationTypeAttributes setAttributes(IRelationTypeAttributes attributes)
          Change the effective attributes of this relation type.
 void startWatching(IRelationWatcher watcher)
          Register a watcher to this relation type.
 void stopWatching(IRelationWatcher watcher)
          Deregister a watcher from this relation type.
 
Methods inherited from interface com.sapportals.wcm.util.name.IName
getNamespaceOrNull
 

Method Detail

getNamespace

String getNamespace()
Get the namespace for this relation type as used for registration.

Specified by:
getNamespace in interface com.sapportals.wcm.util.name.IName
Returns:
a String with the namespace of the relation type.

getName

String getName()
Get the name of this relation type as used for registration.

Specified by:
getName in interface com.sapportals.wcm.util.name.IName
Returns:
a String with the name of the relation type.

getDescription

String getDescription()
Get a description for this relation type.

Returns:
a String with the description of the relation type for the context of the relation type.

getDescription

String getDescription(Locale locale)
Get a description for this relation type for a given locale.

Parameters:
locale - TBD: Description of the incoming method parameter
Returns:
a String with the description of the relation type for the given locale.

getSourceType

IRelationOperandType getSourceType()
Get the source operand's type.

Returns:
the IRelationOperandType of this relation type's source operand type.

getTargetType

IRelationOperandType getTargetType()
Get the target operand's type.

Returns:
the IRelationOperand of this relation type's target operand type.

getContext

IResourceContext getContext()
Get the context of this relation type.

Returns:
a IResourceContext with the context for this relation type (which was used when retrieving this relation type).

getAttributes

IRelationTypeAttributes getAttributes()
Get the effective attributes of this relation type.

Returns:
a IRelationTypeAttributes with the attributes for this relation type.

areAttributesMutable

boolean areAttributesMutable()
Check if setAttributes(IRelationTypeAttributes) can be called or would throw an AccessDeniedException .

Returns:
TBD: Description of the outgoing return value

setAttributes

IRelationTypeAttributes setAttributes(IRelationTypeAttributes attributes)
                                      throws InvalidArgumentException,
                                             AccessDeniedException,
                                             ResourceException
Change the effective attributes of this relation type.

Parameters:
attributes - the IRelationTypeAttributes to use.
Returns:
a IRelationTypeAttributes with the effective attributes for this relation type. Note: the returned attributes might differ from the passed attributes if not all attributes could be changed.
Throws:
InvalidArgumentException - if the given attributes were null .
AccessDeniedException - if the relation type was not accessible from the types given context or if the relation type's attributes are marked as not changeable.
ResourceException - if there was an internal error in the relation manager.

startWatching

void startWatching(IRelationWatcher watcher)
                   throws InvalidArgumentException,
                          AccessDeniedException,
                          ResourceException
Register a watcher to this relation type.

Parameters:
watcher - a IRelationWatcher which will be able to handle callbacks from the triggers of a relation.
Throws:
InvalidArgumentException - if the watcher was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

stopWatching

void stopWatching(IRelationWatcher watcher)
                  throws InvalidArgumentException,
                         AccessDeniedException,
                         ResourceException
Deregister a watcher from this relation type.

Parameters:
watcher - a IRelationWatcher which has to be deregistered.
Throws:
InvalidArgumentException - if the watcher was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

delete

void delete()
            throws AccessDeniedException,
                   ResourceException
Deregister this relation type and delete all of it's relations.

Throws:
AccessDeniedException - if the relation type could not be deleted within the given types context.
ResourceException - if there was an internal error in the relation manager.

createRelation

IRelation createRelation(IRelationOperand source,
                         IRelationOperand target,
                         IPropertyMap properties)
                         throws InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
Create a new relation from wrapped operands.

Parameters:
source - the IRelationOperand which is the wrapped source operand of the relation.
target - the IRelationOperand which is the wrapped target operand of the relation.
properties - a IPropertyMap with the properties for this relation.
Returns:
an IRelation with the created relation for the given type, source and target.
Throws:
InvalidArgumentException - if the source or target is null or the given source or target is not valid with respect to the source-/target type.
AccessDeniedException - if the given context (as passed when retrieving the relation type) has no permissions to create the relation.
NameAlreadyExistsException - if the relation already exists for the given type, source and target.
ResourceException - if there was an internal error in the relation manager.

createRelation

IRelation createRelation(IRelationOperand source,
                         IRelationOperand target)
                         throws InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
a shortcut for createRelation(source, target, null).

Parameters:
source - TBD: Description of the incoming method parameter
target - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation

createRelation

IRelation createRelation(Object source,
                         Object target,
                         IPropertyMap properties)
                         throws InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
Create a relation from operand values.

Parameters:
source - the Object which is the source operand value of the relation.
target - the Object which is the target operand value of the relation.
properties - a IPropertyMap with the properties for this relation.
Returns:
an IRelation with the created relation for the given type, source and target.
Throws:
InvalidArgumentException - if the source or target is null or the given source or target is not valid with respect to the source-/target type.
AccessDeniedException - if the given context (as passed when retrieving the relation type) has no permissions to create the relation.
NameAlreadyExistsException - if the relation already exists for the given type, source and target.
ResourceException - if there was an internal error in the relation manager.

createRelation

IRelation createRelation(Object source,
                         Object target)
                         throws InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
a shortcut for createRelation(source, target, null).

Parameters:
source - TBD: Description of the incoming method parameter
target - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation

getRelations

IRelationList getRelations()
                           throws AccessDeniedException,
                                  ResourceException
Get all availabe relations for this type.

Returns:
a IRelationList with all the relations.
Throws:
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelations

IRelationList getRelations(IRelationOperand source)
                           throws InvalidArgumentException,
                                  AccessDeniedException,
                                  ResourceException
Deprecated. as of NW04. Please use getRelationsBySource instead Get all the relations of this type for the given source operand.

Parameters:
source - a IRelationOperand which defines the source operand to get the relations for.
Returns:
a IRelationList with all the relations for the given source.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the source was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelationsBySource

IRelationList getRelationsBySource(IRelationOperand source)
                                   throws InvalidArgumentException,
                                          AccessDeniedException,
                                          ResourceException
Get all the relations of this type for the given source operand.

Parameters:
source - a IRelationOperand which defines the source operand to get the relations for.
Returns:
a IRelationList with all the relations for the given source.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the source was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelations

IRelationList getRelations(Object source)
                           throws InvalidArgumentException,
                                  AccessDeniedException,
                                  ResourceException
Deprecated. as of NW04. Please use gteRelationsBySource instead Get all the relations of this type for the given source operand value.

Parameters:
source - a Object which defines the source operands value to get the relations for.
Returns:
a IRelationList with all the relations for the given source value.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the source value was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelationsBySource

IRelationList getRelationsBySource(Object source)
                                   throws InvalidArgumentException,
                                          AccessDeniedException,
                                          ResourceException
Get all the relations of this type for the given source operand value.

Parameters:
source - a Object which defines the source operands value to get the relations for.
Returns:
a IRelationList with all the relations for the given source value.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the source value was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelationsByTarget

IRelationList getRelationsByTarget(IRelationOperand target)
                                   throws InvalidArgumentException,
                                          AccessDeniedException,
                                          ResourceException
Get all the relations of this type for the given target operand.

Parameters:
target - a IRelationOperand which defines the target operand to get the relations for.
Returns:
a IRelationList with all the relations for the given target.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the target was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelationsByTarget

IRelationList getRelationsByTarget(Object target)
                                   throws InvalidArgumentException,
                                          AccessDeniedException,
                                          ResourceException
Get all the relations of this type for the given target operand value.

Parameters:
target - a Object which defines the target operands value to get the relations for.
Returns:
a IRelationList with all the relations for the given target value.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the target value was null .
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelations

IRelationList getRelations(IRelationQuery query)
                           throws AccessDeniedException,
                                  RelationQueryException,
                                  ResourceException
Get the relations for this type, which match a given query expression.

Parameters:
query - the IRelationQuery the searched relations should match or null if all relations should be returned.
Returns:
a IRelationList with all the relations of the given type. the list might be empty if no relations are found for the given type which match the given query.
Throws:
AccessDeniedException - Exception raised in failure situation
RelationQueryException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
AccessDeniedException - if the relation type was not accessible from the types given context.
RelationQueryException - if the relation query was not understood.
ResourceException - if there was an internal error in the relation manager.

getRelations

IRelationList getRelations(IRelationQuery query,
                           IRelationQueryOrder order)
                           throws AccessDeniedException,
                                  RelationQueryException,
                                  ResourceException
Get the relations for this type, which match a given query expression.
Not yet supported!

Parameters:
query - the IRelationQuery the searched relations should match or null if all relations should be returned.
order - the IRelationQueryOrder the searched relation list should be sorted by. if null the list is not ordered.
Returns:
a IRelationList with all the relations of the given type. the list might be empty if no relations are found for the given type which match the given query.
Throws:
AccessDeniedException - Exception raised in failure situation
RelationQueryException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
AccessDeniedException - if the relation type was not accessible from the types given context.
RelationQueryException - if the relation query was not understood.
ResourceException - if there was an internal error in the relation manager.

getRelation

IRelation getRelation(String id)
                      throws InvalidArgumentException,
                             AccessDeniedException,
                             ResourceException
Get a specific relation for a given type and id.

Parameters:
id - the id to get the relation for.
Returns:
the IRelation for the given type and id or null if no relation exists for this id.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if the type or the id was null .
AccessDeniedException - if the relation was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelation

IRelation getRelation(IRelationOperand source,
                      IRelationOperand target)
                      throws InvalidArgumentException,
                             AccessDeniedException,
                             ResourceException
Get the relation for a given wrapped source and target.

Parameters:
source - the IRelationOperand which is the wrapped source operand of the relation.
target - the IRelationOperand which is the wrapped target operand of the relation.
Returns:
an IRelation with the relation for this type and the given source and target or null if no such relation exist.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if one of the source or the target parameters was null .
AccessDeniedException - if the relation was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

getRelation

IRelation getRelation(Object source,
                      Object target)
                      throws InvalidArgumentException,
                             AccessDeniedException,
                             ResourceException
Get the relation for a given source and target value.

Parameters:
source - the Object which is the source operand value of the relation.
target - the Object which is the target operand value of the relation.
Returns:
an IRelation with the relation for this type and the given source and target or null if no such relation exist.
Throws:
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
InvalidArgumentException - if one of the source or the target parameters was null .
AccessDeniedException - if the relation was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.

createRelation

IRelation createRelation(IOrderedRelationPosition position,
                         IRelationOperand source,
                         IRelationOperand target,
                         IPropertyMap properties)
                         throws NotSupportedException,
                                InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
Create a new ordered relation from wrapped operands.
Not yet supported!

Parameters:
position - the IOrderedRelationPosition which defines where to put the newly created relation to. if null is given, a OrderedRelationPosition.LAST is used.
source - the IRelationOperand which is the wrapped source operand of the relation.
target - the IRelationOperand which is the wrapped target operand of the relation.
properties - a IPropertyMap with the properties for this relation.
Returns:
an IRelation with the created relation for the given type, source and target.
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
NotSupportedException - if this method is not supported, because this type is not a ordered relation type.
InvalidArgumentException - if the source or target is null or the given source or target is not valid with respect to the source-/target type.
AccessDeniedException - if the given context (as passed when retrieving the relation type) has no permissions to create the relation.
NameAlreadyExistsException - if the relation already exists for the given type, source and target.
ResourceException - if there was an internal error in the relation manager.

createRelation

IRelation createRelation(IOrderedRelationPosition position,
                         IRelationOperand source,
                         IRelationOperand target)
                         throws NotSupportedException,
                                InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
a shortcut for createRelation(source, target, null).
Not yet supported!

Parameters:
position - TBD: Description of the incoming method parameter
source - TBD: Description of the incoming method parameter
target - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation

createRelation

IRelation createRelation(IOrderedRelationPosition position,
                         Object source,
                         Object target,
                         IPropertyMap properties)
                         throws NotSupportedException,
                                InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
Create a ordered relation from operand values.
Not yet supported!

Parameters:
position - the IOrderedRelationPosition which defines where to put the newly created relation to. if null is given, a OrderedRelationPosition.LAST is used.
source - the Object which is the source operand value of the relation.
target - the Object which is the target operand value of the relation.
properties - a IPropertyMap with the properties for this relation.
Returns:
an IRelation with the created relation for the given type, source and target.
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
NotSupportedException - if this method is not supported, because this type is not a ordered relation type.
InvalidArgumentException - if the source or target is null or the given source or target is not valid with respect to the source-/target type.
AccessDeniedException - if the given context (as passed when retrieving the relation type) has no permissions to create the relation.
NameAlreadyExistsException - if the relation already exists for the given type, source and target.
ResourceException - if there was an internal error in the relation manager.

createRelation

IRelation createRelation(IOrderedRelationPosition position,
                         Object source,
                         Object target)
                         throws NotSupportedException,
                                InvalidArgumentException,
                                AccessDeniedException,
                                NameAlreadyExistsException,
                                ResourceException
a shortcut for createRelation(source, target, null).
Not yet supported!

Parameters:
position - TBD: Description of the incoming method parameter
source - TBD: Description of the incoming method parameter
target - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
NameAlreadyExistsException - Exception raised in failure situation
ResourceException - Exception raised in failure situation

reorder

void reorder(IOrderedRelationPositioningList ordering)
             throws NotSupportedException,
                    InvalidArgumentException,
                    AccessDeniedException,
                    ResourceException
Reorder the relations for this type.
Not yet supported!

Parameters:
ordering - TBD: Description of the incoming method parameter
Throws:
NotSupportedException - Exception raised in failure situation
InvalidArgumentException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ResourceException - Exception raised in failure situation
NotSupportedException - if this method is not supported, because this type is not a ordered relation type.
InvalidArgumentException - if there is a pair of relation/relative IDs which are not compatible with respect to their type and source operand.
AccessDeniedException - if the relation type was not accessible from the types given context.
ResourceException - if there was an internal error in the relation manager.
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM


Copyright 2011 SAP AG Complete Copyright Notice