Ontimize Document Management 0.035EN

com.ontimize.dms.jcr
Class JcrVersionBase

java.lang.Object
  extended by com.ontimize.dms.jcr.JcrWrapperAbstract
      extended by com.ontimize.dms.jcr.JcrWrapperPropertyAbstract
          extended by com.ontimize.dms.jcr.JcrVersionBase
All Implemented Interfaces:
JcrVersion, JcrWrapper, JcrWrapperProperty

public abstract class JcrVersionBase
extends JcrWrapperPropertyAbstract
implements JcrVersion


Field Summary
static java.lang.Number BASE
           
static java.util.List DEFAULT_PROPERTIES
           
 
Fields inherited from class com.ontimize.dms.jcr.JcrWrapperAbstract
MSG_CREATE_NM
 
Constructor Summary
JcrVersionBase(JcrNode node)
           
 
Method Summary
protected abstract  Node createInternalNode(JcrNode node)
           
protected  NodeManager createNodeManager(Node node)
          Creates a NodeManager with the current configuration.
protected  JcrStream createStream(java.lang.Number version)
           
protected  java.lang.String createStreamClassName()
           
 Node getNode(java.lang.Number version)
          Searchs in current node the version node in the version history.
 JcrStream getStream(java.lang.Number version)
          Returns the saved stream in the version node.
 JcrStream getStream(java.lang.Number version, boolean data)
          Returns the saved stream in the version node.
protected  boolean hasVersionHistory()
           
protected abstract  boolean isSkipFirstEnabled()
           
 java.lang.Number last()
          Searchs in node version history the last version ID.
 EntityResult list(java.lang.Number version, java.util.List keys, java.util.Map alias)
          Version information on the current node.
 java.lang.Number next()
          Calculates the next version ID.
 JcrNode remove(java.lang.Number version)
          Removes a existing version of the current node, or current node if version is null.
 java.lang.Number size()
          Count saved versions on this node.
 
Methods inherited from class com.ontimize.dms.jcr.JcrWrapperPropertyAbstract
getProperty, hasProperty, setProperty
 
Methods inherited from class com.ontimize.dms.jcr.JcrWrapperAbstract
createNodeManager, getConverter, getInnerSession, getInternal, getSession, getWrapper, isSaveInSessionEnabled, save, save, setConverter, setInnerSession, setInternal, setSaveInSession, setSession, setWrapper
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ontimize.dms.jcr.JcrWrapperProperty
getProperty, hasProperty, setProperty
 
Methods inherited from interface com.ontimize.dms.jcr.JcrWrapper
getInnerSession, getInternal, getSession, getWrapper, save
 

Field Detail

BASE

public static final java.lang.Number BASE

DEFAULT_PROPERTIES

public static final java.util.List DEFAULT_PROPERTIES
Constructor Detail

JcrVersionBase

public JcrVersionBase(JcrNode node)
               throws RepositoryException
Throws:
RepositoryException
Method Detail

isSkipFirstEnabled

protected abstract boolean isSkipFirstEnabled()

createInternalNode

protected abstract Node createInternalNode(JcrNode node)
                                    throws RepositoryException
Throws:
RepositoryException

getNode

public Node getNode(java.lang.Number version)
             throws RepositoryException
Description copied from interface: JcrVersion

Searchs in current node the version node in the version history.

Specified by:
getNode in interface JcrVersion
Parameters:
version - Version number ID
Returns:
Node version if found.
If node version ID is invalid, returns null.
If node is a directory, returns null.
If version is null, returns the base node.
Throws:
RepositoryException - if JCR exception ocurrs.

getStream

public JcrStream getStream(java.lang.Number version)
                    throws RepositoryException
Description copied from interface: JcrVersion

Returns the saved stream in the version node.

Specified by:
getStream in interface JcrVersion
Parameters:
version - Version number ID.
Returns:
Stream handler for selected version node.
Stream handler for root version if version is null.
Throws:
RepositoryException - if JCR exception ocurrs.

getStream

public JcrStream getStream(java.lang.Number version,
                           boolean data)
                    throws RepositoryException
Description copied from interface: JcrVersion

Returns the saved stream in the version node.

Specified by:
getStream in interface JcrVersion
Parameters:
version - Version number ID.
data - True returns the stream data and related properties.
False to return the stream related properties.
Returns:
Stream handler for selected version node.
Stream handler for root version if version is null.
Throws:
RepositoryException - if JCR exception ocurrs.

createStreamClassName

protected java.lang.String createStreamClassName()

createStream

protected JcrStream createStream(java.lang.Number version)
                          throws RepositoryException
Throws:
RepositoryException

list

public EntityResult list(java.lang.Number version,
                         java.util.List keys,
                         java.util.Map alias)
                  throws RepositoryException
Description copied from interface: JcrVersion

Version information on the current node.

alias Map can be null.

Specified by:
list in interface JcrVersion
Parameters:
version - Version number ID.
keys - List with keys to return.
alias - Map with keys conversion rules.
Returns:
ResultEntidad with version information.
Throws:
RepositoryException - if JCR exception ocurrs.

last

public java.lang.Number last()
                      throws RepositoryException
Description copied from interface: JcrVersion

Searchs in node version history the last version ID.

Specified by:
last in interface JcrVersion
Returns:
Number with the last ID in the version history.
Throws:
RepositoryException - if JCR exception ocurrs.

next

public java.lang.Number next()
                      throws RepositoryException
Description copied from interface: JcrVersion

Calculates the next version ID. Searchs the last saved ID and increments a unit.

Specified by:
next in interface JcrVersion
Returns:
Number with the last ID in the version history.
Throws:
RepositoryException

size

public java.lang.Number size()
                      throws RepositoryException
Description copied from interface: JcrVersion

Count saved versions on this node.

Specified by:
size in interface JcrVersion
Returns:
Number of saved versions of this node.
Throws:
RepositoryException - if JCR exception ocurrs.

remove

public JcrNode remove(java.lang.Number version)
               throws LockException,
                      RepositoryException
Description copied from interface: JcrVersion

Removes a existing version of the current node, or current node if version is null.

Specified by:
remove in interface JcrVersion
Parameters:
version - To delete.
Returns:
Current node
Throws:
LockException - if the current node is locked.
RepositoryException - if JCR exception ocurrs.

hasVersionHistory

protected boolean hasVersionHistory()
                             throws RepositoryException
Throws:
RepositoryException

createNodeManager

protected NodeManager createNodeManager(Node node)
                                 throws RepositoryException
Description copied from class: JcrWrapperAbstract
Creates a NodeManager with the current configuration.

Overrides:
createNodeManager in class JcrWrapperAbstract
Parameters:
node - Wrappered node.
Returns:
NodeManager with the current configuration
Throws:
RepositoryException

Ontimize Document Management