看懂在APACHE網(wǎng)站上的英文文檔確實(shí)是一項(xiàng)不小的挑戰(zhàn),下面說(shuō)說(shuō)飛宇對(duì)OFBIZ的入門(mén)方法,希望對(duì)像飛宇一樣剛起步的人有所啟示: 一、獲取OFBIZ源碼 由于我們學(xué)校用的是教育網(wǎng),而關(guān)于OFBIZ的源碼與文檔只能由APACHE等外國(guó)網(wǎng)站提供,后來(lái)在文檔上看到可以通過(guò)SVN下載,但事實(shí)證明在教育網(wǎng)下想通過(guò)SVN下載到OFBIZ幾百M(fèi)B的源碼是不可能的。 后來(lái),回家用ADSL,速度奇快,一般兩三個(gè)小時(shí)就完成了。里面有多少個(gè)文件沒(méi)數(shù)過(guò),反正是挺多的。 還有一種不用SVN下載的方法,是直接上網(wǎng)站下。 PS: 用SVN下載: In the directory where you want OFBiz to be, do a SVN checkout of the ofbiz trunk. For example: svn co http://svn./repos/asf/ofbiz/trunk ofbiz 直接從網(wǎng)站下: All users can access anonymous WebDAV either by pointing your browser or connecting your WebDAV client to the same address as above: http://svn./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ù)庫(kù)和J2EE容器,這時(shí)CMD窗口會(huì)占很大的系統(tǒng)資源,耐心點(diǎn)等到窗口信息停止?jié)L動(dòng),不要關(guān)它。 6、打開(kāi)游覽器: Open a browser and go to http://127.0.0.1:8080/ecommerce/control/main for the ecommerce application or https://127.0.0.1:8443/webtools/control/main for the WebTools application or https://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,把MYSQL JDBC驅(qū)動(dòng)放在OFBIZ源碼ofbiz\framework\entity\lib\jdbc下; 2、在MYSQL中創(chuàng)建一個(gè)數(shù)據(jù)庫(kù),并賦予完全訪問(wèn)權(quán)限,如ofbiz_mysql數(shù)據(jù)庫(kù); 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ù)庫(kù)。 PS:在MYSQL中可以看到DEMO的數(shù)據(jù)庫(kù)已經(jīng)轉(zhuǎn)移到里面了,幾十個(gè)表呢,當(dāng)然里面也有一些初始數(shù)據(jù)。 推薦看Demo and Test Setup Guide和Apache OFBiz Technical Production Setup Guide這兩篇文章。 |
|
來(lái)自: ShangShujie > 《ofbiz》