Package com.vst.model

Examples of com.vst.model.PipelineSubtype


    }

    public boolean exist(PipelineSubtype pipelineSubtype) {
        List list=pipelineSubtypeDao.getPipelineSubtype();
        for (int i=0; i<list.size(); i++){
            PipelineSubtype pipe=(PipelineSubtype)list.get(i);
            if (pipe.getPipelineType().equals(pipelineSubtype.getPipelineType())){
                return true;
            }
        }
        return false;
    }
View Full Code Here


    protected Object formBackingObject(HttpServletRequest request) throws Exception {


        if (!isFormSubmission(request)) {
            PipelineSubtype pipelineSubtype = new PipelineSubtype();

            if (request.getParameter("pipelineId") != null) {
                int id = Integer.parseInt(request.getParameter("pipelineId"));
                pipelineSubtype = pipelineSubtypeManager.getPipelineSubtypeById((Integer) id);
            }

            if (request.getParameter("edited") != null) {
                request.setAttribute("addition", "?edited=1");
                pipelineSubtype.setEdited(true);
            }

            return pipelineSubtype;
        }
View Full Code Here

        if (request.getParameter("cansel") != null) {
            return new ModelAndView("redirect:/lookPipelineSubtype.html");
        }

        PipelineSubtype pipelineSubtype = (PipelineSubtype) command;

        if (pipelineSubtype.getPipelineId() != null) {
            pipelineSubtypeManager.update(pipelineSubtype);
            if (pipelineSubtype.isEdited()) {

                return new ModelAndView("redirect:updating.html?id=" + pipelineSubtype.getPipelineId() + "&fieldId=" + request.getParameter("fieldId"));
            }
            return new ModelAndView("redirect:/lookPipelineSubtype.html");

        } else {
            pipelineSubtypeManager.insert(pipelineSubtype);
            mav.addObject("pipeline", new PipelineSubtype());
            mav.addObject("result", new Integer(1));
            if (pipelineSubtype.isEdited()) {

                return new ModelAndView("redirect:updating.html?id=" + pipelineSubtype.getPipelineId() + "&fieldId=" + request.getParameter("fieldId"));
            }
            return mav;
        }

View Full Code Here

    public boolean supports(Class aClass) {
        return PipelineSubtype.class.isAssignableFrom(aClass);
    }

    public void validate(Object o, Errors errors) {
        PipelineSubtype pipelineSubtype=(PipelineSubtype)o;

        if (pipelineSubtype.getPipelineType()==null || pipelineSubtype.getPipelineType().trim().equals("")){
             errors.rejectValue("pipelineType", "pipeline.error.pipelineType");
        } else{
            if (pipelineSubtype.getPipelineId()==null && pipelineSubtypeManager.exist(pipelineSubtype)){
                errors.rejectValue("pipelineId", "pipeline.error");
            }
        }

    }
View Full Code Here

TOP

Related Classes of com.vst.model.PipelineSubtype

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.