<?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>Liferay 7.2 - Can I inject my code on Liferay existing classes?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114213279" />
  <subtitle>Liferay 7.2 - Can I inject my code on Liferay existing classes?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114213279</id>
  <updated>2026-04-06T20:21:57Z</updated>
  <dc:date>2026-04-06T20:21:57Z</dc:date>
  <entry>
    <title>RE: Liferay 7.2 - Can I inject my code on Liferay existing classes?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114251667" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114251667</id>
    <updated>2019-07-11T14:46:00Z</updated>
    <published>2019-07-11T14:46:00Z</published>
    <summary type="html">Matthew is right here, the model listener is the way to go. It is, in fact, the approach Liferay recommends for adding Audit tracking for adds, updates and deletes.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2019-07-11T14:46:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.2 - Can I inject my code on Liferay existing classes?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114214623" />
    <author>
      <name>Matthew K.</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114214623</id>
    <updated>2019-07-05T12:31:03Z</updated>
    <published>2019-07-05T12:31:03Z</published>
    <summary type="html">You should consider using model listeners for this purpose. Then you don&amp;#39;t have to override already existing code.</summary>
    <dc:creator>Matthew K.</dc:creator>
    <dc:date>2019-07-05T12:31:03Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7.2 - Can I inject my code on Liferay existing classes?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114213278" />
    <author>
      <name>Fabio Carvalho</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114213278</id>
    <updated>2019-07-05T11:49:30Z</updated>
    <published>2019-07-05T11:49:30Z</published>
    <summary type="html">I want to add some data to my database when the user performs some actions. If a user deletes a page for example, I want to add a row with some information on my database. To do this I would like to add one or two lines of my code into the class/method that deletes the page to add that data to my database also.&lt;br /&gt;&lt;br /&gt;I have already created the database and tried to add some rows in my table for tests purposes and is working. Now I would like to move this code to the class that process the deletion of the pages for example.&lt;br /&gt;&lt;br /&gt;It is possible to inject code of mine in the classes that already exists? What would be the best approach to do this?</summary>
    <dc:creator>Fabio Carvalho</dc:creator>
    <dc:date>2019-07-05T11:49:30Z</dc:date>
  </entry>
</feed>
