liferaysites

Generating large page structure Liferay 7.0


Is there any option to generate large amount of pages for Liferay 7.0?

In documentation (https://dev.liferay.com/discover/portal/-/knowledge_base/7-0/creating-sites) i found only creating pages through GUI.

I would like to use script to generate these pages, is there some sort of CLI or something more useful than mouse clicking?


Solution

  • Liferay has a script console, were you can make API calls: https://dev.liferay.com/es/discover/portal/-/knowledge_base/7-0/running-scripts-from-the-script-console

    It supports multiple languages, maybe the most interesting for java developers is groovy.

    Here there is another link focused on invoking liferay services: https://dev.liferay.com/es/discover/portal/-/knowledge_base/7-0/invoking-liferay-services-from-scripts.

    Basically you should import com.liferay.portal.kernel.service.LayoutLocalServiceUtil and then invoke some of the "add" services, this method for example, will create a layout https://github.com/liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/portal/kernel/service/LayoutLocalServiceUtil.java#L101