|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--vc.xml.dom.VersionHandler
VersionHandler is the class of XML subsystem which deals with the maintainance of different versions of a file using an XML file for version content of each file.
Constructor Summary | |
VersionHandler(java.lang.String fileName)
Constructs and Initializes the objects from the parameters |
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. |
java.lang.String |
getLatestVersionName()
Gets the name of the latest version of a file. |
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)
Checks if a file exists with the file name given in constructor. |
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 |
run()
This method saves the DOM document by deleating to saveXML() method. |
void |
saveChanges()
Saves the changes made to the DOM document in a separate thread by creating a new thread |
void |
saveXML()
Saves the existing DOM document into an XML file named after the object's filename variable, using the serialization of DOM document |
void |
setLatestVersionName(java.lang.String versionName)
Sets the name of the latest version of a file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VersionHandler(java.lang.String fileName) throws java.lang.Throwable
fileName
- to initialize the field fileNameMethod Detail |
public void loadXmlFile(boolean referenceXML) throws java.lang.Throwable
loadXmlFile
in interface VersionHandling
referenceXML
- if true loads the XMl document from the regference
file or else from the file given in the constructorpublic void saveXML() throws java.lang.Throwable
saveXML
in interface VersionHandling
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
createNewVersion
in interface VersionHandling
contentFileName
- XML file name which is to be updated with the
data of new versiomnallLinesOfText
- XML data with wich the new version is to be createdversionName
- Name of the new versionversionComment
- Comment or Disription for the new versionversionCreator
- Name of the user creating this new versionbirthTime
- timestamp of the creation of this new versionpublic void addAnotherVersion(java.lang.String allLinesOfText, java.lang.String versionName, java.lang.String versionComment, java.lang.String versionCreator) throws java.lang.Throwable
addAnotherVersion
in interface VersionHandling
allLinesOfText
- XML data with wich the new version is to be createdversionName
- Name of the new versionversionComment
- Comment or Disription for the new versionversionCreator
- Name of the user creating this new versionpublic void removeVersion(java.lang.String versionName) throws java.lang.Throwable
removeVersion
in interface VersionHandling
allLinesOfText
- XML data with wich the new version is to be createdversionName
- Name of the new versionversionComment
- Comment or Disription for the new versionversionCreator
- Name of the user creating this new versionpublic VersionData[] getMultipleVersionContent(java.lang.String fileID, java.lang.String[] versionNames) throws java.lang.Throwable
getMultipleVersionContent
in interface VersionHandling
fileID
- ID of the file whose version data is to wantedversionNames
- Names of the versions whose content is wantedpublic java.lang.String getLatestVersionName() throws java.util.NoSuchElementException
public void setLatestVersionName(java.lang.String versionName) throws java.util.NoSuchElementException
public void saveChanges()
public void run()
run
in interface java.lang.Runnable
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |