首页 > 代码库 > openfire build(2)

openfire build(2)

InterceptorManager 
PluginManager

openfire 插件的中servlet 在web-custom.xml 中的配置 url 一定要小写,访问时不区别大写小 否则404
如:

  <servlet>

    <servlet-name>Sample1Servlet</servlet-name>

        <servlet-class>com.myyule.openfire.plugin.Sample1Servlet</servlet-class>

    </servlet>

    <servlet-mapping>

        <servlet-name>Sample1Servlet</servlet-name>

        <url-pattern>/servlet1</url-pattern>

  <!-- 此处一定要小写,访问时大小时无关,否则404

  http://127.0.0.1:9090/plugins/sample/ServLet1 也可以访问成功

   -->

    </servlet-mapping>



自定用户表:

--设置JDBC连接方式
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcProvider.connectionString‘,

‘jdbc:oracle:thin:@10.35.246.178:1521:orcl‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcProvider.driver‘, ‘oracle.jdbc.driver.OracleDriver‘);

--设置管理员账号
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘admin.authorizedJIDs‘, ‘admin@localhost‘);

--自定义用户认证
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcAuthProvider.useConnectionProvider‘, ‘true‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcAuthProvider.passwordSQL‘, ‘select ‘‘123456‘‘ as pwd from

t_sys_user t where t.code=?‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcAuthProvider.passwordType‘, ‘plain‘);

--自定义用户管理
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcUserProvider.allUsersSQL‘, ‘select code from t_sys_user

t‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcUserProvider.nameField‘, ‘name‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcUserProvider.searchSQL‘, ‘select code from t_sys_user t

where code=?‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcUserProvider.useConnectionProvider‘, ‘true‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcUserProvider.emailField‘, ‘email‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcUserProvider.userCountSQL‘, ‘select count(*) from

t_sys_user t‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcUserProvider.loadUserSQL‘, ‘select t.name,t.email,t.code

from t_sys_user t where t.code=?‘);
insert into OFPROPERTY (NAME, PROPVALUE)
values (‘jdbcUserProvider.usernameField‘, ‘code‘);

--使用不同的数据源
update OFPROPERTY set

PROPVALUE=http://www.mamicode.com/‘org.jivesoftware.openfire.user.JDBCUserProvider‘
where NAME=‘provider.user.className‘;
update OFPROPERTY set

PROPVALUE=http://www.mamicode.com/‘org.jivesoftware.openfire.auth.JDBCAuthProvider‘
where NAME=‘provider.auth.className‘;
commit;