com.sapportals.wcm.repository

Interface ICollection

All Superinterfaces:
IResource, ITypeCast

public interface ICollection
extends IResource

A collection is a resource (IResource) that contains other resources and collections following the composite pattern.

Copyright (c) SAP AG 2001-2004


Method Summary
 ICollection createCollection(String name, IPosition position, IPropertyMap properties)
          Creates a new sub collection in a collection that supports ordering.
 ICollection createCollection(String name, IPosition position, IPropertyMap properties, boolean ignorePropertyFailures)
          Creates a new sub collection in a collection that supports ordering.
 ICollection createCollection(String name, IPropertyMap properties)
          Creates a new sub collection in a collection.
 ICollection createCollection(String name, IPropertyMap properties, boolean ignorePropertyFailures)
          Creates a new sub collection in a collection.
 IResource createLink(String name, URL targetURL, LinkType linkType, IPosition position, IPropertyMap properties)
          Creates a new link in a collection that supports ordering.
 IResource createLink(String name, URL targetURL, LinkType linkType, IPosition position, IPropertyMap properties, boolean ignorePropertyFailures)
          Creates a new link in a collection that supports ordering.
 IResource createLink(String name, URL targetURL, LinkType linkType, IPropertyMap properties)
          Creates a new link in a collection.
 IResource createLink(String name, URL targetURL, LinkType linkType, IPropertyMap properties, boolean ignorePropertyFailures)
          Creates a new link in a collection.
 ILockInfo createResource(String name, ILockProperties lockProperties)
          Creates a empty resource that is initially locked (lock null resource)
 IResource createResource(String name, IPosition position, IPropertyMap properties, IContent content)
          Creates a new resource in a collection that supports ordering.
 IResource createResource(String name, IPosition position, IPropertyMap properties, IContent content, boolean ignorePropertyFailures)
          Creates a new resource in a collection that supports ordering.
 IResource createResource(String name, IPropertyMap properties, IContent content)
          Creates a new resource in a collection.
 IResource createResource(String name, IPropertyMap properties, IContent content, boolean ignorePropertyFailures)
          Creates a new resource in a collection.
 IResourceList getChildren()
          Returns a list of all resources in the collection
 IResourceList getChildren(boolean visible, boolean collections, boolean links)
          Returns a filtered list of the resources in this collection.
 IResourceList getChildren(Selector childrenSelector, Collator sortBy, IPropertyNameList propertyPrefill)
          Returns the children of this collection.
 IResourceList getChildren(Selector childrenSelector, Collator sortBy, IPropertyNameList propertyPrefill, String[] permissionNames)
          Returns the children of this collection.
 int getChildrenCount(boolean visible, boolean collections, boolean links)
          Returns the number of filtered children in the collection.
 IResourceList getChildrenWithoutLinkMapping()
          This method will return all child resources without performing the special handling for link resources.
 OrderType getOrderType()
          Returns the order type of a collection
 boolean hasChildren()
          True if the collection has at least one child resource
 void reorder(IReorderList list)
          Change the position of some or all resources in an ordered collection.
 void setOrderType(OrderType orderType)
          Set the order type of a collection
 
Methods inherited from interface com.sapportals.wcm.repository.IResource
as, checkIn, checkIn, checkIn, checkIn, checkOut, copy, copy, copy, copy, delete, deleteProperty, enableVersioning, getAccessRID, getAccessURI, getCheckedOutResources, getContent, getContent, getContext, getCreatedBy, getCreationDate, getDescription, getDisplayName, getDisplayName, getETag, getInheritedProperty, getLanguage, getLastModified, getLastModifiedBy, getLinkType, getLockByToken, getLocks, getName, getParentCollection, getProperties, getProperties, getProperty, getRepositoryManager, getResourceType, getRevisionID, getRID, getSupportedEvents, getSupportedOptions, getTargetResource, getTargetURL, getUnfilteredContent, getUnfilteredContent, getURI, getVersionHistory, isA, isCheckedOut, isCollection, isHidden, isLocked, isLockedByMe, isReadOnly, isRevision, isVersioned, lock, lock, move, move, move, move, refreshLock, rename, search, setAsCurrentVersion, setLinkType, setProperties, setProperties, setProperty, setTargetURL, undoCheckOut, unlock, update, updateContent
 
Methods inherited from interface com.sapportals.wcm.repository.so.ITypeCast
listTypes
 

Method Detail

getChildren

IResourceList getChildren()
                          throws ResourceException,
                                 AccessDeniedException
Returns a list of all resources in the collection

Returns:
A list of resources
Throws:
ResourceException
AccessDeniedException - If the resource is locked, readonly or authorization failed

getChildren

IResourceList getChildren(boolean visible,
                          boolean collections,
                          boolean links)
                          throws ResourceException,
                                 AccessDeniedException
Returns a filtered list of the resources in this collection. Filter checks are active for visibility, collections and link if corresponding flag is set to true. Note that if collections check is active links to collection will be included regardless of the link flag value. If all filter check are disabled this method is equivalent to ICollection.getChildren()

Parameters:
visible - true: activate visibility check and only visible resource are selected (system property "hidden" is false), false: visibility check is disabled and both visible and hidden resources are selected
collections - true: activate check for collections and only collections are selected (links to collection are also included regardless of links flag), false: check for collections is disabled
links - true: activate check for links and only link resources are selected, false: check for links is disabled
Returns:
A list of resources
Throws:
ResourceException
AccessDeniedException - If the resource is locked, readonly or authorization failed

getChildrenCount

int getChildrenCount(boolean visible,
                     boolean collections,
                     boolean links)
                     throws ResourceException,
                            AccessDeniedException
Returns the number of filtered children in the collection.

Parameters:
visible - true: visibility check is active and only visible resource are counted (system property "hidden" is false), false: visibility check is disabled and both visible and hidden resources are counted
collections - true: collections check is active and only collections are counted (links to collection are also included regardless of links flag), false: check for collections is disabled
links - true: links check is active and only link resources are counted, false: check for links is disabled
Returns:
childrenCount
Throws:
ResourceException
AccessDeniedException - If the resource is locked, readonly or authorization failed

getChildren

IResourceList getChildren(Selector childrenSelector,
                          Collator sortBy,
                          IPropertyNameList propertyPrefill)
                          throws ResourceException,
                                 AccessDeniedException
Returns the children of this collection. The list of children can be filtered and sorted by properties. A child resource is not included in the result if the user in the context does not have read permission for the properties (this is true if at least one parameter is used (not null) which will cause properties to be fetched: Collator, Selector or propertyPrefill).

Parameters:
childrenSelector - Specifies the filter expression
sortBy - Specifies the ordering of the returned list. Children which are collections are grouped together and are placed BEFORE the non-collections.
propertyPrefill - Specifies the names of properties which should be fetched for the children of the collection in addition to those needed for filtering and sorting. This "prefetching" can improve performance of subsequent getProperty() calls on the child resources.
Throws:
ResourceException
AccessDeniedException - If the resource is locked, readonly or authorization failed

getChildren

IResourceList getChildren(Selector childrenSelector,
                          Collator sortBy,
                          IPropertyNameList propertyPrefill,
                          String[] permissionNames)
                          throws ResourceException,
                                 AccessDeniedException
Returns the children of this collection. The list of children can be filtered by properties and permissions and sorted by properties. A child resource is not included in the result if the user in the context does not have read permission for the properties (this is true if at least one parameter is used (not null) which will cause properties to be fetched: Collator, Selector or propertyPrefill).

Parameters:
childrenSelector - Specifies the filter expression
sortBy - Specifies the ordering of the returned list. Children which are collections are grouped together and are placed BEFORE the non-collections.
propertyPrefill - Specifies the names of properties which should be fetched for the children of the collection in addition to those needed for filtering and sorting. This "prefetching" can improve performance of subsequent getProperty() calls on the child resources.
permissionNames - An array of permission names (permission name constants are defined in IPermission). Resources for which the user in the context does not have one of the secified permissions are removed from the result list.
Throws:
ResourceException
AccessDeniedException - If the resource is locked, readonly or authorization failed

hasChildren

boolean hasChildren()
                    throws ResourceException
True if the collection has at least one child resource

Throws:
ResourceException

getOrderType

OrderType getOrderType()
                       throws ResourceException
Returns the order type of a collection

Returns:
The order type
Throws:
ResourceException

setOrderType

void setOrderType(OrderType orderType)
                  throws ResourceException,
                         NotSupportedException,
                         AccessDeniedException
Set the order type of a collection

Parameters:
orderType - orderType to be set
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

reorder

void reorder(IReorderList list)
             throws ResourceException,
                    NotSupportedException,
                    AccessDeniedException
Change the position of some or all resources in an ordered collection. Positioning failures will be reported via one or more resource exception (the RIDs will refer to the resource that couldn't be positioned).

Parameters:
list - A list that contains IPositioning instances that specify how the resources in the collection should be positioned.
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createCollection

ICollection createCollection(String name,
                             IPropertyMap properties)
                             throws ResourceException,
                                    NotSupportedException,
                                    AccessDeniedException
Creates a new sub collection in a collection.

Parameters:
name - The name of the new collection.
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
Returns:
The new collection
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createCollection

ICollection createCollection(String name,
                             IPosition position,
                             IPropertyMap properties)
                             throws ResourceException,
                                    NotSupportedException,
                                    AccessDeniedException
Creates a new sub collection in a collection that supports ordering.

Parameters:
name - The name of the new collection
position - The position in the collection
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
Returns:
The new collection
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createCollection

ICollection createCollection(String name,
                             IPropertyMap properties,
                             boolean ignorePropertyFailures)
                             throws ResourceException,
                                    NotSupportedException,
                                    AccessDeniedException
Creates a new sub collection in a collection.

Parameters:
name - The name of the new collection.
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
ignorePropertyFailures - Ignore exceptions if some or all properties could not be set/removed
Returns:
The new collection
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createCollection

ICollection createCollection(String name,
                             IPosition position,
                             IPropertyMap properties,
                             boolean ignorePropertyFailures)
                             throws ResourceException,
                                    NotSupportedException,
                                    AccessDeniedException
Creates a new sub collection in a collection that supports ordering.

Parameters:
name - The name of the new collection
position - The position in the collection
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
ignorePropertyFailures - Ignore exception if some or all properties could not be set/removed
Returns:
The new collection
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createResource

IResource createResource(String name,
                         IPropertyMap properties,
                         IContent content)
                         throws ResourceException,
                                NotSupportedException,
                                AccessDeniedException
Creates a new resource in a collection.

Parameters:
name - The name of the resource
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
content - The new content
Returns:
The new resource
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createResource

IResource createResource(String name,
                         IPosition position,
                         IPropertyMap properties,
                         IContent content)
                         throws ResourceException,
                                NotSupportedException,
                                AccessDeniedException
Creates a new resource in a collection that supports ordering.

Parameters:
name - The name of the resource
position - Ths positioning information
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
content - The new content
Returns:
The new resource
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createResource

IResource createResource(String name,
                         IPropertyMap properties,
                         IContent content,
                         boolean ignorePropertyFailures)
                         throws ResourceException,
                                NotSupportedException,
                                AccessDeniedException
Creates a new resource in a collection.

Parameters:
name - The name of the resource
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
content - The new content
ignorePropertyFailures - Ignore exception if some or all properties could not be set/removed
Returns:
The new resource
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createResource

IResource createResource(String name,
                         IPosition position,
                         IPropertyMap properties,
                         IContent content,
                         boolean ignorePropertyFailures)
                         throws ResourceException,
                                NotSupportedException,
                                AccessDeniedException
Creates a new resource in a collection that supports ordering.

Parameters:
name - The name of the resource
position - The positioning information
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
content - The new content
ignorePropertyFailures -
Returns:
The new resource
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createResource

ILockInfo createResource(String name,
                         ILockProperties lockProperties)
                         throws ResourceException,
                                NotSupportedException,
                                AccessDeniedException
Creates a empty resource that is initially locked (lock null resource)

Parameters:
name - The name of the resource
lockProperties - The properties of the lock
Returns:
LockInfo that contains the lock token
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createLink

IResource createLink(String name,
                     URL targetURL,
                     LinkType linkType,
                     IPropertyMap properties)
                     throws ResourceException,
                            NotSupportedException,
                            AccessDeniedException
Creates a new link in a collection.

Parameters:
name - The name of the resource
targetURL - The link target
linkType - The link type
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
Returns:
The new resource
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createLink

IResource createLink(String name,
                     URL targetURL,
                     LinkType linkType,
                     IPosition position,
                     IPropertyMap properties)
                     throws ResourceException,
                            NotSupportedException,
                            AccessDeniedException
Creates a new link in a collection that supports ordering.

Parameters:
name - The name of the resource
targetURL - The link target
linkType - The link type
position - The positioning information
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
Returns:
The new resource
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createLink

IResource createLink(String name,
                     URL targetURL,
                     LinkType linkType,
                     IPropertyMap properties,
                     boolean ignorePropertyFailures)
                     throws ResourceException,
                            NotSupportedException,
                            AccessDeniedException
Creates a new link in a collection.

Parameters:
name - The name of the resource
targetURL - The link target
linkType - The link type
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
ignorePropertyFailures -
Returns:
The new resource
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

createLink

IResource createLink(String name,
                     URL targetURL,
                     LinkType linkType,
                     IPosition position,
                     IPropertyMap properties,
                     boolean ignorePropertyFailures)
                     throws ResourceException,
                            NotSupportedException,
                            AccessDeniedException
Creates a new link in a collection that supports ordering.

Parameters:
name - The name of the resource
targetURL - The link target
linkType - The link type
position - The positioning information
properties - The intial properties to set for the new resource. The repository will try to set all properties in the map.
ignorePropertyFailures -
Returns:
The new resource
Throws:
ResourceException
NotSupportedException
AccessDeniedException - If the resource is locked, readonly or authorization failed

getChildrenWithoutLinkMapping

IResourceList getChildrenWithoutLinkMapping()
                                            throws ResourceException,
                                                   NotSupportedException,
                                                   AccessDeniedException
This method will return all child resources without performing the special handling for link resources. This is a performance optimization and can be used by applications which do not depend on "collection link" behaviour.

Returns:
all child resources without performing the special handling for link resources.
Throws:
ResourceException
NotSupportedException
AccessDeniedException
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