LOG.debug("Recommendations count "
+ recommendations.getLength());
recommendationsArr = new Recommendation[recommendations
.getLength()];
for (int i = 0; i < recommendations.getLength(); i++) {
Recommendation recommendationObj = new Recommendation();
Element recommendationEl = (Element) recommendations
.item(i);
String rid = XMLParseUtil.getElementData(recommendationEl,
"id");
if (rid != null) {
recommendationObj.setRecommendationId(rid);
}
String text = XMLParseUtil.getElementData(recommendationEl,
"recommendation-text");
if (text != null) {
recommendationObj.setRecommendationText(text);
}
String code = XMLParseUtil.getElementData(recommendationEl,
"code");
if (code != null) {
recommendationObj.setRecommendationType(code);
}
NodeList recommenderNodes = recommendationEl
.getElementsByTagName("recommender");
if (recommenderNodes != null
&& recommenderNodes.getLength() > 0) {
Element recommenderEl = (Element) recommenderNodes
.item(0);
String recommenderId = XMLParseUtil.getElementData(
recommenderEl, "id");
if (recommenderId != null) {
recommendationObj.setRecommenderId(recommenderId);
}
String fname = XMLParseUtil.getElementData(
recommenderEl, "first-name");
if (fname != null) {
recommendationObj.setRecommenderFirstName(fname);
}
String lname = XMLParseUtil.getElementData(
recommenderEl, "last-name");
if (lname != null) {
recommendationObj.setRecommenderLastName(lname);
}
}
recommendationsArr[i] = recommendationObj;
}