<%-- - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --%> <%@ page errorPage="error.jsp" import="org.jivesoftware.util.ByteFormat, org.jivesoftware.util.Version, org.jivesoftware.openfire.XMPPServer, org.jivesoftware.openfire.container.Plugin" %> <%@ page import="org.jivesoftware.openfire.container.PluginManager" %> <%@ page import="org.jivesoftware.openfire.update.AvailablePlugin" %> <%@ page import="org.jivesoftware.openfire.update.UpdateManager" %> <%@ page import="java.io.File" %> <%@ page import="java.net.URLEncoder" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.Collections" %> <%@ page import="java.util.Comparator" %> <%@ page import="java.util.List" %> <%@ page import="org.jivesoftware.util.JiveGlobals"%> <%@ page import="java.util.Date"%> <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %> <% webManager.init(request, response, session, application, out ); %> <% boolean downloadRequested = request.getParameter("download") != null; String url = request.getParameter("url"); UpdateManager updateManager = XMPPServer.getInstance().getUpdateManager(); List plugins = updateManager.getNotInstalledPlugins(); String time = JiveGlobals.getProperty("update.lastCheck"); // Sort plugins alphabetically Collections.sort(plugins, new Comparator() { public int compare(AvailablePlugin o1, AvailablePlugin o2) { return o1.getName().compareTo(o2.getName()); } }); if (downloadRequested) { // Download and install new plugin updateManager.downloadPlugin(url); // Log the event webManager.logEvent("downloaded new plugin from "+url, null); } %> <fmt:message key="plugin.available.title"/>

<%if(time == null){ %>

 

<% if(!updateManager.isServiceEnabled()){ %> . <% } %>
<% } else {%>
<% // If only the admin plugin is installed, show "none". if (plugins.isEmpty()) { %> <% } for (AvailablePlugin plugin : plugins) { String pluginName = plugin.getName(); String pluginDescription = plugin.getDescription(); String pluginAuthor = plugin.getAuthor(); String pluginVersion = plugin.getLatestVersion(); ByteFormat byteFormat = new ByteFormat(); String fileSize = byteFormat.format(plugin.getFileSize()); if (plugin.isCommercial()) { continue; } %> <% } %> <% for (AvailablePlugin plugin : plugins) { String pluginName = plugin.getName(); String pluginDescription = plugin.getDescription(); String pluginAuthor = plugin.getAuthor(); String pluginVersion = plugin.getLatestVersion(); ByteFormat byteFormat = new ByteFormat(); String fileSize = byteFormat.format(plugin.getFileSize()); if (!plugin.isCommercial()) { continue; } %> <% } %>
  File Size
<% if (plugin.getIcon() != null) { %> Plugin <% } else { %> Plugin <% } %> <%= (pluginName != null ? pluginName : "") %>   <% if (plugin.getReadme() != null) { %> README <% } else { %>   <% } %> <% if (plugin.getChangelog() != null) { %> changelog <% } else { %>   <% } %> <%= pluginDescription != null ? pluginDescription : "" %> <%= pluginVersion != null ? pluginVersion : "" %> <%= pluginAuthor != null ? pluginAuthor : "" %>   <%= fileSize %> <% String updateURL = plugin.getURL(); if (updateManager.isPluginDownloaded(updateURL)) { %>   <% } else { %> <% %> <fmt:message key="> <% } %>

 
<% if (plugin.getIcon() != null) { %> Plugin <% } else { %> Plugin <% } %> <%= (pluginName != null ? pluginName : "") %>   <% if (plugin.getReadme() != null) { %> README <% } else { %>   <% } %> <% if (plugin.getChangelog() != null) { %> changelog <% } else { %>   <% } %> <%= pluginDescription != null ? pluginDescription : "" %> <%= pluginVersion != null ? pluginVersion : "" %> <%= pluginAuthor != null ? pluginAuthor : "" %>   <%= fileSize %> <% String updateURL = plugin.getURL(); if (updateManager.isPluginDownloaded(updateURL)) { %>   <% } else { %> <fmt:message key="> <% } %>

<% final XMPPServer server = XMPPServer.getInstance(); Version version = server.getServerInfo().getVersion(); List outdatedPlugins = new ArrayList(); for (Plugin plugin : server.getPluginManager().getPlugins()) { String pluginVersion = server.getPluginManager().getMinServerVersion(plugin); if (pluginVersion != null && pluginVersion.compareTo(version.getVersionString()) > 0) { outdatedPlugins.add(plugin); } } if (outdatedPlugins.size() > 0) { %>

<% PluginManager pluginManager = server.getPluginManager(); for (Plugin plugin : outdatedPlugins) { String pluginName = pluginManager.getName(plugin); String pluginDescription = pluginManager.getDescription(plugin); String pluginAuthor = pluginManager.getAuthor(plugin); String pluginVersion = pluginManager.getVersion(plugin); File pluginDir = pluginManager.getPluginDirectory(plugin); File icon = new File(pluginDir, "logo_small.png"); boolean readmeExists = new File(pluginDir, "readme.html").exists(); boolean changelogExists = new File(pluginDir, "changelog.html").exists(); if (!icon.exists()) { icon = new File(pluginDir, "logo_small.gif"); } %> <% }%>
<% if (icon.exists()) { %> &showIcon=true&decorator=none" width="16" height="16" alt="Plugin"> <% } else { %> Plugin <% } %> <%= pluginName%>

<% if (readmeExists) { %> &showReadme=true&decorator=none" >README <% } else { %>   <% } %> <% if (changelogExists) { %> &showChangelog=true&decorator=none" >changelog <% } else { %>   <% } %>

<%= pluginDescription %> <%= pluginVersion%> <%= pluginAuthor%>
<%} %>

<% if(time != null){ Date date = new Date(Long.parseLong(time)); time = JiveGlobals.formatDate(date); } %>

<% if(time != null) { %> <%= time%>. <% } %> <% if(updateManager.isServiceEnabled()){%> <% } else { %> <% } %>  

<% } %>