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 閱讀(1623) 評論(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的實體中是否有取數據庫中前幾條記錄的方法  回復  更多評論
            

          主站蜘蛛池模板: 温州市| 庆元县| 公主岭市| 浏阳市| 福安市| 宁强县| 平潭县| 宣威市| 凌源市| 依兰县| 汨罗市| 昆明市| 天祝| 加查县| 观塘区| 吉木乃县| 新宾| 崇文区| 巧家县| 兰考县| 德清县| 桓仁| 三穗县| 南昌市| 竹北市| 宜宾县| 公主岭市| 嘉峪关市| 栖霞市| 特克斯县| 定远县| 资中县| 奇台县| 汕尾市| 临夏县| 洪洞县| 翁牛特旗| 张家港市| 平原县| 柘荣县| 义乌市|