`
gzspark
  • 浏览: 107344 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

MINILANG 开发指导烹调书

阅读更多
* 如何在minilang中使用Java静态方法获得数据
使用beanshell脚本:
<set field="notApplied" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}" type="Double"/>


警告:你必须使用type=""来转换你的结果类型,否则的话,它将返回字符串类型.

* 如何在minilang中调用Java程序
你可以在minilang中插入一段beanshell代码,类似于 applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml的示例:
        <call-bsh><![CDATA[
            String password = (String) userLoginContext.get("currentPassword");
            String confirmPassword = (String) userLoginContext.get("currentPasswordVerify");
            String passwordHint = (String) userLoginContext.get("passwordHint");
            org.ofbiz.securityext.login.LoginServices.checkNewPassword(newUserLogin, null, password, confirmPassword, passwordHint, error_list, true, locale);
        ]]></call-bsh>
  
     
  在beanshell脚本中可以访问在minilang中所有的变量

* 清除 与 刷新的比较
   设置它为null. 这可以是一个类的属性或是集合中的一个值
   从数据库中重新获得foo的值. foo必须是一个GenericValue.

* 如何设置一个布尔值
我无法找到任何例子,但是我这样做是成功的:
<set field="orderAvailableCtx.countNewReturnItems" value="true" type="Boolean"/>
我想minilang使用type=""中的类型与value中的值的做为构造调用.我猜想在某天我看到这些代码时能证明我是对的...
2
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics