org.apache.lenya.cms.repository
Interface Node

All Superinterfaces:
ContentHolder, MetaDataOwner, RepositoryItem

public interface Node
extends RepositoryItem, ContentHolder

A repository node is used to persist a Persistable.

Version:
$Id: Node.java 568271 2007-08-21 20:49:18Z andreas $

Field Summary
static java.lang.String IDENTIFIABLE_TYPE
          The identifiable type.
static java.lang.String LENYA_PROTOCOL
          The protocol with which to find Lenya nodes
 
Method Summary
 void checkin()
          Checks in the node.
 void checkout()
          Checks out the node with restriction to the current session..
 void checkout(boolean restrictedToSession)
          Checks out the node with the possibility to allow other sessions to check it in.
 void copyRevisionsFrom(Node source)
           
 void delete()
          Delete this node.
 boolean exists()
           
 void forceCheckIn()
          Checks in the node even if it is checked out by a different session.
 java.lang.String getCheckoutUserId()
           
 java.util.Collection getChildren()
           
 History getHistory()
           
 java.io.OutputStream getOutputStream()
           
 Persistable getPersistable()
           
 Session getSession()
           
 boolean isCheckedOut()
           
 boolean isCheckedOutBySession(Session session)
          Checks if the node is checked out by a certain session.
 boolean isCollection()
           
 boolean isLocked()
           
 void lock()
          Locks the node.
 void registerDirty()
          Registers the node as dirty.
 void registerRemoved()
          Registers the node as removed.
 void rollback(int revisionNumber)
           
 void setPersistable(Persistable persistable)
           
 void unlock()
          Unlocks the node.
 
Methods inherited from interface org.apache.lenya.cms.repository.ContentHolder
getContentLength, getInputStream, getLastModified, getMimeType, getSourceURI
 
Methods inherited from interface org.apache.lenya.cms.metadata.MetaDataOwner
getMetaData, getMetaDataNamespaceUris
 

Field Detail

LENYA_PROTOCOL

static final java.lang.String LENYA_PROTOCOL
The protocol with which to find Lenya nodes

See Also:
Constant Field Values

IDENTIFIABLE_TYPE

static final java.lang.String IDENTIFIABLE_TYPE
The identifiable type.

See Also:
Constant Field Values
Method Detail

getSession

Session getSession()
Specified by:
getSession in interface RepositoryItem
Returns:
The session this node belongs to.

exists

boolean exists()
               throws RepositoryException
Specified by:
exists in interface ContentHolder
Returns:
if the node exists.
Throws:
RepositoryException - if an error occurs.

isCollection

boolean isCollection()
                     throws RepositoryException
Returns:
if the node is a collection.
Throws:
RepositoryException - if an error occurs.

getChildren

java.util.Collection getChildren()
                                 throws RepositoryException
Returns:
children
Throws:
RepositoryException - if an error occurs.

getOutputStream

java.io.OutputStream getOutputStream()
                                     throws RepositoryException
Returns:
The output stream.
Throws:
RepositoryException - if the node does not exist.

lock

void lock()
          throws RepositoryException
Locks the node.

Throws:
RepositoryException - if an error occurs.

unlock

void unlock()
            throws RepositoryException
Unlocks the node.

Throws:
RepositoryException - if an error occurs.

checkout

void checkout()
              throws RepositoryException
Checks out the node with restriction to the current session..

Throws:
RepositoryException - if an error occurs.

checkout

void checkout(boolean restrictedToSession)
              throws RepositoryException
Checks out the node with the possibility to allow other sessions to check it in. This is a workaround for the current WYSIWYG editor infrastructure, which can't use the same session for opening and saving a node.

Parameters:
restrictedToSession - if the check-out is restricted to the current session.
Throws:
RepositoryException - if an error occurs.

checkin

void checkin()
             throws RepositoryException
Checks in the node.

Throws:
RepositoryException - if the node is not checked out or is checked out by a different session.

forceCheckIn

void forceCheckIn()
                  throws RepositoryException
Checks in the node even if it is checked out by a different session.

Throws:
RepositoryException - if the node is not checked out.

registerDirty

void registerDirty()
                   throws RepositoryException
Registers the node as dirty.

Throws:
RepositoryException - if an error occurs.

isCheckedOut

boolean isCheckedOut()
                     throws RepositoryException
Returns:
if the node is checked out.
Throws:
RepositoryException - if an error occurs.

getCheckoutUserId

java.lang.String getCheckoutUserId()
                                   throws RepositoryException
Returns:
The ID of the user who has checked out this node.
Throws:
RepositoryException - if the node is not checked out.

isCheckedOutBySession

boolean isCheckedOutBySession(Session session)
                              throws RepositoryException
Checks if the node is checked out by a certain session. We pass the session as a parameter to allow the check for nodes from the shared item store.

Parameters:
session - The session.
Returns:
if the node is checked out by a specific session.
Throws:
RepositoryException - if an error occurs.

copyRevisionsFrom

void copyRevisionsFrom(Node source)
                       throws RepositoryException
Parameters:
source - The node to copy the revisions from.
Throws:
RepositoryException - if an error occurs.

rollback

void rollback(int revisionNumber)
              throws RepositoryException
Parameters:
revisionNumber - The revision number to roll back.
Throws:
RepositoryException - if this revision doesn't exist.

isLocked

boolean isLocked()
                 throws RepositoryException
Returns:
if the node is locked.
Throws:
RepositoryException - if an error occurs.

registerRemoved

void registerRemoved()
                     throws RepositoryException
Registers the node as removed.

Throws:
RepositoryException - if an error occurs.

getHistory

History getHistory()
Returns:
The revision history.

delete

void delete()
            throws RepositoryException
Delete this node.

Throws:
RepositoryException - if an error occurs.

setPersistable

void setPersistable(Persistable persistable)
                    throws RepositoryException
Parameters:
persistable - The object which is persisted using the node.
Throws:
RepositoryException - if the node already has an item.

getPersistable

Persistable getPersistable()
Returns:
The object which is persisted using this node or null if no object is registered.


Copyright © 1999-2006 Apache Software Foundation. All Rights Reserved.