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 @@
<!-- Copy the plugin.xml and documentation to the target dir, code below assumes it's there -->
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/jar"/>
<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>
<!-- JSPC any JSP pages. Do this conditionally as there might not be a web dir. -->
......
......@@ -33,8 +33,8 @@ plugin directory are as follows:
|- plugin.xml &lt;- Plugin definition file
|- 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
|- icon_small.gif &lt;- Optional small (16x16) icon associated with the plugin
|- icon_large.gif &lt;- Optional large (32x32) 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 (can also be a .png file)
|- classes/ &lt;- Resources your plugin needs (i.e., a properties file)
|- lib/ &lt;- Libraries (JAR files) your plugin needs
|- web &lt;- Resources for Admin Console integration, if any
......@@ -102,8 +102,8 @@ end-users (all placed in the main plugin directory):
<ul>
<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>icon_small.gif</tt> -- Optional small (16x16) icon associated with the plugin.</li>
<li><tt>icon_large.gif</tt> -- Optional large (32x32) 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.png</tt> -- Optional large (32x32) icon associated with the plugin. It can also be a .gif file.</li>
</ul>
<p>Your plugin class must be implement the
......@@ -201,16 +201,16 @@ that plugins should integrate seamlessly:
<ul>
<li>Integrate into existing tabs and sidebar sections whenever possible
instead of creating your own. Only create new tabs for very
significant new functionality.
instead of creating your own. Only create new tabs for very
significant new functionality.
<li>Don't use the word "plugin" in names of tabs, sidebars and items.
For example, instead of having an item called "Gateway Plugin", it
could be called "Gateway Settings".
For example, instead of having an item called "Gateway Plugin", it
could be called "Gateway Settings".
<li>Try to match the UI of the existing admin console in your custom
plugin pages.
<li>There is no need to create an admin console entry to show plugin
meta-data. Instead, let Jive Messenger inform the user about which
plugins are installed and provide plugin management.
meta-data. Instead, let Jive Messenger inform the user about which
plugins are installed and provide plugin management.
</ul>
<h2>Using the Jive Messenger Build Script</h2>
......@@ -226,8 +226,8 @@ looks for plugin development directories in the following format:
|- plugin.xml &lt;- Plugin definition file
|- readme.html &lt;- Optional readme file for plugin
|- changelog.html &lt;- Optional changelog file for plugin
|- icon_small.gif &lt;- Optional small (16x16) icon associated with the plugin
|- icon_large.gif &lt;- Optional large (32x32) 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 (can also be a .png file)
|- classes/ &lt;- Resources your plugin needs (i.e., a properties file)
|- lib/ &lt;- Libraries your plugin needs
|- src/
......
......@@ -141,6 +141,8 @@
## 2.3.0
## Added key: 'language.choose'
## Added key: 'timezone.choose'
## Added key: 'plugin.admin.click_reload'
## Added key: 'plugin.admin.reload_success'
## Modified key: 'locale.title.info'
## Modified key: 'component.settings.info'
## Modified key: 'sidebar.server-db.descr'
......@@ -153,6 +155,7 @@
## Modified key: 'sidebar.server-data-settings.descr'
## Modified key: 'sidebar.server-ssl.descr'
## Removed key: 'locale.choose'
## Removed key: 'plugin.admin.reload_success'
# Messenger
......@@ -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.
plugin.admin.deleted_success=Plugin deleted successfully.
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.description=Description
plugin.admin.version=Version
......
......@@ -31,7 +31,7 @@
<%
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 showChangelog = ParamUtils.getBooleanParameter(request, "showChangelog", false);
boolean showIcon = ParamUtils.getBooleanParameter(request, "showIcon", false);
......@@ -61,12 +61,12 @@
return;
}
if (refreshPlugin != null) {
if (reloadPlugin != null) {
for (Plugin plugin : plugins) {
File pluginDir = pluginManager.getPluginDirectory(plugin);
if (refreshPlugin.equals(pluginDir.getName())) {
pluginManager.unloadPlugin(refreshPlugin);
response.sendRedirect("plugin-admin.jsp?refrehsuccess=true");
if (reloadPlugin.equals(pluginDir.getName())) {
pluginManager.unloadPlugin(reloadPlugin);
response.sendRedirect("plugin-admin.jsp?reloadsuccess=true");
return;
}
}
......@@ -135,12 +135,23 @@
String pluginName = ParamUtils.getParameter(request, "plugin");
Plugin plugin = pluginManager.getPlugin(pluginName);
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()) {
// Clear any empty line added by the JSP declaration. This is required to show
// the image in resin!!!!!
response.reset();
response.setContentType("image/gif");
if (isPng) {
response.setContentType("image/png");
}
else {
response.setContentType("image/gif");
}
InputStream in = null;
OutputStream ost = null;
try {
......@@ -215,13 +226,13 @@
<% } %>
<% if ("true".equals(request.getParameter("refrehsuccess"))) { %>
<% if ("true".equals(request.getParameter("reloadsuccess"))) { %>
<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="plugin.admin.refresh_success" /></td></tr>
<td class="jive-icon-label"><fmt:message key="plugin.admin.reload_success" /></td></tr>
</tbody>
</table>
</div>
......@@ -271,12 +282,15 @@
String pluginAuthor = pluginManager.getAuthor(plugin);
String pluginVersion = pluginManager.getVersion(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") %>">
<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">
<% } else { %>
<img src="images/plugin-16x16.gif" width="16" height="16" alt="Plugin">
......@@ -310,8 +324,8 @@
<%= pluginAuthor != null ? pluginAuthor : "" %> &nbsp;
</td>
<td width="1%" align="center">
<a href="plugin-admin.jsp?refreshplugin=<%= dirName %>"
title="<fmt:message key="plugin.admin.click_refresh" />"
<a href="plugin-admin.jsp?reloadplugin=<%= dirName %>"
title="<fmt:message key="plugin.admin.click_reload" />"
><img src="images/refresh-16x16.gif" width="16" height="16" border="0"></a>
</td>
<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