public class UIPortalNavigationPortlet extends UIPortletApplication {
public static final int DEFAULT_LEVEL = 2;
public UIPortalNavigationPortlet() throws Exception {
PortletRequestContext context = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
PortletRequest prequest = context.getRequest();
PortletPreferences prefers = prequest.getPreferences();
int level = DEFAULT_LEVEL;
try {
level = Integer.valueOf(prefers.getValue("level", String.valueOf(DEFAULT_LEVEL)));
} catch (Exception ex) {
log.warn("Preference for navigation level can only be integer");