Commit 634ade79 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[JM-1229] Created initial Clearspace integration setup steps. Many stubs in...

[JM-1229] Created initial Clearspace integration setup steps.  Many stubs in place until real integration pieces are built.
Color fixes for LDAP screens when edited via profile settings.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9891 b35dd754-fafc-0310-a699-88a17e54d16e
parent 15cb434b
......@@ -286,6 +286,34 @@
## Added key: 'muc.room.occupants.kicked'
## Added key: 'muc.room.occupants.kickfailed'
## Added key: 'index.host_name'
## Added key: 'setup.profile.clearspace'
## Added key: 'setup.profile.clearspace_description'
## Added key: 'profile-settings.clearspace_mapping_info'
## Added key: 'setup.clearspace.continue'
## Added key: 'setup.clearspace.test'
## Added key: 'setup.clearspace.title'
## Added key: 'setup.clearspace.profile'
## Added key: 'setup.clearspace.service.connection_settings'
## Added key: 'setup.clearspace.service.integration'
## Added key: 'setup.clearspace.service'
## Added key: 'setup.clearspace.service.description'
## Added key: 'setup.clearspace.service.host'
## Added key: 'setup.clearspace.service.host_help'
## Added key: 'setup.clearspace.service.host_error'
## Added key: 'setup.clearspace.service.port'
## Added key: 'setup.clearspace.service.port_help'
## Added key: 'setup.clearspace.service.port_error'
## Added key: 'setup.clearspace.service.secret'
## Added key: 'setup.clearspace.service.secret_help'
## Added key: 'setup.clearspace.service.secret_error'
## Added key: 'setup.clearspace.service.test.error-connection'
## Added key: 'setup.clearspace.service.test.close'
## Added key: 'setup.clearspace.service.test.title'
## Added key: 'setup.clearspace.service.test.title-desc'
## Added key: 'setup.clearspace.service.test.status-success'
## Added key: 'setup.clearspace.service.test.status-success.detail'
## Added key: 'setup.clearspace.service.test.status-error'
# Openfire
......@@ -1577,6 +1605,10 @@ setup.profile.ldap=Directory Server (LDAP)
setup.profile.ldap_description=Integrate with a directory server such as Active Directory or \
OpenLDAP using the LDAP protocol. Users and groups are stored in the directory and treated \
as read-only.
setup.profile.clearspace=Clearspace Integration
setup.profile.clearspace_description=Integrate with an existing Clearspace installation. Users and groups \
will be pulled directly from Clearspace so user management will be handled in Clearspace's admin \
console.
# Setup LDAP pages
......@@ -1732,6 +1764,36 @@ setup.ldap.group.test.label-members=Members
setup.ldap.group.test.group-not-found=No groups were found using the specified configuration. Try changing the base DN,\
group filter or member field.
# Setup Clearspace Pages
setup.clearspace.continue=Save & Continue
setup.clearspace.test=Test Settings
setup.clearspace.title=Profile Settings - Clearspace Integration
setup.clearspace.profile=Profile Settings
setup.clearspace.service.integration=Clearspace Integration
setup.clearspace.service.connection_settings=Connection Settings
setup.clearspace.service=Clearspace Service
setup.clearspace.service.description=Configure connection settings for your Clearspace service below. All fields are required, and the shared secret is configured from the Clearspace admin console.
setup.clearspace.service.host=Host
setup.clearspace.service.host_help=Clearspace service host name; e.g. cs.example.com, etc.
setup.clearspace.service.host_error=Enter a valid Clearspace service host name.
setup.clearspace.service.port=Port
setup.clearspace.service.port_help=Clearspace service port number. The default value is 8080.
setup.clearspace.service.port_error=Enter a valid Clearspace service port number.
setup.clearspace.service.secret=Shared Secret
setup.clearspace.service.secret_help=Shared secret between Clearspace and Openfire.
setup.clearspace.service.secret_error=Enter a valid shared secret as set in Clearspace.
setup.clearspace.service.test.error-connection=An error occured while attempting to connect to Clearspace. This is a stub error and you should never see this in production. Please report immediately if you do.
setup.clearspace.service.test.close=Close
setup.clearspace.service.test.title=Test
setup.clearspace.service.test.title-desc=Connection Settings
setup.clearspace.service.test.status-success=Status: Success!
setup.clearspace.service.test.status-success.detail=A connection was successfully established to the Clearspace \
service using the settings above. Close this test panel and continue to the next step.
setup.clearspace.service.test.status-error=Status: Error
# Setup finished Page
setup.finished.title=Setup Complete!
......@@ -2416,6 +2478,7 @@ profile-settings.info=The server is currently using the following user and group
LDAP it is possible to alter current integration settings. However, if you want to change the user and group \
system then you will need to re-run the setup process.
profile-settings.ldap_mapping_info=LDAP Settings
profile-settings.clearspace_mapping_info=Clearspace Settings
# Ports section/page
......
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.clearspace;
import org.jivesoftware.openfire.auth.AuthProvider;
import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.user.UserNotFoundException;
/**
* @author Daniel Henninger
*/
public class ClearspaceAuthProvider implements AuthProvider {
public boolean isPlainSupported() {
return true;
}
public boolean isDigestSupported() {
return true;
}
public void authenticate(String username, String password) throws UnauthorizedException {
// Nothing
}
public void authenticate(String username, String token, String digest) throws UnauthorizedException {
// Nothing
}
public String getPassword(String username) throws UserNotFoundException, UnsupportedOperationException {
return (username.equals("admin") ? "test" : "asdasdasdasd");
}
public void setPassword(String username, String password) throws UserNotFoundException, UnsupportedOperationException {
// Nothing
}
public boolean supportsPasswordRetrieval() {
return false;
}
}
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.clearspace;
import org.jivesoftware.openfire.group.GroupProvider;
import org.jivesoftware.openfire.group.Group;
import org.jivesoftware.openfire.group.GroupAlreadyExistsException;
import org.jivesoftware.openfire.group.GroupNotFoundException;
import org.xmpp.packet.JID;
import java.util.Collection;
/**
* @author Daniel Henninger
*/
public class ClearspaceGroupProvider implements GroupProvider {
public Group createGroup(String name) throws UnsupportedOperationException, GroupAlreadyExistsException {
throw new UnsupportedOperationException("Test");
}
public void deleteGroup(String name) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Test");
}
public Group getGroup(String name) throws GroupNotFoundException {
return null;
}
public void setName(String oldName, String newName) throws UnsupportedOperationException, GroupAlreadyExistsException {
throw new UnsupportedOperationException("Test");
}
public void setDescription(String name, String description) throws GroupNotFoundException {
throw new UnsupportedOperationException("Test");
}
public int getGroupCount() {
return 0;
}
public Collection<String> getGroupNames() {
return null;
}
public Collection<String> getGroupNames(int startIndex, int numResults) {
return null;
}
public Collection<String> getGroupNames(JID user) {
return null;
}
public void addMember(String groupName, JID user, boolean administrator) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Test");
}
public void updateMember(String groupName, JID user, boolean administrator) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Test");
}
public void deleteMember(String groupName, JID user) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Test");
}
public boolean isReadOnly() {
return true;
}
public Collection<String> search(String query) {
return null;
}
public Collection<String> search(String query, int startIndex, int numResults) {
return null;
}
public boolean isSearchSupported() {
return false;
}
}
/**
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 2008 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.clearspace;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.Log;
import java.util.*;
/**
* Centralized administration of Clearspace connections. The {@link #getInstance()} method
* should be used to get an instace. The following properties configure this manager:
*
* <ul>
* <li>clearspace.host</li>
* <li>clearspace.port</li>
* <li>clearspace.sharedSecret</li>
* </ul>
*
* @author Daniel Henninger
*/
public class ClearspaceManager {
private static ClearspaceManager instance;
static {
// Create a special Map implementation to wrap XMLProperties. We only implement
// the get, put, and remove operations, since those are the only ones used. Using a Map
// makes it easier to perform LdapManager testing.
Map<String, String> properties = new Map<String, String>() {
public String get(Object key) {
return JiveGlobals.getXMLProperty((String)key);
}
public String put(String key, String value) {
JiveGlobals.setXMLProperty(key, value);
// Always return null since XMLProperties doesn't support the normal semantics.
return null;
}
public String remove(Object key) {
JiveGlobals.deleteXMLProperty((String)key);
// Always return null since XMLProperties doesn't support the normal semantics.
return null;
}
public int size() {
return 0;
}
public boolean isEmpty() {
return false;
}
public boolean containsKey(Object key) {
return false;
}
public boolean containsValue(Object value) {
return false;
}
public void putAll(Map<? extends String, ? extends String> t) {
}
public void clear() {
}
public Set<String> keySet() {
return null;
}
public Collection<String> values() {
return null;
}
public Set<Entry<String, String>> entrySet() {
return null;
}
};
instance = new ClearspaceManager(properties);
}
private String host;
private int port;
private String sharedSecret;
private Map<String, String> properties;
/**
* Provides singleton access to an instance of the ClearspaceManager class.
*
* @return an ClearspaceManager instance.
*/
public static ClearspaceManager getInstance() {
return instance;
}
/**
* Constructs a new ClearspaceManager instance. Typically, {@link #getInstance()} should be
* called instead of this method. ClearspaceManager instances should only be created directly
* for testing purposes.
*
* @param properties the Map that contains properties used by the Clearspace manager, such as
* Clearspace host and shared secret.
*/
public ClearspaceManager(Map<String, String> properties) {
this.properties = properties;
String host = properties.get("clearspace.host");
if (host != null) {
this.host = host;
}
String portStr = properties.get("clearspace.port");
port = 8080;
if (portStr != null) {
try {
this.port = Integer.parseInt(portStr);
}
catch (NumberFormatException nfe) {
Log.error(nfe);
}
}
sharedSecret = properties.get("clearspace.sharedSecret");
StringBuilder buf = new StringBuilder();
buf.append("Created new ClearspaceManager() instance, fields:\n");
buf.append("\t host: ").append(host).append("\n");
buf.append("\t port: ").append(port).append("\n");
buf.append("\t sharedSecret: ").append(sharedSecret).append("\n");
if (Log.isDebugEnabled()) {
Log.debug("ClearspaceManager: "+buf.toString());
}
}
/**
* Temporary connection tester.
*
* TODO: This is a temporary stub until the real interface is worked out.
*
* @return True if connection test was successful.
*/
public Boolean testConnection() {
if (host.equals("notlocalhost")) {
return false;
}
return true;
}
/**
* Returns the Clearspace service host; e.g. <tt>cs.example.org</tt>.
* This value is stored as the Jive Property <tt>clearspace.host</tt>.
*
* @return the Clearspace service host name.
*/
public String getHost() {
return host;
}
/**
* Sets the hostname of the Clearspace service; e.g., <tt>cs.example.org</tt>.
* This value is stored as the Jive Property <tt>clearspace.host</tt>.
*
* @param host the Clearspace service host name.
*/
public void setHost(String host) {
this.host = host;
properties.put("clearspace.host", host);
}
/**
* Returns the Clearspace service port number. The default is 8080. This value is
* stored as the Jive Property <tt>clearspace.port</tt>.
*
* @return the Clearspace service port number.
*/
public int getPort() {
return port;
}
/**
* Sets the Clearspace service port number. The default is 8080. This value is
* stored as the Jive property <tt>clearspace.port</tt>.
*
* @param port the Clearspace service port number.
*/
public void setPort(int port) {
this.port = port;
properties.put("clearspace.port", Integer.toString(port));
}
/**
* Returns the password, configured in Clearspace, that Openfire will use to authenticate
* with Clearspace to perform it's integration.
*
* @return the password Openfire will use to authenticate with Clearspace.
*/
public String getSharedSecret() {
return sharedSecret;
}
/**
* Sets the shared secret for the Clearspace service we're connecting to.
*
* @param sharedSecret the password configured in Clearspace to authenticate Openfire.
*/
public void setSharedSecret(String sharedSecret) {
this.sharedSecret = sharedSecret;
properties.put("clearspace.sharedSecret", sharedSecret);
}
}
\ No newline at end of file
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.clearspace;
import org.jivesoftware.openfire.user.UserProvider;
import org.jivesoftware.openfire.user.User;
import org.jivesoftware.openfire.user.UserNotFoundException;
import org.jivesoftware.openfire.user.UserAlreadyExistsException;
import java.util.Collection;
import java.util.Date;
import java.util.Set;
/**
* @author Daniel Henninger
*/
public class ClearspaceUserProvider implements UserProvider {
public User loadUser(String username) throws UserNotFoundException {
return new User(username, "test user", "test@example.org", new Date(), new Date());
}
public User createUser(String username, String password, String name, String email) throws UserAlreadyExistsException {
return new User(username, name, email, new Date(), new Date());
}
public void deleteUser(String username) {
// Nothing
}
public int getUserCount() {
return 0;
}
public Collection<User> getUsers() {
return null;
}
public Collection<String> getUsernames() {
return null;
}
public Collection<User> getUsers(int startIndex, int numResults) {
return null;
}
public void setName(String username, String name) throws UserNotFoundException {
// Nothing
}
public void setEmail(String username, String email) throws UserNotFoundException {
// Nothing
}
public void setCreationDate(String username, Date creationDate) throws UserNotFoundException {
// Nothing
}
public void setModificationDate(String username, Date modificationDate) throws UserNotFoundException {
// Nothing
}
public Set<String> getSearchFields() throws UnsupportedOperationException {
throw new UnsupportedOperationException("Test");
}
public Collection<User> findUsers(Set<String> fields, String query) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Test");
}
public Collection<User> findUsers(Set<String> fields, String query, int startIndex, int numResults) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Test");
}
public boolean isReadOnly() {
return true;
}
}
/**
* $Revision$
* $Date$
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.openfire.clearspace;
import org.jivesoftware.openfire.vcard.VCardProvider;
import org.jivesoftware.util.AlreadyExistsException;
import org.jivesoftware.util.NotFoundException;
import org.dom4j.Element;
/**
* @author Daniel Henninger
*/
public class ClearspaceVCardProvider implements VCardProvider {
public Element loadVCard(String username) {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public Element createVCard(String username, Element vCardElement) throws AlreadyExistsException {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public Element updateVCard(String username, Element vCardElement) throws NotFoundException {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public void deleteVCard(String username) {
//To change body of implemented methods use File | Settings | File Templates.
}
public boolean isReadOnly() {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
}
......@@ -12,6 +12,7 @@
<pattern>/setup/setup-ldap-server_test.jsp*</pattern>
<pattern>/setup/setup-ldap-user_test.jsp*</pattern>
<pattern>/setup/setup-ldap-group_test.jsp*</pattern>
<pattern>/setup/setup-clearspace-integration_test.jsp*</pattern>
<pattern>/setup/setup-admin-settings_test.jsp*</pattern>
<pattern>/login.jsp*</pattern>
<pattern>/plugin-icon.jsp*</pattern>
......
<%
boolean initialSetup = false;
String currentPage = "clearspace-integration.jsp";
String testPage = "setup/setup-clearspace-integration_test.jsp";
String nextPage = "profile-settings.jsp";
Map<String, String> meta = new HashMap<String, String>();
meta.put("pageID", "profile-settings");
%>
<style type="text/css" title="setupStyle" media="screen">
@import "style/lightbox.css";
@import "style/ldap.css";
</style>
<script language="JavaScript" type="text/javascript" src="js/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="js/scriptaculous.js"></script>
<script language="JavaScript" type="text/javascript" src="js/lightbox.js"></script>
<script language="javascript" type="text/javascript" src="js/tooltips/domLib.js"></script>
<script language="javascript" type="text/javascript" src="js/tooltips/domTT.js"></script>
<script language="javascript" type="text/javascript" src="js/setup.js"></script>
<%@ include file="setup/clearspace-integration.jspf" %>
\ No newline at end of file
<%@ page import="org.jivesoftware.util.JiveGlobals" %>
<%@ page import="org.jivesoftware.openfire.ldap.LdapManager" %>
<%@ page import="org.jivesoftware.openfire.clearspace.ClearspaceManager" %>
<%--
- $RCSfile$
- $Revision: $
......@@ -16,12 +17,16 @@
<%
// Get parameters
boolean edit = request.getParameter("edit") != null;
if (edit) {
if (request.getParameter("ldapedit") != null) {
// Redirect to first step.
response.sendRedirect("ldap-server.jsp");
return;
}
else if (request.getParameter("clearspaceedit") != null) {
// Redirect to clearspace setup.
response.sendRedirect("clearspace-integration.jsp");
return;
}
%>
<html>
......@@ -33,18 +38,8 @@
<%
boolean isLDAP = "org.jivesoftware.openfire.ldap.LdapAuthProvider".equals(
JiveGlobals.getXMLProperty("provider.auth.className"));
StringBuilder sb = new StringBuilder();
for (String host : LdapManager.getInstance().getHosts()) {
sb.append(host).append(", ");
}
String hosts = sb.toString();
if (hosts.trim().length() > 0) {
hosts = hosts.substring(0, hosts.length()-2);
}
int port = LdapManager.getInstance().getPort();
String baseDN = LdapManager.getInstance().getBaseDN();
String adminDN = LdapManager.getInstance().getAdminDN();
boolean isCLEARSPACE = "org.jivesoftware.openfire.clearspace.ClearspaceAuthProvider".equals(
JiveGlobals.getXMLProperty("provider.auth.className"));
%>
<p>
<fmt:message key="profile-settings.info"/>
......@@ -59,8 +54,8 @@
<tbody>
<tr>
<td width="1%" nowrap>
<input type="radio" <%= isLDAP ? "disabled" : "readonly"%>
<%= (isLDAP ? "" : "checked") %>>
<input type="radio" <%= (isLDAP || isCLEARSPACE) ? "disabled" : "readonly"%>
<%= ((isLDAP || isCLEARSPACE) ? "" : "checked") %>>
</td>
<td width="99%">
<b><fmt:message key="setup.profile.default" /></b> - <fmt:message key="setup.profile.default_description" />
......@@ -76,6 +71,19 @@
</td>
</tr>
<% if (isLDAP) { %>
<%
StringBuilder sb = new StringBuilder();
for (String host : LdapManager.getInstance().getHosts()) {
sb.append(host).append(", ");
}
String hosts = sb.toString();
if (hosts.trim().length() > 0) {
hosts = hosts.substring(0, hosts.length()-2);
}
int port = LdapManager.getInstance().getPort();
String baseDN = LdapManager.getInstance().getBaseDN();
String adminDN = LdapManager.getInstance().getAdminDN();
%>
<tr>
<td width="1%" nowrap>
&nbsp;
......@@ -125,10 +133,60 @@
</td>
<tr>
<td colspan="2" align="center">
<input type="submit" name="edit" value="<fmt:message key="server.properties.edit" />">
<input type="submit" name="ldapedit" value="<fmt:message key="server.properties.edit" />">
</td>
</tr>
<% } %>
<tr>
<td width="1%" nowrap>
<input type="radio" <%= isCLEARSPACE ? "readonly" : "disabled"%>
<%= (isCLEARSPACE ? "checked" : "") %>>
</td>
<td width="99%">
<b><fmt:message key="setup.profile.clearspace" /></b> - <fmt:message key="setup.profile.clearspace_description" />
</td>
</tr>
<% if (isCLEARSPACE) { %>
<%
String host = ClearspaceManager.getInstance().getHost();
int port = ClearspaceManager.getInstance().getPort();
%>
<tr>
<td width="1%" nowrap>
&nbsp;
</td>
<td width="99%">
<table class="jive-table" cellpadding="0" cellspacing="0" border="0" width="98%" align="right">
<thead>
<tr>
<th colspan="2"><fmt:message key="profile-settings.clearspace_mapping_info" /></th>
</tr>
</thead>
<tbody>
<tr>
<td class="c1">
<fmt:message key="setup.clearspace.service.host" />:
</td>
<td class="c2">
<%= host %>
</td>
</tr>
<tr>
<td class="c1">
<fmt:message key="setup.clearspace.service.port" />:
</td>
<td class="c2">
<%= port %>
</td>
</tr>
</tbody>
</table>
</td>
<tr>
<td colspan="2" align="center">
<input type="submit" name="clearspaceedit" value="<fmt:message key="server.properties.edit" />">
</td>
</tr>
<% } %>
</tbody>
</table>
......
<%@ page import="org.jivesoftware.util.LocaleUtils"%>
<%@ page import="org.jivesoftware.util.ParamUtils"%>
<%@ page import="java.util.*" %>
<%@ page import="org.jivesoftware.openfire.clearspace.ClearspaceManager" %>
<%@ page import="org.jivesoftware.util.JiveGlobals" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<%
String host;
int port = 8080;
String sharedSecret;
// Get parameters
boolean save = request.getParameter("save") != null;
boolean test = request.getParameter("test") != null;
ClearspaceManager manager = ClearspaceManager.getInstance();
Map<String, String> errors = new HashMap<String, String>();
if (save || test) {
host = ParamUtils.getParameter(request, "host");
if (host == null) {
errors.put("host", LocaleUtils.getLocalizedString("setup.clearspace.service.host_error"));
}
port = ParamUtils.getIntParameter(request, "port", port);
if (port <= 0) {
errors.put("port", LocaleUtils.getLocalizedString("setup.clearspace.service.port_error"));
}
sharedSecret = ParamUtils.getParameter(request, "sharedSecret");
if (errors.isEmpty()) {
// Store settings in a map and keep it in the session
Map<String, String> settings = new HashMap<String, String>();
settings.put("clearspace.host", host);
settings.put("clearspace.port", Integer.toString(port));
settings.put("clearspace.sharedSecret", sharedSecret);
session.setAttribute("clearspaceSettings", settings);
if (save) {
// Save settings and redirect
manager.setHost(host);
manager.setPort(port);
manager.setSharedSecret(sharedSecret);
// Enable the Clearspace user, auth, group, and vcard providers.
JiveGlobals.setXMLProperty("provider.user.className",
"org.jivesoftware.openfire.clearspace.ClearspaceUserProvider");
JiveGlobals.setXMLProperty("provider.auth.className",
"org.jivesoftware.openfire.clearspace.ClearspaceAuthProvider");
JiveGlobals.setXMLProperty("provider.group.className",
"org.jivesoftware.openfire.clearspace.ClearspaceGroupProvider");
JiveGlobals.setXMLProperty("provider.vcard.className",
"org.jivesoftware.openfire.clearspace.ClearspaceVCardProvider");
// Redirect to next step.
response.sendRedirect(nextPage);
return;
}
}
} else {
// See if there are already values for the variables defined.
host = manager.getHost();
port = manager.getPort();
sharedSecret = manager.getSharedSecret();
}
%>
<html>
<head>
<title><fmt:message key="setup.clearspace.title" /></title>
<% for (Map.Entry<String, String> entry : meta.entrySet()) { %>
<meta name="<%= entry.getKey()%>" content="<%= entry.getValue()%>"/>
<% } %>
</head>
<body>
<% if (test && errors.isEmpty()) { %>
<a href="<%= testPage%>" id="lbmessage" title="<fmt:message key="global.test" />" style="display:none;"></a>
<script type="text/javascript">
function loadMsg() {
var lb = new lightbox(document.getElementById('lbmessage'));
lb.activate();
}
setTimeout('loadMsg()', 250);
</script>
<% } %>
<% if (initialSetup) { %>
<h1><fmt:message key="setup.clearspace.profile" />: <span><fmt:message key="setup.clearspace.service.integration" /></span></h1>
<% } %>
<div id="jive-contentBox_stepbar">
<span class="jive-stepbar_step"><strong><fmt:message key="setup.clearspace.service.connection_settings" /></strong></span>
</div>
<div class="jive-contentBox jive-contentBox_for-stepbar">
<h2><span><fmt:message key="setup.clearspace.service.connection_settings" /></span></h2>
<p><fmt:message key="setup.clearspace.service.description" /></p>
<% if (errors.size() > 0) { %>
<div class="error">
<% for (String error:errors.values()) { %>
<%= error%><br/>
<% } %>
</div>
<% } %>
<form action="<%= currentPage%>" method="post">
<!-- BEGIN jive-contentBox_bluebox -->
<div class="jive-contentBox_bluebox">
<table border="0" cellpadding="0" cellspacing="2" width="100%">
<tr>
<td colspan="4"><strong><fmt:message key="setup.clearspace.service" /></strong></td>
</tr>
<tr>
<td align="right" width="1%" nowrap="nowrap"><fmt:message key="setup.clearspace.service.host" />:</td>
<td width="1%">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="1%" nowrap="nowrap">
<input type="text" name="host" id="jiveCLEARSPACEhost" size="22" maxlength="50" value="<%= host!=null?host:"" %>">
</td>
<td width="99%">
<span class="jive-setup-helpicon" onmouseover="domTT_activate(this, event, 'content', '<fmt:message key="setup.clearspace.service.host_help" />', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', 8000);"></span>
</td>
</tr>
</table>
</td>
<td align="right" width="1%" nowrap="nowrap">&nbsp;&nbsp; <fmt:message key="setup.clearspace.service.port" />:</td>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="1%" nowrap="nowrap">
<input type="text" name="port" id="jiveCLEARSPACEport" size="5" maxlength="5" value="<%= port %>">
</td>
<td width="99%">
<span class="jive-setup-helpicon" onmouseover="domTT_activate(this, event, 'content', '<fmt:message key="setup.clearspace.service.port_help" />', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', 8000);"></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" width="1%" nowrap="nowrap"><fmt:message key="setup.clearspace.service.secret" />:</td>
<td colspan="3">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="1%" nowrap="nowrap">
<input type="password" name="sharedSecret" id="jiveCLEARSPACEsecret" size="22" maxlength="30" value="<%= sharedSecret!=null?sharedSecret:""%>">
</td>
<td width="99%">
<span class="jive-setup-helpicon" onmouseover="domTT_activate(this, event, 'content', '<fmt:message key="setup.clearspace.service.secret_help" />', 'styleClass', 'jiveTooltip', 'trail', true, 'delay', 300, 'lifetime', -1);"></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!-- END jive-contentBox_bluebox -->
<!-- BEGIN jive-buttons -->
<div class="jive-buttons">
<!-- BEGIN right-aligned buttons -->
<div align="right">
<input type="Submit" name="test" value="<fmt:message key="setup.clearspace.test" />" id="jive-setup-test" border="0">
<input type="Submit" name="save" value="<fmt:message key="setup.clearspace.continue" />" id="jive-setup-save" border="0">
</div>
<!-- END right-aligned buttons -->
</div>
<!-- END jive-buttons -->
</form>
</div>
<!-- END jive-contentBox -->
</body>
</html>
......@@ -47,7 +47,7 @@
boolean doTest = request.getParameter("test") != null;
boolean ldap = "true".equals(request.getParameter("ldap"));
boolean clearspace = "true".equals(request.getParameter("clearspace"));
boolean addAdmin = request.getParameter("addAdministrator") != null;
boolean deleteAdmins = request.getParameter("deleteAdmins") != null;
......@@ -62,6 +62,15 @@
return;
}
// Handle clearspace completion
if (clearspace) {
// admin accounts are pulled from Clearspace, so we're done:
setSetupFinished(session);
// redirect
response.sendRedirect("setup-finished.jsp");
return;
}
// Error checks
Map<String, String> errors = new HashMap<String, String>();
if (doContinue) {
......
<%@ page import="org.jivesoftware.openfire.XMPPServer" %>
<%
// Redirect if we've already run setup:
if (!XMPPServer.getInstance().isSetupMode()) {
response.sendRedirect("setup-completed.jsp");
return;
}
%>
<%
boolean initialSetup = true;
String currentPage = "setup-clearspace-integration.jsp";
String testPage = "setup-clearspace-integration_test.jsp";
String nextPage = "setup-admin-settings.jsp?clearspace=true";
Map<String, String> meta = new HashMap<String, String>();
meta.put("currentStep", "3");
%>
<%@ include file="clearspace-integration.jspf" %>
<%@ page import="org.jivesoftware.util.LocaleUtils" %>
<%@ page import="java.util.Map" %>
<%@ page import="org.jivesoftware.openfire.clearspace.ClearspaceManager" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<%
boolean success = false;
String errorDetail = "";
Map<String, String> settings = (Map<String, String>) session.getAttribute("clearspaceSettings");
if (settings != null) {
ClearspaceManager manager = new ClearspaceManager(settings);
if (manager.testConnection()) {
success = true;
}
else {
errorDetail = LocaleUtils.getLocalizedString("setup.clearspace.service.test.error-connection");
}
}
%>
<!-- BEGIN connection settings test panel -->
<div class="jive-testPanel">
<div class="jive-testPanel-content">
<div align="right" class="jive-testPanel-close">
<a href="#" class="lbAction" rel="deactivate"><fmt:message key="setup.clearspace.service.test.close" /></a>
</div>
<h2><fmt:message key="setup.clearspace.service.test.title" />: <span><fmt:message key="setup.clearspace.service.test.title-desc" /></span></h2>
<% if (success) { %>
<h4 class="jive-testSuccess"><fmt:message key="setup.clearspace.service.test.status-success" /></h4>
<p><fmt:message key="setup.clearspace.service.test.status-success.detail" /></p>
<% } else { %>
<h4 class="jive-testError"><fmt:message key="setup.clearspace.service.test.status-error" /></h4>
<p><%= errorDetail %></p>
<% } %>
</div>
</div>
<!-- END connection settings test panel -->
\ No newline at end of file
......@@ -22,6 +22,8 @@
// Get parameters
boolean isLDAP = "org.jivesoftware.openfire.ldap.LdapAuthProvider".equals(
JiveGlobals.getXMLProperty("provider.auth.className"));
boolean isCLEARSPACE = "org.jivesoftware.openfire.clearspace.ClearspaceAuthProvider".equals(
JiveGlobals.getXMLProperty("provider.auth.className"));
boolean next = request.getParameter("continue") != null;
if (next) {
// Figure out where to send the user.
......@@ -40,6 +42,10 @@
response.sendRedirect("setup-ldap-server.jsp");
return;
}
else if ("clearspace".equals(mode)) {
response.sendRedirect("setup-clearspace-integration.jsp");
return;
}
}
%>
<html>
......@@ -80,6 +86,15 @@
<fmt:message key="setup.profile.ldap_description" />
</td>
</tr>
<tr>
<td align="center" valign="top">
<input type="radio" name="mode" value="clearspace" id="rb03" <% if (isCLEARSPACE) { %>checked<% } %>>
</td>
<td>
<label for="rb03"><b><fmt:message key="setup.profile.clearspace" /></b></label><br>
<fmt:message key="setup.profile.clearspace_description" />
</td>
</tr>
</table>
<br>
......
......@@ -4,83 +4,83 @@
display: block;
margin: 5px 0 0 0;
padding: 3px;
border: 1px solid #aec2d6;
background-color: #eaf1f8;
color: #09345b;
border: 1px solid #bbbbbb;
background-color: #eeeeee;
color: #000000;
font-size: 8pt;
}
}
#jive-contentBox_stepbar span {
margin-right: 32px;
}
}
#jive-contentBox_stepbar span strong {
color: #09345b;
}
color: #000000;
}
#jive-contentBox_stepbar span em {
color: #666;
font-style: normal;
}
}
/* contentBox style, used with 'stepbar' above (seen on the LDAP screens) */
.jive-contentBox_for-stepbar {
margin: 0 0 20px 0;
border-top: 0;
-moz-border-radius: 0 0 4px 4px;
}
}
.jive-contentBox_for-stepbar h2 {
font-size: 14pt;
color: #396b9c;
}
color: #555555;
}
.jive-contentBox_for-stepbar h2 span {
font-size: 10pt;
color: #000;
}
}
/* blue div container (seen on the LDAP screens) */
.jive-contentBox_bluebox {
display: block;
position: relative;
border: 1px solid #dcdcdc;
background-color: #eaeff4;
border: 1px solid #bbbbbb;
background-color: #eeeeee;
-moz-border-radius: 3px;
margin: 0 0 12px 0;
padding: 12px;
}
}
.jive-contentBox_bluebox strong {
display: block;
position: relative;
color: #09345b;
color: #000000;
padding-bottom: 3px;
}
}
/* grey div container (seen on the LDAP screens) */
.jive-contentBox_greybox {
display: block;
position: relative;
border: 1px solid #dcdcdc;
background-color: #ececec;
border: 1px solid #bbbbbb;
background-color: #eeeeee;
-moz-border-radius: 3px;
margin: 0 0 12px 0;
padding: 12px;
}
}
.jive-contentBox_greybox strong {
display: block;
position: relative;
color: #09345b;
color: #555555;
padding-bottom: 3px;
}
}
/* form elements for LDAP */
.jive-contentBox td select {
z-index: 10;
float: left;
}
}
.jive-contentBox td input {
float: left;
}
}
.jive-contentBox td select#jiveLDAPserverType,
.jive-contentBox td input#jiveLDAPbasedn,
.jive-contentBox td input#jiveLDAPadmindn {
width: 320px;
}
}
.jive-contentBox td input#jiveLDAPhost,
.jive-contentBox td input#jiveLDAPadminpwd,
.jive-contentBox td input#jiveLDAPusername,
......@@ -89,14 +89,14 @@
.jive-contentBox td input#jiveLDAPgroupdesc,
.jive-contentBox td input#jiveLDAPgroupsearchfilter{
width: 160px;
}
}
.jive-contentBox td input#jiveLDAPsearchfields,
.jive-contentBox td input#jiveLDAPsearchfilter {
width: 220px;
}
}
.jive-contentBox td label {
margin-right: 5px;
}
}
/* button to toggle the advanced settings panel */
......@@ -106,75 +106,75 @@
width: auto;
clear: both;
margin-top: 0;
}
}
.jiveAdvancedButton a {
padding: 2px 0 2px 14px;
margin: 0 0 5px 0;
background: url('../images/twisty_closed_9x9.gif') no-repeat left;
background-position: 1px;
color: #34679a;
}
color: #555555;
}
a.jiveAdvancedButtonOn {
background: transparent url('../images/twisty_opened_9x9.gif') no-repeat left;
background-position: 1px;
}
}
.jiveAdvancedButtonTopPad {
margin-top: 7px;
}
}
/* advanced settings panel (for Connection Settings) */
.jiveadvancedPanelcs {
display: block;
position: relative;
clear: both;
width: 100%;
background: #ececec;
border: 1px solid #dcdcdc;
background: #eeeeee;
border: 1px solid #bbbbbb;
margin: 5px 0 10px 0;
padding: 0;
overflow: hidden;
-moz-border-radius: 4px;
}
}
.jiveadvancedPanelcs div {
margin: 12px;
}
}
.jiveadvancedPanelcs div table {
background-color: #fff;
border: 1px solid #ccc;
}
}
.jiveadvancedPanelcs div table th,
.jiveadvancedPanelcs div table td {
font-size: 11px;
padding: 3px 5px 3px 5px;
}
}
.jiveadvancedPanelcs div table th,
.jive-vcardTable th {
color: #fff;
color: #000;
font-weight: bold;
background-color: #82a1bc;
}
background-color: #dddddd;
}
.jiveadvancedPanelcs div table td.jive-advancedLabel {
color: #09345b;
color: #000000;
font-weight: bold;
background-color: #eaeff4;
background-color: #dddddd;
text-align: right;
}
}
.jiveadvancedPanelcs div table td.jive-advancedDesc {
color: #333;
}
}
.jiveadvancedPanelcs div table td.jive-advancedCenter {
text-align: center;
}
}
.jiveadvancedPanelcs div table td input {
float: none;
}
}
.jiveadvancedPanelcs div table td.jive-advancedBorderBottom,
.jive-vcardTable td.jive-vardBorderBottom {
border-bottom: 1px solid #e8e8e8;
}
}
.jiveadvancedPanelcs div table td.jive-advancedBorderRight,
.jive-vcardTable td.jive-vardBorderRight {
border-right: 1px solid #e8e8e8;
}
}
.jiveadvancedPanelu {
margin-top: 8px;
width: 97%;
......@@ -182,10 +182,10 @@ a.jiveAdvancedButtonOn {
border: 1px solid #dcdcdc;
-moz-border-radius: 3px;
padding: 8px;
}
}
.jiveadvancedPanelu td {
white-space: nowrap;
}
}
......@@ -193,40 +193,40 @@ a.jiveAdvancedButtonOn {
width: 90%;
background-color: #fff;
border: 1px solid #ccc;
}
}
html>body .jive-vcardTable {
width: 100%;
}
}
.jive-vcardTable th,
.jive-vcardTable td {
font-size: 11px;
padding: 2px 5px 2px 5px;
}
}
.jive-vcardTable th {
text-align: left;
}
}
.jive-vcardTable td.jive-vcardTable-label,
.jive-vcardTable td.jive-vcardTable-label strong {
color: #333;
}
}
.jive-vcardTable td.jive-vcardTable-value input {
font-size: 10px;
width: 230px;
}
}
/* language selection specific styles */
#jive-setup-language {
padding: 0 0 10px 18px;
}
}
#jive-setup-language p {
line-height: 180%;
}
}
/* form buttons throughout setup process */
.jive-buttons {
padding-top: 15px;
}
}
.jive-contentBox input#jive-setup-save {
padding: 2px 5px 2px 5px;
margin: 0;
......@@ -236,7 +236,7 @@ html>body .jive-vcardTable {
color: #fff;
border: 1px solid #7c7c7c;
background: #d6892c url(../images/setup_btn_bg-orange.gif) repeat-x;
}
}
.jive-contentBox input#jive-setup-skip,
.jive-contentBox input#jive-setup-back {
padding: 2px 5px 2px 5px;
......@@ -247,7 +247,7 @@ html>body .jive-vcardTable {
color: #fff;
border: 1px solid #7c7c7c;
background: #8c8c8c url(../images/setup_btn_bg-grey.gif) repeat-x;
}
}
.jive-contentBox input#jive-setup-test {
padding: 2px 5px 2px 5px;
margin: 0 0 0 0;
......@@ -257,13 +257,13 @@ html>body .jive-vcardTable {
color: #fff;
border: 1px solid #7c7c7c;
background: #8c8c8c url(../images/setup_btn_bg-grey.gif) repeat-x;
}
}
.jive-contentBox button#jive-setup-test img {
vertical-align: text-top;
margin: 0;
padding: 0;
border: 0;
}
}
.jive-contentBox a#jive-setup-test2 {
padding: 3px 5px 3px 5px;
margin: 0 10px 0 0;
......@@ -274,18 +274,18 @@ html>body .jive-vcardTable {
border: 1px solid #7c7c7c;
text-decoration: none;
background: #8c8c8c url(../images/setup_btn_bg-grey.gif) repeat-x;
}
}
.jive-contentBox a#jive-setup-test2 img {
vertical-align: text-top;
margin: 0;
padding: 0;
border: 0;
}
}
.jive-description {
display: block;
clear: both;
font-size: 11px;
}
}
.error {
color : #900;
font-weight : bold;
......@@ -310,10 +310,10 @@ html>body .jive-vcardTable {
font-weight: bold;
color: #fff;
border: 1px solid #0c2d4c;
background: #255480 url(../images/setup_btn_bg-bigblue.gif) repeat-x;
background: #D76C0D url(../images/setup_btn_bg-orange.gif) repeat-x;
text-decoration: none;
-moz-border-radius: 4px;
}
}
......@@ -328,7 +328,7 @@ html>body .jive-vcardTable {
height: 17px;
margin: 3px 0 0 5px;
background: transparent url(../images/setup_helpicon.gif) no-repeat;
}
}
div.jiveTooltip {
position: absolute;
width: 330px;
......@@ -341,7 +341,7 @@ div.jiveTooltip {
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=92);
-moz-opacity: .92;
-khtml-opacity: .92;
}
}
div.jiveTooltip .contents {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
......@@ -351,7 +351,7 @@ div.jiveTooltip .contents {
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
-moz-opacity: 1;
-khtml-opacity: 1;
}
}
......@@ -370,14 +370,14 @@ div.jiveTooltip .contents {
overflow: hidden;
z-index: 9997;
-moz-border-radius: 6px;
}
}
.jive-testPanel-content {
display: block;
float: left;
padding: 20px;
font-size: 8pt;
z-index: 9999;
}
}
.jive-testPanel-close a,
.jive-testPanel-close a:visited {
float: right;
......@@ -389,70 +389,70 @@ div.jiveTooltip .contents {
background-position: 4;
border: 1px solid #ccc;
z-index: 9999;
}
}
.jive-testPanel-close a:hover {
background-color: #e9e8d9;
}
}
.jive-testPanel-content h2 {
font-size: 14pt;
color: #396b9c;
color: #555555;
margin: 0 0 10px 0;
padding: 0;
}
}
.jive-testPanel-content h2 span {
font-size: 10pt;
color: #000;
}
}
.jive-testPanel-content h4 {
font-size: 12pt;
margin: 0 0 10px 0;
padding: 0;
}
}
.jive-testPanel-content h4.jive-testSuccess {
color: #1e7100;
}
}
.jive-testPanel-content h4.jive-testError {
color: #890000;
}
}
.jive-testpanel-vcard {
display: block;
float: left;
width: 682px;
border: 1px solid #d8d7c6;
border: 1px solid #bbbbbb;
padding: 4px;
background-color: #fff;
}
}
.jive-testTable-vcard {
float: left;
}
}
.jive-testpanel-vcard-header {
border: 1px solid #dddddd;
background-color: #eaeaea;
font-weight: bold;
padding: 1px 2px 1px 4px;
font-size: 8pt;
}
}
.jive-testpanel-vcard-label {
text-align: right;
padding: 1px 2px 1px 6px;
color: #666;
font-size: 8pt;
}
}
.jive-testpanel-vcard-value {
text-align: left;
padding: 1px 8px 1px 2px;
font-size: 8pt;
}
}
.jive-testpanel-vcard-value a {
color: #34679a;
}
color: #555555;
}
.jive-testpanel-vcard-value strong {
color: #890000;
}
}
.jive-testpanel-vcard-next {
text-align: right;
padding-top: 12px;
}
}
.jive-testpanel-vcard-next a {
display: block;
float: right;
......@@ -460,6 +460,6 @@ div.jiveTooltip .contents {
padding-right: 18px;
margin-right: 4px;
background: transparent url(../images/setup_nextprofile.gif) no-repeat right;
color: #34679a;
color: #555555;
text-decoration: none;
}
}
\ No newline at end of file
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