Message Boards

Create journal article programmatically

Fabio Conte, modified 3 Years ago.

Create journal article programmatically

New Member Post: 1 Join Date: 11/24/20 Recent Posts

Hi,

please can you post an example to craete a JournalArticle (with custom DDMtemplate) on ifeary 7?

Regards

Fabio

 

thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Create journal article programmatically

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts

Hi,

You can use JournalArticleLocalService, it provided multiple methods for creating article . You can refer below url

https://docs.liferay.com/ce/apps/web-experience/latest/javadocs/com/liferay/journal/service/JournalArticleLocalServiceUtil.html

 

For creating custom DDM Template you can use 

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;DDMTemplateManagerUtil.addTemplate(userId, groupId, classNameId, classPK, resourceClassNameId, templateKey, nameMap, descriptionMap, type, mode, language, script, cacheable, smallImage, smallImageURL, smallImageFile, serviceContext)<br>&nbsp;

https://docs.liferay.com/portal/7.0/javadocs/portal-kernel/com/liferay/dynamic/data/mapping/kernel/DDMTemplateManagerUtil.html