Commit ce99999a authored by Gabriel Guardincerri's avatar Gabriel Guardincerri Committed by gguardin

[JM-1326] Fixed AdminConsole doesn't adds the Clearspace tab after setup

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10223 b35dd754-fafc-0310-a699-88a17e54d16e
parent a351f20e
...@@ -18,9 +18,7 @@ import org.dom4j.Element; ...@@ -18,9 +18,7 @@ import org.dom4j.Element;
import org.dom4j.io.SAXReader; import org.dom4j.io.SAXReader;
import org.jivesoftware.openfire.XMPPServer; import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.clearspace.ClearspaceManager; import org.jivesoftware.openfire.clearspace.ClearspaceManager;
import org.jivesoftware.util.ClassUtils; import org.jivesoftware.util.*;
import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
...@@ -48,10 +46,36 @@ public class AdminConsole { ...@@ -48,10 +46,36 @@ public class AdminConsole {
static { static {
overrideModels = new LinkedHashMap<String,Element>(); overrideModels = new LinkedHashMap<String,Element>();
load(); load();
// Detect when a new auth provider class is set to ClearspaceAuthProvider
// then rebuild the model to add the Clearspace tab
// This is to add the tab after Openfire setup
PropertyEventListener propListener = new PropertyEventListener() {
public void propertySet(String property, Map params) {
if ("provider.auth.className".equals(property)) {
String value = (String) params.get("value");
if ("org.jivesoftware.openfire.clearspace.ClearspaceAuthProvider".equals(value)) {
rebuildModel();
}
}
}
public void propertyDeleted(String property, Map params) {
//Ignore
}
public void xmlPropertySet(String property, Map params) {
//Ignore
}
public void xmlPropertyDeleted(String property, Map params) {
//Ignore
}
};
PropertyEventDispatcher.addListener(propListener);
} }
/** Not instantiatable */ /** Not instantiatable */
private AdminConsole() { private AdminConsole() {
} }
/** /**
...@@ -361,10 +385,10 @@ public class AdminConsole { ...@@ -361,10 +385,10 @@ public class AdminConsole {
item.addAttribute("description", LocaleUtils.getLocalizedString("sidebar.clearspace-info.descr")); item.addAttribute("description", LocaleUtils.getLocalizedString("sidebar.clearspace-info.descr"));
item = sidebar.addElement("item"); item = sidebar.addElement("item");
item.addAttribute("id", "clearspace-admin"); item.addAttribute("id", "clearspace-connection");
item.addAttribute("name", LocaleUtils.getLocalizedString("sidebar.clearspace-admin")); item.addAttribute("name", LocaleUtils.getLocalizedString("sidebar.clearspace-connection"));
item.addAttribute("url", "clearspace-admin.jsp"); item.addAttribute("url", "clearspace-connection.jsp");
item.addAttribute("description", LocaleUtils.getLocalizedString("sidebar.clearspace-admin.descr")); item.addAttribute("description", LocaleUtils.getLocalizedString("sidebar.clearspace-connection.descr"));
} }
} }
......
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