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

          主站蜘蛛池模板: 胶州市| 德保县| 花莲市| 东城区| 沧源| 葫芦岛市| 兰坪| 台安县| 莱州市| 漳州市| 松滋市| 确山县| 青阳县| 铜鼓县| 呼和浩特市| 巩义市| 柳林县| 大宁县| 榆林市| 工布江达县| 怀来县| 卓尼县| 元谋县| 滁州市| 安顺市| 许昌市| 赞皇县| 江陵县| 康马县| 萝北县| 深圳市| 比如县| 神池县| 开原市| 泌阳县| 海南省| 临高县| 名山县| 德庆县| 南靖县| 牡丹江市|