Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- uses: s4u/setup-maven-action@v1.14.0
- uses: s4u/setup-maven-action@v1.18.0
with:
java-version: '17'
java-distribution: temurin
Expand Down
11 changes: 6 additions & 5 deletions application/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: JSON node documentation generator
Bundle-SymbolicName: de.philippkatz.knime.jsondocgen.application;singleton:=true
Bundle-Version: 1.14.2.qualifier
Bundle-Version: 1.15.0.qualifier
Bundle-Vendor: Philipp Katz; Selenium Nodes
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,5.0.0)",
org.knime.workbench.core;bundle-version="[5.3.0,6.0.0)",
org.knime.workbench.repository;bundle-version="[5.3.0,6.0.0)",
org.knime.workbench.core;bundle-version="[5.5.0,6.0.0)",
org.knime.workbench.repository;bundle-version="[5.5.0,6.0.0)",
org.eclipse.equinox.p2.metadata;bundle-version="[2.3.100,3.0.0)",
org.eclipse.equinox.p2.core;bundle-version="[2.4.100,3.0.0)",
org.eclipse.equinox.p2.engine;bundle-version="[2.4.100,3.0.0)",
org.knime.product;bundle-version="[5.3.0,6.0.0)",
org.knime.product;bundle-version="[5.5.0,6.0.0)",
org.apache.log4j;bundle-version="[1.2.0,2.0.0)",
com.google.gson;bundle-version="[2.8.6,3.0.0)",
org.knime.workflow.migration;bundle-version="[5.3.0,6.0.0)"
org.knime.workflow.migration;bundle-version="[5.5.0,6.0.0)",
org.knime.core.ui;bundle-version="[5.5.0,6.0.0)"
Bundle-ClassPath: .,
lib-download/mockito-core.jar,
lib-download/byte-buddy.jar,
Expand Down
4 changes: 2 additions & 2 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>de.philippkatz.knime.jsondocgen.application</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<parent>
<groupId>de.philippkatz.knime.jsondocgen</groupId>
<artifactId>de.philippkatz.knime.jsondocgen</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
</parent>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
import org.knime.core.node.port.PortTypeRegistry;
import org.knime.core.node.streamable.PartitionInfo;
import org.knime.core.util.IEarlyStartup;
import org.knime.core.webui.node.dialog.NodeDialogFactory;
import org.knime.core.webui.node.dialog.kai.KaiNodeInterfaceFactory;
import org.knime.workbench.repository.RepositoryManager;
import org.knime.workbench.repository.model.Category;
import org.knime.workbench.repository.model.IContainerObject;
Expand Down Expand Up @@ -421,6 +423,7 @@ private static void processPorts(Collection<Class<? extends PortObject>> portObj
* @return true, if the element was added to the documentation, false if it has
* been skipped
*/
@SuppressWarnings({ "restriction", "unchecked" })
private boolean generate(final File directory, final IRepositoryObject current, final IRepositoryObject parent,
CategoryDocBuilder parentCategory) throws TransformerException, Exception {

Expand Down Expand Up @@ -474,6 +477,15 @@ private boolean generate(final File directory, final IRepositoryObject current,
} catch (Throwable t) {
LOGGER.warn(String.format("Could not create NodeModel for %s", factory.getClass().getName()), t);
}

Node node = new Node((NodeFactory<NodeModel>) factory);
var nodeDescription = node.invokeGetNodeDescription();
builder.setKeywords(Arrays.asList(nodeDescription.getKeywords()));
builder.setSinceVersion(nodeDescription.getSinceVersion().map(v -> v.toString()).orElse(null));

builder.setHasModernDialog(hasModernDialog(factory));
// since KNIME 5.5; https://github.com/knime/knime-core-ui/commit/8769e99ab4df0a435fb90936d664fdc6c6ac2b6d
builder.setHasKaiInterface(factory instanceof KaiNodeInterfaceFactory);

if (deprecated) {
// there are two locations, where nodes can be set to deprecated:
Expand Down Expand Up @@ -717,8 +729,14 @@ private static String getPath(final IRepositoryObject object) {
return "";
}
}

/* package */ static enum PortDirection {
In, Out
}

@SuppressWarnings("restriction")
static boolean hasModernDialog(NodeFactory<?> nodeFactory) {
// supported since KNIME 4.5
return nodeFactory instanceof NodeDialogFactory nodeDialogFactory && nodeDialogFactory.hasNodeDialog();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public static final class NodeDocBuilder extends AbstractDocBuilder {
private List<DynamicPortGroup> dynamicInPorts;
/** @since 1.12 -- added with KNIME 4.2 */
private List<DynamicPortGroup> dynamicOutPorts;
/** @since v1.15 */
private boolean hasModernDialog;
/** @since v1.15 */
private boolean hasKaiInterface;
/** @since v1.15 */
private List<String> keywords;
/** @since v1.15 */
private String sinceVersion;
public NodeDocBuilder setIntro(String intro) {
this.intro = intro;
return this;
Expand Down Expand Up @@ -103,8 +111,28 @@ public NodeDocBuilder setDynamicOutPorts(List<DynamicPortGroup> dynamicOutPorts)
this.dynamicOutPorts = dynamicOutPorts;
return this;
}
/** @since v1.15 */
public NodeDocBuilder setHasModernDialog(boolean hasModernDialog) {
this.hasModernDialog = hasModernDialog;
return this;
}
/** @since v1.15 */
public NodeDocBuilder setHasKaiInterface(boolean hasKaiInterface) {
this.hasKaiInterface = hasKaiInterface;
return this;
}
/** @since v1.15 */
public NodeDocBuilder setKeywords(List<String> keywords) {
this.keywords = keywords;
return this;
}
/** @since v1.15 */
public NodeDocBuilder setSinceVersion(String sinceVersion) {
this.sinceVersion = sinceVersion;
return this;
}
}

public static final class OptionTab {
public final String name;
public final String description;
Expand Down Expand Up @@ -211,6 +239,14 @@ public DynamicPortGroup(Integer insertBefore, String name, String groupIdentifie
public final List<DynamicPortGroup> dynamicInPorts;
/** @since v1.12 -- added with KNIME 4.2 */
public final List<DynamicPortGroup> dynamicOutPorts;
/** @since v1.15 */
public final boolean hasModernDialog;
/** @since v1.15 */
public final boolean hasKaiInterface;
/** @since v1.15 */
public final List<String> keywords;
/** @since v1.15 */
public final String sinceVersion;

private NodeDoc(NodeDocBuilder builder) {
super(builder);
Expand All @@ -230,6 +266,10 @@ private NodeDoc(NodeDocBuilder builder) {
links = builder.links;
dynamicInPorts = copyOrNull(builder.dynamicInPorts);
dynamicOutPorts = copyOrNull(builder.dynamicOutPorts);
hasModernDialog = builder.hasModernDialog;
hasKaiInterface = builder.hasKaiInterface;
keywords = copyOrNull(builder.keywords);
sinceVersion = builder.sinceVersion;
}

private static List<String> convert(List<Port> ports) {
Expand Down
2 changes: 1 addition & 1 deletion feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="de.philippkatz.knime.jsondocgen.feature"
label="NodePit JSON Documentation Generator"
version="1.14.2.qualifier"
version="1.15.0.qualifier"
provider-name="seleniumnodes.com; Philipp Katz">

<plugin
Expand Down
4 changes: 2 additions & 2 deletions feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>de.philippkatz.knime.jsondocgen.feature</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>

<parent>
<groupId>de.philippkatz.knime.jsondocgen</groupId>
<artifactId>de.philippkatz.knime.jsondocgen</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
</parent>

</project>
4 changes: 2 additions & 2 deletions p2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>de.philippkatz.knime.jsondocgen.p2</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>

<parent>
<groupId>de.philippkatz.knime.jsondocgen</groupId>
<artifactId>de.philippkatz.knime.jsondocgen</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
</parent>

</project>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.philippkatz.knime.jsondocgen</groupId>
<artifactId>de.philippkatz.knime.jsondocgen</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
Expand Down Expand Up @@ -39,7 +39,7 @@
<artifact>
<groupId>de.philippkatz.knime.jsondocgen</groupId>
<artifactId>de.philippkatz.knime.jsondocgen.targetplatform</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
</artifact>
</target>
<environments>
Expand Down
7 changes: 6 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ https://download.nodepit.com/jsondocgen/5.0
https://download.nodepit.com/jsondocgen/5.1
https://download.nodepit.com/jsondocgen/5.2
https://download.nodepit.com/jsondocgen/5.3
https://download.nodepit.com/jsondocgen/5.4
https://download.nodepit.com/jsondocgen/5.5
https://download.nodepit.com/jsondocgen/5.6
https://download.nodepit.com/jsondocgen/5.7
https://download.nodepit.com/jsondocgen/5.8
```

Beside that, the `master` branch is available through the following software site:
Expand Down Expand Up @@ -262,7 +267,7 @@ License

- - -

Copyright (c) 2017 – 2024 Philipp Katz
Copyright (c) 2017 – 2025 Philipp Katz

[1]: https://seleniumnodes.com
[2]: https://github.com/NodePit/knime-json-node-doc-generator/issues
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="KNIME 5.3" sequenceNumber="1">
<?pde version="3.8"?><target name="KNIME 5.5" sequenceNumber="1">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.knime.features.base.feature.group" version="0.0.0"/>
Expand All @@ -17,7 +17,7 @@
<unit id="org.knime.features.core.streaming.feature.group" version="0.0.0"/>
<unit id="org.knime.features.database.feature.group" version="0.0.0"/>
<unit id="org.knime.features.clfixes.feature.group" version="0.0.0"/>
<repository location="https://update.knime.com/analytics-platform/5.3"/>
<repository location="https://update.knime.com/analytics-platform/5.5"/>
</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
Expand Down
2 changes: 1 addition & 1 deletion targetplatform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>de.philippkatz.knime.jsondocgen</groupId>
<artifactId>de.philippkatz.knime.jsondocgen</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
</parent>

</project>
4 changes: 2 additions & 2 deletions tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: JSON node documentation generator tests
Bundle-SymbolicName: de.philippkatz.knime.jsondocgen.tests;singleton:=true
Bundle-Version: 1.14.2.qualifier
Bundle-Version: 1.15.0.qualifier
Bundle-Vendor: Philipp Katz; Selenium Nodes
Bundle-RequiredExecutionEnvironment: JavaSE-17
Fragment-Host: de.philippkatz.knime.jsondocgen.application;bundle-version="1.14.2"
Fragment-Host: de.philippkatz.knime.jsondocgen.application;bundle-version="1.15.0"
Require-Bundle: org.junit;bundle-version="4.12.0"
4 changes: 2 additions & 2 deletions tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>de.philippkatz.knime.jsondocgen.tests</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>

<parent>
<groupId>de.philippkatz.knime.jsondocgen</groupId>
<artifactId>de.philippkatz.knime.jsondocgen</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.15.0-SNAPSHOT</version>
</parent>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.knime.core.node.NodeView;
import org.knime.core.node.context.NodeCreationConfiguration;

public class JsonNodeDocuGeneratorTest_ConfigurableNodeFactory {
public class JsonNodeDocuGeneratorTest_ConfigurableNodeFactory_Test {

private static final class ConfigurableStubNodeFactory extends ConfigurableNodeFactory<NodeModel> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import de.philippkatz.knime.jsondocgen.JsonNodeDocuGenerator.PortDirection;
import de.philippkatz.knime.jsondocgen.docs.NodeDoc.DynamicPortGroup;

public class JsonNodeDocuGeneratorTest_DynamicPorts {
public class JsonNodeDocuGeneratorTest_DynamicPorts_Test {

// https://github.com/knime/knime-core/blob/master/org.knime.core/src/eclipse/org/knime/core/node/NodeDescription41Proxy.java
// https://github.com/knime/knime-excel/blob/master/org.knime.ext.poi2/src/org/knime/ext/poi2/node/write3/XLSWriter2NodeFactory.java
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package de.philippkatz.knime.jsondocgen;

import static org.junit.Assert.assertTrue;

import org.junit.Test;
import org.knime.core.node.NodeDialogPane;
import org.knime.core.node.NodeFactory;
import org.knime.core.node.NodeModel;
import org.knime.core.node.NodeView;
import org.knime.core.webui.node.dialog.NodeDialog;
import org.knime.core.webui.node.dialog.NodeDialogFactory;
import org.knime.core.webui.node.dialog.kai.KaiNodeInterface;
import org.knime.core.webui.node.dialog.kai.KaiNodeInterfaceFactory;

public class JsonNodeDocuGeneratorTest_NewFlags_Test {

@SuppressWarnings("restriction")
private static class MyNodeFactory extends NodeFactory<NodeModel>
implements KaiNodeInterfaceFactory, NodeDialogFactory {

@Override
public NodeModel createNodeModel() {
return null;
}

@Override
protected int getNrNodeViews() {
return 0;
}

@Override
public NodeView<NodeModel> createNodeView(int viewIndex, NodeModel nodeModel) {
return null;
}

@Override
protected boolean hasDialog() {
return false;
}

@Override
protected NodeDialogPane createNodeDialogPane() {
return null;
}

@Override
public KaiNodeInterface createKaiNodeInterface() {
return null;
}

@Override
public NodeDialog createNodeDialog() {
return null;
}

}

@Test
public void test() {
assertTrue(JsonNodeDocuGenerator.hasModernDialog(new MyNodeFactory()));
}

}