This content has been marked as final.
Show 1 reply
-
1. Re: how to open new window to display a stream?
logicfish Apr 25, 2005 2:50 PM (in response to greg_gl)I have done something similar with my module which can display images.
To display content outside of the nukes theme I override the `process' method instead of using the `op(Page p)' style.
The url changes to `/nukes/modules/yourmodule/yourresource'
and you parse the url inside the method and then setup the binary resource.
Heres part of my code:public void process(Signature signature, NukesRequest req, NukesResponse resp) { if (signature instanceof ModuleResourceSignature) { ModuleResourceSignature mrs = (ModuleResourceSignature) signature; String id = mrs.getPath(); Resource res = null; if (id.startsWith("/report")) { byte[] bin = .......; res = new ByteArrayResource("image/jpeg", bin); // yours would be pdf res.setName("whatever.jpg"); resourceManager.add("/report/" + name, res); resp.setResult(new ResourceResult(res)); } else { res = getResource(id); if (res != null) { resp.setResult(new ResourceResult(res)); } else { resp.setResult(CodeResult.CODE_404); } } else { super.process(signature, req, resp); } }
To open in a new window use javascript in the href url.
Hope this helps.