Java Code Examples for org.pentaho.di.repository.Repository#getStepAttributeInteger()
The following examples show how to use
org.pentaho.di.repository.Repository#getStepAttributeInteger() .
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: GetSubFoldersMeta.java From pentaho-kettle with Apache License 2.0 | 6 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { int nrfiles = rep.countNrStepAttributes( id_step, "file_name" ); dynamicFoldernameField = rep.getStepAttributeString( id_step, "foldername_field" ); includeRowNumber = rep.getStepAttributeBoolean( id_step, "rownum" ); isFoldernameDynamic = rep.getStepAttributeBoolean( id_step, "foldername_dynamic" ); rowNumberField = rep.getStepAttributeString( id_step, "rownum_field" ); rowLimit = rep.getStepAttributeInteger( id_step, "limit" ); allocate( nrfiles ); for ( int i = 0; i < nrfiles; i++ ) { folderName[i] = rep.getStepAttributeString( id_step, i, "file_name" ); folderRequired[i] = rep.getStepAttributeString( id_step, i, "file_required" ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } }
Example 2
Source File: RowsFromResultMeta.java From pentaho-kettle with Apache License 2.0 | 6 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { int nrfields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrfields ); for ( int i = 0; i < nrfields; i++ ) { fieldname[i] = rep.getStepAttributeString( id_step, i, "field_name" ); type[i] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "field_type" ) ); length[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_length" ); precision[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ); } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "RowsFromResultMeta.Exception.ErrorReadingStepInfoFromRepository" ), e ); } }
Example 3
Source File: XBaseInputMeta.java From pentaho-kettle with Apache License 2.0 | 6 votes |
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { dbfFileName = rep.getStepAttributeString( id_step, "file_dbf" ); rowLimit = (int) rep.getStepAttributeInteger( id_step, "limit" ); rowNrAdded = rep.getStepAttributeBoolean( id_step, "add_rownr" ); rowNrField = rep.getStepAttributeString( id_step, "field_rownr" ); includeFilename = rep.getStepAttributeBoolean( id_step, "include" ); filenameField = rep.getStepAttributeString( id_step, "include_field" ); charactersetName = rep.getStepAttributeString( id_step, "charset_name" ); acceptingFilenames = rep.getStepAttributeBoolean( id_step, "accept_filenames" ); acceptingField = rep.getStepAttributeString( id_step, "accept_field" ); acceptingStepName = rep.getStepAttributeString( id_step, "accept_stepname" ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "XBaseInputMeta.Exception.UnexpectedErrorReadingMetaDataFromRepository" ), e ); } }
Example 4
Source File: WriteToLogMeta.java From pentaho-kettle with Apache License 2.0 | 6 votes |
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { loglevel = rep.getStepAttributeString( id_step, "loglevel" ); displayHeader = rep.getStepAttributeBoolean( id_step, "displayHeader" ); limitRows = rep.getStepAttributeBoolean( id_step, "limitRows" ); String limitRowsNumberString = rep.getStepAttributeString( id_step, "limitRowsNumber" ); limitRowsNumber = Const.toInt( limitRowsNumberString, 5 ); logmessage = rep.getStepAttributeString( id_step, "logmessage" ); limitRows = rep.getStepAttributeBoolean( id_step, "limitRows" ); limitRowsNumber = (int) rep.getStepAttributeInteger( id_step, "limitRowsNumber" ); int nrfields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrfields ); for ( int i = 0; i < nrfields; i++ ) { fieldName[i] = rep.getStepAttributeString( id_step, i, "field_name" ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } }
Example 5
Source File: PaloDimInputMeta.java From pentaho-kettle with Apache License 2.0 | 6 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId idStep, List<DatabaseMeta> databases ) throws KettleException { try { this.databaseMeta = rep.loadDatabaseMetaFromStepAttribute( idStep, "connection", databases ); this.dimension = rep.getStepAttributeString( idStep, "dimension" ); this.baseElementsOnly = rep.getStepAttributeBoolean( idStep, "baseElementsOnly" ); int nrLevels = rep.countNrStepAttributes( idStep, "levelname" ); for ( int i = 0; i < nrLevels; i++ ) { String levelName = rep.getStepAttributeString( idStep, i, "levelname" ); int levelNumber = (int) rep.getStepAttributeInteger( idStep, i, "levelnumber" ); String fieldName = rep.getStepAttributeString( idStep, i, "fieldname" ); String fieldType = rep.getStepAttributeString( idStep, i, "fieldtype" ); this.levels.add( new PaloDimensionLevel( levelName, levelNumber, fieldName, fieldType ) ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } }
Example 6
Source File: MappingIODefinition.java From pentaho-kettle with Apache License 2.0 | 6 votes |
public MappingIODefinition( Repository rep, ObjectId id_step, String prefix, int nr ) throws KettleException { this(); inputStepname = rep.getStepAttributeString( id_step, nr, prefix + "input_step" ); outputStepname = rep.getStepAttributeString( id_step, nr, prefix + "output_step" ); mainDataPath = rep.getStepAttributeBoolean( id_step, nr, prefix + "main_path" ); renamingOnOutput = rep.getStepAttributeBoolean( id_step, nr, prefix + "rename_on_output" ); description = rep.getStepAttributeString( id_step, nr, prefix + "description" ); int nrRenames = (int) rep.getStepAttributeInteger( id_step, nr, prefix + "nr_renames" ); for ( int i = 0; i < nrRenames; i++ ) { String parent = rep.getStepAttributeString( id_step, nr, prefix + "rename_parent_" + i ); String child = rep.getStepAttributeString( id_step, nr, prefix + "rename_child_" + i ); valueRenames.add( new MappingValueRename( parent, child ) ); } }
Example 7
Source File: FieldSplitterMeta.java From pentaho-kettle with Apache License 2.0 | 5 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { splitField = rep.getStepAttributeString( id_step, "splitfield" ); delimiter = rep.getStepAttributeString( id_step, "delimiter" ); enclosure = rep.getStepAttributeString( id_step, "enclosure" ); int nrfields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrfields ); for ( int i = 0; i < nrfields; i++ ) { fieldName[i] = rep.getStepAttributeString( id_step, i, "field_name" ); fieldID[i] = rep.getStepAttributeString( id_step, i, "field_id" ); fieldRemoveID[i] = rep.getStepAttributeBoolean( id_step, i, "field_idrem" ); fieldType[i] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "field_type" ) ); fieldFormat[i] = rep.getStepAttributeString( id_step, i, "field_format" ); fieldGroup[i] = rep.getStepAttributeString( id_step, i, "field_group" ); fieldDecimal[i] = rep.getStepAttributeString( id_step, i, "field_decimal" ); fieldCurrency[i] = rep.getStepAttributeString( id_step, i, "field_currency" ); fieldLength[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_length" ); fieldPrecision[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ); fieldNullIf[i] = rep.getStepAttributeString( id_step, i, "field_nullif" ); fieldIfNull[i] = rep.getStepAttributeString( id_step, i, "field_ifnull" ); fieldTrimType[i] = ValueMetaString.getTrimTypeByCode( rep.getStepAttributeString( id_step, i, "field_trimtype" ) ); } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "FieldSplitterMeta.Exception.UnexpectedErrorInReadingStepInfo" ), e ); } }
Example 8
Source File: RegexEvalMeta.java From pentaho-kettle with Apache License 2.0 | 5 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { script = rep.getStepAttributeString( id_step, "script" ); matcher = rep.getStepAttributeString( id_step, "matcher" ); resultfieldname = rep.getStepAttributeString( id_step, "resultfieldname" ); usevar = rep.getStepAttributeBoolean( id_step, "usevar" ); allowcapturegroups = rep.getStepAttributeBoolean( id_step, "allowcapturegroups" ); replacefields = rep.getStepAttributeBoolean( id_step, "replacefields" ); canoneq = rep.getStepAttributeBoolean( id_step, "canoneq" ); caseinsensitive = rep.getStepAttributeBoolean( id_step, "caseinsensitive" ); comment = rep.getStepAttributeBoolean( id_step, "comment" ); multiline = rep.getStepAttributeBoolean( id_step, "multiline" ); dotall = rep.getStepAttributeBoolean( id_step, "dotall" ); unicode = rep.getStepAttributeBoolean( id_step, "unicode" ); unix = rep.getStepAttributeBoolean( id_step, "unix" ); int nrfields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrfields ); for ( int i = 0; i < nrfields; i++ ) { fieldName[i] = rep.getStepAttributeString( id_step, i, "field_name" ); fieldType[i] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "field_type" ) ); fieldFormat[i] = rep.getStepAttributeString( id_step, i, "field_format" ); fieldGroup[i] = rep.getStepAttributeString( id_step, i, "field_group" ); fieldDecimal[i] = rep.getStepAttributeString( id_step, i, "field_decimal" ); fieldLength[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_length" ); fieldPrecision[i] = (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ); fieldNullIf[i] = rep.getStepAttributeString( id_step, i, "field_nullif" ); fieldIfNull[i] = rep.getStepAttributeString( id_step, i, "field_ifnull" ); fieldCurrency[i] = rep.getStepAttributeString( id_step, i, "field_currency" ); fieldTrimType[i] = ValueMetaString.getTrimTypeByCode( rep.getStepAttributeString( id_step, i, "field_trimtype" ) ); } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "RegexEvalMeta.Exception.UnexpectedErrorInReadingStepInfo" ), e ); } }
Example 9
Source File: CombinationLookupMeta.java From pentaho-kettle with Apache License 2.0 | 5 votes |
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { this.databases = databases; try { databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, "id_connection", databases ); schemaName = rep.getStepAttributeString( id_step, "schema" ); tablename = rep.getStepAttributeString( id_step, "table" ); commitSize = (int) rep.getStepAttributeInteger( id_step, "commit" ); cacheSize = (int) rep.getStepAttributeInteger( id_step, "cache_size" ); replaceFields = rep.getStepAttributeBoolean( id_step, "replace" ); preloadCache = rep.getStepAttributeBoolean( id_step, "preloadCache" ); useHash = rep.getStepAttributeBoolean( id_step, "crc" ); hashField = rep.getStepAttributeString( id_step, "crcfield" ); int nrkeys = rep.countNrStepAttributes( id_step, "lookup_key_name" ); allocate( nrkeys ); for ( int i = 0; i < nrkeys; i++ ) { keyField[ i ] = rep.getStepAttributeString( id_step, i, "lookup_key_name" ); keyLookup[ i ] = rep.getStepAttributeString( id_step, i, "lookup_key_field" ); } technicalKeyField = rep.getStepAttributeString( id_step, "return_name" ); useAutoinc = rep.getStepAttributeBoolean( id_step, "use_autoinc" ); sequenceFrom = rep.getStepAttributeString( id_step, "sequence" ); techKeyCreation = rep.getStepAttributeString( id_step, "creation_method" ); lastUpdateField = rep.getStepAttributeString( id_step, "last_update_field" ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "CombinationLookupMeta.Exception.UnexpectedErrorWhileReadingStepInfo" ), e ); } }
Example 10
Source File: TransExecutorMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { String method = rep.getStepAttributeString( id_step, "specification_method" ); specificationMethod = ObjectLocationSpecificationMethod.getSpecificationMethodByCode( method ); String transId = rep.getStepAttributeString( id_step, "trans_object_id" ); transObjectId = Utils.isEmpty( transId ) ? null : new StringObjectId( transId ); transName = rep.getStepAttributeString( id_step, "trans_name" ); fileName = rep.getStepAttributeString( id_step, "filename" ); directoryPath = rep.getStepAttributeString( id_step, "directory_path" ); groupSize = rep.getStepAttributeString( id_step, "group_size" ); groupField = rep.getStepAttributeString( id_step, "group_field" ); groupTime = rep.getStepAttributeString( id_step, "group_time" ); parameters = new TransExecutorParameters( rep, id_step ); executionResultTargetStep = rep.getStepAttributeString( id_step, F_EXECUTION_RESULT_TARGET_STEP ); executionTimeField = rep.getStepAttributeString( id_step, "execution_time_field" ); executionResultField = rep.getStepAttributeString( id_step, "execution_result_field" ); executionNrErrorsField = rep.getStepAttributeString( id_step, "execution_errors_field" ); executionLinesReadField = rep.getStepAttributeString( id_step, "execution_lines_read_field" ); executionLinesWrittenField = rep.getStepAttributeString( id_step, "execution_lines_written_field" ); executionLinesInputField = rep.getStepAttributeString( id_step, "execution_lines_input_field" ); executionLinesOutputField = rep.getStepAttributeString( id_step, "execution_lines_output_field" ); executionLinesRejectedField = rep.getStepAttributeString( id_step, "execution_lines_rejected_field" ); executionLinesUpdatedField = rep.getStepAttributeString( id_step, "execution_lines_updated_field" ); executionLinesDeletedField = rep.getStepAttributeString( id_step, "execution_lines_deleted_field" ); executionFilesRetrievedField = rep.getStepAttributeString( id_step, "execution_files_retrieved_field" ); executionExitStatusField = rep.getStepAttributeString( id_step, "execution_exit_status_field" ); executionLogTextField = rep.getStepAttributeString( id_step, "execution_log_text_field" ); executionLogChannelIdField = rep.getStepAttributeString( id_step, "execution_log_channelid_field" ); outputRowsSourceStep = rep.getStepAttributeString( id_step, "result_rows_target_step" ); int nrFields = rep.countNrStepAttributes( id_step, "result_rows_field_name" ); allocate( nrFields ); for ( int i = 0; i < nrFields; i++ ) { outputRowsField[ i ] = rep.getStepAttributeString( id_step, i, "result_rows_field_name" ); outputRowsType[ i ] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "result_rows_field_type" ) ); outputRowsLength[ i ] = (int) rep.getStepAttributeInteger( id_step, i, "result_rows_field_length" ); outputRowsPrecision[ i ] = (int) rep.getStepAttributeInteger( id_step, i, "result_rows_field_precision" ); } resultFilesTargetStep = rep.getStepAttributeString( id_step, F_RESULT_FILE_TARGET_STEP ); resultFilesFileNameField = rep.getStepAttributeString( id_step, "result_files_file_name_field" ); executorsOutputStep = rep.getStepAttributeString( id_step, F_EXECUTOR_OUTPUT_STEP ); }
Example 11
Source File: GetXMLDataMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { includeFilename = rep.getStepAttributeBoolean( id_step, "include" ); filenameField = rep.getStepAttributeString( id_step, "include_field" ); addResultFile = rep.getStepAttributeBoolean( id_step, "addresultfile" ); nameSpaceAware = rep.getStepAttributeBoolean( id_step, "namespaceaware" ); ignorecomments = rep.getStepAttributeBoolean( id_step, "ignorecomments" ); readurl = rep.getStepAttributeBoolean( id_step, "readurl" ); validating = rep.getStepAttributeBoolean( id_step, "validating" ); usetoken = rep.getStepAttributeBoolean( id_step, "usetoken" ); IsIgnoreEmptyFile = rep.getStepAttributeBoolean( id_step, "IsIgnoreEmptyFile" ); doNotFailIfNoFile = rep.getStepAttributeBoolean( id_step, "doNotFailIfNoFile" ); includeRowNumber = rep.getStepAttributeBoolean( id_step, "rownum" ); rowNumberField = rep.getStepAttributeString( id_step, "rownum_field" ); rowLimit = rep.getStepAttributeInteger( id_step, "limit" ); loopxpath = rep.getStepAttributeString( id_step, "loopxpath" ); encoding = rep.getStepAttributeString( id_step, "encoding" ); int nrFiles = rep.countNrStepAttributes( id_step, "file_name" ); int nrFields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrFiles, nrFields ); for ( int i = 0; i < nrFiles; i++ ) { fileName[i] = rep.getStepAttributeString( id_step, i, "file_name" ); fileMask[i] = rep.getStepAttributeString( id_step, i, "file_mask" ); excludeFileMask[i] = rep.getStepAttributeString( id_step, i, "exclude_file_mask" ); fileRequired[i] = rep.getStepAttributeString( id_step, i, "file_required" ); includeSubFolders[i] = rep.getStepAttributeString( id_step, i, "include_subfolders" ); } for ( int i = 0; i < nrFields; i++ ) { GetXMLDataField field = new GetXMLDataField(); field.setName( rep.getStepAttributeString( id_step, i, "field_name" ) ); field.setXPath( rep.getStepAttributeString( id_step, i, "field_xpath" ) ); field.setElementType( GetXMLDataField.getElementTypeByCode( rep.getStepAttributeString( id_step, i, "element_type" ) ) ); field.setResultType( GetXMLDataField.getResultTypeByCode( rep .getStepAttributeString( id_step, i, "result_type" ) ) ); field.setType( ValueMeta.getType( rep.getStepAttributeString( id_step, i, "field_type" ) ) ); field.setFormat( rep.getStepAttributeString( id_step, i, "field_format" ) ); field.setCurrencySymbol( rep.getStepAttributeString( id_step, i, "field_currency" ) ); field.setDecimalSymbol( rep.getStepAttributeString( id_step, i, "field_decimal" ) ); field.setGroupSymbol( rep.getStepAttributeString( id_step, i, "field_group" ) ); field.setLength( (int) rep.getStepAttributeInteger( id_step, i, "field_length" ) ); field.setPrecision( (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ) ); field.setTrimType( GetXMLDataField.getTrimTypeByCode( rep .getStepAttributeString( id_step, i, "field_trim_type" ) ) ); field.setRepeated( rep.getStepAttributeBoolean( id_step, i, "field_repeat" ) ); inputFields[i] = field; } inFields = rep.getStepAttributeBoolean( id_step, "IsInFields" ); IsAFile = rep.getStepAttributeBoolean( id_step, "IsAFile" ); xmlField = rep.getStepAttributeString( id_step, "XmlField" ); prunePath = rep.getStepAttributeString( id_step, "prunePath" ); shortFileFieldName = rep.getStepAttributeString( id_step, "shortFileFieldName" ); pathFieldName = rep.getStepAttributeString( id_step, "pathFieldName" ); hiddenFieldName = rep.getStepAttributeString( id_step, "hiddenFieldName" ); lastModificationTimeFieldName = rep.getStepAttributeString( id_step, "lastModificationTimeFieldName" ); uriNameFieldName = rep.getStepAttributeString( id_step, "uriNameFieldName" ); rootUriNameFieldName = rep.getStepAttributeString( id_step, "rootUriNameFieldName" ); extensionFieldName = rep.getStepAttributeString( id_step, "extensionFieldName" ); sizeFieldName = rep.getStepAttributeString( id_step, "sizeFieldName" ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "GetXMLDataMeta.Exception.ErrorReadingRepository" ), e ); } }
Example 12
Source File: InsertUpdateMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { this.databases = databases; try { databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, "id_connection", databases ); commitSize = rep.getStepAttributeString( id_step, "commit" ); if ( commitSize == null ) { long comSz = -1; try { comSz = rep.getStepAttributeInteger( id_step, "commit" ); } catch ( Exception ex ) { commitSize = "100"; } if ( comSz >= 0 ) { commitSize = Long.toString( comSz ); } } schemaName = rep.getStepAttributeString( id_step, "schema" ); tableName = rep.getStepAttributeString( id_step, "table" ); updateBypassed = rep.getStepAttributeBoolean( id_step, "update_bypassed" ); int nrkeys = rep.countNrStepAttributes( id_step, "key_field" ); int nrvalues = rep.countNrStepAttributes( id_step, "value_name" ); allocate( nrkeys, nrvalues ); for ( int i = 0; i < nrkeys; i++ ) { keyStream[i] = rep.getStepAttributeString( id_step, i, "key_name" ); keyLookup[i] = rep.getStepAttributeString( id_step, i, "key_field" ); keyCondition[i] = rep.getStepAttributeString( id_step, i, "key_condition" ); keyStream2[i] = rep.getStepAttributeString( id_step, i, "key_name2" ); } for ( int i = 0; i < nrvalues; i++ ) { updateLookup[i] = rep.getStepAttributeString( id_step, i, "value_name" ); updateStream[i] = rep.getStepAttributeString( id_step, i, "value_rename" ); update[i] = Boolean.valueOf( rep.getStepAttributeBoolean( id_step, i, "value_update", true ) ); } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "InsertUpdateMeta.Exception.UnexpectedErrorReadingStepInfoFromRepository" ), e ); } }
Example 13
Source File: YamlInputMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { includeFilename = rep.getStepAttributeBoolean( id_step, "include" ); filenameField = rep.getStepAttributeString( id_step, "include_field" ); addResultFile = rep.getStepAttributeBoolean( id_step, "addresultfile" ); validating = rep.getStepAttributeBoolean( id_step, "validating" ); IsIgnoreEmptyFile = rep.getStepAttributeBoolean( id_step, "IsIgnoreEmptyFile" ); doNotFailIfNoFile = rep.getStepAttributeBoolean( id_step, "doNotFailIfNoFile" ); includeRowNumber = rep.getStepAttributeBoolean( id_step, "rownum" ); rowNumberField = rep.getStepAttributeString( id_step, "rownum_field" ); rowLimit = rep.getStepAttributeInteger( id_step, "limit" ); encoding = rep.getStepAttributeString( id_step, "encoding" ); int nrFiles = rep.countNrStepAttributes( id_step, "file_name" ); int nrFields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrFiles, nrFields ); for ( int i = 0; i < nrFiles; i++ ) { fileName[i] = rep.getStepAttributeString( id_step, i, "file_name" ); fileMask[i] = rep.getStepAttributeString( id_step, i, "file_mask" ); fileRequired[i] = rep.getStepAttributeString( id_step, i, "file_required" ); includeSubFolders[i] = rep.getStepAttributeString( id_step, i, "include_subfolders" ); } for ( int i = 0; i < nrFields; i++ ) { YamlInputField field = new YamlInputField(); field.setName( rep.getStepAttributeString( id_step, i, "field_name" ) ); field.setPath( rep.getStepAttributeString( id_step, i, "field_path" ) ); field.setType( ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "field_type" ) ) ); field.setFormat( rep.getStepAttributeString( id_step, i, "field_format" ) ); field.setCurrencySymbol( rep.getStepAttributeString( id_step, i, "field_currency" ) ); field.setDecimalSymbol( rep.getStepAttributeString( id_step, i, "field_decimal" ) ); field.setGroupSymbol( rep.getStepAttributeString( id_step, i, "field_group" ) ); field.setLength( (int) rep.getStepAttributeInteger( id_step, i, "field_length" ) ); field.setPrecision( (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ) ); field.setTrimType( YamlInputField.getTrimTypeByCode( rep.getStepAttributeString( id_step, i, "field_trim_type" ) ) ); inputFields[i] = field; } inFields = rep.getStepAttributeBoolean( id_step, "IsInFields" ); IsAFile = rep.getStepAttributeBoolean( id_step, "IsAFile" ); yamlField = rep.getStepAttributeString( id_step, "YamlField" ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "YamlInputMeta.Exception.ErrorReadingRepository" ), e ); } }
Example 14
Source File: XMLInputSaxMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { includeFilename = rep.getStepAttributeBoolean( id_step, "include" ); filenameField = rep.getStepAttributeString( id_step, "include_field" ); includeRowNumber = rep.getStepAttributeBoolean( id_step, "rownum" ); rowNumberField = rep.getStepAttributeString( id_step, "rownum_field" ); rowLimit = (int) rep.getStepAttributeInteger( id_step, "limit" ); int nrFiles = rep.countNrStepAttributes( id_step, "file_name" ); int nrAttributes = rep.countNrStepAttributes( id_step, "def_element" ); int nrFields = rep.countNrStepAttributes( id_step, "field_name" ); int nrPositions = rep.countNrStepAttributes( id_step, "input_position" ); allocate( nrFiles, nrFields, nrPositions ); for ( int i = 0; i < nrFiles; i++ ) { fileName[i] = rep.getStepAttributeString( id_step, i, "file_name" ); fileMask[i] = rep.getStepAttributeString( id_step, i, "file_mask" ); } clearDefinition(); for ( int i = 0; i < nrAttributes; i++ ) { String a = rep.getStepAttributeString( id_step, i, "def_element" ); String b = rep.getStepAttributeString( id_step, i, "def_attribute" ); this.setDefiningAttribute( a, b ); } for ( int i = 0; i < nrFields; i++ ) { XMLInputSaxField field = new XMLInputSaxField(); field.setName( rep.getStepAttributeString( id_step, i, "field_name" ) ); field.setType( ValueMeta.getType( rep.getStepAttributeString( id_step, i, "field_type" ) ) ); field.setFormat( rep.getStepAttributeString( id_step, i, "field_format" ) ); field.setCurrencySymbol( rep.getStepAttributeString( id_step, i, "field_currency" ) ); field.setDecimalSymbol( rep.getStepAttributeString( id_step, i, "field_decimal" ) ); field.setGroupSymbol( rep.getStepAttributeString( id_step, i, "field_group" ) ); field.setLength( (int) rep.getStepAttributeInteger( id_step, i, "field_length" ) ); field.setPrecision( (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ) ); field.setTrimType( XMLInputSaxField.getTrimType( rep .getStepAttributeString( id_step, i, "field_trim_type" ) ) ); field.setRepeated( rep.getStepAttributeBoolean( id_step, i, "field_repeat" ) ); String fieldPositionCode = rep.getStepAttributeString( id_step, i, "field_position_code" ); if ( fieldPositionCode != null ) { field.setFieldPosition( fieldPositionCode ); } inputFields[i] = field; } for ( int i = 0; i < nrPositions; i++ ) { String encoded = rep.getStepAttributeString( id_step, i, "input_position" ); inputPosition[i] = new XMLInputSaxFieldPosition( encoded ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } }
Example 15
Source File: UpdateMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { this.databases = databases; try { databaseMeta = rep.loadDatabaseMetaFromStepAttribute( id_step, "id_connection", databases ); skipLookup = rep.getStepAttributeBoolean( id_step, "skip_lookup" ); commitSize = rep.getStepAttributeString( id_step, "commit" ); if ( commitSize == null ) { long comSz = -1; try { comSz = rep.getStepAttributeInteger( id_step, "commit" ); } catch ( Exception ex ) { commitSize = "100"; } if ( comSz >= 0 ) { commitSize = Long.toString( comSz ); } } useBatchUpdate = rep.getStepAttributeBoolean( id_step, "use_batch" ); schemaName = rep.getStepAttributeString( id_step, "schema" ); tableName = rep.getStepAttributeString( id_step, "table" ); errorIgnored = rep.getStepAttributeBoolean( id_step, "error_ignored" ); ignoreFlagField = rep.getStepAttributeString( id_step, "ignore_flag_field" ); int nrKeyName = rep.countNrStepAttributes( id_step, "key_name" ); int nrKeyField = rep.countNrStepAttributes( id_step, "key_field" ); int nrKeyCondition = rep.countNrStepAttributes( id_step, "key_condition" ); int nrKeyName2 = rep.countNrStepAttributes( id_step, "key_name2" ); int nrkeys = Ints.max( nrKeyName, nrKeyCondition, nrKeyField, nrKeyName2 ); int nrValueName = rep.countNrStepAttributes( id_step, "value_name" ); int nrValueRename = rep.countNrStepAttributes( id_step, "value_rename" ); int nrvalues = Ints.max( nrValueName, nrValueRename ); allocate( nrkeys, nrvalues ); for ( int i = 0; i < nrkeys; i++ ) { keyStream[i] = rep.getStepAttributeString( id_step, i, "key_name" ); keyLookup[i] = rep.getStepAttributeString( id_step, i, "key_field" ); keyCondition[i] = rep.getStepAttributeString( id_step, i, "key_condition" ); keyStream2[i] = rep.getStepAttributeString( id_step, i, "key_name2" ); } for ( int i = 0; i < nrvalues; i++ ) { updateLookup[i] = rep.getStepAttributeString( id_step, i, "value_name" ); updateStream[i] = rep.getStepAttributeString( id_step, i, "value_rename" ); } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "UpdateMeta.Exception.UnexpectedErrorReadingStepInfoFromRepository" ), e ); } }
Example 16
Source File: LDAPInputMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { usePaging = rep.getStepAttributeBoolean( id_step, "usepaging" ); pagesize = rep.getStepAttributeString( id_step, "pagesize" ); useAuthentication = rep.getStepAttributeBoolean( id_step, "useauthentication" ); includeRowNumber = rep.getStepAttributeBoolean( id_step, "rownum" ); rowNumberField = rep.getStepAttributeString( id_step, "rownum_field" ); Host = rep.getStepAttributeString( id_step, "host" ); userName = rep.getStepAttributeString( id_step, "username" ); password = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "password" ) ); port = rep.getStepAttributeString( id_step, "port" ); filterString = rep.getStepAttributeString( id_step, "filterstring" ); searchBase = rep.getStepAttributeString( id_step, "searchbase" ); rowLimit = (int) rep.getStepAttributeInteger( id_step, "limit" ); timeLimit = (int) rep.getStepAttributeInteger( id_step, "timelimit" ); multiValuedSeparator = rep.getStepAttributeString( id_step, "multivaluedseparator" ); dynamicSearch = rep.getStepAttributeBoolean( id_step, "dynamicsearch" ); dynamicSeachFieldName = rep.getStepAttributeString( id_step, "dynamicseachfieldname" ); dynamicFilter = rep.getStepAttributeBoolean( id_step, "dynamicfilter" ); dynamicFilterFieldName = rep.getStepAttributeString( id_step, "dynamicfilterfieldname" ); protocol = rep.getStepAttributeString( id_step, "protocol" ); trustStorePath = rep.getStepAttributeString( id_step, "trustStorePath" ); trustStorePassword = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "trustStorePassword" ) ); trustAllCertificates = rep.getStepAttributeBoolean( id_step, "trustAllCertificates" ); useCertificate = rep.getStepAttributeBoolean( id_step, "useCertificate" ); int nrFields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrFields ); for ( int i = 0; i < nrFields; i++ ) { LDAPInputField field = new LDAPInputField(); field.setName( rep.getStepAttributeString( id_step, i, "field_name" ) ); field.setAttribute( rep.getStepAttributeString( id_step, i, "field_attribute" ) ); field.setFetchAttributeAs( LDAPInputField.getFetchAttributeAsByCode( rep.getStepAttributeString( id_step, i, "field_attribute_fetch_as" ) ) ); field.setSortedKey( rep.getStepAttributeBoolean( id_step, i, "sorted_key" ) ); field.setType( ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "field_type" ) ) ); field.setFormat( rep.getStepAttributeString( id_step, i, "field_format" ) ); field.setCurrencySymbol( rep.getStepAttributeString( id_step, i, "field_currency" ) ); field.setDecimalSymbol( rep.getStepAttributeString( id_step, i, "field_decimal" ) ); field.setGroupSymbol( rep.getStepAttributeString( id_step, i, "field_group" ) ); field.setLength( (int) rep.getStepAttributeInteger( id_step, i, "field_length" ) ); field.setPrecision( (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ) ); field.setTrimType( LDAPInputField.getTrimTypeByCode( rep.getStepAttributeString( id_step, i, "field_trim_type" ) ) ); field.setRepeated( rep.getStepAttributeBoolean( id_step, i, "field_repeat" ) ); inputFields[i] = field; } searchScope = getSearchScopeByCode( Const.NVL( rep.getStepAttributeString( id_step, "searchScope" ), getSearchScopeCode( LDAPConnection.SEARCH_SCOPE_SUBTREE_SCOPE ) ) ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "LDAPInputMeta.Exception.ErrorReadingRepository" ), e ); } }
Example 17
Source File: XMLOutputMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { encoding = rep.getStepAttributeString( id_step, "encoding" ); nameSpace = rep.getStepAttributeString( id_step, "name_space" ); mainElement = rep.getStepAttributeString( id_step, "xml_main_element" ); repeatElement = rep.getStepAttributeString( id_step, "xml_repeat_element" ); fileName = rep.getStepAttributeString( id_step, "file_name" ); extension = rep.getStepAttributeString( id_step, "file_extention" ); servletOutput = rep.getStepAttributeBoolean( id_step, "file_servlet_output" ); doNotOpenNewFileInit = rep.getStepAttributeBoolean( id_step, "do_not_open_newfile_init" ); splitEvery = (int) rep.getStepAttributeInteger( id_step, "file_split" ); stepNrInFilename = rep.getStepAttributeBoolean( id_step, "file_add_stepnr" ); dateInFilename = rep.getStepAttributeBoolean( id_step, "file_add_date" ); timeInFilename = rep.getStepAttributeBoolean( id_step, "file_add_time" ); SpecifyFormat = rep.getStepAttributeBoolean( id_step, "SpecifyFormat" ); omitNullValues = rep.getStepAttributeBoolean( id_step, "omit_null_values" ); date_time_format = rep.getStepAttributeString( id_step, "date_time_format" ); addToResultFilenames = rep.getStepAttributeBoolean( id_step, "add_to_result_filenames" ); zipped = rep.getStepAttributeBoolean( id_step, "file_zipped" ); int nrfields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrfields ); for ( int i = 0; i < nrfields; i++ ) { outputFields[i] = new XMLField(); outputFields[i].setContentType( ContentType.valueOf( Const.NVL( rep.getStepAttributeString( id_step, i, "field_content_type" ), ContentType.Element.name() ) ) ); outputFields[i].setFieldName( rep.getStepAttributeString( id_step, i, "field_name" ) ); outputFields[i].setElementName( rep.getStepAttributeString( id_step, i, "field_element" ) ); outputFields[i].setType( rep.getStepAttributeString( id_step, i, "field_type" ) ); outputFields[i].setFormat( rep.getStepAttributeString( id_step, i, "field_format" ) ); outputFields[i].setCurrencySymbol( rep.getStepAttributeString( id_step, i, "field_currency" ) ); outputFields[i].setDecimalSymbol( rep.getStepAttributeString( id_step, i, "field_decimal" ) ); outputFields[i].setGroupingSymbol( rep.getStepAttributeString( id_step, i, "field_group" ) ); outputFields[i].setNullString( rep.getStepAttributeString( id_step, i, "field_nullif" ) ); outputFields[i].setLength( (int) rep.getStepAttributeInteger( id_step, i, "field_length" ) ); outputFields[i].setPrecision( (int) rep.getStepAttributeInteger( id_step, i, "field_precision" ) ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } }
Example 18
Source File: ExcelWriterStepMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { headerEnabled = rep.getStepAttributeBoolean( id_step, "header" ); footerEnabled = rep.getStepAttributeBoolean( id_step, "footer" ); makeSheetActive = rep.getStepAttributeBoolean( id_step, "makeSheetActive" ); appendOmitHeader = rep.getStepAttributeBoolean( id_step, "appendOmitHeader" ); startingCell = rep.getStepAttributeString( id_step, "startingCell" ); appendEmpty = (int) rep.getStepAttributeInteger( id_step, "appendEmpty" ); appendOffset = (int) rep.getStepAttributeInteger( id_step, "appendOffset" ); rowWritingMethod = rep.getStepAttributeString( id_step, "rowWritingMethod" ); appendLines = rep.getStepAttributeBoolean( id_step, "appendLines" ); forceFormulaRecalculation = rep.getStepAttributeBoolean( id_step, "forceFormulaRecalculation" ); leaveExistingStylesUnchanged = rep.getStepAttributeBoolean( id_step, "leaveExistingStylesUnchanged" ); String addToResult = rep.getStepAttributeString( id_step, "add_to_result_filenames" ); if ( Utils.isEmpty( addToResult ) ) { addToResultFilenames = true; } else { addToResultFilenames = rep.getStepAttributeBoolean( id_step, "add_to_result_filenames" ); } fileName = rep.getStepAttributeString( id_step, "file_name" ); extension = rep.getStepAttributeString( id_step, "file_extention" ); doNotOpenNewFileInit = rep.getStepAttributeBoolean( id_step, "do_not_open_newfile_init" ); splitEvery = (int) rep.getStepAttributeInteger( id_step, "file_split" ); stepNrInFilename = rep.getStepAttributeBoolean( id_step, "file_add_stepnr" ); dateInFilename = rep.getStepAttributeBoolean( id_step, "file_add_date" ); timeInFilename = rep.getStepAttributeBoolean( id_step, "file_add_time" ); SpecifyFormat = rep.getStepAttributeBoolean( id_step, "SpecifyFormat" ); date_time_format = rep.getStepAttributeString( id_step, "date_time_format" ); autosizecolums = rep.getStepAttributeBoolean( id_step, "autosizecolums" ); streamingData = rep.getStepAttributeBoolean( id_step, "stream_data" ); protectsheet = rep.getStepAttributeBoolean( id_step, "protect_sheet" ); password = Encr.decryptPasswordOptionallyEncrypted( rep.getStepAttributeString( id_step, "password" ) ); protectedBy = rep.getStepAttributeString( id_step, "protected_by" ); templateEnabled = rep.getStepAttributeBoolean( id_step, "template_enabled" ); templateFileName = rep.getStepAttributeString( id_step, "template_filename" ); templateSheetEnabled = rep.getStepAttributeBoolean( id_step, "template_sheet_enabled" ); templateSheetHidden = rep.getStepAttributeBoolean( id_step, "template_sheet_hidden" ); templateSheetName = rep.getStepAttributeString( id_step, "template_sheetname" ); sheetname = rep.getStepAttributeString( id_step, "sheetname" ); ifFileExists = rep.getStepAttributeString( id_step, "if_file_exists" ); ifSheetExists = rep.getStepAttributeString( id_step, "if_sheet_exists" ); int nrfields = rep.countNrStepAttributes( id_step, "field_name" ); allocate( nrfields ); for ( int i = 0; i < nrfields; i++ ) { outputFields[i] = new ExcelWriterStepField(); outputFields[i].setName( rep.getStepAttributeString( id_step, i, "field_name" ) ); outputFields[i].setType( rep.getStepAttributeString( id_step, i, "field_type" ) ); outputFields[i].setFormat( rep.getStepAttributeString( id_step, i, "field_format" ) ); outputFields[i].setTitle( rep.getStepAttributeString( id_step, i, "field_title" ) ); outputFields[i].setTitleStyleCell( rep.getStepAttributeString( id_step, i, "field_title_style_cell" ) ); outputFields[i].setStyleCell( rep.getStepAttributeString( id_step, i, "field_style_cell" ) ); outputFields[i].setCommentField( rep.getStepAttributeString( id_step, i, "field_comment_field" ) ); outputFields[i].setCommentAuthorField( rep.getStepAttributeString( id_step, i, "field_comment_author_field" ) ); outputFields[i].setFormula( rep.getStepAttributeBoolean( id_step, i, "field_formula" ) ); outputFields[i].setHyperlinkField( rep.getStepAttributeString( id_step, i, "field_hyperlink_field" ) ); } } catch ( Exception e ) { throw new KettleException( "Unexpected error reading step information from the repository", e ); } }
Example 19
Source File: GaInputStepMeta.java From pentaho-kettle with Apache License 2.0 | 4 votes |
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { String user = rep.getStepAttributeString( id_step, "user" ); String pass = rep.getStepAttributeString( id_step, "pass" ); String apiKey = rep.getStepAttributeString( id_step, "apiKey" ); oauthServiceAccount = rep.getStepAttributeString( id_step, "oauthServiceAccount" ); oauthKeyFile = rep.getStepAttributeString( id_step, "oauthKeyFile" ); // Are we loading a legacy transformation? if ( ( user != null || pass != null || apiKey != null ) && ( oauthServiceAccount == null && oauthKeyFile == null ) ) { logError( BaseMessages.getString( PKG, "GoogleAnalytics.Error.TransformationUpdateNeeded" ) ); } gaProfileName = rep.getStepAttributeString( id_step, "profileName" ); gaAppName = rep.getStepAttributeString( id_step, "appName" ); gaProfileTableId = rep.getStepAttributeString( id_step, "profileTableId" ); gaCustomTableId = rep.getStepAttributeString( id_step, "customTableId" ); useCustomTableId = rep.getStepAttributeBoolean( id_step, "useCustomTableId" ); startDate = rep.getStepAttributeString( id_step, "startDate" ); endDate = rep.getStepAttributeString( id_step, "endDate" ); dimensions = rep.getStepAttributeString( id_step, "dimensions" ); metrics = rep.getStepAttributeString( id_step, "metrics" ); filters = rep.getStepAttributeString( id_step, "filters" ); sort = rep.getStepAttributeString( id_step, "sort" ); useSegment = rep.getStepAttributeBoolean( id_step, 0, "useSegment", true ); // assume default true, if not present useCustomSegment = rep.getStepAttributeBoolean( id_step, "useCustomSegment" ); customSegment = rep.getStepAttributeString( id_step, "customSegment" ); segmentId = rep.getStepAttributeString( id_step, "segmentId" ); segmentName = rep.getStepAttributeString( id_step, "segmentName" ); samplingLevel = rep.getStepAttributeString( id_step, "samplingLevel" ); rowLimit = (int) rep.getStepAttributeInteger( id_step, "rowLimit" ); int nrFields = rep.countNrStepAttributes( id_step, "feedField" ); allocate( nrFields ); for ( int i = 0; i < nrFields; i++ ) { feedFieldType[ i ] = rep.getStepAttributeString( id_step, i, "feedFieldType" ); feedField[ i ] = rep.getStepAttributeString( id_step, i, "feedField" ); outputField[ i ] = rep.getStepAttributeString( id_step, i, "outField" ); outputType[ i ] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, "type" ) ); conversionMask[ i ] = rep.getStepAttributeString( id_step, i, "conversionMask" ); if ( outputType[ i ] < 0 ) { outputType[ i ] = ValueMetaInterface.TYPE_STRING; } } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "GoogleAnalytics.Error.UnableToReadFromRep" ), e ); } }
Example 20
Source File: IntegerPluginProperty.java From pentaho-kettle with Apache License 2.0 | 2 votes |
/** * {@inheritDoc} * * @see at.aschauer.commons.pentaho.plugin.PluginProperty#readFromRepositoryStep(org.pentaho.di.repository.Repository, * long) */ public void readFromRepositoryStep( final Repository repository, final IMetaStore metaStore, final ObjectId stepId ) throws KettleException { final Long longValue = repository.getStepAttributeInteger( stepId, this.getKey() ); this.setValue( longValue.intValue() ); }