Java Code Examples for org.pentaho.di.repository.Repository

The following are top voted examples for showing how to use org.pentaho.di.repository.Repository. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: pdi-hcp-plugin   File: HCPDeleteMeta.java   View source code 7 votes vote down vote up
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
  
  // Optionally add a fields...
  //
  if (StringUtils.isNotEmpty(responseCodeField)) {
    ValueMetaInterface codeValue = new ValueMetaInteger(responseCodeField);
    codeValue.setLength(3);
    codeValue.setOrigin(name);
    inputRowMeta.addValueMeta(codeValue);
  }
  
  if (StringUtils.isNotEmpty(responseTimeField)) {
    ValueMetaInterface timeValue = new ValueMetaInteger(responseTimeField);
    timeValue.setLength(7);
    timeValue.setOrigin(name);
    inputRowMeta.addValueMeta(timeValue);
  }
}
 
Example 2
Project: kettle_support_kettle8.0   File: KettleReposServiceImpl.java   View source code 6 votes vote down vote up
@SuppressWarnings("all")
@Override
public Object loading(T entity) throws KettleException {
	if (null == entity) {
		entity = (T) new KettleRepos();
	}
	entity.setStatus(Constant.STATUS_ENABLED);
	List<T> isList = (List<T>) mapper.iKettleReposMapper
			.selectByWhere(entity);
	if (null != isList && isList.size() > 0) {
		// 运行环境初始化(设置主目录、注册必须的插件等)
		KettleEnvironment.init();
		list = new ArrayList<Repository>();
		for (T repos : isList) {
			initRepository(repos, false);
		}
	}
	return list;
}
 
Example 3
Project: aliyun-maxcompute-data-collectors   File: OdpsOutputMeta.java   View source code 6 votes vote down vote up
@Override public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step,
    List<DatabaseMeta> databases) throws KettleException {
    super.readRep(rep, metaStore, id_step, databases);

    String truncateStr = rep.getStepAttributeString(id_step, "truncate");
    if (truncateStr.equals("true")) {
        setTruncate(true);
    } else {
        setTruncate(false);
    }

    int nrStreamFields = rep.countNrStepAttributes(id_step, "stream_field_name");
    streamFields = new ArrayList<String>(nrStreamFields);
    for (int i = 0; i < nrStreamFields; i++) {
        streamFields.add(rep.getStepAttributeString(id_step, i, "stream_field_name"));
    }
}
 
Example 4
Project: aliyun-maxcompute-data-collectors   File: OdpsMeta.java   View source code 6 votes vote down vote up
@Override public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step,
    List<DatabaseMeta> databases) throws KettleException {
    setEndpoint(rep.getStepAttributeString(id_step, "endpoint"));
    setTunnelEndpoint(rep.getStepAttributeString(id_step, "tunnelEndpoint"));
    setAccessId(rep.getStepAttributeString(id_step, "accessId"));
    setAccessKey(rep.getStepAttributeString(id_step, "accessKey"));
    setProjectName(rep.getStepAttributeString(id_step, "projectName"));
    setTableName(rep.getStepAttributeString(id_step, "tableName"));
    setPartition(rep.getStepAttributeString(id_step, "partition"));

    int nrFields = rep.countNrStepAttributes(id_step, "field_name");
    odpsFields = new ArrayList<OdpsField>(nrFields);
    for (int i = 0; i < nrFields; i++) {
        OdpsField field = new OdpsField();
        field.setName(rep.getStepAttributeString(id_step, i, "field_name"));
        field.setType(rep.getStepAttributeString(id_step, i, "field_type"));
        field.setComment(rep.getStepAttributeString(id_step, i, "field_comment"));
        odpsFields.add(field);
    }
}
 
Example 5
Project: aliyun-maxcompute-data-collectors   File: OdpsMeta.java   View source code 6 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, "endpoint", getEndpoint());
    rep.saveStepAttribute(id_transformation, id_step, "tunnelEndpoint", getTunnelEndpoint());
    rep.saveStepAttribute(id_transformation, id_step, "accessId", getAccessId());
    rep.saveStepAttribute(id_transformation, id_step, "accessKey", getAccessKey());
    rep.saveStepAttribute(id_transformation, id_step, "projectName", getProjectName());
    rep.saveStepAttribute(id_transformation, id_step, "tableName", getTableName());
    rep.saveStepAttribute(id_transformation, id_step, "partition", getPartition());

    for (int i = 0; i < odpsFields.size(); i++) {
        OdpsField field = odpsFields.get(i);
        rep.saveStepAttribute(id_transformation, id_step, i, "field_name",
            field.getName().toLowerCase());
        rep.saveStepAttribute(id_transformation, id_step, i, "field_type", field.getType());
        rep.saveStepAttribute(id_transformation, id_step, i, "field_comment",
            field.getComment());
    }
}
 
Example 6
Project: KettleEasyExpand   File: KettleUtils.java   View source code 6 votes vote down vote up
/**
* 创建数据连接元数据对象 <br/>
* @author jingma
 * @param name 数据库连接名称
 * @param url 数据库连接
 * @param user 数据库用户名
 * @param pass 数据库密码
 * @param replace 是否替换已经存在的
 * @param repository 资源库
* @return
 * @throws Exception 
*/
public static DatabaseMeta createDatabaseMeta(String name, String url,String user,String pass,
        boolean replace,Repository repository) throws Exception {
    JSONObject urlObj = JdbcUtil.parseJdbcUrl(url);
    if(UtilConst.DS_TYPE_ORACLE.equals(urlObj.getString(JdbcUtil.DB_TYPE))){
        return createDatabaseMeta(name, dbTypeToKettle(urlObj.getString(JdbcUtil.DB_TYPE)), 
                DatabaseMeta.dbAccessTypeCode[DatabaseMeta.TYPE_ACCESS_NATIVE], 
                urlObj.getString(JdbcUtil.HOSTNAME), urlObj.getString(JdbcUtil.DATABASE_NAME), 
                urlObj.getString(JdbcUtil.PORT), user, pass,null,replace,repository);
    }else if(UtilConst.DS_TYPE_MYSQL.equals(urlObj.getString(JdbcUtil.DB_TYPE))){
        return createDatabaseMeta(name, dbTypeToKettle(urlObj.getString(JdbcUtil.DB_TYPE)), 
                DatabaseMeta.dbAccessTypeCode[DatabaseMeta.TYPE_ACCESS_NATIVE], 
                urlObj.getString(JdbcUtil.HOSTNAME), urlObj.getString(JdbcUtil.DATABASE_NAME), 
                urlObj.getString(JdbcUtil.PORT), user, pass,urlObj.getJSONObject(JdbcUtil.PARAM_OBJ),
                replace,repository);
    }else{
        return null;
    }
}
 
Example 7
Project: KettleEasyExpand   File: KettleUtils.java   View source code 6 votes vote down vote up
/**
* 将指定job复制到KettleUtils中的资源库 <br/>
* @author jingma
* @param jobName job名称
* @param jobPath job路径
* @param fromRepository 来源资源库
   * @param toRepository 目标资源库
* @throws KettleException
*/
public static void jobCopy(String jobName,String jobPath,Repository fromRepository,
        Repository toRepository) throws KettleException {
	JobMeta jobMeta = KettleUtils.loadJob(jobName,jobPath,fromRepository);
	for(JobEntryCopy jec:jobMeta.getJobCopies()){
		if(jec.isTransformation()){
			JobEntryTrans jet = (JobEntryTrans)jec.getEntry();
			transCopy(jet.getObjectName(), jet.getDirectory(),fromRepository,toRepository);
		}else if(jec.isJob()){
			JobEntryJob jej = (JobEntryJob)jec.getEntry();
			jobCopy(jej.getObjectName(),jej.getDirectory(),fromRepository,toRepository);
		}
	}
	jobMeta.setRepository(toRepository);
	jobMeta.setMetaStore(toRepository.getMetaStore());
	if(!isDirectoryExist(toRepository,jobPath)){
		//所在目录不存在则创建
	    toRepository.createRepositoryDirectory(toRepository.findDirectory("/"), jobPath);
	}
	KettleUtils.saveJob(toRepository,jobMeta);
}
 
Example 8
Project: KettleEasyExpand   File: KettleUtils.java   View source code 6 votes vote down vote up
/**
* 将指定转换复制到KettleUtils中的资源库 <br/>
* @author jingma
* @param jobName 转换名称
* @param jobPath 转换路径
   * @param fromRepository 来源资源库
   * @param toRepository 目标资源库
* @throws KettleException
*/
public static void transCopy(String transName,String transPath,Repository fromRepository,
           Repository toRepository) throws KettleException {
	TransMeta tm = KettleUtils.loadTrans(transName, transPath, fromRepository);
	for(StepMeta sm:tm.getSteps()){
		if(sm.isJobExecutor()){
			JobExecutorMeta jem = (JobExecutorMeta)sm.getStepMetaInterface();
			jobCopy(jem.getJobName(),jem.getDirectoryPath(),fromRepository,toRepository);
		}
		else if(sm.getStepMetaInterface() instanceof TransExecutorMeta){
			TransExecutorMeta te = (TransExecutorMeta)sm.getStepMetaInterface();
			transCopy(te.getTransName(), te.getDirectoryPath(),fromRepository,toRepository);
		}
	}
	if(!isDirectoryExist(toRepository,transPath)){
		//所在目录不存在则创建
	    toRepository.createRepositoryDirectory(toRepository.findDirectory("/"), transPath);
	}
	tm.setRepository(toRepository);
	tm.setMetaStore(toRepository.getMetaStore());
	KettleUtils.saveTrans(toRepository,tm);
}
 
Example 9
Project: KettleUtil   File: KettleUtils.java   View source code 6 votes vote down vote up
/**
* 创建数据连接元数据对象 <br/>
* @author jingma
 * @param name 数据库连接名称
 * @param url 数据库连接
 * @param user 数据库用户名
 * @param pass 数据库密码
 * @param replace 是否替换已经存在的
 * @param repository 资源库
* @return
 * @throws Exception 
*/
public static DatabaseMeta createDatabaseMeta(String name, String url,String user,String pass,
        boolean replace,Repository repository) throws Exception {
    JSONObject urlObj = JdbcUtil.parseJdbcUrl(url);
    if(UtilConst.DS_TYPE_ORACLE.equals(urlObj.getString(JdbcUtil.DB_TYPE))){
        return createDatabaseMeta(name, dbTypeToKettle(urlObj.getString(JdbcUtil.DB_TYPE)), 
                DatabaseMeta.dbAccessTypeCode[DatabaseMeta.TYPE_ACCESS_NATIVE], 
                urlObj.getString(JdbcUtil.HOSTNAME), urlObj.getString(JdbcUtil.DATABASE_NAME), 
                urlObj.getString(JdbcUtil.PORT), user, pass,null,replace,repository);
    }else if(UtilConst.DS_TYPE_MYSQL.equals(urlObj.getString(JdbcUtil.DB_TYPE))){
        return createDatabaseMeta(name, dbTypeToKettle(urlObj.getString(JdbcUtil.DB_TYPE)), 
                DatabaseMeta.dbAccessTypeCode[DatabaseMeta.TYPE_ACCESS_NATIVE], 
                urlObj.getString(JdbcUtil.HOSTNAME), urlObj.getString(JdbcUtil.DATABASE_NAME), 
                urlObj.getString(JdbcUtil.PORT), user, pass,urlObj.getJSONObject(JdbcUtil.PARAM_OBJ),
                replace,repository);
    }else{
        return null;
    }
}
 
Example 10
Project: KettleUtil   File: KettleUtils.java   View source code 6 votes vote down vote up
/**
* 将指定job复制到KettleUtils中的资源库 <br/>
* @author jingma
* @param jobName job名称
* @param jobPath job路径
* @param fromRepository 来源资源库
   * @param toRepository 目标资源库
* @throws KettleException
*/
public static void jobCopy(String jobName,String jobPath,Repository fromRepository,
        Repository toRepository) throws KettleException {
	JobMeta jobMeta = KettleUtils.loadJob(jobName,jobPath,fromRepository);
	for(JobEntryCopy jec:jobMeta.getJobCopies()){
		if(jec.isTransformation()){
			JobEntryTrans jet = (JobEntryTrans)jec.getEntry();
			transCopy(jet.getObjectName(), jet.getDirectory(),fromRepository,toRepository);
		}else if(jec.isJob()){
			JobEntryJob jej = (JobEntryJob)jec.getEntry();
			jobCopy(jej.getObjectName(),jej.getDirectory(),fromRepository,toRepository);
		}
	}
	jobMeta.setRepository(toRepository);
	jobMeta.setMetaStore(toRepository.getMetaStore());
	if(!isDirectoryExist(toRepository,jobPath)){
		//所在目录不存在则创建
	    toRepository.createRepositoryDirectory(toRepository.findDirectory("/"), jobPath);
	}
	KettleUtils.saveJob(toRepository,jobMeta);
}
 
Example 11
Project: KettleUtil   File: KettleUtils.java   View source code 6 votes vote down vote up
/**
* 将指定转换复制到KettleUtils中的资源库 <br/>
* @author jingma
* @param jobName 转换名称
* @param jobPath 转换路径
   * @param fromRepository 来源资源库
   * @param toRepository 目标资源库
* @throws KettleException
*/
public static void transCopy(String transName,String transPath,Repository fromRepository,
           Repository toRepository) throws KettleException {
	TransMeta tm = KettleUtils.loadTrans(transName, transPath, fromRepository);
	for(StepMeta sm:tm.getSteps()){
		if(sm.isJobExecutor()){
			JobExecutorMeta jem = (JobExecutorMeta)sm.getStepMetaInterface();
			jobCopy(jem.getJobName(),jem.getDirectoryPath(),fromRepository,toRepository);
		}
		else if(sm.getStepMetaInterface() instanceof TransExecutorMeta){
			TransExecutorMeta te = (TransExecutorMeta)sm.getStepMetaInterface();
			transCopy(te.getTransName(), te.getDirectoryPath(),fromRepository,toRepository);
		}
	}
	if(!isDirectoryExist(toRepository,transPath)){
		//所在目录不存在则创建
	    toRepository.createRepositoryDirectory(toRepository.findDirectory("/"), transPath);
	}
	tm.setRepository(toRepository);
	tm.setMetaStore(toRepository.getMetaStore());
	KettleUtils.saveTrans(toRepository,tm);
}
 
Example 12
Project: pentaho-pdi-streaming   File: ListStreamingServicesServlet.java   View source code 6 votes vote down vote up
protected void startTransformation( Repository repository, IMetaStore metaStore, final StreamingService service ) {
  try {

    TransMeta transMeta = StreamingConst.loadTransMeta( repository, metaStore, service );
    Trans trans = new Trans( transMeta );
    String carteObjectId = UUID.randomUUID().toString();
    trans.setContainerObjectId( carteObjectId );
    
    if (service.getLogLevel()!=null) {
      trans.setLogLevel(service.getLogLevel());
    }
    TransExecutionConfiguration transExecutionConfiguration = new TransExecutionConfiguration();
    TransConfiguration transConfiguration = new TransConfiguration( transMeta, transExecutionConfiguration );
    transformationMap.addTransformation( transMeta.getName(), carteObjectId, trans, transConfiguration );
    trans.prepareExecution( null );

    // Start the transformation

    trans.startThreads();
    
    // This transformation routinely never ends so we won't wait for it...
    
  } catch ( Exception e ) {
    throw new RuntimeException( "Unable to start transformation for streaming service '" + service.getName() + "'", e );
  }
}
 
Example 13
Project: pentaho-pdi-streaming   File: StreamingService.java   View source code 6 votes vote down vote up
/**
 * Try to look up the transObjectId for transformation which are referenced by path 
 * @param repository The repository to use.
 * @throws KettleException
 */
public void lookupTransObjectId( Repository repository ) throws KettleException {
  if ( repository == null )
    return;

  if ( Const.isEmpty( transFilename ) && transObjectId == null && !Const.isEmpty( transRepositoryPath ) ) {
    // see if there is a path specified to a repository name
    //
    String path = "/";
    String name = transRepositoryPath;
    int lastSlashIndex = name.lastIndexOf( '/' );
    if ( lastSlashIndex >= 0 ) {
      path = transRepositoryPath.substring( 0, lastSlashIndex + 1 );
      name = transRepositoryPath.substring( lastSlashIndex + 1 );
    }
    RepositoryDirectoryInterface tree = repository.loadRepositoryDirectoryTree();
    RepositoryDirectoryInterface rd = tree.findDirectory( path );
    if ( rd == null )
      rd = tree; // root

    ObjectId transformationID = repository.getTransformationID( name, rd );
    transObjectId = transformationID == null ? null : transformationID.getId();
  }
}
 
Example 14
Project: sdmx-kettle   File: SdmxStepMeta.java   View source code 6 votes vote down vote up
/**
 * This method is called by Spoon when a step needs to serialize its configuration to a repository.
 * The repository implementation provides the necessary methods to save the step attributes.
 *
 * @param rep					the repository to save to
 * @param metaStore				the metaStore to optionally write to
 * @param id_transformation		the id to use for the transformation when saving
 * @param id_step				the id to use for the step  when saving
 */
public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step) throws KettleException
{
	try{
		rep.saveStepAttribute(id_transformation, id_step, "provider_id", provider == null ? "" : provider.getName() );
		rep.saveStepAttribute(id_transformation, id_step, "provider_desc", provider == null ? "" : provider.getDescription() );
		rep.saveStepAttribute( id_transformation, id_step, "flow_id", dataflow.getId() );
		rep.saveStepAttribute( id_transformation, id_step, "flow_desc", dataflow.getDescription() );
     rep.saveStepAttribute( id_transformation, id_step, "query_sdmx", getSdmxQuery() );

     saveDimensionsToRepository( rep, id_transformation, id_step );
     saveFieldsToRepository( rep, id_transformation, id_step );
	}
	catch(Exception e){
		throw new KettleException("Unable to save step into repository: "+id_step, e); 
	}
}
 
Example 15
Project: sdmx-kettle   File: SdmxStepMeta.java   View source code 6 votes vote down vote up
/**
 * This method is called to determine the changes the step is making to the row-stream.
 * To that end a RowMetaInterface object is passed in, containing the row-stream structure as it is when entering
 * the step. This method must apply any changes the step makes to the row stream. Usually a step adds fields to the
 * row-stream.
 * 
 * @param inputRowMeta		the row structure coming in to the step
 * @param name 				the name of the step making the changes
 * @param info				row structures of any info steps coming in
 * @param nextStep			the description of a step this step is passing rows to
 * @param space				the variable space for resolving variables
 * @param repository		the repository instance optionally read from
 * @param metaStore			the metaStore to optionally read from
 */
 @Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException{

   for ( int i = 0; i < fields.length; i++ ) {
     int type = fields[i].getType();
     if ( type == ValueMetaInterface.TYPE_NONE) type = ValueMetaInterface.TYPE_STRING;

     try {
       ValueMetaInterface v = ValueMetaFactory.createValueMeta( fields[i].getName(), type );
       v.setConversionMask( fields[i].getFormat() );
       v.setLength( fields[i].getLength() );
       v.setPrecision( fields[i].getPrecision() );
       v.setCurrencySymbol( fields[i].getCurrencySymbol() );
       v.setDecimalSymbol( fields[i].getDecimalSymbol() );
       v.setGroupingSymbol( fields[i].getGroupSymbol() );
       v.setTrimType( fields[i].getTrimType() );

       v.setOrigin( name );

       inputRowMeta.addValueMeta( v );
     } catch (KettlePluginException e) {
       throw new KettleStepException( e );
     }
   }
}
 
Example 16
Project: sdmx-kettle   File: SdmxStepMeta.java   View source code 6 votes vote down vote up
private void saveFieldsToRepository( Repository rep, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  for ( int i = 0; i < fields.length; i++ ) {
    SdmxInputField field = fields[i];

    rep.saveStepAttribute( id_transformation, id_step, i, "name", field.getName() );
    rep.saveStepAttribute( id_transformation, id_step, i, "type", field.getTypeDesc() );
    rep.saveStepAttribute( id_transformation, id_step, i, "length", field.getLength() );
    rep.saveStepAttribute( id_transformation, id_step, i, "precision", field.getPrecision() );
    rep.saveStepAttribute( id_transformation, id_step, i, "trim_type", field.getTrimTypeCode() );
    rep.saveStepAttribute( id_transformation, id_step, i, "repeat", field.isRepeated() );
    rep.saveStepAttribute( id_transformation, id_step, i, "format", field.getFormat() );
    rep.saveStepAttribute( id_transformation, id_step, i, "currency", field.getCurrencySymbol() );
    rep.saveStepAttribute( id_transformation, id_step, i, "decimal", field.getDecimalSymbol() );
    rep.saveStepAttribute( id_transformation, id_step, i, "group", field.getGroupSymbol() );
  }
}
 
Example 17
Project: sdmx-kettle   File: SdmxStepMeta.java   View source code 6 votes vote down vote up
private void readFieldsFromRepository( Repository rep, ObjectId id_step ) throws KettleException {
  int nrFields = rep.countNrStepAttributes( id_step, "trim_type" );
  allocateFields( nrFields );

  for ( int i = 0; i < nrFields; i++ ) {
    SdmxInputField field = new SdmxInputField();

    field.setName( rep.getStepAttributeString( id_step, i, "name" ) );
    field.setType( rep.getStepAttributeString( id_step, i, "type" ) );
    field.setLength( (int) rep.getStepAttributeInteger( id_step, i,  "length" ) );
    field.setPrecision( (int) rep.getStepAttributeInteger( id_step, i,  "precision" ) );
    field.setTrimType( ValueMetaBase.getTrimTypeByCode( rep.getStepAttributeString( id_step, i, "trim_type" ) ) );
    field.setFormat( rep.getStepAttributeString( id_step, i, "format" ) );
    field.setCurrencySymbol( rep.getStepAttributeString( id_step, i, "currency" ) );
    field.setDecimalSymbol( rep.getStepAttributeString( id_step, i, "decimal" ) );
    field.setGroupSymbol( rep.getStepAttributeString( id_step, i, "group" ) );

    String srepeat = rep.getStepAttributeString( id_step, i, "repeat" );
    if ( srepeat != null ) {
      field.setRepeated( YES.equalsIgnoreCase( srepeat ) );
    } else {
      field.setRepeated( false );
    }
    fields[i] = field;
  }
}
 
Example 18
Project: pdi-hcp-plugin   File: HCPGetMeta.java   View source code 6 votes vote down vote up
@Override
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases)
    throws KettleException {

  String connectionName = rep.getStepAttributeString(id_step, TAG_CONNECTION);
  if (StringUtils.isNotEmpty(connectionName)) {
    try {
      connection = HCPConnectionUtils.getConnectionFactory(metaStore).loadElement(connectionName);
    } catch (MetaStoreException e) {
      // We just log the message but we don't abort the complete meta-data
      // loading.
      //
      log.logError(BaseMessages.getString(PKG, "HCPGetMeta.Error.HCPConnectionNotFound", connectionName));
      connection = null;
    }
  }
  sourceFileField = rep.getStepAttributeString(id_step, TAG_SOURCE_FILE);
  targetFileField = rep.getStepAttributeString(id_step, TAG_TARGET_FILE);
  responseCodeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_CODE_FIELD);
  responseTimeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_TIME_FIELD);
  responseSizeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_SIZE_FIELD);
}
 
Example 19
Project: pdi-hcp-plugin   File: HCPDeleteMeta.java   View source code 6 votes vote down vote up
@Override
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases)
    throws KettleException {

  String connectionName = rep.getStepAttributeString(id_step, TAG_CONNECTION);
  if (StringUtils.isNotEmpty(connectionName)) {
    try {
      connection = HCPConnectionUtils.getConnectionFactory(metaStore).loadElement(connectionName);
    } catch(MetaStoreException e) {
      // We just log the message but we don't abort the complete meta-data loading.
      //
      log.logError(BaseMessages.getString(PKG, "HCPPutMeta.Error.HCPConnectionNotFound", connectionName));
      connection = null;
    }
  }
  targetFileField = rep.getStepAttributeString(id_step, TAG_TARGET_FILE_FIELD);
  responseCodeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_CODE_FIELD);
  responseTimeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_TIME_FIELD);
}
 
Example 20
Project: pdi-hcp-plugin   File: HCPPutMeta.java   View source code 6 votes vote down vote up
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
  
  // Optionally add a fields...
  //
  if (StringUtils.isNotEmpty(responseCodeField)) {
    ValueMetaInterface codeValue = new ValueMetaInteger(responseCodeField);
    codeValue.setLength(3);
    codeValue.setOrigin(name);
    inputRowMeta.addValueMeta(codeValue);
  }
  
  if (StringUtils.isNotEmpty(responseTimeField)) {
    ValueMetaInterface timeValue = new ValueMetaInteger(responseTimeField);
    timeValue.setLength(7);
    timeValue.setOrigin(name);
    inputRowMeta.addValueMeta(timeValue);
  }
}
 
Example 21
Project: pdi-hcp-plugin   File: HCPPutMeta.java   View source code 6 votes vote down vote up
@Override
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases)
    throws KettleException {

  String connectionName = rep.getStepAttributeString(id_step, TAG_CONNECTION);
  if (StringUtils.isNotEmpty(connectionName)) {
    try {
      connection = HCPConnectionUtils.getConnectionFactory(metaStore).loadElement(connectionName);
    } catch(MetaStoreException e) {
      // We just log the message but we don't abort the complete meta-data loading.
      //
      log.logError(BaseMessages.getString(PKG, "HCPPutMeta.Error.HCPConnectionNotFound", connectionName));
      connection = null;
    }
  }
  sourceFileField = rep.getStepAttributeString(id_step, TAG_SOURCE_FILE_FIELD);
  targetFileField = rep.getStepAttributeString(id_step, TAG_TARGET_FILE_FIELD);
  updating = rep.getStepAttributeBoolean(id_step, TAG_UPDATING);
  responseCodeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_CODE_FIELD);
  responseTimeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_TIME_FIELD);
}
 
Example 22
Project: carbondata   File: CarbonSliceMergerStepMeta.java   View source code 6 votes vote down vote up
/**
 * Read the steps information from a Kettle repository
 *
 * @param rep       The repository to read from
 * @param idStep    The step ID
 * @param databases The databases to reference
 * @param counters  The counters to reference
 * @throws KettleException When an unexpected error occurred (database, network, etc)
 */
@Override public void readRep(Repository rep, ObjectId idStep, List<DatabaseMeta> databases,
    Map<String, Counter> counters) throws KettleException {
  try {
    tabelName = rep.getStepAttributeString(idStep, "TableName");
    mdkeySize = rep.getStepAttributeString(idStep, "MDKeySize");
    measureCount = rep.getStepAttributeString(idStep, "Measurecount");
    heirAndKeySize = rep.getStepAttributeString(idStep, "HeirAndKeySize");
    databaseName = rep.getStepAttributeString(idStep, "databaseName");
    tableName = rep.getStepAttributeString(idStep, "tableName");
    groupByEnabled = rep.getStepAttributeString(idStep, "isGroupByEnabled");
    aggregatorClassString = rep.getStepAttributeString(idStep, "aggregatorClassString");
    aggregatorString = rep.getStepAttributeString(idStep, "aggregatorString");
    factDimLensString = rep.getStepAttributeString(idStep, "factDimLensString");
    levelAnddataTypeString = rep.getStepAttributeString(idStep, "levelAnddataTypeString");
    partitionID = rep.getStepAttributeString(idStep, "partitionID");
    segmentId = rep.getStepAttributeString(idStep, "segmentId");
    taskNo = rep.getStepAttributeString(idStep, "taskNo");
  } catch (Exception exception) {
    throw new KettleException(BaseMessages
        .getString(PKG, "CarbonDataWriterStepMeta.Exception.UnexpectedErrorInReadingStepInfo"),
        exception);
  }

}
 
Example 23
Project: carbondata   File: SortKeyStepMeta.java   View source code 6 votes vote down vote up
/**
 * Read the steps information from a Kettle repository
 *
 * @param rep       The repository to read from
 * @param idStep    The step ID
 * @param databases The databases to reference
 * @param counters  The counters to reference
 * @throws KettleException When an unexpected error occurred (database, network, etc)
 */
public void readRep(Repository rep, ObjectId idStep, List<DatabaseMeta> databases,
    Map<String, Counter> counters) throws KettleException {
  try {
    this.tabelName = rep.getStepAttributeString(idStep, "TableName");
    this.outputRowSize = rep.getStepAttributeString(idStep, "outputRowSize");
    this.databaseName = rep.getStepAttributeString(idStep, "databaseName");
    this.tableName = rep.getStepAttributeString(idStep, "tableName");
    this.dimensionCount = rep.getStepAttributeString(idStep, "dimensionCount");
    this.noDictionaryDims = rep.getStepAttributeString(idStep, "noDictionaryDims");
    this.noDictionaryDims = rep.getStepAttributeString(idStep, "noDictionaryDimsMapping");
    this.complexDimensionCount = rep.getStepAttributeString(idStep, "complexDimensionCount");
    this.measureCount = rep.getStepAttributeString(idStep, "measureCount");
    this.updateMemberRequest = rep.getStepAttributeString(idStep, "isUpdateMemberRequest");
    this.measureDataType = rep.getStepAttributeString(idStep, "measureDataType");
    this.partitionID = rep.getStepAttributeString(idStep, "partitionID");
    this.segmentId = rep.getStepAttributeString(idStep, "segmentId");
    this.taskNo = rep.getStepAttributeString(idStep, "taskNo");
  } catch (Exception ex) {
    throw new KettleException(BaseMessages
        .getString(PKG, "CarbonDataWriterStepMeta.Exception.UnexpectedErrorInReadingStepInfo",
            new String[0]), ex);
  }
}
 
Example 24
Project: carbondata   File: MDKeyGenStepMeta.java   View source code 6 votes vote down vote up
@Override public void readRep(Repository rep, ObjectId idStep, List<DatabaseMeta> databases,
    Map<String, Counter> counters) throws KettleException {
  try {
    tableName = rep.getStepAttributeString(idStep, "TableName");
    aggregateLevels = rep.getStepAttributeString(idStep, "AggregateLevels");
    numberOfCores = rep.getStepAttributeString(idStep, "NumberOfCores");
    databaseName = rep.getStepAttributeString(idStep, "databaseName");
    tableName = rep.getStepAttributeString(idStep, "tableName");
    noDictionaryDims = rep.getStepAttributeString(idStep, "noDictionaryDims");
    measureCount = rep.getStepAttributeString(idStep, "measureCount");
    columnGroupsString = rep.getStepAttributeString(idStep, "dimensionsStoreType");
    dimensionCount = rep.getStepAttributeString(idStep, "dimensionCount");
    complexDimsCount = rep.getStepAttributeString(idStep, "complexDimsCount");
    complexTypeString = rep.getStepAttributeString(idStep, "complexTypeString");
    measureDataType = rep.getStepAttributeString(idStep, "measureDataType");
    taskNo = rep.getStepAttributeString(idStep, "taskNo");
    factTimeStamp = rep.getStepAttributeString(idStep, "factTimeStamp");
    partitionID = rep.getStepAttributeString(idStep, "partitionID");
    isUseInvertedIndex = rep.getStepAttributeString(idStep, "isUseInvertedIndex");
    segmentId = rep.getStepAttributeString(idStep, "segmentId");
    noDictionaryDimsMapping = rep.getStepAttributeString(idStep, "noDictionaryDimsMapping");
  } catch (Exception e) {
    throw new KettleException(BaseMessages
        .getString(pkg, "CarbonMDKeyStepMeta.Exception.UnexpectedErrorInReadingStepInfo"), e);
  }
}
 
Example 25
Project: pentaho-mqtt-plugin   File: MQTTPublisherMeta.java   View source code 6 votes vote down vote up
@Override public void readRep( Repository rep, IMetaStore metaStore, ObjectId stepId, List<DatabaseMeta> databases )
    throws KettleException {
  try {
    broker = rep.getStepAttributeString( stepId, "BROKER" );
    topic = rep.getStepAttributeString( stepId, "TOPIC" );
    m_topicIsFromField = rep.getStepAttributeBoolean( stepId, "TOPIC_IS_FROM_FIELD" );
    field = rep.getStepAttributeString( stepId, "FIELD" );
    clientId = rep.getStepAttributeString( stepId, "CLIENT_ID" );
    timeout = rep.getStepAttributeString( stepId, "TIMEOUT" );
    qos = rep.getStepAttributeString( stepId, "QOS" );
    requiresAuth = Boolean.parseBoolean( rep.getStepAttributeString( stepId, "REQUIRES_AUTH" ) );
    username = rep.getStepAttributeString( stepId, "USERNAME" );
    password = rep.getStepAttributeString( stepId, "PASSWORD" );

    sslCaFile = rep.getStepAttributeString( stepId, "SSL_CA_FILE" );
    sslCertFile = rep.getStepAttributeString( stepId, "SSL_CERT_FILE" );
    sslKeyFile = rep.getStepAttributeString( stepId, "SSL_KEY_FILE" );
    sslKeyFilePass = rep.getStepAttributeString( stepId, "SSL_KEY_FILE_PASS" );
  } catch ( Exception e ) {
    throw new KettleException( "MQTTClientMeta.Exception.loadRep", e );
  }
}
 
Example 26
Project: PentahoSnowflakePlugin   File: WarehouseManager.java   View source code 6 votes vote down vote up
public void loadXML( Node entryNode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep ) throws KettleXMLException {
  try {
    super.loadXML( entryNode, databases, slaveServers );
    String dbname = XMLHandler.getTagValue( entryNode, CONNECTION );
    databaseMeta = DatabaseMeta.findDatabase( databases, dbname );

    setManagementAction( XMLHandler.getTagValue( entryNode, MANAGEMENT_ACTION ) );
    setReplace( "Y".equalsIgnoreCase( XMLHandler.getTagValue( entryNode, REPLACE ) ) );
    setFailIfExists( "Y".equalsIgnoreCase( XMLHandler.getTagValue( entryNode, FAIL_IF_EXISTS ) ) );
    setWarehouseName( XMLHandler.getTagValue( entryNode, WAREHOUSE_NAME ) );
    setWarehouseSize( XMLHandler.getTagValue( entryNode, WAREHOUSE_SIZE ) );
    setWarehouseType( XMLHandler.getTagValue( entryNode, WAREHOUSE_TYPE ) );
    setMaxClusterCount( XMLHandler.getTagValue( entryNode, MAX_CLUSTER_COUNT ) );
    setMinClusterCount( XMLHandler.getTagValue( entryNode, MIN_CLUSTER_COUNT ) );
    setAutoSuspend( XMLHandler.getTagValue( entryNode, AUTO_SUSPEND ) );
    setAutoResume( "Y".equalsIgnoreCase( XMLHandler.getTagValue( entryNode, AUTO_RESUME ) ) );
    setInitiallySuspended( "Y".equalsIgnoreCase( XMLHandler.getTagValue( entryNode, INITIALLY_SUSPENDED ) ) );
    setResourceMonitor( XMLHandler.getTagValue( entryNode, RESOURCE_MONITOR ) );
    setComment( XMLHandler.getTagValue( entryNode, COMMENT ) );
    setFailIfNotExists( "Y".equalsIgnoreCase( XMLHandler.getTagValue( entryNode, FAIL_IF_NOT_EXISTS ) ) );
  } catch ( KettleXMLException dbe ) {
    throw new KettleXMLException( BaseMessages.getString( PKG, "SnowflakeWarehouseManager.Error.Exception.UnableLoadXML" ), dbe );
  }
}
 
Example 27
Project: PentahoSnowflakePlugin   File: WarehouseManager.java   View source code 6 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
                     List<SlaveServer> slaveServers ) throws KettleException {
  try {
    setManagementAction( rep.getJobEntryAttributeString( id_jobentry, MANAGEMENT_ACTION ) );
    setReplace( rep.getJobEntryAttributeBoolean( id_jobentry, REPLACE ) );
    setFailIfExists( rep.getJobEntryAttributeBoolean( id_jobentry, FAIL_IF_EXISTS ) );
    setWarehouseName( rep.getJobEntryAttributeString( id_jobentry, WAREHOUSE_NAME ) );
    setWarehouseSize( rep.getJobEntryAttributeString( id_jobentry, WAREHOUSE_SIZE ) );
    setWarehouseType( rep.getJobEntryAttributeString( id_jobentry, WAREHOUSE_TYPE ) );
    setMaxClusterCount( rep.getJobEntryAttributeString( id_jobentry, MAX_CLUSTER_COUNT ) );
    setMinClusterCount( rep.getJobEntryAttributeString( id_jobentry, MIN_CLUSTER_COUNT ) );
    setAutoSuspend( rep.getJobEntryAttributeString( id_jobentry, AUTO_SUSPEND ) );
    setAutoResume( rep.getJobEntryAttributeBoolean( id_jobentry, AUTO_RESUME ) );
    setInitiallySuspended( rep.getJobEntryAttributeBoolean( id_jobentry, INITIALLY_SUSPENDED ) );
    setResourceMonitor( rep.getJobEntryAttributeString( id_jobentry, RESOURCE_MONITOR ) );
    setComment( rep.getJobEntryAttributeString( id_jobentry, COMMENT ) );
    databaseMeta = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, CONNECTION, "id_database", databases );
    setFailIfNotExists( rep.getJobEntryAttributeBoolean( id_jobentry, FAIL_IF_NOT_EXISTS ) );
  } catch ( KettleException dbe ) {

    throw new KettleException( BaseMessages.getString( PKG, "SnowflakeWarehouseManager.Error.Exception.UnableLoadRep" )
      + id_jobentry, dbe );
  }
}
 
Example 28
Project: PentahoSnowflakePlugin   File: WarehouseManager.java   View source code 6 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_job ) throws KettleException {
  try {
    rep.saveDatabaseMetaJobEntryAttribute( id_job, getObjectId(), CONNECTION, "id_database", databaseMeta );
    rep.saveJobEntryAttribute( id_job, getObjectId(), MANAGEMENT_ACTION, getManagementAction() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), REPLACE, isReplace() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), FAIL_IF_EXISTS, isFailIfExists() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), WAREHOUSE_NAME, getWarehouseName() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), WAREHOUSE_SIZE, getWarehouseSize() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), WAREHOUSE_TYPE, getWarehouseType() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), MAX_CLUSTER_COUNT, getMaxClusterCount() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), MIN_CLUSTER_COUNT, getMinClusterCount() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), AUTO_SUSPEND, getAutoSuspend() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), AUTO_RESUME, isAutoResume() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), INITIALLY_SUSPENDED, isInitiallySuspended() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), RESOURCE_MONITOR, getResourceMonitor() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), COMMENT, getComment() );
    rep.saveJobEntryAttribute( id_job, getObjectId(), FAIL_IF_NOT_EXISTS, isFailIfNotExists() );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleDatabaseException( BaseMessages.getString( PKG, "SnowflakeWarehouseManager.Error.Exception.UnableSaveRep" )
      + getObjectId(), dbe );
  }
}
 
Example 29
Project: pdi-zendesk-plugin   File: ZendeskInputOrganizationsMeta.java   View source code 6 votes vote down vote up
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
  if ( nextStep != null ) {
    if ( nextStep.equals( organizationStepMeta ) ) {
      prepareExecutionResultsOrganization( inputRowMeta, space );
    } else if ( nextStep.equals( organizationTagStepMeta ) ) {
      prepareExecutionResultsOrganizationTag( inputRowMeta, space );
    } else if ( nextStep.equals( organizationFieldStepMeta ) ) {
      prepareExecutionResultsOrganizationField( inputRowMeta, space );
    } else if ( nextStep.equals( organizationDomainStepMeta ) ) {
      prepareExecutionResultsOrganizationDomain( inputRowMeta, space );
    }
  }
}
 
Example 30
Project: pdi-zendesk-plugin   File: ZendeskInputOrganizationsMeta.java   View source code 6 votes vote down vote up
@Override
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases )
  throws KettleException {
  super.readRep( rep, metaStore, id_step, databases );
  setIncomingFieldname( rep.getStepAttributeString( id_step, "incomingFieldname" ) );
  setOrganizationIdFieldname( rep.getStepAttributeString( id_step, "organizationIdFieldname" ) );
  setUrlFieldname( rep.getStepAttributeString( id_step, "urlFieldname" ) );
  setExternalIdFieldname( rep.getStepAttributeString( id_step, "externalIdFieldname" ) );
  setNameFieldname( rep.getStepAttributeString( id_step, "nameFieldname" ) );
  setCreatedAtFieldname( rep.getStepAttributeString( id_step, "createdAtFieldname" ) );
  setUpdatedAtFieldname( rep.getStepAttributeString( id_step, "updatedAtFieldname" ) );
  setDetailsFieldname( rep.getStepAttributeString( id_step, "detailsFieldname" ) );
  setNotesFieldname( rep.getStepAttributeString( id_step, "notesFieldname" ) );
  setGroupIdFieldname( rep.getStepAttributeString( id_step, "groupIdFieldname" ) );
  setSharedTicketsFieldname( rep.getStepAttributeString( id_step, "sharedTicketsFieldname" ) );
  setSharedCommentsFieldname( rep.getStepAttributeString( id_step, "sharedCommentsFieldname" ) );
  setTagFieldname( rep.getStepAttributeString( id_step, "tagFieldname" ) );
  setDomainNameFieldname( rep.getStepAttributeString( id_step, "domainNameFieldname" ) );
  setOrgFieldNameFieldname( rep.getStepAttributeString( id_step, "orgFieldNameFieldname" ) );
  setOrgFieldValueFieldname( rep.getStepAttributeString( id_step, "orgFieldValueFieldname" ) );
  setOrganizationStepName( rep.getStepAttributeString( id_step, "organizationStepName" ) );
  setOrganizationTagStepName( rep.getStepAttributeString( id_step, "organizationTagStepName" ) );
  setOrganizationFieldStepName( rep.getStepAttributeString( id_step, "organizationFieldStepName" ) );
  setOrganizationDomainStepName( rep.getStepAttributeString( id_step, "organizationDomainStepName" ) );
}
 
Example 31
Project: pdi-zendesk-plugin   File: ZendeskInputTicketFieldsMeta.java   View source code 6 votes vote down vote up
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldIdFieldname() ),
    ValueMetaInterface.TYPE_INTEGER );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldUrlFieldname() ),
    ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldTypeFieldname() ),
    ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldTitleFieldname() ),
    ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldActiveFieldname() ),
    ValueMetaInterface.TYPE_BOOLEAN );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldRequiredFieldname() ),
    ValueMetaInterface.TYPE_BOOLEAN );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketFieldVisibleEndUsersFieldname() ),
    ValueMetaInterface.TYPE_BOOLEAN );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
 
Example 32
Project: pdi-zendesk-plugin   File: ZendeskInputTicketFieldsMeta.java   View source code 6 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
  throws KettleException {
  super.saveRep( rep, metaStore, id_transformation, id_step );
  rep.saveStepAttribute( id_transformation, id_step, "ticketFieldIdFieldname", getTicketFieldIdFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "ticketFieldUrlFieldname", getTicketFieldUrlFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "ticketFieldTypeFieldname", getTicketFieldTypeFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "ticketFieldTitleFieldname", getTicketFieldTitleFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "ticketFieldActiveFieldname", getTicketFieldActiveFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "ticketFieldRequiredFieldname",
    getTicketFieldRequiredFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "ticketFieldVisibleEndUsersFieldname",
    getTicketFieldVisibleEndUsersFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "createdAtFieldname", getCreatedAtFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "updatedAtFieldname", getUpdatedAtFieldname() );
}
 
Example 33
Project: pdi-zendesk-plugin   File: ZendeskInputHCSectionMeta.java   View source code 6 votes vote down vote up
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionNameFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getSourceLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getSectionHtmlUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getOutdatedFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getPositionFieldname() ), ValueMetaInterface.TYPE_INTEGER );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
 
Example 34
Project: pdi-zendesk-plugin   File: ZendeskInputHCSectionMeta.java   View source code 6 votes vote down vote up
@Override
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases )
  throws KettleException {
  super.readRep( rep, metaStore, id_step, databases );
  setSectionIdFieldname( rep.getStepAttributeString( id_step, "sectionIdFieldname" ) );
  setSectionUrlFieldname( rep.getStepAttributeString( id_step, "sectionUrlFieldname" ) );
  setSectionNameFieldname( rep.getStepAttributeString( id_step, "sectionNameFieldname" ) );
  setCategoryIdFieldname( rep.getStepAttributeString( id_step, "categoryIdFieldname" ) );
  setLocaleFieldname( rep.getStepAttributeString( id_step, "localeFieldname" ) );
  setSourceLocaleFieldname( rep.getStepAttributeString( id_step, "sourceLocaleFieldname" ) );
  setSectionHtmlUrlFieldname( rep.getStepAttributeString( id_step, "sectionHtmlUrlFieldname" ) );
  setOutdatedFieldname( rep.getStepAttributeString( id_step, "outdatedFieldname" ) );
  setPositionFieldname( rep.getStepAttributeString( id_step, "positionFieldname" ) );
  setCreatedAtFieldname( rep.getStepAttributeString( id_step, "createdAtFieldname" ) );
  setUpdatedAtFieldname( rep.getStepAttributeString( id_step, "updatedAtFieldname" ) );
}
 
Example 35
Project: pdi-zendesk-plugin   File: ZendeskInputHCSectionMeta.java   View source code 6 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
  throws KettleException {
  super.saveRep( rep, metaStore, id_transformation, id_step );
  rep.saveStepAttribute( id_transformation, id_step, "sectionIdFieldname", getSectionIdFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "sectionUrlFieldname", getSectionUrlFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "sectionNameFieldname", getSectionNameFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "categoryIdFieldname", getCategoryIdFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "localeFieldname", getLocaleFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "sourceLocaleFieldname", getSourceLocaleFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "sectionHtmlUrlFieldname", getSectionHtmlUrlFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "outdatedFieldname", getOutdatedFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "positionFieldname", getPositionFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "createdAtFieldname", getCreatedAtFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "updatedAtFieldname", getUpdatedAtFieldname() );
}
 
Example 36
Project: pdi-zendesk-plugin   File: ZendeskInputTicketAuditMeta.java   View source code 6 votes vote down vote up
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  if ( nextStep != null ) {
    if ( nextStep.equals( ticketOverviewStepMeta ) ) {
      prepareExecutionResultsTicketOverview( inputRowMeta, space );
    } else if ( nextStep.equals( ticketCommentsStepMeta ) ) {
      prepareExecutionResultsTicketComments( inputRowMeta, space );
    } else if ( nextStep.equals( ticketCustomFieldsStepMeta ) ) {
      prepareExecutionResultsTicketCustomFields( inputRowMeta, space );
    } else if ( nextStep.equals( ticketTagsStepMeta ) ) {
      prepareExecutionResultsTicketTags( inputRowMeta, space );
    } else if ( nextStep.equals( ticketCollaboratorsStepMeta ) ) {
      prepareExecutionResultsTicketCollaborators( inputRowMeta, space );
    }
  }
}
 
Example 37
Project: pdi-zendesk-plugin   File: ZendeskInputHCCategoryMeta.java   View source code 6 votes vote down vote up
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryNameFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getDescriptionFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getSourceLocaleFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCategoryHtmlUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getOutdatedFieldname() ), ValueMetaInterface.TYPE_BOOLEAN );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getPositionFieldname() ), ValueMetaInterface.TYPE_INTEGER );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
}
 
Example 38
Project: pdi-zendesk-plugin   File: ZendeskInputHCCategoryMeta.java   View source code 6 votes vote down vote up
@Override
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases )
  throws KettleException {
  super.readRep( rep, metaStore, id_step, databases );
  setCategoryIdFieldname( rep.getStepAttributeString( id_step, "categoryIdFieldname" ) );
  setCategoryUrlFieldname( rep.getStepAttributeString( id_step, "categoryUrlFieldname" ) );
  setCategoryNameFieldname( rep.getStepAttributeString( id_step, "categoryNameFieldname" ) );
  setDescriptionFieldname( rep.getStepAttributeString( id_step, "descriptionFieldname" ) );
  setLocaleFieldname( rep.getStepAttributeString( id_step, "localeFieldname" ) );
  setSourceLocaleFieldname( rep.getStepAttributeString( id_step, "sourceLocaleFieldname" ) );
  setCategoryHtmlUrlFieldname( rep.getStepAttributeString( id_step, "categoryHtmlUrlFieldname" ) );
  setOutdatedFieldname( rep.getStepAttributeString( id_step, "outdatedFieldname" ) );
  setPositionFieldname( rep.getStepAttributeString( id_step, "positionFieldname" ) );
  setCreatedAtFieldname( rep.getStepAttributeString( id_step, "createdAtFieldname" ) );
  setUpdatedAtFieldname( rep.getStepAttributeString( id_step, "updatedAtFieldname" ) );
}
 
Example 39
Project: pdi-zendesk-plugin   File: ZendeskInputHCCategoryMeta.java   View source code 6 votes vote down vote up
@Override
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step )
  throws KettleException {
  super.saveRep( rep, metaStore, id_transformation, id_step );
  rep.saveStepAttribute( id_transformation, id_step, "categoryIdFieldname", getCategoryIdFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "categoryUrlFieldname", getCategoryUrlFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "categoryNameFieldname", getCategoryNameFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "descriptionFieldname", getDescriptionFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "localeFieldname", getLocaleFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "sourceLocaleFieldname", getSourceLocaleFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "categoryHtmlUrlFieldname", getCategoryHtmlUrlFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "outdatedFieldname", getOutdatedFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "positionFieldname", getPositionFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "createdAtFieldname", getCreatedAtFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "updatedAtFieldname", getUpdatedAtFieldname() );
}
 
Example 40
Project: pdi-zendesk-plugin   File: ZendeskInputSuspendedTicketsMeta.java   View source code 6 votes vote down vote up
@Override
public void getFields( RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
  super.getFields( inputRowMeta, name, info, nextStep, space, repository, metaStore );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getSuspendedTicketIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getSuspendedTicketUrlFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getAuthorFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getSubjectFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getContentFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCauseFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getMessageIdFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getTicketIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getRecipientFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getCreatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getUpdatedAtFieldname() ), ValueMetaInterface.TYPE_DATE );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getViaFieldname() ), ValueMetaInterface.TYPE_STRING );
  addFieldToRow( inputRowMeta, space.environmentSubstitute( getBrandIdFieldname() ), ValueMetaInterface.TYPE_INTEGER );
}