LRP-614 practice question 11 of 25

Instanceable portlets: (Please select all correct answers.)

Full set: 144 questions
Answer options
A: Have unique preferences per portlet Correct answer
B: Can be added to a page multiple times Correct answer
C: Share the same data within the same site
D: Can be displayed in the Control Panel
E: Share the same data on the same page
Correct Answer:
A. Have unique preferences per portlet; B. Can be added to a page multiple times
Explanation

An instanceable portlet is defined by its ability to be placed on a page more than once. This is configured by setting the flag to true in the liferay-portlet.xml deployment descriptor. Each instance placed on a page is assigned a unique ID. This unique identification is crucial as it allows each instance to maintain its own separate set of configurations, known as portlet preferences. Consequently, two instances of the same portlet on the same page can be configured to display different information or behave differently.

Why Incorrect

C. Share the same data within the same site Data sharing is determined by the portlet's implementation (e.g., service scope), not by its instanceable nature. Instances can be configured to show completely different data.
D. Can be displayed in the Control Panel A portlet's appearance in the Control Panel is configured via , which is independent of the setting.
E. Share the same data on the same page The primary purpose of multiple instances is to have separate configurations and data; they do not inherently share data on the same page.

References

1. Liferay, Inc. (2013). Liferay Portal 6.2 Developer's Guide. Section: "liferay-portlet.xml", Page 118. The guide states, "The tag determines whether a portlet can appear multiple times on a page. If you set this to true, you can have many instances of your portlet on a single page, each with its own set of preferences."

2. Liferay, Inc. (2013). Liferay Portal 6.2 Developer's Guide. Section: "Portlet Preferences", Pages 126-127. This section explains that portlet preferences are stored on a per-portlet-instance basis, allowing for unique configurations for each instance.

3. Liferay DTDs. liferay-portlet-app610.dtd. The official DTD comment for the instanceable element states: "Set the instanceable element to true if you want to allow users to put multiple copies of the portlet on a page. Each portlet instance will have its own set of portlet preferences."

Scroll to Top