- You can get
userId
of logged in User bythemeDisplay.getUserId()
- Using this
userId
, you can get the User's Organizations byOrganizationLocalServiceUtil.getUserOrganizations(userId)
- Then you can iterate through the Organizations to get the organizationId you require.
How to get OrganizationId after Login -Liferay
-
31-05-2022 - |
문제
I am using liferay6.I deployed my web application inside liferay.After Login,it is redirecting to one page.In that jsp page,i want to set organization id of logged in user in a javascript variable.How can i do this.Can anyone pls explain.
해결책
다른 팁
com.liferay.portal.model.Group currentGroup;
long organizationId = 0;
try {
currentGroup = themeDisplay.getLayout().getGroup();
if (currentGroup.isOrganization()) {
organizationId = currentGroup.getClassPK();
}
} catch (Exception e) {
log.error(e);
}
return organizationId;
제휴하지 않습니다 StackOverflow