Skip to content

Commit d5acc7b

Browse files
committed
fix #12: Compatible with Openfire 5.0.0
This replaces usage of Openfire API that was dropped in 5.0.0 with API that was introduced in 4.4.0. Also, a third-party library that no longer ships with Openfire is now added as a direct dependency of this plugin. As a result, the plugin should now be compatible with Openfire 4.4.0 and later (including 5.0.0).
1 parent b4596af commit d5acc7b

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

changelog.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,11 @@ <h1>User Import/Export Plugin Changelog</h1>
148148
</div>
149149
<div id="pageBody">
150150

151-
<p><b>2.7.2</b> -- To Be Determined</p>
151+
<p><b>2.8.0</b> -- To Be Determined</p>
152152
<ul>
153+
<li>Requires Openfire 4.4.0.</li>
154+
<li>Requires Java 11 or later</li>
155+
<li>[<a href='https://github.com/igniterealtime/openfire-userImportExport-plugin/issues/12'>#12</a>] - Fixes Openfire 5.0.0 compatibility issue.</li>
153156
</ul>
154157

155158
<p><b>2.7.1</b> -- November 21, 2023</p>

plugin.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
<description>Enables import and export of user data</description>
88
<author>Ryan Graham</author>
99
<version>${project.version}</version>
10-
<date>2023-11-21</date>
11-
<minServerVersion>4.3.0</minServerVersion>
10+
<date>2025-06-23</date>
11+
<minServerVersion>4.4.0</minServerVersion>
12+
<minJavaVersion>11</minJavaVersion>
1213

1314
<adminconsole>
1415
<tab id="tab-users">

pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<parent>
55
<artifactId>plugins</artifactId>
66
<groupId>org.igniterealtime.openfire</groupId>
7-
<version>4.3.0</version>
7+
<version>4.4.0</version>
88
</parent>
99
<groupId>org.igniterealtime.openfire.plugins</groupId>
1010
<artifactId>userImportExport</artifactId>
11-
<version>2.7.2-SNAPSHOT</version>
11+
<version>2.8.0-SNAPSHOT</version>
1212
<name>UserImportExport Plugin</name>
1313
<description>Enables import and export of user data</description>
1414

@@ -65,6 +65,11 @@
6565
<artifactId>xsdlib</artifactId>
6666
<version>${msv.version}</version>
6767
</dependency>
68+
<dependency>
69+
<groupId>commons-fileupload</groupId>
70+
<artifactId>commons-fileupload</artifactId>
71+
<version>1.6.0</version>
72+
</dependency>
6873
<dependency>
6974
<groupId>junit</groupId>
7075
<artifactId>junit</artifactId>

src/web/export-file.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
boolean xep227Support = ParamUtils.getBooleanParameter(request, "xep227support", false);
88
99
response.setHeader("Content-Disposition","attachment;filename="+fileName+".xml");
10-
ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("userimportexport");
10+
ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPluginByName("User Import Export").orElseThrow();
1111
byte[] content = plugin.exportUsersToByteArray(xep227Support);
1212
OutputStream os = response.getOutputStream();
1313
os.write(content);

src/web/export-user-data.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
boolean xep227Support = ParamUtils.getBooleanParameter(request, "xep227support", false);
1717
1818
ImportExportPlugin plugin = (ImportExportPlugin)XMPPServer.getInstance().getPluginManager(
19-
).getPlugin("userimportexport");
19+
).getPluginByName("User Import Export").orElseThrow();
2020
2121
String exportText = "";
2222

src/web/import-user-data.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
boolean importUsers = request.getParameter("importUsers") != null;
1414
boolean xep227Support = request.getParameter("xep227support") != null;
1515
16-
ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("userimportexport");
16+
ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPluginByName("User Import Export").orElseThrow();
1717
List<String> duplicateUsers = new ArrayList<String>();
1818
1919
Map<String, String> errors = new HashMap<String, String>();

0 commit comments

Comments
 (0)