From 3b217ed464a709b71e472d55921369bd9f6396ce Mon Sep 17 00:00:00 2001 From: Sergey Ponomarev Date: Thu, 17 Oct 2024 22:28:59 +0300 Subject: [PATCH] OF-1823: admin console Available Plugins page: show releaseDate in ISO and store it --- .../openfire/update/AvailablePlugin.java | 12 +----------- .../jivesoftware/openfire/update/UpdateManager.java | 1 + 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/xmppserver/src/main/java/org/jivesoftware/openfire/update/AvailablePlugin.java b/xmppserver/src/main/java/org/jivesoftware/openfire/update/AvailablePlugin.java index a89f126aeb..8dcab96081 100644 --- a/xmppserver/src/main/java/org/jivesoftware/openfire/update/AvailablePlugin.java +++ b/xmppserver/src/main/java/org/jivesoftware/openfire/update/AvailablePlugin.java @@ -37,8 +37,6 @@ public class AvailablePlugin extends PluginMetadata { private static final Logger Log = LoggerFactory.getLogger( AvailablePlugin.class ); - private static final DateFormat RELEASE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); - private static final DateFormat RELEASE_DATE_DISPLAY_FORMAT = DateFormat.getDateInstance(DateFormat.MEDIUM); /** * URL from where the latest version of the plugin can be downloaded. @@ -141,15 +139,7 @@ public static AvailablePlugin getInstance( Element plugin ) minJavaVersion = new JavaSpecVersion( minJavaVersionValue ); } - String releaseDate = null; - final String releaseDateString = plugin.attributeValue("releaseDate"); - if( releaseDateString!= null) { - try { - releaseDate = RELEASE_DATE_DISPLAY_FORMAT.format(RELEASE_DATE_FORMAT.parse(releaseDateString)); - } catch (final ParseException e) { - Log.warn("Unexpected exception parsing release date: " + releaseDateString, e); - } - } + final String releaseDate = plugin.attributeValue("releaseDate"); long fileSize = -1; String fileSizeValue = plugin.attributeValue("fileSize"); diff --git a/xmppserver/src/main/java/org/jivesoftware/openfire/update/UpdateManager.java b/xmppserver/src/main/java/org/jivesoftware/openfire/update/UpdateManager.java index eba3ea01e7..6440765120 100644 --- a/xmppserver/src/main/java/org/jivesoftware/openfire/update/UpdateManager.java +++ b/xmppserver/src/main/java/org/jivesoftware/openfire/update/UpdateManager.java @@ -730,6 +730,7 @@ private void saveAvailablePluginsInfo() { Element component = xml.addElement("plugin"); component.addAttribute("name", plugin.getName()); component.addAttribute("latest", plugin.getVersion() != null ? plugin.getVersion().getVersionString() : null); + component.addAttribute("releaseDate", plugin.getReleaseDate()); component.addAttribute("changelog", plugin.getChangelog() != null ? plugin.getChangelog().toExternalForm() : null ); component.addAttribute("url", plugin.getDownloadURL() != null ? plugin.getDownloadURL().toExternalForm() : null ); component.addAttribute("author", plugin.getAuthor());