Liferay 7.0生成大页面结构

Generating large page structure Liferay 7.0

有没有为 Liferay 7.0 生成大量页面的选项?

在文档 (https://dev.liferay.com/discover/portal/-/knowledge_base/7-0/creating-sites) 中,我发现只能通过 GUI 创建页面。

我想使用脚本生成这些页面,有没有某种 CLI 或比鼠标单击更有用的东西?

Liferay 已满API。注意 "ServiceBuilder",因为它是为其提供大部分技术基础的组件。您还需要 API-name 页数,即 "Layout"。您会发现远程服务为 LayoutService,"local" 服务(例如,无权限检查,仅在同一 VM 内可用)为 LayoutLocalService

您很可能需要查找有关其用法的示例。我喜欢指向旧的 SevenCogs 示例(revived for 6.1,但从那以后就被忽略了)

另一种选择是检查 Liferay 的 ResourceImporter。

Liferay 有一个脚本控制台,您可以进行 API 次调用:https://dev.liferay.com/es/discover/portal/-/knowledge_base/7-0/running-scripts-from-the-script-console

它支持多种语言,java 开发人员最感兴趣的可能是 groovy。

这里有另一个link专注于调用liferay服务:https://dev.liferay.com/es/discover/portal/-/knowledge_base/7-0/invoking-liferay-services-from-scripts

基本上你应该导入 com.liferay.portal.kernel.service.LayoutLocalServiceUtil 然后调用一些 "add" 服务,例如这个方法,将创建一个布局 https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/portal/kernel/service/LayoutLocalServiceUtil.java#L101