From 0240482e86f65d40faea8dcd2e962426989509f0 Mon Sep 17 00:00:00 2001 From: rrahn Date: Thu, 23 Aug 2018 22:06:48 +0200 Subject: [PATCH] [FEATURE] Adds category group Allows external configuration systems to boostrap plugins from different providers into a core plugin for distribution. --- .../dynamic/DynamicGenericNodeSetFactory.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/com.genericworkflownodes.knime/src/com/genericworkflownodes/knime/dynamic/DynamicGenericNodeSetFactory.java b/com.genericworkflownodes.knime/src/com/genericworkflownodes/knime/dynamic/DynamicGenericNodeSetFactory.java index de2c4bd7..f86d8a15 100644 --- a/com.genericworkflownodes.knime/src/com/genericworkflownodes/knime/dynamic/DynamicGenericNodeSetFactory.java +++ b/com.genericworkflownodes.knime/src/com/genericworkflownodes/knime/dynamic/DynamicGenericNodeSetFactory.java @@ -48,7 +48,17 @@ public DynamicGenericNodeSetFactory() { public abstract IPluginConfiguration getPluginConfig(); protected abstract String getCategoryPath(); - + + /** + * Add additional grouping in category independent of CTD category + * definition and after the plugin version. This can be useful if a single + * plugin contains sources from multiple projects. + * + * @return String with the name of the group. Use null to omit the category + * group. + */ + protected abstract String getCategoryGroup(); + protected abstract String getIdForTool(String relPath); @Override @@ -77,6 +87,10 @@ public String getCategoryPath(String id) { logger.error("Could not read node category from CTD, using '/' instead.", e); category = ""; } + String categoryGroup = getCategoryGroup(); + if (categoryGroup != null) + category = categoryGroup + "/" + category; + return getCategoryPath() + "/" + getPluginConfig().getPluginVersion() + "/" + category; }