Package org.spw.controller

Examples of org.spw.controller.CommunicationController


   
    private void deleteCommunication(Communication communication) {
        Contact contact = getContact();
        contact.getParticipate().remove(communication);
        new ContactController().update(contact);
        new CommunicationController().delete(communication);
       
    }
View Full Code Here


        return "success";
    }

    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
        java.util.List<Contact> participants = new ArrayList<Contact>();
        participants.add(contact);
        if (selected != null) {
            for (int i= 0; i < selected.length; i++) {
                Contact aParticipant = contactCtl.parse("["+selected[i]+"]");
                if (aParticipant != null && !aParticipant.equals(contact)) {
                    participants.add(aParticipant);
                }
            }
        }
        communication = comCtl.updateParticipants(communication, participants);

        // update the current properties in the session
        setCommunication(communication);
        contact = contactCtl.read(contact.getIdContact());
        setContact(contact);
View Full Code Here

        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();
       
        return null;
View Full Code Here

   
    private void deleteCommunication(Communication communication) {
        Contact contact = getContact();
        contact.getParticipate().remove(communication);
        new ContactController().update(contact);
        new CommunicationController().delete(communication);
       
    }
View Full Code Here

     * Add a Faces message if the list can't be refresh (it's the case if
     * the object was created from a list).
     */
    public void refreshList() {
        aList.clear();
        aList.addAll(new CommunicationController().getCommunications());
    }
View Full Code Here

     * Refresh the list from the database with the selected contact.
     * Add a Faces message if the list can't be refresh (it's the case if
     * the object was created from a list).
     */
    public void refreshListActionsNotCompleted() {
        CommunicationController comCtl = new CommunicationController();
        aList.clear();
       
        aList.addAll(comCtl.getActionsNotCompleted());
    }
View Full Code Here

        return "success";
    }

    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
        java.util.List<Contact> participants = new ArrayList<Contact>();
        participants.add(contact);
        if (selected != null) {
            for (int i= 0; i < selected.length; i++) {
                Contact aParticipant = contactCtl.parse("["+selected[i]+"]");
                if (aParticipant != null && !aParticipant.equals(contact)) {
                    participants.add(aParticipant);
                }
            }
        }
        communication = comCtl.updateParticipants(communication, participants);

        // update the current properties in the session
        setCommunication(communication);
        contact = contactCtl.read(contact.getIdContact());
        setContact(contact);
View Full Code Here

        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();
       
        return null;
View Full Code Here

            close();
        }
    }
   
    private void historize(Contact contact) {
        CommunicationController comCtl = new CommunicationController();
        Communication com = new Communication();
        com.setDateCommunication(new Date());
        com.setMedia("Email");
        com.setTopic(this.getSubject());
        List<Contact> participants = new ArrayList<Contact>(1);
        participants.add(contact);
        com.setParticipants(participants);
        comCtl.create(com);
    }
View Full Code Here

    }
   
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        comCtrl = new CommunicationController();
        contactCtrl = new ContactController();
        testContact = new Contact();
        testContact.setFirstName(getName());
        contactCtrl.create(testContact);
        //Action completed with a participant
View Full Code Here

TOP

Related Classes of org.spw.controller.CommunicationController

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.