一、环境搭建:
1、java环境:jdk-1.6_43;
2、工具:64-bit )
下载地址:
https://https://www.sodocs.net/doc/8e3165485.html,/downloads/packages/release/juno/sr2;
3、ofbiz:ofibz-release-12.04,zip下载地址:
svn下载地址:
https://www.sodocs.net/doc/8e3165485.html,/repos/asf/ofbiz/branches/release12.04;
4、系统:win8.0 64-bit ;
二、Eclipse参数及插件设置及安装ofbiz:
1、svn插件安装:进入“Help>>Install New Software...”打开Istall窗口,在“Work With”文本框内输入Subclipse 安装地址:
Subclipse 1.8.x Update Site - https://www.sodocs.net/doc/8e3165485.html,/update_1.8.x,然后按步骤操作即可;
2、导航到“Window>>Preferences”打开“Preferences”窗口,点击“General>>Workspace”将eclipse工作空间字符集设置为
"UTF-8",如图:
3、使用svn插件安装ofbiz:
(1)、在"Project Exploryer"中右键,选择"Import",打开"Import"窗口,选择"从SVN检出项目",点击"Next"如图:
(2)、选择"创建新的资源库位置",点击"Next",如图:
(3)、在"URL"文本输入框中输入ofbiz的svn下载地址"https://www.sodocs.net/doc/8e3165485.html,/repos/asf/ofbiz/branches/release12.04",
点击"Next",然后按步骤进行即可,如图:
4、普通安装:将下载的ofbiz压缩包解压到工作空间,然后按正常导入项目流程将解压后的ofbiz项目导入eclipse即可;
5、导入eclipse后,ofbiz的目录结构如图:
6、使用eclipse打开ofbiz的ant命令:"Window>>Show View>>Other"打开"Show View"窗口,选择"ant",
点击"OK",点击ant视图中的"",选择"build.xml",如图:
ofbiz的ant命令打开后如图所示:
三、ofbiz数据库(MySQL)安装及配置(基本):
1、将"mysql-connector-java-5.1.28.jar"copy到
"${ofbiz_home}/framework/entity/lib/jdbc"下,修改文件
"${ofbiz_home}/framework/entity/config/entityengine.xml",如下图(部分代码):
.......
........
2、在mysql中创建用户:user:ofbiz,password:ofbiz;
创建库:ofbiz、ofbizolap、ofbiztenant;
MySQL用户创建及库创建不在赘述;
注意:在创建库的时候要选择"utf8_general_ci"字符集
3、双击ant视图中的"clean-all",运行完毕后双击ant视图中的"load-demo",此时启动ofbiz数据库安装;
4、等待"load-demo"命令运行完毕后,双击ant视图中的"start"命令,启动ofbiz,在浏览器中输入
"http://localhost:8080/webtools" 打开ofbiz的web工具页面或"http://8080/ecommerce"打开ofbiz电子商务网站;
四、ofbiz数据库(MySQL)安装及配置(其他):
1、在同一台PC上运行ofbiz多实例:
(1).修改文件:${ofbiz install
dir}/framework/base/config/ofbiz-containers.xml
...........
class="org.ofbiz.base.container.NamingServiceContainer">
.................
class="org.ofbiz.service.rmi.RmiServiceContainer"> ...........
......
.............
value="https://www.sodocs.net/doc/8e3165485.html,ng.Thread#NORM_PRIORITY"/>
............
..................
class="org.ofbiz.catalina.container.CatalinaContainer"> ...................... ............ ...................
...................................
(2).修改文件:${ofbiz install
dir}/framework/start/src/org/ofbiz/base/start/start.properties
# --- Set these for shutting down when running as background process ofbiz.admin.host=127.0.0.1
ofbiz.admin.port=10524 #由10523更改为10524
ofbiz.admin.key=so3du5kasd5dn
(3).修改文件:${ofbiz install dir}/framework/webapp/config/url.properties:
.........................................
# HTTPS Port (Secure port)
port.https.enabled=Y
#update port.https=8443 to port.https=443 by ding on 2014/03/03 Begin port.https=443
#update port.https=8443 to port.https=443 by ding on 2014/03/03 End force.https.host=
# HTTP Port (Not Secure port)
#update port.http=8080 to port.http=80 by ding on 2014/03/03 Begin
port.http=80
#update port.http=8080 to port.http=80 by ding on 2014/03/03 End
force.http.host=
(4).重新编译${ofbiz install dir}/framework/start模块;
2、ofbiz 本地化及邮件设置:
(1)、${ofbiz_home}/framework/common/config/general.properties文件需要以下更改:
############################################################# ##################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.sodocs.net/doc/8e3165485.html,/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
############################################################# ##################
# -- unique instance id (20 char max)
unique.instanceId=ofbiz1
# -- the default currency to use for prices, etc
# -- update on 2014/02/11
# -- currency.uom.id.default=USD
currency.uom.id.default=CNY
# These values override the _NA_ DEFAULT values in user preferences for the GLOBAL_PREFERENCES userPrefGroupTypeId
# -- the default organizationPartyId for used in dropdowns and reports ORGANIZATION_PARTY=Company
# ID of the VisualTheme to use if there is no VISUAL_THEME UserPreference record for the current user (ie default value)
# VISUAL_THEME=TOMAHAWK
VISUAL_THEME=FLATGREY
# -- the default decimal format for currency (used in UtilFormatOut.java) currency.decimal.format=#,##0.00
# -- the default rounding for currency (used in OfbizCurrencyTransform.java) currency.rounding.default=10
# -- the default check scale for integer currency enabled (Y|N) (used in OfbizCurrencyTransform.java)
#When decimals are '00'
# -- Y if you want to display only x , example : 10
# -- N if you want to display x.00 , example : 10.00
currency.scale.enabled=N
# -- Properties fallback locale. Change this setting with caution. If you
# start getting "resource not found" exceptions, then there are
# properties missing in the locale you specified. This property does not
# control the default locale - the default locale is set in start.properties.
#update on 2014/02/11
# -- locale.properties.fallback=en
locale.properties.fallback=zh
# -- Locales made available, separated by commas. This property controls
# which locales the user can select from. If this property is not used,
# then the user will be able to select from all the locales available
# in the JVM. The list below corresponds to the languages really available OOTB (2010-16-02)
#locales.available=ar,de,en,es,fr,hi,it,nl,pt,ro,ru,th,zh
# -- Time zones made available, separated by commas. This property controls
# which time zones the user can select from. If this property is not used,
# then the user will be able to select from all the time zones available
# in the JVM.
#timeZones.available=US/Eastern,US/Central,US/Mountain,US/Pacific,US/Alaska,U S/Hawaii
# -- the default country for drop downs
#update on 2014/02/11
# -- country.geo.id.default=USA
country.geo.id.default=CHN
# -- Available countries, separated by commas.This property controls
# which countries the user can select from. If this property is not used,
# then the user will be able to select from all the countries.
#countries.geo.id.available=USA
# -- the default trackingCodeId to use for Partner Managed Tracking Codes partner.trackingCodeId.default=
# -- USPS address matching string - should be all lower case, no spaces, pipe delimited
usps.address.match=(^.*?p[\\. ]*o[\\. ]*box.*$)|(^.*?post.*?office.*?box.*$)|((^|(^.*? ))r[\\. ]*r[\\. ]*(( +)|([0-9#]+)).*$)|(^.*?rural.*?route.*$)
# -- general default 'fromEmailAddress' can be overridden in: EmailTemplateSetting
defaultFromEmailAddress=ofbiztest@https://www.sodocs.net/doc/8e3165485.html,
# -- The default domainname used in the notification emails links
# as 'baseUrl' and 'baseSecureUrl' are set in the url.properties file.
# -- mail notifications enabled (Y|N)
#update on 2014/02/11
mail.notifications.enabled=Y
# -- redirect all mail notifications to this address for testing
#mail.notifications.redirectTo=
# -- the default mail server to use
#update on 2014/02/11
mail.smtp.relay.host=https://www.sodocs.net/doc/8e3165485.html,
# -- SMTP Auth settings
#update on 2014/02/11
https://www.sodocs.net/doc/8e3165485.html,er=XXX@https://www.sodocs.net/doc/8e3165485.html,
mail.smtp.auth.password=********
# -- Additional Required Fields needed for Gmail and other non traditional smtp servers
# -- These added fields also work for Yahoo business mail for instance
# -- Gmail smtp port can be either 465 or 587
#mail.smtp.port=465