You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by HongNK <ho...@gmail.com> on 2008/02/12 06:17:02 UTC

Call Bsh from simple method

Hi I'm making a web service using simple method to display a list of pending
orders. I wanted to reuse existing codes in OrderMgr application which do
the same task. Therefore I will be using &lt;call-bsh&gt; to call this
script 
/order/webapp/ordermgr/WEB-INF/actions/order/orderlist.bsh. 

I'm facing 2 problems:

1. Tried to use "resource" attribute of "call-bsh". This attribute is
documented to call external bsh scripts, but I do not know what is the URI
format for the resource (no examples found). Besides the script is inside
"WEB-INF" which might not be available to outside (I'm not sure about this)?

2. So I switched to inline code, as follows:
&lt;call-bsh&gt;&lt;![CDATA[
org.ofbiz.base.util.BshUtil.runBshAtLocation("component://order/webapp/ordermgr/WEB-INF/actions/order/orderlist.bsh",parameters);
]]&gt; &lt;/call-bsh&gt;

The script get called, but now the problem is that the Bsh script uses
"request" object and "context" object. I realize "context" is actually
"parameters" from the simple method, but where is "request", or how could I
pass "request" object to external script to make it work without
modification.

Thanks for your guide.
Hong  



-- 
View this message in context: http://www.nabble.com/Call-Bsh-from-simple-method-tp15426154p15426154.html
Sent from the OFBiz - Dev mailing list archive at Nabble.com.