cancel
Showing results for 
Search instead for 
Did you mean: 

Thumbnail API

rjohnson
Star Contributor
Star Contributor
The thumbnail API seems to be either incomplete or incorrectly documented. Several of the functions that are supposed to exist cannot be found when executing javascript in Javascript Console (I do not know if this could make a difference or not - but it never has with anything else).

By way of example

var document = space.childByNamePath("doc000000011.xml");
logger.log(document);
var tList = document.getThumbnails();
for (var t in tList) {
  logger.log(t);
}
Works, but the iteration over tList prints out

0
1
2
Which I honestly would not have expected. However, by contrast

var document = space.childByNamePath("doc000000011.xml");
var tdList = document.getThumbnailDefinitions();
for (var td in tdList) {
  logger.log(td);
}
logger.log("Done getThumbnailDefinitions");
Throws an error that
function getThumbnailDefinitions cannot be found
Further

var document = space.childByNamePath("doc000000011.xml");
logger.log(document);
var tList = document.getThumbnails();
for (var t in tList) {
  t.update()
  logger.log(t);
}
logger.log("Done getThumbnails");
Throws an error that
function update cannot be found

Both update and getThumbnailDefinitions are documented functions. The same is true if you try and use updateThumbnail().

Don't know why this is the case, perhaps I am doing something wrong.

Can anyone advise?

Thanks

Bob Johnson
1 REPLY 1

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Hi Bob,

you'll need to use the full for statement rather than the abbreviated one… try with:


var document = space.childByNamePath("doc000000011.xml");
logger.log(document);
var tList = document.getThumbnails();
for (var i = 0; i< tList.lenght; i++) {
  var t = tList[i];
  logger.log(t);
}

Adei