看懂在APACHE網(wǎng)站上的英文文檔確實(shí)是一項(xiàng)不小的挑戰(zhàn),下面說說飛宇對(duì)OFBIZ的入門方法,希望對(duì)像飛宇一樣剛起步的人有所啟示:
一、獲取OFBIZ源碼
由于我們學(xué)校用的是教育網(wǎng),而關(guān)于OFBIZ的源碼與文檔只能由APACHE等外國網(wǎng)站提供,后來在文檔上看到可以通過SVN下載,但事實(shí)證明在教育網(wǎng)下想通過SVN下載到OFBIZ幾百M(fèi)B的源碼是不可能的。
后來,回家用ADSL,速度奇快,一般兩三個(gè)小時(shí)就完成了。里面有多少個(gè)文件沒數(shù)過,反正是挺多的。
還有一種不用SVN下載的方法,是直接上網(wǎng)站下。
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
直接從網(wǎng)站下:
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這篇文檔
二、運(yùn)行自帶的DEMO
1、在CMD里面定位到OFBIZ源碼的根目錄;
2、運(yùn)行ant.bat命令
3、運(yùn)行ant.bat run-install;
4、運(yùn)行ant.bat run;
5、由于DEMO是用OFBIZ自帶的DERBY數(shù)據(jù)庫和J2EE容器,這時(shí)CMD窗口會(huì)占很大的系統(tǒng)資源,耐心點(diǎn)等到窗口信息停止?jié)L動(dòng),不要關(guān)它。
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:在調(diào)試時(shí)還有一個(gè)命令常用:ant.bat clean
推薦看Demo and Test Setup Guide這篇文章
三、與MYSQL結(jié)合
1、安裝MYSQL,把MYSQLJDBC驅(qū)動(dòng)放在OFBIZ源碼ofbiz\framework\entity\lib\jdbc下;
2、在MYSQL中創(chuàng)建一個(gè)數(shù)據(jù)庫,并賦予完全訪問權(quán)限,如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、按照運(yùn)行DEMO的方法重新載入,完成轉(zhuǎn)移數(shù)據(jù)庫。
PS:在MYSQL中可以看到DEMO的數(shù)據(jù)庫已經(jīng)轉(zhuǎn)移到里面了,幾十個(gè)表呢,當(dāng)然里面也有一些初始數(shù)據(jù)。
推薦看Demo and Test Setup Guide和Apache OFBiz Technical ProductionSetup Guide這兩篇文章。
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)
點(diǎn)擊舉報(bào)。