A portal properties hook lets you override a subset of
portal properties
that define event actions, model listeners, validators, generators, and content
sanitizers. The
liferay-hook-6.2.dtd
file
lists these properties.
Some portal properties accept multiple values. For example, the
login.event.pre
property lets you define multiple action classes to invoke
before login. Deploying multiple hooks that set such a portal property appends
the values to the property’s current value. For example, multiple
hooks that add login event actions
append their action classes to the portal instance’s login.event.pre
property. Refer to the
portal property reference documentation
to determine whether a property accepts multiple values. The property
description might explicitly mention it or show value lists assigned to a
default or example property setting.
Some portal properties accept a
single value only. For example, the terms.of.use.required
property is either true
or
false
. Modify single value properties from one hook only; otherwise there’s no telling which value will be assigned.
Here’s how to override a portal property using a Hook:
-
Create a Hook plugin using Liferay @ide@, the Plugins SDK, or Maven.
-
In the plugin’s
WEB-INF/src
folder, create aportal.properties
file and override properties with the values you want. -
In the plugin’s
WEB-INF/liferay-hook.xml
file, add the followingportal-properties
element as a child of thehook
element. Refer to theliferay-hook-6.2.dtd
file for details.<portal-properties>portal.properties</portal-properties>
You’ve modified the portal property. The Server Administration page’s Properties screen in the Control Panel shows your new property setting.
Related Topics
Creating Plugins using Liferay @ide@