看懂在APACHE網站上的英文文檔確實是一項不小的挑戰(zhàn),下面說說飛宇對OFBIZ的入門方法,希望對像飛宇一樣剛起步的人有所啟示:
一、獲取OFBIZ源碼
由于我們學校用的是教育網,而關于OFBIZ的源碼與文檔只能由APACHE等外國網站提供,后來在文檔上看到可以通過SVN下載,但事實證明在教育網下想通過SVN下載到OFBIZ幾百MB的源碼是不可能的。
后來,回家用ADSL,速度奇快,一般兩三個小時就完成了。里面有多少個文件沒數(shù)過,反正是挺多的。
還有一種不用SVN下載的方法,是直接上網站下。
PS:
用SVN下載:
In the directory where you want OFBiz to be, do a SVN checkout ofthe ofbiz trunk. For example:
svn co http://svn.apache.org/repos/asf/ofbiz/trunk ofbiz
直接從網站下:
All users can access anonymous WebDAV either by pointing yourbrowser or connecting your WebDAV client to the same address asabove:
http://svn.apache.org/repos/asf/ofbiz/trunk
推薦看Source Repository and Access這篇文檔
二、運行自帶的DEMO
1、在CMD里面定位到OFBIZ源碼的根目錄;
2、運行ant.bat命令
3、運行ant.bat run-install;
4、運行ant.bat run;
5、由于DEMO是用OFBIZ自帶的DERBY數(shù)據(jù)庫和J2EE容器,這時CMD窗口會占很大的系統(tǒng)資源,耐心點等到窗口信息停止?jié)L動,不要關它。
6、打開游覽器:
Open a browser and go tohttp://127.0.0.1:8080/ecommerce/control/main
for the ecommerce application orhttps://127.0.0.1:8443/webtools/control/main
for the WebTools application orhttps://127.0.0.1:8443/catalog/control/main
for the Catalog Manager application.
PS:在調試時還有一個命令常用:ant.bat clean
推薦看Demo and Test Setup Guide這篇文章
三、與MYSQL結合
1、安裝MYSQL,把MYSQLJDBC驅動放在OFBIZ源碼ofbiz\framework\entity\lib\jdbc下;
2、在MYSQL中創(chuàng)建一個數(shù)據(jù)庫,并賦予完全訪問權限,如ofbiz_mysql數(shù)據(jù)庫;
3、修改ofbiz\framework\entity\config下的entityengine.xml文件:
<delegator name="default" entity-model-reader="main"entity-group-reader="main" entity-eca-reader="main"distributed-cache-clear-enabled="false">
<group-map group-name="org.ofbiz"datasource-name="localmysql"/>
</delegator>
----------------------------------------------------------------------
<datasource name="localmysql"
helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
schema-name="ofbiz_mysql"
field-type-name="mysql"
check-on-start="true"
add-missing-on-start="true"
use-pk-constraint-names="false">
<read-data reader-name="seed"/>
<read-data reader-name="demo"/>
<read-data reader-name="ext"/>
<inline-jdbc
jdbc-driver="com.mysql.jdbc.Driver"
jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz_mysql?autoReconnect=true"
jdbc-username="root"
jdbc-password="123456"
isolation-level="ReadCommitted"
pool-minsize="2"
pool-maxsize="20"/>
<!-- <jndi-jdbc jndi-server-name="localjndi"jndi-name="java:/MySqlDataSource"isolation-level="Serializable"/> -->
</datasource>
---------------------------------------------------------------------
4、按照運行DEMO的方法重新載入,完成轉移數(shù)據(jù)庫。
PS:在MYSQL中可以看到DEMO的數(shù)據(jù)庫已經轉移到里面了,幾十個表呢,當然里面也有一些初始數(shù)據(jù)。
推薦看Demo and Test Setup Guide和Apache OFBiz Technical ProductionSetup Guide這兩篇文章。
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內容,請
點擊舉報。