vc.xml.dom
Interface VersionHandling

All Known Implementing Classes:
VersionHandler

public interface VersionHandling

VersionHandling is the interface of XML subsystem which deals with the maintainance of different versions of a file using an XML file for version content of each file. This interface standardizes the methods to be used for the classes implementing the the logic for implementing the version handling according to the needed algorithm.


Method Summary
 void addAnotherVersion(java.lang.String allLinesOfText, java.lang.String versionName, java.lang.String versionComment, java.lang.String versionCreator)
          Obtains the reference DOM document from the reeference XML file and then creates the new version in the document by appending the nex XML content to the existing one.
 void createNewVersion(java.lang.String contentFileName, java.lang.String allLinesOfText, java.lang.String versionName, java.lang.String versionComment, java.lang.String versionCreator, java.lang.String birthTime)
          Obtains the reference DOM document from the reeference XML file and then creates the document from the scratch.
 VersionData[] getMultipleVersionContent(java.lang.String fileID, java.lang.String[] versionNames)
          Gets the XMl content of multiple versions of a file in the XML document.
 void loadXmlFile(boolean referenceXML)
          Loads the XML document which is the baseline for doing the future XML operations on the DOM document.
 void removeVersion(java.lang.String versionName)
          Obtains the reference DOM document from the reeference XML file and then removes the content of the specified version from the XML document.
 void saveXML()
          Saves the existing DOM document into an XML file named after the object's filename variable, using the serialization of DOM document
 

Method Detail

loadXmlFile

public void loadXmlFile(boolean referenceXML)
                 throws java.lang.Throwable
Loads the XML document which is the baseline for doing the future XML operations on the DOM document.
Parameters:
referenceXML - if true loads the XMl document from the reference file or else from the file given in the constructor

saveXML

public void saveXML()
             throws java.lang.Throwable
Saves the existing DOM document into an XML file named after the object's filename variable, using the serialization of DOM document

createNewVersion

public void createNewVersion(java.lang.String contentFileName,
                             java.lang.String allLinesOfText,
                             java.lang.String versionName,
                             java.lang.String versionComment,
                             java.lang.String versionCreator,
                             java.lang.String birthTime)
                      throws java.lang.Throwable
Obtains the reference DOM document from the reeference XML file and then creates the document from the scratch. It creates the xml document based upon the data sent as parameters and then saves that document.
Parameters:
contentFileName - XML file name which is to be updated with the data of new versiomn
allLinesOfText - XML data with wich the new version is to be created
versionName - Name of the new version
versionComment - Comment or Disription for the new version
versionCreator - Name of the user creating this new version
birthTime - timestamp of the creation of this new version

addAnotherVersion

public void addAnotherVersion(java.lang.String allLinesOfText,
                              java.lang.String versionName,
                              java.lang.String versionComment,
                              java.lang.String versionCreator)
                       throws java.lang.Throwable
Obtains the reference DOM document from the reeference XML file and then creates the new version in the document by appending the nex XML content to the existing one. It creates the xml document based upon the data sent as parameters and then saves that document. Also it wont let the existing XML data get lost.
Parameters:
allLinesOfText - XML data with wich the new version is to be created
versionName - Name of the new version
versionComment - Comment or Disription for the new version
versionCreator - Name of the user creating this new version

removeVersion

public void removeVersion(java.lang.String versionName)
                   throws java.lang.Throwable
Obtains the reference DOM document from the reeference XML file and then removes the content of the specified version from the XML document.
Parameters:
allLinesOfText - XML data with wich the new version is to be created
versionName - Name of the new version
versionComment - Comment or Disription for the new version
versionCreator - Name of the user creating this new version

getMultipleVersionContent

public VersionData[] getMultipleVersionContent(java.lang.String fileID,
                                               java.lang.String[] versionNames)
                                        throws java.lang.Throwable
Gets the XMl content of multiple versions of a file in the XML document.
Parameters:
fileID - ID of the file whose version data is to wanted
versionNames - Names of the versions whose content is wanted
Returns:
Returns the XMl content of multiple versions of a file with array of strings where each array element is the content of a aricular version