Re: [xwiki-users] SH/BAT file plugin
To achieve this I would create an xwiki class "shellscript" that contains a single field, named "shcode" which is pure text. Then I would create velocity script that dispalys the page or downloads the code based on some http servlet $request parameters. I would not try to "dig out" the shell code from the wiki page. Note that you can access the servlet request as well as response object so you can make downloading just anything, not only text/html. Regards Peter Verhás Péter +36(30)9306805 [email protected]
Thanks for the response, Peter :-) I see, I guess that would work, and I'd also be able to edit the shell scripts inline (as long as I provide a template for it). Just one more question, though - are we able to completely override what $request returns, since the header needs to be set before returning any data whatsoever (I guess things like mime type?). If so, this would solve my problem pretty cleanly! I'll try it out after installing the long awaited 1.7.1 :-D Thanks again! On Mon, Jan 12, 2009 at 5:06 PM, Peter Verhas <[email protected]> wrote:
To achieve this I would create an xwiki class "shellscript" that contains a single field, named "shcode" which is pure text. Then I would create velocity script that dispalys the page or downloads the code based on some http servlet $request parameters.
I would not try to "dig out" the shell code from the wiki page.
Note that you can access the servlet request as well as response object so you can make downloading just anything, not only text/html.
Regards Peter Verhás Péter +36(30)9306805 [email protected] _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Lewis Denizen wrote:
Thanks for the response, Peter :-) I see, I guess that would work, and I'd also be able to edit the shell scripts inline (as long as I provide a template for it). Just one more question, though - are we able to completely override what $request returns, since the header needs to be set before returning any data whatsoever (I guess things like mime type?). If so, this would solve my problem pretty cleanly! I'll try it out after installing the long awaited 1.7.1 :-D Thanks again!
You can set response headers anytime, as the velocity parsing takes place before the response is sent to the client. If you want to send a response without the surrounding XWiki UI, just add &xpage=plain in the URL (or starting with ? if you don't have other parameters).
On Mon, Jan 12, 2009 at 5:06 PM, Peter Verhas <[email protected]> wrote:
To achieve this I would create an xwiki class "shellscript" that contains a single field, named "shcode" which is pure text. Then I would create velocity script that dispalys the page or downloads the code based on some http servlet $request parameters.
I would not try to "dig out" the shell code from the wiki page.
Note that you can access the servlet request as well as response object so you can make downloading just anything, not only text/html.
-- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (3)
-
Lewis Denizen -
Peter Verhas -
Sergiu Dumitriu