From 2c531fe7ae3c3133195de57c5f618cd600f255e8 Mon Sep 17 00:00:00 2001 From: "CLINITEC\\janderson" Date: Thu, 27 Jun 2024 11:55:32 -0500 Subject: [PATCH 1/6] [ROCKSOLID-12899] remove superfluous spacing --- .../com/mirth/connect/server/userutil/AttachmentUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/com/mirth/connect/server/userutil/AttachmentUtil.java b/server/src/com/mirth/connect/server/userutil/AttachmentUtil.java index f2884faac..f19ec1015 100644 --- a/server/src/com/mirth/connect/server/userutil/AttachmentUtil.java +++ b/server/src/com/mirth/connect/server/userutil/AttachmentUtil.java @@ -118,7 +118,7 @@ public static String reAttachMessage(String raw, ImmutableConnectorMessage conne * @param connectorMessage * The ConnectorMessage associated with this message, used to identify the * channel/message ID. - * @return A List of attachment IDs associated with the current channel / message. + * @return A List of attachment IDs associated with the current channel/message. * @throws MessageSerializerException * If the attachment IDs could be retrieved. */ @@ -127,13 +127,13 @@ public static List getMessageAttachmentIds(ImmutableConnectorMessage con } /** - * Returns a list of attachment IDs associated with the current channel / message. + * Returns a list of attachment IDs associated with the current channel/message. * * @param channelId * The ID of the channel the attachments are associated with. * @param messageId * The ID of the message the attachments are associated with. - * @return A List of attachment IDs associated with the current channel / message. + * @return A List of attachment IDs associated with the current channel/message. * @throws MessageSerializerException * If the attachment IDs could be retrieved. */ From c454101dab9875999e93a534e7f8f24996e0ae22 Mon Sep 17 00:00:00 2001 From: Nick Rupley Date: Mon, 1 Jul 2024 19:17:09 -0400 Subject: [PATCH 2/6] Allowing Extensions view to pull max core versions from server. Also tweaking ExtensionLoader to only include max versions for a plugin if a max version is explicitly specified. If there is no max version in the JSON, then do not assume max=min. --- .../com/mirth/connect/client/ui/Frame.java | 8 +++ .../ExtensionManagerPanel.java | 56 +++++++++++++------ .../servlets/ExtensionServletInterface.java | 10 ++++ .../com/mirth/connect/client/core/Client.java | 10 ++++ .../mirth/connect/server/ExtensionLoader.java | 26 ++++----- .../controllers/ExtensionController.java | 5 ++ .../mirth/connect/client/ui/FrameBase.java | 6 +- .../server/api/servlets/ExtensionServlet.java | 5 ++ .../DefaultExtensionController.java | 5 ++ .../servlets/SwaggerExamplesServlet.java | 23 +++++++- 10 files changed, 119 insertions(+), 35 deletions(-) diff --git a/client/src/com/mirth/connect/client/ui/Frame.java b/client/src/com/mirth/connect/client/ui/Frame.java index 48d26a6fc..9a279a05c 100644 --- a/client/src/com/mirth/connect/client/ui/Frame.java +++ b/client/src/com/mirth/connect/client/ui/Frame.java @@ -248,6 +248,7 @@ public class Frame extends FrameBase { public LinkedHashMap displayNameToDataType; private Map loadedPlugins; private Map loadedConnectors; + private Map> extensionMaxCoreVersions; private Map safeErrorFailCountMap = new HashMap(); private Map componentTaskMap = new HashMap(); private boolean acceleratorKeyPressed = false; @@ -827,6 +828,7 @@ public void dispose() { private void loadExtensionMetaData() throws ClientException { loadedPlugins = mirthClient.getPluginMetaData(); loadedConnectors = mirthClient.getConnectorMetaData(); + extensionMaxCoreVersions = mirthClient.getExtensionMaxCoreVersions(); // Register extension JAX-RS providers with the client Set apiProviderPackages = new HashSet(); @@ -4759,6 +4761,7 @@ public void doRefreshExtensions() { } public void refreshExtensions() { + extensionsPanel.setExtensionMaxCoreVersions(getExtensionMaxCoreVersions()); extensionsPanel.setPluginData(getPluginMetaData()); extensionsPanel.setConnectorData(getConnectorMetaData()); } @@ -5008,6 +5011,11 @@ public Map getConnectorMetaData() { return this.loadedConnectors; } + @Override + public Map> getExtensionMaxCoreVersions() { + return this.extensionMaxCoreVersions; + } + public String getSelectedChannelIdFromDashboard() { return dashboardPanel.getSelectedStatuses().get(0).getChannelId(); } diff --git a/client/src/com/mirth/connect/client/ui/extensionmanager/ExtensionManagerPanel.java b/client/src/com/mirth/connect/client/ui/extensionmanager/ExtensionManagerPanel.java index 8d4159d9a..398a2aa2e 100644 --- a/client/src/com/mirth/connect/client/ui/extensionmanager/ExtensionManagerPanel.java +++ b/client/src/com/mirth/connect/client/ui/extensionmanager/ExtensionManagerPanel.java @@ -28,7 +28,6 @@ import org.jdesktop.swingx.decorator.HighlighterFactory; import com.mirth.connect.client.core.ClientException; -import com.mirth.connect.client.core.Version; import com.mirth.connect.client.ui.CellData; import com.mirth.connect.client.ui.Frame; import com.mirth.connect.client.ui.ImageCellRenderer; @@ -60,6 +59,7 @@ public class ExtensionManagerPanel extends javax.swing.JPanel { private final String ENABLED_STATUS = "Enabled"; private Map pluginData = null; private Map connectorData = null; + private Map> extensionMaxCoreVersions = null; private Frame parent; public ExtensionManagerPanel() { @@ -70,6 +70,10 @@ public ExtensionManagerPanel() { makeLoadedPluginsTable(); } + public void setExtensionMaxCoreVersions(Map> extensionMaxCoreVersions) { + this.extensionMaxCoreVersions = extensionMaxCoreVersions; + } + /** * Gets the selected extension index that corresponds to the saved extensions list */ @@ -231,7 +235,7 @@ private void setToolTipTexts(MirthTable table) { table.getColumnExt(PLUGIN_URL_COLUMN_NAME).setToolTipText("A website you can visit to learn more about this extension."); table.getColumnExt(PLUGIN_VERSION_COLUMN_NAME).setToolTipText("The version of this extension."); table.getColumnExt(PLUGIN_BUILD_COLUMN_NAME).setToolTipText("The specific build number of this extension, if applicable.
For \"core\" extensions that come bundled with Mirth Connect by default,
this build number will equal the build number of Mirth Connect itself."); - table.getColumnExt(MC_VERSIONS_COLUMN_NAME).setToolTipText("The version(s) of Mirth Connect that this version of this
extension is compatible with. This may be a single version,
a range from min-max, or a comma-separated list of versions."); + table.getColumnExt(MC_VERSIONS_COLUMN_NAME).setToolTipText("The version(s) of Mirth Connect that this version of this
extension is compatible with. This may be a single version,
a range from min-max, or a comma-separated list of versions.

If a \"+\" appears at the end, it means that there is not
yet any known max version specified, so this plugin should
be fully compatible with higher versions of Mirth Connect."); table.getColumnExt(CORE_COLUMN_NAME).setToolTipText("Indicates whether this extension is a \"core\" extension
that comes bundled with Mirth Connect by default."); } @@ -500,23 +504,43 @@ private String getSupportedMCVersions(MetaData metaData) { // If core library min versions are specified, derive a range of supported versions if (MapUtils.isNotEmpty(metaData.getMinCoreVersions())) { - // Assume the minimum supported MC version is the highest core library version - String minSupportedMCVersion = null; - for (Entry minCoreVersionEntry : metaData.getMinCoreVersions().entrySet()) { - if (minSupportedMCVersion == null || MigrationUtil.compareVersions(minSupportedMCVersion, minCoreVersionEntry.getValue()) < 0) { - minSupportedMCVersion = minCoreVersionEntry.getValue(); + try { + // Assume the minimum supported MC version is the highest core library version + String minSupportedMCVersion = null; + for (Entry minCoreVersionEntry : metaData.getMinCoreVersions().entrySet()) { + if (minSupportedMCVersion == null || MigrationUtil.compareVersions(minSupportedMCVersion, minCoreVersionEntry.getValue()) < 0) { + minSupportedMCVersion = minCoreVersionEntry.getValue(); + } } - } - - if (minSupportedMCVersion != null) { - supportedMCVersions = minSupportedMCVersion; - // Assume the highest supported MC version is the current version - // TODO: Get this from server-side - Version matchingMinVersion = Version.fromString(minSupportedMCVersion); - if (matchingMinVersion != null && matchingMinVersion != Version.getLatest()) { - supportedMCVersions += " - " + Version.getLatest().toString(); + if (minSupportedMCVersion != null) { + supportedMCVersions = minSupportedMCVersion; + + String maxSupportedMCVersion = null; + + // Get max version from the server-side map, if available + if (MapUtils.isNotEmpty(extensionMaxCoreVersions)) { + Map maxVersions = extensionMaxCoreVersions.get(metaData.getPath()); + if (MapUtils.isNotEmpty(maxVersions)) { + for (Entry maxCoreVersionEntry : maxVersions.entrySet()) { + if (StringUtils.isNotBlank(maxCoreVersionEntry.getValue()) && (maxSupportedMCVersion == null || MigrationUtil.compareVersions(maxSupportedMCVersion, maxCoreVersionEntry.getValue()) > 0)) { + maxSupportedMCVersion = maxCoreVersionEntry.getValue(); + } + } + } + } + + if (maxSupportedMCVersion != null) { + if (MigrationUtil.compareVersions(minSupportedMCVersion, maxSupportedMCVersion) < 0) { + supportedMCVersions += " - " + maxSupportedMCVersion; + } + } else { + supportedMCVersions += "+"; + } } + } catch (Exception e) { + // Ignore, and just use the mirthVersion from the metadata + e.printStackTrace(); } } diff --git a/core-client-api/src/com/mirth/connect/client/core/api/servlets/ExtensionServletInterface.java b/core-client-api/src/com/mirth/connect/client/core/api/servlets/ExtensionServletInterface.java index 6945b1297..c8050e4e1 100644 --- a/core-client-api/src/com/mirth/connect/client/core/api/servlets/ExtensionServletInterface.java +++ b/core-client-api/src/com/mirth/connect/client/core/api/servlets/ExtensionServletInterface.java @@ -101,6 +101,16 @@ public void uninstallExtension(@Param("extensionPath") @RequestBody(description @ExampleObject(name = "pluginMetaData", ref = "../apiexamples/plugin_metadata_map_json") }) }) public Map getPluginMetaData() throws ClientException; + @GET + @Path("/maxcoreversions") + @Operation(summary = "Returns max core library versions for loaded extensions.") + @MirthOperation(name = "getExtensionMaxCoreVersions", display = "Get extension max core versions", auditable = false) + @ApiResponse(content = { @Content(mediaType = MediaType.APPLICATION_XML, examples = { + @ExampleObject(name = "extensionMaxCoreVersions", ref = "../apiexamples/extension_maxcoreversions_map_xml") }), + @Content(mediaType = MediaType.APPLICATION_JSON, examples = { + @ExampleObject(name = "extensionMaxCoreVersions", ref = "../apiexamples/extension_maxcoreversions_map_json") }) }) + public Map> getExtensionMaxCoreVersions() throws ClientException; + @GET @Path("/{extensionName}/enabled") @Operation(summary = "Returns the enabled status of an extension.") diff --git a/core-client/src/com/mirth/connect/client/core/Client.java b/core-client/src/com/mirth/connect/client/core/Client.java index 7e5e3c9c9..20c6f1aad 100644 --- a/core-client/src/com/mirth/connect/client/core/Client.java +++ b/core-client/src/com/mirth/connect/client/core/Client.java @@ -2588,6 +2588,16 @@ public Map getPluginMetaData() throws ClientException { return getServlet(ExtensionServletInterface.class).getPluginMetaData(); } + /** + * Returns max core library versions for loaded extensions. + * + * @see ExtensionServletInterface#getExtensionMaxCoreVersions + */ + @Override + public Map> getExtensionMaxCoreVersions() throws ClientException { + return getServlet(ExtensionServletInterface.class).getExtensionMaxCoreVersions(); + } + /** * Returns the enabled status of an extension. * diff --git a/core-server-plugins/src/com/mirth/connect/server/ExtensionLoader.java b/core-server-plugins/src/com/mirth/connect/server/ExtensionLoader.java index eb6f663ee..c82ac1479 100644 --- a/core-server-plugins/src/com/mirth/connect/server/ExtensionLoader.java +++ b/core-server-plugins/src/com/mirth/connect/server/ExtensionLoader.java @@ -74,6 +74,7 @@ public static ExtensionLoader getInstance() { private Map pluginMetaDataMap = new HashMap(); private Map connectorProtocolsMap = new HashMap(); private Map invalidMetaDataMap = new HashMap(); + private Map> allExtensionMaxCoreVersions = new HashMap>(); private boolean loadedExtensions = false; private ObjectXMLSerializer serializer = ObjectXMLSerializer.getInstance(); private static Logger logger = LogManager.getLogger(ExtensionLoader.class); @@ -116,6 +117,11 @@ public Map getInvalidMetaData() { return invalidMetaDataMap; } + public Map> getExtensionMaxCoreVersions() { + loadExtensions(); + return allExtensionMaxCoreVersions; + } + @SuppressWarnings("unchecked") public Class getControllerClass(Class abstractClass) { Class overrideClass = null; @@ -183,7 +189,7 @@ public boolean isExtensionCompatible(MetaData metaData) { Map extensionMaxCoreVersions = new HashMap(); try { extensionMinCoreVersions = metaData.getMinCoreVersions(); - extensionMaxCoreVersions = getExtensionMaxCoreVersions(metaData.getPath(), metaData.getPluginVersion(), extensionMinCoreVersions); + extensionMaxCoreVersions = getExtensionMaxCoreVersions(metaData.getPath(), metaData.getPluginVersion()); } catch (Exception e) { logger.error("An error occurred while attempting to determine the extension's Core versions.", e); return false; @@ -206,13 +212,14 @@ public boolean isExtensionCompatible(MetaData metaData) { if (!MapUtils.isEmpty(extensionMaxCoreVersions)) { if (extensionMaxCoreVersions.containsKey(connectCoreVersionEntry.getKey())) { - if (!StringUtils.isEmpty(extensionMaxCoreVersions.get(connectCoreVersionEntry.getKey())) && connectCoreVersion.isGreaterThan(extensionMaxCoreVersions.get(connectCoreVersionEntry.getKey()))) { + if (StringUtils.isNotBlank(extensionMaxCoreVersions.get(connectCoreVersionEntry.getKey())) && connectCoreVersion.isGreaterThan(extensionMaxCoreVersions.get(connectCoreVersionEntry.getKey()))) { return false; } } } } + allExtensionMaxCoreVersions.put(metaData.getPath(), extensionMaxCoreVersions); return true; } else { // validate extension the old way for non-commercial extensions @@ -416,7 +423,7 @@ private static Map getConnectCoreVersions(ManifestEntry[] manife * @throws JsonProcessingException * @throws JsonMappingException */ - private Map getExtensionMaxCoreVersions(String pluginPath, String pluginVersion, Map extensionMinCoreVersions) throws JsonMappingException, JsonProcessingException { + private Map getExtensionMaxCoreVersions(String pluginPath, String pluginVersion) throws JsonMappingException, JsonProcessingException { Map extensionMaxCoreVersions = new HashMap(); if (!StringUtils.isEmpty(extensionsCoreVersionsS3File)) { @@ -433,20 +440,11 @@ private Map getExtensionMaxCoreVersions(String pluginPath, Strin while(extensionCoreVersionsS3FileIt.hasNext()) { Map.Entry extensionCoreVersionS3FileEntry = extensionCoreVersionsS3FileIt.next(); - String extensionCoreVersionS3FileEntryValue = ""; - if (extensionCoreVersionS3FileEntry.getValue().has("max") && !StringUtils.isEmpty(extensionCoreVersionS3FileEntry.getValue().get("max").textValue())) { - extensionCoreVersionS3FileEntryValue = extensionCoreVersionS3FileEntry.getValue().get("max").textValue(); - } else { - extensionCoreVersionS3FileEntryValue = extensionMinCoreVersions.get(extensionCoreVersionS3FileEntry.getKey()); + if (extensionCoreVersionS3FileEntry.getValue().has("max") && StringUtils.isNotBlank(extensionCoreVersionS3FileEntry.getValue().get("max").textValue())) { + extensionMaxCoreVersions.put(extensionCoreVersionS3FileEntry.getKey(), extensionCoreVersionS3FileEntry.getValue().get("max").textValue()); } - - extensionMaxCoreVersions.put(extensionCoreVersionS3FileEntry.getKey(), extensionCoreVersionS3FileEntryValue); } - } else { - extensionMaxCoreVersions.putAll(extensionMinCoreVersions); } - } else { - extensionMaxCoreVersions.putAll(extensionMinCoreVersions); } return extensionMaxCoreVersions; diff --git a/core-server-plugins/src/com/mirth/connect/server/controllers/ExtensionController.java b/core-server-plugins/src/com/mirth/connect/server/controllers/ExtensionController.java index a072840b0..6bcc940e0 100644 --- a/core-server-plugins/src/com/mirth/connect/server/controllers/ExtensionController.java +++ b/core-server-plugins/src/com/mirth/connect/server/controllers/ExtensionController.java @@ -157,6 +157,11 @@ public Properties getPluginProperties(String name) throws ControllerException { public abstract Map getInvalidMetaData(); + /** + * Returns max core library versions for loaded extensions. + */ + public abstract Map> getExtensionMaxCoreVersions(); + // ************************************************************ // Connectors // ************************************************************ diff --git a/core-ui/src/com/mirth/connect/client/ui/FrameBase.java b/core-ui/src/com/mirth/connect/client/ui/FrameBase.java index 6fa8490ca..9cf2f8e41 100644 --- a/core-ui/src/com/mirth/connect/client/ui/FrameBase.java +++ b/core-ui/src/com/mirth/connect/client/ui/FrameBase.java @@ -115,9 +115,11 @@ public abstract class FrameBase extends JXFrame { public abstract void setVisibleTasks(JXTaskPane pane, JPopupMenu menu, int startIndex, int endIndex, boolean visible); public abstract Map getPluginMetaData(); - + public abstract Map getConnectorMetaData(); - + + public abstract Map> getExtensionMaxCoreVersions(); + /** * Enables the save button for needed page. */ diff --git a/server/src/com/mirth/connect/server/api/servlets/ExtensionServlet.java b/server/src/com/mirth/connect/server/api/servlets/ExtensionServlet.java index f05238da1..35ff6d898 100644 --- a/server/src/com/mirth/connect/server/api/servlets/ExtensionServlet.java +++ b/server/src/com/mirth/connect/server/api/servlets/ExtensionServlet.java @@ -97,6 +97,11 @@ public Map getPluginMetaData() { return extensionController.getPluginMetaData(); } + @Override + public Map> getExtensionMaxCoreVersions() { + return extensionController.getExtensionMaxCoreVersions(); + } + @Override public boolean isExtensionEnabled(String extensionName) { return extensionController.isExtensionEnabled(extensionName); diff --git a/server/src/com/mirth/connect/server/controllers/DefaultExtensionController.java b/server/src/com/mirth/connect/server/controllers/DefaultExtensionController.java index 30b7bfa6a..f2ec5b218 100644 --- a/server/src/com/mirth/connect/server/controllers/DefaultExtensionController.java +++ b/server/src/com/mirth/connect/server/controllers/DefaultExtensionController.java @@ -631,6 +631,11 @@ public Map getInvalidMetaData() { return extensionLoader.getInvalidMetaData(); } + @Override + public Map> getExtensionMaxCoreVersions() { + return extensionLoader.getExtensionMaxCoreVersions(); + } + /** * Executes the script that removes that database tables for plugins that are marked for * removal. The actual removal of the plugin directory happens in MirthLauncher.java, before diff --git a/server/src/com/mirth/connect/server/servlets/SwaggerExamplesServlet.java b/server/src/com/mirth/connect/server/servlets/SwaggerExamplesServlet.java index 65e216e82..7bfcf5773 100644 --- a/server/src/com/mirth/connect/server/servlets/SwaggerExamplesServlet.java +++ b/server/src/com/mirth/connect/server/servlets/SwaggerExamplesServlet.java @@ -325,6 +325,8 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se requestedObject = getPasswordRequirementListExample(); } else if (exampleRequested.equals("plugin_metadata_map")) { requestedObject = getPluginMetaDataMapExample(); + } else if (exampleRequested.equals("extension_maxcoreversions_map")) { + requestedObject = getExtensionMaxCoreVersionsExample(); } else if (exampleRequested.equals("properties")) { requestedObject = getPropertiesExample(); } else if (exampleRequested.equals("protocols_and_cipher_suites_map")) { @@ -1198,9 +1200,24 @@ private Map getPluginMetaDataMapExample() { Map pluginMetaDataMap = new HashMap<>(); pluginMetaDataMap.put("Name", getPluginMetaDataExample()); return pluginMetaDataMap; - } - - private Properties getPropertiesExample() { + } + + private Map> getExtensionMaxCoreVersionsExample() { + Map> extensionMaxCoreVersions = new HashMap<>(); + Map versionsMap = new HashMap<>(); + versionsMap.put("mirth-core-client", Version.getLatest().toString()); + versionsMap.put("mirth-core-client-api", Version.getLatest().toString()); + versionsMap.put("mirth-core-client-base", Version.getLatest().toString()); + versionsMap.put("mirth-core-client-plugins", Version.getLatest().toString()); + versionsMap.put("mirth-core-models", Version.getLatest().toString()); + versionsMap.put("mirth-core-server-plugins", Version.getLatest().toString()); + versionsMap.put("mirth-core-ui", Version.getLatest().toString()); + versionsMap.put("mirth-core-util", Version.getLatest().toString()); + extensionMaxCoreVersions.put("Name", versionsMap); + return extensionMaxCoreVersions; + } + + private Properties getPropertiesExample() { Properties properties = new Properties(); properties.setProperty("exampleKey1", "exampleValue1"); properties.setProperty("exampleKey2", "exampleValue2"); From 26186c4bf06cbfc0b9023025e6a5a63eaaf69803 Mon Sep 17 00:00:00 2001 From: Chris McQuillen Date: Sun, 1 Sep 2024 19:28:21 -0500 Subject: [PATCH 3/6] Initial setup --- .vscode/settings.json | 3 +++ client/.project | 11 +++++++++++ command/.project | 11 +++++++++++ core-client-api/.project | 11 +++++++++++ core-client-base/.project | 11 +++++++++++ core-client-plugins/.project | 11 +++++++++++ core-client/.project | 11 +++++++++++ core-models/.project | 11 +++++++++++ core-server-plugins/.project | 11 +++++++++++ core-ui/.project | 11 +++++++++++ core-util/.project | 11 +++++++++++ donkey/.project | 11 +++++++++++ generator/.project | 11 +++++++++++ manager/.project | 11 +++++++++++ server/.project | 11 +++++++++++ simplesender/.project | 11 +++++++++++ webadmin/.project | 11 +++++++++++ 17 files changed, 179 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..8f2b7113d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.compile.nullAnalysis.mode": "disabled" +} \ No newline at end of file diff --git a/client/.project b/client/.project index 26fbc4505..a500911c8 100644 --- a/client/.project +++ b/client/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689250 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/command/.project b/command/.project index e0884d3e5..cf6e70bd4 100644 --- a/command/.project +++ b/command/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689259 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/core-client-api/.project b/core-client-api/.project index bf2f06b03..98eb0ba15 100644 --- a/core-client-api/.project +++ b/core-client-api/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689267 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/core-client-base/.project b/core-client-base/.project index 2b90f362a..4d2e5d11f 100644 --- a/core-client-base/.project +++ b/core-client-base/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689271 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/core-client-plugins/.project b/core-client-plugins/.project index 6ba8503b9..8be51f5a3 100644 --- a/core-client-plugins/.project +++ b/core-client-plugins/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689279 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/core-client/.project b/core-client/.project index bccf4351e..87c3011ab 100644 --- a/core-client/.project +++ b/core-client/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689264 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/core-models/.project b/core-models/.project index 70c82c998..ff17157c8 100644 --- a/core-models/.project +++ b/core-models/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689284 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/core-server-plugins/.project b/core-server-plugins/.project index 1f7c42a63..1dd6cd75a 100644 --- a/core-server-plugins/.project +++ b/core-server-plugins/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689287 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/core-ui/.project b/core-ui/.project index 856ccdaaa..a02c5d359 100644 --- a/core-ui/.project +++ b/core-ui/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689290 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/core-util/.project b/core-util/.project index 80e562829..622fa4d37 100644 --- a/core-util/.project +++ b/core-util/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689295 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/donkey/.project b/donkey/.project index e2a5d1be0..842863671 100644 --- a/donkey/.project +++ b/donkey/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689298 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/generator/.project b/generator/.project index 2c663857c..e9a938807 100644 --- a/generator/.project +++ b/generator/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689301 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/manager/.project b/manager/.project index c6e58661f..6b505c0b4 100644 --- a/manager/.project +++ b/manager/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689306 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/server/.project b/server/.project index d4d4f9ae9..87b02dd6a 100644 --- a/server/.project +++ b/server/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689311 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/simplesender/.project b/simplesender/.project index 56981deb4..668021b63 100644 --- a/simplesender/.project +++ b/simplesender/.project @@ -14,4 +14,15 @@ org.eclipse.jdt.core.javanature + + + 1725236689314 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + diff --git a/webadmin/.project b/webadmin/.project index e449fab99..3b1494d48 100644 --- a/webadmin/.project +++ b/webadmin/.project @@ -33,4 +33,15 @@ org.eclipse.jdt.core.javanature org.eclipse.wst.jsdt.core.jsNature + + + 1725236689317 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + From 30968608a62609ddf3a28b71834ecc474976d164 Mon Sep 17 00:00:00 2001 From: Chris McQuillen Date: Sun, 1 Sep 2024 19:34:45 -0500 Subject: [PATCH 4/6] Use LinkedHashMap to preserve parameter order --- core-util/src/com/mirth/connect/util/HttpUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-util/src/com/mirth/connect/util/HttpUtil.java b/core-util/src/com/mirth/connect/util/HttpUtil.java index 1b0b80854..b2ec75437 100644 --- a/core-util/src/com/mirth/connect/util/HttpUtil.java +++ b/core-util/src/com/mirth/connect/util/HttpUtil.java @@ -11,7 +11,7 @@ import java.nio.charset.Charset; import java.util.ArrayList; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -104,7 +104,7 @@ public static Map> getTableMap(boolean useVariable, String } public static Map> getTableMap(String mapVariable, MessageMaps messageMaps, ConnectorMessage connectorMessage) { - Map> map = new HashMap>(); + Map> map = new LinkedHashMap>(); try { Map source = (Map) messageMaps.get(mapVariable, connectorMessage); From 8bd7c2fc761ac24315ee58091cec70c3c6a5fe82 Mon Sep 17 00:00:00 2001 From: Shurazi Date: Tue, 10 Sep 2024 15:14:41 -0500 Subject: [PATCH 5/6] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index eca7bb939..396d207bd 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ donkey/donkey-test .sonar **/junit-reports **/code-coverage-reports +.vscode/settings.json # /client/ /client/logs @@ -24,6 +25,7 @@ donkey/donkey-test /client/nbdist /client/test_classes /client/junit-reports +/client/.project # /client/lib/ /client/lib/*-shared.jar From 30d27609b0e0e0f17090caa9c7c99a3b233f9a69 Mon Sep 17 00:00:00 2001 From: Richard Ogin Date: Tue, 10 Sep 2024 15:57:14 -0500 Subject: [PATCH 6/6] #6276 add unit test --- .../com/mirth/connect/util/HttpUtilTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/core-util/test/com/mirth/connect/util/HttpUtilTest.java b/core-util/test/com/mirth/connect/util/HttpUtilTest.java index f13811902..6e591391c 100644 --- a/core-util/test/com/mirth/connect/util/HttpUtilTest.java +++ b/core-util/test/com/mirth/connect/util/HttpUtilTest.java @@ -9,10 +9,13 @@ package com.mirth.connect.util; +import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; import java.security.KeyStore; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.UUID; import javax.net.ssl.SSLContext; @@ -22,6 +25,9 @@ import org.apache.http.ssl.SSLContexts; import org.junit.Test; +import com.mirth.connect.donkey.model.message.ConnectorMessage; +import com.mirth.connect.donkey.util.MessageMaps; + public class HttpUtilTest { @Test @@ -40,4 +46,20 @@ public void testExecuteGetRequest() throws Exception { } catch (Exception e) { } } + + @Test + public void testMapOrderPreserved() { + final String MAP_KEY = "MyMap"; + + Map initial = new LinkedHashMap<>(); + initial.put("First", 1); + initial.put("Second", 2); + initial.put("Third", 3); + + ConnectorMessage cm = new ConnectorMessage(); + cm.getSourceMap().put(MAP_KEY, initial); + + Map copied = HttpUtil.getTableMap(MAP_KEY, new MessageMaps(), cm); + assertArrayEquals("Failed to preserve key order", initial.keySet().toArray(), copied.keySet().toArray()); + } }