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

          主站蜘蛛池模板: 府谷县| 无极县| 谢通门县| 兴城市| 个旧市| 汪清县| 三门峡市| 崇信县| 枣强县| 桦川县| 喜德县| 嘉峪关市| 四川省| 定南县| 靖边县| 武汉市| 井陉县| 定安县| 顺平县| 大竹县| 页游| 广水市| 彰化县| 安图县| 彭山县| 龙井市| 重庆市| 高阳县| 公主岭市| 黎平县| 台南市| 鸡泽县| 厦门市| 砀山县| 安溪县| 法库县| 镇沅| 岳普湖县| 沿河| 古蔺县| 余姚市|