Sunday 19 February 2012

How to get ThemeDisplay instance

Sometimes it is  needed to get ThemeDisplay, for exapmle to retrieve Company, CompanyId, User, Locale, Urls, ets. from it.

To do it you can use following code:

  
  ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
  themeDisplay.getCompanyId();
  themeDisplay.getUser();
  themeDisplay.getURLSignOut();

Also you can check WebKeys interface to see what else you can get from attributes.

No comments:

Post a Comment