Package com.vst.model

Examples of com.vst.model.ObjectType


        request = newGet("/editObjectType.html");
        request.addParameter("objectTypeId", "1");

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

        ObjectType objectType = (ObjectType) mv.getModel().get(c.getCommandName());
        assertNotNull(objectType);
        request = newPost("/editObjectType.html");
        super.objectToRequestParameters(objectType, request);

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


                request.setAttribute("errormessage", bundle.getString("commonMistake"));
            }
        }


        ObjectType objectType = new ObjectType();
        // populate object with request parameters
        BeanUtils.populate(objectType, request.getParameterMap());

        List objectTypes = objectTypeManager.getObjectTypes(objectType);
View Full Code Here

    protected Object formBackingObject(HttpServletRequest request)
            throws Exception {

        if (!isFormSubmission(request)) {
            String objectTypeId = request.getParameter("objectTypeId");
            ObjectType objectType = null;

            if (!StringUtils.isEmpty(objectTypeId)) {
                objectType = objectTypeManager.getObjectType(objectTypeId);
                objectTypeManager.evict(objectType);
            } else {
                objectType = new ObjectType();
            }
            if (request.getParameter("edited") != null) {
                request.setAttribute("addition", "?edited=1");
                objectType.setEdited(true);
            }
            objectType.setDocLocation(request.getParameter("docLocation"));

            return objectType;
        }
        return super.formBackingObject(request);
    }
View Full Code Here

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

        ObjectType objectType = (ObjectType) command;
        boolean isNew = (objectType.getObjectTypeId() == null);
        Locale locale = request.getLocale();

        if (request.getParameter("delete") != null) {
            objectTypeManager.removeObjectType(objectType.getObjectTypeId().toString());

            saveMessage(request, getText("objectType.deleted", locale));
        } else {
            objectTypeManager.saveObjectType(objectType);

            String key = (isNew) ? "objectType.added" : "objectType.updated";
            saveMessage(request, getText(key, locale));
            if (objectType.isEdited()) {
                return new ModelAndView("redirect:updating.html?id=" + objectType.getObjectTypeId() + "&fieldId=" + request.getParameter("fieldId"));
            }
        }

        return new ModelAndView("redirect:" + objectType.getDocLocation());
    }
View Full Code Here

    public void setObjectTypeDao(ObjectTypeDao dao) {
        this.dao = dao;
    }

    public void testAddObjectType() throws Exception {
        ObjectType objectType = new ObjectType();

        // set required fields

        dao.saveObjectType(objectType);

        // verify a primary key was assigned
        assertNotNull(objectType.getObjectTypeId());

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

        // verify set fields are same after save
    }

    public void testGetObjectType() throws Exception {
        ObjectType objectType = dao.getObjectType(objectTypeId);
        assertNotNull(objectType);
    }
View Full Code Here

        ObjectType objectType = dao.getObjectType(objectTypeId);
        assertNotNull(objectType);
    }

    public void testGetObjectTypes() throws Exception {
        ObjectType objectType = new ObjectType();

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

        List results = dao.getObjectTypes(objectType);
        assertTrue(results.size() > 0);
    }

    public void testSaveObjectType() throws Exception {
        ObjectType objectType = dao.getObjectType(objectTypeId);

        // update required fields

        dao.saveObjectType(objectType);
View Full Code Here

        objectTypeManager = null;
    }

    public void testGetObjectTypes() throws Exception {
        List results = new ArrayList();
        ObjectType objectType = new ObjectType();
        results.add(objectType);

        // set expected behavior on dao
        objectTypeDao.expects(once()).method("getObjectTypes")
            .will(returnValue(results));
View Full Code Here

    }

    public void testGetObjectType() throws Exception {
        // set expected behavior on dao
        objectTypeDao.expects(once()).method("getObjectType")
            .will(returnValue(new ObjectType()));
        ObjectType objectType = objectTypeManager.getObjectType(objectTypeId);
        assertTrue(objectType != null);
        objectTypeDao.verify();
    }
View Full Code Here

TOP

Related Classes of com.vst.model.ObjectType

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.