In Liferay 6.1, one of the new built in features are the Mobile Device Rules. To add a custom rule handler, it’s fairly simple. You need to create a hook with the following liferay-hook.xml:

<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.1.0//EN"
In the portal properties, set a application startup hook.
Then, in the test startup action:
package com.xtivia;
public class CustomRuleHandlerStartupAction extends SimpleAction {
    private static CustomRuleHandler _customRuleHandler = new CustomRuleHandler();
    public void run(String[] ids) throws ActionException {
The CustomRuleHandler class needs to implement the interface, and the default implementation is contained within the class.
Share This