Search in sources :

Example 11 with ScriptLocation

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);
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) ClasspathScriptLocation(org.alfresco.repo.jscript.ClasspathScriptLocation) HashMap(java.util.HashMap) ScriptLocation(org.alfresco.service.cmr.repository.ScriptLocation) ClasspathScriptLocation(org.alfresco.repo.jscript.ClasspathScriptLocation) BaseAlfrescoSpringTest(org.alfresco.util.BaseAlfrescoSpringTest) Test(org.junit.Test) AbstractContentTransformerTest(org.alfresco.repo.content.transform.AbstractContentTransformerTest)

Aggregations

ScriptLocation (org.alfresco.service.cmr.repository.ScriptLocation)11 HashMap (java.util.HashMap)10 ClasspathScriptLocation (org.alfresco.repo.jscript.ClasspathScriptLocation)8 Test (org.junit.Test)7 BaseAlfrescoSpringTest (org.alfresco.util.BaseAlfrescoSpringTest)5 NodeRef (org.alfresco.service.cmr.repository.NodeRef)4 Serializable (java.io.Serializable)3 QName (org.alfresco.service.namespace.QName)3 AbstractContentTransformerTest (org.alfresco.repo.content.transform.AbstractContentTransformerTest)2 ChildAssociationRef (org.alfresco.service.cmr.repository.ChildAssociationRef)2 BaseSpringTest (org.alfresco.util.BaseSpringTest)2 Date (java.util.Date)1 HashSet (java.util.HashSet)1 UserTransaction (javax.transaction.UserTransaction)1 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)1 SleepActionExecuter (org.alfresco.repo.action.ActionServiceImplTest.SleepActionExecuter)1 FilterPropString (org.alfresco.repo.node.getchildren.FilterPropString)1 ScriptReplicationDefinition (org.alfresco.repo.replication.script.ScriptReplicationDefinition)1 AuthenticationComponent (org.alfresco.repo.security.authentication.AuthenticationComponent)1 TransferTargetImpl (org.alfresco.repo.transfer.TransferTargetImpl)1