<?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: Behavior for onAccess of a document in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25756#M11127</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Krutik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to be able to update a property on document access. I tried using the onContentRead behavior, it is getting called only when I am viewing the whole content from browser and not just browsing the properties.&amp;nbsp; My code is like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.onContentRead = new JavaBehaviour(this, OnContentReadPolicy.QNAME.getLocalName(), NotificationFrequency.TRANSACTION_COMMIT);&lt;BR /&gt; this.policyComponentImpl.bindClassBehaviour(OnContentReadPolicy.QNAME, QName.createQName(MODEL_URI, MODEL_NAME), this.onContentRead);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;public void onContentRead(NodeRef nodeRef) is not getting called while accessing the properties. Is there any other configuration that I am missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Dec 2017 08:14:06 GMT</pubDate>
    <dc:creator>vijisankar</dc:creator>
    <dc:date>2017-12-21T08:14:06Z</dc:date>
    <item>
      <title>Behavior for onAccess of a document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25754#M11125</link>
      <description>Hello,I have a requirement to be able to update a property on access of a document. I could not use the onContentRead behavior as it is called only when I read the content of the document. My requirement is a behavior or any other way I can update a property when the document is even accessed from t</description>
      <pubDate>Thu, 21 Dec 2017 06:16:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25754#M11125</guid>
      <dc:creator>vijisankar</dc:creator>
      <dc:date>2017-12-21T06:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior for onAccess of a document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25755#M11126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is only one behavior in alfresco ,which is onContentRead , which is getting called when you read the content property of the document.This will even get called from share when you open document details of view in alfresco.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What i did not get is&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&lt;SPAN style="color: #727174;"&gt;&amp;nbsp;you need an event which gets fired when document is accessed from share.I think&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d;"&gt;onContentRead&amp;nbsp; should full fill your requirement.Can you explain the reason why it is not suitable for your requirement.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2017 07:58:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25755#M11126</guid>
      <dc:creator>krutik_jayswal</dc:creator>
      <dc:date>2017-12-21T07:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior for onAccess of a document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25756#M11127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Krutik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is to be able to update a property on document access. I tried using the onContentRead behavior, it is getting called only when I am viewing the whole content from browser and not just browsing the properties.&amp;nbsp; My code is like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.onContentRead = new JavaBehaviour(this, OnContentReadPolicy.QNAME.getLocalName(), NotificationFrequency.TRANSACTION_COMMIT);&lt;BR /&gt; this.policyComponentImpl.bindClassBehaviour(OnContentReadPolicy.QNAME, QName.createQName(MODEL_URI, MODEL_NAME), this.onContentRead);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;public void onContentRead(NodeRef nodeRef) is not getting called while accessing the properties. Is there any other configuration that I am missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2017 08:14:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25756#M11127</guid>
      <dc:creator>vijisankar</dc:creator>
      <dc:date>2017-12-21T08:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior for onAccess of a document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25757#M11128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that case , you don't have choice, other writing the Spring method interceptor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using this&amp;nbsp; you can intercept the method, meaning you can call your own method whenever the specified method in specified object is called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case you need to intercept method of nodeService.Method names are getProperty and getProperties.Below link contains more information on Spring&amp;nbsp;&lt;SPAN&gt;method interceptor.You can google it for more details.&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.journaldev.com/2676/spring-mvc-interceptor-example-handlerinterceptor-handlerinterceptoradapter" title="https://www.journaldev.com/2676/spring-mvc-interceptor-example-handlerinterceptor-handlerinterceptoradapter" rel="nofollow noopener noreferrer"&gt;Spring MVC Interceptor HandlerInterceptorAdapter, HandlerInterceptor Example - JournalDev&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2017 08:26:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25757#M11128</guid>
      <dc:creator>krutik_jayswal</dc:creator>
      <dc:date>2017-12-21T08:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Behavior for onAccess of a document</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25758#M11129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh thank you Krutik, I will try that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Dec 2017 08:29:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/behavior-for-onaccess-of-a-document/m-p/25758#M11129</guid>
      <dc:creator>vijisankar</dc:creator>
      <dc:date>2017-12-21T08:29:17Z</dc:date>
    </item>
  </channel>
</rss>

