<?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: Creating  behavior  to validate the file signature in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/creating-behavior-to-validate-the-file-signature/m-p/134839#M36262</link>
    <description>&lt;P&gt;This behaviour validates electronic signatures on a file:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/keensoft/alfresco-esign-cert/blob/master/esign-cert-repo/src/main/java/es/keensoft/alfresco/behaviour/CustomBehaviour.java#L90" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/keensoft/alfresco-esign-cert/blob/master/esign-cert-repo/src/main/java/es/keensoft/alfresco/behaviour/CustomBehaviour.java#L90&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I guess you should listen to "onContentUpdate" policy instead of "onCreateNode" one.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2021 08:21:41 GMT</pubDate>
    <dc:creator>angelborroy</dc:creator>
    <dc:date>2021-01-19T08:21:41Z</dc:date>
    <item>
      <title>Creating  behavior  to validate the file signature</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/creating-behavior-to-validate-the-file-signature/m-p/134838#M36261</link>
      <description>&lt;P&gt;I am trying to fetch the content of the uploded document&amp;nbsp; but I am getting the contentReader value as null.How to get the uploaded document content on onCreateNode method?Below is the code snippet that I&amp;nbsp; was implemented&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;public void &lt;/SPAN&gt;&lt;SPAN&gt;onCreateNode&lt;/SPAN&gt;(ChildAssociationRef parentChildAssocRef) {&lt;BR /&gt;    &lt;SPAN&gt;logger&lt;/SPAN&gt;.info(&lt;SPAN&gt;"Inside onCreateNode"&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    NodeRef parentFolderRef = parentChildAssocRef.getParentRef()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    NodeRef docRef = parentChildAssocRef.getChildRef()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    System.&lt;SPAN&gt;out&lt;/SPAN&gt;.println(&lt;SPAN&gt;"onCreateNode NodeRef "&lt;/SPAN&gt;+docRef)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    ContentReader reader = &lt;SPAN&gt;this&lt;/SPAN&gt;.getContentService().getReader(docRef&lt;SPAN&gt;, &lt;/SPAN&gt;ContentModel.&lt;SPAN&gt;PROP_CONTENT&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    System.&lt;SPAN&gt;out&lt;/SPAN&gt;.println(&lt;SPAN&gt;"onCreateNode Reader "&lt;/SPAN&gt;+reader)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;}&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jan 2021 07:26:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/creating-behavior-to-validate-the-file-signature/m-p/134838#M36261</guid>
      <dc:creator>kiranmaik</dc:creator>
      <dc:date>2021-01-19T07:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating  behavior  to validate the file signature</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/creating-behavior-to-validate-the-file-signature/m-p/134839#M36262</link>
      <description>&lt;P&gt;This behaviour validates electronic signatures on a file:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/keensoft/alfresco-esign-cert/blob/master/esign-cert-repo/src/main/java/es/keensoft/alfresco/behaviour/CustomBehaviour.java#L90" target="_blank" rel="nofollow noopener noreferrer"&gt;https://github.com/keensoft/alfresco-esign-cert/blob/master/esign-cert-repo/src/main/java/es/keensoft/alfresco/behaviour/CustomBehaviour.java#L90&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I guess you should listen to "onContentUpdate" policy instead of "onCreateNode" one.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 08:21:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/creating-behavior-to-validate-the-file-signature/m-p/134839#M36262</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2021-01-19T08:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Creating  behavior  to validate the file signature</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/creating-behavior-to-validate-the-file-signature/m-p/134840#M36263</link>
      <description>&lt;P&gt;I changed the NotificationFrequency to &lt;STRONG&gt;TRANSACTION_COMMIT&lt;/STRONG&gt; in onCreateNode then I am not getting the contentReader value as null but &lt;STRONG&gt;while to am trying to fetch the content as a stream object then I am facing issue as ContentIOException.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Caused by: org.alfresco.service.cmr.repository.ContentIOException: 00190021 Failed to open stream onto channel:&lt;BR /&gt;dms-impl-acs_1 | accessor: ContentAccessor[ contentUrl=store://2021/1/19/18/47/7d2e073a-43b0-4e7d-8caa-aa180047be66.bin, mimetype=image/png, size=158162, encoding=UTF-8, locale=en_GB]&lt;/P&gt;&lt;P&gt;Below is the code snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;public void &lt;/SPAN&gt;&lt;SPAN&gt;onCreateNode&lt;/SPAN&gt;(ChildAssociationRef parentChildAssocRef) {&lt;BR /&gt;    &lt;SPAN&gt;logger&lt;/SPAN&gt;.info(&lt;SPAN&gt;"Inside onCreateNode"&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    NodeRef parentFolderRef = parentChildAssocRef.getParentRef()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    NodeRef docRef = parentChildAssocRef.getChildRef()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    System.&lt;SPAN&gt;out&lt;/SPAN&gt;.println(&lt;SPAN&gt;"onCreateNode NodeRef "&lt;/SPAN&gt;+docRef)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    ContentReader reader = &lt;SPAN&gt;this&lt;/SPAN&gt;.getContentService().getReader(docRef&lt;SPAN&gt;, &lt;/SPAN&gt;ContentModel.&lt;SPAN&gt;PROP_CONTENT&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    System.&lt;SPAN&gt;out&lt;/SPAN&gt;.println(&lt;SPAN&gt;"onCreateNode Reader "&lt;/SPAN&gt;+reader)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    InputStream originalInputStream = reader.getContentInputStream()&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;    System.&lt;SPAN&gt;out&lt;/SPAN&gt;.println(&lt;SPAN&gt;"originalInputStream "&lt;/SPAN&gt;+originalInputStream)&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;}&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jan 2021 19:06:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/creating-behavior-to-validate-the-file-signature/m-p/134840#M36263</guid>
      <dc:creator>kiranmaik</dc:creator>
      <dc:date>2021-01-19T19:06:38Z</dc:date>
    </item>
  </channel>
</rss>

