public void fillOptionsAndCodesByPlugins( List<PluginInterface> plugins ) { int pluginIndex = 0; for ( PluginInterface plugin : plugins ) { options[ StepPartitioningMeta.methodDescriptions.length + pluginIndex ] = plugin.getDescription(); codes[ StepPartitioningMeta.methodCodes.length + pluginIndex ] = plugin.getIds()[ 0 ]; pluginIndex++; } }
/** * Find the plugin ID based on the description of the plugin * * @param pluginType the type of plugin * @param pluginDescription The description to look for * @return The plugin with the specified description or null if nothing was found. */ public PluginInterface findPluginWithDescription( Class<? extends PluginTypeInterface> pluginType, String pluginDescription ) { return getPlugins( pluginType ).stream() .filter( plugin -> plugin.getDescription().equals( pluginDescription ) ) .findFirst() .orElse( null ); }
private KettleURLClassLoader createClassLoader( PluginInterface plugin ) throws MalformedURLException, UnsupportedEncodingException { List<String> jarFiles = plugin.getLibraries(); URL[] urls = new URL[jarFiles.size()]; for ( int i = 0; i < jarFiles.size(); i++ ) { File jarfile = new File( jarFiles.get( i ) ); urls[i] = new URL( URLDecoder.decode( jarfile.toURI().toURL().toString(), "UTF-8" ) ); } ClassLoader classLoader = getClass().getClassLoader(); String[] patterns = parentClassloaderPatternMap.get( plugin ); if ( patterns != null ) { return new KettleSelectiveParentFirstClassLoader( urls, classLoader, plugin.getDescription(), patterns ); } else { return new KettleURLClassLoader( urls, classLoader, plugin.getDescription() ); } }
public String getXML() { StringBuilder xml = new StringBuilder(); xml.append( XMLHandler.openTag( XML_TAG ) ).append( Const.CR ).append( Const.CR ); for ( ImportRuleInterface rule : getRules() ) { PluginInterface plugin = PluginRegistry.getInstance().getPlugin( ImportRulePluginType.class, rule.getId() ); xml.append( "<!-- " ).append( plugin.getName() ).append( " : " ).append( plugin.getDescription() ).append( Const.CR ).append( " -->" ).append( Const.CR ); xml.append( rule.getXML() ); xml.append( Const.CR ).append( Const.CR ); } xml.append( XMLHandler.closeTag( XML_TAG ) ); return xml.toString(); }
/** * Gets the plug-in type description * * @return the plug-in type description */ public String getTypeDesc() { PluginInterface plugin = PluginRegistry.getInstance().findPluginWithId( JobEntryPluginType.class, configId ); return plugin.getDescription(); }
@SuppressWarnings( "unchecked" ) public String getPlugins() { List<PluginInterface> plugins = pluginRegistry.getPlugins( RepositoryPluginType.class ); JSONArray list = new JSONArray(); for ( PluginInterface pluginInterface : plugins ) { if ( !pluginInterface.getIds()[0].equals( "PentahoEnterpriseRepository" ) ) { JSONObject repoJSON = new JSONObject(); repoJSON.put( "id", pluginInterface.getIds()[ 0 ] ); repoJSON.put( "name", pluginInterface.getName() ); repoJSON.put( "description", pluginInterface.getDescription() ); list.add( repoJSON ); } } return list.toString(); }
/** * @return entry in JobEntryInterface.typeCode[] for native jobs, entry.getTypeCode() for plugins */ public String getTypeDesc() { PluginInterface plugin = PluginRegistry.getInstance().findPluginWithId( JobEntryPluginType.class, entry.getPluginId() ); return plugin.getDescription(); }
private void addStepItem( final TreeItem categoryItem, final PluginInterface step ) { final Image stepImage = GUIResource.getInstance().getImagesStepsSmall().get( step.getIds()[ 0 ] ); String pluginName = step.getName(); String pluginDescription = step.getDescription(); if ( filterMatch( pluginName ) || filterMatch( pluginDescription ) ) { createTreeItem( categoryItem, pluginName, stepImage, step.getIds()[ 0 ] ); coreStepToolTipMap.put( pluginName, pluginDescription ); } }
public RowDistributionInterface askUserForCustomDistributionMethod() { List<PluginInterface> plugins = PluginRegistry.getInstance().getPlugins( RowDistributionPluginType.class ); if ( Utils.isEmpty( plugins ) ) { return null; } List<String> choices = new ArrayList<>(); for ( PluginInterface plugin : plugins ) { choices.add( plugin.getName() + " : " + plugin.getDescription() ); } EnterSelectionDialog dialog = new EnterSelectionDialog( shell, choices.toArray( new String[ choices.size() ] ), "Select distribution method", "Please select the row distribution method:" ); if ( dialog.open() != null ) { PluginInterface plugin = plugins.get( dialog.getSelectionNr() ); try { return (RowDistributionInterface) PluginRegistry.getInstance().loadClass( plugin ); } catch ( Exception e ) { new ErrorDialog( shell, "Error", "Error loading row distribution plugin class", e ); return null; } } else { return null; } }
String[] names = new String[plugins.size()]; for ( int i = 0; i < plugins.size(); i++ ) { names[i] = plugins.get( i ).getName() + " : " + plugins.get( i ).getDescription();
PluginInterface dbPlugin = PluginRegistry.getInstance().getPlugin( DatabasePluginType.class, meta.getDatabaseMeta().getDatabaseInterface() ); data.dbDescription = ( dbPlugin != null ) ? dbPlugin.getDescription() : BaseMessages.getString( PKG, "MySQLBulkLoader.UnknownDB" );
/** * @param pluginType the type of plugin to get information for * @return a row buffer containing plugin information for the given plugin type * @throws KettlePluginException */ public RowBuffer getPluginInformation( Class<? extends PluginTypeInterface> pluginType ) throws KettlePluginException { RowBuffer rowBuffer = new RowBuffer( getPluginInformationRowMeta() ); for ( PluginInterface plugin : getPlugins( pluginType ) ) { Object[] row = new Object[getPluginInformationRowMeta().size()]; int rowIndex = 0; row[rowIndex++] = getPluginType( plugin.getPluginType() ).getName(); row[rowIndex++] = plugin.getIds()[0]; row[rowIndex++] = plugin.getName(); row[rowIndex++] = Const.NVL( plugin.getDescription(), "" ); row[rowIndex++] = Utils.isEmpty( plugin.getLibraries() ) ? "" : plugin.getLibraries().toString(); row[rowIndex++] = Const.NVL( plugin.getImageFile(), "" ); row[rowIndex++] = plugin.getClassMap().values().toString(); row[rowIndex] = Const.NVL( plugin.getCategory(), "" ); rowBuffer.getBuffer().add( row ); } return rowBuffer; }
for ( int i = 0; i < names.length; i++ ) { PluginInterface plugin = plugins.get( i ); names[i] = plugin.getName() + " - " + plugin.getDescription();
GUIResource.getInstance().getImagesSteps().get( stepPlugin.getIds()[0] ).getAsBitmapForSize( display, ConstUI.MEDIUM_ICON_SIZE, ConstUI.MEDIUM_ICON_SIZE ); String pluginName = Const.NVL( stepPlugin.getName(), "" ); String pluginDescription = Const.NVL( stepPlugin.getDescription(), "" ); coreStepToolTipMap.put( stepPlugin.getDescription(), pluginDescription + " (" + usage.getNrUses() + ")" ); GUIResource.getInstance().getImagesJobentriesSmall().get( baseJobEntries.get( j ).getIds()[0] ); String pluginName = Const.NVL( baseJobEntries.get( j ).getName(), "" ); String pluginDescription = Const.NVL( baseJobEntries.get( j ).getDescription(), "" );
KettleDatabaseRepository.FIELD_STEP_TYPE_DESCRIPTION ), sp.getName() ); table.addValue( new ValueMetaString( KettleDatabaseRepository.FIELD_STEP_TYPE_HELPTEXT ), sp.getDescription() );