<?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: Content mimetype property not a String in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249590#M202720</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply Loftux.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's odd, because I've tried using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var mimeType = new String(nodeVar.mimetype);&lt;BR /&gt;var mimeType = nodeVar.mimetype.toString();&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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;And none seems to work, the typeof mimeType keeps being object. The only way it works for me is adding an empty string as described in the first post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jordi.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Oct 2011 07:21:05 GMT</pubDate>
    <dc:creator>jordiv</dc:creator>
    <dc:date>2011-10-11T07:21:05Z</dc:date>
    <item>
      <title>Content mimetype property not a String</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249588#M202718</link>
      <description>Hi,Inside an Alfresco webscript, given a node, I get its mime type as follows:var mimeType = nodeVar.mimetype;// This is also valid:// var mimeType = nodeVar.properties.content.mimetype;‍‍‍I get it succesfully, but the type of mimeType variable is object instead of String (as it should be according</description>
      <pubDate>Mon, 10 Oct 2011 13:33:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249588#M202718</guid>
      <dc:creator>jordiv</dc:creator>
      <dc:date>2011-10-10T13:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Content mimetype property not a String</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249589#M202719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The returned value is a java string (and not javascript string), typeof probably returns this as object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;var mimeType = new String(nodeVar.mimetype);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;and you will get a proper javascript string object. This applies to many alfresco javascript methods/properties, where for example equality operator === doesn't do what you would expect because they are different kind if string objects.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2011 14:27:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249589#M202719</guid>
      <dc:creator>loftux</dc:creator>
      <dc:date>2011-10-10T14:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Content mimetype property not a String</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249590#M202720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply Loftux.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's odd, because I've tried using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var mimeType = new String(nodeVar.mimetype);&lt;BR /&gt;var mimeType = nodeVar.mimetype.toString();&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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;And none seems to work, the typeof mimeType keeps being object. The only way it works for me is adding an empty string as described in the first post.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jordi.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 07:21:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249590#M202720</guid>
      <dc:creator>jordiv</dc:creator>
      <dc:date>2011-10-11T07:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Content mimetype property not a String</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249591#M202721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What if you try nodeVar.properties.content.mimetype?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I checked the alfresco source, and the nodeVar.mimetype does return a string, so I'm not sure why the "new String()" does not work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 07:45:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249591#M202721</guid>
      <dc:creator>loftux</dc:creator>
      <dc:date>2011-10-11T07:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Content mimetype property not a String</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249592#M202722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've also tried it and the result is the same.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've done this tests in the JavaScript Console (doing it inside the webscript has the same effect):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;var nodeVar = companyhome.childByNamePath("Sites/TestSite/documentLibrary/test/test.txt");&lt;BR /&gt;var mimeType;&lt;BR /&gt;mimeType = nodeVar.mimetype; print(typeof mimeType); // object&lt;BR /&gt;mimeType = nodeVar.mimetype.toString(); print(typeof mimeType); // object&lt;BR /&gt;mimeType = new String(nodeVar.mimetype); print(typeof mimeType); // object&lt;BR /&gt;mimeType = nodeVar.properties.content.mimetype; print(typeof mimeType); // object&lt;BR /&gt;mimeType = nodeVar.properties.content.mimetype.toString(); print(typeof mimeType); // object&lt;BR /&gt;mimeType = new String(nodeVar.properties.content.mimetype); print(typeof mimeType); // object&lt;BR /&gt;mimeType = "" + nodeVar.mimetype; print(typeof mimeType); // string&lt;BR /&gt;mimeType = "" + nodeVar.properties.content.mimetype; print(typeof mimeType); // string&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;/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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 09:05:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/content-mimetype-property-not-a-string/m-p/249592#M202722</guid>
      <dc:creator>jordiv</dc:creator>
      <dc:date>2011-10-11T09:05:31Z</dc:date>
    </item>
  </channel>
</rss>

