org.apache.slide.content
Class ContentImpl

java.lang.Object
  extended byorg.apache.slide.content.ContentImpl
All Implemented Interfaces:
Content

public class ContentImpl
extends java.lang.Object
implements Content

Implementation of the content interface.

Version:
$Revision: 1.63 $

Field Summary
protected static java.lang.String I_URIREDIRECTORCLASS
           
protected static java.lang.String I_URIREDIRECTORCLASS_DEFAULT
           
protected static int POST_REMOVE
           
protected static int POST_RETRIEVE
           
protected static int POST_STORE
           
protected static int PRE_REMOVE
           
protected static int PRE_STORE
           
protected static java.lang.Class uriRedirectorClass
           
 
Constructor Summary
ContentImpl(Namespace namespace, NamespaceConfig namespaceConfig, Security securityHelper, Structure structureHelper, Lock lockHelper)
          Constructor.
 
Method Summary
 void create(SlideToken token, java.lang.String strUri, boolean isVersioned)
          Create new revision descriptors.
protected  void create(SlideToken token, java.lang.String strUri, NodeRevisionDescriptor revisionDescriptor)
          Create new branch-less revision descriptor.
 void create(SlideToken token, java.lang.String strUri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent)
          Create new revision in main branch.
protected  void create(SlideToken token, java.lang.String strUri, NodeRevisionNumber basedOnRevisionNumber, NodeRevisionDescriptor newRevisionDescriptor, NodeRevisionContent revisionContent)
          Create new revision based on a previous revision.
 void create(SlideToken token, java.lang.String strUri, java.lang.String branch, NodeRevisionDescriptor newRevisionDescriptor, NodeRevisionContent revisionContent)
          Create new revision based on a previous revision.
 NodeRevisionNumber fork(SlideToken token, java.lang.String strUri, java.lang.String branchName, NodeRevisionDescriptor basedOnRevisionDescriptor)
          Create a branch based on specified revision.
 NodeRevisionNumber fork(SlideToken token, java.lang.String strUri, java.lang.String branchName, NodeRevisionNumber basedOnRevisionNumber)
          Create a branch based on specified revision.
protected  void invokeInterceptors(SlideToken token, NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent, int type)
          Invoke content interceptors.
 void merge(SlideToken token, java.lang.String strUri, NodeRevisionDescriptor mainBranch, NodeRevisionDescriptor branch, NodeRevisionDescriptor newRevisionDescriptor, NodeRevisionContent revisionContent)
          Merge specified branches into a single branch.
 void merge(SlideToken token, java.lang.String strUri, java.lang.String mainBranch, java.lang.String branch, NodeRevisionDescriptor newRevisionDescriptor, NodeRevisionContent revisionContent)
          Merge specified branches into a single branch.
protected  NodeRevisionNumber redirectLatestRevisionNumber(java.lang.String uri)
           
protected  java.lang.String redirectUri(java.lang.String uri)
           
 void remove(SlideToken token, NodeRevisionDescriptors revisionDescriptors)
          Remove all revisions at this Uri.
 void remove(SlideToken token, java.lang.String strUri, NodeRevisionDescriptor revisionDescriptor)
          Remove specified revision.
 void remove(SlideToken token, java.lang.String strUri, NodeRevisionNumber revisionNumber)
          Remove specified revision.
 NodeRevisionDescriptor retrieve(SlideToken token, NodeRevisionDescriptors revisionDescriptors)
          Retrieve revision descriptor from the latest revision in the main branch.
 NodeRevisionContent retrieve(SlideToken token, NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor)
          Retrieve revision content.
 NodeRevisionDescriptor retrieve(SlideToken token, NodeRevisionDescriptors revisionDescriptors, NodeRevisionNumber revisionNumber)
          Retrieve revision descriptor.
 NodeRevisionDescriptor retrieve(SlideToken token, NodeRevisionDescriptors revisionDescriptors, java.lang.String branch)
          Retrieve revision descriptor of the latest revision from a branch.
 NodeRevisionDescriptors retrieve(SlideToken token, java.lang.String strUri)
          Retrieve revision descriptors.
 NodeRevisionContent retrieve(SlideToken token, java.lang.String strUri, NodeRevisionDescriptor revisionDescriptor)
          Retrieve revision content.
protected  void setDefaultProperties(ObjectNode associatedObject, NodeRevisionDescriptor revisionDescriptor)
          Set default properties for a revision descriptors.
 void store(SlideToken token, java.lang.String strUri, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent)
          Update contents of an existing revision.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

I_URIREDIRECTORCLASS

protected static final java.lang.String I_URIREDIRECTORCLASS
See Also:
Constant Field Values

I_URIREDIRECTORCLASS_DEFAULT

protected static final java.lang.String I_URIREDIRECTORCLASS_DEFAULT
See Also:
Constant Field Values

PRE_STORE

protected static final int PRE_STORE
See Also:
Constant Field Values

POST_STORE

protected static final int POST_STORE
See Also:
Constant Field Values

POST_RETRIEVE

protected static final int POST_RETRIEVE
See Also:
Constant Field Values

PRE_REMOVE

protected static final int PRE_REMOVE
See Also:
Constant Field Values

POST_REMOVE

protected static final int POST_REMOVE
See Also:
Constant Field Values

uriRedirectorClass

protected static java.lang.Class uriRedirectorClass
Constructor Detail

ContentImpl

public ContentImpl(Namespace namespace,
                   NamespaceConfig namespaceConfig,
                   Security securityHelper,
                   Structure structureHelper,
                   Lock lockHelper)
Constructor.

Parameters:
namespace - Namespace
namespaceConfig - Namespace configuration
securityHelper - Security helper
structureHelper - Structure helper
lockHelper - lockHelper
Method Detail

retrieve

public NodeRevisionDescriptors retrieve(SlideToken token,
                                        java.lang.String strUri)
                                 throws ObjectNotFoundException,
                                        AccessDeniedException,
                                        LinkedObjectNotFoundException,
                                        ServiceAccessException,
                                        ObjectLockedException,
                                        VetoException
Retrieve revision descriptors.

Specified by:
retrieve in interface Content
Parameters:
strUri - Uri
Returns:
NodeRevisionDescriptors
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
ObjectLockedException
VetoException

retrieve

public NodeRevisionDescriptor retrieve(SlideToken token,
                                       NodeRevisionDescriptors revisionDescriptors,
                                       java.lang.String branch)
                                throws ObjectNotFoundException,
                                       AccessDeniedException,
                                       LinkedObjectNotFoundException,
                                       ServiceAccessException,
                                       RevisionDescriptorNotFoundException,
                                       ObjectLockedException,
                                       BranchNotFoundException,
                                       NodeNotVersionedException,
                                       VetoException
Retrieve revision descriptor of the latest revision from a branch.

Specified by:
retrieve in interface Content
Parameters:
revisionDescriptors - Node revision descriptors
branch - String branch
token - The token to access slide
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
BranchNotFoundException
NodeNotVersionedException
VetoException

retrieve

public NodeRevisionDescriptor retrieve(SlideToken token,
                                       NodeRevisionDescriptors revisionDescriptors,
                                       NodeRevisionNumber revisionNumber)
                                throws ObjectNotFoundException,
                                       AccessDeniedException,
                                       LinkedObjectNotFoundException,
                                       ServiceAccessException,
                                       RevisionDescriptorNotFoundException,
                                       ObjectLockedException,
                                       VetoException
Retrieve revision descriptor.

Specified by:
retrieve in interface Content
Parameters:
revisionDescriptors - Node revision descriptors
revisionNumber - Node revision number
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
VetoException

retrieve

public NodeRevisionDescriptor retrieve(SlideToken token,
                                       NodeRevisionDescriptors revisionDescriptors)
                                throws ObjectNotFoundException,
                                       AccessDeniedException,
                                       LinkedObjectNotFoundException,
                                       ServiceAccessException,
                                       RevisionDescriptorNotFoundException,
                                       ObjectLockedException,
                                       VetoException
Retrieve revision descriptor from the latest revision in the main branch.

Specified by:
retrieve in interface Content
Parameters:
revisionDescriptors - Node revision descriptors
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
VetoException

retrieve

public NodeRevisionContent retrieve(SlideToken token,
                                    NodeRevisionDescriptors revisionDescriptors,
                                    NodeRevisionDescriptor revisionDescriptor)
                             throws ObjectNotFoundException,
                                    AccessDeniedException,
                                    LinkedObjectNotFoundException,
                                    ServiceAccessException,
                                    RevisionNotFoundException,
                                    RevisionContentNotFoundException,
                                    ObjectLockedException,
                                    VetoException
Retrieve revision content.

Specified by:
retrieve in interface Content
Parameters:
revisionDescriptors - Node revision descriptors
revisionDescriptor - Node revision descriptor
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionNotFoundException
RevisionContentNotFoundException
ObjectLockedException
VetoException

retrieve

public NodeRevisionContent retrieve(SlideToken token,
                                    java.lang.String strUri,
                                    NodeRevisionDescriptor revisionDescriptor)
                             throws ObjectNotFoundException,
                                    AccessDeniedException,
                                    LinkedObjectNotFoundException,
                                    ServiceAccessException,
                                    RevisionNotFoundException,
                                    RevisionContentNotFoundException,
                                    ObjectLockedException,
                                    VetoException
Retrieve revision content.

Specified by:
retrieve in interface Content
Parameters:
strUri - Uri
revisionDescriptor - Node revision descriptor
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionNotFoundException
RevisionContentNotFoundException
ObjectLockedException
VetoException

create

public void create(SlideToken token,
                   java.lang.String strUri,
                   boolean isVersioned)
            throws ObjectNotFoundException,
                   AccessDeniedException,
                   LinkedObjectNotFoundException,
                   ServiceAccessException,
                   ObjectLockedException,
                   VetoException
Create new revision descriptors.

Specified by:
create in interface Content
Parameters:
strUri - Uri
isVersioned - true is the resource is versioned
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
ObjectLockedException
VetoException

create

public void create(SlideToken token,
                   java.lang.String strUri,
                   NodeRevisionDescriptor revisionDescriptor,
                   NodeRevisionContent revisionContent)
            throws ObjectNotFoundException,
                   AccessDeniedException,
                   RevisionAlreadyExistException,
                   LinkedObjectNotFoundException,
                   ServiceAccessException,
                   ObjectLockedException,
                   VetoException
Create new revision in main branch.

Specified by:
create in interface Content
Parameters:
strUri - Uri
revisionDescriptor - New Node revision descriptor
revisionContent - New Node revision content
Throws:
ObjectNotFoundException
AccessDeniedException
RevisionAlreadyExistException
LinkedObjectNotFoundException
ServiceAccessException
ObjectLockedException
VetoException

create

public void create(SlideToken token,
                   java.lang.String strUri,
                   java.lang.String branch,
                   NodeRevisionDescriptor newRevisionDescriptor,
                   NodeRevisionContent revisionContent)
            throws ObjectNotFoundException,
                   AccessDeniedException,
                   RevisionAlreadyExistException,
                   LinkedObjectNotFoundException,
                   ServiceAccessException,
                   RevisionDescriptorNotFoundException,
                   ObjectLockedException,
                   NodeNotVersionedException,
                   BranchNotFoundException,
                   VetoException
Create new revision based on a previous revision.

Specified by:
create in interface Content
Parameters:
strUri - Uri
branch - Branch in which to create the revision
newRevisionDescriptor - New revision descriptor
revisionContent - Node revision content
Throws:
ObjectNotFoundException
AccessDeniedException
RevisionAlreadyExistException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
NodeNotVersionedException
BranchNotFoundException
VetoException

fork

public NodeRevisionNumber fork(SlideToken token,
                               java.lang.String strUri,
                               java.lang.String branchName,
                               NodeRevisionDescriptor basedOnRevisionDescriptor)
                        throws ObjectNotFoundException,
                               AccessDeniedException,
                               LinkedObjectNotFoundException,
                               ServiceAccessException,
                               RevisionDescriptorNotFoundException,
                               ObjectLockedException,
                               NodeNotVersionedException,
                               RevisionAlreadyExistException,
                               VetoException
Create a branch based on specified revision.

Specified by:
fork in interface Content
Parameters:
strUri - Uri
branchName - Name of the new branch
basedOnRevisionDescriptor - Node revision descriptor of the revision on which the new branch is based on.
Returns:
the NodeRevisionNumber of the created revision.
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
NodeNotVersionedException
RevisionAlreadyExistException
VetoException

fork

public NodeRevisionNumber fork(SlideToken token,
                               java.lang.String strUri,
                               java.lang.String branchName,
                               NodeRevisionNumber basedOnRevisionNumber)
                        throws ObjectNotFoundException,
                               AccessDeniedException,
                               LinkedObjectNotFoundException,
                               ServiceAccessException,
                               RevisionDescriptorNotFoundException,
                               ObjectLockedException,
                               NodeNotVersionedException,
                               RevisionAlreadyExistException,
                               VetoException
Create a branch based on specified revision.

Specified by:
fork in interface Content
Parameters:
strUri - Uri
branchName - Name of the new branch
basedOnRevisionNumber - NodeRevisionNumber revision descriptor of the revision on which the new branch is based on.
Returns:
the NodeRevisionNumber of the created revision.
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
NodeNotVersionedException
RevisionAlreadyExistException
VetoException

merge

public void merge(SlideToken token,
                  java.lang.String strUri,
                  NodeRevisionDescriptor mainBranch,
                  NodeRevisionDescriptor branch,
                  NodeRevisionDescriptor newRevisionDescriptor,
                  NodeRevisionContent revisionContent)
           throws ObjectNotFoundException,
                  AccessDeniedException,
                  LinkedObjectNotFoundException,
                  ServiceAccessException,
                  RevisionDescriptorNotFoundException,
                  ObjectLockedException,
                  NodeNotVersionedException,
                  BranchNotFoundException,
                  RevisionAlreadyExistException,
                  VetoException
Merge specified branches into a single branch.

Specified by:
merge in interface Content
Parameters:
strUri - Uri
mainBranch - Branch into which the other branch will be merged
branch - Branch to merge into main branch
newRevisionDescriptor - New revision descriptor
revisionContent - Node revision content
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
NodeNotVersionedException
BranchNotFoundException
RevisionAlreadyExistException
VetoException

merge

public void merge(SlideToken token,
                  java.lang.String strUri,
                  java.lang.String mainBranch,
                  java.lang.String branch,
                  NodeRevisionDescriptor newRevisionDescriptor,
                  NodeRevisionContent revisionContent)
           throws ObjectNotFoundException,
                  AccessDeniedException,
                  LinkedObjectNotFoundException,
                  ServiceAccessException,
                  RevisionDescriptorNotFoundException,
                  ObjectLockedException,
                  NodeNotVersionedException,
                  BranchNotFoundException,
                  RevisionAlreadyExistException,
                  VetoException
Merge specified branches into a single branch.

Specified by:
merge in interface Content
Parameters:
strUri - Uri
mainBranch - Branch into which the other branch will be merged
branch - Branch to merge into main branch
newRevisionDescriptor - New revision descriptor
revisionContent - Node revision content
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
NodeNotVersionedException
BranchNotFoundException
RevisionAlreadyExistException
VetoException

store

public void store(SlideToken token,
                  java.lang.String strUri,
                  NodeRevisionDescriptor revisionDescriptor,
                  NodeRevisionContent revisionContent)
           throws ObjectNotFoundException,
                  AccessDeniedException,
                  LinkedObjectNotFoundException,
                  ServiceAccessException,
                  RevisionDescriptorNotFoundException,
                  ObjectLockedException,
                  RevisionNotFoundException,
                  VetoException
Update contents of an existing revision.

Specified by:
store in interface Content
Parameters:
strUri - Uri
revisionDescriptor - Revision descriptor
revisionContent - Revision content
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
RevisionNotFoundException
VetoException

remove

public void remove(SlideToken token,
                   NodeRevisionDescriptors revisionDescriptors)
            throws ObjectNotFoundException,
                   AccessDeniedException,
                   LinkedObjectNotFoundException,
                   ServiceAccessException,
                   RevisionDescriptorNotFoundException,
                   ObjectLockedException,
                   VetoException
Remove all revisions at this Uri.

Specified by:
remove in interface Content
Parameters:
revisionDescriptors - Node revision descriptors
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
VetoException

remove

public void remove(SlideToken token,
                   java.lang.String strUri,
                   NodeRevisionDescriptor revisionDescriptor)
            throws ObjectNotFoundException,
                   AccessDeniedException,
                   LinkedObjectNotFoundException,
                   ServiceAccessException,
                   RevisionDescriptorNotFoundException,
                   ObjectLockedException,
                   VetoException
Remove specified revision.

Specified by:
remove in interface Content
Parameters:
strUri - Uri
revisionDescriptor - Node revision descriptor
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
VetoException

remove

public void remove(SlideToken token,
                   java.lang.String strUri,
                   NodeRevisionNumber revisionNumber)
            throws ObjectNotFoundException,
                   AccessDeniedException,
                   LinkedObjectNotFoundException,
                   ServiceAccessException,
                   RevisionDescriptorNotFoundException,
                   ObjectLockedException,
                   VetoException
Remove specified revision.

Specified by:
remove in interface Content
Parameters:
strUri - Uri
revisionNumber - Revision number
Throws:
ObjectNotFoundException
AccessDeniedException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
VetoException

create

protected void create(SlideToken token,
                      java.lang.String strUri,
                      NodeRevisionNumber basedOnRevisionNumber,
                      NodeRevisionDescriptor newRevisionDescriptor,
                      NodeRevisionContent revisionContent)
               throws ObjectNotFoundException,
                      AccessDeniedException,
                      RevisionAlreadyExistException,
                      LinkedObjectNotFoundException,
                      ServiceAccessException,
                      RevisionDescriptorNotFoundException,
                      ObjectLockedException,
                      NodeNotVersionedException,
                      VetoException
Create new revision based on a previous revision.

Parameters:
strUri - Uri
basedOnRevisionNumber - Number of revision on which the new revision is based
newRevisionDescriptor - New revision descriptor
revisionContent - Node revision content
Throws:
ObjectNotFoundException
AccessDeniedException
RevisionAlreadyExistException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
NodeNotVersionedException
VetoException

create

protected void create(SlideToken token,
                      java.lang.String strUri,
                      NodeRevisionDescriptor revisionDescriptor)
               throws ObjectNotFoundException,
                      AccessDeniedException,
                      RevisionAlreadyExistException,
                      LinkedObjectNotFoundException,
                      ServiceAccessException,
                      RevisionDescriptorNotFoundException,
                      ObjectLockedException,
                      NodeNotVersionedException,
                      VetoException
Create new branch-less revision descriptor. This is used only by DeltaV to store the VHR-specific descriptor at revision 0.0, or to backup the properties of a VCR for checkout/uncheckout at revision 0.0.

Throws:
ObjectNotFoundException
AccessDeniedException
RevisionAlreadyExistException
LinkedObjectNotFoundException
ServiceAccessException
RevisionDescriptorNotFoundException
ObjectLockedException
NodeNotVersionedException
VetoException

setDefaultProperties

protected void setDefaultProperties(ObjectNode associatedObject,
                                    NodeRevisionDescriptor revisionDescriptor)
Set default properties for a revision descriptors.


invokeInterceptors

protected void invokeInterceptors(SlideToken token,
                                  NodeRevisionDescriptors revisionDescriptors,
                                  NodeRevisionDescriptor revisionDescriptor,
                                  NodeRevisionContent revisionContent,
                                  int type)
                           throws AccessDeniedException,
                                  ObjectNotFoundException,
                                  LinkedObjectNotFoundException,
                                  ObjectLockedException,
                                  ServiceAccessException
Invoke content interceptors.

Throws:
AccessDeniedException
ObjectNotFoundException
LinkedObjectNotFoundException
ObjectLockedException
ServiceAccessException

redirectUri

protected java.lang.String redirectUri(java.lang.String uri)

redirectLatestRevisionNumber

protected NodeRevisionNumber redirectLatestRevisionNumber(java.lang.String uri)