Java Code Examples for org.pentaho.di.trans.TransMeta#getParameterDescription()
The following examples show how to use
org.pentaho.di.trans.TransMeta#getParameterDescription() .
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: TransformationParameterHelper.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
public KettleParameterInfo[] getDeclaredParameter() throws KettleException, ReportDataFactoryException { if ( parameters == null ) { TransMeta transMeta = transformationProducer.loadTransformation( dataFactoryContext ); String[] parameterNames = transMeta.listParameters(); ArrayList<KettleParameterInfo> infos = new ArrayList<KettleParameterInfo>(); for ( String parameterName : parameterNames ) { String defaultValue = transMeta.getParameterDefault( parameterName ); String description = transMeta.getParameterDescription( parameterName ); infos.add( new KettleParameterInfo( parameterName, description, defaultValue ) ); } parameters = infos.toArray( new KettleParameterInfo[ infos.size() ] ); } return parameters; }
Example 2
Source File: TransExecutorDialog.java From pentaho-kettle with Apache License 2.0 | 5 votes |
protected void getParametersFromTrans( TransMeta inputTransMeta ) { try { // Load the job in executorTransMeta // if ( inputTransMeta == null ) { loadTransformation(); inputTransMeta = executorTransMeta; } String[] parameters = inputTransMeta.listParameters(); for ( int i = 0; i < parameters.length; i++ ) { String name = parameters[ i ]; String desc = inputTransMeta.getParameterDescription( name ); TableItem item = new TableItem( wTransExecutorParameters.table, SWT.NONE ); item.setText( 1, Const.NVL( name, "" ) ); String str = inputTransMeta.getParameterDefault( name ); str = ( str != null ? str : ( desc != null ? desc : "" ) ); item.setText( 3, Const.NVL( str, "" ) ); } wTransExecutorParameters.removeEmptyRows(); wTransExecutorParameters.setRowNums(); wTransExecutorParameters.optWidth( true ); } catch ( Exception e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "TransExecutorDialog.ErrorLoadingSpecifiedTrans.Title" ), BaseMessages.getString( PKG, "TransExecutorDialog.ErrorLoadingSpecifiedTrans.Message" ), e ); } }
Example 3
Source File: KettleDatabaseRepositoryTransDelegate.java From pentaho-kettle with Apache License 2.0 | 3 votes |
/** * Save the parameters of this transformation to the repository. * * * @throws KettleException * Upon any error. * * * TODO: Move this code over to the Repository class for refactoring... */ public void saveTransParameters( TransMeta transMeta ) throws KettleException { String[] paramKeys = transMeta.listParameters(); for ( int idx = 0; idx < paramKeys.length; idx++ ) { String desc = transMeta.getParameterDescription( paramKeys[idx] ); String defaultValue = transMeta.getParameterDefault( paramKeys[idx] ); insertTransParameter( transMeta.getObjectId(), idx, paramKeys[idx], defaultValue, desc ); } }