// }else{
// List buildingObjectTypes = (List) WebContextFactory.get()
// .getHttpServletRequest().getSession()
// .getAttribute("buildingObjectTypes");
// }
BuildingObjectTypeDTO bo = null;
List<BuildingObject> bolist = null;
// Second level selected
if (itemType.equals("buildingObject") || itemType.equals("list")) {
for (Object o : buildingObjectTypes) {
bo = (BuildingObjectTypeDTO) o;
bolist = bo.getBuildingObjects();
for (BuildingObject b : bolist) {
if (b.getObjectId().intValue() == (itemId.intValue())) {
String name = b.getName().trim().toUpperCase();
int k = name.length() / 15;
int l = 0;
if (k <= 1) {
l = name.length();
} else {
l = 14;
}
if (name.trim().equals(""))
outputHtml += "N/A";
else
outputHtml += "<a target='mainFrame' href='buildingObjects.html?type=one&objectId="+b.getObjectId().intValue()+"' >"+name.substring(0, l)
+ "</a><br/><span class='next-step' onclick=\"location.href='index.html'\" ></span></div><ul class='number-list'>";
mainMenu += "<li class='add3'><a target='mainFrame'"+
"href='/vst/objectConstructions.html?form=new&objectId="+b.getObjectId()+"'> </a></li>";
List bol = b.getConstructionTypes();
if (bol.size() > 0) {
for (Object o2 : bol) {
ObjectConstruction ct = (ObjectConstruction) o2;
name = ct.getConstructionType().getName();
k = name.length() / 15;
l = 0;
if (k <= 1) {
l = name.length();
} else {
l = 14;
}
if (name.trim().equals(""))
name = "N/A";
else
name = name.substring(0, l);
outputHtml += "<li onclick=\"ajaxSampleSvc.expandTreeItem('constructionType',";
outputHtml += ct.getTypeId().intValue();
outputHtml += ", processItemChange);\" >";
outputHtml += "<a target='mainFrame' href='objectConstructions.html?objectId=";
outputHtml += ct.getObjectId() + "&typeId=" + ct.getTypeId();
outputHtml += "'>";
outputHtml += name;
outputHtml += "<span>"+ct.getNumberInObject()+"</span>";
outputHtml += "</a>";
// reverse expandable value
// b.setExpandable(!b.isExpandable());
// break;
outputHtml += "</li>";
}
} else {
outputHtml += "<li><a>No items present</a></li><br>";
}
}else if(itemType.equals("list")){
String name = b.getName().trim().toUpperCase();
int k = name.length() / 15;
int l = 0;
if (k <= 1) {
l = name.length();
} else {
l = 14;
}
if (name.trim().equals(""))
outputHtml += "N/A";
else
outputHtml += "<li onclick=\"ajaxSampleSvc.expandTreeItem('buildingObject',"+b.getObjectId()+", processItemChange);\">";
outputHtml += "<a target='mainFrame' href='buildingObjects.html?type=one&objectId="+b.getObjectId()+"' >"+name.substring(0, l);
outputHtml += "</a></li>";
} /*
* else { String name = b.getName().trim(); int k =
* name.length() / 15; int l = 0; if (k <= 1) { l =
* name.length(); } else { l = 14; } outputHtml +=
* "<span onclick=\"ajaxSampleSvc.expandTreeItem('buildingObject',"
* ; outputHtml += b.getObjectId().intValue(); outputHtml +=
* ", processItemChange);\" >"; outputHtml +=
* b.getName().trim().substring(0, l); outputHtml +=
* "</span>"; outputHtml +=
* "<br><span class='next-step'></span>";
*
* }
*/
}
}
// Set changed item.
WebContextFactory.get().getHttpServletRequest().getSession()
.setAttribute("buildingObject", buildingObjectTypes);
} else if (itemType.equals("constructionType")) {
for (Object o : buildingObjectTypes) {
bo = (BuildingObjectTypeDTO) o;
bolist = bo.getBuildingObjects();
for (BuildingObject b : bolist) {
List ctl = b.getConstructionTypes();
if (ctl.size() > 0) {
for (Object o2 : ctl) {
ObjectConstruction ct = (ObjectConstruction) o2;
if (isConstructionTypeSelected(ct, itemId)) {
String name = b.getName().trim().toUpperCase();
int k = name.length() / 15;
int l = 0;
if (k <= 1) {
l = name.length();
} else {
l = 14;
}
outputHtml += "<a target='mainFrame' href='buildingObjects.html?type=one&objectId="+b.getObjectId().intValue()+"' >"+name.substring(0, l)
+ "</a><br/><span class='next-step' onclick=\"location.href='index.html'\" ></span>";
//outputHtml += "<a href='index.html'>"+name.substring(0, l);
//outputHtml += "</a><br/><span class='next-step'></span>";
outputHtml += "<a href=\"objectConstructions.html?objectId=";
outputHtml += ct.getObjectId().intValue()+ "&typeId=";
outputHtml += ct.getTypeId().intValue();
outputHtml += "\" target='mainFrame' > ";
outputHtml += ct.getConstructionType().getName() +"</a><br/>";
//outputHtml += "<a href='buildingObjects.html?type=one&objectId=";
//outputHtml += ct.getObjectId();
//outputHtml += "' target='mainFrame' >";
//outputHtml += ct.getConstructionType().getName();
outputHtml += "<span onclick=\"ajaxSampleSvc.expandTreeItem('buildingObject',";
outputHtml += ct.getObjectId().intValue();
outputHtml += ", processItemChange);\" class='next-step'></span></div><ul class='number-list'>";
mainMenu += "<li class='add3'><a target='mainFrame'"+
"href='/vst/objectConstructions.html?form=new&objectId="+b.getObjectId()+"'> </a></li>";
List eol = ct.getConstructionExamples();
if(eol.size() > 0){
for (Object ob : eol) {
ConstructionExample ce = (ConstructionExample) ob;
name = ce.getExampleName();
k = name.length() / 15;
l = 0;
if (k <= 1) {
l = name.length();
} else {
l = 14;
}
if (name.trim().equals(""))
name = "N/A";
else
name = name.substring(0, l);
outputHtml += "<li onclick=\"ajaxSampleSvc.expandTreeItem('constructionExample',";
outputHtml += ce.getExampleId().intValue() ;
outputHtml += ", processItemChange);\" >" ;
outputHtml += "<a target='mainFrame' href='constructionExamples.html?exampleId=";
outputHtml += ce.getExampleId();
outputHtml += "&typeId=";
outputHtml += ce.getObjectConstructionId();
outputHtml += "&objectId="+ct.getObjectId()+"'";
outputHtml += ce.getObjectId();
outputHtml += "'>";
outputHtml += name;
outputHtml += "</a>";
}
}//else{
// outputHtml += "<li><a>No items present</a></li><br>";
//}
}
}
}
}
}
} else if (itemType.equals("constructionExample")
|| (itemType.equals("exampleEdit"))) {
for (Object o : buildingObjectTypes) {
bo = (BuildingObjectTypeDTO) o;
bolist = bo.getBuildingObjects();
for (BuildingObject b : bolist) {
List ctl = b.getConstructionTypes();
if (ctl.size() > 0) {
for (Object o2 : ctl) {
ObjectConstruction ct = (ObjectConstruction) o2;