Package com.vst.model

Examples of com.vst.model.ConstructionExample


        request = newGet("/editConstructionExample.html");
        request.addParameter("exampleId", "1");

        mv = c.handleRequest(request, new MockHttpServletResponse());

        ConstructionExample constructionExample = (ConstructionExample) mv.getModel().get(c.getCommandName());
        assertNotNull(constructionExample);
        request = newPost("/editConstructionExample.html");
        super.objectToRequestParameters(constructionExample, request);

        // update the form's fields and add it back to the request
View Full Code Here



            boolean hasFatalError = false;
            try {
                ConstructionDefect constructionDefect = constructionDefectManager.getConstructionDefect(constructionDefectId);
                ConstructionExample constructionExample = constructionExampleManager.getConstructionExample(constructionDefect.getExampleId().toString());
                constructionExample.getExampleDefects().remove(constructionDefect);
                constructionExampleManager.saveConstructionExample(constructionExample);
                request.getSession().setAttribute("madeChanges", new Boolean(true));
                request.setAttribute("message", bundle.getString("constructionDefect.deleted"));

                ObjectConstruction objectConstruction = objectConstructionManager.getObjectConstruction(constructionExample.getObjectConstructionId().toString());
        try {
          doDeleteDefectSymbols(request, objectConstruction.getWayToDefectMap(),
              constructionDefect);
        } catch (IOException e) {

        }

            } catch (Exception e) {
                hasFatalError = true;
            }
            if (hasFatalError) {
                request.setAttribute("errormessage", bundle.getString("commonMistake"));
            }

        } else if (extractDefectTypeParam(request).equals("zone")) {

            ConstructionDefectZone constructionDefect = constructionDefectManager.getConstructionDefectZone(constructionDefectId);
            ConstructionExample constructionExample = constructionExampleManager.getConstructionExample(constructionDefect.getExampleId().toString());
            constructionExample.getExampleDefectsZone().remove(constructionDefect);
            constructionExampleManager.saveConstructionExample(constructionExample);
            constructionDefectManager.deleteConstructionDefectZone(constructionDefect);
            request.getSession().setAttribute("madeChanges", new Boolean(true));
            request.setAttribute("message", bundle.getString("constructionDefect.deleted"));
View Full Code Here

        List constructionDefects = new ArrayList();
        String exampleId = extractExampleIdParam(request);

        //creating refference for construction breadcrump
        if (extractExampleIdParam(request) != null) {
            ConstructionExample constructionExample = constructionExampleManager.getConstructionExampleForBreadCrump(request.getParameter("exampleId"));
            if (constructionExample != null) {
             request.getSession().setAttribute("constructionExampleName", (constructionExample.getExampleName() == null || constructionExample.getExampleName().trim().equals("")) ? String.valueOf(constructionExample.getExampleNumber()) : constructionExample.getExampleName());
             System.out.println("CENRef"+constructionExample.getObjectConstructionId()+constructionExample);
             request.getSession().setAttribute("constructionExampleNameRef", "constructionExamples.html?exampleId=" + constructionExample.getExampleId() + "&typeId=" + constructionExample.getObjectConstructionId());

             ObjectConstruction objectConstruction = objectConstructionManager.getObjectConstructionForBreadCrump(String.valueOf(constructionExample.getObjectConstructionId()));
             if (objectConstruction != null) {
              //objectConstructionManager.evict(objectConstruction);
               request.getSession().setAttribute("constructionTypeName", objectConstruction.getConstructionType().getName() );
               request.getSession().setAttribute("constructionTypeNameRef", "objectConstructions.html?typeId=" + objectConstruction.getTypeId() + "&objectId=" + objectConstruction.getObjectId());
               //Integer buildingObjectId = objectConstruction.getObjectId();
View Full Code Here

      HttpServletResponse response) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException {
      if (request.getParameter("elementCopy") != null) {


            ObjectConstruction objectConstruction = objectConstructionManager.getObjectConstruction(request.getParameter("typeId"));
            ConstructionExample constructionExample = constructionExampleManager.getConstructionExample(request.getParameter("id"));
            ConstructionExample newConstructionExample = (ConstructionExample) elementCopyManager.getNewObject(constructionExample);
            objectConstruction.getConstructionExamples().add(newConstructionExample);
            constructionExampleManager.saveConstructionExample(newConstructionExample);
            objectConstructionManager.saveObjectConstruction(objectConstruction);
            elementCopyManager.setNumZerro();
View Full Code Here

    private void processParamExampleId(HttpServletRequest request,
      HttpServletResponse response) {
      //creating refference for construction example
        if (request.getParameter("exampleId") != null) {
            ConstructionExample constructionExample = constructionExampleManager.getConstructionExampleForBreadCrump(request.getParameter("exampleId"));
            request.getSession().setAttribute("constructionExampleName", (constructionExample.getExampleName() == null || constructionExample.getExampleName().trim().equals("")) ? String.valueOf(constructionExample.getExampleRelativeNumber()) : constructionExample.getExampleName());
            System.out.println("CENRef2"+constructionExample.getObjectConstructionId()+constructionExample);
            request.getSession().setAttribute("constructionExampleNameRef", "constructionExamples.html?exampleId=" + constructionExample.getExampleId() + "&typeId=" + constructionExample.getObjectConstructionId());

        } else {
            //destroying construction example refference in breadcrump
            request.getSession().setAttribute("constructionExampleName", "");
            request.getSession().setAttribute("constructionExampleNameRef", "");
View Full Code Here

            HttpServletResponse response){
      String constructionExampleId = request.getParameter("id");
        ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources");
        boolean hasFatalError = false;
        try {
            ConstructionExample constructionExample = constructionExampleManager.getConstructionExample(constructionExampleId);
            ObjectConstruction objectConstruction = objectConstructionManager.getObjectConstruction(constructionExample.getObjectConstructionId().toString());
            objectConstruction.getConstructionExamples().remove(constructionExample);
            constructionExampleManager.removeConstructionExample(constructionExampleId);
            objectConstructionManager.saveObjectConstruction(objectConstruction);
            request.getSession().setAttribute("madeChanges", new Boolean(true));
            request.setAttribute("message", bundle.getString("constructionExample.deleted"));
View Full Code Here

              constructionExamples = constructionExampleManager.getConstructionExamplesForTable(new Integer(objectId), null);
            }
        }

        for (int i = 0; i < constructionExamples.size(); i++) {
            ConstructionExample constructionExample = (ConstructionExample) constructionExamples.get(i);
            constructionExample.setObjectConstructionId(new Integer(typeId));
            constructionExamples.set(i, constructionExample);
        }

//       constructionExamples = constructionExampleManager.fillRecomendedDangerCategories(constructionExamples));
//       constructionExamples = constructionExampleManager.fillConstractionExampleData(constructionExamples, new Integer(request.getParameter("exampleId") != null ? request.getParameter("exampleId") : "-1"));

        if (constructionExamples.size() > 0) {
            ConstructionExample firstExample = (ConstructionExample) constructionExamples.get(0);
            request.setAttribute("constructionType", selectedObjectConstruction.getConstructionType());
            request.setAttribute("material", selectedObjectConstruction.getConstructionType().getMaterial());
        }
        /*<input type="image"
                   src="<c:url value="/images/photo.png"/>"
View Full Code Here

            String strengthId = request.getParameter("id");
            ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources");
            boolean hasFatalError = false;
            try {
                Strength strength = strengthManager.getStrength(strengthId);
                ConstructionExample constructionExample = constructionExampleManager.getConstructionExample(strength.getExampleId().toString());
                constructionExample.getStrengthPoints().remove(strength);



                ObjectConstruction objectConstruction = objectConstructionManager.getObjectConstruction(constructionExample.getObjectConstructionId().toString());
                                                     try {

                                                         ObjectInputStream in = new ObjectInputStream(new FileInputStream(FileHelper.getCurrentPath(request)+objectConstruction.getWayToDefectMap()));
                                                         ObjectPicture objectPicture=new ObjectPicture();
                                                         try {
View Full Code Here

            "redirect:objectConstructions.html?objectId="
                + buildObjectId + "&typeId=" + typeId);
      }
     
      if (exampleNumber > 0) {
        ConstructionExample constructionExample = new ConstructionExample();
        // generating the unique number of construction
        constructionExample.setExampleName("конструкция 0");
        System.out.println(objectConstruction.getTypeId().intValue());
        Integer number = constructionExampleManager.getExampleNumberByConstructionObjectId(new Integer(objectConstruction.getTypeId()));
        constructionExample.setExampleRelativeNumber(number);
        DangerCategory dc = new DangerCategory();
        // 0 -default danger category means N/A
        dc.setDangerCategoryId(new Integer(0));
        constructionExample.setDangerCategory(dc);
        constructionExample.setObjectId(new Integer(buildObjectId));
        constructionExample.setBuildObjectId(new Integer(buildObjectId));
        constructionExample.setObjectConstructionId(objectConstruction.getTypeId());
        constructionExample.setConstructionType(objectConstruction.getConstructionType());
        constructionExample.setRecommendedDangerCategory(null);
        constructionExample.setParent(objectConstruction);
        // setting the ways to esciz
        // checking esciz
        if (constructionExample.getWayToDefectEsckiz() == null
        || constructionExample.getWayToDefectEsckiz().equals("")) {
          // retrieving esciz from object construction
          Blob eskiz = objectConstructionManager
              .getObjectConstructionImage(new Integer(typeId),"eskiz");
          // esciz for defects
          if (eskiz != null) {
            String wayToDefectEskiz = "eskiz"
                + (System.currentTimeMillis() & 0xffffffffL)
                + ".jpg";
            constructionExample.setDefectEsckizBlob(eskiz);
            constructionExample
                .setWayToDefectEsckiz(wayToDefectEskiz);
            constructionExample.setDefectEsckizWayImage("image"
                + wayToDefectEskiz);
            // esciz for power points
            String wayToPowerEskiz = "powereskiz"
                + (System.currentTimeMillis() & 0xffffffffL)
                + ".jpg";
            constructionExample
                .setWayToPowerEsckiz(wayToPowerEskiz);
            constructionExample.setPowerEsckizBlob(eskiz);
            constructionExample.setPowerEsckizWayImage("image"
                + wayToPowerEskiz);
          }
        }
        constructionExampleManager
            .saveConstructionExample(constructionExample);
        constructionExampleManager.copyExample(
            constructionExample.getExampleId(), exampleNumber - 1);
        Cookie cookie = new Cookie("nodeEnsureVisible", ""
            + (new java.util.Date().getTime()));
        cookie.setValue(String.valueOf(number));
        cookie.setMaxAge(30 * 24 * 60 * 60);
        response.addCookie(cookie);
 
View Full Code Here

        }

        //checking if the esciz already exists
        if (strength.getWayToEskiz() == null || strength.getWayToEskiz().equals("")) {
            //loading eskiz from objectconstruction
            ConstructionExample constructionExample = constructionExampleManager.getConstructionExample(strength.getExampleId().toString());
            constructionExampleManager.evict(constructionExample);
            strength.setWayToEskiz(constructionExample.getWayToPowerEsckiz());
        }
        request.setAttribute("saveWay", strength.getWayToEskiz());
        request.setAttribute("loadWay", strength.getWayToEskiz());
        strength.setDocLocation(request.getParameter("docLocation"));
View Full Code Here

TOP

Related Classes of com.vst.model.ConstructionExample

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.