Examples of ObjectConstruction


Examples of com.vst.model.ObjectConstruction

            log.debug("entering 'handleRequest' method...");
        }

        String objectConstructionId = request.getParameter("objectConstructionId");
        if (objectConstructionId != null) {
            ObjectConstruction objectConstruction = objectConstructionManager.getObjectConstruction(objectConstructionId);
            if (objectConstruction.getWayToEsckiz() != null && !"".equals(objectConstruction.getWayToEsckiz()) && objectConstruction.getEsckizBlob() != null && objectConstruction.getEsckizBlob().length() > 0) {
                File file = new File(FileHelper.getCurrentPath(request) + objectConstruction.getWayToEsckiz());
                if (file.exists()) {
                    file.delete();
                }
                file.createNewFile();
                FileOutputStream fileOutputStream = new FileOutputStream(FileHelper.getCurrentPath(request) + objectConstruction.getWayToEsckiz());
                Blob blob = objectConstruction.getEsckizBlob();
                byte[] bufer = new byte[62000];
                InputStream inputStream = blob.getBinaryStream();
                while (inputStream.read(bufer) != -1) {
                    fileOutputStream.write(bufer);
                }
                inputStream.close();
                fileOutputStream.close();
            } else {
                request.setAttribute("noPhoto", "true");
            }
            return new ModelAndView("objectConstructionPicture", Constants.OBJECTCONSTRUCTIONTYPE_WAY, objectConstruction.getWayToEsckiz());

        } else {
            request.setAttribute("noObjectConstruction", "true");
        }
        return new ModelAndView("objectConstructionPicture");
View Full Code Here

Examples of com.vst.model.ObjectConstruction

             List<?> clist =
               buildingDao.getConstructionTypesForTree(bo.getObjectId());
             System.out.println(bo);
             System.out.println(clist);
             for (Object c: clist){
               ObjectConstruction ct = (ObjectConstruction) c;
               List<?> samplelist =
                 csamplesDao.getConstructionExamplesLite("" + ct.getTypeId(), "tree");

               System.out.println(samplelist);
             }
           }
View Full Code Here

Examples of com.vst.model.ObjectConstruction

             List<?> clist = bo.getConstructionTypes();
               //buildingDao.getConstructionTypesForTree(bo.getObjectId());
             System.out.println(bo);
             System.out.println(clist);
             for (Object c: clist){
               ObjectConstruction ct = (ObjectConstruction) c;
               List<?> samplelist = ct.getConstructionExamples();
                 //csamplesDao.getConstructionExamplesLite("" + ct.getTypeId(), "tree");

               System.out.println(samplelist);
             }
           }
View Full Code Here

Examples of com.vst.model.ObjectConstruction

                    BuildingObject buildingObject = (BuildingObject) buildingObjectList.get(i);
                    List answerList = buildingObject.getDocumentationQuestions();
                    //retrieving construction answers
                    List objectConstructions = buildingObject.getConstructionTypes();
                    for (int j = 0; j < objectConstructions.size(); j++) {
                        ObjectConstruction objectConstruction = (ObjectConstruction) objectConstructions.get(j);
                        List constructionAnswers = objectConstruction.getDocumentationQuestions();
                        answerList.addAll(constructionAnswers);
                        if (constructionAnswers.size() == 0 && questionManager.hasQuestionForConstruction(objectConstruction.getConstructionType().getConstructionTypeId().toString())) {
                            errorMessage += "Не даны ответы по конструкции - <a target=blank href='objectConstructions.html?objectId=" + objectConstruction.getObjectId() + "&typeId=" + objectConstruction.getTypeId() + "'>" + objectConstruction.getConstructionType() + ". Объект - " + buildingObject.getName() + "</a><br/>";
                        }
                    }

// checking if all questions have answer
                    for (int j = 0; j < answerList.size(); j++) {
View Full Code Here

Examples of com.vst.model.ObjectConstruction

    public boolean supports(Class candidate) {
        return ObjectConstruction.class.isAssignableFrom(candidate);
    }

    public void validate(Object obj, Errors errors) {
        ObjectConstruction objectConstruction = (ObjectConstruction) obj;
        //checking if all answers were given and if there are necessary questions tha were not answered
        List objectAnswerList = objectConstruction.getCurrentDocumentationQuestions();
        boolean allAnswers = true;
        boolean noNecessaryAnswers = false;
        boolean dataTooLong = false;       
        for (int i = 0; i < objectAnswerList.size(); i++) {
            ObjectAnswer objectAnswer = (ObjectAnswer) objectAnswerList.get(i);
View Full Code Here

Examples of com.vst.model.ObjectConstruction

        return questionDao.getConstructionQuestionsByTypeId(typeId);
    }

    public List fillExampleNumbers(List objectConstructions) {
        for (int i = 0; i < objectConstructions.size(); i++) {
            ObjectConstruction objectConstruction = (ObjectConstruction) objectConstructions.get(i);
            objectConstruction.setNumberInObject(getExampleNumberByConstructionType(objectConstruction.getTypeId().toString(), objectConstruction.getObjectId().toString()).intValue());
            //System.out.println("objectConstruction SIZE == "+objectConstruction.getTypeId()+"; "+objectConstruction.getObjectId()+";  === "+objectConstruction.getNumberInObject());
        }

        return objectConstructions;
    }
View Full Code Here

Examples of com.vst.model.ObjectConstruction

    public List getObjectConstructionByObjectIdAndConstructionType(Integer objectId, Integer constructionType) {
        List list=dao.getObjectConstructions(objectId);
        List resultList=new ArrayList();
        for (int i=0; i<list.size(); i++){
            ObjectConstruction objectConstruction=(ObjectConstruction)list.get(i);
            if (objectConstruction.getConstructionType().getConstructionTypeId().equals(constructionType)){
                resultList.add(objectConstruction);
            }
        }
        return resultList;  //To change body of implemented methods use File | Settings | File Templates.
    }
View Full Code Here

Examples of com.vst.model.ObjectConstruction

                constructionExample.getStrengthPoints().add(strength);
                constructionExampleManager.saveConstructionExample(constructionExample);
//                buildingObjectManager.saveBuildingObject(buildingObject);
//                constructionExampleManager.saveConstructionExample(constructionExample);

                ObjectConstruction objectConstruction = objectConstructionManager.getObjectConstruction(constructionExample.getObjectConstructionId().toString());
                String fileName = FileHelper.getCurrentPath(request) + objectConstruction.getWayToDefectMap();
                paintStrength(constructionExample, strength, fileName,"save");


            } else {
                strengthManager.saveStrength(strength);


                Integer exampleId = strength.getExampleId();
                ConstructionExample constructionExample = constructionExampleManager.getConstructionExample(exampleId.toString());
                ObjectConstruction objectConstruction = objectConstructionManager.getObjectConstruction(constructionExample.getObjectConstructionId().toString());
                String fileName = FileHelper.getCurrentPath(request) + objectConstruction.getWayToDefectMap();
                paintStrength(constructionExample, strength, fileName,"update");


            }
            String key = (isNew) ? "strength.added" : "strength.updated";
View Full Code Here

Examples of com.vst.model.ObjectConstruction

    public List getConstructionExamplesForObject(String objectId){
        BuildingObject buildingObject=(BuildingObject)getHibernateTemplate().get(BuildingObject.class,new Integer(objectId));
        List typeList=buildingObject.getConstructionTypes();
        List resultList=new ArrayList();
        for (int i = 0; i < typeList.size(); i++) {
            ObjectConstruction objectConstruction = (ObjectConstruction) typeList.get(i);
            resultList.addAll(objectConstruction.getConstructionExamples());
        }
       return resultList;
    }
View Full Code Here

Examples of com.vst.model.ObjectConstruction

        }
       return resultList;
    }

    public List getConstructionExamples(final String typeId) {
        ObjectConstruction objectConstruction=(ObjectConstruction)getHibernateTemplate().get(ObjectConstruction.class,new Integer(typeId));

        return objectConstruction.getConstructionExamples();

        /* Remove the line above and uncomment this code block if you want
           to use Hibernate's Query by Example API.
        if (constructionExample == null) {
            return getHibernateTemplate().find("from ConstructionExample");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.