spark的自留地(ofbiz/eclipse rcp/shark/opentaps)

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  54 Posts :: 0 Stories :: 112 Comments :: 0 Trackbacks

* 如何在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中所有的变量


* 清除 与 刷新的比较
  <clear-field field-name="foo"/> 设置它为null. 这可以是一个类的属性或是集合中的一个值
  <refresh-value value-name="foo"/> 从数据库中重新获得foo的值. foo必须是一个GenericValue.


* 如何设置一个布尔值
 我无法找到任何例子,但是我这样做是成功的:

 <set field="orderAvailableCtx.countNewReturnItems" value="true" type="Boolean"/>


 我想minilang使用type=""中的类型与value中的值的做为构造调用.猜想在某天我看到这些代码时能证明我是对的...

本文档译自ofbiz 4.0 cookbooks,本人翻译,欢迎转载,请注明出处.

posted on 2008-10-31 09:21 shanghai_spark 阅读(1585) 评论(4)  编辑  收藏 所属分类: opentaps

Feedback

# re: MINILANG 开发指导烹调书 2008-11-01 17:05 金山词霸2008
"烹调书"--一种很形象的提法。   回复  更多评论
  

# re: MINILANG 开发指导烹调书 2008-12-29 13:29 sunshinezxb
请问:是否有关于ofbiz的视频提供?  回复  更多评论
  

# re: MINILANG 开发指导烹调书 2009-01-01 14:01 广州spark
http://www.opensourcestrategies.com/ofbiz/ofbiz_opentaps_training_video.php  回复  更多评论
  

# re: MINILANG 开发指导烹调书[未登录] 2009-02-17 17:31 jun
ofbiz的实体中是否有取数据库中前几条记录的方法  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: