Package org.spw.model

Examples of org.spw.model.Partnership


       
        return null;
    }

    private void deleteAdvertisement(final Advertisement advertisement) {
        Partnership partnership = getSessionBean1().getPartnership();
        new PartnershipController().removeAdvertisement(partnership, advertisement);
        getSessionBean1().setPartnership(partnership);
    }
View Full Code Here


    protected RequestBean1 getRequestBean1() {
        return (RequestBean1)getBean("RequestBean1");
    }
   
    public String buttonValidate_action() {
        Partnership partnership = getPartnership();
        Advertisement advertisement = getAdvertisement();
       
        advertisement.setPartnership(partnership);
       
        PartnershipController partnershipCtrl = new PartnershipController();
View Full Code Here

   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            PartnershipController  ctrl = new PartnershipController();
            Partnership partnership = (Partnership)list.getObject(rk);
            ctrl.delete(partnership);
        }
        list.refreshList();

        return null;
View Full Code Here

       
        return "edit";
    }

    public String buttonAdd_action() {
        getSessionBean1().setPartnership(new Partnership());
       
        return "new";
    }
View Full Code Here

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

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

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

       
        return "success";
    }
   
    public String buttonCancel_action() {
        Partnership object = getSessionBean1().getPartnership();
        if (object == null || object.getIdContact() == null) {
            return "cancel";
        } else {
            return "success";
        }
    }
View Full Code Here

    public PartnershipControllerTest(String testName) {
        super(testName);
    }
   
    protected void setUp() throws Exception {
        Partnership p1 = new Partnership();
        p1.setIdContact(TEST_ID_ABC1);
        p1.setOrganisationName(TEST_NAME_ABC1);
        p1.setFirstName(TEST_NAME_ABC1);
        p1.setLastName(getName());
        p1.setTypeOfPartnership("Recruitment");
        partnershipCtl.create(p1);
        for(long id = TEST_ID_ABC1+1; id < TEST_ID_ABC1 + 8; id++) {
            Partnership p = new Partnership();
            p.setIdContact(id);
            p.setOrganisationName(TEST_NAME_ABC1 + id);
            p.setLastName(getName());
            p.setTypeOfPartnership("Recruitment");
            partnershipCtl.create(p);
        }
        Partnership p2 = new Partnership();
        p2.setIdContact(TEST_ID_BBC);
        p2.setOrganisationName(TEST_NAME_BBC);
        p2.setLastName(getName());
        p2.setTypeOfPartnership("Recruitment");
        partnershipCtl.create(p2);
    }
View Full Code Here

        p2.setTypeOfPartnership("Recruitment");
        partnershipCtl.create(p2);
    }
   
    protected void tearDown() throws Exception {
        Partnership p;
        for(long id = TEST_ID_ABC1; id < TEST_ID_ABC1 + 8; id++) {
            p = partnershipCtl.read(id);
            if (p != null) partnershipCtl.delete(p);
        }
        partnershipCtl.delete(partnershipCtl.read(TEST_ID_BBC));
View Full Code Here

     * Test of addAdvertisement method, of class org.spw.controller.PartnershipController.
     */
    public void testAddAdvertisement() {
        System.out.println("addAdvertisement");
       
        Partnership partnership = partnershipCtl.read(TEST_ID_ABC1);
        Advertisement advertisement = new Advertisement();
        advertisement.setDateAdvert(new Date());
        advertisement.setIdAdvertisement(TEST_ID_ABC1);
        advertisement.setNotes(getName());
       
        Partnership result = partnershipCtl.addAdvertisement(partnership, advertisement);
        assertNotNull(result);
        assertEquals(partnership, result);
        assertTrue(result.getAdvertisements().contains(advertisement));       
    }
View Full Code Here

TOP

Related Classes of org.spw.model.Partnership

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.