use of org.alfresco.service.cmr.repository.ScriptLocation in project alfresco-repository by Alfresco.
the class ThumbnailServiceImplTest method testJSAPI.
// == Test the JavaScript API ==
@Test
public void testJSAPI() throws Exception {
NodeRef jpgOrig = createOriginalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_JPEG);
NodeRef gifOrig = createOriginalContent(this.folder, MimetypeMap.MIMETYPE_IMAGE_GIF);
NodeRef pdfOrig = createOriginalContent(this.folder, MimetypeMap.MIMETYPE_PDF);
NodeRef docOrig = createOriginalContent(this.folder, MimetypeMap.MIMETYPE_WORD);
Map<String, Object> model = new HashMap<String, Object>(2);
model.put("jpgOrig", jpgOrig);
model.put("gifOrig", gifOrig);
model.put("pdfOrig", pdfOrig);
model.put("docOrig", docOrig);
ScriptLocation location = new ClasspathScriptLocation("org/alfresco/repo/thumbnail/script/test_thumbnailAPI.js");
this.scriptService.executeScript(location, model);
}
Aggregations