<?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 Trying to read the content of a document in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/trying-to-read-the-content-of-a-document/m-p/150393#M105275</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I am trying to read the content of a document whitin a custom action. I can get the Node and the NodeRef using browseBean.getDocument().&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I try to use fileFolderService.getReader(nodeRef) to get the content but when I call that function Alfresco throws an exception:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;java.lang.NullPointerException&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.toFileInfo(FileFolderServiceImpl.java:224)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.getReader(FileFolderServiceImpl.java:924)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.alfresco.sample.AddSignatureDialog.finishImpl(AddSignatureDialog.java:68)&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I know that the node references a document because the name and the path fields of that Node have the name of the document.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here you have the source code&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;65: Node documentNode = browseBean.getDocument();&lt;BR /&gt;66: NodeRef documentNodeRef = documentNode.getNodeRef();&lt;BR /&gt;67: fileFolderService = new FileFolderServiceImpl();&lt;BR /&gt;68: ContentReader contentReader = fileFolderService.getReader(documentNodeRef);&lt;BR /&gt;69: String contentURL = contentReader.getContentUrl();&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pau Carré Cardona&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Jul 2008 10:07:06 GMT</pubDate>
    <dc:creator>pau_carre</dc:creator>
    <dc:date>2008-07-31T10:07:06Z</dc:date>
    <item>
      <title>Trying to read the content of a document</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/trying-to-read-the-content-of-a-document/m-p/150393#M105275</link>
      <description>Hi, I am trying to read the content of a document whitin a custom action. I can get the Node and the NodeRef using browseBean.getDocument().Then I try to use fileFolderService.getReader(nodeRef) to get the content but when I call that function Alfresco throws an exception:java.lang.NullPointerExcept</description>
      <pubDate>Thu, 31 Jul 2008 10:07:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/trying-to-read-the-content-of-a-document/m-p/150393#M105275</guid>
      <dc:creator>pau_carre</dc:creator>
      <dc:date>2008-07-31T10:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to read the content of a document</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/trying-to-read-the-content-of-a-document/m-p/150394#M105276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The problem is in line # 67&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;fileFolderService = new FileFolderServiceImpl();&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;You should never instantiate a spring service bean using "new". Rather inject the service bean in your faces bean in faces-config-bean.xml and declare a "getter" and "setter" of your service bean in your custom action. This is the basic fundamental of spring's dependency injection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Aug 2008 12:00:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/trying-to-read-the-content-of-a-document/m-p/150394#M105276</guid>
      <dc:creator>algoworks</dc:creator>
      <dc:date>2008-08-10T12:00:47Z</dc:date>
    </item>
  </channel>
</rss>

