<?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: update the contents with another contents in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/update-the-contents-with-another-contents/m-p/158278#M112400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I see your point.&amp;nbsp; There is no 'copyNode' method that i can see now. Sorry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jun 2008 11:10:14 GMT</pubDate>
    <dc:creator>jos_snellings</dc:creator>
    <dc:date>2008-06-06T11:10:14Z</dc:date>
    <item>
      <title>update the contents with another contents</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-the-contents-with-another-contents/m-p/158275#M112397</link>
      <description>Hello, let me know if you can do this through Web Services. I would like to update the contents of a file in Alfresco, with the contents of another file also different in Alfresco, but I do not want to transfer thecontents through my application. It would be something like: … &amp;nbsp;&amp;nbsp; Reference theReferen</description>
      <pubDate>Thu, 05 Jun 2008 16:02:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-the-contents-with-another-contents/m-p/158275#M112397</guid>
      <dc:creator>frama</dc:creator>
      <dc:date>2008-06-05T16:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: update the contents with another contents</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-the-contents-with-another-contents/m-p/158276#M112398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes you can. In the code you posted you are reading the content from another node. Here is an example with as the input&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for the update an on-disk file. Meta-data in the original remain untouched.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reference contentReference = getReferencia(uuid, null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // read file into byte array&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; InputStream is = new FileInputStream(file);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the size of the file&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; long length = file.length();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (length &amp;gt; Integer.MAX_VALUE) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] bytes = new byte[(int) length];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Read in the bytes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int offset = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int numRead = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (offset &amp;lt; bytes.length&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp; (numRead = is.read(bytes, offset, bytes.length - offset)) &amp;gt;= 0) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; offset += numRead;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Ensure all the bytes have been read in&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (offset &amp;lt; bytes.length) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new IOException("Could not completely read file " + file.getName());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Close the input stream and return bytes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; is.close();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContentFormat cf = new ContentFormat(&amp;lt;themimetype&amp;gt;, &amp;lt;theencoding&amp;gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; contentService.write(contentReference, Constants.PROP_CONTENT, bytes, cf);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2008 09:06:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-the-contents-with-another-contents/m-p/158276#M112398</guid>
      <dc:creator>jos_snellings</dc:creator>
      <dc:date>2008-06-06T09:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: update the contents with another contents</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-the-contents-with-another-contents/m-p/158277#M112399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's what I'm doing now. The problem is that communication between my application and Alfresco is slow and that means downloading and then upload again. What we do is pass it may require a node to another without passing the inputstram for my application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2008 09:24:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-the-contents-with-another-contents/m-p/158277#M112399</guid>
      <dc:creator>frama</dc:creator>
      <dc:date>2008-06-06T09:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: update the contents with another contents</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-the-contents-with-another-contents/m-p/158278#M112400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I see your point.&amp;nbsp; There is no 'copyNode' method that i can see now. Sorry.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2008 11:10:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-the-contents-with-another-contents/m-p/158278#M112400</guid>
      <dc:creator>jos_snellings</dc:creator>
      <dc:date>2008-06-06T11:10:14Z</dc:date>
    </item>
  </channel>
</rss>

