Search in sources :

Example 1 with EmailAddress

use of com.liferay.portal.model.EmailAddress in project liferay-ide by liferay.

the class LiferayPersonService method getEmails.

protected List<ListField> getEmails(User user) throws Exception {
    List<ListField> emails = new ArrayList<ListField>();
    ListField email = new ListFieldImpl(Field.PRIMARY.toString(), user.getEmailAddress());
    emails.add(email);
    List<EmailAddress> emailAddresses = EmailAddressLocalServiceUtil.getEmailAddresses(user.getCompanyId(), User.class.getName(), user.getUserId());
    for (EmailAddress emailAddress : emailAddresses) {
        email = new ListFieldImpl(emailAddress.getType().getName(), emailAddress.getAddress());
        emails.add(email);
    }
    return emails;
}
Also used : ListFieldImpl(org.apache.shindig.social.core.model.ListFieldImpl) User(com.liferay.portal.model.User) ArrayList(java.util.ArrayList) ListField(org.apache.shindig.social.opensocial.model.ListField) EmailAddress(com.liferay.portal.model.EmailAddress)

Aggregations

EmailAddress (com.liferay.portal.model.EmailAddress)1 User (com.liferay.portal.model.User)1 ArrayList (java.util.ArrayList)1 ListFieldImpl (org.apache.shindig.social.core.model.ListFieldImpl)1 ListField (org.apache.shindig.social.opensocial.model.ListField)1