@Override public String getURL( String hostname, String port, String databaseName ) { if ( getAccessType() == DatabaseMeta.TYPE_ACCESS_ODBC ) { return "jdbc:odbc:" + databaseName; } else { if ( Const.isEmpty( port ) ) { return "jdbc:mariadb://" + hostname + "/" + databaseName; } else { return "jdbc:mariadb://" + hostname + ":" + port + "/" + databaseName; } } }
private boolean isTransformationDefined() { return !Utils.isEmpty( fileName ) || transObjectId != null || ( !Utils.isEmpty( this.directoryPath ) && !Const .isEmpty( transName ) ); }
/** * This method is called when Spoon needs to display the name * of the partitioner on dialogs etc. * * @return a string containing a descriptive string for the partitioner */ public String getDescription() { String description = "String length based demo partitioner"; if ( !Const.isEmpty( fieldName ) ) { description += " (" + fieldName + ")"; } return description; }
protected String decodeAccessKey( String key ) { if ( Const.isEmpty( key ) ) { return key; } return key.replaceAll( "%2B", "\\+" ).replaceAll( "%2F", "/" ); }
public static URL stringToURL( String pathOrURL ) throws MalformedURLException { URL result = null; if ( !Const.isEmpty( pathOrURL ) ) { if ( pathOrURL.toLowerCase().startsWith( "http://" ) || pathOrURL.toLowerCase().startsWith( "file://" ) ) { result = new URL( pathOrURL ); } else { String c = "file://" + pathOrURL; result = new URL( c ); } } return result; }
@Override public String getURL( String hostname, String port, String databaseName ) { if ( Const.isEmpty( port ) ) { port = Integer.toString( getDefaultDatabasePort() ); } return URL_PREFIX + hostname + ":" + port + "/" + databaseName; }
private String summaryMsgKey() { if ( Const.isEmpty( getParentAttribute() ) ) { return "Modeler.CreateAttribute.Summary.noparent"; } return "Modeler.CreateAttribute.Summary"; }
private void ok() { if ( Const.isEmpty( wStepname.getText() ) ) { return; } stepname = wStepname.getText(); // return value getInfo( input ); dispose(); }
private void ok() { if ( Const.isEmpty( wStepname.getText() ) ) { return; } stepname = wStepname.getText(); // return value getInfo( input ); dispose(); }
private void ok() { if ( Const.isEmpty( wStepname.getText() ) ) { return; } getInfo( input ); dispose(); }
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException { if ( !Const.isEmpty( m_incomingKeyField ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, "incoming_key_field", m_incomingKeyField ); } if ( !Const.isEmpty( m_incomingResultField ) ) { rep.saveStepAttribute( id_transformation, id_step, 0, "incoming_result_field", m_incomingResultField ); } namedClusterLoadSaveUtil.saveRep( rep, metaStore, id_transformation, id_step, namedClusterService, namedCluster, log ); if ( m_mapping != null ) { m_mapping.saveRep( rep, id_transformation, id_step ); } }
protected void ok() { if ( Const.isEmpty( m_stepnameText.getText() ) ) { return; } stepname = m_stepnameText.getText(); setMeta( m_currentMeta ); if ( !m_originalMeta.equals( m_currentMeta ) ) { m_currentMeta.setChanged(); changed = m_currentMeta.hasChanged(); } dispose(); }
@Override public String getMissingDatabaseConnectionInformationMessage() { if ( Const.isEmpty( getJobConfig().getDatabase() ) && !Const.isEmpty( getJobConfig().getConnect() ) ) { // We're using advanced configuration, alert the user we cannot visualize unless we're not using a database // managed by Kettle return BaseMessages.getString( AbstractSqoopJobEntry.class, "ErrorMustConfigureDatabaseConnectionFromList" ); } // Use the default error message return null; }
private HierarchyMetaData locateHierarchy( final ModelerWorkspace workspace, final String name ) { for ( DimensionMetaData dimensionMetaData : workspace.getModel().getDimensions() ) { if ( dimensionMetaData.getName().equals( getDimension() ) ) { for ( HierarchyMetaData hierarchyMetaData : dimensionMetaData ) { if ( hierarchyMetaData.getName().equals( Const.isEmpty( name ) ? getDimension() : name ) ) { return hierarchyMetaData; } } } } return null; }
protected FileSystemOptions getFileSystemOptions() throws FileSystemException { FileSystemOptions opts = new FileSystemOptions(); if ( !Const.isEmpty( getAccessKey() ) || !Const.isEmpty( getSecretKey() ) ) { // create a FileSystemOptions with user & password StaticUserAuthenticator userAuthenticator = new StaticUserAuthenticator( null, getVariableSpace().environmentSubstitute( getAccessKey() ), getVariableSpace().environmentSubstitute( getSecretKey() ) ); DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator( opts, userAuthenticator ); } return opts; }
protected void getData() { if ( !Const.isEmpty( m_currentMeta.getIncomingKeyField() ) ) { m_incomingKeyCombo.setText( m_currentMeta.getIncomingKeyField() ); } if ( !Const.isEmpty( m_currentMeta.getIncomingResultField() ) ) { m_incomingResultCombo.setText( m_currentMeta.getIncomingResultField() ); } m_mappingEditor.setSelectedNamedCluster( m_currentMeta.getNamedCluster().getName() ); if ( m_currentMeta.getMapping() != null ) { m_mappingEditor.setMapping( m_currentMeta.getMapping() ); } }
@Override public String getSummary() { return BaseMessages .getString( MSG_CLASS, summaryMsgKey(), getName(), Const.isEmpty( getHierarchy() ) ? "" : " " + getHierarchy(), getParentAttribute() ); }