LRP-614 practice question 12 of 25
The method to retrieve a list of users added directly to an organization is:
Full set: 144 questionsIn Liferay's service-oriented architecture, the service utility class corresponding to the primary entity being retrieved is the most appropriate one to use. Since the goal is to retrieve a list of User objects, UserLocalServiceUtil is the correct service. The method getOrganizationUsers(long organizationId) is specifically designed for this purpose, fetching all users directly assigned to the specified organization. While other services might offer convenience wrappers, the core implementation and the most direct API call resides within the UserLocalService.
A. While OrganizationLocalServiceUtil.getOrganizationUsers() exists, it is a convenience method that internally delegates the call to UserLocalServiceUtil, making B the more direct and primary choice.
C. The GroupLocalServiceUtil class does not have a method named getOrganizationUsers(). Its methods operate on generic Group entities, not specifically organizations.
D. This option is incorrect because option C is invalid, and option A is a less direct method than the primary implementation found in option B.
1. Liferay Portal 6.1 CE Javadocs, com.liferay.portal.service.UserLocalService interface. The documentation specifies the method getOrganizationUsers(long organizationId) which returns the list of users associated with the organization. This is the primary service for user-related operations. (Reference: com.liferay.portal.service.UserLocalService#getOrganizationUsers(long))
2. Liferay Portal 6.1 CE Javadocs, com.liferay.portal.service.OrganizationLocalService interface. The documentation for getOrganizationUsers(long organizationId) in this service often indicates that it is a wrapper. The source code for its implementation (OrganizationLocalServiceImpl) confirms it delegates the call directly to userLocalService.getOrganizationUsers(organizationId). (Reference: com.liferay.portal.service.OrganizationLocalService#getOrganizationUsers(long))
3. Liferay Portal 6.1 CE Javadocs, com.liferay.portal.service.GroupLocalService interface. A review of this service's API shows the absence of a getOrganizationUsers method, confirming that option C is invalid. (Reference: com.liferay.portal.service.GroupLocalService API documentation).
Keep practicing
Take the free LRP-614 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other LRP-614 practice questions
- Question 1The best way to add a new language key to the portal is through:
- Question 2In a JSP that includes the tag, the method to check permissions is:
- Question 3A hook plugin can be used to: (Please select all correct answers.)
- Question 4An administrator would like to add a new travel preferences section in the Miscellaneous …
- Question 5The following statements about plugins are true: (Please select all correct answers.)
- Question 6All Service Builder entities contain a local reference to: (Please select all correct ans…
