Package com.vst.dto

Examples of com.vst.dto.BuildingObjectTypeDTO


    private List<?> groupByRegionNames(List<BuildingObject> buildingObjects){

      List buildingObjectTypes = new ArrayList();
        String currentRegion = "";
        BuildingObjectTypeDTO buildingObjectTypeDTO = new BuildingObjectTypeDTO();

        /////

        for (int i = 0; i < buildingObjects.size(); i++) {
            BuildingObject buildingObject = (BuildingObject) buildingObjects.get(i);
            if (i == 0 || (!currentRegion.equals(buildingObject.getRegion()) && !(currentRegion == null) && !currentRegion.trim().equals(""))) {
                if (i != 0) {
                    buildingObjectTypes.add(buildingObjectTypeDTO);
                }
                buildingObjectTypeDTO = new BuildingObjectTypeDTO();
                currentRegion = buildingObject.getRegion();
                buildingObjectTypeDTO.setObjectType(currentRegion);

            }
            buildingObjectTypeDTO.getBuildingObjects().add(buildingObject);
        }
        buildingObjectTypeDTO.setObjectType(currentRegion);
        buildingObjectTypes.add(buildingObjectTypeDTO);

        return buildingObjectTypes;
    }
View Full Code Here


 
  private List<?> groupByRegionNames(List<BuildingObject> buildingObjects){

      List buildingObjectTypes = new ArrayList();
        String currentRegion = "";
        BuildingObjectTypeDTO buildingObjectTypeDTO = new BuildingObjectTypeDTO();

        /////

        for (int i = 0; i < buildingObjects.size(); i++) {
            BuildingObject buildingObject = (BuildingObject) buildingObjects.get(i);
            if (i == 0 || (!currentRegion.equals(buildingObject.getRegion()) && !(currentRegion == null) && !currentRegion.trim().equals(""))) {
                if (i != 0) {
                    buildingObjectTypes.add(buildingObjectTypeDTO);
                }
                buildingObjectTypeDTO = new BuildingObjectTypeDTO();
                currentRegion = buildingObject.getRegion();
                buildingObjectTypeDTO.setObjectType(currentRegion);

            }
            buildingObjectTypeDTO.getBuildingObjects().add(buildingObject);
        }
        buildingObjectTypeDTO.setObjectType(currentRegion);
        buildingObjectTypes.add(buildingObjectTypeDTO);

        return buildingObjectTypes;
    }
View Full Code Here

   //       }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;
View Full Code Here

    private List<?> groupByRegionNames(List<BuildingObject> buildingObjects){

      List buildingObjectTypes = new ArrayList();
        String currentRegion = "";
        BuildingObjectTypeDTO buildingObjectTypeDTO = new BuildingObjectTypeDTO();

        /////

        for (int i = 0; i < buildingObjects.size(); i++) {
            BuildingObject buildingObject = (BuildingObject) buildingObjects.get(i);
            if (i == 0 || (!currentRegion.equals(buildingObject.getRegion())
                && !(currentRegion == null) && !currentRegion.trim().equals(""))) {
                if (i != 0) {
                    buildingObjectTypes.add(buildingObjectTypeDTO);
                }
                buildingObjectTypeDTO = new BuildingObjectTypeDTO();
                currentRegion = buildingObject.getRegion();
                buildingObjectTypeDTO.setObjectType(currentRegion);

            }
            buildingObjectTypeDTO.getBuildingObjects().add(buildingObject);
        }
        buildingObjectTypeDTO.setObjectType(currentRegion);
        buildingObjectTypes.add(buildingObjectTypeDTO);

        return buildingObjectTypes;
    }
View Full Code Here

    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        List buildingObjects = buildingObjectManager.getBuildingObjects(null);
        List buildingObjectTypes = new ArrayList();
        String currentRegion = "";
        BuildingObjectTypeDTO buildingObjectTypeDTO = new BuildingObjectTypeDTO();

        for (int i = 0; i < buildingObjects.size(); i++) {
            BuildingObject buildingObject = (BuildingObject) buildingObjects.get(i);

            List objectConstructionList = buildingObject.getConstructionTypes();
            for (int j = 0; j < objectConstructionList.size(); j++) {
                ObjectConstruction objectConstruction = (ObjectConstruction) objectConstructionList.get(j);
                if (objectConstruction.getDescription() != null) {
                    objectConstruction.setBriefDescription(objectConstruction.getDescription().length() > 10 ? objectConstruction.getDescription().substring(0, 9) + "..." : objectConstruction.getDescription());
                }
            }
        }


        for (int i = 0; i < buildingObjects.size(); i++) {
            BuildingObject buildingObject = (BuildingObject) buildingObjects.get(i);
            if (i == 0 || (!currentRegion.equals(buildingObject.getRegion()) && !(currentRegion == null) && !currentRegion.trim().equals(""))) {
                if (i != 0) {
                    buildingObjectTypes.add(buildingObjectTypeDTO);
                }
                buildingObjectTypeDTO = new BuildingObjectTypeDTO();
                currentRegion = buildingObject.getRegion();
                buildingObjectTypeDTO.setObjectType(currentRegion);
            }
            buildingObjectTypeDTO.getBuildingObjects().add(buildingObject);


        }
        buildingObjectTypeDTO.setObjectType(currentRegion);
        buildingObjectTypes.add(buildingObjectTypeDTO);

        httpServletRequest.setAttribute("buildingObjectTypes", buildingObjectTypes);

View Full Code Here

TOP

Related Classes of com.vst.dto.BuildingObjectTypeDTO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.