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.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3875306#3875306
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3875306
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user