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

          主站蜘蛛池模板: 汕头市| 临泉县| 神池县| 日土县| 株洲市| 沂水县| 政和县| 马尔康县| 资源县| 革吉县| 吉水县| 深水埗区| 桦甸市| 正安县| 江西省| 梨树县| 台山市| 五原县| 遂溪县| 水富县| 呼和浩特市| 梓潼县| 清水河县| 永顺县| 岐山县| 永济市| 汝南县| 彭阳县| 繁峙县| 沭阳县| 西峡县| 延津县| 孟津县| 兴城市| 临江市| 阿尔山市| 宁夏| 正阳县| 莱州市| 嘉兴市| 个旧市|