I'm developing portlet with Vaadin in Liferay 6 and I need to get the ID of the community where the portlet is located. How is it done?
There is no Community entity in Liferay, it's just another kind of group (see GroupConstants
)
If you have access to a ThemeDisplay
object I think this will give you the Id of the community
long id = themeDisplay.getLayout().getGroupId();
In a struts action you can get ThemeDisplay like this:
ThemeDisplay themeDisplay =
(ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
where request
can be a RenderRequest
or an ActionRequest
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With