<?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>listener model create/update/delete liferay 7.1</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119817724" />
  <subtitle>listener model create/update/delete liferay 7.1</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119817724</id>
  <updated>2026-04-06T04:56:13Z</updated>
  <dc:date>2026-04-06T04:56:13Z</dc:date>
  <entry>
    <title>RE: listener model create/update/delete liferay 7.1</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119819120" />
    <author>
      <name>Alberto Imaginanet</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119819120</id>
    <updated>2020-08-23T07:00:11Z</updated>
    <published>2020-08-23T07:00:11Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Do you know how to change categories en articles? I only found these classes&lt;pre&gt;&lt;code&gt;JournalArticleLocalServiceUtil&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;AssetCategoryLocalServiceUtil&lt;/code&gt;&lt;/pre&gt;But can not find method for change categories in articles.&amp;nbsp;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Alberto Imaginanet</dc:creator>
    <dc:date>2020-08-23T07:00:11Z</dc:date>
  </entry>
  <entry>
    <title>RE: listener model create/update/delete liferay 7.1</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119820257" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119820257</id>
    <updated>2020-08-22T17:47:19Z</updated>
    <published>2020-08-22T17:47:19Z</published>
    <summary type="html">You use the service wrapper to override the add, update and delete methods.&lt;br /&gt;&lt;br /&gt;In each one you do your thing, i.e. for add/update you find the 5 w/ the &amp;#34;new&amp;#34; category, find the one to remove it and use the injected original reference to save the update. You then modify the current incoming one, either on way in or if it is easier, on way out to add the &amp;#34;new&amp;#34; category.&lt;br /&gt;&lt;br /&gt;For the delete, it&amp;#39;s about the same except you&amp;#39;re trying to find an older one to re-apply the &amp;#34;new&amp;#34; category to.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://help.liferay.com/hc/en-us/articles/360029144671-Overriding-Liferay-Services-Service-Wrappers-"&gt;https://help.liferay.com/hc/en-us/articles/360029144671-Overriding-Liferay-Services-Service-Wrappers-&lt;/a&gt;</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2020-08-22T17:47:19Z</dc:date>
  </entry>
  <entry>
    <title>RE: listener model create/update/delete liferay 7.1</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119818212" />
    <author>
      <name>Alberto Imaginanet</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119818212</id>
    <updated>2020-08-22T15:03:38Z</updated>
    <published>2020-08-22T15:03:38Z</published>
    <summary type="html">Can you explain how to use a service wrapper for this case?</summary>
    <dc:creator>Alberto Imaginanet</dc:creator>
    <dc:date>2020-08-22T15:03:38Z</dc:date>
  </entry>
  <entry>
    <title>RE: listener model create/update/delete liferay 7.1</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119819908" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119819908</id>
    <updated>2020-08-22T14:53:59Z</updated>
    <published>2020-08-22T14:53:59Z</published>
    <summary type="html">I don&amp;#39;t know that I&amp;#39;d do this inside of a model listener. I mean, conceivably it should work, but typically I look at a model listener to make a change to the current entity or perhaps mirror some or all of the current entity out to some other table or entity.&lt;br /&gt;&lt;br /&gt;But I wouldn&amp;#39;t look at it as the point to retrieve and update other entities of the same type. Because as you update those, well the model listener is going to get triggered on those, and pretty soon you&amp;#39;re left trying to decide if you should apply the update or not within the context of a model listener and things get really messy.&lt;br /&gt;&lt;br /&gt;For what you want to do, I&amp;#39;d actually use a service wrapper. Here it&amp;#39;s kind of expected that you&amp;#39;re going to be doing more work on other entities, for example, but you also won&amp;#39;t face the same kind of re-invoke when you persist the changes to the other entities.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2020-08-22T14:53:59Z</dc:date>
  </entry>
  <entry>
    <title>listener model create/update/delete liferay 7.1</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119817723" />
    <author>
      <name>Alberto Imaginanet</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119817723</id>
    <updated>2020-08-22T09:34:55Z</updated>
    <published>2020-08-22T09:34:55Z</published>
    <summary type="html">Hi everyone!!!I need to create a module with a listener that runs when news create/ edit / delete. This listener will do the following:&lt;br /&gt;- Remove featured category from all news&lt;br /&gt;- Put the featured category to the 5 most recent. Has anyone done something like this? I need some advice how to do it.&lt;br /&gt;&lt;br /&gt;Thank you!</summary>
    <dc:creator>Alberto Imaginanet</dc:creator>
    <dc:date>2020-08-22T09:34:55Z</dc:date>
  </entry>
</feed>
