Package org.spw.model

Examples of org.spw.model.Communication


        Contact contact = new Contact();
        contact.setIdContact(TEST_ID_CONTACT);
        contact.setFirstName(getName());
        contactCtrl.create(contact);
        //Action completed with a participant
        Communication com1 = new Communication();
        com1.setIdCommunication(TEST_ID_COMPLETED_WITH_CONTACT);
        com1.setActionToBeConducted("Test already done");
        com1.setDateOfCompletion(new Date());
        com1.setTopic(getName());
        List participants = new ArrayList();
        participants.add(contact);
        com1.setParticipants(participants);
        comCtrl.create(com1);
        contact.getParticipate().add(com1);
        contactCtrl.update(contact);
        //No action to complete
        Communication com2 = new Communication();
        com2.setIdCommunication(TEST_ID_NO_ACTION);
        com2.setTopic(getName());
        comCtrl.create(com2);
        //Action to complete
        Communication com3 = new Communication();
        com3.setIdCommunication(TEST_ID_NOT_COMPLETED);
        com3.setActionToBeConducted("Test to be done");
        com3.setTopic(getName());
        comCtrl.create(com3);
    }
View Full Code Here


        List<Communication> result = instance.getList();
        assertFalse("The list must not be empty",
                result.isEmpty());
        assertFalse("The list must contain only one item",
                result.size() > 1);
        Communication retrievedCom = result.get(0);
        assertEquals(TEST_ID_COMPLETED_WITH_CONTACT, (long)retrievedCom.getIdCommunication());
        List<Contact> participants = retrievedCom.getParticipants();
        assertFalse("The list of participants must not be empty",
                participants.isEmpty());
        assertFalse("The list of participants must contain only one item",
                participants.size() > 1);
        Contact retrievedContact = participants.get(0);
View Full Code Here

    }
   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Communication communication = (Communication)list.getObject(rk);
            deleteCommunication(communication);
        }
        list.refreshListCommunicationsContact();
       
        return null;
View Full Code Here

    private Contact getContact() {
        return list.getContact();
    }
   
    public String buttonAdd_action() {
        getSessionBean1().setCommunication(new Communication());
        loadOfficeStaff(null);
        loadSelected(null);
       
        return "new";
    }
View Full Code Here

    }
   
    public String buttonEdit_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Communication communication = (Communication)list.getObject(rk);
            getSessionBean1().setCommunication(communication);
            loadOfficeStaff(communication.getParticipants());
            loadSelected(communication.getParticipants());
        }
       
        return "edit";
    }
View Full Code Here

       
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        if (getCommunication() == null) {
            setCommunication(new Communication());
        }
    }
View Full Code Here

    private void addCommunication() {
        String[] selected = getSessionBean1().getChoices();
        CommunicationController comCtl = new CommunicationController();
        ContactController contactCtl = new ContactController();
        Contact contact = getContact();
        Communication communication = getCommunication();
       
        //Create communication (needed for new object)
        communication = comCtl.update(communication);
       
        //Insert the participants after converting the array to List
View Full Code Here

    }
   
    public String buttonCompleted_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Communication communication = (Communication)getSessionBean1().
                    getCommunicationDataProvider().getObject(rk);
            communication.setDateOfCompletion(new Date());
            new CommunicationController().update(communication);
        }
        // Refresh
        actionsNotCompletedList.refreshListActionsNotCompleted();
       
View Full Code Here

    }
   
    public String buttonEditCommunication_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Communication communication = (Communication) actionsNotCompletedList.getObject(rk);
            if (! communication.getParticipants().isEmpty()) {
                Contact contact = communication.getParticipants().get(0);
                if (contact instanceof Partnership) {
                    getSessionBean1().setPartnership((Partnership) contact);
                    return "infoPartnership";
                } else if (contact instanceof Person) {
                    getSessionBean1().setPerson((Person) contact);
View Full Code Here

    }
   
    public String buttonDelete_action() {
        RowKey rk = tableRowGroup1.getRowKey();
        if (rk != null) {
            Communication communication = (Communication)list.getObject(rk);
            deleteCommunication(communication);
        }
        list.refreshListCommunicationsContact();
       
        return null;
View Full Code Here

TOP

Related Classes of org.spw.model.Communication

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.