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

The following are top voted examples for showing how to use org.pentaho.di.repository.ObjectId. 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: 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 2
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 3
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 4
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 5
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 6
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 7
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 8
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 9
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 10
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 11
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 12
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 13
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 14
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 15
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 16
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 17
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 18
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 19
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 20
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 21
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 22
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 23
Project: pdi-zendesk-plugin   File: ZendeskInputSuspendedTicketsMeta.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 );
  setSuspendedTicketIdFieldname( rep.getStepAttributeString( id_step, "suspendedTicketIdFieldname" ) );
  setSuspendedTicketUrlFieldname( rep.getStepAttributeString( id_step, "suspendedTicketUrlFieldname" ) );
  setAuthorFieldname( rep.getStepAttributeString( id_step, "authorFieldname" ) );
  setSubjectFieldname( rep.getStepAttributeString( id_step, "subjectFieldname" ) );
  setContentFieldname( rep.getStepAttributeString( id_step, "contentFieldname" ) );
  setCauseFieldname( rep.getStepAttributeString( id_step, "causeFieldname" ) );
  setMessageIdFieldname( rep.getStepAttributeString( id_step, "messageIdFieldname" ) );
  setTicketIdFieldname( rep.getStepAttributeString( id_step, "ticketIdFieldname" ) );
  setRecipientFieldname( rep.getStepAttributeString( id_step, "recipientFieldname" ) );
  setCreatedAtFieldname( rep.getStepAttributeString( id_step, "createdAtFieldname" ) );
  setUpdatedAtFieldname( rep.getStepAttributeString( id_step, "updatedAtFieldname" ) );
  setViaFieldname( rep.getStepAttributeString( id_step, "viaFieldname" ) );
  setBrandIdFieldname( rep.getStepAttributeString( id_step, "brandIdFieldname" ) );
}
 
Example 24
Project: pdi-zendesk-plugin   File: ZendeskInputSuspendedTicketsMeta.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, "suspendedTicketIdFieldname", getSuspendedTicketIdFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "suspendedTicketUrlFieldname", getSuspendedTicketUrlFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "authorFieldname", getAuthorFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "subjectFieldname", getSubjectFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "contentFieldname", getContentFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "causeFieldname", getCauseFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "messageIdFieldname", getMessageIdFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "ticketIdFieldname", getTicketIdFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "recipientFieldname", getRecipientFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "createdAtFieldname", getCreatedAtFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "updatedAtFieldname", getUpdatedAtFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "viaFieldname", getViaFieldname() );
  rep.saveStepAttribute( id_transformation, id_step, "brandIdFieldname", getBrandIdFieldname() );
}
 
Example 25
Project: pentaho-sequoiadb-plugin   File: SequoiaDBInputMeta.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, "hostname", getHostname() );
   rep.saveStepAttribute( id_transformation, id_step, "port", getPort() );
   rep.saveStepAttribute( id_transformation, id_step, "sequoiadbusername", getUserName() );
   rep.saveStepAttribute( id_transformation, id_step, "sequoiadbpassword", getPwd() );
   rep.saveStepAttribute( id_transformation, id_step, "CSName", getCSName() );
   rep.saveStepAttribute( id_transformation, id_step, "CLName", getCLName() );
   rep.saveStepAttribute( id_transformation, id_step, "query", getQuery() );
   rep.saveStepAttribute( id_transformation, id_step, "selector", getSelector() );
   rep.saveStepAttribute( id_transformation, id_step, "orderby", getOrderby() );
   rep.saveStepAttribute( id_transformation, id_step, "skip", getSkipStr() );
   rep.saveStepAttribute( id_transformation, id_step, "limit", getLimitStr() );
   
   if (m_fields != null && m_fields.size() > 0){
      for (int i = 0; i < m_fields.size(); i++){
         SequoiaDBInputField fieldTmp = m_fields.get(i);
         rep.saveStepAttribute(id_transformation, id_step, i, "field_name", fieldTmp.m_fieldName);
         rep.saveStepAttribute(id_transformation, id_step, i, "field_path", fieldTmp.m_path);
         rep.saveStepAttribute(id_transformation, id_step, i, "field_type", fieldTmp.m_kettleType);
      }
   }
}
 
Example 26
Project: read-open-source-code   File: RepositoryExplorerDialog.java   View source code 6 votes vote down vote up
public void editPartitionSchema(String partitionSchemaName)
{
    try
    {
        ObjectId id = rep.getPartitionSchemaID(partitionSchemaName);
        PartitionSchema partitionSchema = rep.loadPartitionSchema(id, null);  // Load the last version

        PartitionSchemaDialog dd = new PartitionSchemaDialog(shell, partitionSchema, rep.readDatabases(), variableSpace);
        if (dd.open())
        {
            rep.insertLogEntry("Updating partition schema '"+partitionSchema.getName()+"'");
            rep.save(partitionSchema, Const.VERSION_COMMENT_EDIT_VERSION, null);
            if(!partitionSchemaName.equalsIgnoreCase(partitionSchema.getName())) refreshTree();
        }
    }
    catch(KettleException e)
    {
        new ErrorDialog(shell, BaseMessages.getString(PKG, "RepositoryExplorerDialog.PartitionSchema.Edit.UnexpectedError.Title"), 
                BaseMessages.getString(PKG, "RepositoryExplorerDialog.PartitionSchema.Edit.UnexpectedError.Message")+partitionSchemaName+"]", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
}
 
Example 27
Project: read-open-source-code   File: StepsMetricsMeta.java   View source code 6 votes vote down vote up
public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step) throws KettleException
{
    try
    {
         for (int i = 0; i < stepName.length; i++)
         {
             rep.saveStepAttribute(id_transformation, id_step, i, "step_name", stepName[i]);
             rep.saveStepAttribute(id_transformation, id_step, i, "step_CopyNr", stepCopyNr[i]);
             rep.saveStepAttribute(id_transformation, id_step, i, "step_required", stepRequired[i]);
         }
         rep.saveStepAttribute(id_transformation, id_step, "stepnamefield",         stepnamefield);
         rep.saveStepAttribute(id_transformation, id_step, "stepidfield",         stepidfield);
         rep.saveStepAttribute(id_transformation, id_step, "steplinesinputfield",         steplinesinputfield);
         rep.saveStepAttribute(id_transformation, id_step, "steplinesoutputfield",         steplinesoutputfield);
         rep.saveStepAttribute(id_transformation, id_step, "steplinesreadfield",         steplinesreadfield);
         rep.saveStepAttribute(id_transformation, id_step, "steplineswrittentfield",         steplineswrittentfield);
         rep.saveStepAttribute(id_transformation, id_step, "steplinesupdatedfield",         steplinesupdatedfield);
         rep.saveStepAttribute(id_transformation, id_step, "steplineserrorsfield",         steplineserrorsfield);
         rep.saveStepAttribute(id_transformation, id_step, "stepsecondsfield",         stepsecondsfield); 
     }
     catch (Exception e)
     {
         throw new KettleException("Unable to save step information to the repository for id_step=" + id_step, e);
     }
 }
 
Example 28
Project: pdi-zookeeper   File: ZooKeeperOutputMeta.java   View source code 6 votes vote down vote up
public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
  try {
    rep.saveStepAttribute( id_transformation, id_step, "createPaths", isCreatePaths() );
    if ( fields != null ) {
      int i = 0;
      for ( ZooKeeperField field : fields ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "name", field.getFieldName() );
        rep.saveStepAttribute( id_transformation, id_step, i, "path", field.getPath() );
        rep.saveStepAttribute( id_transformation, id_step, i, "type", field.getType().getName() );
        i++;
      }
    }

  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "ZooKeeperOutputMeta.Exception.UnableToSaveStepInfoToRepository" )
      + id_step, e );
  }
}
 
Example 29
Project: read-open-source-code   File: NumberRangeMeta.java   View source code 6 votes vote down vote up
public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step)
					throws KettleException 
	{
 		try 
 		{
 			rep.saveStepAttribute(id_transformation, id_step, "inputField",	inputField);
 			rep.saveStepAttribute(id_transformation, id_step, "outputField",outputField);
 			rep.saveStepAttribute(id_transformation, id_step, "fallBackValue",	getFallBackValue());
 
 			int i = 0;
 			for (NumberRangeRule rule : rules) 
 			{
 				rep.saveStepAttribute(id_transformation, id_step, i,"lower_bound", String.valueOf(rule.getLowerBound())); //$NON-NLS-1$
 				rep.saveStepAttribute(id_transformation, id_step, i,"upper_bound", String.valueOf(rule.getUpperBound())); //$NON-NLS-1$
 				rep.saveStepAttribute(id_transformation, id_step, i, "value",	String.valueOf(rule.getValue())); //$NON-NLS-1$
 				i++;
 			}
 		} 
 catch (KettleDatabaseException dbe) 
	{
 			throw new KettleException(	"Unable to save step information to the repository, id_step="+	 id_step, dbe);
 }
}
 
Example 30
Project: read-open-source-code   File: JobEntryFoldersCompare.java   View source code 6 votes vote down vote up
public void loadRep(Repository rep, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException
{
	try
	{
		includesubfolders = rep.getJobEntryAttributeBoolean(id_jobentry, "include_subfolders");
		comparefilecontent = rep.getJobEntryAttributeBoolean(id_jobentry, "compare_filecontent");
		comparefilesize = rep.getJobEntryAttributeBoolean(id_jobentry, "compare_filesize");
		
		compareonly = rep.getJobEntryAttributeString(id_jobentry, "compareonly");
		wildcard = rep.getJobEntryAttributeString(id_jobentry, "wildcard");
		filename1 = rep.getJobEntryAttributeString(id_jobentry, "filename1");
		filename2 = rep.getJobEntryAttributeString(id_jobentry, "filename2");
	}
	catch(KettleException dbe)
	{
		throw new KettleException(BaseMessages.getString(PKG, "JobFoldersCompare.Meta.UnableLoadRep",""+id_jobentry, dbe.getMessage()));
	}
}
 
Example 31
Project: read-open-source-code   File: KettleDatabaseRepositoryJobEntryDelegate.java   View source code 6 votes vote down vote up
public void loadJobEntryBase(JobEntryBase jobEntryBase, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException {
	try {
		RowMetaAndData r = getJobEntry(id_jobentry);
		if (r != null) {
			jobEntryBase.setName(r.getString("NAME", null));

			jobEntryBase.setDescription(r.getString("DESCRIPTION", null));
			long id_jobentry_type = r.getInteger("ID_JOBENTRY_TYPE", 0);
			RowMetaAndData jetrow = getJobEntryType(new LongObjectId(id_jobentry_type) );
			if (jetrow != null) {
				jobEntryBase.setPluginId(jetrow.getString("CODE", null));
			}
		}
	} catch (KettleDatabaseException dbe) {
		throw new KettleException("Unable to load base job entry information from the repository for id_jobentry=" + id_jobentry, dbe);
	}
}
 
Example 32
Project: read-open-source-code   File: SystemDataMeta.java   View source code 6 votes vote down vote up
public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step) throws KettleException
{
	try
	{
		for (int i=0;i<fieldName.length;i++)
		{
			rep.saveStepAttribute(id_transformation, id_step, i, "field_name",      fieldName[i]);
			rep.saveStepAttribute(id_transformation, id_step, i, "field_type",      functions[fieldType[i]]!=null ? functions[fieldType[i]].getCode() : "");
		}
	}
	catch(Exception e)
	{
		throw new KettleException("Unable to save step information to the repository for id_step="+id_step, e);
	}

}
 
Example 33
Project: read-open-source-code   File: SetVariableMeta.java   View source code 6 votes vote down vote up
public void saveRep(Repository rep, ObjectId id_transformation, ObjectId id_step)
	throws KettleException
{
	try
	{
		for (int i=0;i<fieldName.length;i++)
		{
			rep.saveStepAttribute(id_transformation, id_step, i, "field_name", Const.isEmpty(fieldName[i])?"":fieldName[i]); //$NON-NLS-1$
			rep.saveStepAttribute(id_transformation, id_step, i, "variable_name",     variableName[i]); //$NON-NLS-1$
               rep.saveStepAttribute(id_transformation, id_step, i, "variable_type",   getVariableTypeCode(variableType[i])); //$NON-NLS-1$
               rep.saveStepAttribute(id_transformation, id_step, i, "default_value",     defaultValue[i]);
		}
		
           rep.saveStepAttribute(id_transformation, id_step, 0, "use_formatting", usingFormatting);
	}
	catch(Exception e)
	{
		throw new KettleException(BaseMessages.getString(PKG, "SetVariableMeta.RuntimeError.UnableToSaveRepository.SETVARIABLE0006", ""+id_step), e); //$NON-NLS-1$
	}

}
 
Example 34
Project: read-open-source-code   File: JobEntryAddResultFilenames.java   View source code 6 votes vote down vote up
public void loadRep(Repository rep, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException
{
  try
  {
    argFromPrevious = rep.getJobEntryAttributeBoolean(id_jobentry, "arg_from_previous"); //$NON-NLS-1$
    includeSubfolders = rep.getJobEntryAttributeBoolean(id_jobentry, "include_subfolders"); //$NON-NLS-1$

    deleteallbefore = rep.getJobEntryAttributeBoolean(id_jobentry, "delete_all_before");
    
    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes(id_jobentry, "name"); //$NON-NLS-1$
    arguments = new String[argnr];
    filemasks = new String[argnr];

    // Read them all...
    for (int a = 0; a < argnr; a++) {
      arguments[a] = rep.getJobEntryAttributeString(id_jobentry, a, "name"); //$NON-NLS-1$
      filemasks[a] = rep.getJobEntryAttributeString(id_jobentry, a, "filemask"); //$NON-NLS-1$
    }
  } catch (KettleException dbe) {
    throw new KettleException(BaseMessages.getString(PKG, "JobEntryAddResultFilenames.UnableToLoadFromRepo", String.valueOf(id_jobentry)), dbe); //$NON-NLS-1$
  }
}
 
Example 35
Project: pentaho-mqtt-producer   File: MQTTProducerMeta.java   View source code 6 votes vote down vote up
public void readRep(Repository rep, ObjectId stepId,
		List<DatabaseMeta> databases, Map<String, Counter> counters)
		throws KettleException {
	try {
		broker = rep.getStepAttributeString(stepId, "BROKER");
		topic = rep.getStepAttributeString(stepId, "TOPIC");
		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"));
		if (requiresAuth) {
			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 36
Project: read-open-source-code   File: ConnectionsController.java   View source code 6 votes vote down vote up
private void refreshConnectionList() {
  final List<UIDatabaseConnection> tmpList = new ArrayList<UIDatabaseConnection>();
  Runnable r = new Runnable() {
    public void run() {
      try {
        ObjectId[] dbIdList = repository.getDatabaseIDs(false);
        for (ObjectId dbId : dbIdList) {
          DatabaseMeta dbMeta = repository.loadDatabaseMeta(dbId, null);
          tmpList.add(new UIDatabaseConnection(dbMeta));
        }
      } catch (KettleException e) {
        // convert to runtime exception so it bubbles up through the UI
        throw new RuntimeException(e);
      }
    }
  };
  doWithBusyIndicator(r);
  dbConnectionList.setChildren(tmpList);
}
 
Example 37
Project: read-open-source-code   File: KettleDatabaseRepositoryDirectoryDelegate.java   View source code 6 votes vote down vote up
private synchronized ObjectId insertDirectory(ObjectId id_directory_parent, RepositoryDirectoryInterface dir)
    throws KettleException {
  ObjectId id = repository.connectionDelegate.getNextDirectoryID();

  String tablename = KettleDatabaseRepository.TABLE_R_DIRECTORY;
  RowMetaAndData table = new RowMetaAndData();
  table.addValue(
      new ValueMeta(KettleDatabaseRepository.FIELD_DIRECTORY_ID_DIRECTORY, ValueMetaInterface.TYPE_INTEGER), id);
  table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_DIRECTORY_ID_DIRECTORY_PARENT,
      ValueMetaInterface.TYPE_INTEGER), id_directory_parent);
  table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_DIRECTORY_DIRECTORY_NAME,
      ValueMetaInterface.TYPE_STRING), dir.getName());

  repository.connectionDelegate.getDatabase().prepareInsert(table.getRowMeta(), tablename);
  repository.connectionDelegate.getDatabase().setValuesInsert(table);
  repository.connectionDelegate.getDatabase().insertRow();
  repository.connectionDelegate.getDatabase().closeInsert();

  return id;
}
 
Example 38
Project: read-open-source-code   File: InjectorMeta.java   View source code 6 votes vote down vote up
public void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters)
	throws KettleException
{
       try
       {
          int nrfields = rep.countNrStepAttributes(id_step, "field_name"); //$NON-NLS-1$
           allocate(nrfields);
   
           for (int i=0;i<nrfields;i++)
           {
               fieldname[i]      = rep.getStepAttributeString (id_step, i, "field_name"); //$NON-NLS-1$
               type[i]      = ValueMeta.getType( rep.getStepAttributeString (id_step, i, "field_type")); //$NON-NLS-1$
               length[i]    = (int)rep.getStepAttributeInteger(id_step, i, "field_length"); //$NON-NLS-1$
               precision[i] = (int)rep.getStepAttributeInteger(id_step, i, "field_precision"); //$NON-NLS-1$
           }
       }
       catch(Exception e)
       {
           throw new KettleException(BaseMessages.getString(PKG, "InjectorMeta.Exception.ErrorReadingStepInfoFromRepository"), e); //$NON-NLS-1$
       }

}
 
Example 39
Project: read-open-source-code   File: KettleDatabaseRepositoryJobDelegate.java   View source code 6 votes vote down vote up
public synchronized ObjectId insertJobHop(ObjectId id_job, ObjectId id_jobentry_copy_from, ObjectId id_jobentry_copy_to, boolean enabled, boolean evaluation, boolean unconditional) throws KettleException {
	ObjectId id = repository.connectionDelegate.getNextJobHopID();

	RowMetaAndData table = new RowMetaAndData();

	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_HOP_ID_JOB_HOP, ValueMetaInterface.TYPE_INTEGER), id);
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_HOP_ID_JOB, ValueMetaInterface.TYPE_INTEGER), id_job);
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_HOP_ID_JOBENTRY_COPY_FROM, ValueMetaInterface.TYPE_INTEGER), id_jobentry_copy_from);
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_HOP_ID_JOBENTRY_COPY_TO, ValueMetaInterface.TYPE_INTEGER), id_jobentry_copy_to);
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_HOP_ENABLED, ValueMetaInterface.TYPE_BOOLEAN), Boolean.valueOf(enabled));
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_HOP_EVALUATION, ValueMetaInterface.TYPE_BOOLEAN), Boolean.valueOf(evaluation));
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_JOB_HOP_UNCONDITIONAL, ValueMetaInterface.TYPE_BOOLEAN), Boolean.valueOf(unconditional));

	repository.connectionDelegate.getDatabase().prepareInsert(table.getRowMeta(), KettleDatabaseRepository.TABLE_R_JOB_HOP);
	repository.connectionDelegate.getDatabase().setValuesInsert(table);
	repository.connectionDelegate.getDatabase().insertRow();
	repository.connectionDelegate.getDatabase().closeInsert();

	return id;
}
 
Example 40
Project: read-open-source-code   File: StringCutMeta.java   View source code 6 votes vote down vote up
public void readRep(Repository rep, ObjectId id_step, List<DatabaseMeta> databases, Map<String, Counter> counters)
    throws KettleException
    {
	try {

		int nrkeys = rep.countNrStepAttributes(id_step, "in_stream_name"); //$NON-NLS-1$

		allocate(nrkeys);
		for (int i = 0; i < nrkeys; i++) {
			fieldInStream[i] = Const.NVL(rep.getStepAttributeString(id_step, i,	"in_stream_name"), ""); //$NON-NLS-1$
			fieldOutStream[i] = Const.NVL(rep.getStepAttributeString(id_step, i,	"out_stream_name"), "");
			cutFrom[i] = Const.NVL(rep.getStepAttributeString(id_step, i, "cut_from"), ""); //$NON-NLS-1$
			cutTo[i] = Const.NVL(rep.getStepAttributeString(id_step, i, "cut_to"), ""); //$NON-NLS-1$
		}
	} catch (Exception e) {
		throw new KettleException(
				BaseMessages.getString(PKG, "StringCutMeta.Exception.UnexpectedErrorInReadingStepInfo"), e); //$NON-NLS-1$
	}
}