This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hop.git


The following commit(s) were added to refs/heads/master by this push:
     new a8af932  HOP-2242 Add ExtensionPoint after project is enabled
     new db265b9  Merge pull request #420 from nadment/HOP-2242
a8af932 is described below

commit a8af932a447da2c9c2fc59862e58552f2d6dcc1f
Author: nadment <[email protected]>
AuthorDate: Fri Nov 27 19:21:34 2020 +0100

    HOP-2242 Add ExtensionPoint after project is enabled
---
 .../java/org/apache/hop/core/extension/HopExtensionPoint.java    | 3 ++-
 .../main/java/org/apache/hop/projects/gui/ProjectsGuiPlugin.java | 9 ++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/core/src/main/java/org/apache/hop/core/extension/HopExtensionPoint.java 
b/core/src/main/java/org/apache/hop/core/extension/HopExtensionPoint.java
index c622adf..ee0b9df 100644
--- a/core/src/main/java/org/apache/hop/core/extension/HopExtensionPoint.java
+++ b/core/src/main/java/org/apache/hop/core/extension/HopExtensionPoint.java
@@ -127,11 +127,12 @@ public enum HopExtensionPoint {
 
   HopGuiPipelineAfterClose("Called after a pipeline is closed in the Hop GUI 
(PipelineMeta)"),
   HopGuiWorkflowAfterClose("Called after a workflow is closed in the Hop GUI 
(WorkflowMeta)"),
-
+  
   GetFieldsExtension( "Get Fields dialog" ),
 
   HopEnvironmentAfterInit("Called after HopEnvironment.init() was called.  It 
allows you to add your own plugins and so on at this time."),
 
+  HopGuiProjectAfterEnabled( "Called after a project is enabled in Hop GUI" )
   ;
 
   public String id;
diff --git 
a/plugins/misc/projects/src/main/java/org/apache/hop/projects/gui/ProjectsGuiPlugin.java
 
b/plugins/misc/projects/src/main/java/org/apache/hop/projects/gui/ProjectsGuiPlugin.java
index 136a04e..61f940b 100644
--- 
a/plugins/misc/projects/src/main/java/org/apache/hop/projects/gui/ProjectsGuiPlugin.java
+++ 
b/plugins/misc/projects/src/main/java/org/apache/hop/projects/gui/ProjectsGuiPlugin.java
@@ -21,15 +21,17 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.hop.core.Const;
 import org.apache.hop.core.config.HopConfig;
 import org.apache.hop.core.exception.HopException;
+import org.apache.hop.core.extension.ExtensionPointHandler;
+import org.apache.hop.core.extension.HopExtensionPoint;
 import org.apache.hop.core.gui.plugin.GuiPlugin;
 import org.apache.hop.core.gui.plugin.toolbar.GuiToolbarElement;
 import org.apache.hop.core.gui.plugin.toolbar.GuiToolbarElementType;
 import org.apache.hop.core.logging.ILogChannel;
+import org.apache.hop.core.logging.LogChannel;
 import org.apache.hop.core.variables.IVariables;
 import org.apache.hop.core.variables.Variables;
 import org.apache.hop.history.AuditEvent;
 import org.apache.hop.history.AuditManager;
-import org.apache.hop.i18n.BaseMessages;
 import org.apache.hop.metadata.api.IHopMetadataProvider;
 import org.apache.hop.metadata.api.IHopMetadataSerializer;
 import org.apache.hop.pipeline.config.PipelineRunConfiguration;
@@ -587,6 +589,11 @@ public class ProjectsGuiPlugin {
         );
         AuditManager.getActive().storeEvent( envUsedEvent );
       }
+      
+      // Inform the outside world that we're enabled an other project
+      //
+      ExtensionPointHandler.callExtensionPoint( LogChannel.GENERAL, 
HopExtensionPoint.HopGuiProjectAfterEnabled.name(), project);
+
     } catch ( Exception e ) {
       throw new HopException( "Error enabling project '" + projectName + "' in 
HopGui", e );
     }

Reply via email to