<?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: An oddness phenomenon in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89141#M60564</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK.&amp;nbsp; I think I got that :wink:&amp;nbsp; You want to inject a header into a document.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this case, you are trying to modify the underlying binary file directly.&amp;nbsp; This breaks the concurrency model completely.&amp;nbsp; Also, you are restricting users of your modified system from choosing the content store they wish to use.&amp;nbsp; You are forcing everyone onto a single filestore with possible concurrency problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to&lt;/SPAN&gt;&lt;UL&gt;Get the &lt;EM&gt;ContentReader&lt;/EM&gt; from the &lt;EM&gt;ContentService&lt;/EM&gt;.&lt;BR /&gt;Get a temporary file using &lt;EM&gt;TempFileProvider&lt;/EM&gt;.&amp;nbsp; Make sure that you give the &lt;STRONG&gt;.doc&lt;/STRONG&gt; extension.&lt;BR /&gt;Create a &lt;EM&gt;FileContentWriter&lt;/EM&gt; on top of the temp file.&lt;BR /&gt;&lt;EM&gt;putContent(ContentReader)&lt;/EM&gt; from the reader to the temp writer.&lt;BR /&gt;Get the header text.&lt;BR /&gt;Do your file manipulation against the temp file.&lt;BR /&gt;Get a &lt;EM&gt;ContentWriter&lt;/EM&gt; for the node using the &lt;EM&gt;ContentService&lt;/EM&gt;.&lt;BR /&gt;Write the temp file to the node's content using &lt;EM&gt;putContent(File)&lt;/EM&gt;.&lt;/UL&gt;&lt;SPAN&gt;This is the safe way to do it.&amp;nbsp; Take a look at the &lt;/SPAN&gt;&lt;EM&gt;PdfBoxContentTransformer&lt;/EM&gt;&lt;SPAN&gt; and the &lt;/SPAN&gt;&lt;EM&gt;OpenOfficeContentTransformer&lt;/EM&gt;&lt;SPAN&gt; for similar examples of manipulating files.&amp;nbsp; Absolutely do not attempt to modify the underlying binaries directly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Aug 2007 11:44:06 GMT</pubDate>
    <dc:creator>derek</dc:creator>
    <dc:date>2007-08-01T11:44:06Z</dc:date>
    <item>
      <title>An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89138#M60561</link>
      <description>I do some thing&amp;nbsp; about&amp;nbsp; the&amp;nbsp; upload file with openoffice . And&amp;nbsp; now&amp;nbsp; i&amp;nbsp; open&amp;nbsp; the&amp;nbsp; upload&amp;nbsp; file&amp;nbsp; in http://locohost:8080/alfresco/webdav is what i want ;but i open with&amp;nbsp; the file linked&amp;nbsp; is&amp;nbsp; not same as i want . and&amp;nbsp; the file has&amp;nbsp; only&amp;nbsp; one version . the is&amp;nbsp; my code /* * Copyright (C) 2005-2007 Alfr</description>
      <pubDate>Fri, 13 Jul 2007 00:52:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89138#M60561</guid>
      <dc:creator>xietengfei</dc:creator>
      <dc:date>2007-07-13T00:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89139#M60562</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you give a description of what you would like to have happen.&amp;nbsp; Particularly, what is the &lt;/SPAN&gt;&lt;STRONG&gt;save&lt;/STRONG&gt;&lt;SPAN&gt; method meant to be doing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 15:21:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89139#M60562</guid>
      <dc:creator>derek</dc:creator>
      <dc:date>2007-07-31T15:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89140#M60563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I&amp;nbsp; find&amp;nbsp; the&amp;nbsp; contentdata ,and&amp;nbsp; find the url, and&amp;nbsp; i have another MS OFFICE&amp;nbsp; TO insert it.and i open it in the&amp;nbsp; ui,it is the&amp;nbsp; same .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the same is do some things to do it&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 02:05:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89140#M60563</guid>
      <dc:creator>xietengfei</dc:creator>
      <dc:date>2007-08-01T02:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89141#M60564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK.&amp;nbsp; I think I got that :wink:&amp;nbsp; You want to inject a header into a document.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this case, you are trying to modify the underlying binary file directly.&amp;nbsp; This breaks the concurrency model completely.&amp;nbsp; Also, you are restricting users of your modified system from choosing the content store they wish to use.&amp;nbsp; You are forcing everyone onto a single filestore with possible concurrency problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to&lt;/SPAN&gt;&lt;UL&gt;Get the &lt;EM&gt;ContentReader&lt;/EM&gt; from the &lt;EM&gt;ContentService&lt;/EM&gt;.&lt;BR /&gt;Get a temporary file using &lt;EM&gt;TempFileProvider&lt;/EM&gt;.&amp;nbsp; Make sure that you give the &lt;STRONG&gt;.doc&lt;/STRONG&gt; extension.&lt;BR /&gt;Create a &lt;EM&gt;FileContentWriter&lt;/EM&gt; on top of the temp file.&lt;BR /&gt;&lt;EM&gt;putContent(ContentReader)&lt;/EM&gt; from the reader to the temp writer.&lt;BR /&gt;Get the header text.&lt;BR /&gt;Do your file manipulation against the temp file.&lt;BR /&gt;Get a &lt;EM&gt;ContentWriter&lt;/EM&gt; for the node using the &lt;EM&gt;ContentService&lt;/EM&gt;.&lt;BR /&gt;Write the temp file to the node's content using &lt;EM&gt;putContent(File)&lt;/EM&gt;.&lt;/UL&gt;&lt;SPAN&gt;This is the safe way to do it.&amp;nbsp; Take a look at the &lt;/SPAN&gt;&lt;EM&gt;PdfBoxContentTransformer&lt;/EM&gt;&lt;SPAN&gt; and the &lt;/SPAN&gt;&lt;EM&gt;OpenOfficeContentTransformer&lt;/EM&gt;&lt;SPAN&gt; for similar examples of manipulating files.&amp;nbsp; Absolutely do not attempt to modify the underlying binaries directly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 11:44:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89141#M60564</guid>
      <dc:creator>derek</dc:creator>
      <dc:date>2007-08-01T11:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89142#M60565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks,that is what i want&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 09:47:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89142#M60565</guid>
      <dc:creator>xietengfei</dc:creator>
      <dc:date>2007-08-02T09:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89143#M60566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Get a temporary file using TempFileProvider. Make sure that you give the .doc extension. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Create a FileContentWriter on top of the temp file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 00:48:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89143#M60566</guid>
      <dc:creator>xietengfei</dc:creator>
      <dc:date>2007-08-03T00:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89144#M60567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;EM&gt;TempFileProvider&lt;/EM&gt;&lt;SPAN&gt; is just a convenience.&amp;nbsp; If you just create a temporary file directly, be sure to delete it safely in the method's &lt;/SPAN&gt;&lt;EM&gt;finally&lt;/EM&gt;&lt;SPAN&gt; block.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can copy the content to the temporary file using &lt;/SPAN&gt;&lt;EM&gt;reader.getContent(File)&lt;/EM&gt;&lt;SPAN&gt; as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 01:09:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89144#M60567</guid>
      <dc:creator>derek</dc:creator>
      <dc:date>2007-08-03T01:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89145#M60568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;and&amp;nbsp; how&amp;nbsp; can&amp;nbsp; put the&amp;nbsp; head on the top ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 02:01:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89145#M60568</guid>
      <dc:creator>xietengfei</dc:creator>
      <dc:date>2007-08-03T02:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89146#M60569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That question is probably best asked on the OO dev forums.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 02:06:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89146#M60569</guid>
      <dc:creator>derek</dc:creator>
      <dc:date>2007-08-03T02:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: An oddness phenomenon</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89147#M60570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thanks derek&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2007 02:11:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/an-oddness-phenomenon/m-p/89147#M60570</guid>
      <dc:creator>xietengfei</dc:creator>
      <dc:date>2007-08-03T02:11:47Z</dc:date>
    </item>
  </channel>
</rss>

