Skip to content

Instantly share code, notes, and snippets.

@hi-ko
Last active March 11, 2022 17:22
Show Gist options
  • Save hi-ko/079c3103e37234559ba3ba526d302939 to your computer and use it in GitHub Desktop.
Save hi-ko/079c3103e37234559ba3ba526d302939 to your computer and use it in GitHub Desktop.
Alfresco Javascript Console
// example for the ecm4u smartTransformer to (re)create high quality Previews for Office-Docs
var suffixList=['pptx', 'ppt', 'xlsx', 'xls', 'docx', 'doc'];
recurse(document, function(node) {
if ( node.isDocument){
var suffix=node.properties["cm:name"].split('.').pop();
if (suffixList.indexOf(suffix.toLowerCase()) >= 0) {
print(node.displayPath+'/'+node.name+': ' + smarttransformer.createThumbnails(node).message);
}
}
});
recurse(companyhome, function(node) {
for each(permission in node.fullPermissions) {
if (/;DIRECT$/.test(permission)) {
logger.log(node.displayPath + "/"+ node.name + ";" + permission);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment