Thumbanil API: suport for placeholder thumbnails added and queueing of thumbnails for creation on get

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9434 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2008-06-10 10:27:35 +00:00
parent 98df967450
commit 3febbb8396
4 changed files with 182 additions and 40 deletions

View File

@@ -131,7 +131,7 @@ public class ThumbnailServiceTest extends BaseWebScriptTest
public void testCreateAsyncThumbnail() throws Exception
{
// Check for pdfToSWF transformation before doing test
// Check for pdfToSWF transformation before doing test
if (this.contentService.getTransformer(MimetypeMap.MIMETYPE_PDF, MimetypeMap.MIMETYPE_FLASH) != null)
{
String url = "/api/node/" + pdfNode.getStoreRef().getProtocol() + "/" + pdfNode.getStoreRef().getIdentifier() + "/" + pdfNode.getId() + "/content/thumbnails?as=true";
@@ -179,5 +179,27 @@ public class ThumbnailServiceTest extends BaseWebScriptTest
}
}
public void testPlaceHolder()
throws Exception
{
if (this.contentService.getTransformer(MimetypeMap.MIMETYPE_PDF, MimetypeMap.MIMETYPE_FLASH) != null)
{
// Check that there is no place holder set for webpreview
this.getRequest(getThumbnailsURL(pdfNode) + "/webpreview", 404);
this.getRequest(getThumbnailsURL(pdfNode) + "/webpreview?ph=true", 404);
}
// Check that here is a place holder for medium
this.getRequest(getThumbnailsURL(jpgNode) + "/medium", 404);
this.getRequest(getThumbnailsURL(jpgNode) + "/medium?ph=true", 200);
System.out.println(getThumbnailsURL(jpgNode) + "/medium?ph=true");
}
private String getThumbnailsURL(NodeRef nodeRef)
{
return "/api/node/" + nodeRef.getStoreRef().getProtocol() + "/" + nodeRef.getStoreRef().getIdentifier() + "/" + nodeRef.getId() + "/content/thumbnails";
}
}