ofbiz瘦身[已验证,9.04-11.04 稍作修改可用]

ofbiz瘦身 
由于ofbiz表特别多,并且没有很多资料供我们参考(至少中文资料是这样),学习起来不知道从那里下手。经过一晚上的学习(当然也有此然半个月的基础),终于把ofbiz的表缩小到只有66个,这样学习起来就方便多了。具体方法如下: 
1.在mysql中创建数据库ofbiz,修改ofbiz\framework\entity\config\entityengine.xml文件,

  1.    <delegator name="default" entityentity-model-reader="main"entity-group-reader="main" entity-eca-reader="main"distributed-cache-clear-enabled="false">  
  2.         <group-map group-name="org.ofbiz" datasource-name="localmysql"/>  
  3.     </delegator>  
  4.   
  5. <datasource name="localmysql"  
  6.             helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"  
  7.             field-type-name="mysql"  
  8.             check-on-start="true"  
  9.             add-missing-on-start="true"  
  10.             check-pks-on-start="false"  
  11.             use-foreign-keys="true"  
  12.             join-style="ansi-no-parenthesis"  
  13.             alias-view-columns="false"  
  14.             drop-fk-use-foreign-key-keyword="true"  
  15.             table-type="InnoDB"  
  16.             character-set="latin1"  
  17.             collate="latin1_general_cs">  
  18.         <read-data reader-name="seed"/>  
  19.         <read-data reader-name="demo"/>  
  20.         <read-data reader-name="ext"/>  
  21.         <inline-jdbc  
  22.                 jdbc-driver="com.mysql.jdbc.Driver"  
  23.                 jdbc-uri="jdbc:mysql://127.0.0.1/ofbiz?autoReconnect=true"  
  24.                 jdbc-username="root"  
  25.                 jdbc-password="root"  
  26.                 isolation-level="ReadCommitted"  
  27.                 pool-minsize="2"  
  28.                 pool-maxsize="20"/>  
  29.        <!-- <jndi-jdbc jndi-server-name="localjndi"jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>-->  
  30. </datasource>  



2. 将ofbiz\framework\base\config\component-load.xml中的applications,specialpurpose和hot-deploy注释掉,得到结果如下

  1. <component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/component-loader.xsd">  
  2.     <load-components parent-directory="${ofbiz.home}/framework"/>  
  3.     <!--<load-components parent-directory="${ofbiz.home}/applications"/>-->  
  4.     <!--<load-components parent-directory="${ofbiz.home}/specialpurpose"/>-->   
  5.     <!--<load-components parent-directory="${ofbiz.home}/hot-deploy"/>-->  
  6. </component-loader>  


3. 将ofbiz\framework\component-load.xml文件中的workflow, testtools和example注释掉,得到结果如下

  1. <component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/component-loader.xsd">  
  2.     <load-component component-location="${ofbiz.home}/framework/geronimo"/>  
  3.     <load-component component-location="${ofbiz.home}/framework/entity"/>  
  4.     <load-component component-location="${ofbiz.home}/framework/catalina"/>  
  5.     <!-- <load-component component-location="${ofbiz.home}/framework/jetty"/> -->  
  6.     <load-component component-location="${ofbiz.home}/framework/security"/>  
  7.     <load-component component-location="${ofbiz.home}/framework/datafile"/>  
  8.     <load-component component-location="${ofbiz.home}/framework/minilang"/>  
  9.     <load-component component-location="${ofbiz.home}/framework/common"/>  
  10.     <load-component component-location="${ofbiz.home}/framework/service"/>  
  11.     <load-component component-location="${ofbiz.home}/framework/entityext"/>  
  12.     <load-component component-location="${ofbiz.home}/framework/webapp"/>  
  13.     <load-component component-location="${ofbiz.home}/framework/guiapp"/>  
  14.     <load-component component-location="${ofbiz.home}/framework/widget"/>  
  15.     <load-component component-location="${ofbiz.home}/framework/appserver"/>  
  16.     <!-- <load-component component-location="${ofbiz.home}/framework/workflow"/>-->  
  17.     <!-- load-component component-location="${ofbiz.home}/framework/shark"/>-->  
  18.     <!-- <load-component component-location="${ofbiz.home}/framework/testtools"/>-->  
  19.     <load-component component-location="${ofbiz.home}/framework/webtools"/>  
  20.     <load-component component-location="${ofbiz.home}/framework/images"/>  
  21.     <!--<load-component component-location="${ofbiz.home}/framework/example"/>-->  
  22. </component-loader>  


4. 打开doc并在ofbiz目录下执行命令: 
ant clean-all 
ant run-install 
startofbiz.bat 

7,https://localhost:8443/webtools/ 
5. 执行第4步之后,在user_login表中只有system一条记录,但是该记录的password字段是空的,需要修改为“ofbiz”加密代码,另外enable字段值为“n”,表示该用户不可用,需要将它的值改为“Y”,执行的两个SQL语句如下:

  1. update user_login set current_password = '47ca69ebb4bdc9ae0adec130880165d2cc05db1a';  
  2. update user_login set enabled='Y';  


6,启动ofbiz,现在只有webtools可用(http://localhost:8080/webtools),用户名/密码:system/ofbiz

 

转载自: http://zhaxg.iteye.com/blog/510547

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值