PortletRequestContext context = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
PortletRequest prequest = context.getRequest();
PortletPreferences prefers = prequest.getPreferences();
String template = prefers.getValue("template", "app:/groovy/portal/webui/component/UIPortalNavigation2.gtmpl");
UIPortalNavigation2 portalNavigation = addChild(UIPortalNavigation2.class, "UIHorizontalNavigation", null);
portalNavigation.setUseAjax(Boolean.valueOf(prefers.getValue("useAJAX", "true")));
portalNavigation.setTemplate(template);
}