if (path == null) {
throw new ProcessingException("getXML: Path is required");
}
if (path.startsWith("/") == false) path = '/' + path;
DocumentFragment frag = null;
if ( path.equals("/") ) {
// get all: first authentication then application
frag = this.authContext.getXML("/authentication");
if (frag != null) {
// now add root node authentication
Node root = frag.getOwnerDocument().createElementNS(null, "authentication");
Node child;
while (frag.hasChildNodes() == true) {
child = frag.getFirstChild();
frag.removeChild(child);
root.appendChild(child);
}
frag.appendChild(root);
}
if (this.applicationName != null) {
// join
DocumentFragment appFrag = this.authContext.getXML("/applications/" + this.applicationName);
if (appFrag != null) {
// now add root node application
Node root = appFrag.getOwnerDocument().createElementNS(null, "application");
Node child;
while (appFrag.hasChildNodes() ) {
child = appFrag.getFirstChild();
appFrag.removeChild(child);
root.appendChild(child);
}
appFrag.appendChild(root);
if (frag == null) {
frag = appFrag;
} else {
while (appFrag.hasChildNodes() ) {
child = appFrag.getFirstChild();
appFrag.removeChild(child);
child = frag.getOwnerDocument().importNode(child, true);
frag.appendChild(child);
}
}
}