Java Code Examples for org.pentaho.di.repository.Repository#saveStepAttribute()

The following examples show how to use org.pentaho.di.repository.Repository#saveStepAttribute() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TableExistsMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", database );
    rep.saveStepAttribute( id_transformation, id_step, "tablenamefield", tablenamefield );
    rep.saveStepAttribute( id_transformation, id_step, "schemaname", schemaname );

    rep.saveStepAttribute( id_transformation, id_step, "resultfieldname", resultfieldname );

    // Also, save the step-database relationship!
    if ( database != null ) {
      rep.insertStepDatabase( id_transformation, id_step, database.getObjectId() );
    }
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString( PKG, "TableExistsMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 2
Source File: DatabaseJoinMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", databaseMeta );
    rep.saveStepAttribute( id_transformation, id_step, "rowlimit", rowLimit );
    rep.saveStepAttribute( id_transformation, id_step, "sql", sql );
    rep.saveStepAttribute( id_transformation, id_step, "outer_join", outerJoin );
    rep.saveStepAttribute( id_transformation, id_step, "replace_vars", replacevars );

    for ( int i = 0; i < parameterField.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "parameter_field", parameterField[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "parameter_type", ValueMetaFactory
          .getValueMetaName( parameterType[i] ) );
    }

    // Also, save the step-database relationship!
    if ( databaseMeta != null ) {
      rep.insertStepDatabase( id_transformation, id_step, databaseMeta.getObjectId() );
    }
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString( PKG, "DatabaseJoinMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 3
Source File: JoinRowsMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "directory", directory );
    rep.saveStepAttribute( id_transformation, id_step, "prefix", prefix );
    rep.saveStepAttribute( id_transformation, id_step, "cache_size", cacheSize );

    if ( mainStepname == null ) {
      mainStepname = getLookupStepname();
    }
    rep.saveStepAttribute( id_transformation, id_step, "main", mainStepname );

    rep.saveConditionStepAttribute( id_transformation, id_step, "id_condition", condition );
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "JoinRowsMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 4
Source File: SymmetricCryptoTransMeta.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "operation_type", getOperationTypeCode( operationType ) );
    rep.saveStepAttribute( id_transformation, id_step, "algorithm", algorithm );
    rep.saveStepAttribute( id_transformation, id_step, "schema", schema );

    rep.saveStepAttribute( id_transformation, id_step, "secretKeyField", secretKeyField );
    rep.saveStepAttribute( id_transformation, id_step, "messageField", messageField );
    rep.saveStepAttribute( id_transformation, id_step, "resultfieldname", resultfieldname );

    rep.saveStepAttribute( id_transformation, id_step, "secretKey", Encr
      .encryptPasswordIfNotUsingVariables( secretKey ) );
    rep.saveStepAttribute( id_transformation, id_step, "secretKeyInField", secretKeyInField );
    rep.saveStepAttribute( id_transformation, id_step, "readKeyAsBinary", readKeyAsBinary );
    rep.saveStepAttribute( id_transformation, id_step, "outputResultAsBinary", outputResultAsBinary );

  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "SymmetricCryptoTransMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 5
Source File: BlockingStepMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
  throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "pass_all_rows", passAllRows );
    rep.saveStepAttribute( id_transformation, id_step, "directory", directory );
    rep.saveStepAttribute( id_transformation, id_step, "prefix", prefix );
    rep.saveStepAttribute( id_transformation, id_step, "cache_size", cacheSize );
    rep.saveStepAttribute( id_transformation, id_step, "compress", compressFiles );
  } catch ( Exception e ) {
    throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e );
  }
}
 
Example 6
Source File: GetVariableMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
  throws KettleException {
  try {

    for ( int i = 0; i < fieldDefinitions.length; i++ ) {
      String fieldName = fieldDefinitions[i].getFieldName();
      if ( fieldName != null && fieldName.length() != 0 ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "field_name", fieldName );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_variable", fieldDefinitions[i]
            .getVariableString() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_type",
          ValueMetaFactory.getValueMetaName( fieldDefinitions[i].getFieldType() ) );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_format", fieldDefinitions[i].getFieldFormat() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_currency", fieldDefinitions[i].getCurrency() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_decimal", fieldDefinitions[i].getDecimal() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_group", fieldDefinitions[i].getGroup() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_length", fieldDefinitions[i].getFieldLength() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_precision", fieldDefinitions[i]
            .getFieldPrecision() );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_trim_type",
          ValueMetaString.getTrimTypeCode( fieldDefinitions[i].getTrimType() ) );
      }
    }
  } catch ( Exception e ) {
    throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e );
  }

}
 
Example 7
Source File: SSHMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "dynamicCommandField", dynamicCommandField );
    rep.saveStepAttribute( id_transformation, id_step, "command", command );
    rep.saveStepAttribute( id_transformation, id_step, "commandfieldname", commandfieldname );
    rep.saveStepAttribute( id_transformation, id_step, "port", port );
    rep.saveStepAttribute( id_transformation, id_step, "servername", serverName );
    rep.saveStepAttribute( id_transformation, id_step, "userName", userName );
    rep.saveStepAttribute( id_transformation, id_step, "password", Encr
      .encryptPasswordIfNotUsingVariables( password ) );

    rep.saveStepAttribute( id_transformation, id_step, "usePrivateKey", usePrivateKey );
    rep.saveStepAttribute( id_transformation, id_step, "keyFileName", keyFileName );
    rep.saveStepAttribute( id_transformation, id_step, "passPhrase", Encr
      .encryptPasswordIfNotUsingVariables( passPhrase ) );
    rep.saveStepAttribute( id_transformation, id_step, "stdOutFieldName", stdOutFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "stdErrFieldName", stdErrFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "timeOut", timeOut );
    rep.saveStepAttribute( id_transformation, id_step, "proxyHost", proxyHost );
    rep.saveStepAttribute( id_transformation, id_step, "proxyPort", proxyPort );
    rep.saveStepAttribute( id_transformation, id_step, "proxyUsername", proxyUsername );
    rep.saveStepAttribute( id_transformation, id_step, "proxyPassword", Encr
      .encryptPasswordIfNotUsingVariables( proxyPassword ) );

  } catch ( Exception e ) {
    throw new KettleException(
      BaseMessages.getString( PKG, "SSHMeta.Exception.UnableToSaveStepInfo" ) + id_step, e );
  }
}
 
Example 8
Source File: SplitFieldToRowsMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "splitfield", splitField );
    rep.saveStepAttribute( id_transformation, id_step, "delimiter", delimiter );
    rep.saveStepAttribute( id_transformation, id_step, "newfield", newFieldname );
    rep.saveStepAttribute( id_transformation, id_step, "rownum", includeRowNumber );
    rep.saveStepAttribute( id_transformation, id_step, "reset_rownumber", resetRowNumber );
    rep.saveStepAttribute( id_transformation, id_step, "rownum_field", rowNumberField );
    rep.saveStepAttribute( id_transformation, id_step, "delimiter_is_regex", isDelimiterRegex );
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "SplitFieldToRowsMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 9
Source File: FileExistsMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "filenamefield", filenamefield );
    rep.saveStepAttribute( id_transformation, id_step, "resultfieldname", resultfieldname );
    rep.saveStepAttribute( id_transformation, id_step, "includefiletype", includefiletype );
    rep.saveStepAttribute( id_transformation, id_step, "filetypefieldname", filetypefieldname );
    rep.saveStepAttribute( id_transformation, id_step, "addresultfilenames", addresultfilenames );
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString( PKG, "FileExistsMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 10
Source File: MappingParameters.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  for ( int i = 0; i < variable.length; i++ ) {
    rep.saveStepAttribute( id_transformation, id_step, i, "mapping_parameter_variable", variable[i] );
    rep.saveStepAttribute( id_transformation, id_step, i, "mapping_parameter_input", input[i] );
  }
  rep.saveStepAttribute(
    id_transformation, id_step, "mapping_parameter_inherit_all_vars", inheritingAllVariables );
}
 
Example 11
Source File: HTTPMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "url", url );
    rep.saveStepAttribute( id_transformation, id_step, "urlInField", urlInField );
    rep.saveStepAttribute( id_transformation, id_step, "urlField", urlField );
    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );
    rep.saveStepAttribute( id_transformation, id_step, "httpLogin", httpLogin );
    rep.saveStepAttribute( id_transformation, id_step, "httpPassword", Encr
      .encryptPasswordIfNotUsingVariables( httpPassword ) );
    rep.saveStepAttribute( id_transformation, id_step, "proxyHost", proxyHost );
    rep.saveStepAttribute( id_transformation, id_step, "proxyPort", proxyPort );
    rep.saveStepAttribute( id_transformation, id_step, "socketTimeout", socketTimeout );
    rep.saveStepAttribute( id_transformation, id_step, "connectionTimeout", connectionTimeout );
    rep.saveStepAttribute( id_transformation, id_step, "closeIdleConnectionsTime", closeIdleConnectionsTime );

    for ( int i = 0; i < argumentField.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "arg_name", argumentField[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "arg_parameter", argumentParameter[i] );
    }

    for ( int i = 0; i < headerField.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "header_name", headerField[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "header_parameter", headerParameter[i] );
    }

    rep.saveStepAttribute( id_transformation, id_step, "result_name", fieldName );
    rep.saveStepAttribute( id_transformation, id_step, "result_code", resultCodeFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "response_time", responseTimeFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "response_header", responseHeaderFieldName );
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString( PKG, "HTTPMeta.Exception.UnableToSaveStepInfo" )
      + id_step, e );
  }
}
 
Example 12
Source File: LucidDBBulkLoaderMeta.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", databaseMeta );
    rep.saveStepAttribute( id_transformation, id_step, "errors", maxErrors );
    rep.saveStepAttribute( id_transformation, id_step, "buffer_size", bufferSize );
    rep.saveStepAttribute( id_transformation, id_step, "schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "table", tableName );

    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );

    rep.saveStepAttribute( id_transformation, id_step, "fifo_directory", fifoDirectory );
    rep.saveStepAttribute( id_transformation, id_step, "fifo_server_name", fifoServerName );

    for ( int i = 0; i < fieldTable.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "stream_name", fieldTable[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_name", fieldStream[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_format_ok", fieldFormatOk[i] );
    }

    // Also, save the step-database relationship!
    if ( databaseMeta != null ) {
      rep.insertStepDatabase( id_transformation, id_step, databaseMeta.getObjectId() );
    }
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "LucidDBBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 13
Source File: GetXMLDataMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
  throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "include", includeFilename );
    rep.saveStepAttribute( id_transformation, id_step, "include_field", filenameField );
    rep.saveStepAttribute( id_transformation, id_step, "addresultfile", addResultFile );
    rep.saveStepAttribute( id_transformation, id_step, "namespaceaware", nameSpaceAware );
    rep.saveStepAttribute( id_transformation, id_step, "ignorecomments", ignorecomments );
    rep.saveStepAttribute( id_transformation, id_step, "readurl", readurl );

    rep.saveStepAttribute( id_transformation, id_step, "validating", validating );
    rep.saveStepAttribute( id_transformation, id_step, "usetoken", usetoken );
    rep.saveStepAttribute( id_transformation, id_step, "IsIgnoreEmptyFile", IsIgnoreEmptyFile );
    rep.saveStepAttribute( id_transformation, id_step, "doNotFailIfNoFile", doNotFailIfNoFile );

    rep.saveStepAttribute( id_transformation, id_step, "rownum", includeRowNumber );
    rep.saveStepAttribute( id_transformation, id_step, "rownum_field", rowNumberField );
    rep.saveStepAttribute( id_transformation, id_step, "limit", rowLimit );
    rep.saveStepAttribute( id_transformation, id_step, "loopxpath", loopxpath );
    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );

    for ( int i = 0; i < fileName.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "file_name", fileName[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "file_mask", fileMask[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "exclude_file_mask", excludeFileMask[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "file_required", fileRequired[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "include_subfolders", includeSubFolders[i] );
    }

    for ( int i = 0; i < inputFields.length; i++ ) {
      GetXMLDataField field = inputFields[i];

      rep.saveStepAttribute( id_transformation, id_step, i, "field_name", field.getName() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_xpath", field.getXPath() );
      rep.saveStepAttribute( id_transformation, id_step, i, "element_type", field.getElementTypeCode() );
      rep.saveStepAttribute( id_transformation, id_step, i, "result_type", field.getResultTypeCode() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_type", field.getTypeDesc() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_format", field.getFormat() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_currency", field.getCurrencySymbol() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_decimal", field.getDecimalSymbol() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_group", field.getGroupSymbol() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_length", field.getLength() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_precision", field.getPrecision() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_trim_type", field.getTrimTypeCode() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_repeat", field.isRepeated() );
    }
    rep.saveStepAttribute( id_transformation, id_step, "IsInFields", inFields );
    rep.saveStepAttribute( id_transformation, id_step, "IsAFile", IsAFile );

    rep.saveStepAttribute( id_transformation, id_step, "XmlField", xmlField );
    rep.saveStepAttribute( id_transformation, id_step, "prunePath", prunePath );
    rep.saveStepAttribute( id_transformation, id_step, "shortFileFieldName", shortFileFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "pathFieldName", pathFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "hiddenFieldName", hiddenFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "lastModificationTimeFieldName", lastModificationTimeFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "uriNameFieldName", uriNameFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "rootUriNameFieldName", rootUriNameFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "extensionFieldName", extensionFieldName );
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString( PKG, "GetXMLDataMeta.Exception.ErrorSavingToRepository", ""
        + id_step ), e );
  }
}
 
Example 14
Source File: OraBulkLoaderMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveDatabaseMetaStepAttribute( id_transformation, id_step, "id_connection", databaseMeta );
    rep.saveStepAttribute( id_transformation, id_step, "commit", commitSize );
    rep.saveStepAttribute( id_transformation, id_step, "bind_size", bindSize );
    rep.saveStepAttribute( id_transformation, id_step, "read_size", readSize );
    rep.saveStepAttribute( id_transformation, id_step, "errors", maxErrors );
    rep.saveStepAttribute( id_transformation, id_step, "schema", schemaName );
    rep.saveStepAttribute( id_transformation, id_step, "table", tableName );

    rep.saveStepAttribute( id_transformation, id_step, "load_method", loadMethod );
    rep.saveStepAttribute( id_transformation, id_step, "load_action", loadAction );
    rep.saveStepAttribute( id_transformation, id_step, "sqlldr", sqlldr );
    rep.saveStepAttribute( id_transformation, id_step, "control_file", controlFile );
    rep.saveStepAttribute( id_transformation, id_step, "data_file", dataFile );
    rep.saveStepAttribute( id_transformation, id_step, "log_file", logFile );
    rep.saveStepAttribute( id_transformation, id_step, "bad_file", badFile );
    rep.saveStepAttribute( id_transformation, id_step, "discard_file", discardFile );

    rep.saveStepAttribute( id_transformation, id_step, "direct_path", directPath );
    rep.saveStepAttribute( id_transformation, id_step, "erase_files", eraseFiles );
    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );
    rep.saveStepAttribute( id_transformation, id_step, "dbname_override", dbNameOverride );

    rep.saveStepAttribute( id_transformation, id_step, "character_set", characterSetName );
    rep.saveStepAttribute( id_transformation, id_step, "fail_on_warning", failOnWarning );
    rep.saveStepAttribute( id_transformation, id_step, "fail_on_error", failOnError );
    rep.saveStepAttribute( id_transformation, id_step, "parallel", parallel );
    rep.saveStepAttribute( id_transformation, id_step, "alt_rec_term", altRecordTerm );

    for ( int i = 0; i < fieldTable.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "stream_name", fieldTable[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_name", fieldStream[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "date_mask", dateMask[i] );
    }

    // Also, save the step-database relationship!
    if ( databaseMeta != null ) {
      rep.insertStepDatabase( id_transformation, id_step, databaseMeta.getObjectId() );
    }
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "OraBulkLoaderMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 15
Source File: AccessInputMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "include", includeFilename );
    rep.saveStepAttribute( id_transformation, id_step, "include_field", filenameField );
    rep.saveStepAttribute( id_transformation, id_step, "tablename", includeTablename );
    rep.saveStepAttribute( id_transformation, id_step, "tablename_field", tablenameField );
    rep.saveStepAttribute( id_transformation, id_step, "rownum", includeRowNumber );
    rep.saveStepAttribute( id_transformation, id_step, "isaddresult", isaddresult );
    rep.saveStepAttribute( id_transformation, id_step, "filefield", filefield );
    rep.saveStepAttribute( id_transformation, id_step, "filename_Field", dynamicFilenameField );
    rep.saveStepAttribute( id_transformation, id_step, "rownum_field", rowNumberField );
    rep.saveStepAttribute( id_transformation, id_step, "limit", rowLimit );
    rep.saveStepAttribute( id_transformation, id_step, "table_name", TableName );
    rep.saveStepAttribute( id_transformation, id_step, "reset_rownumber", resetRowNumber );

    for ( int i = 0; i < fileName.length; i++ ) {
      rep.saveStepAttribute( id_transformation, id_step, i, "file_name", fileName[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "file_mask", fileMask[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "exclude_file_mask", excludeFileMask[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "file_required", fileRequired[i] );
      rep.saveStepAttribute( id_transformation, id_step, i, "include_subfolders", includeSubFolders[i] );
    }

    for ( int i = 0; i < inputFields.length; i++ ) {
      AccessInputField field = inputFields[i];

      rep.saveStepAttribute( id_transformation, id_step, i, "field_name", field.getName() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_attribut", field.getColumn() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_type", field.getTypeDesc() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_format", field.getFormat() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_currency", field.getCurrencySymbol() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_decimal", field.getDecimalSymbol() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_group", field.getGroupSymbol() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_length", field.getLength() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_precision", field.getPrecision() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_trim_type", field.getTrimTypeCode() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_repeat", field.isRepeated() );

    }
    rep.saveStepAttribute( id_transformation, id_step, "shortFileFieldName", shortFileFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "pathFieldName", pathFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "hiddenFieldName", hiddenFieldName );
    rep.saveStepAttribute(
      id_transformation, id_step, "lastModificationTimeFieldName", lastModificationTimeFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "uriNameFieldName", uriNameFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "rootUriNameFieldName", rootUriNameFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "extensionFieldName", extensionFieldName );
    rep.saveStepAttribute( id_transformation, id_step, "sizeFieldName", sizeFieldName );
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "AccessInputMeta.Exception.ErrorSavingToRepository", "" + id_step ), e );
  }
}
 
Example 16
Source File: XMLOutputMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
  throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "encoding", encoding );
    rep.saveStepAttribute( id_transformation, id_step, "name_space", nameSpace );
    rep.saveStepAttribute( id_transformation, id_step, "xml_main_element", mainElement );
    rep.saveStepAttribute( id_transformation, id_step, "xml_repeat_element", repeatElement );
    rep.saveStepAttribute( id_transformation, id_step, "file_name", fileName );
    rep.saveStepAttribute( id_transformation, id_step, "file_extention", extension );
    rep.saveStepAttribute( id_transformation, id_step, "file_servlet_output", servletOutput );

    rep.saveStepAttribute( id_transformation, id_step, "do_not_open_newfile_init", doNotOpenNewFileInit );
    rep.saveStepAttribute( id_transformation, id_step, "file_split", splitEvery );
    rep.saveStepAttribute( id_transformation, id_step, "file_add_stepnr", stepNrInFilename );
    rep.saveStepAttribute( id_transformation, id_step, "file_add_date", dateInFilename );
    rep.saveStepAttribute( id_transformation, id_step, "file_add_time", timeInFilename );
    rep.saveStepAttribute( id_transformation, id_step, "SpecifyFormat", SpecifyFormat );
    rep.saveStepAttribute( id_transformation, id_step, "omit_null_values", omitNullValues );
    rep.saveStepAttribute( id_transformation, id_step, "date_time_format", date_time_format );

    rep.saveStepAttribute( id_transformation, id_step, "add_to_result_filenames", addToResultFilenames );
    rep.saveStepAttribute( id_transformation, id_step, "file_zipped", zipped );

    for ( int i = 0; i < outputFields.length; i++ ) {
      XMLField field = outputFields[i];

      rep.saveStepAttribute( id_transformation, id_step, i, "field_content_type", field.getContentType().name() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_name", field.getFieldName() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_element", field.getElementName() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_type", field.getTypeDesc() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_format", field.getFormat() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_currency", field.getCurrencySymbol() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_decimal", field.getDecimalSymbol() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_group", field.getGroupingSymbol() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_nullif", field.getNullString() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_length", field.getLength() );
      rep.saveStepAttribute( id_transformation, id_step, i, "field_precision", field.getPrecision() );
    }
  } catch ( Exception e ) {
    throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e );
  }
}
 
Example 17
Source File: JobExecutorMeta.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  rep.saveStepAttribute( id_transformation, id_step, "specification_method", specificationMethod == null
    ? null : specificationMethod.getCode() );
  rep.saveStepAttribute( id_transformation, id_step, "job_object_id", jobObjectId == null ? null : jobObjectId
    .toString() );
  rep.saveStepAttribute( id_transformation, id_step, "filename", fileName );
  rep.saveStepAttribute( id_transformation, id_step, "job_name", jobName );
  rep.saveStepAttribute( id_transformation, id_step, "directory_path", directoryPath );

  rep.saveStepAttribute( id_transformation, id_step, "group_size", groupSize );
  rep.saveStepAttribute( id_transformation, id_step, "group_field", groupField );
  rep.saveStepAttribute( id_transformation, id_step, "group_time", groupTime );

  // save the mapping parameters too
  //
  parameters.saveRep( rep, metaStore, id_transformation, id_step );

  // The output side...
  //
  rep.saveStepAttribute(
    id_transformation, id_step, "execution_result_target_step", executionResultTargetStepMeta == null
      ? null : executionResultTargetStepMeta.getName() );
  rep.saveStepAttribute( id_transformation, id_step, "execution_time_field", executionTimeField );
  rep.saveStepAttribute( id_transformation, id_step, "execution_result_field", executionResultField );
  rep.saveStepAttribute( id_transformation, id_step, "execution_errors_field", executionNrErrorsField );
  rep.saveStepAttribute( id_transformation, id_step, "execution_lines_read_field", executionLinesReadField );
  rep
    .saveStepAttribute(
      id_transformation, id_step, "execution_lines_written_field", executionLinesWrittenField );
  rep.saveStepAttribute( id_transformation, id_step, "execution_lines_input_field", executionLinesInputField );
  rep.saveStepAttribute( id_transformation, id_step, "execution_lines_output_field", executionLinesOutputField );
  rep.saveStepAttribute(
    id_transformation, id_step, "execution_lines_rejected_field", executionLinesRejectedField );
  rep
    .saveStepAttribute(
      id_transformation, id_step, "execution_lines_updated_field", executionLinesUpdatedField );
  rep
    .saveStepAttribute(
      id_transformation, id_step, "execution_lines_deleted_field", executionLinesDeletedField );
  rep.saveStepAttribute(
    id_transformation, id_step, "execution_files_retrieved_field", executionFilesRetrievedField );
  rep.saveStepAttribute( id_transformation, id_step, "execution_exit_status_field", executionExitStatusField );
  rep.saveStepAttribute( id_transformation, id_step, "execution_log_text_field", executionLogTextField );
  rep
    .saveStepAttribute(
      id_transformation, id_step, "execution_log_channelid_field", executionLogChannelIdField );

  rep.saveStepAttribute( id_transformation, id_step, "result_rows_target_step", resultRowsTargetStepMeta == null
    ? null : resultRowsTargetStepMeta.getName() );

  for ( int i = 0; i < resultRowsField.length; i++ ) {
    rep.saveStepAttribute( id_transformation, id_step, i, "result_rows_field_name", resultRowsField[i] );
    rep.saveStepAttribute( id_transformation, id_step, i, "result_rows_field_type",
      ValueMetaFactory.getValueMetaName( resultRowsType[i] ) );
    rep.saveStepAttribute( id_transformation, id_step, i, "result_rows_field_length", resultRowsLength[i] );
    rep.saveStepAttribute( id_transformation, id_step, i, "result_rows_field_precision", resultRowsPrecision[i] );
  }

  rep.saveStepAttribute(
    id_transformation, id_step, "result_files_target_step", resultFilesTargetStepMeta == null
      ? null : resultFilesTargetStepMeta.getName() );
  rep.saveStepAttribute( id_transformation, id_step, "result_files_file_name_field", resultFilesFileNameField );
}
 
Example 18
Source File: IntegerPluginProperty.java    From pentaho-kettle with Apache License 2.0 2 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @see at.aschauer.commons.pentaho.plugin.PluginProperty#saveToRepositoryStep(org.pentaho.di.repository.Repository,
 *      long, long)
 */
public void saveToRepositoryStep( final Repository repository, final IMetaStore metaStore,
  final ObjectId transformationId, final ObjectId stepId ) throws KettleException {
  repository.saveStepAttribute( transformationId, stepId, this.getKey(), this.getValue() );
}
 
Example 19
Source File: StringListPluginProperty.java    From pentaho-kettle with Apache License 2.0 2 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @see at.aschauer.commons.pentaho.plugin.PluginProperty#saveToRepositoryStep(org.pentaho.di.repository.Repository,
 *      long, long)
 */
public void saveToRepositoryStep( final Repository repository, final IMetaStore metaStore,
  final ObjectId transformationId, final ObjectId stepId ) throws KettleException {
  final String stringValue = asString( this.getValue() );
  repository.saveStepAttribute( transformationId, stepId, this.getKey(), stringValue );
}
 
Example 20
Source File: StringPluginProperty.java    From pentaho-kettle with Apache License 2.0 2 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @see at.aschauer.commons.pentaho.plugin.PluginProperty#saveToRepositoryStep(org.pentaho.di.repository.Repository,
 *      long, long)
 */
public void saveToRepositoryStep( final Repository repository, final IMetaStore metaStore,
  final ObjectId transformationId, final ObjectId stepId ) throws KettleException {
  repository.saveStepAttribute( transformationId, stepId, this.getKey(), this.getValue() );
}