Package com.vst.model

Examples of com.vst.model.AuthentificationElement


        request = newGet("/editAuthentificationElement.html");
        request.addParameter("authentificationId", "1");

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

        AuthentificationElement authentificationElement = (AuthentificationElement) mv.getModel().get(c.getCommandName());
        assertNotNull(authentificationElement);
        request = newPost("/editAuthentificationElement.html");
        super.objectToRequestParameters(authentificationElement, request);

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


    protected Object formBackingObject(HttpServletRequest request)
            throws Exception {
        if (!isFormSubmission(request)) {
            String authentificationId = request.getParameter("authentificationId");
            AuthentificationElement authentificationElement = null;

            if (!StringUtils.isEmpty(authentificationId)) {
                authentificationElement = authentificationElementManager.getAuthentificationElement(authentificationId);
                authentificationElementManager.evict(authentificationElement);
            } else {
                authentificationElement = new AuthentificationElement();
            }
            if (request.getParameter("edited") != null) {
                request.setAttribute("addition", "?edited=1");
                authentificationElement.setEdited(true);
            }
            return authentificationElement;
        }
        return super.formBackingObject(request);
    }
View Full Code Here

            throws Exception {
        if (log.isDebugEnabled()) {
            log.debug("entering 'onSubmit' method...");
        }

        AuthentificationElement authentificationElement = (AuthentificationElement) command;
        boolean isNew = (authentificationElement.getAuthentificationId() == null);
        Locale locale = request.getLocale();

        if (request.getParameter("delete") != null) {
            authentificationElementManager.removeAuthentificationElement(authentificationElement.getAuthentificationId().toString());

            saveMessage(request, getText("authentificationElement.deleted", locale));
        } else {
            authentificationElementManager.saveAuthentificationElement(authentificationElement);

            String key = (isNew) ? "authentificationElement.added" : "authentificationElement.updated";
            saveMessage(request, getText(key, locale));

            if (authentificationElement.isEdited()) {
                return new ModelAndView("redirect:updating.html?id=" + authentificationElement.getAuthentificationId() + "&fieldId=" + request.getParameter("fieldId"));
            }
        }

        return new ModelAndView(getSuccessView());
    }
View Full Code Here

            }
            if (hasFatalError) {
                request.setAttribute("errormessage", bundle.getString("commonMistake"));
            }
        }
        AuthentificationElement authentificationElement = new AuthentificationElement();
        // populate object with request parameters
        BeanUtils.populate(authentificationElement, request.getParameterMap());

        List authentificationElements = authentificationElementManager.getAuthentificationElements(authentificationElement);
View Full Code Here

            saveMessage(request, getText("defectZone.deleted", locale));
        } else {
            List defectZoneAutentifications = new ArrayList();
            List defectZoneAutentificationsFromForm = defectZone.getAuthentificationElements();
            for (int i = 0; i < defectZoneAutentificationsFromForm.size(); i++) {
                AuthentificationElement authentificationElement = (AuthentificationElement) defectZoneAutentificationsFromForm.get(i);


                defectZoneAutentifications.add(authentificationElementManager.getAuthentificationElement(authentificationElement.getAuthentificationId().toString()));
            }

            defectZone.setAuthentificationElements(defectZoneAutentifications);
            defectZoneManager.saveDefectZone(defectZone);
View Full Code Here

                                              Object command,
                                              BindException errors)
            throws Exception {
        DefectZone defectZone = (DefectZone) command;
        if (request.getParameter("addElement") != null) {
            defectZone.getAuthentificationElements().add(new AuthentificationElement());
            return new ModelAndView("defectZoneForm", "defectZone", defectZone);
        }
        if (request.getParameter("deleteElement") != null) {
            defectZone.getAuthentificationElements().remove(defectZone.getAuthentificationNumber());
            return new ModelAndView("defectZoneForm", "defectZone", defectZone);
View Full Code Here

    public void setAuthentificationElementDao(AuthentificationElementDao dao) {
        this.dao = dao;
    }

    public void testAddAuthentificationElement() throws Exception {
        AuthentificationElement authentificationElement = new AuthentificationElement();

        // set required fields

        dao.saveAuthentificationElement(authentificationElement);

        // verify a primary key was assigned
        assertNotNull(authentificationElement.getAuthentificationId());

        // verify set fields are same after save
    }
View Full Code Here

        // verify set fields are same after save
    }

    public void testGetAuthentificationElement() throws Exception {
        AuthentificationElement authentificationElement = dao.getAuthentificationElement(authentificationElementId);
        assertNotNull(authentificationElement);
    }
View Full Code Here

        AuthentificationElement authentificationElement = dao.getAuthentificationElement(authentificationElementId);
        assertNotNull(authentificationElement);
    }

    public void testGetAuthentificationElements() throws Exception {
        AuthentificationElement authentificationElement = new AuthentificationElement();

        List results = dao.getAuthentificationElements(authentificationElement);
        assertTrue(results.size() > 0);
    }
View Full Code Here

        List results = dao.getAuthentificationElements(authentificationElement);
        assertTrue(results.size() > 0);
    }

    public void testSaveAuthentificationElement() throws Exception {
        AuthentificationElement authentificationElement = dao.getAuthentificationElement(authentificationElementId);

        // update required fields

        dao.saveAuthentificationElement(authentificationElement);
View Full Code Here

TOP

Related Classes of com.vst.model.AuthentificationElement

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.