<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: onContentReadPolicy is being executed automatically withouth actually reading any node or docume in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/oncontentreadpolicy-is-being-executed-automatically-withouth/m-p/128761#M34898</link>
    <description>&lt;P&gt;Hi, i am having same issue. Did you find a solution for this?&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2023 03:12:05 GMT</pubDate>
    <dc:creator>davidzuluaga5</dc:creator>
    <dc:date>2023-09-25T03:12:05Z</dc:date>
    <item>
      <title>onContentReadPolicy is being executed automatically withouth actually reading any node or document.</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/oncontentreadpolicy-is-being-executed-automatically-withouth/m-p/128760#M34897</link>
      <description>&lt;P&gt;I created a custom behaviour that extends the onContentRead policy so that i couls execute an action every time an especific type of document is requested.&lt;/P&gt;&lt;P&gt;The thing is that this behaviour is being executed atomatically for all the documents that matches the type but without the necesity of actually requesting the document or documents.&lt;/P&gt;&lt;P&gt;How can i limit the execution of this behaviour to the scenario in which the action of requesting the document to be displayed in share is executed.&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;private &lt;/SPAN&gt;PolicyComponent &lt;SPAN&gt;eventManager&lt;/SPAN&gt;;&lt;BR /&gt;&lt;SPAN&gt;private &lt;/SPAN&gt;ServiceRegistry &lt;SPAN&gt;serviceRegistry&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public void &lt;/SPAN&gt;&lt;SPAN&gt;registerEventHandlers&lt;/SPAN&gt;() {&lt;BR /&gt;    &lt;SPAN&gt;eventManager&lt;/SPAN&gt;.bindClassBehaviour(&lt;BR /&gt;            ContentServicePolicies.OnContentReadPolicy.&lt;SPAN&gt;QNAME&lt;/SPAN&gt;,&lt;BR /&gt;            MNContentModel.&lt;SPAN&gt;TYPE_MN_GENERAL&lt;/SPAN&gt;,&lt;BR /&gt;            &lt;SPAN&gt;new &lt;/SPAN&gt;JavaBehaviour(&lt;SPAN&gt;this&lt;/SPAN&gt;, &lt;SPAN&gt;"onContentRead"&lt;/SPAN&gt;,&lt;BR /&gt;                    Behaviour.NotificationFrequency.&lt;SPAN&gt;FIRST_EVENT&lt;/SPAN&gt;));&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public void &lt;/SPAN&gt;&lt;SPAN&gt;onContentRead&lt;/SPAN&gt;(NodeRef docNodeRef) {&lt;BR /&gt;        AuthenticationUtil.&lt;SPAN&gt;runAsSystem&lt;/SPAN&gt;(()-&amp;gt; {&lt;BR /&gt;            &lt;SPAN&gt;try&lt;/SPAN&gt;{&lt;BR /&gt;                updateCount(&lt;SPAN&gt;docNodeRef&lt;/SPAN&gt;);&lt;BR /&gt;            }&lt;SPAN&gt;catch &lt;/SPAN&gt;(Exception e){&lt;BR /&gt;                System.&lt;SPAN&gt;out&lt;/SPAN&gt;.println(e.getMessage());&lt;BR /&gt;            }&lt;BR /&gt;            &lt;SPAN&gt;return null&lt;/SPAN&gt;;&lt;BR /&gt;        });&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;}&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Sep 2023 14:27:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/oncontentreadpolicy-is-being-executed-automatically-withouth/m-p/128760#M34897</guid>
      <dc:creator>santiagoposadag</dc:creator>
      <dc:date>2023-09-15T14:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: onContentReadPolicy is being executed automatically withouth actually reading any node or docume</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/oncontentreadpolicy-is-being-executed-automatically-withouth/m-p/128761#M34898</link>
      <description>&lt;P&gt;Hi, i am having same issue. Did you find a solution for this?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 03:12:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/oncontentreadpolicy-is-being-executed-automatically-withouth/m-p/128761#M34898</guid>
      <dc:creator>davidzuluaga5</dc:creator>
      <dc:date>2023-09-25T03:12:05Z</dc:date>
    </item>
  </channel>
</rss>

