From 2049681c256ec44dd179f49043f5f8ea01b97d3d Mon Sep 17 00:00:00 2001 From: Nicolas Adment <39568358+nadment@users.noreply.github.com> Date: Sun, 14 Jul 2024 16:06:43 +0200 Subject: [PATCH 1/2] Fix readme.txt --- assemblies/static/src/main/resources/README.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assemblies/static/src/main/resources/README.txt b/assemblies/static/src/main/resources/README.txt index 221bcf905b3..9dd0e9ebe9e 100644 --- a/assemblies/static/src/main/resources/README.txt +++ b/assemblies/static/src/main/resources/README.txt @@ -20,7 +20,7 @@ When you have a question you can use our mailing list (http://hop.apache.org/com Installation Instruction: - - Have a recent Java 8 Runtime + - Have a recent Java 17 Runtime Windows: - To start the GUI run hop-gui.bat From 16a08424ae044f7e476f800ba8c85dbbca14db73 Mon Sep 17 00:00:00 2001 From: Nicolas Adment <39568358+nadment@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:12:44 +0200 Subject: [PATCH 2/2] Normalize file name for Workflow and Pipeline #4131 --- .../file/pipeline/HopPipelineFileType.java | 21 ++++++++++++------- .../file/workflow/HopWorkflowFileType.java | 18 ++++++++++++---- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopPipelineFileType.java b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopPipelineFileType.java index c794791cee0..5d5fd473ba0 100644 --- a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopPipelineFileType.java +++ b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopPipelineFileType.java @@ -27,6 +27,7 @@ import org.apache.hop.core.file.IHasFilename; import org.apache.hop.core.gui.plugin.action.GuiAction; import org.apache.hop.core.gui.plugin.action.GuiActionType; +import org.apache.hop.core.logging.LogChannel; import org.apache.hop.core.variables.IVariables; import org.apache.hop.core.xml.XmlHandler; import org.apache.hop.history.AuditManager; @@ -35,8 +36,10 @@ import org.apache.hop.ui.core.dialog.ErrorDialog; import org.apache.hop.ui.core.gui.HopNamespace; import org.apache.hop.ui.hopgui.HopGui; +import org.apache.hop.ui.hopgui.HopGuiExtensionPoint; import org.apache.hop.ui.hopgui.context.GuiContextHandler; import org.apache.hop.ui.hopgui.context.IGuiContextHandler; +import org.apache.hop.ui.hopgui.delegates.HopGuiFileOpenedExtension; import org.apache.hop.ui.hopgui.file.HopFileTypeBase; import org.apache.hop.ui.hopgui.file.HopFileTypePlugin; import org.apache.hop.ui.hopgui.file.IHopFileType; @@ -112,14 +115,21 @@ public Properties getCapabilities() { } @Override - public IHopFileTypeHandler openFile( - HopGui hopGui, String filename, IVariables parentVariableSpace) throws HopException { + public IHopFileTypeHandler openFile(HopGui hopGui, String filename, IVariables variables) + throws HopException { try { // This file is opened in the data orchestration perspective // HopDataOrchestrationPerspective perspective = HopGui.getDataOrchestrationPerspective(); perspective.activate(); + // Normalize the filename into a relative path... + // + HopGuiFileOpenedExtension ext = new HopGuiFileOpenedExtension(null, variables, filename); + ExtensionPointHandler.callExtensionPoint( + LogChannel.UI, variables, HopGuiExtensionPoint.HopGuiFileOpenedDialog.id, ext); + filename = variables.resolve(ext.filename); + // See if the same pipeline isn't already open. // Other file types we might allow to open more than once but not pipelines for now. // @@ -136,7 +146,7 @@ public IHopFileTypeHandler openFile( // Load the pipeline // PipelineMeta pipelineMeta = - new PipelineMeta(filename, hopGui.getMetadataProvider(), parentVariableSpace); + new PipelineMeta(filename, hopGui.getMetadataProvider(), variables); // Pass the MetaStore for reference lookups // @@ -153,10 +163,7 @@ public IHopFileTypeHandler openFile( // Inform those that want to know about it that we loaded a pipeline // ExtensionPointHandler.callExtensionPoint( - hopGui.getLog(), - parentVariableSpace, - HopExtensionPoint.PipelineAfterOpen.id, - pipelineMeta); + hopGui.getLog(), variables, HopExtensionPoint.PipelineAfterOpen.id, pipelineMeta); return typeHandler; } catch (Exception e) { diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopWorkflowFileType.java b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopWorkflowFileType.java index 0f3cef9f1ab..42bf75037a3 100644 --- a/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopWorkflowFileType.java +++ b/ui/src/main/java/org/apache/hop/ui/hopgui/file/workflow/HopWorkflowFileType.java @@ -26,6 +26,7 @@ import org.apache.hop.core.file.IHasFilename; import org.apache.hop.core.gui.plugin.action.GuiAction; import org.apache.hop.core.gui.plugin.action.GuiActionType; +import org.apache.hop.core.logging.LogChannel; import org.apache.hop.core.variables.IVariables; import org.apache.hop.core.xml.XmlHandler; import org.apache.hop.history.AuditManager; @@ -33,8 +34,10 @@ import org.apache.hop.ui.core.dialog.ErrorDialog; import org.apache.hop.ui.core.gui.HopNamespace; import org.apache.hop.ui.hopgui.HopGui; +import org.apache.hop.ui.hopgui.HopGuiExtensionPoint; import org.apache.hop.ui.hopgui.context.GuiContextHandler; import org.apache.hop.ui.hopgui.context.IGuiContextHandler; +import org.apache.hop.ui.hopgui.delegates.HopGuiFileOpenedExtension; import org.apache.hop.ui.hopgui.file.HopFileTypeBase; import org.apache.hop.ui.hopgui.file.HopFileTypePlugin; import org.apache.hop.ui.hopgui.file.IHopFileType; @@ -114,14 +117,21 @@ public Properties getCapabilities() { } @Override - public IHopFileTypeHandler openFile( - HopGui hopGui, String filename, IVariables parentVariableSpace) throws HopException { + public IHopFileTypeHandler openFile(HopGui hopGui, String filename, IVariables variables) + throws HopException { try { // This file is opened in the data orchestration perspective // HopDataOrchestrationPerspective perspective = HopGui.getDataOrchestrationPerspective(); perspective.activate(); + // Normalize the filename into a relative path... + // + HopGuiFileOpenedExtension ext = new HopGuiFileOpenedExtension(null, variables, filename); + ExtensionPointHandler.callExtensionPoint( + LogChannel.UI, variables, HopGuiExtensionPoint.HopGuiFileOpenedDialog.id, ext); + filename = variables.resolve(ext.filename); + // See if the same workflow isn't already open. // Other file types we might allow to open more than once but not workflows for now. // @@ -138,7 +148,7 @@ public IHopFileTypeHandler openFile( // Load the workflow from file // WorkflowMeta workflowMeta = - new WorkflowMeta(parentVariableSpace, filename, hopGui.getMetadataProvider()); + new WorkflowMeta(variables, filename, hopGui.getMetadataProvider()); // Pass the MetaStore for reference lookups // @@ -151,7 +161,7 @@ public IHopFileTypeHandler openFile( // Inform those that want to know about it that we loaded a pipeline // ExtensionPointHandler.callExtensionPoint( - hopGui.getLog(), parentVariableSpace, "WorkflowAfterOpen", workflowMeta); + hopGui.getLog(), variables, "WorkflowAfterOpen", workflowMeta); // Show it in the perspective //