Examples of Volunteer


Examples of org.spw.model.Volunteer

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

Examples of org.spw.model.Volunteer

       
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        if (getSessionBean1().getVolunteer() == null) {
            getSessionBean1().setVolunteer(new Volunteer());
        }
        if (getSessionBean1().getVolunteer().getYearApplyingFor() == 0) {
            yearApplyingFor.setText(
                    java.util.Calendar.getInstance().get(java.util.Calendar.YEAR));
        }
View Full Code Here

Examples of org.spw.model.Volunteer

     * handled a postback and then navigated to a different page).  Customize
     * this method to allocate resources that will be required for rendering
     * this page.</p>
     */
    public void prerender() {
        Volunteer volunteer = getSessionBean1().
                getVolunteer();
        if (volunteer != null && volunteer.getNextOfKin() != null) {
            nextOfKin.setValue(volunteer.getNextOfKin().toString());
        }
        if (volunteer != null && volunteer.getParents() != null
                && !volunteer.isParentsSameAsNextOfKin())
            parents.setValue(volunteer.getParents().toString());
    }
View Full Code Here

Examples of org.spw.model.Volunteer

    }
   
    public String buttonValidate_action() {
        VolunteerController ctrlVolunteer = new VolunteerController();
        PersonController ctrlPerson = new PersonController();
        Volunteer volunteer = getSessionBean1().getVolunteer();
        // parse the next of Kin & the parents
        Person contactNextOfKin = null;
        Person contactParent;
        if (nextOfKin.getText().length() > 0) {
            contactNextOfKin = ctrlPerson.parse((String) nextOfKin.getValue());
            if (contactNextOfKin != null) {
                volunteer.setNextOfKin(contactNextOfKin);
            }
        }
        if (volunteer.isParentsSameAsNextOfKin()) {
            volunteer.setParents(contactNextOfKin);
        } else {
            if (parents.getText().length() > 0) {
                contactParent = ctrlPerson.parse((String) parents.getValue());
                if (contactParent != null) {
                    volunteer.setParents(contactParent);
                }
            }
        }
       
        // Remove previous Person if creation of Volunteer from a Person
        if (getSessionBean1().getPerson() !=  null &&
                getSessionBean1().getPerson().getIdContact() == volunteer.getIdContact() ) {
            ctrlPerson.delete(getSessionBean1().getPerson());
        }
        // Persit the new object
        ctrlVolunteer.update(volunteer);
       
View Full Code Here

Examples of org.spw.model.Volunteer

        instance.setArchived(false);
        instance.refreshList();
       
        assertTrue(instance.getList().size() > 0);
        for (Object object: instance.getList()) {
            Volunteer volunteer = (Volunteer) object;
            assertTrue("year applying is incorrect, expected " + year + ", found " +
                    volunteer.getYearApplyingFor(), volunteer.getYearApplyingFor() >= year);
        }
       
        instance.setArchived(true);
        instance.refreshList();
       
        assertTrue(instance.getList().size() > 0);
        boolean isArchivedFound = false;
        for (Object object: instance.getList()) {
            Volunteer volunteer = (Volunteer) object;
            isArchivedFound = (volunteer.getYearApplyingFor() < year);
            if (isArchivedFound)
                break;
        }
        assertTrue("Can't find any archived volunteer", isArchivedFound);
    }
View Full Code Here

Examples of org.spw.model.Volunteer

        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

Examples of org.spw.model.Volunteer

    }
   
    public String buttonEdit_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Volunteer volunteer = (Volunteer)list.getObject(rk);
            getSessionBean1().setVolunteer(volunteer);
        }
       
        return "edit";
    }
View Full Code Here

Examples of org.spw.model.Volunteer

    }
   
    public String buttonInfo_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Volunteer volunteer = (Volunteer)list.getObject(rk);
            getSessionBean1().setPerson(volunteer);
        }
       
        return "info";
    }
View Full Code Here

Examples of org.spw.model.Volunteer

    }
   
    public String buttonApplication_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Volunteer volunteer = (Volunteer)list.getObject(rk);
            getSessionBean1().setVolunteer(volunteer);
            getSessionBean1().setVolunteerApplication(volunteer.getApplication());
        }
       
        return null;
    }
View Full Code Here

Examples of org.spw.model.Volunteer

    }
   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Volunteer volunteer = (Volunteer) list.getObject(rk);
            new VolunteerController().delete(volunteer);
        }
        try {
            list.refreshList();
        } catch (CriteriaException ex) {
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.