Monday, 20 November 2017

Create Journal Article Programmatically

We can create journal article programmatically by using add article method

JournalArticleLocalServiceUtil.addArticle (10198, 10181, 0, nameMap, nameMap,content, "23303",ddmTemplate.getTemplateKey(), serviceContext);

To create the title map and description map use localizationutil

Creating titlemap:

String mycustomwebcontent = "New title";
Map<Locale,String> nameMap = LocalizationUtil.getLocalizationMap(mycustomwebcontent);



In template key and structure key pass your structure and template key.

And use servicecontext object

ServiceContext serviceContext = ServiceContextFactory.getInstance(request);

TEST

I am Java Developer. I have 6 year Experiance in this field and like to post in blogging. So keep sharing and like my post

0 comments:

Post a Comment

 

Copyright @ 2017 Liferay Article.