且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Liferay中以编程方式获取页面的url

更新时间:2023-01-02 11:08:26

用于访问Liferay中的页面的API是LayoutService.但是,页面名称在Liferay中不是唯一的,而且它们是国际化的.因此,除了名称之外,您还需要页面具有一些唯一的属性来检索其url.

The API to access pages in Liferay is the LayoutService. However, page names are not unique in Liferay and furthermore they are internationalized. So you need some unique property for a page to retrieve its url, besides its name.

如果确实只有页面名称,则可以使用LayoutLocalServiceUtil.getLayouts(...)遍历所有Layouts并检查某些属性(在本例中为属性名称).

If you really only have the page name, you can use LayoutLocalServiceUtil.getLayouts(...) to loop over all Layouts and check for some property (in this case its name).