how can I correctly handle the knime URLs like
knime://LOCAL/workflow_group/test.xlsx
knime://knime.mountpoint/workflow_group/test.xlsx
in combination with the DialogComponentFileChooser component?
is there a good example workflow to check how to handle these URLs?
->I write out the file selected by the user. Normal system paths in the user input work just fine - but for the knime urls i am not quite sure.
@ScottF not quite sure about your shift from KNIME Development → Knime Analytics Platform… isn’t the Development forum for questions regarding the development of own nodes?
Sorry if i missed something - but to be clear this is a question regarding the implementation of my own node
with the new filehandling framework that we have stabilized with KNIME 4.3 we no longer encourage the use of knime:// urls, instead we recommend using the new Path variable/ cell type to define locations to read from/ write to.
However I could not get the portsConfig / PortsConfiguration working in the SettingsModelWriterFileChooser (null seems not to be allowed)
How would I set the ports config in the above example?
I looked into the POI Excel Writer Node - but could not figure out how to apply it to the basic NumberFormatter example
thanks again - this worked
However I changed it afterwards to a “SettingsModelFileChooser2”
(it seemed more intuitive - and hopefully needs less project changes to support older KNIME Verions…)
As the FileChooserHelper does exactly what I wanted to do
final SettingsModelFileChooser2 outputFilePathModel2 = TemplateXLSXNodeModel.createOutputFilePath2SettingsModel();
final FlowVariableModel tplfvm = createFlowVariableModel(
new String[]{outputFilePathModel2.getConfigName(),
SettingsModelFileChooser2.PATH_OR_URL_KEY},
Type.STRING);
addDialogComponent(new DialogComponentFileChooser2(0, outputFilePathModel2, "XLSoutput", JFileChooser.SAVE_DIALOG,
JFileChooser.FILES_ONLY, tplfvm));
FileChooserHelper fileHelperOutput = new FileChooserHelper(m_fs, m_outputfilePath2, defaulttimeoutInSeconds * 1000);
Path pathOutput = fileHelperOutput.getPathFromSettings();