Commit 2977c65c authored by Matt Tucker's avatar Matt Tucker Committed by matt

Plugin icons can now be .png (JM-365).

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@2836 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4d159a96
...@@ -930,7 +930,7 @@ ...@@ -930,7 +930,7 @@
<!-- Copy the plugin.xml and documentation to the target dir, code below assumes it's there --> <!-- Copy the plugin.xml and documentation to the target dir, code below assumes it's there -->
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/jar"/> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/jar"/>
<copy todir="${plugin.dev.dest.dir}/@{plugin}/jar" failonerror="false" overwrite="${overwrite}" > <copy todir="${plugin.dev.dest.dir}/@{plugin}/jar" failonerror="false" overwrite="${overwrite}" >
<fileset dir="@{pluginsrc}/@{plugin}" includes="*.xml, *.html, *.gif"/> <fileset dir="@{pluginsrc}/@{plugin}" includes="*.xml, *.html, *.gif, *.png"/>
</copy> </copy>
<!-- JSPC any JSP pages. Do this conditionally as there might not be a web dir. --> <!-- JSPC any JSP pages. Do this conditionally as there might not be a web dir. -->
......
...@@ -33,8 +33,8 @@ plugin directory are as follows: ...@@ -33,8 +33,8 @@ plugin directory are as follows:
|- plugin.xml &lt;- Plugin definition file |- plugin.xml &lt;- Plugin definition file
|- readme.html &lt;- Optional readme file for plugin, which will be displayed to end users |- readme.html &lt;- Optional readme file for plugin, which will be displayed to end users
|- changelog.html &lt;- Optional changelog file for plugin, which will be displayed to end users |- changelog.html &lt;- Optional changelog file for plugin, which will be displayed to end users
|- icon_small.gif &lt;- Optional small (16x16) icon associated with the plugin |- icon_small.gif &lt;- Optional small (16x16) icon associated with the plugin (can also be a .png file)
|- icon_large.gif &lt;- Optional large (32x32) icon associated with the plugin |- icon_large.gif &lt;- Optional large (32x32) icon associated with the plugin (can also be a .png file)
|- classes/ &lt;- Resources your plugin needs (i.e., a properties file) |- classes/ &lt;- Resources your plugin needs (i.e., a properties file)
|- lib/ &lt;- Libraries (JAR files) your plugin needs |- lib/ &lt;- Libraries (JAR files) your plugin needs
|- web &lt;- Resources for Admin Console integration, if any |- web &lt;- Resources for Admin Console integration, if any
...@@ -102,8 +102,8 @@ end-users (all placed in the main plugin directory): ...@@ -102,8 +102,8 @@ end-users (all placed in the main plugin directory):
<ul> <ul>
<li><tt>readme.html</tt> -- Optional readme file for plugin, which will be displayed to end users.</li> <li><tt>readme.html</tt> -- Optional readme file for plugin, which will be displayed to end users.</li>
<li><tt>changelog.html</tt> -- Optional changelog file for plugin, which will be displayed to end users.</li> <li><tt>changelog.html</tt> -- Optional changelog file for plugin, which will be displayed to end users.</li>
<li><tt>icon_small.gif</tt> -- Optional small (16x16) icon associated with the plugin.</li> <li><tt>icon_small.png</tt> -- Optional small (16x16) icon associated with the plugin. It can also be a .gif file.</li>
<li><tt>icon_large.gif</tt> -- Optional large (32x32) icon associated with the plugin.</li> <li><tt>icon_large.png</tt> -- Optional large (32x32) icon associated with the plugin. It can also be a .gif file.</li>
</ul> </ul>
<p>Your plugin class must be implement the <p>Your plugin class must be implement the
...@@ -226,8 +226,8 @@ looks for plugin development directories in the following format: ...@@ -226,8 +226,8 @@ looks for plugin development directories in the following format:
|- plugin.xml &lt;- Plugin definition file |- plugin.xml &lt;- Plugin definition file
|- readme.html &lt;- Optional readme file for plugin |- readme.html &lt;- Optional readme file for plugin
|- changelog.html &lt;- Optional changelog file for plugin |- changelog.html &lt;- Optional changelog file for plugin
|- icon_small.gif &lt;- Optional small (16x16) icon associated with the plugin |- icon_small.gif &lt;- Optional small (16x16) icon associated with the plugin (can also be a .png file)
|- icon_large.gif &lt;- Optional large (32x32) icon associated with the plugin |- icon_large.gif &lt;- Optional large (32x32) icon associated with the plugin (can also be a .png file)
|- classes/ &lt;- Resources your plugin needs (i.e., a properties file) |- classes/ &lt;- Resources your plugin needs (i.e., a properties file)
|- lib/ &lt;- Libraries your plugin needs |- lib/ &lt;- Libraries your plugin needs
|- src/ |- src/
......
...@@ -141,6 +141,8 @@ ...@@ -141,6 +141,8 @@
## 2.3.0 ## 2.3.0
## Added key: 'language.choose' ## Added key: 'language.choose'
## Added key: 'timezone.choose' ## Added key: 'timezone.choose'
## Added key: 'plugin.admin.click_reload'
## Added key: 'plugin.admin.reload_success'
## Modified key: 'locale.title.info' ## Modified key: 'locale.title.info'
## Modified key: 'component.settings.info' ## Modified key: 'component.settings.info'
## Modified key: 'sidebar.server-db.descr' ## Modified key: 'sidebar.server-db.descr'
...@@ -153,6 +155,7 @@ ...@@ -153,6 +155,7 @@
## Modified key: 'sidebar.server-data-settings.descr' ## Modified key: 'sidebar.server-data-settings.descr'
## Modified key: 'sidebar.server-ssl.descr' ## Modified key: 'sidebar.server-ssl.descr'
## Removed key: 'locale.choose' ## Removed key: 'locale.choose'
## Removed key: 'plugin.admin.reload_success'
# Messenger # Messenger
...@@ -1545,7 +1548,9 @@ plugin.admin.info=Plugins add new functionality to the server. The list of plugi ...@@ -1545,7 +1548,9 @@ plugin.admin.info=Plugins add new functionality to the server. The list of plugi
<a href="http://www.jivesoftware.org/messenger/plugins.jsp" target="_blank">plugin download</a> page. <a href="http://www.jivesoftware.org/messenger/plugins.jsp" target="_blank">plugin download</a> page.
plugin.admin.deleted_success=Plugin deleted successfully. plugin.admin.deleted_success=Plugin deleted successfully.
plugin.admin.deleted_failure=Unable to delete plugin. plugin.admin.deleted_failure=Unable to delete plugin.
plugin.admin.refresh_success=Plugin was successfully refreshed. plugin.admin.click_reload=Reload the plugin.
plugin.admin.reload_success=Plugin was successfully reloaded. It may take a short time for the \
plugin to appear in the list of installed plugins again.
plugin.admin.name=Plugins plugin.admin.name=Plugins
plugin.admin.description=Description plugin.admin.description=Description
plugin.admin.version=Version plugin.admin.version=Version
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<% <%
String deletePlugin = ParamUtils.getParameter(request, "deleteplugin"); String deletePlugin = ParamUtils.getParameter(request, "deleteplugin");
String refreshPlugin = ParamUtils.getParameter(request, "refreshplugin"); String reloadPlugin = ParamUtils.getParameter(request, "reloadplugin");
boolean showReadme = ParamUtils.getBooleanParameter(request, "showReadme", false); boolean showReadme = ParamUtils.getBooleanParameter(request, "showReadme", false);
boolean showChangelog = ParamUtils.getBooleanParameter(request, "showChangelog", false); boolean showChangelog = ParamUtils.getBooleanParameter(request, "showChangelog", false);
boolean showIcon = ParamUtils.getBooleanParameter(request, "showIcon", false); boolean showIcon = ParamUtils.getBooleanParameter(request, "showIcon", false);
...@@ -61,12 +61,12 @@ ...@@ -61,12 +61,12 @@
return; return;
} }
if (refreshPlugin != null) { if (reloadPlugin != null) {
for (Plugin plugin : plugins) { for (Plugin plugin : plugins) {
File pluginDir = pluginManager.getPluginDirectory(plugin); File pluginDir = pluginManager.getPluginDirectory(plugin);
if (refreshPlugin.equals(pluginDir.getName())) { if (reloadPlugin.equals(pluginDir.getName())) {
pluginManager.unloadPlugin(refreshPlugin); pluginManager.unloadPlugin(reloadPlugin);
response.sendRedirect("plugin-admin.jsp?refrehsuccess=true"); response.sendRedirect("plugin-admin.jsp?reloadsuccess=true");
return; return;
} }
} }
...@@ -135,12 +135,23 @@ ...@@ -135,12 +135,23 @@
String pluginName = ParamUtils.getParameter(request, "plugin"); String pluginName = ParamUtils.getParameter(request, "plugin");
Plugin plugin = pluginManager.getPlugin(pluginName); Plugin plugin = pluginManager.getPlugin(pluginName);
if (plugin != null) { if (plugin != null) {
File icon = new File(pluginManager.getPluginDirectory(plugin), "logo_small.gif"); // Try looking for PNG file first then default to GIF.
File icon = new File(pluginManager.getPluginDirectory(plugin), "logo_small.png");
boolean isPng = true;
if (!icon.exists()) {
icon = new File(pluginManager.getPluginDirectory(plugin), "logo_small.gif");
isPng = false;
}
if (icon.exists()) { if (icon.exists()) {
// Clear any empty line added by the JSP declaration. This is required to show // Clear any empty line added by the JSP declaration. This is required to show
// the image in resin!!!!! // the image in resin!!!!!
response.reset(); response.reset();
if (isPng) {
response.setContentType("image/png");
}
else {
response.setContentType("image/gif"); response.setContentType("image/gif");
}
InputStream in = null; InputStream in = null;
OutputStream ost = null; OutputStream ost = null;
try { try {
...@@ -215,13 +226,13 @@ ...@@ -215,13 +226,13 @@
<% } %> <% } %>
<% if ("true".equals(request.getParameter("refrehsuccess"))) { %> <% if ("true".equals(request.getParameter("reloadsuccess"))) { %>
<div class="jive-success"> <div class="jive-success">
<table cellpadding="0" cellspacing="0" border="0"> <table cellpadding="0" cellspacing="0" border="0">
<tbody> <tbody>
<tr><td class="jive-icon"><img src="images/success-16x16.gif" width="16" height="16" border="0"></td> <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="plugin.admin.refresh_success" /></td></tr> <td class="jive-icon-label"><fmt:message key="plugin.admin.reload_success" /></td></tr>
</tbody> </tbody>
</table> </table>
</div> </div>
...@@ -271,12 +282,15 @@ ...@@ -271,12 +282,15 @@
String pluginAuthor = pluginManager.getAuthor(plugin); String pluginAuthor = pluginManager.getAuthor(plugin);
String pluginVersion = pluginManager.getVersion(plugin); String pluginVersion = pluginManager.getVersion(plugin);
File pluginDir = pluginManager.getPluginDirectory(plugin); File pluginDir = pluginManager.getPluginDirectory(plugin);
File logo = new File(pluginDir, "logo_small.gif"); File icon = new File(pluginDir, "logo_small.png");
if (!icon.exists()) {
icon = new File(pluginDir, "logo_small.gif");
}
%> %>
<tr class="jive-<%= (((count%2)==0) ? "even" : "odd") %>"> <tr class="jive-<%= (((count%2)==0) ? "even" : "odd") %>">
<td width="1%"> <td width="1%">
<% if (logo.exists()) { %> <% if (icon.exists()) { %>
<img src="plugin-admin.jsp?plugin=<%= URLEncoder.encode(pluginDir.getName(), "utf-8") %>&showIcon=true" width="16" height="16" alt="Plugin"> <img src="plugin-admin.jsp?plugin=<%= URLEncoder.encode(pluginDir.getName(), "utf-8") %>&showIcon=true" width="16" height="16" alt="Plugin">
<% } else { %> <% } else { %>
<img src="images/plugin-16x16.gif" width="16" height="16" alt="Plugin"> <img src="images/plugin-16x16.gif" width="16" height="16" alt="Plugin">
...@@ -310,8 +324,8 @@ ...@@ -310,8 +324,8 @@
<%= pluginAuthor != null ? pluginAuthor : "" %> &nbsp; <%= pluginAuthor != null ? pluginAuthor : "" %> &nbsp;
</td> </td>
<td width="1%" align="center"> <td width="1%" align="center">
<a href="plugin-admin.jsp?refreshplugin=<%= dirName %>" <a href="plugin-admin.jsp?reloadplugin=<%= dirName %>"
title="<fmt:message key="plugin.admin.click_refresh" />" title="<fmt:message key="plugin.admin.click_reload" />"
><img src="images/refresh-16x16.gif" width="16" height="16" border="0"></a> ><img src="images/refresh-16x16.gif" width="16" height="16" border="0"></a>
</td> </td>
<td width="1%" align="center" style="border-right:1px #ccc solid;"> <td width="1%" align="center" style="border-right:1px #ccc solid;">
......
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