10-10-2011 09:33 AM
var mimeType = nodeVar.mimetype;
// This is also valid:
// var mimeType = nodeVar.properties.content.mimetype;
typeof nodeVar.mimetype;
I can change it to String by doing something like:var mimeType = "" + nodeVar.mimetype;
But I would like to know if this is a bug or I'm doing something wrong.10-10-2011 10:27 AM
var mimeType = new String(nodeVar.mimetype);
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.
10-11-2011 03:21 AM
var mimeType = new String(nodeVar.mimetype);
var mimeType = nodeVar.mimetype.toString();
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.10-11-2011 03:45 AM
10-11-2011 05:05 AM
var nodeVar = companyhome.childByNamePath("Sites/TestSite/documentLibrary/test/test.txt");
var mimeType;
mimeType = nodeVar.mimetype; print(typeof mimeType); // object
mimeType = nodeVar.mimetype.toString(); print(typeof mimeType); // object
mimeType = new String(nodeVar.mimetype); print(typeof mimeType); // object
mimeType = nodeVar.properties.content.mimetype; print(typeof mimeType); // object
mimeType = nodeVar.properties.content.mimetype.toString(); print(typeof mimeType); // object
mimeType = new String(nodeVar.properties.content.mimetype); print(typeof mimeType); // object
mimeType = "" + nodeVar.mimetype; print(typeof mimeType); // string
mimeType = "" + nodeVar.properties.content.mimetype; print(typeof mimeType); // string
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.