Forums de discussion

5.2.3 API Help

thumbnail
Andew Jardine, modifié il y a 11 années.

5.2.3 API Help

Liferay Legend Publications: 2416 Date d'inscription: 22/12/10 Publications récentes
Hi,

I realize this is the lamest post on the forum right now but i need more eyes. I'm used to working with Liferay 6+ where the User model object has methods on it (as part of the API) to retrieve Addresses and Phone number collections assigned to them. I have zero experience with 5.2.3 but know that the methodology is sound. So, Here is what I am doing -

1. Retrieve my list of organization ids (that I am trying to report on)
2. For each orgnization, get the list of users assigned to it
3. For each user in the list, append their details to a StringBuffer for the CSV report

... now for the raw fields like, first, last, email, its easy. But I can't see in the 5.2.3 API how I can retrieve their address(es) and phone number(s). Can someone point out the obvious to me?
thumbnail
Marco Re, modifié il y a 11 années.

RE: 5.2.3 API Help

Junior Member Publications: 29 Date d'inscription: 30/07/09 Publications récentes
Hi Andrew,
this is what you are looking for :

List
addresses = AddressLocalServiceUtil.getAddresses( user.getCompanyId(), Contact.class.getName(), user.getContact().getContactId()); List<phone> phones = PhoneLocalServiceUtil.getPhones( user.getCompanyId(), Contact.class.getName(), user.getContact().getContactId()); List<website> websites = WebsiteLocalServiceUtil.getWebsites( user.getCompanyId(), Contact.class.getName(), user.getContact().getContactId()); </website></phone>