love fish大鵬一曰同風起,扶搖直上九萬里

          常用鏈接

          統計

          積分與排名

          friends

          link

          最新評論

          ofbiz實體引擎結合jbuilder的配置

          1.1 配置
          這一節將給出實體引擎在jbuider中單獨使用的配置向導
          本文是從ofbiz網站的(OFBiz Quick Start Guide by Brett G. Palmer)的基礎上完成配置。

          1.從www.ofbiz.org中下載ofbiz-XX-XX-complete.zip包,本文用的是ofbiz-2.1.1-apps.zip
          解開放到某個目錄下,本文在j:\ofbiz,這也就是ofbiz.home的值
          2.建立jbuilder項目,如下圖所示


          3.加入源文件,
          ofbiz.home/core/src/entiry
          ofbiz.home/core/src/share


          4.加入所用到的jar文件
          ofbiz.home/lib/common
          ofbiz.home/lib/compile
          ofbiz.home/lib/jasterreports
          ofbiz.home/lib/jotm
          ofbiz.home/lib/scripting
          ofbiz.home/lib/share
          ofbiz.home/lib/tyrex



          5.將配置文件等導入工程
          將ofbiz.home/commonapp/etc下所有文件打到ofbiz_etc.jar包內
          jar cvf ofbiz_etc.jar *
          將ofbiz.home/core/docs/xmldefs/ofbiz下所有文件打到ofbiz_dtd.jar包內
          jar cvf ofbiz_dtd.jar *

          將這兩個包引入工程。

          6.將ofbiz.home\setup\jrun4\servers\ofbiz\SERVER-INF\jndi.properties文件放入
          ofbiz.home\lib\jotm\jotm.jar包內

          7.配置ofbiz.home
          在項目run tab中加入vm parameter:
          -Dofbiz.home=j:\ofbiz

          8.在GenericDelegator.java中,將下面語句注釋掉。
          /*
          // setup the Entity ECA Handler
          try {
          Class eecahClass = loader.loadClass(ECA_HANDLER_CLASS_NAME);
          this.entityEcaHandler = (EntityEcaHandler) eecahClass.newInstance();
          this.entityEcaHandler.setDelegator(this);
          } catch (ClassNotFoundException e) {
          Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " was not found, Entity ECA Rules will be disabled");
          } catch (InstantiationException e) {
          Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " could not be instantiated, Entity ECA Rules will be disabled");
          } catch (IllegalAccessException e) {
          Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " could not be accessed (illegal), Entity ECA Rules will be disabled");
          } catch (ClassCastException e) {
          Debug.logWarning(e, "EntityEcaHandler class with name " + ECA_HANDLER_CLASS_NAME + " does not implement the EntityEcaHandler interface, Entity ECA Rules will be disabled");
          }
          */


          9.測試文件Test.java
          package org.ofbiz.core;

          import org.ofbiz.core.entity.GenericDelegator;
          import org.ofbiz.core.entity.GenericValue;
          import org.ofbiz.core.util.UtilMisc;
          import org.ofbiz.core.entity.*;


          public class Test {
          public static void main(String[] args) {
          System.out.println("Entered testFindByPrimaryKey");
          //Instantiate the delegator.
          GenericDelegator delegator = GenericDelegator.getGenericDelegator("default");


          // Find book by primary key
          try {
          GenericValue party= delegator.findByPrimaryKey("PartyType",
          UtilMisc.toMap("partyTypeId", "PERSON"));
          }
          catch (GenericEntityException ex1) {
          }
          return;
          }

          }

          10.ok

          posted on 2006-08-15 11:29 liaojiyong 閱讀(520) 評論(0)  編輯  收藏 所屬分類: Ofbiz


          只有注冊用戶登錄后才能發表評論。


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          主站蜘蛛池模板: 龙井市| 信宜市| 武城县| 永嘉县| 错那县| 象山县| 保德县| 兴仁县| 宽城| 扶余县| 淮滨县| 高要市| 泌阳县| 平乐县| 来宾市| 赫章县| 丰顺县| 什邡市| 唐河县| 乌拉特中旗| 临高县| 封开县| 平阴县| 江山市| 湟源县| 开平市| 东港市| 大渡口区| 岑溪市| 赞皇县| 南川市| 南和县| 平乐县| 武功县| 丰县| 乡城县| 巴马| 馆陶县| 丹阳市| 永康市| 洞头县|