LRP-614 practice question 20 of 25

In portal.properties, the following property lists portlets that can be embedded on any page: portlet.add(default.resource.check.whitelist=3,56_INSTANCE_0000,5S,S2,S6,87,88/103,113,145,164, The property is listed in liferay-hook_6_l_0.dtd as a property that can can be overridden with a hook. The recommended way to prevent embedding the Search portlet ("3") is to create a hook plugin.

Full set: 144 questions
Answer options
A: True
B: False
Correct Answer:
[FALSE]
Explanation

The statement is false because the standard and most recommended way to override properties from portal.properties is by creating or modifying a portal-ext.properties file. While a hook plugin can be used to override a specific subset of portal properties (those listed in the liferay-hook.dtd), this method is typically reserved for when a customization needs to be packaged and deployed as a self-contained plugin. For a direct, system-wide configuration change performed by a portal administrator, using portal-ext.properties is the simpler, more direct, and conventional approach.

Why Incorrect

The "True" option is incorrect because it misrepresents Liferay's standard configuration best practices. Although technically possible to use a hook for this purpose, it is not the recommended method for general property overrides. The portal-ext.properties file is the primary and universally documented mechanism for this task.

References

1. Liferay Portal 6.2 Developer's Guide, Chapter 2: "Setting Up a Liferay Development Environment", Section: "Portal Properties".

Quote/Paraphrase: The guide explicitly states, "To override the default properties, you don’t need to edit portal.properties directly. Instead, you can create a new file called portal-ext.properties and place it in your Liferay Home folder... Liferay Portal automatically loads this file after portal.properties and your new values for the properties override the default values." This establishes portal-ext.properties as the primary override mechanism.

2. Liferay Portal 6.2 Developer's Guide, Chapter 13: "Customizing Liferay with Hooks", Section: "Overriding Portal Properties with a Hook".

Quote/Paraphrase: This section describes the capability of a hook to override portal properties: "You can override portal properties with a hook. To do so, you need to create a portal.properties file in your hook’s docroot/WEB-INF/src folder and add the element to your hook’s liferay-hook.xml file." While it explains how, it presents this as one of several hook capabilities, not as the primary method for all portal configuration. The existence of this feature in hooks is for creating self-contained, deployable applications, not for general system administration.

3. Official Liferay DTD Definition (liferay-hook620.dtd)

Reference: The DTD file itself, specifically the and sections.

Paraphrase: The DTD defines the syntax for including portal properties within a hook's deployment descriptor (liferay-hook.xml). It lists which properties are eligible for being overridden via this mechanism. The presence of portlet.add.default.resource.check.whitelist in this DTD would confirm it can be overridden by a hook, but the DTD does not provide guidance on whether this is the recommended practice compared to using portal-ext.properties. The recommendation is found in the developer and administration guides.

Scroll to Top