LRP-614 practice question 18 of 25

When adding new users to Liferay, the form will display the Details, Organizations and Personal Site sections based on the following property in…

Full set: 144 questions
When adding new users to Liferay, the form will display the Details, Organizations and Personal Site sections based on the following property in portal.properties: users.form.add.main =detaiIs,organizations,personal-site The "users.form.add.main" property is listed in the liferay-hook_6_l_0.dtd as a portal property that can be overridden with a hook. Deploying a hook with the following property in the portal.properties file will remove the Personal Site section: users.form.add.main =details,organizations
Answer options
A: True
B: False
Correct Answer:
TRUE
Explanation

The statement is correct. In Liferay 6.1, a hook plugin is the standard mechanism for overriding a defined subset of properties from the core portal.properties file. The users.form.add.main property specifically controls which JSP segments are included in the "Add User" form in the Control Panel. The question correctly states that this property is defined in the liferay-hook610.dtd as being overridable. By deploying a hook that contains its own portal.properties file with the line users.form.add.main=details,organizations, the hook's property value will take precedence over the default portal value. Consequently, when Liferay renders the "Add User" form, it will only include the details and organizations sections, effectively removing the personal-site section from the user interface.

Why Incorrect

The "False" option is incorrect because the described process is a fundamental and intended feature of the Liferay hook architecture. Hooks are designed to allow such customizations, including the modification of portal properties, without altering the core Liferay source code. The mechanism described in the question is the precise, officially sanctioned method for achieving this specific UI modification.

References

1. Liferay Portal 6.1 Developer's Guide: Chapter 10, "Hooks". The section "Overriding and Adding Portal Properties" details this exact mechanism. It explains that to override portal properties, you create a portal.properties file in your hook's docroot/WEB-INF/src directory and specify the new values. The guide confirms that only a specific list of properties can be overridden this way.

2. Liferay Portal 6.1 Source Code (portal-impl/src/portal.properties): The default portal.properties file within the Liferay source code defines the property and its default value:

properties

Input a list of comma delimited sections that will be displayed in the user

form.

users.form.add.main=details,organizations,personal-site

users.form.update.main=details,password,organizations,personal-site,roles,user-groups,communities

This confirms the property's existence and purpose.

3. Liferay Portal 6.1 DTD (liferay-hook610.dtd): This Document Type Definition file, which governs the structure of the liferay-hook.xml deployment descriptor, includes the element. The existence of this element in the DTD is the formal declaration that a hook can contain a file to override portal properties.

xml

This structure indicates that the liferay-hook.xml file can point to a properties file for overriding portal settings.

Scroll to Top