SAP NetWeaver '04

com.sapportals.wcm.repository
Interface IResource

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.framework_api.jar]
All Superinterfaces:
ITypeCast
All Known Subinterfaces:
ICollection

public interface IResource
extends ITypeCast

A resource represents an object in a repository and is uniquely identified by a resource identifier (RID). Clients use this interface and the derived ICollection interface to manipulate the resources in a repository. Every repository is controlled by a repository manager (getRepositoryManager()), which is resposible for createing resource instances and carrying out all basic operations (create, update content or properties, deleting, etc.).

The Repository Framework knows these kinds of resources:

Normal resources: A resource has an identifier (RID) which is unique within a CM system (getRID()) and usually has content (getContent()) and properties (getProperties()).

Collections: isCollection() returns true . The items in a collection are called "children" and are accessed with ICollection.getChildren().

Links: getLinkType() returns INTERNAL or EXTERNAL. Internal links point to other resources (in the same or a different repository), external links point to resources outside the CM system (URL). The link target for internal links is access with getTargetResource(). The target can again be a link. Links to collections are themselfs collections. A link resource usually has no content but might have properties.

Version Controlled Resources: isVersioned() returns true . A version controlled resource must be checked out to be modified. All revisions of the content and/or properties will be recorded in a version history (getVersionHistory()). The resources in the version history are called "revisions".

Revisions: isRevision() returns true . A revision provides read-only access to the properties and the content of a version of the version controlled resource.

Deleted resources: As soon as the delete() method has been called the resource instance is in a special state. All methods except getRID() and getName() are prohibited and will throw an exception.

Copyright (c) SAP AG 2001-2004


Method Summary
 java.lang.Object as(java.lang.Class classref)
          Get a representation of this resource as the specified class.
 ICheckInInfo checkIn(IContent newContent, IPropertyMap properties)
          Check in a new version of the resource with new content and/or properties.
 ICheckInInfo checkIn(IContent newContent, IPropertyMap properties, boolean ignorePropertyFailures)
          Check in a new version of the resource with new content and/or properties.
 ICheckInInfo checkIn(IContent newContent, IPropertyMap properties, boolean ignorePropertyFailures, RID expectedCheckInRID)
          Check in a new version of the resource with new content and/or properties.
 ICheckInInfo checkIn(IContent newContent, IPropertyMap properties, boolean ignorePropertyFailures, URI expectedCheckInURI)
          Deprecated. As of EP 5.0 SP4
 ICheckOutInfo checkOut()
          Check out the resource for editing.
 IResource copy(RID destinationRID, ICopyParameter param)
          Copy the resource.
 IResource copy(RID destinationRID, IPosition position, ICopyParameter param)
          Copy the resource to a destination collection that supports ordered children.
 IResource copy(URI destinationURI, ICopyParameter param)
          Deprecated. As of EP 5.0 SP5, replaced by copy() with RID parameter.
 IResource copy(URI destinationURI, IPosition position, ICopyParameter param)
          Deprecated. As of EP 5.0 SP5, replaced by copy() with RID parameter.
 void delete()
          Deletes this resource from the repository.
 void deleteProperty(IPropertyName propName)
          Removes the property.
 void enableVersioning(boolean enable)
          Enables or disables versioning.
 RID getAccessRID()
          Returns the RID that was used to create this resource object in IResourceFactory.getResource
 URI getAccessURI()
          Deprecated. As of EP 5.0 SP3, replaced by getAccessRID()
 IResourceList getCheckedOutResources()
          Returns a list of currently checked out resources.
 IContent getContent()
          Returns the content of this resource.
 IContent getContent(boolean handleExternalLink)
          Deprecated. As of EP 5.0 SP 5

This method is deprecated because it opens a potential security hole: The URL of an external link can have different schemas (e.g. "file:") which are all accessed with the security context of the servlet engine. This could be (ab)used to access files/resources on the local server and other systems without the security context of the logged in user.

No longer supported as of SP6: Throws a NotSupportedException if parameter is true

 IResourceContext getContext()
          Returns the resource context
 java.lang.String getCreatedBy()
          Get value of the system property CreatedBy.
 java.util.Date getCreationDate()
          Get value of the system property CreationDate
 java.lang.String getDescription()
          Get value of the system property Description
 java.lang.String getDisplayName()
          Returns the value of the Displayname system property or null if the property is not set.
 java.lang.String getDisplayName(boolean orNameIfNull)
          Returns the value of the Displayname system property or null if the property is not set.
 java.lang.String getETag()
          Get value of the system property ETag, reflecting the HTTP entity tag for the unfiltered content of this resource.
 IProperty getInheritedProperty(IPropertyName propName)
          Get a property of the resource or inherit it.
 java.lang.String getLanguage()
          Returns the language
 java.util.Date getLastModified()
          Get value of the system property LastModified
 java.lang.String getLastModifiedBy()
          Get value of the system property LastModifiedBy.
 LinkType getLinkType()
          Returns the link type (NONE if the resource is not a link).
 ILockInfo getLockByToken(java.lang.String lockToken)
          Get a LockInfo for the token.
 ILockInfoCollection getLocks()
          Returns a collection of all existing locks.
 java.lang.String getName()
          Get name of the resource.
 ICollection getParentCollection()
          Returns the parent collection of this resource.
 IPropertyMap getProperties()
          Returns a map with IProperty references for the resource.
 IPropertyMap getProperties(IPropertyNameList propNameList)
          Returns a map with IProperty references for the resource.
 IProperty getProperty(IPropertyName propName)
          Get a property.
 IRepositoryManager getRepositoryManager()
          Get the repository manager for this resource
 java.lang.String getResourceType()
          Returns the value of the ResourceType system property or an empty string if the property is not set.
 java.lang.String getRevisionID()
          Returns the identifier for this revision.
 RID getRID()
          Get the ID (path) of this resource.
 IEventList getSupportedEvents()
          Returns a collection of supported resource events and semantic events for this resource.
 ISupportedOptionSet getSupportedOptions()
          Returns a collection of supported options for the resource.
 IResource getTargetResource()
          Returns the target resource of an internal link.
 URL getTargetURL()
          Returns the target URL of a link or null if the resource is not a link.
 IContent getUnfilteredContent()
          Returns the content of this resource without applying content filters.
 IContent getUnfilteredContent(boolean handleExternalLink)
          Returns the content of this resource without applying content filters.
 URI getURI()
          Deprecated. As of EP 5.0 SP3, replaced by getRID()
 IVersionHistory getVersionHistory()
          Returns the version history of this resource.
 boolean isA(java.lang.Class classtest)
          Returns whether this resource has a representation as the class.
 boolean isCheckedOut()
          Returns true if this resource is currently checked out.
 boolean isCollection()
          Returns true if this resource is a collection
 boolean isHidden()
          Get value of the system property Hidden
 boolean isLocked()
          Returns true if this resource is locked.
 boolean isLockedByMe()
          Returns true if this resource is locked by the current user in the context.
 boolean isReadOnly()
          Get value of the system property Readonly
 boolean isRevision()
          Returns true if this resource is a revision.
 boolean isVersioned()
          Returns true if versioning is enabled for this resource.
 ILockInfo lock()
          Lock the resource using the current user in the context.
 ILockInfo lock(ILockProperties lockProperties)
          Lock the resource using the current user in the context.
 IResource move(RID destinationRID, ICopyParameter param)
          Move the resource's content and properties
 IResource move(RID destinationRID, IPosition position, ICopyParameter param)
          Move the resource to a destination collection that supports ordered children.
 IResource move(URI destinationURI, ICopyParameter param)
          Deprecated. As of EP 5.0 SP5, replaced by move() with RID parameter.
 IResource move(URI destinationURI, IPosition position, ICopyParameter param)
          Deprecated. As of EP 5.0 SP5, replaced by move() with RID parameter.
 void refreshLock(ILockInfo lockInfo)
          Refresh the lock.
 void rename(java.lang.String newName)
          Changes the name of this resource.
 IResourceList search(IQueryExpression query, int depth, int maxResults, boolean includeRevisions)
          Queries the resource and optionally the collection hierarchy for resources.
 void setAsCurrentVersion()
          Deprecated. As of EP 5.0 SP5 This method will fail if it's not possible to unambigously identify the version-controlled resource to be updated (this may happen when working resources or workspaces are used). Instead check out the version-controlled resource, copy the version onto it, then check it back again.
 void setLinkType(LinkType linkType)
          Changes the link type.
 void setProperties(IPropertyMap props)
          Set all properties of the resource.
 void setProperties(java.util.List propChangeList)
          Change the properties of the resource.
 void setProperty(IProperty prop)
          Sets a property.
 void setTargetURL(URL url)
          Changes the target URL of a link.
 void undoCheckOut()
          Undo a previous check out operation.
 void unlock(ILockInfo lockInfo)
          Unlock the resource using the current user in the context.
 void update(IContent newContent, IPropertyMap properties)
          Updates the content and properties of this resource in an atomic operation.
 void updateContent(IContent newContent)
          Updates the content of this resource.
 
Methods inherited from interface com.sapportals.wcm.repository.so.ITypeCast
listTypes
 

Method Detail

getSupportedEvents

public IEventList getSupportedEvents()
                              throws ResourceException
Returns a collection of supported resource events and semantic events for this resource.
Returns:
The set of supported events
Throws:
ResourceException - Exception raised in failure situation

getSupportedOptions

public ISupportedOptionSet getSupportedOptions()
Returns a collection of supported options for the resource.
Returns:
The set of supported operations

getContext

public IResourceContext getContext()
Returns the resource context
Returns:
The context

getRepositoryManager

public IRepositoryManager getRepositoryManager()
Get the repository manager for this resource
Returns:
Reference to a repository manager instance

getName

public java.lang.String getName()
                         throws ResourceException
Get name of the resource. The resource name ist the last part if its RID. path.
Returns:
The name of the resource
Throws:
ResourceException -  

getCreationDate

public java.util.Date getCreationDate()
Get value of the system property CreationDate
Returns:
Property value, can be null if property is not supported by the repository.

getLastModified

public java.util.Date getLastModified()
Get value of the system property LastModified
Returns:
Property value, can be null if property is not supported by the repository.

getDescription

public java.lang.String getDescription()
Get value of the system property Description
Returns:
Property value, can be null if property is not supported by the repository.

getDisplayName

public java.lang.String getDisplayName()
Returns the value of the Displayname system property or null if the property is not set.
Returns:
the value of the Displayname system property or null if the property is not set.

getDisplayName

public java.lang.String getDisplayName(boolean orNameIfNull)
Returns the value of the Displayname system property or null if the property is not set. If the boolean parameter is true the name (last part of the resource identifier) is used as a fallback if the property is not set.
Parameters:
orNameIfNull - If true, the name (last part of the resource identifier) is used as a fallback if the DisplayName property is not set.
Returns:
The display name.

getResourceType

public java.lang.String getResourceType()
Returns the value of the ResourceType system property or an empty string if the property is not set.
Returns:
the value of the ResourceType system property or an empty string if the property is not set

getCreatedBy

public java.lang.String getCreatedBy()
Get value of the system property CreatedBy. This will be some kind of user name or ID.
Returns:
Property value, can be null if property is not supported by the repository.

getLastModifiedBy

public java.lang.String getLastModifiedBy()
Get value of the system property LastModifiedBy. This will be some kind of user name or ID.
Returns:
Property value, can be null if property is not supported by the repository.

getETag

public java.lang.String getETag()
Get value of the system property ETag, reflecting the HTTP entity tag for the unfiltered content of this resource. If two strong entity tags for a given RID are identical, the contents is identical octet-by-octet. If two weak entitiy tags are identical, the contents is semantically equivalent, but may differ in it's octet representation. Tags are weak if and only if they start with a leading "W/".

Note: The ETag of a resource is not a unique identifier.

Returns:
Property value, can be null if etags are not supported by the resource.

getLanguage

public java.lang.String getLanguage()
Returns the language
Returns:
The language ID

getURI

public URI getURI()
           throws ResourceException
Deprecated. As of EP 5.0 SP3, replaced by getRID()

Returns:
uRI
Throws:
ResourceException - Exception raised in failure situation

getRID

public RID getRID()
           throws ResourceException
Get the ID (path) of this resource. This RID might differ from the access RID that was used to create this resource object with a call to ResourceFactory.getResource(), e.g. if this RID contained one ore more links to collections in the same or a different repository.
Example:
Access RID: getResource("/prefix-repository-a/xxx/link-to-collection-in-repository-b/xxx/test.html", ...) getRID() returns: /prefix-repository-b/dir1/dir2/link-target/xxx/test.html

A repository might provide special RIDs for revision resources to provide access to all the resources in the version history via some kind of "virtual" collection. The syntax of the revision RID is specific to each repository.

Returns:
The RID
Throws:
ResourceException -  
See Also:
isRevision(), getAccessRID()

getAccessURI

public URI getAccessURI()
                 throws ResourceException
Deprecated. As of EP 5.0 SP3, replaced by getAccessRID()

Returns:
accessURI
Throws:
ResourceException - Exception raised in failure situation

getAccessRID

public RID getAccessRID()
                 throws ResourceException
Returns the RID that was used to create this resource object in IResourceFactory.getResource
Returns:
The access RID
Throws:
ResourceException -  
See Also:
getRID()

isReadOnly

public boolean isReadOnly()
Get value of the system property Readonly
Returns:
Property value

isHidden

public boolean isHidden()
Get value of the system property Hidden
Returns:
Property value

isCollection

public boolean isCollection()
Returns true if this resource is a collection
Returns:
true if this resource is a collection

rename

public void rename(java.lang.String newName)
            throws ResourceException,
                   NotSupportedException,
                   AccessDeniedException
Changes the name of this resource.
Parameters:
newName - The new name
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

getParentCollection

public ICollection getParentCollection()
                                throws ResourceException,
                                       AccessDeniedException
Returns the parent collection of this resource. The return value will be null if this resource is the root collection. If this resource is a revision (@link #isRevision) the returned resource is the parent collection of the versioned controlled resource of the revision. The return value might be null because repository manager implementation might not support this call for revision at all or it is not possible for some revisions, for example if the version controlled resource does not exist anymore.
Returns:
the parent collection of this resource
Throws:
ResourceException -  
AccessDeniedException - If authorization failed

getContent

public IContent getContent()
                    throws ResourceException,
                           AccessDeniedException
Returns the content of this resource.
Returns:
the content of this resource.
Throws:
ResourceException -  
AccessDeniedException - If authorization failed

getContent

public IContent getContent(boolean handleExternalLink)
                    throws ResourceException,
                           AccessDeniedException
Deprecated. As of EP 5.0 SP 5

This method is deprecated because it opens a potential security hole: The URL of an external link can have different schemas (e.g. "file:") which are all accessed with the security context of the servlet engine. This could be (ab)used to access files/resources on the local server and other systems without the security context of the logged in user.

No longer supported as of SP6: Throws a NotSupportedException if parameter is true

Returns the content of this resource.
Parameters:
handleExternalLink - If true , try to read the content from an external source, if the resource is a external link.
Returns:
the content of this resource.
Throws:
ResourceException -  
AccessDeniedException - If authorization failed

getUnfilteredContent

public IContent getUnfilteredContent()
                              throws ResourceException,
                                     AccessDeniedException
Returns the content of this resource without applying content filters.
Returns:
the unfiltered content of this resource.
Throws:
ResourceException -  
AccessDeniedException - If authorization failed

getUnfilteredContent

public IContent getUnfilteredContent(boolean handleExternalLink)
                              throws ResourceException,
                                     AccessDeniedException
Returns the content of this resource without applying content filters.
Parameters:
handleExternalLink - If true , try to read the content from an external source, if the resource is a external link.
Returns:
the unfiltered content of this resource.
Throws:
ResourceException -  
AccessDeniedException - If authorization failed

delete

public void delete()
            throws ResourceException,
                   NotSupportedException,
                   AccessDeniedException
Deletes this resource from the repository. If the resource is a collection all its children will be deleted.
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

updateContent

public void updateContent(IContent newContent)
                   throws ResourceException,
                          NotSupportedException,
                          AccessDeniedException
Updates the content of this resource.
Parameters:
newContent - The new content
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed
See Also:
Content

update

public void update(IContent newContent,
                   IPropertyMap properties)
            throws ResourceException,
                   NotSupportedException,
                   AccessDeniedException,
                   SetPropertiesException
Updates the content and properties of this resource in an atomic operation. If some or all properties cannot be saved the content will not change - and vice versa.
Parameters:
newContent - The new content
properties - A map with properties
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed
SetPropertiesException - If some properties could not be set or removed
See Also:
Content

copy

public IResource copy(URI destinationURI,
                      ICopyParameter param)
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Deprecated. As of EP 5.0 SP5, replaced by copy() with RID parameter.

Parameters:
destinationURI - TBD: Description of the incoming method parameter
param - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
ResourceException - Exception raised in failure situation
NotSupportedException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation

copy

public IResource copy(URI destinationURI,
                      IPosition position,
                      ICopyParameter param)
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Deprecated. As of EP 5.0 SP5, replaced by copy() with RID parameter.

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

move

public IResource move(URI destinationURI,
                      ICopyParameter param)
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Deprecated. As of EP 5.0 SP5, replaced by move() with RID parameter.

Parameters:
destinationURI - TBD: Description of the incoming method parameter
param - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
ResourceException - Exception raised in failure situation
NotSupportedException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation

move

public IResource move(URI destinationURI,
                      IPosition position,
                      ICopyParameter param)
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Deprecated. As of EP 5.0 SP5, replaced by move() with RID parameter.

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

copy

public IResource copy(RID destinationRID,
                      ICopyParameter param)
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Copy the resource.
Parameters:
destinationRID - the RID of the destination (includes the name). All collections in the destination RID must already exists.
param - The copy parameter object, can be null
Returns:
The new resource object
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

copy

public IResource copy(RID destinationRID,
                      IPosition position,
                      ICopyParameter param)
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Copy the resource to a destination collection that supports ordered children.
Parameters:
destinationRID - the RID of the destination (includes the name). All collections in the destination RID must already exists.
position - The positioning information
param - The copy parameter object, can be null
Returns:
The new resource object
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

move

public IResource move(RID destinationRID,
                      ICopyParameter param)
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Move the resource's content and properties
Parameters:
destinationRID - The RID of the destination (includes the name). All collections in the destination RID must already exists.
param - The copy parameter object, can be null
Returns:
The new resource object
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

move

public IResource move(RID destinationRID,
                      IPosition position,
                      ICopyParameter param)
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Move the resource to a destination collection that supports ordered children. If the destinationRID is the same as the RID of this resource the position parameter can be used to reposition the resource in the sorted collection. In this case the return value will be null .
Parameters:
destinationRID - The RID of the destination
position - The positioning information
param - The copy parameter object, can be null
Returns:
The new resource object or null
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

getProperties

public IPropertyMap getProperties()
                           throws ResourceException,
                                  NotSupportedException,
                                  AccessDeniedException
Returns a map with IProperty references for the resource.
Returns:
The property map
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

getProperties

public IPropertyMap getProperties(IPropertyNameList propNameList)
                           throws ResourceException,
                                  NotSupportedException,
                                  AccessDeniedException
Returns a map with IProperty references for the resource.
Parameters:
propNameList - The list with the requested property names.
Returns:
The property map
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

setProperties

public void setProperties(IPropertyMap props)
                   throws ResourceException,
                          NotSupportedException,
                          AccessDeniedException,
                          SetPropertiesException
Set all properties of the resource. The call is not atomic. That means failuers to set or remove some properties will not cause the operation to fail completely. All errors for properties in the map and also attemps to remove required properties are collected and reported via a SetPropertiesException.
Parameters:
props - The map with the properties.
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed
SetPropertiesException - If the call was succesfull but some of the properties could not be set or removed

setProperties

public void setProperties(java.util.List propChangeList)
                   throws ResourceException,
                          NotSupportedException,
                          AccessDeniedException,
                          SetPropertiesException
Change the properties of the resource. The call is not atomic. That means failures to set or remove some properties will not cause the operation to fail completely. All errors for properties in the map and also attempts to remove required properties are collected and reported via a SetPropertiesException.
Parameters:
propChangeList - change list (contains IProperty entries for properties to be set and IPropertyName entries for properties to be removed)
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed
SetPropertiesException - If the call was succesfull but some of the properties could not be set or removed

getProperty

public IProperty getProperty(IPropertyName propName)
                      throws ResourceException,
                             NotSupportedException,
                             AccessDeniedException
Get a property.
Parameters:
propName - The property name of the property to read
Returns:
A reference to the property or null if the property was not found
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

getInheritedProperty

public IProperty getInheritedProperty(IPropertyName propName)
                               throws ResourceException,
                                      NotSupportedException,
                                      AccessDeniedException
Get a property of the resource or inherit it. If the resource does not have the property attached to it it will inherit it from a collection in its path. The list of all parent(ancestor) collections up to the root collection is searched for the property.
Parameters:
propName - The property name of the property to find
Returns:
A reference to the property or null if no property was found
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

setProperty

public void setProperty(IProperty prop)
                 throws ResourceException,
                        NotSupportedException,
                        AccessDeniedException
Sets a property.
Parameters:
prop - The property to set
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

deleteProperty

public void deleteProperty(IPropertyName propName)
                    throws ResourceException,
                           NotSupportedException,
                           AccessDeniedException
Removes the property.
Parameters:
propName - The property name of the property to delete
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

lock

public ILockInfo lock()
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Lock the resource using the current user in the context. Scope is "exclusive", type is "write" and time-out is "infinite".
Returns:
TBD: Description of the outgoing return value
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

lock

public ILockInfo lock(ILockProperties lockProperties)
               throws ResourceException,
                      NotSupportedException,
                      AccessDeniedException
Lock the resource using the current user in the context.
Parameters:
lockProperties - The lock properties defining the scope, type and time-out of the lock.
Returns:
TBD: Description of the outgoing return value
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

unlock

public void unlock(ILockInfo lockInfo)
            throws ResourceException,
                   NotSupportedException,
                   AccessDeniedException
Unlock the resource using the current user in the context.
Parameters:
lockInfo - The LockInfo
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

refreshLock

public void refreshLock(ILockInfo lockInfo)
                 throws ResourceException,
                        NotSupportedException,
                        AccessDeniedException
Refresh the lock.
Parameters:
lockInfo - The LockInfo
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

getLockByToken

public ILockInfo getLockByToken(java.lang.String lockToken)
                         throws ResourceException,
                                NotSupportedException
Get a LockInfo for the token.
Parameters:
lockToken - TBD: Description of the incoming method parameter
Returns:
lockByToken
Throws:
NotSupportedException -  
ResourceException - Exception raised in failure situation

getLocks

public ILockInfoCollection getLocks()
                             throws ResourceException,
                                    NotSupportedException,
                                    AccessDeniedException
Returns a collection of all existing locks.
Returns:
A collection of ILockInfo instances
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

isLocked

public boolean isLocked()
                 throws ResourceException
Returns true if this resource is locked.
Returns:
true if this resource is locked.
Throws:
ResourceException -  

isLockedByMe

public boolean isLockedByMe()
                     throws ResourceException
Returns true if this resource is locked by the current user in the context.
Returns:
true if this resource is locked by the current user in the context.
Throws:
ResourceException -  

getTargetURL

public URL getTargetURL()
                 throws ResourceException
Returns the target URL of a link or null if the resource is not a link.
Returns:
the target URL of a link or null if the resource is not a link.
Throws:
ResourceException -  

setTargetURL

public void setTargetURL(URL url)
                  throws ResourceException,
                         AccessDeniedException
Changes the target URL of a link.
Parameters:
url - targetURL to be set
Throws:
ResourceException -  
AccessDeniedException - If authorization failed

getTargetResource

public IResource getTargetResource()
                            throws ResourceException
Returns the target resource of an internal link. If the resource is not a link or an external link the method returns null . The method will resolve relativ internal links and links to target resources which are links.
Returns:
The target resource
Throws:
ResourceException -  

getLinkType

public LinkType getLinkType()
                     throws ResourceException
Returns the link type (NONE if the resource is not a link).
Returns:
the link type (NONE if the resource is not a link).
Throws:
ResourceException -  

setLinkType

public void setLinkType(LinkType linkType)
                 throws ResourceException,
                        AccessDeniedException
Changes the link type.
Parameters:
linkType - linkType to be set
Throws:
ResourceException -  
AccessDeniedException - If authorization failed

enableVersioning

public void enableVersioning(boolean enable)
                      throws ResourceException,
                             NotSupportedException,
                             AccessDeniedException
Enables or disables versioning. The operation will not be performed if the parameter is true /false but versioning is already enabled/disabled.
Parameters:
enable - TBD: Description of the incoming method parameter
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

isVersioned

public boolean isVersioned()
                    throws ResourceException
Returns true if versioning is enabled for this resource.
Returns:
true if versioning is enabled for this resource.
Throws:
ResourceException -  

isRevision

public boolean isRevision()
Returns true if this resource is a revision.
Returns:
true if this resource is a revision.

getRevisionID

public java.lang.String getRevisionID()
Returns the identifier for this revision. Usually this will be some kind of a version number (depends on the repository manager implementation). If this resource is a version controlled resource (isVersioned()) the return value will be null .
Returns:
the identifier for this revision.

isCheckedOut

public boolean isCheckedOut()
                     throws ResourceException
Returns true if this resource is currently checked out.
Returns:
true if this resource is currently checked out.
Throws:
ResourceException -  

checkOut

public ICheckOutInfo checkOut()
                       throws ResourceException,
                              NotSupportedException,
                              AccessDeniedException
Check out the resource for editing. This method optionally returns an CheckOutInfo object. This holds information about the expected revision ID and RID of the new revision that will be created when the resource is checked in. The application can provide this RID when checking in. This check-in will fail if the new revision RID would be different for some reason.
Returns:
A ICheckOutInfo instance or null if the repository does not support the "expected check-in RID" option.
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

undoCheckOut

public void undoCheckOut()
                  throws ResourceException,
                         NotSupportedException,
                         AccessDeniedException
Undo a previous check out operation.
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

checkIn

public ICheckInInfo checkIn(IContent newContent,
                            IPropertyMap properties,
                            boolean ignorePropertyFailures,
                            URI expectedCheckInURI)
                     throws ResourceException,
                            NotSupportedException,
                            AccessDeniedException,
                            ExpectedCheckInURIException
Deprecated. As of EP 5.0 SP4

Parameters:
newContent - TBD: Description of the incoming method parameter
properties - TBD: Description of the incoming method parameter
ignorePropertyFailures - TBD: Description of the incoming method parameter
expectedCheckInURI - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value
Throws:
ResourceException - Exception raised in failure situation
NotSupportedException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation
ExpectedCheckInURIException - Exception raised in failure situation

checkIn

public ICheckInInfo checkIn(IContent newContent,
                            IPropertyMap properties)
                     throws ResourceException,
                            NotSupportedException,
                            AccessDeniedException
Check in a new version of the resource with new content and/or properties.
Parameters:
newContent - The new content. Can be null : the existing content will be used for the new version.
properties - The new properties, can be null
Returns:
checkin status information
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

checkIn

public ICheckInInfo checkIn(IContent newContent,
                            IPropertyMap properties,
                            boolean ignorePropertyFailures)
                     throws ResourceException,
                            NotSupportedException,
                            AccessDeniedException
Check in a new version of the resource with new content and/or properties.
Parameters:
newContent - The new content. Can be null : the existing content will be used for the new version.
properties - The new properties, can be null
ignorePropertyFailures - Ignore exceptions if some or all properties could not be set/removed
Returns:
checkin status information
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

checkIn

public ICheckInInfo checkIn(IContent newContent,
                            IPropertyMap properties,
                            boolean ignorePropertyFailures,
                            RID expectedCheckInRID)
                     throws ResourceException,
                            NotSupportedException,
                            AccessDeniedException,
                            ExpectedCheckInRIDException
Check in a new version of the resource with new content and/or properties.
Parameters:
newContent - The new content, can be null
properties - The new properties, can be null
ignorePropertyFailures - Ignore exceptions if some or all properties could not be set/removed
expectedCheckInRID - Create the new revision with this revision RID. The check-in may fail if the new revision RID would be different. In this case an ExpectedCheckInRID exception will be thrown which will contain a new "expected check-in RID". To make sure that the expectedCheckInRID actually was used, it needs to be compared to the RID returned by ICheckInInfo.getRevisionRID() (this is because a repository may check-in the resource although it couldn't use the expectedCheckInRID).
Returns:
checkin status information
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed
ExpectedCheckInRIDException - Exception raised in failure situation
See Also:
checkOut()

getVersionHistory

public IVersionHistory getVersionHistory()
                                  throws ResourceException,
                                         NotSupportedException
Returns the version history of this resource. Note that IVersionHistory is restricted to linear (non-branching) version histories, therefore this method will fail if the version history is not linear.
Returns:
versionHistory
Throws:
ResourceException -  
NotSupportedException -  

setAsCurrentVersion

public void setAsCurrentVersion()
                         throws ResourceException,
                                NotSupportedException,
                                AccessDeniedException
Deprecated. As of EP 5.0 SP5 This method will fail if it's not possible to unambigously identify the version-controlled resource to be updated (this may happen when working resources or workspaces are used). Instead check out the version-controlled resource, copy the version onto it, then check it back again.

Make this revision of the resource the current version. This is equivalent to copying the revision to the checked-out resource (updating content and dead properties) followed by a checkin.

Note that {@IVersionControlledResource} supports a more powerful update mechanism that will actually create proper branches in the version history.

Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException - If authorization failed

getCheckedOutResources

public IResourceList getCheckedOutResources()
                                     throws ResourceException,
                                            NotSupportedException,
                                            AccessDeniedException
Returns a list of currently checked out resources. This method is usually only supported for revision resources.
Returns:
Resource list, or null if no resources are checked out
Throws:
ResourceException -  
NotSupportedException -  
AccessDeniedException -  

isA

public boolean isA(java.lang.Class classtest)
Returns whether this resource has a representation as the class. This method must be implemented in a resource class that extends ResourceImpl class. This base class will always return false .
Specified by:
isA in interface ITypeCast
Parameters:
classtest - class to test for.
Returns:
a

as

public java.lang.Object as(java.lang.Class classref)
                    throws ResourceException,
                           NotSupportedException,
                           AccessDeniedException
Get a representation of this resource as the specified class. This method must be implemented in a resource class that extends ResourceImpl class. This base class will always return null .
Specified by:
as in interface ITypeCast
Parameters:
classref - TBD: Description of the incoming method parameter
Returns:
reference to object of this class or null .
Throws:
ResourceException - Exception raised in failure situation
NotSupportedException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation

search

public IResourceList search(IQueryExpression query,
                            int depth,
                            int maxResults,
                            boolean includeRevisions)
                     throws ResourceException,
                            NotSupportedException,
                            AccessDeniedException
Queries the resource and optionally the collection hierarchy for resources. The search criteria are properties and property values. Note that this method does not automatically follow links. Also note that the query expression must have been built using the correct property search manager (the one configured for the repository manager the resource is in).
Parameters:
query - The query specification
depth - The search depth (0, 1, or Integer.MAX_VALUE)
maxResults - The maximum number of resources that will be returned
includeRevisions - when set to true , also descend into version history (independantly of depth)
Returns:
The result list
Throws:
ResourceException -  
NotSupportedException - Exception raised in failure situation
AccessDeniedException - Exception raised in failure situation

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.