Message Boards

Automate creation of Liferay Page

thumbnail
Chethan Barike, modified 5 Years ago.

Automate creation of Liferay Page

Junior Member Posts: 29 Join Date: 3/27/12 Recent Posts
How we can create Liferay pagesĀ (public/private) from the backend(Database).
I'm using Liferay version 6.2

Regards,
Chethan
thumbnail
Christoph Rabel, modified 5 Years ago.

RE: Automate creation of Liferay Page

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
You need to do this through the api.
LayoutLocalService.addLayout(...)

https://docs.liferay.com/portal/7.0/javadocs/portal-kernel/com/liferay/portal/kernel/service/LayoutLocalService.html

With that, you get an empty page. Then you would need to add portlets to it. Maybe this code helps:

https://www.programcreek.com/java-api-examples/?class=com.liferay.portal.model.LayoutTypePortlet&method=setLayoutTemplateId