Ontimize Document Management 0.035EN

com.ontimize.dms.jcr
Interface JcrNode

All Superinterfaces:
java.lang.Comparable, JcrLockable, JcrWrapper
All Known Implementing Classes:
JcrNodeBase

public interface JcrNode
extends JcrWrapper, JcrLockable, java.lang.Comparable

Wrappers a Node node. Supported node structure:

BASE

    KEYS

        NODES

Since:
23/12/2008 Insert, get saved properties, remove., 24/12/2008 Dates, Locks (Non concurrent)., 29/12/2008 Concurrent locks in the same session., 30/12/2008 Node versioning., 14/01/2009 Node versioning refactoring., 14/01/2009 Node listing., 15/01/2009 Node versioning with creation date., 16/01/2009 Node locking in directories., 22/01/2009 Added support to insert a complete directory path., 26/01/2009 Added access control., 04/02/2009 Base node can't be changed., 05/02/2009 Move across root nodes., 19/02/2009 Keys node optional., 23/02/2009 Changed base methods. Property type required., 04/03/2009 Attached file name., 11/03/2009 Node links., 18/03/2009 Multiple sessions refactoring., 27/03/2009 Refactoring to allow jcr:content node with the file stream., 01/04/2009 Added support to copy nodes. Refactoring paste., 02/04/2009 Deleted keys related methods., 07/04/2009 Link node with target name., 19/05/2009 Disable permissions., 20/05/2009 Set key node type., 10/06/2009 Removed permissions in nodes., 15/06/2009 Changed children listing., 16/06/2009 Allows BytesBlock to update file stream in node., 19/06/2009 Refactoring. Implements JcrLockable. Changes in node status., 26/06/2009 Root, keys and base are not mutable nodes., 17/07/2009 Setting node types. Node properties in a internal fields node., 22/07/2009 Remove links before remove a node. nt:linkedFile restriction., 21/08/2009 Save thumbnail in the fields node., 20/10/2009 Compute children nodes., 14/12/2009 Adds fields when create a new version., 05/02/2010 Lock files without length property in modifications., 01/10/2010 Removed Apache Jackrabbit references., 08/10/2010 Refactoring to allow configurable session saves., 15/10/2010 Changed version wrapper class load., 22/10/2010 Refactoring: changed node creation.

Field Summary
static java.lang.String AUTO_NAMES
           
static java.lang.String BASE
           
static java.lang.String CHILDREN
           
static java.lang.String DATA
           
static java.lang.String DATE_INSERT
           
static java.lang.String DATE_UPDATE
           
static java.lang.String DEEP
           
static java.lang.String DESCRIPTION
           
static java.lang.String DOCUMENT
           
static java.lang.String FIELDS
           
static java.lang.String FILE
           
static java.lang.String JCR_CONTENT
           
static java.lang.String KEYS
           
static java.lang.String LAST_MODIFIED
           
static java.lang.String LINK
           
static java.lang.String LINK_TARGET
           
static java.lang.String MIME_TYPE
           
static java.lang.String NAME
           
static java.lang.String NODE_FIELDS
           
static java.lang.String NODE_FILE
           
static java.lang.String NODE_FOLDER
           
static java.lang.String NODE_LINK
           
static java.lang.String NODE_STATUS
           
static java.lang.String NODE_STATUS_DATE
           
static java.lang.String NODE_STATUS_USER
           
static java.lang.String NT_UNSTRUCTURED
           
static java.lang.String PARENT_FIELDS
           
static java.lang.String PATH
           
static java.lang.String PROPERTY_STATUS
           
static java.lang.String PROPERTY_STATUS_DATE
           
static java.lang.String PROPERTY_STATUS_USER
           
static java.lang.String STREAM
           
static java.lang.String STREAM_DATE
           
static java.lang.String STREAM_LENGTH
           
static java.lang.String STREAM_OPENED
           
static java.lang.String STREAM_STATUS
           
static java.lang.String STREAM_STATUS_DATE
           
static java.lang.String STREAM_STATUS_USER
           
static java.lang.String STREAM_VERSION
           
static java.lang.String THUMBNAIL
           
static java.lang.String TITLE
           
static java.lang.String TYPE
           
static java.lang.String TYPE_BASE
           
static java.lang.String TYPE_DIR
           
static java.lang.String TYPE_FILE
           
static java.lang.String TYPE_KEYS
           
static java.lang.String TYPE_LINK
           
static java.lang.String USER_INSERT
           
static java.lang.String USER_UPDATE
           
 
Method Summary
 void checkEditable()
           
 JcrNode clone(Node node)
           
 Node getBase()
          Returns the node base for the node and the current session request.
 JcrNodeIterator getChildren(java.util.Map fields, boolean recursive)
          Return a iterator with the children filtered with the given Map.
 long getChildrenSize()
          Returns the children node list size.
 java.lang.String getFile()
          Returns the attached file name.
 java.lang.String getName()
          Returns the node name.
 Node getNode()
          Returns the internal JCR node interface.
 Type getNodeType()
           
 java.lang.String getPath()
          Returns the path of the current node.
 java.util.Map getPathTypes()
          Returns the path types of the current node path.
 java.util.Map getPathTypes(java.util.List types, java.util.Map alias)
          Returns the path types of the current node path.
 JcrProperty getProperty()
          Returns a property handler for the current node.
 JcrStream getStream()
          Returns the saved stream in the node.
 JcrStream getStream(boolean data)
          Returns the saved stream in the node and / or its properties.
 JcrVersion getVersion()
          Returns a version handle for the current node.
 boolean hasNodeType()
           
 JcrNode insert(java.util.Map info, java.util.Map properties)
          Insert a new child node to current node.
 boolean isBase()
          Check if the current node is in the base path of the repository.
 boolean isEditable()
          Check if the current node can be changed.
 boolean isKeys()
          Check if the current node is a key node.
 boolean isLeaf()
          Checks if there is a ending node.
 boolean isLink()
          Check if the current node is a link to another.
 boolean isRoot()
           
 JcrNode paste(java.util.Map info, java.util.Map properties, boolean copy)
          Moves the current node to the desired target.
 JcrNode remove()
          Removes the current node.
 JcrNode rename(java.lang.String name)
          Changes the name of the current node.
 JcrNode update(java.util.Map info, boolean version)
          Set new information to the base version of the current node.
 
Methods inherited from interface com.ontimize.dms.jcr.JcrWrapper
getInnerSession, getInternal, getSession, getWrapper, save
 
Methods inherited from interface com.ontimize.dms.jcr.JcrLockable
isLocked, lock, unlock, unlock, unlock, unlock
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

NODE_FOLDER

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

NODE_FILE

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

NODE_LINK

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

NODE_FIELDS

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

DOCUMENT

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

FIELDS

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

CHILDREN

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

DEEP

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

BASE

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

KEYS

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

PATH

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

NAME

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

FILE

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

LINK

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

LINK_TARGET

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

TITLE

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

DESCRIPTION

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

TYPE

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

STREAM

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

STREAM_LENGTH

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

STREAM_DATE

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

STREAM_VERSION

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

THUMBNAIL

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

NODE_STATUS

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

NODE_STATUS_USER

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

NODE_STATUS_DATE

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

STREAM_STATUS

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

STREAM_STATUS_USER

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

STREAM_STATUS_DATE

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

STREAM_OPENED

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

USER_INSERT

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

DATE_INSERT

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

USER_UPDATE

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

DATE_UPDATE

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

PROPERTY_STATUS

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

PROPERTY_STATUS_USER

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

PROPERTY_STATUS_DATE

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

DATA

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

LAST_MODIFIED

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

MIME_TYPE

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

AUTO_NAMES

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

PARENT_FIELDS

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

TYPE_BASE

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

TYPE_KEYS

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

TYPE_FILE

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

TYPE_LINK

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

TYPE_DIR

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

JCR_CONTENT

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

NT_UNSTRUCTURED

static final java.lang.String NT_UNSTRUCTURED
See Also:
Constant Field Values
Method Detail

getBase

Node getBase()

Returns the node base for the node and the current session request.

Returns:
The internal JCR node base.

getNode

Node getNode()

Returns the internal JCR node interface.

Returns:
Returns the internal JCR node interface.

getName

java.lang.String getName()
                         throws RepositoryException

Returns the node name.

Returns:
Current node name.
Throws:
RepositoryException - if JCR exception is thrown.

getFile

java.lang.String getFile()
                         throws RepositoryException

Returns the attached file name.

Note: File name can be different of current node name.

Returns:
Attached file name.
Throws:
RepositoryException - if JCR exception is thrown.

getPath

java.lang.String getPath()
                         throws RepositoryException

Returns the path of the current node.

Returns:
Current node path.
Throws:
RepositoryException - if JCR exception is thrown.

getPathTypes

java.util.Map getPathTypes()
                           throws RepositoryException

Returns the path types of the current node path.
Parse: base, keys, path, name and file of the current node.

Returns:
Map with base, keys, path, name and file.
Throws:
RepositoryException - if JCR exception is thrown.

getPathTypes

java.util.Map getPathTypes(java.util.List types,
                           java.util.Map alias)
                           throws RepositoryException

Returns the path types of the current node path.
Parse: base, keys, path, name and file of the current node.

Parameters:
types - Path types to return.
alias - map with alternative keys.
Returns:
Map with base, keys, path, name and file.
Throws:
RepositoryException - if JCR exception is thrown.

getNodeType

Type getNodeType()
                 throws RepositoryException
Throws:
RepositoryException

getChildrenSize

long getChildrenSize()
                     throws RepositoryException

Returns the children node list size.

Returns:
Children node list size. Returns -1 if the node is a leaf.
Throws:
RepositoryException - if JCR exception ocurrs.

isLeaf

boolean isLeaf()
               throws LockException,
                      RepositoryException

Checks if there is a ending node.

Returns:
True if this is a ending node.
Throws:
LockException - if the current node is locked.
RepositoryException - if JCR exception ocurrs.

isRoot

boolean isRoot()
               throws RepositoryException
Throws:
RepositoryException

isBase

boolean isBase()
               throws RepositoryException

Check if the current node is in the base path of the repository.

Returns:
True is this node is in the base path.
Throws:
RepositoryException - if JCR exception ocurrs.

isKeys

boolean isKeys()
               throws RepositoryException

Check if the current node is a key node.

Returns:
True is this node is a key node.
Throws:
RepositoryException - if JCR exception ocurrs.

isLink

boolean isLink()
               throws RepositoryException

Check if the current node is a link to another.

Returns:
True if the current node is a link.
Throws:
RepositoryException - if JCR exception ocurrs.

isEditable

boolean isEditable()
                   throws RepositoryException

Check if the current node can be changed. (System nodes root, keys and base can be changed.)

Returns:
True if the node can be changed.
Throws:
RepositoryException

checkEditable

void checkEditable()
                   throws RepositoryException
Throws:
RepositoryException

hasNodeType

boolean hasNodeType()
                    throws RepositoryException
Throws:
RepositoryException

getStream

JcrStream getStream()
                    throws LockException,
                           RepositoryException

Returns the saved stream in the node.

Returns:
Stream handler for current node.
Throws:
LockException - if the current node is locked.
RepositoryException - if JCR exception ocurrs.

getStream

JcrStream getStream(boolean data)
                    throws LockException,
                           RepositoryException

Returns the saved stream in the node and / or its properties.

Parameters:
data - True returns the stream data and related properties.
False to return the stream related properties.
Returns:
Stream handler for current node.
Throws:
LockException - if the current node is locked.
RepositoryException - if JCR exception ocurrs.

getProperty

JcrProperty getProperty()
                        throws RepositoryException

Returns a property handler for the current node.

Returns:
Property handler for current node.
Throws:
RepositoryException - if JCR exception ocurrs.

getVersion

JcrVersion getVersion()
                      throws RepositoryException

Returns a version handle for the current node.

Returns:
Version handler for current node. Null if the node is not versionable.
Throws:
RepositoryException - if JCR exception ocurrs.

getChildren

JcrNodeIterator getChildren(java.util.Map fields,
                            boolean recursive)
                            throws RepositoryException

Return a iterator with the children filtered with the given Map.

Parameters:
fields - List only the nodes with the current keys/values.
recursive - Search child nodes recursive.
Returns:
Iterator with the children list.
Throws:
RepositoryException - if JCR exception ocurrs.

insert

JcrNode insert(java.util.Map info,
               java.util.Map properties)
               throws RepositoryException

Insert a new child node to current node.

Support to insert complete directories path.

Parameters:
info - New node information
properties - Additional properties to new nodes.
Returns:
The new child node
Throws:
RepositoryException - if JCR exception ocurrs.
java.lang.IllegalArgumentException - if any information parameter is missing.

update

JcrNode update(java.util.Map info,
               boolean version)
               throws LockException,
                      RepositoryException

Set new information to the base version of the current node.

Parameters:
info - Node information
Returns:
The current node
Throws:
LockException - if the current node is locked.
java.lang.IllegalArgumentException - if any information parameter is missing.
RepositoryException - if JCR exception ocurrs.

paste

JcrNode paste(java.util.Map info,
              java.util.Map properties,
              boolean copy)
              throws LockException,
                     RepositoryException

Moves the current node to the desired target.

Recursive

The target must exists.

Parameters:
info - Node to paste information
properties - Additional properties to the target node.
Returns:
Current node.
Throws:
LockException - if the current node is locked.
RepositoryException - if JCR exception ocurrs.

rename

JcrNode rename(java.lang.String name)
               throws LockException,
                      RepositoryException

Changes the name of the current node.

Parameters:
name - New node name
Returns:
Current node.
Throws:
LockException - if the current node is locked.
RepositoryException - if JCR exception ocurrs.

remove

JcrNode remove()
               throws LockException,
                      RepositoryException

Removes the current node.

If the current node is a file, remove all links to current node.

Returns:
Current node.
Throws:
LockException - if the current node is locked.
RepositoryException - if JCR exception ocurrs.

clone

JcrNode clone(Node node)
              throws RepositoryException
Throws:
RepositoryException

Ontimize Document Management