org.apache.lenya.cms.rc
Interface RCML


public interface RCML

An object of this class handles the revisions of a node. The node is passed as a parameter so an RCML object can be shared between sessions for synchronization purposes.


Field Summary
static short ci
          ci Checkin
static short co
          co Checkout
 
Method Summary
 void checkIn(Node node, boolean backup, boolean newVersion)
          Check the RCML in.
 void checkOut(Node node)
          Check the RCML out with restriction to the current session.
 void checkOut(Node node, boolean restrictedToSession)
          Check the RCML out.
 void copyFrom(Node node, Node otherNode)
           
 boolean delete()
          delete the RCML file and the directory if this one is empty
 void deleteRevisions()
          Delete all revisions.
 java.util.Vector getBackupEntries()
          get all backup entries
 java.lang.String[] getBackupsTime()
          get the time's value of the backups
 java.util.Vector getEntries()
          get all check in and check out
 CheckInEntry getLatestCheckInEntry()
          get the latest check in
 CheckOutEntry getLatestCheckOutEntry()
          get the latest check out
 RCMLEntry getLatestEntry()
          get the latest entry (a check out or check in)
 boolean isCheckedOut()
           
 boolean isCheckedOutBySession(Session session)
           
 boolean isDirty()
          Check if the document is dirty
 void makeBackup(long time)
          Creates a backup.
 void pruneEntries()
          Prune the list of entries and delete the corresponding backups.
 void restoreBackup(Node node, long time)
          Restores a backup.
 

Field Detail

co

static final short co
co Checkout

See Also:
Constant Field Values

ci

static final short ci
ci Checkin

See Also:
Constant Field Values
Method Detail

checkIn

void checkIn(Node node,
             boolean backup,
             boolean newVersion)
             throws RevisionControlException
Check the RCML in.

Parameters:
node - The node.
backup - If a backup shall be created.
newVersion - If the revision number should be increased.
Throws:
RevisionControlException - if an error occurs.

checkOut

void checkOut(Node node)
              throws RevisionControlException
Check the RCML out with restriction to the current session.

Parameters:
node - The node.
Throws:
RevisionControlException - if an error occurs.

checkOut

void checkOut(Node node,
              boolean restrictedToSession)
              throws RevisionControlException
Check the RCML out.

Parameters:
node - The node.
restrictedToSession - If only the current session may check the node in, or all sessions belonging to this user.
Throws:
RevisionControlException - if an error occurs.

getLatestCheckOutEntry

CheckOutEntry getLatestCheckOutEntry()
                                     throws RevisionControlException
get the latest check out

Returns:
CheckOutEntry The entry of the check out
Throws:
RevisionControlException - if an error occurs

getLatestCheckInEntry

CheckInEntry getLatestCheckInEntry()
                                   throws RevisionControlException
get the latest check in

Returns:
CheckInEntry The entry of the check in
Throws:
RevisionControlException - if an error occurs

getLatestEntry

RCMLEntry getLatestEntry()
                         throws RevisionControlException
get the latest entry (a check out or check in)

Returns:
RCMLEntry The entry of the check out/in
Throws:
RevisionControlException - if an error occurs

getEntries

java.util.Vector getEntries()
                            throws RevisionControlException
get all check in and check out

Returns:
Vector of all check out and check in entries in this RCML-file
Throws:
RevisionControlException - if an error occurs

getBackupEntries

java.util.Vector getBackupEntries()
                                  throws java.lang.Exception
get all backup entries

Returns:
Vector of all entries in this RCML-file with a backup
Throws:
java.lang.Exception - if an error occurs

makeBackup

void makeBackup(long time)
                throws RevisionControlException
Creates a backup.

Parameters:
time - The time.
Throws:
RevisionControlException

restoreBackup

void restoreBackup(Node node,
                   long time)
                   throws RevisionControlException
Restores a backup.

Parameters:
node - The node to restore the backup to.
time - The time.
Throws:
RevisionControlException

pruneEntries

void pruneEntries()
                  throws java.lang.Exception
Prune the list of entries and delete the corresponding backups. Limit the number of entries to the value maximalNumberOfEntries (2maxNumberOfRollbacks(configured)+1)

Throws:
java.lang.Exception - if an error occurs

isDirty

boolean isDirty()
Check if the document is dirty

Returns:
boolean dirty

getBackupsTime

java.lang.String[] getBackupsTime()
                                  throws java.lang.Exception
get the time's value of the backups

Returns:
String[] the times
Throws:
java.lang.Exception - if an error occurs

delete

boolean delete()
delete the RCML file and the directory if this one is empty

Returns:
boolean true, if the file was deleted

deleteRevisions

void deleteRevisions()
                     throws RevisionControlException
Delete all revisions.

Throws:
RevisionControlException - if an error occurs.

copyFrom

void copyFrom(Node node,
              Node otherNode)
              throws RevisionControlException
Parameters:
node - The target node.
otherNode - The source node.
Throws:
RevisionControlException - if an error occurs.

isCheckedOut

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

isCheckedOutBySession

boolean isCheckedOutBySession(Session session)
                              throws RevisionControlException
Parameters:
session - The session.
Returns:
if the RCML is checked out by this session.
Throws:
RevisionControlException - if an error occurs.


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