Search in sources :

Example 1 with ListFieldImpl

use of org.apache.shindig.social.core.model.ListFieldImpl in project liferay-ide by liferay.

the class LiferayPersonService method getPhoneNumbers.

protected List<ListField> getPhoneNumbers(String className, long classPK) throws Exception {
    List<ListField> phoneNumbers = new ArrayList<ListField>();
    List<com.liferay.portal.model.Phone> liferayPhones = PhoneServiceUtil.getPhones(className, classPK);
    for (com.liferay.portal.model.Phone liferayPhone : liferayPhones) {
        ListField phoneNumber = new ListFieldImpl(liferayPhone.getType().getName(), liferayPhone.getNumber());
        phoneNumbers.add(phoneNumber);
    }
    return phoneNumbers;
}
Also used : ListFieldImpl(org.apache.shindig.social.core.model.ListFieldImpl) ArrayList(java.util.ArrayList) ListField(org.apache.shindig.social.opensocial.model.ListField)

Example 2 with ListFieldImpl

use of org.apache.shindig.social.core.model.ListFieldImpl 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

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