Skip to content

Commit

Permalink
Merge pull request #2630 from pentaho/feature/named-cluster-dialog
Browse files Browse the repository at this point in the history
[PPP-5174]   End-of-Life: AngularJS 1.8.0 Pentaho Data Integration - Update Hadoop Addon to contain SWT version of hadoop cluster dialog
  • Loading branch information
rmansoor authored Sep 30, 2024
2 parents 6ee24f4 + 42658b7 commit a401713
Show file tree
Hide file tree
Showing 103 changed files with 3,350 additions and 5,309 deletions.
7 changes: 0 additions & 7 deletions assemblies/features/src/main/feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@
<feature name="pentaho-hadoop-cluster-ui" version="1.0">
<bundle>mvn:org.pentaho.di.plugins/core-ui/${project.version}</bundle>
<bundle>mvn:pentaho/hadoop-cluster-ui/${project.version}</bundle>
<bundle>pentaho-webjars:mvn:org.webjars.bower/angular/${angular.version}</bundle>
<bundle>pentaho-webjars:mvn:org.webjars.bower/angular-animate/${angular.version}</bundle>
<bundle>pentaho-webjars:mvn:org.webjars.bower/angular-i18n/${angular.version}</bundle>
<bundle>pentaho-webjars:mvn:org.webjars.bower/requirejs-text/${requirejs-text.version}</bundle>
<bundle>pentaho-webjars:mvn:org.webjars.npm/uirouter__core/${uirouter-core.version}</bundle>
<bundle>pentaho-webjars:mvn:org.webjars.npm/uirouter__angularjs/${uirouter-angularjs.version}</bundle>
<bundle>pentaho-webjars:mvn:org.webjars.npm/jquery/${jquery.version}</bundle>
<bundle>mvn:commons-fileupload/commons-fileupload/${commons-fileupload.version}</bundle>
</feature>

Expand Down
14 changes: 0 additions & 14 deletions kettle-plugins/hadoop-cluster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
<dependency.karaf.version>3.0.3</dependency.karaf.version>
<dependency.osgi.version>4.3.1</dependency.osgi.version>
<version.for.license>${project.version}</version.for.license>
<js.project.list>prantlf__requirejs,requirejs-text,angular,require-css,angular-i18n</js.project.list>
<pentaho-osgi-bundles.version>10.3.0.0-SNAPSHOT</pentaho-osgi-bundles.version>
<platform.version>10.3.0.0-SNAPSHOT</platform.version>
<cxf.karaf.version>3.0.13</cxf.karaf.version>
<require-css.version>0.1.8</require-css.version>
<swt.version>4.6</swt.version>
<dependency.javax.servlet-api.version>3.0.1</dependency.javax.servlet-api.version>
<dependency.javax.ws.rs-api.version>2.0</dependency.javax.ws.rs-api.version>
Expand Down Expand Up @@ -112,18 +110,6 @@
<version>${swt.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>requirejs-text</artifactId>
<version>${requirejs-text.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>require-css</artifactId>
<version>${require-css.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.pentaho.di.plugins</groupId>
<artifactId>core-ui</artifactId>
Expand Down
40 changes: 0 additions & 40 deletions kettle-plugins/hadoop-cluster/ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.gtk.linux.x86_64</artifactId>
</dependency>
<dependency>
<!--this is required by OSGi bean declared in src/main/resources-filtered/OSGI-INF/blueprint/blueprint.xml-->
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.web</groupId>
<artifactId>pax-web-spi</artifactId>
Expand All @@ -116,32 +110,6 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>prantlf__requirejs</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular</artifactId>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>angular-i18n</artifactId>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>requirejs-text</artifactId>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>require-css</artifactId>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>jquery</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
Expand Down Expand Up @@ -198,7 +166,6 @@
<excludes>
<exclude>META-INF/**/*</exclude>
<exclude>OSGI-INF/**/*</exclude>
<exclude>app/index.html</exclude>
</excludes>
</resource>
<resource>
Expand All @@ -207,13 +174,6 @@
<includes>
<include>META-INF/**/*</include>
<include>OSGI-INF/**/*</include>
<include>app/index.html</include>
</includes>
</resource>
<resource>
<directory>src/main/javascript</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,56 @@

package org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.dialog;

import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.dialog.wizard.AddDriverDialog;
import org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.dialog.wizard.NamedClusterDialog;
import org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.dialog.wizard.util.CustomWizardDialog;
import org.pentaho.di.base.AbstractMeta;
import org.pentaho.di.core.logging.KettleLogStore;
import org.pentaho.di.core.logging.LogChannelInterface;
import org.pentaho.di.core.service.PluginServiceLoader;
import org.pentaho.di.ui.spoon.Spoon;
import org.pentaho.hadoop.shim.api.cluster.NamedClusterService;
import org.pentaho.metastore.api.IMetaStore;
import org.pentaho.metastore.locator.api.MetastoreLocator;
import org.pentaho.runtime.test.RuntimeTester;

import java.util.Collection;
import java.util.Map;
import java.util.function.Supplier;

public class HadoopClusterDelegate {

private static final Class<?> PKG = HadoopClusterDelegate.class;
private Supplier<Spoon> spoonSupplier = Spoon::getInstance;
private final Supplier<Spoon> spoonSupplier = Spoon::getInstance;

private static final int WIDTH = 630;
private static final int HEIGHT = 650;
private final RuntimeTester runtimeTester;
private final NamedClusterService namedClusterService;

public void openDialog( String thinAppState, Map<String, String> urlParams ) {
HadoopClusterDialog hadoopClusterDialog = new HadoopClusterDialog( spoonSupplier.get().getShell(), WIDTH, HEIGHT );
hadoopClusterDialog.open(
BaseMessages.getString( PKG, "HadoopCluster.dialog.title" ), thinAppState, urlParams );
private static final LogChannelInterface log =
KettleLogStore.getLogChannelInterfaceFactory().create( "HadoopClusterDelegate" );

public HadoopClusterDelegate( NamedClusterService clusterService, RuntimeTester tester ) {
namedClusterService = clusterService;
runtimeTester = tester;
}

public void openDialog( String dialogState, Map<String, String> urlParams ) {
try {
Collection<MetastoreLocator> metastoreLocators = PluginServiceLoader.loadServices( MetastoreLocator.class );
IMetaStore metastore = metastoreLocators.stream().findFirst().get().getMetastore();
if ( dialogState.equals( "add-driver" ) ) {
CustomWizardDialog wizardDialog =
new CustomWizardDialog( spoonSupplier.get().getShell(),
new AddDriverDialog( (AbstractMeta) spoonSupplier.get().getActiveMeta(), namedClusterService, metastore ) );
wizardDialog.open();
} else {
CustomWizardDialog wizardDialog = new CustomWizardDialog( spoonSupplier.get().getShell(),
new NamedClusterDialog( namedClusterService, metastore, (AbstractMeta) spoonSupplier.get().getActiveMeta(),
runtimeTester, urlParams, dialogState ) );
wizardDialog.open();
}
} catch ( Exception e ) {
log.logError( e.getMessage() );
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*! ******************************************************************************
*
* Pentaho Data Integration
*
* Copyright (C) 2019 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/

package org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.dialog.wizard;

import org.eclipse.jface.wizard.Wizard;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
//import org.pentaho.big.data.impl.cluster.NamedClusterManager;
import org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.dialog.wizard.pages.AddDriverPage;
import org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.dialog.wizard.pages.AddDriverResultPage;
import org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.dialog.wizard.util.CustomWizardDialog;
import org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.dialog.wizard.util.NamedClusterHelper;
import org.pentaho.big.data.kettle.plugins.hadoopcluster.ui.endpoints.HadoopClusterManager;
import org.pentaho.di.core.Props;
import org.pentaho.di.core.logging.KettleLogStore;
import org.pentaho.di.core.logging.LogChannelInterface;
import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.core.variables.Variables;
import org.pentaho.di.metastore.MetaStoreConst;
import org.pentaho.di.ui.core.PropsUI;
import org.pentaho.di.ui.spoon.Spoon;
import org.pentaho.hadoop.shim.api.cluster.NamedClusterService;
import org.pentaho.metastore.api.IMetaStore;

import java.util.function.Supplier;

public class AddDriverDialog extends Wizard {

private AddDriverPage addDriverPage;
private AddDriverResultPage addDriverResultPage;
private final VariableSpace variableSpace;
private final HadoopClusterManager hadoopClusterManager;
private final Supplier<Spoon> spoonSupplier = Spoon::getInstance;
private static final LogChannelInterface log =
KettleLogStore.getLogChannelInterfaceFactory().create( "AddDriverDialog" );

public AddDriverDialog( VariableSpace variables, NamedClusterService namedClusterService, IMetaStore metastore ) {
variableSpace = variables;
hadoopClusterManager = new HadoopClusterManager( spoonSupplier.get(), namedClusterService, metastore, "" );
}

public void addPages() {
addDriverPage = new AddDriverPage( variableSpace );
addPage( addDriverPage );
addDriverResultPage = new AddDriverResultPage( variableSpace );
addPage( addDriverResultPage );
}

public boolean importDriver( String driverFile ) {
boolean result = false;
try {
result = NamedClusterHelper.processDriverFile( driverFile, hadoopClusterManager );
} catch ( Exception e ) {
log.logError( e.getMessage() );
}
return result;
}

public boolean canFinish() {
// Hack to style the CustomWizardDialog.
( (CustomWizardDialog) getContainer() ).style();
// Couldn't be done elsewhere because the "TestResultsPage" was not initialized by the wizard.

String currentPage = super.getContainer().getCurrentPage().getName();
if ( currentPage.equals( addDriverPage.getClass().getSimpleName() ) ) {
( (CustomWizardDialog) getContainer() ).enableCancelButton( true );
}
if ( currentPage.equals( addDriverResultPage.getClass().getSimpleName() ) ) {
( (CustomWizardDialog) getContainer() ).enableCancelButton( false );
}
return addDriverPage.isPageComplete();
}

public boolean performFinish() {
String currentPage = super.getContainer().getCurrentPage().getName();
if ( currentPage.equals( addDriverPage.getClass().getSimpleName() ) ) {
boolean result = importDriver( addDriverPage.getFileName() );
addDriverResultPage.setImportResult( result );
getContainer().showPage( addDriverResultPage );
}
return currentPage.equals( addDriverResultPage.getClass().getSimpleName() );
}

/*
public static void main( String[] args ) {
try {
KettleLogStore.init();
Display display = new Display();
Shell shell = new Shell( display );
PropsUI.init( display, Props.TYPE_PROPERTIES_SPOON );
AddDriverDialog addDriverDialog =
new AddDriverDialog( new Variables(), NamedClusterManager.getInstance(),
MetaStoreConst.openLocalPentahoMetaStore() );
CustomWizardDialog wizardDialog = new CustomWizardDialog( shell, addDriverDialog );
wizardDialog.open();
} catch ( Exception e ) {
log.logError( e.getMessage() );
}
}
*/
}
Loading

0 comments on commit a401713

Please sign in to comment.