cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript API mimetype problem

rhofkens
Champ in-the-making
Champ in-the-making
Hello,

I'm trying to set the mimetype of a new document via the Javascript API.
Here's my code (using alfresco 1.3):

//get the space where the search result template can be found
var nodeSearch = companyhome.childByNamePath("/Geo Extension/Geo Search Results");

//create search result document
var dDate = new Date();
var srName = "geo-search-result-" + dDate.getTime();
var searchResult = nodeSearch.createFile(srName);
searchResult.mimetype = "text/xml";
The script fails on the last line with the following error:

Java class "org.alfresco.repo.jscript.Node" has no public instance field or method named "mimetype"

According to the wiki, the mimetype property should be available…

Any ideas?

ciao,
Roeland
1 REPLY 1

kevinr
Star Contributor
Star Contributor
The mimetype property is available for READ access in 1.3, it is now also a WRITE property in 1.4:
http://wiki.alfresco.com/wiki/JavaScript_API#Miscellanous_API_Functions_and_Properties

Thanks,

Kevin