上次看centric crm,是一年多前的事了,這一年中,忙忙碌碌的,都不知道做了些什么,但還是一直關(guān)注crm的相關(guān)信息。
年初,有個(gè)朋友需要一套CRM軟件,我就給他推薦centric crm,但他不懂技術(shù),希望我?guī)退愀悖@就應(yīng)了下來(lái),又一次開(kāi)始認(rèn)真的看centric crm。
[溫故而知新]
看以前貼的關(guān)于centric crm的blog,心有慚愧,希望產(chǎn)生誤導(dǎo)的影響不會(huì)很大。
今天作一些更正,算是補(bǔ)償。
1、獲取centric crm源碼,得先注冊(cè),注冊(cè)地址:http://www.centriccrm.com/Register.do
? 先輸入你的郵箱地址(登錄用這個(gè));
? 個(gè)人名稱(chēng)可隨便填寫(xiě);
? 注冊(cè)成功后,密碼會(huì)發(fā)送到你郵箱中,
2、官方用SubVersion管理centic crm的源碼,可以當(dāng)一個(gè)subverion的客戶端,指定到要下載版本的鏈接,
輸入注冊(cè)的郵箱和密碼,就可以獲取源碼。
現(xiàn)在有4.0和4.1兩個(gè)版本,subverion鏈接分別如下,
4.1源碼:https://svn.centricsuite.com/webapp/branches/branch-41
4.0源碼:https://svn.centricsuite.com/webapp/tags/rel-200611151353-402
我使用eclipse,裝了個(gè)SVN插件,配好后,直接check out成eclipse的項(xiàng)目。
SVN eclipse plugin是subclipse,插件獲取網(wǎng)站:http://subclipse.tigris.org/update_1.2.x
3、源碼獲取下來(lái)目錄如下圖

[源碼check out到eclipse后,把整個(gè)項(xiàng)目編碼方式改為UTF-8,因源文件注釋中有些時(shí)間戳是中文簡(jiǎn)體字,不設(shè)成UTF-8,就顯示為亂碼,看起來(lái)沒(méi)什么大礙,但若修改源文件再保存就會(huì)彈出編碼格式不正確錯(cuò)誤信息]
bin:暫沒(méi)看這個(gè)目錄中的內(nèi)容
doc:基本文件目錄
??? Binary EULA.rtf:版權(quán)申明的文件;
??? CRM Installation and Setup.pdf:安裝配置文件,描述的比較簡(jiǎn)單;
??? db-schema.html:庫(kù)表設(shè)計(jì)說(shuō)明文件,了解centric CRM表結(jié)構(gòu)這個(gè)文件最佳參考資料
lib:項(xiàng)目需要的jar文件目錄
pref:特定情況下需要的配置文件目錄
src:源碼基本目錄
??? src目錄內(nèi)有下面四個(gè)主要目錄:
??? java:java源文件目錄
??? web:web展示源文件目錄
??? sql:庫(kù)表腳本文件目錄
??? testcases:單元測(cè)試文件目錄
??? src目錄內(nèi)有下面四個(gè)主要文件:
??? build.xml:項(xiàng)目編譯、發(fā)布的ant配置文件
??? home.properties.example:build.xml的輔助文件樣例,定義一些基本路徑信息,如:服務(wù)發(fā)布目錄
??? master.properties:build.xml的輔助文件,定義系統(tǒng)的一些屬性配置
??? README.txt:比較詳細(xì)的安裝配置文件(我就是看這個(gè)文件進(jìn)行安裝配置的,有時(shí)間可以把安翻譯成中文)
4、開(kāi)始安裝配置
??? 1)安裝需求Java JDK,就不用說(shuō)了,1.4以上都可以,1.4以下行不行,我也沒(méi)試,有興趣的朋友可試試,測(cè)試結(jié)果能告之當(dāng)是感激了。我裝的是JDK 5.0。
??? 2)應(yīng)用服務(wù)用tomcat 5.0,5.5都可以(不過(guò)tomcat5.5得在JDK5.0上才能運(yùn)行起來(lái)),Jboss、Weblogic、WebSphere、Resin也可以運(yùn)行。我用Tomcat 5.5.3。
??? 3)數(shù)據(jù)庫(kù)支持DB、MSSQL、MySQL、Oracle等,具體信息可看README.txt。我用的是MySQL 5.0.21。驅(qū)動(dòng)jar是MySQL官網(wǎng)下載的 mysql-connector-java-5.0.4-bin.jar。
??? 4)還需要有ant工具,申明是要1.6的,我用eclipse自帶的1.6.5。
??? 5)centric CRM中用到WebServices,可去下載一個(gè),
??? 下載地址:http://apache.downlod.in/ws/axis/1_4/axis-src-1_4.zip。
??? 解開(kāi)zip包,把webapp下面的axis目錄拷貝到$tomcat/webapps/目錄下。
??? 準(zhǔn)備好上幾步要求的,可以開(kāi)始配置build.xml運(yùn)行的兩個(gè)屬性文件。
??? 復(fù)制home.properties.example文件為 home.properties,相關(guān)屬性做如下修改:
##?The?following?properties?can?be?set?instead?of?using?environment?variables
##?Declare?the?webapp?server's?directory?to?compile?using?web?app?server?libraries
##?based?on?the?webapp?type?configured?in?build.properties
## 設(shè)置Tomcat安裝路徑
CATALINA_HOME=D:/java/tomcat5.5.3
#GERONIMO_HOME=/path/to/geronimo?or?websphere?ce
#JBOSS_HOME=/path/to/jboss
#WEBLOGIC_HOME=/path/to/weblogic
#WEBSPHERE_HOME=/path/to/websphere
##?CENTRIC_HOME?can?be?used?to?compile?directly?to?the?webapp's?deployment
##?directory?(for?development),?or?to?any?directory?for?later?generating?a?.war
## 設(shè)置centric CRM 發(fā)布到tomcat中的路徑
CENTRIC_HOME=D:/java/tomcat5.5.3/webapps/centric
#CENTRIC_HOME=/path/to/weblogic/domain/autodeploy/directory
##?At?times,?scripts?will?need?to?install?or?upgrade?fileLibrary?documents?when
##?deploying?from?source
## 設(shè)置項(xiàng)目中配置文件存放目錄
CENTRIC_FILELIBRARY=D:/Project.java/Centric?CRM?4.1/fileLibrary
##?To?skip?web?based?GUI?the?fileLibrary?must?be?in?the?WEB-INF?folder,?useful
##?for?development
## 設(shè)置配置文件發(fā)布目錄
CENTRIC_FILELIBRARY=D:/java/tomcat5.5.3/webapps/centric/WEB-INF/fileLibrary
##?If?using?Axis?Web?Services,?then?declare?the?webapp?home?so?that?the
##?Centric?CRM?descriptors?can?be?installed?with?"ant?ws"
## 設(shè)置axis在tomcat中的發(fā)布目錄
AXIS_HOME=D:/java/tomcat5.5.3/webapps/axis
? ??
??? master.properties 相關(guān)屬性做如下修改:
##
## NOTE: Do not edit "master.properties" -- edit a copy of it
## These settings are used by ant for the build and installation process
##
## PART 1: Are you reading the instructions? (required)
## The following is a control, uncomment the following line after modifying
## these properties... we just want to make sure you're paying attention and
## the build process doesn't do something it shouldn't!
## 確認(rèn)修改過(guò)此配置文件標(biāo)識(shí)
PROPERTIES=configured
## PART 2: Deployment settings (required for compiling)
## Default language setting: even though any locale can be specified, the
## following have Centric CRM translations and supporting database data
## args="de_DE,en_US,es_VE,fr_FR,it_IT,ja_JP,nl_NL,pt_BR,ro_RO,ru_RU,sl_SI"/>
SYSTEM.LANGUAGE=en_US
## Web server debug level:
## Extended debug information can be displayed in the web server's log file
## Comment out for no debugging, especially production server
DEBUGLEVEL=2
#DEBUG=true
#DEBUGLEVEL=lines,vars,source
## Specify the web server to build/deploy against (required):
## Use catalina for Tomcat
## Use geronimo for WAS-CE or Apache Geronimo
## All others untested but planned for
## 指定Web Server 應(yīng)用服務(wù)類(lèi)型
WEBSERVER.TYPE=catalina
#WEBSERVER.TYPE=geronimo
#WEBSERVER.TYPE=jboss
#WEBSERVER.TYPE=weblogic
#WEBSERVER.TYPE=websphere
## A self-signed SSL Certificate will be generated with the following parameters,
## which can then be added to Tomcat's SSL configuration and/or
## signed by an authority
## Common name should be a domain name
## Ex. *.yourcompany.com or www.yourcompany.com
KEYSTORE.COMMONNAME=127.0.0.1
KEYSTORE.ORGANIZATION=Company
KEYSTORE.ORGANIZATIONALUNIT=Unit
KEYSTORE.CITY=City
KEYSTORE.STATE=State
KEYSTORE.COUNTRY=US
KEYSTORE.VALIDITY=1000
## Force users to use SSL in Centric CRM
## The web server must be configured for SSL if this option is set to true as
## Centric CRM will redirect non-secure URLs to the secure URL
FORCESSL=false
## PART 3: Database installation settings (required for database installation)
## Uncomment and set the connection information for your specific database
## NOTE: The gatekeeper URL includes your database name, the site URL does not;
## The ant script will insert the database name after the specified url
## DB2
## CREATE DATABASE centric USING CODESET UTF-8 TERRITORY US pagesize 32 k
#GATEKEEPER.DBTYPE=db2
#GATEKEEPER.DRIVER=com.ibm.db2.jcc.DB2Driver
#GATEKEEPER.URL=jdbc:db2://127.0.0.1:50000/centric
#GATEKEEPER.USER=db2admin
#GATEKEEPER.PASSWORD=
#SITE.DBTYPE=db2
#SITE.DRIVER=com.ibm.db2.jcc.DB2Driver
#SITE.URL=jdbc:db2://127.0.0.1:50000/
#SITE.USER=db2admin
#SITE.PASSWORD=
## POSTGRESQL
## createdb -E UNICODE centric_crm
#GATEKEEPER.DBTYPE=postgresql
#GATEKEEPER.DRIVER=org.postgresql.Driver
#GATEKEEPER.URL=jdbc:postgresql://127.0.0.1:5432/centric_crm
#GATEKEEPER.USER=postgres
#GATEKEEPER.PASSWORD=
#SITE.DBTYPE=postgresql
#SITE.DRIVER=org.postgresql.Driver
#SITE.URL=jdbc:postgresql://127.0.0.1:5432/
#SITE.USER=postgres
#SITE.PASSWORD=
## MySQL
## CREATE DATABASE centric_crm CHARACTER SET utf8 COLLATE utf8_general_ci
## 指定數(shù)據(jù)庫(kù)類(lèi)型及連接配置
GATEKEEPER.DBTYPE=mysql
GATEKEEPER.DRIVER=com.mysql.jdbc.Driver
GATEKEEPER.URL=jdbc:mysql://127.0.0.1:3306/my_centric_crm
GATEKEEPER.USER=my_centric_crm
GATEKEEPER.PASSWORD=crm
SITE.DBTYPE=mysql
SITE.DRIVER=com.mysql.jdbc.Driver
SITE.URL=jdbc:mysql://127.0.0.1:3306/
SITE.USER=my_centric_crm
SITE.PASSWORD=crm
## MS SQL SERVER
#GATEKEEPER.DBTYPE=mssql
#GATEKEEPER.DRIVER=net.sourceforge.jtds.jdbc.Driver
#GATEKEEPER.URL=jdbc:jtds:sqlserver://127.0.0.1:1433/centric_crm
#GATEKEEPER.USER=centric_crm
#GATEKEEPER.PASSWORD=
#SITE.DBTYPE=mssql
#SITE.DRIVER=net.sourceforge.jtds.jdbc.Driver
#SITE.URL=jdbc:jtds:sqlserver://127.0.0.1:1433/
#SITE.USER=centric_crm
#SITE.PASSWORD=
## CodeGear's InterBase (formally owned by Borland) www.codegear.com
## Do NOT put the database in the centric file library, or at least the root,
## as the build.xml copies its prefs into there using the same name as your database file!
## "e:/centriccrm_db" is only an example
#GATEKEEPER.DBTYPE=interbase
#GATEKEEPER.DRIVER=interbase.interclient.Driver
#GATEKEEPER.URL=jdbc:interbase://127.0.0.1:3050/e:/centriccrm_db/centric_crm.ib
#GATEKEEPER.USER=sysdba
#GATEKEEPER.PASSWORD=masterkey
#SITE.DBTYPE=interbase
#SITE.DRIVER=interbase.interclient.Driver
#SITE.URL=jdbc:interbase://127.0.0.1:3050/e:/centriccrm_db/
#SITE.USER=sysdba
#SITE.PASSWORD=masterkey
## FIREBIRD SQL
#GATEKEEPER.DBTYPE=firebird
#GATEKEEPER.DRIVER=org.firebirdsql.jdbc.FBDriver
#GATEKEEPER.URL=jdbc:firebirdsql:127.0.0.1/3050:${CENTRIC_FILELIBRARY}/centric_crm.fdb
#GATEKEEPER.USER=sysdba
#GATEKEEPER.PASSWORD=masterkey
#SITE.DBTYPE=firebird
#SITE.DRIVER=org.firebirdsql.jdbc.FBDriver
#SITE.URL=jdbc:firebirdsql:127.0.0.1/3050:${CENTRIC_FILELIBRARY}/
#SITE.USER=sysdba
#SITE.PASSWORD=masterkey
## DAFFODIL DB EMBEDDED
#GATEKEEPER.DBTYPE=daffodildb
#GATEKEEPER.DRIVER=in.co.daffodil.db.jdbc.DaffodilDBDriver
## YOU MUST EDIT THE path in the following line to where you want the database
## created.
## The user and password must be set to daffodil
#GATEKEEPER.URL=jdbc:daffodilDB_embedded:centric_crm;create=true;path=/home/fileLibrary/centric_crm/daffodildb
#GATEKEEPER.USER=daffodil
#GATEKEEPER.PASSWORD=daffodil
#SITE.DBTYPE=daffodildb
#SITE.DRIVER=in.co.daffodil.db.jdbc.DaffodilDBDriver
#SITE.URL=jdbc:daffodilDB_embedded:
## YOU MUST EDIT THE path in the following line to where you want the database
## created.
## Ex. Use the same path as Centric CRM's deployed file library, then the name of
## the database, then end in daffodildb
## The user and password must be set to daffodil
#SITE.APPEND=;create=true;path=/home/fileLibrary/centric_crm/daffodildb
#SITE.USER=daffodil
#SITE.PASSWORD=daffodil
## ORACLE
## During installdb, use XE (or whatever you add under gatekeeper) for the
## database name since the install has not been adjusted for Oracle yet
#GATEKEEPER.DBTYPE=oracle
#GATEKEEPER.DRIVER=oracle.jdbc.driver.OracleDriver
#GATEKEEPER.URL=jdbc:oracle:thin:@//127.0.0.1:1521/XE
#GATEKEEPER.USER=
#GATEKEEPER.PASSWORD=
#SITE.DBTYPE=oracle
#SITE.DRIVER=oracle.jdbc.driver.OracleDriver
#SITE.URL=jdbc:oracle:thin:@//127.0.0.1:1521/
#SITE.USER=
#SITE.PASSWORD=
## Derby
#GATEKEEPER.DBTYPE=derby
#GATEKEEPER.DRIVER=org.apache.derby.jdbc.EmbeddedDriver
## YOU MUST EDIT THE path in the following line to where you want the database
## created.
#GATEKEEPER.URL=jdbc:derby:/home/fileLibrary/centric_crm/derbydb;create=true;upgrade=true
#GATEKEEPER.USER=centric_crm
#GATEKEEPER.PASSWORD=
#SITE.DBTYPE=derby
#SITE.DRIVER=org.apache.derby.jdbc.EmbeddedDriver
## YOU MUST EDIT THE path in the following line to where you want the database
## created.
#SITE.URL=jdbc:derby:/home/fileLibrary/centric_crm/
#SITE.APPEND=;create=true;upgrade=true
#SITE.USER=centric_crm
#SITE.PASSWORD=
## PART 4: Advanced configuration (optional)
## Web-based configuration is recommended and is the default setting
##
## If you uncomment the following CONTROL line then you must configure the
## remaining parameters yourself. You will also have to create a new Centric
## CRM user and password before using Centric CRM.
##
## If you DO NOT uncomment the CONTROL line, then the first time you use
## Centric CRM, you will be presented with a configuration wizard which will
## assist you in defining these parameters and creating a new Centric CRM
## user and password.
##
#CONTROL=BYPASS_WEB-BASED_APPLICATION_SETUP
## The following are methods for working with multiple development databases
## The APPCODE must be the same for the following Gatekeeper prefs and Site prefs
GATEKEEPER.APPCODE=centric
SITE.APPCODE=centric
## Define the web address used in communications when using a single development
## database
#WEBSERVER.URL=127.0.0.1:8080/centric
## Define the web address used in communications when using multiple development
## databases
#WEBSERVER.ASPMODE=true
#WEBSERVER.PORT=8080
#WEBSERVER.CONTEXT=/centric
## The server's default timezone for new users (using standard Java names)
SYSTEM.TIMEZONE=America/New_York
## Default currency for all users
SYSTEM.CURRENCY=USD
## Default country for all users
SYSTEM.COUNTRY=UNITED STATES
## External Servers used by the system
MAILSERVER=127.0.0.1
FAXSERVER=127.0.0.1
FAXENABLED=false
PROXYSERVER=false
PROXYSERVER.HOST=
PROXYSERVER.PORT=
## Apache Axis Web Services
## 指定WebService 服務(wù)路徑
AXIS.WEBAPP=/axis
AXIS.HOST=127.0.0.1
AXIS.PORT=8080
## Asterisk integration
ASTERISK.OUTBOUND.ENABLED=false
ASTERISK.INBOUND.ENABLED=false
ASTERISK.URL=
ASTERISK.USERNAME=
ASTERISK.PASSWORD=
ASTERISK.CONTEXT=from-internal
## XMPP/Jabber integration
XMPP.ENABLED=false
XMPP.CONNECTION.SSL=false
XMPP.CONNECTION.URL=
XMPP.CONNECTION.PORT=5222
XMPP.MANAGER.USERNAME=
XMPP.MANAGER.PASSWORD=
## LDAP integration
LDAP.ENABLED=false
# Validate username OR email against LDAP: username|email
LDAP.CENTRIC_CRM.FIELD=username
LDAP.FACTORY=com.sun.jndi.ldap.LdapCtxFactory
LDAP.SERVER=ldap://127.0.0.1:389
# Search by attribute, otherwise composite DN: true|false
LDAP.SEARCH.BY_ATTRIBUTE=true
LDAP.SEARCH.USERNAME=cn=admin,ou=IT,o=COMPANY
LDAP.SEARCH.PASSWORD=
LDAP.SEARCH.CONTAINER=o=COMPANY
LDAP.SEARCH.ORGPERSON=inetOrgPerson
LDAP.SEARCH.SUBTREE=true
LDAP.SEARCH.ATTRIBUTE=mail
#LDAP.SEARCH.BY_ATTRIBUTE=false
#LDAP.SEARCH.PREFIX=cn=
#LDAP.SEARCH.POSTFIX=,o=COMPANY
## Define the system's email address
EMAILADDRESS=Centric CRM <noreply@127.0.0.1>
## Timed events, definitely turn on for a production server
CRON.ENABLED=true
## Connection Pool Settings
CONNECTION_POOL.DEBUG=false
CONNECTION_POOL.TEST_CONNECTIONS=false
CONNECTION_POOL.ALLOW_SHRINKING=true
CONNECTION_POOL.MAX_CONNECTIONS=10
CONNECTION_POOL.MAX_IDLE_TIME.SECONDS=60
CONNECTION_POOL.MAX_DEAD_TIME.SECONDS=300
## Layout Settings
## Template replaces the following files which MUST exist:
## CSS:
## template1.css
## template1-8pt.css
## template1-10pt.css
## JSP:
## template1nav.jsp
## template1style.jsp
## template1styleNoSession.jsp
## template1styleContainer.jsp
LAYOUT.TEMPLATE=template1
LAYOUT.JSP.WELCOME=welcome.jsp
LAYOUT.JSP.LOGIN=login.jsp
#LAYOUT.JSP.LOGIN.LOGO=<img src="images/centric/logo-centric.gif" width="295" height="66" alt="" border="0" />
#LAYOUT.JSP.LOGIN.TEXT=Centric CRM
## Max Imports that can run concurrently
IMPORT_QUEUE_MAX=1
## Opportunity behavior
# OPPORTUNITY.DEFAULT_TERM=52
# OPPORTUNITY.DEFAULT_UNITS=W
# OPPORTUNITY.MULTIPLIER=52
# OPPORTUNITY.CLOSE_PROBABILITY=25,50,75
完成上述兩文件的修改后,打開(kāi)eclipse的ant視圖,
??? 運(yùn)行:
ant deploy 完成項(xiàng)目的編譯發(fā)布工作。
下一步是創(chuàng)建庫(kù)表,可運(yùn)行 ant installdb 創(chuàng)建庫(kù)表。
??? 運(yùn)行 ant installdb前,先在啟動(dòng)MySQL,創(chuàng)建一個(gè)表空間及用戶,
???
CREATE DATABASE my_centric_crm CHARACTER SET utf8 COLLATE utf8_general_ci;
??? GRANT ALL PRIVILEGES ON my_centric_crm.* TO my_centric_crm@"%" IDENTIFIED BY "crm";??? 創(chuàng)建庫(kù)表時(shí),若出現(xiàn)類(lèi)似"
Specified key was too long; max key length is 765bytes"的錯(cuò)誤,是因?yàn)闃?biāo)識(shí)"UNIQUE NOT NULL"的字段長(zhǎng)度>255(255=765/3)了。MySQL數(shù)據(jù)庫(kù)的unique類(lèi)字段長(zhǎng)度限制比較短,視不同版本,有的限制為765個(gè)字節(jié),有的限制為1000個(gè)字節(jié),UTF是占用3個(gè)字節(jié)位的,所以在這個(gè)限制上還要除以3。centric CRM的mysql庫(kù)腳本中,unique類(lèi)字段的長(zhǎng)度是設(shè)為300長(zhǎng)字符的,出現(xiàn)上述問(wèn)題一個(gè)可行的妥協(xié)辦法是修改腳本unique類(lèi)字段的長(zhǎng)度。
建完表后,可以啟動(dòng)tomcat服務(wù),運(yùn)行 ant ws 激活WebService,應(yīng)用服務(wù)配置安裝完成!
通過(guò) http://localhost:8080/centric,第一次進(jìn)入centric crm系統(tǒng)。
??? 第一次進(jìn)入系統(tǒng)時(shí),是一個(gè)登錄界面,用戶是dhvadmin,密碼是admin,登錄進(jìn)入,是一步步的系統(tǒng)參數(shù)設(shè)置操作,操頁(yè)面提示,就可完成設(shè)置。最后是創(chuàng)建應(yīng)用系統(tǒng)公司名稱(chēng)和管理員用戶密碼的界面,再次使用系統(tǒng)時(shí),就以管理員名稱(chēng)和密碼登錄,對(duì)系統(tǒng)進(jìn)行設(shè)置及添加管理其他用戶。(至此,告一段落。)