Commit 1df0b9a0 authored by Ryan Graham's avatar Ryan Graham Committed by ryang

* Added the ability to import user roster data when using a read-only user...

* Added the ability to import user roster data when using a read-only user store such as LDAP or POP3.
* Added the ability to allow user elements in the import file to be in any order.
* Added a check to make sure that the username is valid.
* Removed an unnecessary check when creating roster items.
* Updated UI to match later versions of Wildfire.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6859 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8a3ff84a
......@@ -6,75 +6,75 @@
<style type="text/css">
/* global font and body settings */
body {
font-size : 100%;
background-color : #d3d6d9;
padding: 0px;
margin: 0px 0px 30px 0px;
font-size : 100%;
background-color : #d3d6d9;
padding: 0px;
margin: 0px 0px 30px 0px;
}
body, td, th {
font-family : arial, helvetica, sans-serif;
font-size : 10pt;
font-family : arial, helvetica, sans-serif;
font-size : 10pt;
}
pre, tt, code {
font-family : courier new, monospaced;
font-size : 9pt;
font-family : courier new, monospaced;
font-size : 9pt;
}
#pageContainer {
display: block;
position: relative;
clear: both;
background-color: #fff;
border: 1px solid #999;
padding: 40px;
margin: 30px;
-moz-border-radius: 6px;
display: block;
position: relative;
clear: both;
background-color: #fff;
border: 1px solid #999;
padding: 40px;
margin: 30px;
-moz-border-radius: 6px;
}
#pageHeader {
display: block;
position: relative;
height: 80px;
background-color: #e7eaee;
border: 1px solid #cccccc;
border-bottom: none;
-moz-border-radius: 5px 5px 0px 0px;
margin: 10px 0px 0px 0px;
display: block;
position: relative;
height: 80px;
background-color: #e7eaee;
border: 1px solid #cccccc;
border-bottom: none;
-moz-border-radius: 5px 5px 0px 0px;
margin: 10px 0px 0px 0px;
}
#pageBody {
margin: 0px 18px 0px 20px;
margin: 0px 18px 0px 20px;
}
/* anchors */
a:link {
color: #11568c;
color: #11568c;
}
a:visited {
color: #571c8d;
color: #571c8d;
}
a:hover {
color: #7a1d42;
text-decoration : underline;
color: #7a1d42;
text-decoration : underline;
}
a:active {
color: #7a1d42;
color: #7a1d42;
}
/* page header elements (logo and navigation) */
.navigation {
display: block;
position: relative;
height: 20px;
background-color: #335588;
border: 1px solid #cccccc;
border-top: none;
color: #ffffff;
font-size: 11px;
line-height: 18px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 25px 0px;
overflow: hidden;
display: block;
position: relative;
height: 20px;
background-color: #335588;
border: 1px solid #cccccc;
border-top: none;
color: #ffffff;
font-size: 11px;
line-height: 18px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 25px 0px;
overflow: hidden;
}
.navigation a {
margin: 0px 20px 0px 20px;
margin: 0px 20px 0px 20px;
}
.navigation a:link { color: #ffffff; }
.navigation a:visited { color: #ffffff; }
......@@ -83,86 +83,93 @@ a:active {
/* headings */
h1 {
display: block;
position: relative;
font-size : 1.7em;
font-weight : bold;
color: #670e15;
padding: 0px;
margin: 30px 0px 0px 20px;
display: block;
position: relative;
font-size : 1.7em;
font-weight : bold;
color: #670e15;
padding: 0px;
margin: 30px 0px 0px 20px;
}
h2 {
font-size : 1.3em;
font-weight : bold;
margin: 40px 0px 6px 0px;
padding: 0px;
color: #335588;
font-size : 1.3em;
font-weight : bold;
margin: 40px 0px 6px 0px;
padding: 0px;
color: #335588;
}
h3 {
font-size : 1.0em;
font-weight : bold;
margin: 25px 0px 3px 0px;
padding: 0px;
color: #334466;
font-size : 1.0em;
font-weight : bold;
margin: 25px 0px 3px 0px;
padding: 0px;
color: #334466;
}
/* general elements */
p {
margin: 0px 0px 15px 0px;
margin: 0px 0px 15px 0px;
}
ul {
margin: 5px 0px 15px 35px;
margin: 5px 0px 15px 35px;
}
li {
padding-bottom : 4px;
padding-bottom : 4px;
}
tt {
font-family : courier new;
font-weight : bold;
color : #060;
font-family : courier new;
font-weight : bold;
color : #060;
}
hr {
display: block;
height: 1px;
background-color: #999999;
border: none;
margin: 40px 0px 20px 0px;
display: block;
height: 1px;
background-color: #999999;
border: none;
margin: 40px 0px 20px 0px;
}
.footer {
font-size : 8pt;
color : #666;
text-align : center;
margin-top : 2em;
padding-top : 0.5em;
border-top : 1px #CCC solid;
font-size : 8pt;
color : #666;
text-align : center;
margin-top : 2em;
padding-top : 0.5em;
border-top : 1px #CCC solid;
}
</style>
</head>
<body>
<div id="pageContainer">
<div id="pageHeader">
<h1>User Import/Export Plugin Changelog</h1>
</div>
<div id="pageHeader">
<h1>User Import/Export Plugin Changelog</h1>
</div>
<div id="pageBody">
<h2>2.1.0 -- <span style="font-weight: normal;">Januar 29, 2007</span></h2>
<ul>
<li>Added the ability to import user roster data when using a read-only user store such as LDAP or POP3.</li>
<li>Added the ability to allow user elements in the import file to be in any order.</li>
<li>Added a check to make sure that the username is valid.</li>
<li>Removed an unnecessary check when creating roster items.</li>
<li>Updated UI to match later versions of Wildfire.</li>
</ul>
<h2>2.0.4 -- <span style="font-weight: normal;">October 06, 2006</span></h2>
<ul>
<li>Updated to use compression offered by Wildfire 3.1</li>
<li>Updated to use compression offered by Wildfire 3.1</li>
</ul>
<h2>2.0.3 -- <span style="font-weight: normal;">July 10, 2006</span></h2>
<ul>
<li>Updated to work with Wildfire 3.0.1.</li>
<li>Updated to work with Wildfire 3.0.1.</li>
</ul>
<h2>2.0.2 -- <span style="font-weight: normal;">December 15, 2005</span></h2>
<ul>
<li>Now requires Wildfire 2.4.0.</li>
<li>Now requires Wildfire 2.4.0.</li>
</ul>
<h2>2.0.1 -- <span style="font-weight: normal;">November 29, 2005</span></h2>
......@@ -186,10 +193,10 @@ hr {
<h2>1.0 -- <span style="font-weight: normal;">June 1, 2005</span></h2>
<ul>
<li>Initial release.</li>
<li>Initial release.</li>
</ul>
</div>
</div>
</div>
</body>
......
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Wildfire">
<xs:complexType>
<xs:sequence>
<xs:element ref="User" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="User">
<xs:complexType>
<xs:sequence>
<xs:element ref="Username" use="required"/>
<xs:element ref="Password" use="required"/>
<xs:element ref="Email"/>
<xs:element ref="Name"/>
<xs:element ref="CreationDate"/>
<xs:element ref="ModifiedDate"/>
<xs:element ref="Roster"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Username" type="xs:string"/>
<xs:element name="Password" type="xs:string"/>
<xs:element name="Email" type="xs:string"/>
<xs:element name="Name" type="xs:string"/>
<xs:element name="CreationDate" type="jive-date"/>
<xs:element name="ModifiedDate" type="jive-date"/>
<xs:element name="Roster">
<xs:complexType>
<xs:sequence>
<xs:element ref="Item" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Item">
<xs:complexType>
<xs:sequence>
<xs:element ref="Group" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute ref="jid" use="required"/>
<xs:attribute name="askstatus" use="required"/>
<xs:attribute name="recvstatus" use="required"/>
<xs:attribute name="substatus" use="required"/>
<xs:attribute name="name"/>
</xs:complexType>
</xs:element>
<xs:element name="Group" type="xs:string"/>
<xs:attribute name="jid" type="xs:string"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="askstatus">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="-1"/>
<xs:maxInclusive value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="recvstatus">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="-1"/>
<xs:maxInclusive value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="substatus">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="-1"/>
<xs:maxInclusive value="3"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:simpleType name="jive-date">
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Wildfire">
<xs:complexType>
<xs:sequence>
<xs:element ref="User" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="User">
<xs:complexType>
<xs:all>
<xs:element ref="Username" use="required" />
<xs:element ref="Password" use="required" />
<xs:element ref="Email" />
<xs:element ref="Name" />
<xs:element ref="CreationDate" />
<xs:element ref="ModifiedDate" />
<xs:element ref="Roster" />
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="Username" type="xs:string" />
<xs:element name="Password" type="xs:string" />
<xs:element name="Email" type="xs:string" />
<xs:element name="Name" type="xs:string" />
<xs:element name="CreationDate" type="jive-date" />
<xs:element name="ModifiedDate" type="jive-date" />
<xs:element name="Roster">
<xs:complexType>
<xs:sequence>
<xs:element ref="Item" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Item">
<xs:complexType>
<xs:sequence>
<xs:element ref="Group" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute ref="jid" use="required" />
<xs:attribute name="askstatus" use="required" />
<xs:attribute name="recvstatus" use="required" />
<xs:attribute name="substatus" use="required" />
<xs:attribute name="name" />
</xs:complexType>
</xs:element>
<xs:element name="Group" type="xs:string" />
<xs:attribute name="jid" type="xs:string" />
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="askstatus">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="-1" />
<xs:maxInclusive value="3" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="recvstatus">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="-1" />
<xs:maxInclusive value="3" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="substatus">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="-1" />
<xs:maxInclusive value="3" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:simpleType name="jive-date">
<xs:restriction base="xs:string"></xs:restriction>
</xs:simpleType>
</xs:schema>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<plugin>
<class>org.jivesoftware.wildfire.plugin.ImportExportPlugin</class>
<class>org.jivesoftware.wildfire.plugin.ImportExportPlugin</class>
<name>User Import Export</name>
<description>Enables import and export of user data</description>
<author>Ryan Graham</author>
<version>2.0.4</version>
<date>10/06/2006</date>
<minServerVersion>3.1.0</minServerVersion>
<name>User Import Export</name>
<description>Enables import and export of user data</description>
<author>Ryan Graham</author>
<version>2.1.0</version>
<date>01/29/2007</date>
<minServerVersion>3.1.0</minServerVersion>
<adminconsole>
<tab id="tab-users">
<sidebar id="user-import-export" name="Import &amp; Export">
<item id="import-export-selection" name="User Import &amp; Export"
url="import-export-selection.jsp"
description="Allows the importing and exporting of Wildfire user data." />
</sidebar>
</tab>
</adminconsole>
<adminconsole>
<tab id="tab-users">
<sidebar id="user-import-export" name="Import &amp; Export">
<item id="import-export-selection" name="User Import &amp; Export"
url="import-export-selection.jsp"
description="Allows the importing and exporting of Wildfire user data." />
</sidebar>
</tab>
</adminconsole>
</plugin>
This diff is collapsed.
......@@ -6,7 +6,7 @@
response.setContentType("application/x-download");
response.setHeader("Content-Disposition","attachment;filename="+fileName+".xml");
ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("userimportexport");
byte[] content = plugin.exportUsersToFile();
byte[] content = plugin.exportUsersToByteArray();
OutputStream os = response.getOutputStream();
os.write(content);
os.flush();
......
<%@ page import="java.io.IOException,
java.util.*,
java.util.*,
org.jivesoftware.wildfire.plugin.ImportExportPlugin,
org.jivesoftware.wildfire.XMPPServer,
org.jivesoftware.util.ParamUtils"
......@@ -85,13 +85,12 @@
<form action="export-user-data.jsp?exportUsers" method="post">
<fieldset>
<legend>Export Options</legend>
<div>
<div class="jive-contentBoxHeader">Export Options</div>
<div class="jive-contentBox">
<p>
Select the radio button next to the desired export option and then click on the Export button.
</p>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody>
<tr>
......@@ -112,10 +111,7 @@
</tr>
</tbody>
</table>
</div>
</fieldset>
<br><br>
</div>
<input type="submit" value="Export">
</form>
......
......@@ -16,12 +16,6 @@
<p>
<% if (plugin.isUserProviderReadOnly()) { %>
Sorry, because you are using LDAP as your user store, this plugin will not work with your Wildfire installation.
<% } else { %>
The import and export functions allow you to read data into and write user
data from your Wildfire installation.
......@@ -30,7 +24,13 @@ data from your Wildfire installation.
<li><a href="export-user-data.jsp">Export User Data</a></li>
</ul>
<% if (plugin.isUserProviderReadOnly()) { %>
Note: because you are using a read-only user data store such as LDAP or POP3 you will only be able to import user roster data, not users themselves.
Please see the <a href="../../plugin-admin.jsp?plugin=userimportexport&showReadme=true&decorator=none">readme</a> for details.
<% } %>
</p>
</body>
</html>
......@@ -10,7 +10,6 @@
<%
boolean importUsers = request.getParameter("importUsers") != null;
boolean success = request.getParameter("success") != null;
ImportExportPlugin plugin = (ImportExportPlugin) XMPPServer.getInstance().getPluginManager().getPlugin("userimportexport");
List<String> duplicateUsers = new ArrayList<String>();
......@@ -41,8 +40,8 @@
response.sendRedirect("import-user-data.jsp?success=true");
return;
}
errors.put("userAlreadyExists", "userAlreadyExists");
errors.put("invalidUser", "invalidUser");
}
catch (MalformedURLException e) {
errors.put("IOException", "IOException");
......@@ -80,8 +79,13 @@
Import failed.
<% } else if (errors.containsKey("invalidUserFile")) { %>
The import file does not match the user schema.
<% } else if (errors.containsKey("userAlreadyExists")) { %>
The following users are already exist in the system and were not loaded:<br>
<% } else if (errors.containsKey("invalidUser")) { %>
<% if (plugin.isUserProviderReadOnly()) { %>
The following users did not exist in the system or have invalid username so their roster was not loaded:<br>
<% } else { %>
The following users already exist in the system or have invalid username and were not loaded:<br>
<% } %>
<%
Iterator iter = duplicateUsers.iterator();
while (iter.hasNext()) {
......@@ -108,7 +112,11 @@
<tbody>
<tr>
<td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<td class="jive-icon-label">All users added successfully.</td>
<% if (plugin.isUserProviderReadOnly()) { %>
<td class="jive-icon-label">User roster data added successfully.</td>
<% } else { %>
<td class="jive-icon-label">All users added successfully.</td>
<% } %>
</tr>
</tbody>
</table>
......@@ -122,9 +130,8 @@ Use the form below to import a user data XML file.
<form action="import-user-data.jsp?importUsers" method="post" enctype="multipart/form-data">
<fieldset>
<legend>Import</legend>
<div>
<div class="jive-contentBoxHeader">Import</div>
<div class="jive-contentBox">
<p>
Choose a file to import:</p>
<input type="file" name="thefile">
......@@ -136,10 +143,7 @@ Use the form below to import a user data XML file.
See the migration section of the <a href="../../plugin-admin.jsp?plugin=userimportexport&showReadme=true&decorator=none">readme</a> for details.
</p>
Replace Domain: <input type="text" size="20" maxlength="150" name="previousDomain" value=""/>
</div>
</fieldset>
<br><br>
</div>
<input type="submit" value="Import">
</form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment