com.sapportals.wcm.repository
Interface IResource


public interface IResource

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-2002

Version:
$Revision: 1.37 $

Method Summary
 java.lang.Object as(java.lang.Class classref)
          Get a representation of this resource as the specified class.
 com.sapportals.wcm.repository.ICheckInInfo checkIn(com.sapportals.wcm.repository.IContent newContent, com.sapportals.wcm.repository.IPropertyMap properties)
          Check in a new version of the resource with new content and/or properties.
 com.sapportals.wcm.repository.ICheckInInfo checkIn(com.sapportals.wcm.repository.IContent newContent, com.sapportals.wcm.repository.IPropertyMap properties, boolean ignorePropertyFailures)
          Check in a new version of the resource with new content and/or properties.
 com.sapportals.wcm.repository.ICheckInInfo checkIn(com.sapportals.wcm.repository.IContent newContent, com.sapportals.wcm.repository.IPropertyMap properties, boolean ignorePropertyFailures, com.sapportals.wcm.util.uri.RID expectedCheckInRID)
          Check in a new version of the resource with new content and/or properties.
 com.sapportals.wcm.repository.ICheckOutInfo checkOut()
          Check out the resource for editing.
 IResource copy(com.sapportals.wcm.util.uri.RID destinationRID, com.sapportals.wcm.repository.ICopyParameter param)
          Copy the resource.
 IResource copy(com.sapportals.wcm.util.uri.RID destinationRID, com.sapportals.wcm.repository.IPosition position, com.sapportals.wcm.repository.ICopyParameter param)
          Copy the resource to a destination collection that supports ordered children.
 void delete()
          Deletes this resource from the repository.
 void deleteProperty(com.sapportals.wcm.repository.IPropertyName propName)
          Removes the property.
 void enableVersioning(boolean enable)
          Enables or disables versioning.
 com.sapportals.wcm.util.uri.RID getAccessRID()
          Returns the RID that was used to create this resource object in IResourceFactory.getResource
 IResourceList getCheckedOutResources()
          Returns a list of currently checked out resources.
 com.sapportals.wcm.repository.IContent getContent()
          Returns the content of this resource.
 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.
 com.sapportals.wcm.repository.IProperty getInheritedProperty(com.sapportals.wcm.repository.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.
 com.sapportals.wcm.repository.LinkType getLinkType()
          Returns the link type (NONE if the resource is not a link).
 com.sapportals.wcm.repository.ILockInfo getLockByToken(java.lang.String lockToken)
          Get a LockInfo for the token.
 com.sapportals.wcm.repository.ILockInfoCollection getLocks()
          Returns a collection of all existing locks.
 java.lang.String getName()
          Get name of the resource.
 com.sapportals.wcm.repository.ICollection getParentCollection()
          Returns the parent collection of this resource.
 com.sapportals.wcm.repository.IPropertyMap getProperties()
          Returns a map with IProperty references for the resource.
 com.sapportals.wcm.repository.IPropertyMap getProperties(com.sapportals.wcm.repository.IPropertyNameList propNameList)
          Returns a map with IProperty references for the resource.
 com.sapportals.wcm.repository.IProperty getProperty(com.sapportals.wcm.repository.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.
 com.sapportals.wcm.util.uri.RID getRID()
          Get the ID (path) of this resource.
 com.sapportals.wcm.util.events.IEventList getSupportedEvents()
          Returns a collection of supported resource events and semantic events for this resource.
 com.sapportals.wcm.repository.ISupportedOptionSet getSupportedOptions()
          Returns a collection of supported options for the resource.
 IResource getTargetResource()
          Returns the target resource of an internal link.
 com.sapportals.wcm.util.uri.URL getTargetURL()
          Returns the target URL of a link or null if the resource is not a link.
 com.sapportals.wcm.repository.IContent getUnfilteredContent()
          Returns the content of this resource without applying content filters.
 com.sapportals.wcm.repository.IContent getUnfilteredContent(boolean handleExternalLink)
          Returns the content of this resource without applying content filters.
 com.sapportals.wcm.repository.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.
 com.sapportals.wcm.repository.ILockInfo lock()
          Lock the resource using the current user in the context.
 com.sapportals.wcm.repository.ILockInfo lock(com.sapportals.wcm.repository.ILockProperties lockProperties)
          Lock the resource using the current user in the context.
 IResource move(com.sapportals.wcm.util.uri.RID destinationRID, com.sapportals.wcm.repository.ICopyParameter param)
          Move the resource's content and properties
 IResource move(com.sapportals.wcm.util.uri.RID destinationRID, com.sapportals.wcm.repository.IPosition position, com.sapportals.wcm.repository.ICopyParameter param)
          Move the resource to a destination collection that supports ordered children.
 void refreshLock(com.sapportals.wcm.repository.ILockInfo lockInfo)
          Refresh the lock.
 void rename(java.lang.String newName)
          Changes the name of this resource.
 IResourceList search(com.sapportals.wcm.repository.IQueryExpression query, int depth, int maxResults, boolean includeRevisions)
          Queries the resource and optionally the collection hierarchy for resources.
 void setLinkType(com.sapportals.wcm.repository.LinkType linkType)
          Changes the link type.
 void setProperties(com.sapportals.wcm.repository.IPropertyMap props)
          Set all properties of the resource.
 void setProperties(java.util.List propChangeList)
          Change the properties of the resource.
 void setProperty(com.sapportals.wcm.repository.IProperty prop)
          Sets a property.
 void setTargetURL(com.sapportals.wcm.util.uri.URL url)
          Changes the target URL of a link.
 void undoCheckOut()
          Undo a previous check out operation.
 void unlock(com.sapportals.wcm.repository.ILockInfo lockInfo)
          Unlock the resource using the current user in the context.
 void update(com.sapportals.wcm.repository.IContent newContent, com.sapportals.wcm.repository.IPropertyMap properties)
          Updates the content and properties of this resource in an atomic operation.
 void updateContent(com.sapportals.wcm.repository.IContent newContent)
          Updates the content of this resource.
 

Method Detail

as

public java.lang.Object as(java.lang.Class classref)
                    throws com.sapportals.wcm.repository.ResourceException,
                           com.sapportals.wcm.repository.NotSupportedException,
                           com.sapportals.wcm.repository.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 .
Parameters:
classref - TBD: Description of the incoming method parameter
Returns:
reference to object of this class or null .
Throws:
com.sapportals.wcm.repository.ResourceException - Exception raised in failure situation
com.sapportals.wcm.repository.NotSupportedException - Exception raised in failure situation
com.sapportals.wcm.repository.AccessDeniedException - Exception raised in failure situation

checkIn

public com.sapportals.wcm.repository.ICheckInInfo checkIn(com.sapportals.wcm.repository.IContent newContent,
                                                          com.sapportals.wcm.repository.IPropertyMap properties)
                                                   throws com.sapportals.wcm.repository.ResourceException,
                                                          com.sapportals.wcm.repository.NotSupportedException,
                                                          com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

checkIn

public com.sapportals.wcm.repository.ICheckInInfo checkIn(com.sapportals.wcm.repository.IContent newContent,
                                                          com.sapportals.wcm.repository.IPropertyMap properties,
                                                          boolean ignorePropertyFailures)
                                                   throws com.sapportals.wcm.repository.ResourceException,
                                                          com.sapportals.wcm.repository.NotSupportedException,
                                                          com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

checkIn

public com.sapportals.wcm.repository.ICheckInInfo checkIn(com.sapportals.wcm.repository.IContent newContent,
                                                          com.sapportals.wcm.repository.IPropertyMap properties,
                                                          boolean ignorePropertyFailures,
                                                          com.sapportals.wcm.util.uri.RID expectedCheckInRID)
                                                   throws com.sapportals.wcm.repository.ResourceException,
                                                          com.sapportals.wcm.repository.NotSupportedException,
                                                          com.sapportals.wcm.repository.AccessDeniedException,
                                                          com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed
com.sapportals.wcm.repository.ExpectedCheckInRIDException - Exception raised in failure situation
See Also:
checkOut()

checkOut

public com.sapportals.wcm.repository.ICheckOutInfo checkOut()
                                                     throws com.sapportals.wcm.repository.ResourceException,
                                                            com.sapportals.wcm.repository.NotSupportedException,
                                                            com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

copy

public IResource copy(com.sapportals.wcm.util.uri.RID destinationRID,
                      com.sapportals.wcm.repository.ICopyParameter param)
               throws com.sapportals.wcm.repository.ResourceException,
                      com.sapportals.wcm.repository.NotSupportedException,
                      com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

copy

public IResource copy(com.sapportals.wcm.util.uri.RID destinationRID,
                      com.sapportals.wcm.repository.IPosition position,
                      com.sapportals.wcm.repository.ICopyParameter param)
               throws com.sapportals.wcm.repository.ResourceException,
                      com.sapportals.wcm.repository.NotSupportedException,
                      com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

delete

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

deleteProperty

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

enableVersioning

public void enableVersioning(boolean enable)
                      throws com.sapportals.wcm.repository.ResourceException,
                             com.sapportals.wcm.repository.NotSupportedException,
                             com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

getAccessRID

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

getCheckedOutResources

public IResourceList getCheckedOutResources()
                                     throws com.sapportals.wcm.repository.ResourceException,
                                            com.sapportals.wcm.repository.NotSupportedException,
                                            com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException -  

getContent

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

getContext

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

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.

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.

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.

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.

getInheritedProperty

public com.sapportals.wcm.repository.IProperty getInheritedProperty(com.sapportals.wcm.repository.IPropertyName propName)
                                                             throws com.sapportals.wcm.repository.ResourceException,
                                                                    com.sapportals.wcm.repository.NotSupportedException,
                                                                    com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

getLanguage

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

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.

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.

getLinkType

public com.sapportals.wcm.repository.LinkType getLinkType()
                                                   throws com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  

getLockByToken

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

getLocks

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

getName

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

getParentCollection

public com.sapportals.wcm.repository.ICollection getParentCollection()
                                                              throws com.sapportals.wcm.repository.ResourceException,
                                                                     com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

getProperties

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

getProperties

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

getProperty

public com.sapportals.wcm.repository.IProperty getProperty(com.sapportals.wcm.repository.IPropertyName propName)
                                                    throws com.sapportals.wcm.repository.ResourceException,
                                                           com.sapportals.wcm.repository.NotSupportedException,
                                                           com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

getRepositoryManager

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

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

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.

getRID

public com.sapportals.wcm.util.uri.RID getRID()
                                       throws com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
See Also:
isRevision(), getAccessRID()

getSupportedEvents

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

getSupportedOptions

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

getTargetResource

public IResource getTargetResource()
                            throws com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  

getTargetURL

public com.sapportals.wcm.util.uri.URL getTargetURL()
                                             throws com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  

getUnfilteredContent

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

getUnfilteredContent

public com.sapportals.wcm.repository.IContent getUnfilteredContent(boolean handleExternalLink)
                                                            throws com.sapportals.wcm.repository.ResourceException,
                                                                   com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

getVersionHistory

public com.sapportals.wcm.repository.IVersionHistory getVersionHistory()
                                                                throws com.sapportals.wcm.repository.ResourceException,
                                                                       com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  

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 .
Parameters:
classtest - class to test for.
Returns:
a

isCheckedOut

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

isCollection

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

isHidden

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

isLocked

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

isLockedByMe

public boolean isLockedByMe()
                     throws com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  

isReadOnly

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

isRevision

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

isVersioned

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

lock

public com.sapportals.wcm.repository.ILockInfo lock()
                                             throws com.sapportals.wcm.repository.ResourceException,
                                                    com.sapportals.wcm.repository.NotSupportedException,
                                                    com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

lock

public com.sapportals.wcm.repository.ILockInfo lock(com.sapportals.wcm.repository.ILockProperties lockProperties)
                                             throws com.sapportals.wcm.repository.ResourceException,
                                                    com.sapportals.wcm.repository.NotSupportedException,
                                                    com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

move

public IResource move(com.sapportals.wcm.util.uri.RID destinationRID,
                      com.sapportals.wcm.repository.ICopyParameter param)
               throws com.sapportals.wcm.repository.ResourceException,
                      com.sapportals.wcm.repository.NotSupportedException,
                      com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

move

public IResource move(com.sapportals.wcm.util.uri.RID destinationRID,
                      com.sapportals.wcm.repository.IPosition position,
                      com.sapportals.wcm.repository.ICopyParameter param)
               throws com.sapportals.wcm.repository.ResourceException,
                      com.sapportals.wcm.repository.NotSupportedException,
                      com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed

refreshLock

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

rename

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

search

public IResourceList search(com.sapportals.wcm.repository.IQueryExpression query,
                            int depth,
                            int maxResults,
                            boolean includeRevisions)
                     throws com.sapportals.wcm.repository.ResourceException,
                            com.sapportals.wcm.repository.NotSupportedException,
                            com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException - Exception raised in failure situation
com.sapportals.wcm.repository.AccessDeniedException - Exception raised in failure situation

setLinkType

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

setProperties

public void setProperties(com.sapportals.wcm.repository.IPropertyMap props)
                   throws com.sapportals.wcm.repository.ResourceException,
                          com.sapportals.wcm.repository.NotSupportedException,
                          com.sapportals.wcm.repository.AccessDeniedException,
                          com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed
com.sapportals.wcm.repository.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 com.sapportals.wcm.repository.ResourceException,
                          com.sapportals.wcm.repository.NotSupportedException,
                          com.sapportals.wcm.repository.AccessDeniedException,
                          com.sapportals.wcm.repository.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 - properties to be set
Throws:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed
com.sapportals.wcm.repository.SetPropertiesException - If the call was succesfull but some of the properties could not be set or removed

setProperty

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

setTargetURL

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

undoCheckOut

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

unlock

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

update

public void update(com.sapportals.wcm.repository.IContent newContent,
                   com.sapportals.wcm.repository.IPropertyMap properties)
            throws com.sapportals.wcm.repository.ResourceException,
                   com.sapportals.wcm.repository.NotSupportedException,
                   com.sapportals.wcm.repository.AccessDeniedException,
                   com.sapportals.wcm.repository.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:
com.sapportals.wcm.repository.ResourceException -  
com.sapportals.wcm.repository.NotSupportedException -  
com.sapportals.wcm.repository.AccessDeniedException - If authorization failed
com.sapportals.wcm.repository.SetPropertiesException - If some properties could not be set or removed
See Also:
Content

updateContent

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