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