Package org.spw.model

Examples of org.spw.model.VolunteerApplication


       
        int nbApplications1 = testProgram1.getApplications().size();
        Edit instance = new Edit();
       
        // Create a fresh new application
        VolunteerApplication application = new VolunteerApplication();
        application.setIdApplication(TEST_ID);
        application.setProgram(testProgram1);
       
        // Create and persist the volunteer
        Volunteer volunteer = new Volunteer();
        volunteer.setIdContact(TEST_ID);
        volunteer.setFirstName(getName());
        volunteer.setLastName(getName());
        volunteer.setTypeVolunteer("Potential");
        volunteer = volunteerCtrl.update(volunteer);
       
        // test the method
        instance.persist(volunteer, application, null);

        //Refresh
        application = applicationCtrl.read(TEST_ID);
        testProgram1 = programCtrl.read(testProgram1.getIdProgram());
       
        assertNotNull(application);
        assertNotNull(application.getVolunteer());
        assertEquals((long) TEST_ID, (long) application.getVolunteer().getIdContact());
        assertEquals("Potential", application.getVolunteer().getTypeVolunteer());
       
        applications = new ArrayList<VolunteerApplication>
                (testProgram1.getApplications());
        assertTrue("Cannot find the application in the program", applications.contains(application));
        assertEquals("The number of application should have increased", nbApplications1+1, applications.size());
View Full Code Here


        if (! (person instanceof Volunteer)) {
            return null;
        } else {
            getSessionBean1().setVolunteer((Volunteer) person);
        }
        VolunteerApplication application = getSessionBean1().getVolunteer().getApplication();
        if (application == null) {
            application = new VolunteerApplication();
        }
        getSessionBean1().setVolunteerApplication(application);
       
        return "application";
    }
View Full Code Here

        if (! (person instanceof Volunteer)) {
            return null;
        } else {
            getSessionBean1().setVolunteer((Volunteer) person);
        }
        VolunteerApplication application = getSessionBean1().getVolunteer().getApplication();
        if (application == null) {
            return null;
        }
        getSessionBean1().setVolunteerApplication(application);
        Program program = application.getProgram();
        getSessionBean1().setProgram(program);
       
        return "application";
    }
View Full Code Here

    public String hyperlinkContributions_action() {
        Person person = getSessionBean1().getPerson();
        if (! (person instanceof Volunteer)) {
            return null;
        }
        VolunteerApplication application = getSessionBean1().getVolunteer().getApplication();
        if (application == null) {
            return null;
        }
        getSessionBean1().getContributionDataProvider().setApplication(application);
       
View Full Code Here

       
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        if (getSessionBean1().getVolunteerApplication() == null) {
            getSessionBean1().setVolunteerApplication(new VolunteerApplication());
        }
    }
View Full Code Here

    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1)getBean("ApplicationBean1");
    }
   
    public String buttonValidate_action() {
        VolunteerApplication application = getVolunteerApplication();
        Volunteer volunteer = getVolunteer();
        Program previousProgram = getProgram();
        persist(volunteer, application, previousProgram);
       
        return "success";
View Full Code Here

    /**
     * Creates a new instance of VolunteerApplicationDataProvider
     */
    public VolunteerApplicationDataProvider() {
        // Put in dummy data for design time
        aList.add(new VolunteerApplication());

        // Wrap the list
        setList(aList);       
    }
View Full Code Here

    public String getAsString(FacesContext context, UIComponent component, Object value) {
        if (value == null) return null;
        if (!(value instanceof VolunteerApplication)) {
            throw new ConverterException("Error converting Application, got a " + value.getClass().getName());
        }
        VolunteerApplication obj = (VolunteerApplication) value;
        return obj.getIdApplication().toString();
    }
View Full Code Here

    }

    public String buttonValidate_action() {
        VolunteerApplicationController ctrl = new VolunteerApplicationController();
        Contribution contribution = getSessionBean1().getContribution();
        VolunteerApplication application = getSessionBean1().getContributionDataProvider().getApplication();
        if (!application.getContributions().contains(contribution)) {
            application.addContribution(contribution);
        }
        ctrl.update(application);
       
        return "success";
    }
View Full Code Here

   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            VolunteerApplicationController ctrl = new VolunteerApplicationController();
            VolunteerApplication application = dataProvider.getApplication();
            Contribution contribution = (Contribution)dataProvider.getObject(rk);
            application.removeContribution(contribution);
           
            ctrl.removeContribution(application, contribution);
            dataProvider.refreshList();
        }
       
View Full Code Here

TOP

Related Classes of org.spw.model.VolunteerApplication

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.