public void populateVersionTable() throws SamFSException { CCActionTableModel model = getTableModel(VERSION_TABLE); model.clear(); HttpSession session = RequestManager.getRequestContext().getRequest().getSession(); HashMap myHashMap = (HashMap) session.getAttribute(Constants.SessionAttributes.VERSION_HIGHLIGHT); if (myHashMap == null) { // Start parsing the XML file try { SAXHandler.parseIt(); } catch (SamFSException ex) { // Failed to parse version highlight XML file SamUtil.setErrorAlert( getParentViewBean(), ServerCommonViewBeanBase.CHILD_COMMON_ALERT, "VersionHighlight.error", ex.getSAMerrno(), ex.getMessage(), ""); return; } // Retrieve the HashMap after parsing the XML file myHashMap = SAXHandler.getHashMap(); // Save hashMap into Session session.setAttribute(Constants.SessionAttributes.VERSION_HIGHLIGHT, myHashMap); } for (int i = 0; i < myHashMap.size(); i++) { if (i > 0) { model.appendRow(); } HighlightInfo highlightInfo = (HighlightInfo) myHashMap.get(new Integer(i)); String featureType = highlightInfo.getFeatureType(); featureType = featureType == null ? "" : featureType; // pre-populate blank images into the model, // overwrite them later if necessary model.setValue("FirstImage", Constants.Image.ICON_BLANK); model.setValue("SecondImage", Constants.Image.ICON_BLANK); model.setValue("ThirdImage", Constants.Image.ICON_BLANK); model.setValue("SupportText", ""); // populate the feature name if (featureType.equals("summary")) { model.setValue( "NameText", new NonSyncStringBuffer("<b>") .append(SamUtil.getResourceString(highlightInfo.getFeatureName())) .append("</b>") .toString()); } else { String heading = "---- "; if (featureType.equals("detail")) { heading = "-- "; } model.setValue( "NameText", new NonSyncStringBuffer(heading) .append(SamUtil.getResourceString(highlightInfo.getFeatureName())) .toString()); model.setValue("SupportText", highlightInfo.getServerVersion()); String[] versionInfoArray = highlightInfo.getVersionInfo().split("###"); for (int j = 0; j < versionInfoArray.length; j++) { String[] versionInfo = versionInfoArray[j].split(","); if (versionInfo[0].equals("version.highlight.versionnumber.50")) { model.setValue("FirstImage", getImage(versionInfo[1])); } else if (versionInfo[0].equals("version.highlight.versionnumber.46")) { model.setValue("SecondImage", getImage(versionInfo[1])); model.setValue("FirstImage", Constants.Image.ICON_AVAILABLE); } else if (versionInfo[0].equals("version.highlight.versionnumber.45")) { model.setValue("ThirdImage", getImage(versionInfo[1])); model.setValue("FirstImage", Constants.Image.ICON_AVAILABLE); model.setValue("SecondImage", Constants.Image.ICON_AVAILABLE); } else { model.setValue("ThirdImage", Constants.Image.ICON_AVAILABLE); model.setValue("FirstImage", Constants.Image.ICON_AVAILABLE); model.setValue("SecondImage", Constants.Image.ICON_AVAILABLE); } } } } }