<?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: Howto Change Mimetype for Existing Content in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/howto-change-mimetype-for-existing-content/m-p/192869#M145999</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure. That's how I would try it. It could be a defect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps that only works if you're actually going to go ahead and write something using the channel you get from the ContentWriter…?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be a shame to stream the content out and then back in though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe try opening up random access channel and then force write-flush, with the 'metadata' param as true:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;fileChannel = contentWriter.getFileChannel(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;contentWriter.setMimetype("text/plain");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fileChannel.force(true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fileChannel.close();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;…?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jan 2009 10:25:41 GMT</pubDate>
    <dc:creator>tommorris</dc:creator>
    <dc:date>2009-01-27T10:25:41Z</dc:date>
    <item>
      <title>Howto Change Mimetype for Existing Content</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/howto-change-mimetype-for-existing-content/m-p/192868#M145998</link>
      <description>How would I change the mime-type on a piece of existing content?I have tried several methods and none seem to work.&amp;nbsp; The program executes with no problem, it just doesn't do anything to the content.Method 1: Using the ContentWriterTransactionService transactionService = serviceRegistry.getTransactio</description>
      <pubDate>Wed, 21 Jan 2009 18:07:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/howto-change-mimetype-for-existing-content/m-p/192868#M145998</guid>
      <dc:creator>stevewickii</dc:creator>
      <dc:date>2009-01-21T18:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Howto Change Mimetype for Existing Content</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/howto-change-mimetype-for-existing-content/m-p/192869#M145999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure. That's how I would try it. It could be a defect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps that only works if you're actually going to go ahead and write something using the channel you get from the ContentWriter…?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be a shame to stream the content out and then back in though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe try opening up random access channel and then force write-flush, with the 'metadata' param as true:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;fileChannel = contentWriter.getFileChannel(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;contentWriter.setMimetype("text/plain");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fileChannel.force(true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fileChannel.close();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;…?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2009 10:25:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/howto-change-mimetype-for-existing-content/m-p/192869#M145999</guid>
      <dc:creator>tommorris</dc:creator>
      <dc:date>2009-01-27T10:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Howto Change Mimetype for Existing Content</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/howto-change-mimetype-for-existing-content/m-p/192870#M146000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can set the mimetype using the NodeService instead:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;ContentData cd = (ContentData) nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT);&lt;BR /&gt;ContentData newCD = ContentData.setMimetype(cd, "other/mimetype");&lt;BR /&gt;nodeService.setProperty(nodeRef, ContentModel.PROP_CONTENT, newCD);&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems, that the ContentReader or ContentWriter .setMimetype method is only usable for creating new content. Might be a bug or a feature &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; lothar&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2009 12:16:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/howto-change-mimetype-for-existing-content/m-p/192870#M146000</guid>
      <dc:creator>lotharm</dc:creator>
      <dc:date>2009-01-27T12:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Howto Change Mimetype for Existing Content</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/howto-change-mimetype-for-existing-content/m-p/192871#M146001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Of course! Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2009 12:18:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/howto-change-mimetype-for-existing-content/m-p/192871#M146001</guid>
      <dc:creator>tommorris</dc:creator>
      <dc:date>2009-01-27T12:18:17Z</dc:date>
    </item>
  </channel>
</rss>

