<?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>Updating JournalArticles programmatically</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=92470354" />
  <subtitle>Updating JournalArticles programmatically</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=92470354</id>
  <updated>2026-05-24T16:58:28Z</updated>
  <dc:date>2026-05-24T16:58:28Z</dc:date>
  <entry>
    <title>RE: Updating JournalArticles programmatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92523643" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92523643</id>
    <updated>2017-08-01T10:13:05Z</updated>
    <published>2017-08-01T10:13:05Z</published>
    <summary type="html">Does deleting the caches in the service administration help? (Or a restart)&lt;br /&gt;Also, please check the database for differences between the new entry and the old one. e.g. a status might be set.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2017-08-01T10:13:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: Updating JournalArticles programmatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92478250" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92478250</id>
    <updated>2017-07-31T14:25:05Z</updated>
    <published>2017-07-31T14:25:05Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;bernd kopinits:&lt;/div&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt;Validate the interface if you haven&amp;#39;t exchanged any ids&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Sorry, I&amp;#39;m not sure what you mean by that.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I meant: Double-Check that you didn&amp;#39;t exchange some parameters - e.g. the different IDs you provide etc. This is one of the easy to miss problems. Look up the interface, be 200% sure that everything is in the right order.&lt;br /&gt;&lt;br /&gt;As I said above: Let&amp;#39;s start with what&amp;#39;s easy to rule out. Sorry, if this all sounds trivial - everything you write sounds like it should work. Seems reasonable to hunt for the easily missed simple things first...</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2017-07-31T14:25:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: Updating JournalArticles programmatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92474377" />
    <author>
      <name>bernd kopinits</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92474377</id>
    <updated>2017-07-31T12:15:58Z</updated>
    <published>2017-07-31T12:15:58Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt;Validate the interface if you haven't exchanged any ids&lt;/em&gt;&lt;br&gt;Sorry, I'm not sure what you mean by that.&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;The new content should be XML and might have multiple languages. You might only update one language version&lt;/em&gt;&lt;br&gt;the content before the update looks like&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;!--?xml version="1.0"?--&amp;gt;
 
 &amp;lt;root available-locales="de_DE" default-locale="de_DE"&amp;gt;
 	&amp;lt;static-content language-id="de_DE"&amp;gt;hello there&amp;lt;/static-content&amp;gt;
 &amp;lt;/root&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;the content after the update&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;!--?xml version="1.0"?--&amp;gt;
 
 &amp;lt;root available-locales="de_DE" default-locale="de_DE"&amp;gt;
 	&amp;lt;static-content language-id="de_DE"&amp;gt;hello today&amp;lt;/static-content&amp;gt;
 &amp;lt;/root&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;all that has changed is the string inside of the cdata.&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Are you running a cluster, update it on one machine, then access it on the other? In that case this points to a flawed cluster setup&lt;/em&gt;&lt;br&gt;the process is running an my local dev client, so no clustering.&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>bernd kopinits</dc:creator>
    <dc:date>2017-07-31T12:15:58Z</dc:date>
  </entry>
  <entry>
    <title>RE: Updating JournalArticles programmatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92468559" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92468559</id>
    <updated>2017-07-31T10:21:41Z</updated>
    <published>2017-07-31T10:21:41Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I'm trying to make this code a bit more readable by introducing line breaks&lt;br&gt;&lt;div class="quote-title"&gt;bernd kopinits:&lt;/div&gt;&lt;blockquote&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;JournalArticle newArticle = JournalArticleLocalServiceUtil.addArticle(
    userId, groupId, folderId, 
    titleMap, descMap, content, 
    structureKey, templateKey, sc);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Later we're trying to update article's content programmatically with this call&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;JournalArticle updatedArticle = JournalArticleLocalServiceUtil.updateArticle(
    userId, groupId, newArticle.getFolderId(), newArticle.getArticleId(), 
    newArticle.getVersion(), newArticle.getTitleMap(), newArticle.getDescriptionMap(), 
    newContent, newArticle.getLayoutUuid(), sc);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;While debugging, the content property of the updatedArticle variable shows the new content. In the database a new minorversion is created with the correct content. However when we open the article, we can see the new versionnumber but the content is the old one. Why are we presented with the old content?&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;br&gt;The two easiest points (please check): &lt;br&gt;&lt;ul&gt;&lt;li&gt;Validate the interface if you haven't exchanged any ids&lt;/li&gt;&lt;li&gt;The new content should be XML and might have multiple languages. You might only update one language version&lt;/li&gt;&lt;li&gt;Are you running a cluster, update it on one machine, then access it on the other? In that case this points to a flawed cluster setup&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;&lt;br&gt;It might be something less (or even more) obvious, but these are the quick-to-check points, assuming that you following the debugger closely, would have caught the easiest cases.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2017-07-31T10:21:41Z</dc:date>
  </entry>
  <entry>
    <title>Updating JournalArticles programmatically</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92470353" />
    <author>
      <name>bernd kopinits</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=92470353</id>
    <updated>2017-07-31T10:03:47Z</updated>
    <published>2017-07-31T10:03:47Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hello, we're using Liferay 6.2 SP17 and creating articles programmatically with this API call&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;JournalArticle newArticle = JournalArticleLocalServiceUtil.addArticle(userId, groupId, folderId, titleMap, descMap, content, structureKey, templateKey, sc);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Later we're trying to update article's content programmatically with this call&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;JournalArticle updatedArticle = JournalArticleLocalServiceUtil.updateArticle(userId, groupId, newArticle.getFolderId(), newArticle.getArticleId(), newArticle.getVersion(), newArticle.getTitleMap(), newArticle.getDescriptionMap(), newContent, newArticle.getLayoutUuid(), sc);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;While debugging, the content property of the updatedArticle variable shows the new content. In the database a new minorversion is created with the correct content. However when we open the article, we can see the new versionnumber but the content is the old one. Why are we presented with the old content?&lt;br&gt;&lt;br&gt;Thanks, Bernd&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>bernd kopinits</dc:creator>
    <dc:date>2017-07-31T10:03:47Z</dc:date>
  </entry>
</feed>
