org.apache.lenya.cms.rc
Class RevisionController

java.lang.Object
  extended by org.apache.lenya.cms.rc.RevisionController

public class RevisionController
extends java.lang.Object

Controller for the reserved check-in, check-out, the backup versions and the rollback.


Field Summary
static java.lang.String systemUsername
           
 
Constructor Summary
RevisionController()
          Creates a new RevisionController object.
RevisionController(java.lang.String rootDir)
          Creates a new RevisionController object.
RevisionController(java.lang.String rcmlDirectory, java.lang.String backupDirectory, java.lang.String rootDirectory)
          Creates a new RevisionController object.
 
Method Summary
 boolean canCheckOut(java.lang.String source, java.lang.String identity)
          Deprecated. please use canCheckOut(Document, String) Checks if a source can be checked out.
 void deleteRCML(java.lang.String filename)
          Deprecated. please use deleteRCML(Document) delete the rcml file
 void deleteRevisions(java.lang.String filename)
          Deprecated. please use deleteRevisions(Document) delete the revisions
 java.io.File getBackupFile(long time, java.lang.String filename)
          Deprecated. getBackupFile(long, Document) Get the file of a backup version
 java.lang.String getBackupFilename(long time, java.lang.String filename)
          Get the absolute path of a backup version
 RCML getRCML(java.lang.String source)
          Deprecated. please use getRCML(Document doc) Get the RCML File for the file source
 long reservedCheckIn(java.lang.String destination, java.lang.String identity, boolean backup)
          Deprecated. please use reservedCheckIn(Document, String, boolean) Try to make a reserved check in of the file destination for a user with identity. A backup copy can be made.
 java.io.File reservedCheckOut(java.lang.String source, java.lang.String identity)
          Deprecated. reservedCheckOut(Document, String) Try to make a reserved check out of the file source for a user with identity
 long rollback(java.lang.String destination, java.lang.String identity, boolean backupFlag, long time)
          Deprecated. please use rollback(Document, String, boolean, long) Rolls back to the given point in time.
 java.lang.String toString()
          Shows Configuration
 void undoCheckIn(long time, java.lang.String destination)
          Delete the check in and roll back the file to the backup at time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

systemUsername

public static final java.lang.String systemUsername
See Also:
Constant Field Values
Constructor Detail

RevisionController

public RevisionController()
Creates a new RevisionController object.


RevisionController

public RevisionController(java.lang.String rcmlDirectory,
                          java.lang.String backupDirectory,
                          java.lang.String rootDirectory)
Creates a new RevisionController object.

Parameters:
rcmlDirectory - The directory for the RCML files
backupDirectory - The directory for the backup versions
rootDirectory - The publication directory

RevisionController

public RevisionController(java.lang.String rootDir)
Creates a new RevisionController object.

Parameters:
rootDir - The publication directory
Method Detail

toString

public java.lang.String toString()
Shows Configuration

Overrides:
toString in class java.lang.Object
Returns:
String The rcml directory, the backup directory, the publication directory

getRCML

public RCML getRCML(java.lang.String source)
             throws java.io.FileNotFoundException,
                    java.io.IOException,
                    java.lang.Exception
Deprecated. please use getRCML(Document doc) Get the RCML File for the file source

Parameters:
source - The path of the file from the publication.
Returns:
RCML The corresponding RCML file.
Throws:
java.io.FileNotFoundException - if an error occurs
java.io.IOException - if an error occurs
java.lang.Exception - if an error occurs

reservedCheckOut

public java.io.File reservedCheckOut(java.lang.String source,
                                     java.lang.String identity)
                              throws java.lang.Exception
Deprecated. reservedCheckOut(Document, String) Try to make a reserved check out of the file source for a user with identity

Parameters:
source - The filename of the file to check out
identity - The identity of the user
Returns:
File File to check out
Throws:
java.lang.Exception - if an error occurs

canCheckOut

public boolean canCheckOut(java.lang.String source,
                           java.lang.String identity)
                    throws java.lang.Exception
Deprecated. please use canCheckOut(Document, String) Checks if a source can be checked out.

Parameters:
source - The source.
identity - The identity who requests checking out.
Returns:
A boolean value.
Throws:
java.lang.Exception - when something went wrong.

reservedCheckIn

public long reservedCheckIn(java.lang.String destination,
                            java.lang.String identity,
                            boolean backup)
                     throws FileReservedCheckInException,
                            java.lang.Exception
Deprecated. please use reservedCheckIn(Document, String, boolean) Try to make a reserved check in of the file destination for a user with identity. A backup copy can be made.

Parameters:
destination - The file we want to check in
identity - The identity of the user
backup - if true, a backup will be created, else no backup will be made.
Returns:
long The time.
Throws:
FileReservedCheckInException - if the document couldn't be checked in (for instance because it is already checked out by someone other ...)
java.lang.Exception - if other problems occur

getBackupFilename

public java.lang.String getBackupFilename(long time,
                                          java.lang.String filename)
Get the absolute path of a backup version

Parameters:
time - The time of the backup
filename - The path of the file from the {publication}
Returns:
String The absolute path of the backup version

getBackupFile

public java.io.File getBackupFile(long time,
                                  java.lang.String filename)
Deprecated. getBackupFile(long, Document) Get the file of a backup version

Parameters:
time - The time of the backup
filename - The path of the file from the {publication}
Returns:
File The file of the backup version

rollback

public long rollback(java.lang.String destination,
                     java.lang.String identity,
                     boolean backupFlag,
                     long time)
              throws FileReservedCheckInException,
                     FileReservedCheckOutException,
                     java.io.FileNotFoundException,
                     java.lang.Exception
Deprecated. please use rollback(Document, String, boolean, long) Rolls back to the given point in time.

Parameters:
destination - File which will be rolled back
identity - The identity of the user
backupFlag - If true, a backup of the current version will be made before the rollback
time - The time point of the desired version
Returns:
long The time of the version to roll back to.
Throws:
FileReservedCheckInException - if the current version couldn't be checked in again
FileReservedCheckOutException - if the current version couldn't be checked out
java.io.FileNotFoundException - if a file couldn't be found
java.lang.Exception - if another problem occurs

undoCheckIn

public void undoCheckIn(long time,
                        java.lang.String destination)
                 throws java.lang.Exception
Delete the check in and roll back the file to the backup at time

Parameters:
time - The time point of the back version we want to retrieve
destination - The File for which we want undo the check in
Throws:
java.lang.Exception - FileNotFoundException if the back version or the current version couldn't be found

deleteRevisions

public void deleteRevisions(java.lang.String filename)
                     throws RevisionControlException
Deprecated. please use deleteRevisions(Document) delete the revisions

Parameters:
filename - of the document
Throws:
RevisionControlException - when somthing went wrong

deleteRCML

public void deleteRCML(java.lang.String filename)
                throws RevisionControlException
Deprecated. please use deleteRCML(Document) delete the rcml file

Parameters:
filename - of the document
Throws:
RevisionControlException - if something went wrong


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