Skip to content

Instantly share code, notes, and snippets.

@jamesfalkner
Created February 7, 2014 14:50
Show Gist options
  • Save jamesfalkner/8863987 to your computer and use it in GitHub Desktop.
Save jamesfalkner/8863987 to your computer and use it in GitHub Desktop.
#set ($permissionThreadLocal = $portal.getClass().forName("com.liferay.portal.security.permission.PermissionThreadLocal"))
#set ($scopeGroupId = $getterUtil.getLong($request.theme-display.scope-group-id))
#set ($userLocalService = $portalBeanLocator.locate("com.liferay.portal.service.UserLocalService.velocity"))
#set ($userId = $getterUtil.getLong($request.theme-display.user-id))
#set ($portalURL = $httpUtil.getProtocol($request.attributes.CURRENT_COMPLETE_URL) + "://" + $getterUtil.getString($request.theme-display.portal-url))
#set ($themeDisplay = $portal.getClass().forName("com.liferay.portal.theme.ThemeDisplay").newInstance())
#set ($V = $themeDisplay.setCompany($company))
#set ($V = $themeDisplay.setLocale($locale))
#set ($V = $themeDisplay.setPathImage($getterUtil.getString($request.theme-display.path-image)))
#set ($V = $themeDisplay.setPathMain($getterUtil.getString($request.theme-display.path-main)))
#set ($V = $themeDisplay.setPermissionChecker($permissionThreadLocal.getPermissionChecker()))
#set ($V = $themeDisplay.setPortalURL($portalURL))
#set ($V = $themeDisplay.setScopeGroupId($scopeGroupId))
#set ($V = $themeDisplay.setTimeZone($request.theme-display.time-zone))
#set ($V = $themeDisplay.setUser($userLocalService.getUserById($userId)))
Our new themeDisplay: <pre>$themeDisplay</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment