How to get global (company) group id in Liferay?

前端 未结 4 1245
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-08 04:27

How to get the global (company) group id in Liferay without accessing ThemeDisplay?

P.S.: with ThemeDisplay it is simple: themeDisplay.ge

4条回答
  •  醉梦人生
    2021-02-08 04:52

    When you have only one Company in your portal:

    Company company = CompanyLocalServiceUtil.getCompanyByMx(PropsUtil.get(PropsKeys.COMPANY_DEFAULT_WEB_ID));
    long globalGroupId = company.getGroup().getGroupId(); 
    

提交回复
热议问题