- liwei888
- 等级: 初级会员
- 性别:
- 文章: 11
- 积分: 30
- 来自: 北京
|
最近在看OPenfire的用户集成管理Custom Database Integration Guide,按照官方的文档资料无论如何也集成不了;我们现有的系统,最后几经周折终于搞定.别的就不多说了具体配置文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file stores bootstrap properties needed by Openfire. Property names must be in the format: "prop.name.is.blah=value" That will be stored as: <prop> <name> <is> <blah>value</blah> </is> </name> </prop>
Most properties are stored in the Openfire database. A property viewer and editor is included in the admin console. --> <!-- root element, all properties must be under this element --> <jive> <adminConsole> <!-- Disable either port by setting the value to -1 --> <port>9090</port> <securePort>9091</securePort> </adminConsole> <admin> <authorizedUsernames>liwei, admin</authorizedUsernames> </admin> <locale>zh_CN</locale> <provider> <auth> <className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className> </auth> <user> <className>org.jivesoftware.openfire.user.JDBCUserProvider</className> </user> <group> <className>org.jivesoftware.openfire.group.JDBCGroupProvider</className> </group> </provider> <jdbcProvider> //需要集成系统的数据库; <driver>com.mysql.jdbc.Driver</driver> <connectionString>jdbc:mysql://localhost:3306/test?user=root&password=root</connectionString> </jdbcProvider> <jdbcAuthProvider> <passwordSQL>SELECT password FROM user_account WHERE Username=?</passwordSQL> <passwordType>plain</passwordType> </jdbcAuthProvider> <jdbcUserProvider> //集成用户 <loadUserSQL>SELECT name,email FROM user_account WHERE Username=?</loadUserSQL> <userCountSQL>SELECT COUNT(*) FROM user_account</userCountSQL> <allUsersSQL>SELECT username FROM user_account</allUsersSQL> <searchSQL>SELECT username FROM user_account WHERE</searchSQL> <usernameField>Username</usernameField> <nameField>name</nameField> <emailField>email</emailField> </jdbcUserProvider> //------------ <connectionProvider> <className>org.jivesoftware.database.DefaultConnectionProvider</className> </connectionProvider> <database> <defaultProvider> <driver>com.mysql.jdbc.Driver</driver> <serverURL>jdbc:mysql://localhost:3306/openfire</serverURL> <username>root</username> <password>root</password> <testSQL>select 1</testSQL> <testBeforeUse>true</testBeforeUse> <testAfterUse>true</testAfterUse> <minConnections>5</minConnections> <maxConnections>15</maxConnections> <connectionTimeout>1.0</connectionTimeout> </defaultProvider> </database> <!-- Fin configuration --> <setup>true</setup> <log> <debug> <enabled>true</enabled> </debug> </log> </jive>
声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
|
返回顶楼 |
|
|
- spiderbob
- 等级: 初级会员
- 性别:
- 文章: 1
- 积分: 30
- 来自: 北京
|
你这xml文件怎么命名啊 你这xml配置文件放在哪啊,是放在openfire的conf目录下?
|
返回顶楼 |
|
|
- liwei888
- 等级: 初级会员
- 性别:
- 文章: 11
- 积分: 30
- 来自: 北京
|
修改原来的配置文件!
|
返回顶楼 |
|
|
- cary
- 等级: 初级会员
- 性别:
- 文章: 32
- 积分: 40
- 来自: 合肥
|
liwei888 写道
最近在看OPenfire的用户集成管理Custom Database Integration Guide,按照官方的文档资料无论如何也集成不了;我们现有的系统,最后几经周折终于搞定.别的就不多说了具体配置文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<!-- This file stores bootstrap properties needed by Openfire. Property names must be in the format: "prop.name.is.blah=value" That will be stored as: <prop> <name> <is> <blah>value</blah> </is> </name> </prop>
Most properties are stored in the Openfire database. A property viewer and editor is included in the admin console. --> <!-- root element, all properties must be under this element --> <jive> <adminConsole> <!-- Disable either port by setting the value to -1 --> <port>9090</port> <securePort>9091</securePort> </adminConsole> <admin> <authorizedUsernames>liwei, admin</authorizedUsernames> </admin> <locale>zh_CN</locale> <provider> <auth> <className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className> </auth> <user> <className>org.jivesoftware.openfire.user.JDBCUserProvider</className> </user> <group> <className>org.jivesoftware.openfire.group.JDBCGroupProvider</className> </group> </provider> <jdbcProvider> //需要集成系统的数据库; <driver>com.mysql.jdbc.Driver</driver> <connectionString>jdbc:mysql://localhost:3306/test?user=root&password=root</connectionString> </jdbcProvider> <jdbcAuthProvider> <passwordSQL>SELECT password FROM user_account WHERE Username=?</passwordSQL> <passwordType>plain</passwordType> </jdbcAuthProvider> <jdbcUserProvider> //集成用户 <loadUserSQL>SELECT name,email FROM user_account WHERE Username=?</loadUserSQL> <userCountSQL>SELECT COUNT(*) FROM user_account</userCountSQL> <allUsersSQL>SELECT username FROM user_account</allUsersSQL> <searchSQL>SELECT username FROM user_account WHERE</searchSQL> <usernameField>Username</usernameField> <nameField>name</nameField> <emailField>email</emailField> </jdbcUserProvider> //------------ <connectionProvider> <className>org.jivesoftware.database.DefaultConnectionProvider</className> </connectionProvider> <database> <defaultProvider> <driver>com.mysql.jdbc.Driver</driver> <serverURL>jdbc:mysql://localhost:3306/openfire</serverURL> <username>root</username> <password>root</password> <testSQL>select 1</testSQL> <testBeforeUse>true</testBeforeUse> <testAfterUse>true</testAfterUse> <minConnections>5</minConnections> <maxConnections>15</maxConnections> <connectionTimeout>1.0</connectionTimeout> </defaultProvider> </database> <!-- Fin configuration --> <setup>true</setup> <log> <debug> <enabled>true</enabled> </debug> </log> </jive>
|
返回顶楼 |
|
|
- hhren1984
- 等级: 初级会员
- 性别:
- 文章: 1
- 积分: 30
- 来自: 延吉
|
你这个和原教程写的有什么区别啊,除了Username字段大写以外
|
返回顶楼 |
|
|
- hannover2008
- 等级: 初级会员
- 性别:
- 文章: 2
- 积分: 30
- 来自: 武汉
|
该配置文件怎么不起作用?请指教下,hannove_love@126.com
|
返回顶楼 |
|
|
- FGhost
- 等级:
- 性别:
- 文章: 40
- 积分: 108
- 来自: 上海
|
hhren1984 写道 你这个和原教程写的有什么区别啊,除了Username字段大写以外
我看也没啥区别!
|
返回顶楼 |
|
|
- popo123
- 等级: 初级会员
- 性别:
- 文章: 5
- 积分: 30
- 来自: 北京
|
现在直接改在数据库里面配了,烦死了
|
返回顶楼 |
|
|