Commit 483315fb authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Initial version. JM-715

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3982 b35dd754-fafc-0310-a699-88a17e54d16e
parent ca60a47c
<%--
- 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.
--%>
<%@ page import="org.jivesoftware.wildfire.XMPPServer,
org.jivesoftware.wildfire.update.AvailablePlugin,
org.jivesoftware.wildfire.update.UpdateManager,
java.util.List"
%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<%
boolean downloadRequested = request.getParameter("download") != null;
String url = request.getParameter("url");
UpdateManager updateManager = XMPPServer.getInstance().getUpdateManager();
List<AvailablePlugin> plugins = updateManager.getAvailablePlugins();
if (downloadRequested) {
// Download and install new plugin
updateManager.downloadPlugin(url);
}
%>
<html>
<head>
<title><fmt:message key="plugin.available.title"/></title>
<meta name="pageID" content="available-plugins"/>
</head>
<body>
<p>
<fmt:message key="plugin.available.info" />
</p>
<p>
<div class="jive-table">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<thead>
<tr>
<th>&nbsp;</th>
<th nowrap colspan="2"><fmt:message key="plugin.available.name" /></th>
<th nowrap><fmt:message key="plugin.available.description" /></th>
<th nowrap><fmt:message key="plugin.available.version" /></th>
<th nowrap><fmt:message key="plugin.available.author" /></th>
<th nowrap><fmt:message key="plugin.available.install" /></th>
</tr>
</thead>
<tbody>
<%
// If only the admin plugin is installed, show "none".
if (plugins.isEmpty()) {
%>
<tr>
<td align="center" colspan="8"><fmt:message key="plugin.available.no_plugin" /></td>
</tr>
<%
}
for (AvailablePlugin plugin : plugins) {
String pluginName = plugin.getName();
String pluginDescription = plugin.getDescription();
String pluginAuthor = plugin.getAuthor();
String pluginVersion = plugin.getLatestVersion();
%>
<tr>
<td width="1%">
<% if (plugin.getIcon() != null) { %>
<img src="<%= plugin.getIcon() %>" width="16" height="16" alt="Plugin">
<% } else { %>
<img src="images/plugin-16x16.gif" width="16" height="16" alt="Plugin">
<% } %>
</td>
<td width="20%" nowrap>
<%= (pluginName != null ? pluginName : "") %> &nbsp;
</td>
<td nowrap valign="top">
<% if (plugin.getReadme() != null) { %>
<a href="<%= plugin.getReadme() %>"
><img src="images/doc-readme-16x16.gif" width="16" height="16" border="0" alt="README"></a>
<% } else { %> &nbsp; <% } %>
<% if (plugin.getChangelog() != null) { %>
<a href="<%= plugin.getChangelog() %>"
><img src="images/doc-changelog-16x16.gif" width="16" height="16" border="0" alt="changelog"></a>
<% } else { %> &nbsp; <% } %>
</td>
<td width="60%">
<%= pluginDescription != null ? pluginDescription : "" %>
</td>
<td width="5%" align="center" valign="top">
<%= pluginVersion != null ? pluginVersion : "" %>
</td>
<td width="15%" nowrap valign="top">
<%= pluginAuthor != null ? pluginAuthor : "" %> &nbsp;
</td>
<td width="1%" align="center" valign="top">
<%
String updateURL = plugin.getURL();
if (updateManager.isPluginDownloaded(updateURL)) {
%>
&nbsp;
<% } else { %>
<%
if (updateURL.endsWith(".jar") || updateURL.endsWith(".zip") || updateURL.endsWith(".war")) {
// Change it so that the server downloads and installs the new version of the plugin
updateURL = "available-plugins.jsp?download=true&url="+ updateURL;
}
%>
<a href="<%= updateURL %>"
><img src="images/doc-down-16x16.gif" width="16" height="16" border="0" alt="<fmt:message key="plugin.available.download" />"></a>
<% } %>
</td>
</tr>
<%
}
%>
</tbody>
</table>
</div>
</body>
</html>
\ No newline at end of file
<%--
- $RCSfile$
- $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.
--%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<%@ page import="org.jivesoftware.util.ParamUtils,
org.jivesoftware.wildfire.XMPPServer,
org.jivesoftware.wildfire.update.UpdateManager,
java.util.HashMap,
java.util.Map"
errorPage="error.jsp"
%>
<html>
<head>
<title><fmt:message key="manage-updates.title"/></title>
<meta name="pageID" content="manage-updates"/>
</head>
<body>
<% // Get parameters
boolean update = request.getParameter("update") != null;
boolean notificationUpdate = request.getParameter("notificationUpdate") != null;
boolean serviceEnabled = ParamUtils.getBooleanParameter(request,"serviceEnabled");
boolean notificationsEnabled = ParamUtils.getBooleanParameter(request,"notificationsEnabled");
boolean updateSucess = false;
UpdateManager updateManager = XMPPServer.getInstance().getUpdateManager();
// Update the session kick policy if requested
Map<String, String> errors = new HashMap<String, String>();
if (update) {
updateManager.setServiceEnabled(serviceEnabled);
updateSucess = true;
}
if (notificationUpdate) {
updateManager.setNotificationEnabled(notificationsEnabled);
updateSucess = true;
}
// Set page vars
if (errors.size() == 0) {
serviceEnabled = updateManager.isServiceEnabled();
notificationsEnabled = updateManager.isNotificationEnabled();
}
else {
}
%>
<p>
<fmt:message key="manage-updates.info"/>
</p>
<% if (!errors.isEmpty()) { %>
<div class="jive-error">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td class="jive-icon"><img src="images/error-16x16.gif" width="16" height="16" border="0"/></td>
<td class="jive-icon-label">
</td>
</tr>
</tbody>
</table>
</div>
<br>
<% } else if (updateSucess) { %>
<div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td>
<td class="jive-icon-label">
<fmt:message key="manage-updates.config.updated" />
</td></tr>
</tbody>
</table>
</div><br>
<% } %>
<form action="manage-updates.jsp" method="post">
<fieldset>
<legend><fmt:message key="manage-updates.enabled.legend" /></legend>
<div>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody>
<tr valign="middle">
<td width="1%" nowrap>
<input type="radio" name="serviceEnabled" value="false" id="rb01"
<%= (!serviceEnabled ? "checked" : "") %>>
</td>
<td width="99%">
<label for="rb01">
<b><fmt:message key="manage-updates.label_disable" /></b> - <fmt:message key="manage-updates.label_disable_info" />
</label>
</td>
</tr>
<tr valign="middle">
<td width="1%" nowrap>
<input type="radio" name="serviceEnabled" value="true" id="rb02"
<%= (serviceEnabled ? "checked" : "") %>>
</td>
<td width="99%">
<label for="rb02">
<b><fmt:message key="manage-updates.label_enable" /></b> - <fmt:message key="manage-updates.label_enable_info" />
</label>
</td>
</tr>
</tbody>
</table>
</div>
</fieldset>
<br>
<input type="submit" name="update" value="<fmt:message key="global.save_settings" />">
</form>
<br>
<fieldset>
<legend><fmt:message key="manage-updates.notif.enabled.legend" /></legend>
<div>
<table cellpadding="3" cellspacing="0" border="0" width="100%">
<tbody>
<tr valign="middle">
<td width="1%" nowrap>
<input type="radio" name="notificationsEnabled" value="false" id="rb01"
<%= (!notificationsEnabled ? "checked" : "") %>>
</td>
<td width="99%">
<label for="rb01">
<b><fmt:message key="manage-updates.notif.label_disable" /></b> - <fmt:message key="manage-updates.notif.label_disable_info" />
</label>
</td>
</tr>
<tr valign="middle">
<td width="1%" nowrap>
<input type="radio" name="notificationsEnabled" value="true" id="rb02"
<%= (notificationsEnabled ? "checked" : "") %>>
</td>
<td width="99%">
<label for="rb02">
<b><fmt:message key="manage-updates.notif.label_enable" /></b> - <fmt:message key="manage-updates.notif.label_enable_info" />
</label>
</td>
</tr>
</tbody>
</table>
</div>
</fieldset>
<br>
<input type="submit" name="notificationUpdate" value="<fmt:message key="global.save_settings" />">
</body>
</html>
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