if (!foundInfinite) {
if (!fatherAsso.isEmpty()) {
boolean showChildren = false;
Iterator iFaterAsso = fatherAsso.iterator();
while (iFaterAsso.hasNext()) {
Association asso = (Association) iFaterAsso.next();
// if path is equal to the destination path, it is a backward association. we are only displaying
// the forward associations here
if (!path.equals(asso.getDestinationPath())) {
if (!paths.contains(asso.getDestinationPath())) {
showChildren = true;
break;
}
}
}
if (showChildren) {
associationTreePart.append("<a onclick=\"showHideCommon('y_").append(
associationTreeBean.getAssoIndex()).append(
"');showHideCommon('xminus_").append(
associationTreeBean.getAssoIndex()).append(
"');showHideCommon('xplus_").append(
associationTreeBean.getAssoIndex()).append(
"');\">").append(
"<img src=\"../resources/images/icon-tree-minus.gif\"").append(
"id=\"xminus_").append(associationTreeBean.getAssoIndex()).append(
"\" style=\"margin-right:2px;\" />").append(
"<img src=\"../resources/images/icon-tree-plus.gif\"").append(
"id=\"xplus_").append(associationTreeBean.getAssoIndex()).append(
"\" style=\"margin-right:2px;display:none;\" /></a>");
}
} else {
associationTreePart.append("<img src=\"../resources/images/spacer.gif\" style=\"width:15px;\" />");
}
} else {
associationTreePart.append("<img src=\"../resources/images/spacer.gif\" style=\"width:15px;\" />");
}
if (fatherResourceType.equals("collection")) {
associationTreePart.append("<img src=\"../resources/images/icon-folder-small.gif\" style=\"margin-right:2px;\" />");
} else {
associationTreePart.append("<img src=\"../resources/images/editshred.png\" style=\"margin-right:2px;\" />");
}
//associationTreePart += "<a title=\"" + path + "\" href=\"resource.jsp?path=" + calculateRelativePath(path) + "\">";
String tempPath = path;
if (tempPath != null) {
tempPath = tempPath.replace("&", "%26");
}
associationTreePart.append("<a title=\"").append(path).append(
"\" href=\"../resources/resource.jsp?region=region3&item=resource_browser_menu&viewType=std&path=").append(
tempPath).append("\">");
String pathSmall = path;
if (pathSmall != null) {
if (associationTreeBean.getAssoType().equals(CommonConstants.ASSOCIATION_TYPE01)) {
if (pathSmall.length() >= 108) {
pathSmall = pathSmall.substring(0, 50) + " .... " +
pathSmall.substring(pathSmall.length() - 50, pathSmall.length());
}
} else {
if (pathSmall.length() >= 68) {
pathSmall = pathSmall.substring(0, 30) + " .... " +
pathSmall.substring(pathSmall.length() - 30, pathSmall.length());
}
}
}
if (foundInfinite) {
associationTreePart.append(pathSmall).append("(infinite loop..)");
} else {
associationTreePart.append(pathSmall);
}
associationTreePart.append("</a></li>");
if (!associationTreeBean.getAssoType().equals(CommonConstants.ASSOCIATION_TYPE01))
associationTreePart.append("<li class=\"second\">").append(
tmpAsso.getAssociationType()).append("</li>");
associationTreePart.append("</ul></div>");
if (!foundInfinite && !fatherAsso.isEmpty()) {
associationTreePart.append("<div class=\"child-objects\" id=\"y_").append(
associationTreeBean.getAssoIndex()).append("\">");
Iterator iFaterAsso = fatherAsso.iterator();
while (iFaterAsso.hasNext()) {
Association asso = (Association) iFaterAsso.next();
// if path is equal to the destination path, it is a backward association. we are only displaying
// the forward associations here
if (!path.equals(asso.getDestinationPath())) {
if (!paths.contains(asso.getDestinationPath())) {
associationTreePart.append(createAssociationTree(asso, associationTreeBean, registry));
}
}
}
associationTreePart.append("</div>");