XML handling by Deploy
Deploy needs to create a settings file in the xml
fileformat for each application.
The creation of these files involves the ability to manipulate the xml
datastructure, create new xml
instances based on previous ones and save the result to a file.
The existing XMLTree
class (under dk.netarkivet.common.utils
) did not support these abilities, and it would require a larger structural change of the class to meet these demands.
A new class (dk.netarkivet.deploy.XmlStructure
) has therefore been implemented to meet the requests for handling the xml
datastructure.
This class uses the com.dom4j
structure for handling the xml
datastructure.
The dk.netarkivet.deploy.XmlStructure
class has the ability to inherit and overwrite, which is used in the deploy configuration structure.
The abilty to inherit is implemented as creating a new instance identical to a current instance, thus inheritance can only occour during creation of a new instance of this class.
The overwrite function merges the current !XmlStructure with a new tree.
This means that the leafs which are present in both new tree and the current one, the value in the current leaf will be overwritten by the leaf on the new tree.
Branches which only exists in the new tree will be appended to the current tree.
The branches in both trees are recursively overwritten