xplanner的readme.txt裡有句話
“XPlanner has only been tested on mysql 4.x, myslq 5.0, Tomcat 5.x, java 1.4, windows and linux.”
不過我用的環境是,JDK1.5+tomcat5.5+mysql5
安裝jdk、tomcat、mysql省略......
#mysqladmin -u root password centos
# mysql -u root -p
Enter password:
mysql> create database xplanner character set utf8;
mysql>create user xplauser identified by 'xplanner';
mysql>grant all privileges on xplanner.* to xplauser@'%' identified by 'xplanner' with grant option;
mysql>grant all privileges on xplanner.* to xplauser@'localhost' identified by 'xplanner' with grant option;
mysql> flush privileges;
hibernate.dialect=com.technoetic.xplanner.db.hibernate.XPlannerMySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost/xplanner?autoReconnect=true&useUnicode=true&characterEncoding=UTF8
hibernate.connection.username=xplauser
hibernate.connection.password=xplanner
步驟:
1、下載 xplanner-0.7b7b-war.zip
可以到http://ftp.heanet.ie/disk1/sourceforge/x/xp/xplanner/ 去下載,不要下載xplanner-0.7b7-war.zip,要下載xplanner-0.7b7b-war.zip
2、xplanner/web-inf/classes/xplanner.properties 跟 xplanner-custom.properties成相應的資料庫連接
3、xplanner-0.7b7-war/ant create.db.schema.script會在installer目錄下組建檔案
4、將 installer 目錄下的 hibernate_schema.sql 的資料跑一遍,會在資料庫產生需要的表
這個指令檔每條 語句都沒有用分號包住,還要自己修改成mysql可執行檔格式
5、xplanner-0.7b7-war/ant bootstrap 建立 sysadmin 的資料進 mysql
6、刪除 /WEB-INF/classes/patches 下所有資料
7、 xplanner Copy 到 Tomcat
8、替換內容
開啟 /xplanner/WEB-INF/classes/spring-beans.xml
找到 bean id="metaRepository"
替換成如下樣子
<property name="repositories">
<bean class="java.util.HashMap">
<constructor-arg>
<map>.....</map>
</constructor-arg>
</bean>
</property>
就是把<map>...</map>用外面兩個屬性包住.
9、foot.jsp頁面報錯,JSP頁面報錯其實挺簡單的,就是引號裡面套了個引號,把裡面的引號轉義下就OK了。
MYSQL中文亂碼問題:
1: 更改xplanner-custom.properties
hibernate.connection.url=jdbc:mysql://localhost/xplanner?autoReconnect=true&useUnicode=true&characterEncoding=GBK
2: 新增資料庫,編碼為GBK
CREATE DATABASE `xplanner` DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci;
其實只要存取編碼一致,都設定成UTF8的也沒有問題。
漢化問題:
把漢化檔案 http://runthu.javaeye.com/topics/download/942e7cab-b1f3-3376-bd00-8c804f602983 覆蓋到xplanner/WEB-INF/classes目錄下。