Package org.jivesoftware.admin
Class AdminConsole
java.lang.Object
org.jivesoftware.admin.AdminConsole
A model for admin tab and sidebar info. This class loads in XML definitions of the
data and produces an in-memory model.
This class loads its data from the admin-sidebar.xml
file which is assumed
to be in the main application jar file. In addition, it will load files from
META-INF/admin-sidebar.xml
if they're found. This allows developers to
extend the functionality of the admin console to provide more options. See the main
admin-sidebar.xml
file for documentation of its format.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addModel
(String name, InputStream in) Adds XML stream to the tabs/sidebar model.static void
Adds an <adminconsole> Element to the tabs/sidebar model.static String
getAdminText
(String string, String pluginName) Returns a text element for the admin console, applying the appropriate locale.static String
Returns the name of the application.static org.dom4j.Element
getElemnetByID
(String id) Convenience method to select an element from the model by its ID.static String
Returns the git SHA of the commit at which this version was builtstatic String
Returns the URL of the login image for the admin console.static String
Returns the URL of the main logo image for the admin console.static org.dom4j.Element
getModel()
Returns the model.static String
Returns the version string displayed in the admin console.static void
removeModel
(String name) Removes an <adminconsole> Element from the tabs/sidebar model.
-
Method Details
-
addModel
Adds XML stream to the tabs/sidebar model.- Parameters:
name
- the name.in
- the XML input stream.- Throws:
Exception
- if an error occurs when parsing the XML or adding it to the model.
-
addModel
Adds an <adminconsole> Element to the tabs/sidebar model.- Parameters:
name
- the name.element
- the Element- Throws:
Exception
- if an error occurs.
-
removeModel
Removes an <adminconsole> Element from the tabs/sidebar model.- Parameters:
name
- the name.
-
getAppName
Returns the name of the application.- Returns:
- the name of the application.
-
getLogoImage
Returns the URL of the main logo image for the admin console.- Returns:
- the logo image.
-
getLoginLogoImage
Returns the URL of the login image for the admin console.- Returns:
- the login image.
-
getVersionString
Returns the version string displayed in the admin console.- Returns:
- the version string.
-
getGitSHAString
Returns the git SHA of the commit at which this version was built- Returns:
- the git SHA.
-
getModel
public static org.dom4j.Element getModel()Returns the model. The model should be considered read-only.- Returns:
- the model.
-
getElemnetByID
Convenience method to select an element from the model by its ID. If an element with a matching ID is not found,null
will be returned.- Parameters:
id
- the ID.- Returns:
- the element.
-
getAdminText
Returns a text element for the admin console, applying the appropriate locale. Internationalization logic will only be applied if the String is specially encoded in the format "${key.name}". If it is, the String is pulled from the resource bundle. If the pluginName is notnull
, the plugin's resource bundle will be used to look up the key.- Parameters:
string
- the String.pluginName
- the name of the plugin that the i18n String can be found in, ornull
if the standard Openfire resource bundle should be used.- Returns:
- the string, or if the string is encoded as an i18n key, the value from the appropriate resource bundle.
-