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);

No comments:

Post a Comment