Package org.opencustomer.db.vo.crm

Examples of org.opencustomer.db.vo.crm.PersonContactVO


            UserVO user = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
            ContactVO contact = (ContactVO) getPanel().getEntity();

            if (user.getPerson() != null)
            {
                PersonContactVO pc = new PersonContactVO(user.getPerson(), contact);

                if (!contact.getPersonContacts().contains(pc))
                    contact.getPersonContacts().add(pc);
            }
View Full Code Here


        {
            if (log.isDebugEnabled())
                log.debug("contact for person");

            PersonVO person = (PersonVO)lastPanel.getEntity();
            contact.getPersonContacts().add(new PersonContactVO(person, contact));
        }
        else
        {
            log.error("unknown entity foundin panel: "+lastPanel);
        }   
       
        // add own user by default
        if(activeUser.getPerson() != null) {
            PersonVO person = activeUser.getPerson();
            boolean containsPerson = false;
            for(PersonContactVO personContact : contact.getPersonContacts()) {
                if(person.equals(personContact.getPerson())) {
                    containsPerson = true;
                }
            }
           
            if(!containsPerson) {
                contact.getPersonContacts().add(new PersonContactVO(person, contact));
            }
        }
       
        attributes.put("contact", contact);
    }
View Full Code Here

        try
        {
            if(log.isInfoEnabled())
                log.info("import mail from " + mail.getSender());
            String recipient;
            PersonContactVO pc;
            List<PersonContactVO> pcs = new ArrayList<PersonContactVO>();

            MimeMessage message = mail.getMessage();
            MailetContext mailetContext = getMailetContext();
            contact = new ContactVO();

            contact.setBoundType(ContactVO.BoundType.IN);
            contact.setContactType(ContactVO.ContactType.EMAIL);
            contact.setContactTimestamp(new Date());
            contact.setImportType(ContactVO.ImportType.NEW);

            // Subject setzen
            if (message.getSubject() != null)
                contact.setSubject(message.getSubject());
            else
                contact.setSubject("Kein Betreff angegeben");

            // Content Setzen
            insertContent(message);
            if (contentTypetext)
                contact.setContentType(ContactVO.ContentType.PLAINTEXT);
            else
                contact.setContentType(ContactVO.ContentType.HTML);

            // Absender
            List<PersonVO> senders = new PersonDAO().getByMail(mail.getSender().toString());
            if (!senders.isEmpty())
                for (PersonVO person : senders)
                {
                    pc = new PersonContactVO(person, contact);
                    pc.setRelationType(PersonContactVO.Type.SENDER);
                    pcs.add(pc);
                    if ((mailetContext.isLocalUser(mail.getSender().getUser())) && mailetContext.isLocalServer(mail.getSender().getHost()))
                    {
                        contact.setBoundType(ContactVO.BoundType.OUT);
                    }
                }
            else
                contact.setContactName("From: " + mail.getSender().toString());

            // Emfaenger TO
            Address[] addresses = message.getRecipients(MimeMessage.RecipientType.TO);
            for (Address address : addresses)
            {
                recipient = address.toString();
                List<PersonVO> recipients = new PersonDAO().getByMail(recipient);
                if (!recipients.isEmpty())
                    for (PersonVO person : recipients)
                    {
                        pc = new PersonContactVO(person, contact);
                        pc.setRelationType(PersonContactVO.Type.TO);
                        pcs.add(pc);
                    }
                else if (contact.getContactName() == null)
                    contact.setContactName("To: " + recipient);
                else
                    contact.setContactName(contact.getContactName() + ", To: " + recipient);
            }

            // Emfaenger CC
            addresses = message.getRecipients(MimeMessage.RecipientType.CC);
            if (addresses != null)
                for (Address address : addresses)
                {
                    recipient = address.toString();
                    List<PersonVO> recipients = new PersonDAO().getByMail(recipient);
                    if (!recipients.isEmpty())
                        for (PersonVO person : recipients)
                        {
                            pc = new PersonContactVO(person, contact);
                            pc.setRelationType(PersonContactVO.Type.CC);
                            pcs.add(pc);
                        }
                    else if (contact.getContactName() == null)
                        contact.setContactName("CC: " + recipient);
                    else
                        contact.setContactName(contact.getContactName() + ", CC: " + recipient);
                }

            // Emfaenger BCC
            addresses = message.getRecipients(MimeMessage.RecipientType.BCC);
            if (addresses != null)
                for (Address address : addresses)
                {
                    recipient = address.toString();
                    List<PersonVO> recipients = new PersonDAO().getByMail(recipient);
                    if (!recipients.isEmpty())
                        for (PersonVO person : recipients)
                        {
                            pc = new PersonContactVO(person, contact);
                            pc.setRelationType(PersonContactVO.Type.BCC);
                            pcs.add(pc);
                        }
                    else if (contact.getContactName() == null)
                        contact.setContactName("BCC: " + recipient);
                    else
View Full Code Here

        }
        else
        {
            ContactVO contact = (ContactVO) panel.getEntity();

            PersonContactVO pc = new PersonContactVO(person, contact);

            if (!contact.getPersonContacts().contains(pc))
                contact.getPersonContacts().add(pc);
        }
    }
View Full Code Here

TOP

Related Classes of org.opencustomer.db.vo.crm.PersonContactVO

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.