"/images/toggle_plus10.gif' id='").append(unit.getIdInternal()).append("'") .append("indexed='true' onClick=\"check(document.getElementById('aa")
"/images/toggle_plus10.gif' id='img").append(unit.getIdInternal()).append("'") .append("onClick=\"check(document.getElementById('aa")
    public String getUnits() throws FenixFilterException, FenixServiceException, ExcepcaoPersistencia {	StringBuilder buffer = new StringBuilder();	YearMonthDay currentDate = new YearMonthDay();	PartyTypeEnum partyType = null;	boolean writeSeparatorLine = false;	Map<PartyTypeEnum, Set<Unit>> allInstitutionSubUnits = getAllInstitutionSubUnits();	for (PartyTypeEnum partyTypeEnum : allInstitutionSubUnits.keySet()) {	    for (Unit unit : allInstitutionSubUnits.get(partyTypeEnum)) {		if (unit.getType() != null) {		    // Title		    if (partyType == null || !partyType.equals(unit.getType())) {			partyType = unit.getType();			buffer.append("<h3 class='mtop2'>").append(				this.bundle.getString(partyType.getName())).append("</h3>\r\n");		    }		} else if (unit.getType() == null) {		    // End Separator Line		    if (writeSeparatorLine == false) {			buffer				.append("<div class='mtop2' style='color: #aaa;'>- - - - - - - -</div>\r\n");			buffer.append("<h3 class='mtop2'>").append(				this.bundle.getString(PartyTypeEnum.UNKNOWN.getName())).append(				"</h3>\r\n");			writeSeparatorLine = true;		    }		}		buffer.append("<ul class='padding nobullet'>\r\n");		List<Unit> activeSubUnits = unit.getActiveSubUnits(currentDate,			AccountabilityTypeEnum.ORGANIZATIONAL_STRUCTURE);		Collections.sort(activeSubUnits, Unit.UNIT_COMPARATOR_BY_NAME);		if (!activeSubUnits.isEmpty()) {		    buffer.append("\t<li><img ").append("src='").append(getContextPath()).append(			    "/images/toggle_plus10.gif' id='").append(unit.getIdInternal()).append("'")			    .append("indexed='true' onClick=\"check(document.getElementById('aa")			    .append(unit.getIdInternal()).append("'),document.getElementById('").append(				    unit.getIdInternal()).append("'));return false;\"/> ");		    buffer.append("<a href='").append(getContextPath()).append(			    "/messaging/organizationalStructure/chooseUnit.faces?unitID=").append(			    unit.getIdInternal()).append("'>").append(unit.getNameWithAcronym()).append(			    "</a></li>\r\n");		} else {		    buffer.append("\t<li><a href='").append(getContextPath()).append(			    "/messaging/organizationalStructure/chooseUnit.faces?unitID=").append(			    unit.getIdInternal()).append("'>").append(unit.getNameWithAcronym()).append(			    "</a></li>\r\n");		}		getInstitutionSubUnitsTree(buffer, unit, activeSubUnits, currentDate);		buffer.append("</ul>\r\n");	    }	}	return buffer.toString();    }