-
Notifications
You must be signed in to change notification settings - Fork 0
UIEXT-3490 WebUI Migration Model to Binary Object #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tcrundall-tng
wants to merge
2
commits into
master
Choose a base branch
from
enh/UIEXT-3490-webui-migration-model-to-binary-object
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
org.knime.base.filehandling.tests/files/node_settings/ModelToBinaryObjectNodeParameters.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <config xmlns="http://www.knime.org/2008/09/XMLConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.knime.org/2008/09/XMLConfig http://www.knime.org/XMLConfig_2008_09.xsd" key="settings.xml"> | ||
| <entry key="node_file" type="xstring" value="settings.xml"/> | ||
| <config key="flow_stack"/> | ||
| <config key="internal_node_subsettings"> | ||
| <entry key="memory_policy" type="xstring" value="CacheSmallInMemory"/> | ||
| </config> | ||
| <config key="model"> | ||
| <config key="columnname_Internals"> | ||
| <entry key="SettingsModelID" type="xstring" value="SMID_string"/> | ||
| <entry key="EnabledStatus" type="xboolean" value="true"/> | ||
| </config> | ||
| <entry key="columnname" type="xstring" value="model"/> | ||
| </config> | ||
| <entry key="customDescription" type="xstring" isnull="true" value=""/> | ||
| <entry key="state" type="xstring" value="IDLE"/> | ||
| <entry key="factory" type="xstring" value="org.knime.base.filehandling.binaryobjects.model.to.port.ModelToBinaryObjectNodeFactory"/> | ||
| <entry key="node-name" type="xstring" value="Model to Binary Object"/> | ||
| <entry key="node-bundle-name" type="xstring" value="KNIME File Handling Nodes"/> | ||
| <entry key="node-bundle-symbolic-name" type="xstring" value="org.knime.base.filehandling"/> | ||
| <entry key="node-bundle-vendor" type="xstring" value="KNIME AG, Zurich, Switzerland"/> | ||
| <entry key="node-bundle-version" type="xstring" value="5.11.0.v202603201205"/> | ||
| <entry key="node-feature-name" type="xstring" isnull="true" value=""/> | ||
| <entry key="node-feature-symbolic-name" type="xstring" isnull="true" value=""/> | ||
| <entry key="node-feature-vendor" type="xstring" isnull="true" value=""/> | ||
| <entry key="node-feature-version" type="xstring" value="0.0.0"/> | ||
| <config key="factory_settings"/> | ||
| <entry key="name" type="xstring" value="Model to Binary Object"/> | ||
| <entry key="hasContent" type="xboolean" value="false"/> | ||
| <entry key="isInactive" type="xboolean" value="false"/> | ||
| <config key="ports"> | ||
| <config key="port_1"> | ||
| <entry key="index" type="xint" value="1"/> | ||
| <entry key="port_dir_location" type="xstring" isnull="true" value=""/> | ||
| </config> | ||
| </config> | ||
| <config key="filestores"> | ||
| <entry key="file_store_location" type="xstring" isnull="true" value=""/> | ||
| <entry key="file_store_id" type="xstring" isnull="true" value=""/> | ||
| </config> | ||
| </config> |
42 changes: 42 additions & 0 deletions
42
....base.filehandling.binaryobjects.model.to.port.ModelToBinaryObjectNodeParametersTest.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "data" : { | ||
| "model" : { | ||
| "columnName" : "" | ||
| } | ||
| }, | ||
| "schema" : { | ||
| "type" : "object", | ||
| "properties" : { | ||
| "model" : { | ||
| "type" : "object", | ||
| "properties" : { | ||
| "columnName" : { | ||
| "type" : "string", | ||
| "title" : "New column name", | ||
| "description" : "Name of the new column.", | ||
| "default" : "" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "ui_schema" : { | ||
| "elements" : [ { | ||
| "type" : "Control", | ||
| "scope" : "#/properties/model/properties/columnName" | ||
| } ] | ||
| }, | ||
| "persist" : { | ||
| "type" : "object", | ||
| "properties" : { | ||
| "model" : { | ||
| "type" : "object", | ||
| "properties" : { | ||
| "columnName" : { | ||
| "configKey" : "columnname" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
4 changes: 4 additions & 0 deletions
4
...ling.binaryobjects.model.to.port.ModelToBinaryObjectNodeParametersTest0.settings.xml.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <config xmlns="http://www.knime.org/2008/09/XMLConfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.knime.org/2008/09/XMLConfig http://www.knime.org/XMLConfig_2008_09.xsd" key="test"> | ||
| <entry key="columnname" type="xstring" value="model"/> | ||
| </config> |
42 changes: 42 additions & 0 deletions
42
...base.filehandling.binaryobjects.model.to.port.ModelToBinaryObjectNodeParametersTest1.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "data" : { | ||
| "model" : { | ||
| "columnName" : "model" | ||
| } | ||
| }, | ||
| "schema" : { | ||
| "type" : "object", | ||
| "properties" : { | ||
| "model" : { | ||
| "type" : "object", | ||
| "properties" : { | ||
| "columnName" : { | ||
| "type" : "string", | ||
| "title" : "New column name", | ||
| "description" : "Name of the new column.", | ||
| "default" : "" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "ui_schema" : { | ||
| "elements" : [ { | ||
| "type" : "Control", | ||
| "scope" : "#/properties/model/properties/columnName" | ||
| } ] | ||
| }, | ||
| "persist" : { | ||
| "type" : "object", | ||
| "properties" : { | ||
| "model" : { | ||
| "type" : "object", | ||
| "properties" : { | ||
| "columnName" : { | ||
| "configKey" : "columnname" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
92 changes: 92 additions & 0 deletions
92
.../base/filehandling/binaryobjects/model/to/port/ModelToBinaryObjectNodeParametersTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| /* | ||
| * ------------------------------------------------------------------------ | ||
| * | ||
| * Copyright by KNIME AG, Zurich, Switzerland | ||
| * Website: http://www.knime.com; Email: contact@knime.com | ||
| * | ||
| * This program is free software; you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License, Version 3, as | ||
| * published by the Free Software Foundation. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, but | ||
| * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program; if not, see <http://www.gnu.org/licenses>. | ||
| * | ||
| * Additional permission under GNU GPL version 3 section 7: | ||
| * | ||
| * KNIME interoperates with ECLIPSE solely via ECLIPSE's plug-in APIs. | ||
| * Hence, KNIME and ECLIPSE are both independent programs and are not | ||
| * derived from each other. Should, however, the interpretation of the | ||
| * GNU GPL Version 3 ("License") under any applicable laws result in | ||
| * KNIME and ECLIPSE being a combined program, KNIME AG herewith grants | ||
| * you the additional permission to use and propagate KNIME together with | ||
| * ECLIPSE with only the license terms in place for ECLIPSE applying to | ||
| * ECLIPSE and the GNU GPL Version 3 applying for KNIME, provided the | ||
| * license terms of ECLIPSE themselves allow for the respective use and | ||
| * propagation of ECLIPSE together with KNIME. | ||
| * | ||
| * Additional permission relating to nodes for KNIME that extend the Node | ||
| * Extension (and in particular that are based on subclasses of NodeModel, | ||
| * NodeDialog, and NodeView) and that only interoperate with KNIME through | ||
| * standard APIs ("Nodes"): | ||
| * Nodes are deemed to be separate and independent programs and to not be | ||
| * covered works. Notwithstanding anything to the contrary in the | ||
| * License, the License does not apply to Nodes, you are not required to | ||
| * license Nodes under the License, and you are granted a license to | ||
| * prepare and propagate Nodes, in each case even if such Nodes are | ||
| * propagated with or for interoperation with KNIME. The owner of a Node | ||
| * may freely choose the license terms applicable to such Node, including | ||
| * when such Node is propagated with or for interoperation with KNIME. | ||
| * ------------------------------------------------------------------------ | ||
| */ | ||
|
|
||
| package org.knime.base.filehandling.binaryobjects.model.to.port; | ||
|
|
||
| import java.io.FileInputStream; | ||
| import java.io.IOException; | ||
|
|
||
| import org.knime.core.node.InvalidSettingsException; | ||
| import org.knime.core.node.NodeSettings; | ||
| import org.knime.core.webui.node.dialog.SettingsType; | ||
| import org.knime.core.webui.node.dialog.defaultdialog.NodeParametersUtil; | ||
| import org.knime.testing.node.dialog.DefaultNodeSettingsSnapshotTest; | ||
| import org.knime.testing.node.dialog.SnapshotTestConfiguration; | ||
|
|
||
| /** | ||
| * Snapshot test for {@link ModelToBinaryObjectNodeParameters}. | ||
| * | ||
| * @author Tim Crundall, TNG Technology Consulting GmbH | ||
| */ | ||
| @SuppressWarnings({"restriction", "javadoc"}) | ||
| final class ModelToBinaryObjectNodeParametersTest extends DefaultNodeSettingsSnapshotTest { | ||
|
|
||
| ModelToBinaryObjectNodeParametersTest() { | ||
| super(getConfig()); | ||
| } | ||
|
|
||
| private static SnapshotTestConfiguration getConfig() { | ||
| return SnapshotTestConfiguration.builder() // | ||
| .testJsonFormsForModel(ModelToBinaryObjectNodeParameters.class) // | ||
| .testJsonFormsWithInstance(SettingsType.MODEL, () -> readSettings()) // | ||
| .testNodeSettingsStructure(() -> readSettings()) // | ||
| .build(); | ||
| } | ||
|
|
||
| private static ModelToBinaryObjectNodeParameters readSettings() { | ||
| try { | ||
| var path = getSnapshotPath(ModelToBinaryObjectNodeParameters.class).getParent().resolve("node_settings") | ||
| .resolve("ModelToBinaryObjectNodeParameters.xml"); | ||
| try (var fis = new FileInputStream(path.toFile())) { | ||
| var nodeSettings = NodeSettings.loadFromXML(fis); | ||
| return NodeParametersUtil.loadSettings(nodeSettings.getNodeSettings(SettingsType.MODEL.getConfigKey()), | ||
| ModelToBinaryObjectNodeParameters.class); | ||
| } | ||
| } catch (IOException | InvalidSettingsException e) { | ||
| throw new IllegalStateException(e); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
...rg/knime/base/filehandling/binaryobjects/model/to/port/ModelToBinaryObjectNodeFactory.xml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small thing: put the imports in the right order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done