plugins/misc/projects/src/main/java/org/apache/hop/projects/util/ProjectsUtil.java
public static void enableProject( ILogChannel log, String projectName, Project project, IVariables variables, List<String> configurationFiles, String environmentName, IHasHopMetadataProvider hasHopMetadataProvider ) throws HopException {

    ProjectsConfig config = ProjectsConfigSingleton.getConfig();

    ProjectConfig projectConfig = config.findProjectConfig( projectName );
    if ( projectConfig == null ) {
      throw new HopException( "Error enabling project " + projectName + ": it is not configured." );
    }

    // Variable system variables but also apply them to variables
    // We'll use those to change the loaded variables in HopGui
    //
    project.modifyVariables( variables, projectConfig, configurationFiles, environmentName );

    // Change the metadata provider in the GUI
    //
    if ( hasHopMetadataProvider != null ) {
      hasHopMetadataProvider.setMetadataProvider( HopMetadataUtil.getStandardHopMetadataProvider( variables ) );
    }

    // We store the project in the namespace singleton (used mainly in the GUI)
    //
    HopNamespace.setNamespace( projectName );

    // Save some history concerning the usage of the project...
    //
    AuditManager.registerEvent(
      HopGui.DEFAULT_HOP_GUI_NAMESPACE,
      STRING_PROJECT_AUDIT_TYPE,
      projectName,
      "open"
      );

    // Signal others that we have a new active project
    //
    ExtensionPointHandler.callExtensionPoint( log, variables, Defaults.EXTENSION_POINT_PROJECT_ACTIVATED, projectName );
  }
/**
   * Enable the specified project
   * Force reload of a number of settings
   *
   * @param log                the log channel to log to
   * @param projectName
   * @param project
   * @param variables
   * @param configurationFiles
   * @throws HopException
   * @throws HopException
   */
Enable the specified project
Force reload of a number of settings


Enable the specified project Force reload of a number of settings
public static void enableProject( ILogChannel log, String projectName, Project project, IVariables variables, List<String> configurationFiles, String environmentName, IHasHopMetadataProvider hasHopMetadataProvider ) throws HopException {
    ProjectsConfig config = ProjectsConfigSingleton.getConfig();
    ProjectConfig projectConfig = config.findProjectConfig( projectName );
    if ( projectConfig == null ) {
      throw new HopException( "Error enabling project " + projectName + ": it is not configured." );
    }
    project.modifyVariables( variables, projectConfig, configurationFiles, environmentName );
     Change the metadata provider in the GUI
    if ( hasHopMetadataProvider != null ) {
      hasHopMetadataProvider.setMetadataProvider( HopMetadataUtil.getStandardHopMetadataProvider( variables ) );
    }
     We store the project in the namespace singleton (used mainly in the GUI)
    HopNamespace.setNamespace( projectName );
     Save some history concerning the usage of the project...
    AuditManager.registerEvent(
      HopGui.DEFAULT_HOP_GUI_NAMESPACE,
      STRING_PROJECT_AUDIT_TYPE,
      projectName,
      "open"
      );
     Signal others that we have a new active project
    ExtensionPointHandler.callExtensionPoint( log, variables, Defaults.EXTENSION_POINT_PROJECT_ACTIVATED, projectName );
  }
public static void enableProject ( ILogChannel log , String projectName , Project project , IVariables variables , List < String > configurationFiles , String environmentName , IHasHopMetadataProvider hasHopMetadataProvider ) throws HopException { ProjectsConfig config = ProjectsConfigSingleton . getConfig ( ) ; ProjectConfig projectConfig = config . findProjectConfig ( projectName ) ; if ( projectConfig == null ) { throw new HopException ( "Error enabling project " + projectName + ": it is not configured." ) ; } project . modifyVariables ( variables , projectConfig , configurationFiles , environmentName ) ; if ( hasHopMetadataProvider != null ) { hasHopMetadataProvider . setMetadataProvider ( HopMetadataUtil . getStandardHopMetadataProvider ( variables ) ) ; } HopNamespace . setNamespace ( projectName ) ; AuditManager . registerEvent ( HopGui . DEFAULT_HOP_GUI_NAMESPACE , STRING_PROJECT_AUDIT_TYPE , projectName , "open" ) ; ExtensionPointHandler . callExtensionPoint ( log , variables , Defaults . EXTENSION_POINT_PROJECT_ACTIVATED , projectName ) ; }
Enable the specified project
 Force reload of a number of settings
Enable the specified project Force reload of a number of settings
// Variable system variables but also apply them to variables // We'll use those to change the loaded variables in HopGui // // Change the metadata provider in the GUI // // We store the project in the namespace singleton (used mainly in the GUI) // // Save some history concerning the usage of the project... // // Signal others that we have a new active project //