@Test public void testNothingAboveBranches() throws Exception { new OfficeListTag().getAboveBranches(result, null, null, null, null); Assert.assertEquals("", result.toString()); }
void getAboveBranches(XmlBuilder html, List<OfficeBO> officeList, String regional, String subregional, String area) { if (null != officeList) { XmlBuilder regionalHtml = null; XmlBuilder subregionalHtml = null; XmlBuilder areaHtml = null; for (int i = 0; i < officeList.size(); i++) { OfficeBO office = officeList.get(i); if (office.getOfficeLevel() == OfficeLevel.HEADOFFICE) { html.singleTag("br"); html.startTag("span", "class", "fontnormalbold"); html.append(getLink(office.getOfficeId(), office.getOfficeName())); html.singleTag("br"); html.endTag("span"); } else if (office.getOfficeLevel() == OfficeLevel.REGIONALOFFICE) { regionalHtml = processOffice(regionalHtml, office, regional); } else if (office.getOfficeLevel() == OfficeLevel.SUBREGIONALOFFICE) { subregionalHtml = processOffice(subregionalHtml, office, subregional); } else if (office.getOfficeLevel() == OfficeLevel.AREAOFFICE) { areaHtml = processOffice(areaHtml, office, area); } } outputLevel(html, regionalHtml); outputLevel(html, subregionalHtml); outputLevel(html, areaHtml); } }
OfficeListTag extends BodyTagSupport { void getAboveBranches(XmlBuilder html, List<OfficeBO> officeList, String regional, String subregional, String area) { if (null != officeList) { XmlBuilder regionalHtml = null; XmlBuilder subregionalHtml = null; XmlBuilder areaHtml = null; for (int i = 0; i < officeList.size(); i++) { OfficeBO office = officeList.get(i); if (office.getOfficeLevel() == OfficeLevel.HEADOFFICE) { html.singleTag("br"); html.startTag("span", "class", "fontnormalbold"); html.append(getLink(office.getOfficeId(), office.getOfficeName())); html.singleTag("br"); html.endTag("span"); } else if (office.getOfficeLevel() == OfficeLevel.REGIONALOFFICE) { regionalHtml = processOffice(regionalHtml, office, regional); } else if (office.getOfficeLevel() == OfficeLevel.SUBREGIONALOFFICE) { subregionalHtml = processOffice(subregionalHtml, office, subregional); } else if (office.getOfficeLevel() == OfficeLevel.AREAOFFICE) { areaHtml = processOffice(areaHtml, office, area); } } outputLevel(html, regionalHtml); outputLevel(html, subregionalHtml); outputLevel(html, areaHtml); } } }
OfficeListTag extends BodyTagSupport { void getAboveBranches(XmlBuilder html, List<OfficeBO> officeList, String regional, String subregional, String area) { if (null != officeList) { XmlBuilder regionalHtml = null; XmlBuilder subregionalHtml = null; XmlBuilder areaHtml = null; for (int i = 0; i < officeList.size(); i++) { OfficeBO office = officeList.get(i); if (office.getOfficeLevel() == OfficeLevel.HEADOFFICE) { html.singleTag("br"); html.startTag("span", "class", "fontnormalbold"); html.append(getLink(office.getOfficeId(), office.getOfficeName())); html.singleTag("br"); html.endTag("span"); } else if (office.getOfficeLevel() == OfficeLevel.REGIONALOFFICE) { regionalHtml = processOffice(regionalHtml, office, regional); } else if (office.getOfficeLevel() == OfficeLevel.SUBREGIONALOFFICE) { subregionalHtml = processOffice(subregionalHtml, office, subregional); } else if (office.getOfficeLevel() == OfficeLevel.AREAOFFICE) { areaHtml = processOffice(areaHtml, office, area); } } outputLevel(html, regionalHtml); outputLevel(html, subregionalHtml); outputLevel(html, areaHtml); } } OfficeListTag();  OfficeListTag(String action, String method, String flow); }
OfficeListTag extends BodyTagSupport { void getAboveBranches(XmlBuilder html, List<OfficeBO> officeList, String regional, String subregional, String area) { if (null != officeList) { XmlBuilder regionalHtml = null; XmlBuilder subregionalHtml = null; XmlBuilder areaHtml = null; for (int i = 0; i < officeList.size(); i++) { OfficeBO office = officeList.get(i); if (office.getOfficeLevel() == OfficeLevel.HEADOFFICE) { html.singleTag("br"); html.startTag("span", "class", "fontnormalbold"); html.append(getLink(office.getOfficeId(), office.getOfficeName())); html.singleTag("br"); html.endTag("span"); } else if (office.getOfficeLevel() == OfficeLevel.REGIONALOFFICE) { regionalHtml = processOffice(regionalHtml, office, regional); } else if (office.getOfficeLevel() == OfficeLevel.SUBREGIONALOFFICE) { subregionalHtml = processOffice(subregionalHtml, office, subregional); } else if (office.getOfficeLevel() == OfficeLevel.AREAOFFICE) { areaHtml = processOffice(areaHtml, office, area); } } outputLevel(html, regionalHtml); outputLevel(html, subregionalHtml); outputLevel(html, areaHtml); } } OfficeListTag();  OfficeListTag(String action, String method, String flow); @Override int doStartTag(); String getActionName(); void setActionName(String actionName); String getMethodName(); void setMethodName(String methodName); String getOnlyBranchOffices(); void setOnlyBranchOffices(String onlyBranchOffices); String replaceSpaces(String officeName); String getFlowKey(); void setFlowKey(String flowKey); }
OfficeListTag extends BodyTagSupport { void getAboveBranches(XmlBuilder html, List<OfficeBO> officeList, String regional, String subregional, String area) { if (null != officeList) { XmlBuilder regionalHtml = null; XmlBuilder subregionalHtml = null; XmlBuilder areaHtml = null; for (int i = 0; i < officeList.size(); i++) { OfficeBO office = officeList.get(i); if (office.getOfficeLevel() == OfficeLevel.HEADOFFICE) { html.singleTag("br"); html.startTag("span", "class", "fontnormalbold"); html.append(getLink(office.getOfficeId(), office.getOfficeName())); html.singleTag("br"); html.endTag("span"); } else if (office.getOfficeLevel() == OfficeLevel.REGIONALOFFICE) { regionalHtml = processOffice(regionalHtml, office, regional); } else if (office.getOfficeLevel() == OfficeLevel.SUBREGIONALOFFICE) { subregionalHtml = processOffice(subregionalHtml, office, subregional); } else if (office.getOfficeLevel() == OfficeLevel.AREAOFFICE) { areaHtml = processOffice(areaHtml, office, area); } } outputLevel(html, regionalHtml); outputLevel(html, subregionalHtml); outputLevel(html, areaHtml); } } OfficeListTag();  OfficeListTag(String action, String method, String flow); @Override int doStartTag(); String getActionName(); void setActionName(String actionName); String getMethodName(); void setMethodName(String methodName); String getOnlyBranchOffices(); void setOnlyBranchOffices(String onlyBranchOffices); String replaceSpaces(String officeName); String getFlowKey(); void setFlowKey(String flowKey);  }