Added stream content 'kind of' web script, modified ContentGet webscript to use common code, create GET thumbnail method based on stream content kind of web script

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9395 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2008-06-05 10:07:26 +00:00
parent 6878025007
commit 0c1d2728fb
12 changed files with 606 additions and 310 deletions

View File

@@ -105,17 +105,27 @@ public class ThumbnailServiceTest extends BaseWebScriptTest
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";
System.out.println(url);
JSONObject tn = new JSONObject();
tn.put("thumbnailName", "webpreview");
System.out.println(tn.toString());
MockHttpServletResponse response = this.postRequest(url, 200, tn.toString(), "application/json");
//JSONObject result = new JSONObject(response.getContentAsString());
System.out.println(response.getContentAsString());
}
// Do a image transformation (medium)
String url = "/api/node/" + jpgNode.getStoreRef().getProtocol() + "/" + jpgNode.getStoreRef().getIdentifier() + "/" + jpgNode.getId() + "/content/thumbnails";
JSONObject tn = new JSONObject();
tn.put("thumbnailName", "medium");
MockHttpServletResponse response = this.postRequest(url, 200, tn.toString(), "application/json");
System.out.println(response.getContentAsString());
JSONObject result = new JSONObject(response.getContentAsString());
String thumbnailUrl = result.getString("url").substring(17);
System.out.println(thumbnailUrl);
response = getRequest(thumbnailUrl, 200);
}