for(Element widgetEle : widgetEles) {
String nameW = XMLUtil.getAttribute(widgetEle, "name");
String pathW = XMLUtil.getAttribute(widgetEle, "path");
String cssClassW = XMLUtil.getAttribute(widgetEle, "cssClass");
String cacheW = XMLUtil.getAttribute(widgetEle, "cache");
WidgetConfig widgetConfig = new WidgetConfig(nameW, pathW, cssClassW, cacheW);
//
Element titleEle = XMLUtil.getChildElement(widgetEle, "title");
if(titleEle!=null) {
String titleW = XMLUtil.getValue(titleEle);
widgetConfig.setTitle(titleW);
}
//
Element prefsEle = XMLUtil.getChildElement(widgetEle, "prefs");
if(prefsEle!=null) {
List<Element> prefEles = XMLUtil.getChildElements(prefsEle);
for(Element prefEle : prefEles) {
String key = XMLUtil.getName(prefEle);
String value = XMLUtil.getValue(prefEle);
widgetConfig.addPref(key, value);
}
}
pageConfig.add(nameP, widgetConfig);
}
}