<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How to create content programatically</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121372274" />
  <subtitle>How to create content programatically</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121372274</id>
  <updated>2026-04-06T20:11:03Z</updated>
  <dc:date>2026-04-06T20:11:03Z</dc:date>
  <entry>
    <title>RE: How to create content programatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121375069" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121375069</id>
    <updated>2022-03-08T10:29:52Z</updated>
    <published>2022-03-08T10:29:51Z</published>
    <summary type="html">&lt;p&gt;Hi ,&lt;/p&gt;
&lt;p&gt;You can below API for creating Web Content and Page&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;//WebContent       
_journalArticleLocalService.addArticle(externalReferenceCode, userId, groupId, folderId, titleMap, descriptionMap, content, ddmStructureKey, ddmTemplateKey, serviceContext);

//Pages
 _layoutLocalService.addLayout(userId, groupId, privateLayout, parentLayoutId, name, title, description, type, hidden, friendlyURL, serviceContext)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2022-03-08T10:29:51Z</dc:date>
  </entry>
  <entry>
    <title>How to create content programatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121372273" />
    <author>
      <name>Pietro Pagani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121372273</id>
    <updated>2022-03-04T22:50:01Z</updated>
    <published>2022-03-04T21:33:40Z</published>
    <summary type="html">&lt;p&gt;Hi everyone,&lt;/p&gt;
&lt;p&gt;I need to programatically create content (both pages based on
  template and web contents) on my Liferay 7.4 instance.&lt;/p&gt;
&lt;p&gt;Basically I need to implement in Liferay a scheduled task which every
  night will fetch data from an external database and:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Create a web content by filling the fields of the underlying structure&lt;/li&gt;
  &lt;li&gt;Create a page using a specific template (it could be both a
    content page or a widget page) &lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Is this possible?&lt;/p&gt;
&lt;p&gt;Can you suggest me the best way to do that and/or provide some hints
  about which Liferay API I should use?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Pietro&lt;/p&gt;</summary>
    <dc:creator>Pietro Pagani</dc:creator>
    <dc:date>2022-03-04T21:33:40Z</dc:date>
  </entry>
</feed>
