Examples of IEmployee


Examples of org.springmodules.web.test.domain.IEmployee

        assertNotNull(binder.findCustomEditor(null, "office"));
    }
   
    public void testSetCustomEditorsWithFailure()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedAbstractWizardFormController controller = (EnhancedAbstractWizardFormController) this.applicationContext.getBean("testCustomEditorsWizardControllerFour");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        try {
            controller.initBinder(new MockHttpServletRequest(), binder);
View Full Code Here

Examples of org.springmodules.web.test.domain.IEmployee

        return suite;
    }

    public void testSetCustomEditorsWithDefaultPrefix()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedSimpleFormController controller = (EnhancedSimpleFormController) this.applicationContext.getBean("testCustomEditorsControllerOne");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        controller.initBinder(new MockHttpServletRequest(), binder);
       
View Full Code Here

Examples of org.springmodules.web.test.domain.IEmployee

        assertNotNull(binder.findCustomEditor(Office.class, null));
    }
   
    public void testSetCustomEditorsWithClassPrefix()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedSimpleFormController controller = (EnhancedSimpleFormController) this.applicationContext.getBean("testCustomEditorsControllerTwo");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        controller.initBinder(new MockHttpServletRequest(), binder);
       
View Full Code Here

Examples of org.springmodules.web.test.domain.IEmployee

        assertNotNull(binder.findCustomEditor(Office.class, null));
    }
   
    public void testSetCustomEditorsWithPropertyPrefix()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedSimpleFormController controller = (EnhancedSimpleFormController) this.applicationContext.getBean("testCustomEditorsControllerThree");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        controller.initBinder(new MockHttpServletRequest(), binder);
       
View Full Code Here

Examples of org.springmodules.web.test.domain.IEmployee

        assertNotNull(binder.findCustomEditor(null, "office"));
    }
   
    public void testSetCustomEditorsWithFailure()
    throws Exception {
        IEmployee emp = new Employee();
        EnhancedSimpleFormController controller = (EnhancedSimpleFormController) this.applicationContext.getBean("testCustomEditorsControllerFour");
        ServletRequestDataBinder binder = new ServletRequestDataBinder(emp);
       
        try {
            controller.initBinder(new MockHttpServletRequest(), binder);
View Full Code Here

Examples of org.springmodules.xt.examples.domain.IEmployee

        return IEmployee.class.isAssignableFrom(aClass);
    }

    public void validate(Object object, Errors errors) {
        if (this.supports(object.getClass())) {
            IEmployee emp = (IEmployee) object;
           
            // Validate matriculation code:
            if (emp.getMatriculationCode() == null || emp.getMatriculationCode().equals("")) {
                errors.rejectValue("matriculationCode", EmployeeErrorCodes.NULL_CODE, "No Matriculation Code!");
            }
           
            // Validate password:
            if (emp.getPassword().length() < PASSWORD_MIN_LENGTH) {
                errors.rejectValue("password", EmployeeErrorCodes.SHORT_PASSWORD, new Object[]{PASSWORD_MIN_LENGTH}, "Too short password!");
            }
        }
    }
View Full Code Here

Examples of org.springmodules.xt.examples.domain.IEmployee

            errors.rejectValue("office", OfficeErrorCodes.NOT_FOUND, "No office found!");
            return this.showForm(request, response, errors);
        }
        else {
            try {
                IEmployee employee = (IEmployee) this.introductor.getTarget(view);
                office.addEmployee(employee);
                store.addOffice(office);
            }
            catch(BusinessException ex) {
                for (Error error : ex.getErrors()) {
View Full Code Here

Examples of org.springmodules.xt.examples.domain.IEmployee

    private static final String OFFICE_ID = "officeId";
   
    private MemoryRepository store;
   
    public AjaxResponse dragEmployee(AjaxActionEvent event) {
        IEmployee draggedEmployee = store.getEmployee(event.getParameters().get(EMPLOYEE_ID));
        IOffice droppableOffice = store.getOffice(event.getHttpRequest().getParameter(OFFICE_ID));
       
        if (! droppableOffice.getEmployees().contains(draggedEmployee)) {
            BindStatusHelper helper = new BindStatusHelper("command.employees");
           
            ListItem item = new ListItem(new SimpleText(draggedEmployee.getFirstname() + " " + draggedEmployee.getSurname()));
            InputField hidden = new InputField(helper.getStatusExpression(), draggedEmployee.getMatriculationCode(), InputField.InputType.HIDDEN);
           
            AppendContentAction appendAction = new AppendContentAction("employees", new LinkedList<Component>(Arrays.asList(item, hidden)));
           
            AjaxResponse response = new AjaxResponseImpl();
            response.addAction(appendAction);
View Full Code Here

Examples of org.springmodules.xt.examples.domain.IEmployee

    public AjaxResponse employeeSelection(AjaxActionEvent event)
    throws Exception {
        String matriculationCode = event.getHttpRequest().getParameter(event.getElementName());
        // Get the selected employee:
        IEmployee e = store.getEmployee(matriculationCode);
       
        // Create an ajax action for setting the "value" attribute of the "firstname" html element:
        SetAttributeAction setFirstname = new SetAttributeAction("firstname", "value", e.getFirstname());
        // Create an ajax action for setting the "value" attribute of the "surname" html element:
        SetAttributeAction setSurname = new SetAttributeAction("surname", "value", e.getSurname());
       
        // Create the ajax response:
        AjaxResponse response = new AjaxResponseImpl();
        // Add the actions to the response:
        response.addAction(setFirstname);
View Full Code Here

Examples of org.springmodules.xt.test.domain.IEmployee

    public DefaultErrorRenderingCallbackTest(String testName) {
        super(testName);
    }
   
    protected void setUp() throws Exception {
        IEmployee target = new Employee();
       
        this.callback = new DefaultErrorRenderingCallback();   
        this.errors = new BindException(target, "command");
        this.errors.addError(new ObjectError("command", new String[]{"ErrorCode1"}, null, "Default Message 1"));
        this.messageSource = new DelegatingMessageSource();
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.