<?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 Problem while reading document content in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/problem-while-reading-document-content/m-p/38228#M20260</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Version details : Alfresco 1.3 / Tomcat 5.5.12 / JDK 1.5 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;environment (an Alfresco bundle - downloaded from alfresco site)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have 2 spaces in the repository&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - test01&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - test02&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a simple workflow setup such that content will be move from test01 to test02. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is rule setup on space test02, whenever a new file/content arrives in test02, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;it will trigger an action which calls an external java application and passes the &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;node-uuid of the document to it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The application will query back the repository using the uuid reference &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;via WebServices API and gets the file from repository and saves it to the local file system.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here the problem is that whenever the application queries and get the file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;it always ended up with NULL value. But if i try with node reference&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;of a document which is there on the repository some time before, then &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i am able to get the file and other meta data associated with it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is failing every other case like if the application queries the repository&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using the uuid sent by the action set on space test02.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I expect that the problem is due to immediate querying of the alfresco&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; where it is not yet done with storing the file completely in the repository.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can anybody give me some idea of how to handle this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following is the code snap i used and the *ed is the line where it throws me the NULL value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;AuthenticationUtils.startSession(user, pwd);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Store store = new Store(StoreEnum.workspace, "SpacesStore");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Reference reference = new Reference(store,uuid,null);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Predicate predicate = new Predicate(new Reference[]{reference}, store, null);&lt;BR /&gt;&amp;nbsp; RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();&lt;BR /&gt;//At this line it is not able to get the nodes.&lt;BR /&gt;&amp;nbsp; ***&amp;nbsp;&amp;nbsp; Node[] nodes = repositoryService.get(predicate);&lt;BR /&gt;&amp;nbsp; ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();&lt;BR /&gt;&amp;nbsp; Content[] readResult = contentService.read(predicate,Constants.PROP_CONTENT);&lt;BR /&gt;&amp;nbsp; fileName = Calendar.getInstance().getTime().toString()+".out";&lt;BR /&gt;&amp;nbsp; File filePath&amp;nbsp; = new File(dirName,fileName);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContentUtils.copyContentToFile(readResult[0],finalFilePath);&lt;BR /&gt;AuthenticationUtils.endSession();&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pavan Ramadugula&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Aug 2006 20:15:11 GMT</pubDate>
    <dc:creator>pavan_kumar</dc:creator>
    <dc:date>2006-08-11T20:15:11Z</dc:date>
    <item>
      <title>Problem while reading document content</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-while-reading-document-content/m-p/38228#M20260</link>
      <description>Hi All,Version details : Alfresco 1.3 / Tomcat 5.5.12 / JDK 1.5 environment (an Alfresco bundle - downloaded from alfresco site)We have 2 spaces in the repository&amp;nbsp; - test01&amp;nbsp; - test02There is a simple workflow setup such that content will be move from test01 to test02. There is rule setup on space te</description>
      <pubDate>Fri, 11 Aug 2006 20:15:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-while-reading-document-content/m-p/38228#M20260</guid>
      <dc:creator>pavan_kumar</dc:creator>
      <dc:date>2006-08-11T20:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while reading document content</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-while-reading-document-content/m-p/38229#M20261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i am not an expert but try this.I suggest you to query the file before you read so that you know if the file is there in Alfresco.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Aug 2006 06:49:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-while-reading-document-content/m-p/38229#M20261</guid>
      <dc:creator>seshu</dc:creator>
      <dc:date>2006-08-13T06:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem while reading document content</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-while-reading-document-content/m-p/38230#M20262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, I tried that too, its not even able to find the node reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That seems to be the actual trouble.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Probably the alfresco's persistence layer has not updated the infomation of the document &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by the time the java code is querying back using the WS API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pavan Ramadugula&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Aug 2006 12:28:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-while-reading-document-content/m-p/38230#M20262</guid>
      <dc:creator>pavan_kumar</dc:creator>
      <dc:date>2006-08-16T12:28:38Z</dc:date>
    </item>
  </channel>
</rss>

