当前位置: 首页>>代码示例>>Java>>正文


Java NamedParams.listParameters方法代码示例

本文整理汇总了Java中org.pentaho.di.core.parameters.NamedParams.listParameters方法的典型用法代码示例。如果您正苦于以下问题:Java NamedParams.listParameters方法的具体用法?Java NamedParams.listParameters怎么用?Java NamedParams.listParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.core.parameters.NamedParams的用法示例。


在下文中一共展示了NamedParams.listParameters方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setParams

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
/**
* 将来源对象的参数拷贝到目标对象,并根据要求修改 <br/>
* @author jingma
* @param target 要设置的目标对象
* @param source 来源对象
* @param params 要修改的参数
*/
public static void setParams(NamedParams target,
        NamedParams source,Map<String, String> params) {
    //修改参数
    target.eraseParameters();
    try {
        for ( String key : source.listParameters() ) {
            String defaultVal = source.getParameterDefault( key );
            if(params.containsKey(key)){
                defaultVal = params.get(key);
            }
            target.addParameterDefinition( key, defaultVal, 
                    source.getParameterDescription( key ) );
        }
    } catch (Exception e) {
        log.error("保存JOB失败", e);
    }
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:25,代码来源:KettleUtils.java

示例2: filterUserParameters

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
private NamedParams filterUserParameters( NamedParams params ) {

    NamedParams userParams = new NamedParamsDefault();

    if ( !isEmpty( params ) ) {

      for ( String paramName : params.listParameters() ) {

        if ( isUserParameter( paramName ) ) {
          try {
            userParams.addParameterDefinition( paramName, StringUtils.EMPTY, StringUtils.EMPTY );
          } catch ( DuplicateParamException e ) {
            // ignore
          }
        }
      }
    }

    return userParams;
  }
 
开发者ID:pentaho,项目名称:pdi-platform-plugin,代码行数:21,代码来源:PdiContentProvider.java

示例3: setParametersAsVariablesInUI

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
public void setParametersAsVariablesInUI(NamedParams namedParameters, VariableSpace space) {
      for (String param : namedParameters.listParameters()) {
    	  try {
    		  space.setVariable(param, Const.NVL(namedParameters.getParameterValue(param), Const.NVL(namedParameters.getParameterDefault(param), Const.NVL(space.getVariable(param), ""))));
    	  }
    	  catch(Exception e) {
    		  // ignore this
    	  }
      }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:11,代码来源:Spoon.java

示例4: setParametersAsVariablesInUI

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
public void setParametersAsVariablesInUI(NamedParams namedParameters, VariableSpace space) {
  for (String param : namedParameters.listParameters()) {
    try {
      space.setVariable(param, Const.NVL(namedParameters.getParameterValue(param), Const.NVL(namedParameters
          .getParameterDefault(param), Const.NVL(space.getVariable(param), ""))));
    } catch (Exception e) {
      // ignore this
    }
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:11,代码来源:Spoon.java

示例5: testTransformationUserParameters

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
@Test
public void testTransformationUserParameters() throws Exception {

  PdiAction action = new PdiAction();
  action.setRepositoryName( KettleFileRepositoryMeta.REPOSITORY_TYPE_ID );
  action.setArguments( new String[] { "dummyArg" } );
  action.setDirectory( SOLUTION_REPOSITORY );
  action.setTransformation( SAMPLE_TRANS );

  action.execute();

  Assert.isTrue( action.localTrans != null && action.localTrans.getTransMeta() != null );

  NamedParams np = action.localTrans.getTransMeta();

  boolean protectedParameterNameExistsInKtr = false;

  for ( String param : np.listParameters() ) {
    protectedParameterNameExistsInKtr |= param != null && param.equals( SAMPLE_PROTECTED_PARAMETER_NAME );
  }

  // we make sure: this ktr does indeed have a system/hidden parameter
  Assert.isTrue( protectedParameterNameExistsInKtr );

  // reset attribute
  protectedParameterNameExistsInKtr = false;

  // we now call IPdiContentProvider.getUserParameters( kjb ), that should filter out protected parameters
  IPdiContentProvider pdiContentProvider = new PdiContentProvider( PentahoSystem.get( IUnifiedRepository.class ) );
  String[] userParams = pdiContentProvider.getUserParameters( SOLUTION_REPOSITORY + SAMPLE_TRANS + ".ktr" );

  for ( String userParam : userParams ) {
    protectedParameterNameExistsInKtr |= userParam != null && userParam.equals( SAMPLE_PROTECTED_PARAMETER_NAME );
  }

  // we make sure: IPdiContentProvider has filtered it out
  Assert.isTrue( !protectedParameterNameExistsInKtr );
}
 
开发者ID:pentaho,项目名称:pdi-platform-plugin,代码行数:39,代码来源:UserParametersTest.java

示例6: testJobUserParameters

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
@Test
public void testJobUserParameters() throws Exception {

  PdiAction action = new PdiAction();
  action.setRepositoryName( KettleFileRepositoryMeta.REPOSITORY_TYPE_ID );
  action.setArguments( new String[] { "dummyArg" } );
  action.setDirectory( SOLUTION_REPOSITORY );
  action.setJob( SAMPLE_JOB );

  action.execute();

  Assert.isTrue( action.localJob != null && action.localJob.getJobMeta() != null );

  NamedParams np = action.localJob.getJobMeta();

  boolean protectedParameterNameExistsInKjb = false;

  for ( String param : np.listParameters() ) {
    protectedParameterNameExistsInKjb |= param != null && param.equals( SAMPLE_PROTECTED_PARAMETER_NAME );
  }

  // we make sure: this kjb does indeed have a system/hidden parameter
  Assert.isTrue( protectedParameterNameExistsInKjb );

  // reset attribute
  protectedParameterNameExistsInKjb = false;

  // we now call IPdiContentProvider.getUserParameters( kjb ), that should filter out protected parameters
  IPdiContentProvider pdiContentProvider = new PdiContentProvider( PentahoSystem.get( IUnifiedRepository.class ) );
  String[] userParams = pdiContentProvider.getUserParameters( SOLUTION_REPOSITORY + SAMPLE_JOB + ".kjb" );

  for ( String userParam : userParams ) {
    protectedParameterNameExistsInKjb |= userParam != null && userParam.equals( SAMPLE_PROTECTED_PARAMETER_NAME );
  }

  // we make sure: IPdiContentProvider has filtered it out
  Assert.isTrue( !protectedParameterNameExistsInKjb );
}
 
开发者ID:pentaho,项目名称:pdi-platform-plugin,代码行数:39,代码来源:UserParametersTest.java

示例7: setParametersAsVariablesInUI

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
public void setParametersAsVariablesInUI( NamedParams namedParameters, VariableSpace space ) {
  for ( String param : namedParameters.listParameters() ) {
    try {
      space.setVariable( param, Const.NVL( namedParameters.getParameterValue( param ), Const.NVL(
        namedParameters.getParameterDefault( param ), Const.NVL( space.getVariable( param ), "" ) ) ) );
    } catch ( Exception e ) {
      // ignore this
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:11,代码来源:Spoon.java

示例8: getUserParameters

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
@Override
public String[] getUserParameters( String kettleFilePath ) {

  List<String> userParams = new ArrayList<String>();

  if ( !StringUtils.isEmpty( kettleFilePath ) ) {

    try {

      NamedParams np = getMeta( kettleFilePath );

      if ( !isEmpty( np = filterUserParameters( np ) ) ) {

        return np.listParameters();
      }

    } catch ( KettleException e ) {
      log.error( e );
    }
  }

  return userParams.toArray( new String[] {} );
}
 
开发者ID:pentaho,项目名称:pdi-platform-plugin,代码行数:24,代码来源:PdiContentProvider.java

示例9: isEmpty

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
private boolean isEmpty( NamedParams np ) {
  return np == null || np.listParameters() == null || np.listParameters().length == 0;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:4,代码来源:PdiContentProvider.java

示例10: getUserParameters

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
@Override
public String[] getUserParameters( String kettleFilePath ) {

  List<String> userParams = new ArrayList<String>();

  if ( !StringUtils.isEmpty( kettleFilePath ) ) {

    RepositoryFile file = unifiedRepository.getFile( kettleFilePath );

    if ( file != null ) {

      try {

        NamedParams np = getMeta( file );

        if ( !isEmpty( np = filterUserParameters( np ) ) ) {

          return np.listParameters();
        }

      } catch ( KettleException e ) {
        log.error( e );
      }
    }
  }

  return userParams.toArray( new String[] {} );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:29,代码来源:PdiContentProvider.java

示例11: isEmpty

import org.pentaho.di.core.parameters.NamedParams; //导入方法依赖的package包/类
private boolean isEmpty( NamedParams np ) {
  return np == null || np.listParameters() == null || np.listParameters().length == 0;

}
 
开发者ID:pentaho,项目名称:pdi-platform-plugin,代码行数:5,代码来源:PdiContentProvider.java


注:本文中的org.pentaho.di.core.parameters.NamedParams.listParameters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。