NamedNodeMap attrs = widgetNode.getAttributes();
// version
Node versionAttr = attrs.getNamedItem("version");
if (versionAttr == null) {
throw new ValidationException("VALIDATION_CONFIGXML_MISSING_VERSION");
}
_widgetConfig.setVersion(getTextValue(versionAttr));
// id
Node idAttr = attrs.getNamedItem("id");
if (idAttr != null) {
_widgetConfig.setID(getTextValue(idAttr));
}
// rim:header
Node headerAttr = attrs.getNamedItem("rim:header");
if (headerAttr != null) {
String header = getTextValue(headerAttr);
int index = header.indexOf(':');
if (index > 0) {
_widgetConfig.addHeader(
header.substring(0, index), header.substring(index + 1, header.length()));
}
}
// rim:backButton
Node backButtonAttr = attrs.getNamedItem("rim:backButton");
if (backButtonAttr != null) {
_widgetConfig.setBackButtonBehaviour(getTextValue(backButtonAttr));
}
// Parsing access nodes and feature nodes
Hashtable<WidgetAccess, Vector<WidgetFeature>> accessTable = new Hashtable<WidgetAccess, Vector<WidgetFeature>>();
// Populate "LOCAL" access list
String localpath = "WidgetConfig.WIDGET_LOCAL_DOMAIN";
boolean hasFeatures = false;
WidgetAccess localAccess = new WidgetAccess(localpath, true);
Vector<WidgetFeature> featureList = getFeatureListFromNode(widgetNode);
if (featureList.size() > 0) {
hasFeatures = true;
}
accessTable.put(localAccess, featureList);
// Populate all "access" nodes access lists
for (int i = 0; i < list.getLength(); i++) {
Node node = list.item(i);
if (node.getNodeName().equalsIgnoreCase("access")
&& node.getNodeType() == Node.ELEMENT_NODE) {
NamedNodeMap nodeAttributes = node.getAttributes();
// uri information
Node uriNode = nodeAttributes.getNamedItem("uri");
String uri = "";
if (uriNode != null) {
uri = uriNode.getNodeValue();
}
// subdomains information
Node subdomainsNode = nodeAttributes.getNamedItem("subdomains");
boolean subdomains = false;
if (subdomainsNode != null) {
if (subdomainsNode.getNodeValue().equalsIgnoreCase("true")) {
subdomains = true;
}
}
if (!uri.trim().equals("*")) {
WidgetAccess access = new WidgetAccess(uri, subdomains);
// Find all sub-feature nodes
if (uri.length() > 0) {
featureList = getFeatureListFromNode(node);
if (featureList.size() > 0) {
hasFeatures = true;
}
accessTable.put(access, featureList);
}
} else {
_widgetConfig.setMultiAccess(true);
// no features allowed for *
if (getFeatureListFromNode(node).size() > 0) {
throw new ValidationException("EXCEPTION_CONFIGXML_FEATURES_NOT_ALLOWED");
}
}
}
}
if (!hasFeatures) {