Package org.spw.model

Examples of org.spw.model.Communication


    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

     * Creates a new instance of CommunicationDataProvider
     */
    public CommunicationDataProvider() {
        aList = new ArrayList<Communication>();
        // Put in dummy data for design time
        aList.add(new Communication());
       
        // Wrap the list
        setList(aList);
    }
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

        super(testName);
    }
   
    protected void setUp() throws Exception {
        //Action completed
        Communication com1 = new Communication();
        com1.setIdCommunication(TEST_ID_COMPLETED);
        com1.setActionToBeConducted("Test already done");
        com1.setDateOfCompletion(new Date());
        com1.setTopic(getName());
        comCtrl.create(com1);
        //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

     * @param key The unique ID of the object
     * @return a communication if found, null otherwise
     */
    public Communication read(Long key) {
        EntityManager em = emf.createEntityManager();
        Communication retValue = null;
        try {
            retValue = em.find(Communication.class, key);
        } catch (Exception e) {
            Logger.getLogger(CommunicationController.class.getName()).log(Level.SEVERE, "Error reading " + key, e);
            if (em.getTransaction().isActive())
View Full Code Here

     * Update an existing communication. If it's a new Communication, create it.
     * @param object The communication to update
     * @return the new object communication after the persistence operation
     */
    public Communication update(Communication object) {
        Communication result = null;
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        try {
            result = em.merge(object);
            em.getTransaction().commit();
View Full Code Here

     */
    public void delete(Communication object) {
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        try {
            Communication entity = em.find(Communication.class, object.getIdCommunication());
            // remove communication from contact removed from the list
            for(Contact contact : entity.getParticipants()) {
                contact.getParticipate().remove(entity);
                em.merge(contact);
            }
           
            em.remove(entity);
View Full Code Here

     * @return the new communication object after being persisted
     */
    public Communication updateParticipants(Communication communication,
            List<Contact> newParticipants) {
        // First persist the communication with all the contacts
        Communication result = null;
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        try {
            // remove communication from contact removed from the list
            for(Contact contact : communication.getParticipants()) {
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.