From 65430717235f45d69d52bddf6fe3113101b12639 Mon Sep 17 00:00:00 2001 From: Elyes Cherfa Date: Mon, 14 Oct 2024 15:44:15 +0200 Subject: [PATCH 1/3] Issue #63: Display the new additional connectors configuration * Updated the plugin to generate `additionalConnectors` section instead of `variables` which has been abandonned. * Tested on both MetricsHub community & Enterprise documentations. --- .../connector/producer/ConnectorPageProducer.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java b/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java index 12b4e6d..85d0e0b 100644 --- a/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java +++ b/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java @@ -539,11 +539,17 @@ private void produceMetricsHubExamplesContent( // Connector variable if (connectorVariables != null && !connectorVariables.isEmpty()) { - yamlBuilder.append(" variables:\n"); + yamlBuilder.append(" additionalConnectors:\n"); + yamlBuilder.append(" :\n"); + yamlBuilder.append(" uses: " + connectorId); + yamlBuilder.append(" # Id of connector to use\n"); + yamlBuilder.append(" force: true/false"); + yamlBuilder.append(" # true by default\n"); + yamlBuilder.append(" variables:\n"); connectorVariables .iterator() .forEachRemaining(variable -> { - yamlBuilder.append(String.format(" %s: %s", variable, "")); + yamlBuilder.append(String.format(" %s: %s", variable, "")); yamlBuilder.append(" # Replace with desired value.\n"); }); } From 5338cfd2a4d492b2b23737433b03eeb5673d9e09 Mon Sep 17 00:00:00 2001 From: Elyes Cherfa Date: Tue, 22 Oct 2024 14:57:33 +0200 Subject: [PATCH 2/3] Issue #63: Display the new additional connectors configuration * Changed the additional connectors display format. * Tested on MetricsHub doc --- .../connector/producer/ConnectorPageProducer.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java b/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java index 85d0e0b..2142e1e 100644 --- a/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java +++ b/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java @@ -539,12 +539,14 @@ private void produceMetricsHubExamplesContent( // Connector variable if (connectorVariables != null && !connectorVariables.isEmpty()) { + yamlBuilder.append(" additionalConnectors:\n"); - yamlBuilder.append(" :\n"); + yamlBuilder.append(" " + connectorId); + yamlBuilder.append(": # Unique ID. Use 'uses' if different from the original connector ID\n"); yamlBuilder.append(" uses: " + connectorId); - yamlBuilder.append(" # Id of connector to use\n"); - yamlBuilder.append(" force: true/false"); - yamlBuilder.append(" # true by default\n"); + yamlBuilder.append(" # Optional - Original ID if not in key\n"); + yamlBuilder.append(" force: true"); + yamlBuilder.append(" # Optional (default: true); false for auto-detection only\n"); yamlBuilder.append(" variables:\n"); connectorVariables .iterator() From 6290d715a30b2c5f7d9aad4aad912b02f2663243 Mon Sep 17 00:00:00 2001 From: Elyes Cherfa Date: Tue, 22 Oct 2024 15:08:58 +0200 Subject: [PATCH 3/3] Issue #63: Display the new additional connectors configuration * Reformatted the code. --- .../metricshub/connector/producer/ConnectorPageProducer.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java b/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java index 2142e1e..2fad27c 100644 --- a/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java +++ b/src/main/java/org/sentrysoftware/maven/metricshub/connector/producer/ConnectorPageProducer.java @@ -539,7 +539,6 @@ private void produceMetricsHubExamplesContent( // Connector variable if (connectorVariables != null && !connectorVariables.isEmpty()) { - yamlBuilder.append(" additionalConnectors:\n"); yamlBuilder.append(" " + connectorId); yamlBuilder.append(": # Unique ID. Use 'uses' if different from the original connector ID\n");