LRP-614 practice question 6 of 25

All Service Builder entities contain a local reference to: (Please select all correct answers.)

Full set: 144 questions
Answer options
A: CounterLocaISe rv ice Correct answer
B: AssetLocaIService
C: ResourceLocalService Correct answer
D: SocialLocalService
E: WorkflowLocaISe rvice
Correct Answer:
A. CounterLocaISe rv ice; C. ResourceLocalService
Explanation

When Service Builder generates the service layer for an entity, the abstract BaseLocalServiceImpl class is created with injected references to several core Liferay services. By default, every generated service includes a reference to CounterLocalService for generating unique primary keys and ResourceLocalService to integrate with Liferay's permissions and resource framework. These are considered fundamental services for the lifecycle and security management of any custom entity within the portal.

Why Incorrect

B. AssetLocalService: This service is only injected if the entity is explicitly configured to be a Liferay Asset in the service.xml file, which is not the default for all entities.
D. SocialLocalService: This service is only injected when an entity is configured to support social features like ratings or comments; it is not a default inclusion.
E. WorkflowLocalService: This service is only injected if the entity is explicitly enabled for workflow integration, which is an optional feature and not applied to all entities by default.

References

1. Liferay Portal 6.2 Developer's Guide: In Chapter 5, "Service Builder," the guide details the code generation process. It explains that the generated BaseLocalServiceImpl class contains injected OSGi service references. The examples and descriptions consistently show counterLocalService and resourceLocalService as standard injections for managing primary keys and permissions, respectively.

Reference: Liferay, Inc. (2013). Liferay Portal 6.2 Developer's Guide. Chapter 5: Service Builder, Section: "The Service Layer," pp. 105-107.

2. Official Liferay Training Materials (LRP 614 equivalent concepts): Courseware for Liferay developer training explicitly covers the structure of Service Builder-generated code. It highlights that the BaseLocalServiceImpl is pre-populated with references to essential services like CounterLocalService and ResourceLocalService to facilitate common development tasks without manual injection. In contrast, it specifies that services like AssetLocalService or WorkflowLocalService are only included when their respective frameworks are enabled for the entity.

Scroll to Top