From 769c94836e2880769e7ed2bf9238b2fd5a02dfc7 Mon Sep 17 00:00:00 2001 From: nilspreusker Date: Mon, 25 Oct 2010 15:36:02 +0000 Subject: [PATCH] fixed visualization of transformation exceptions, debug info should now be rendered as HTMl instead of being offered as download --- .../org/activiti/rest/api/cycle/ContentGet.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ContentGet.java b/modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ContentGet.java index 7536acf43d..dec2cf8b9b 100644 --- a/modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ContentGet.java +++ b/modules/activiti-webapp-rest/src/main/java/org/activiti/rest/api/cycle/ContentGet.java @@ -85,15 +85,17 @@ public class ContentGet extends ActivitiStreamingWebScript { } } - InputStream content; try { - content = this.cycleService.getContent(artifact.getConnectorId(), artifact.getNodeId(), contentRepresentation.getId()).asInputStream(); + + streamResponse(res, this.cycleService.getContent(artifact.getConnectorId(), artifact.getNodeId(), contentRepresentation.getId()).asInputStream(), new Date(0), + // TODO: what is a good way to determine the etag? Using a fake one... + "W/\"647-1281077702000\"", attach, attachmentFileName, contentType); } catch (TransformationException e) { - content = new ByteArrayInputStream(e.getRenderContent().getBytes()); + streamResponse(res, new ByteArrayInputStream(e.getRenderContent().getBytes()), new Date(0), + // TODO: what is a good way to determine the etag? Using a fake one... + "W/\"647-1281077702000\"", false, null, CycleDefaultMimeType.HTML.getContentType()); } - streamResponse(res, content, new Date(0), - // TODO: what is a good way to determine the etag? Using a fake one... - "W/\"647-1281077702000\"", attach, attachmentFileName, contentType); + } -- GitLab