Java Code Examples for org.pentaho.di.repository.Repository#getJobEntryAttributeString()

The following examples show how to use org.pentaho.di.repository.Repository#getJobEntryAttributeString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobEntryFilesExist.java    From pentaho-kettle with Apache License 2.0 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 {
    filename = rep.getJobEntryAttributeString( id_jobentry, "filename" );

    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes( id_jobentry, "name" );
    allocate( argnr );

    // Read them all...
    for ( int a = 0; a < argnr; a++ ) {
      arguments[a] = rep.getJobEntryAttributeString( id_jobentry, a, "name" );
    }
  } catch ( KettleException dbe ) {
    throw new KettleException( BaseMessages
      .getString( PKG, "JobEntryFilesExist.ERROR_0002_Cannot_Load_Job_From_Repository", "" + id_jobentry, dbe
        .getMessage() ) );
  }
}
 
Example 2
Source File: JobEntryDeleteFolders.java    From pentaho-kettle with Apache License 2.0 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 {
    argFromPrevious = rep.getJobEntryAttributeBoolean( id_jobentry, "arg_from_previous" );
    limit_folders = rep.getJobEntryAttributeString( id_jobentry, "limit_folders" );
    success_condition = rep.getJobEntryAttributeString( id_jobentry, "success_condition" );

    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes( id_jobentry, "name" );
    allocate( argnr );

    // Read them all...
    for ( int a = 0; a < argnr; a++ ) {
      arguments[a] = rep.getJobEntryAttributeString( id_jobentry, a, "name" );
    }
  } catch ( KettleException dbe ) {
    throw new KettleException( BaseMessages.getString( PKG, "JobEntryDeleteFolders.UnableToLoadFromRepo", String
      .valueOf( id_jobentry ) ), dbe );
  }
}
 
Example 3
Source File: JobEntryUnZip.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    zipFilename = rep.getJobEntryAttributeString( id_jobentry, "zipfilename" );
    afterunzip = (int) rep.getJobEntryAttributeInteger( id_jobentry, "afterunzip" );
    wildcard = rep.getJobEntryAttributeString( id_jobentry, "wildcard" );
    wildcardexclude = rep.getJobEntryAttributeString( id_jobentry, "wildcardexclude" );
    sourcedirectory = rep.getJobEntryAttributeString( id_jobentry, "targetdirectory" );
    movetodirectory = rep.getJobEntryAttributeString( id_jobentry, "movetodirectory" );
    addfiletoresult = rep.getJobEntryAttributeBoolean( id_jobentry, "addfiletoresult" );
    isfromprevious = rep.getJobEntryAttributeBoolean( id_jobentry, "isfromprevious" );
    adddate = rep.getJobEntryAttributeBoolean( id_jobentry, "adddate" );
    addtime = rep.getJobEntryAttributeBoolean( id_jobentry, "addtime" );
    addOriginalTimestamp = rep.getJobEntryAttributeBoolean( id_jobentry, "addOriginalTimestamp" );
    SpecifyFormat = rep.getJobEntryAttributeBoolean( id_jobentry, "SpecifyFormat" );
    date_time_format = rep.getJobEntryAttributeString( id_jobentry, "date_time_format" );
    rootzip = rep.getJobEntryAttributeBoolean( id_jobentry, "rootzip" );
    createfolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createfolder" );
    nr_limit = rep.getJobEntryAttributeString( id_jobentry, "nr_limit" );
    wildcardSource = rep.getJobEntryAttributeString( id_jobentry, "wildcardSource" );
    success_condition = rep.getJobEntryAttributeString( id_jobentry, "success_condition" );
    if ( Utils.isEmpty( success_condition ) ) {
      success_condition = SUCCESS_IF_NO_ERRORS;
    }
    iffileexist = getIfFileExistsInt( rep.getJobEntryAttributeString( id_jobentry, "iffileexists" ) );
    createMoveToDirectory = rep.getJobEntryAttributeBoolean( id_jobentry, "create_move_to_directory" );
    setOriginalModificationDate = rep.getJobEntryAttributeBoolean( id_jobentry, "setOriginalModificationDate" );
  } catch ( KettleException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'unzip' from the repository for id_jobentry="
      + id_jobentry, dbe );
  }
}
 
Example 4
Source File: JobEntryTableExists.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    tablename = rep.getJobEntryAttributeString( id_jobentry, "tablename" );
    schemaname = rep.getJobEntryAttributeString( id_jobentry, "schemaname" );

    connection = rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, "connection", "id_database", databases );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException(
      BaseMessages.getString( PKG, "TableExists.Meta.UnableLoadRep", "" + id_jobentry ), dbe );
  }
}
 
Example 5
Source File: JobEntryDosToUnix.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    arg_from_previous = rep.getJobEntryAttributeBoolean( id_jobentry, "arg_from_previous" );
    include_subfolders = rep.getJobEntryAttributeBoolean( id_jobentry, "include_subfolders" );

    nr_errors_less_than = rep.getJobEntryAttributeString( id_jobentry, "nr_errors_less_than" );
    success_condition = rep.getJobEntryAttributeString( id_jobentry, "success_condition" );
    resultfilenames = rep.getJobEntryAttributeString( id_jobentry, "resultfilenames" );

    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes( id_jobentry, "source_filefolder" );
    allocate( argnr );

    // Read them all...
    for ( int a = 0; a < argnr; a++ ) {
      source_filefolder[a] = rep.getJobEntryAttributeString( id_jobentry, a, "source_filefolder" );
      wildcard[a] = rep.getJobEntryAttributeString( id_jobentry, a, "wildcard" );
      conversionTypes[a] =
        getConversionTypeByCode( Const.NVL(
          rep.getJobEntryAttributeString( id_jobentry, "ConversionType" ), "" ) );
    }
  } catch ( KettleException dbe ) {

    throw new KettleException( BaseMessages.getString( PKG, "JobDosToUnix.Error.Exception.UnableLoadRep" )
      + id_jobentry, dbe );
  }
}
 
Example 6
Source File: JobEntryConnectedToRepository.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    isspecificrep = rep.getJobEntryAttributeBoolean( id_jobentry, "isspecificrep" );
    repname = rep.getJobEntryAttributeString( id_jobentry, "repname" );
    isspecificuser = rep.getJobEntryAttributeBoolean( id_jobentry, "isspecificuser" );
    username = rep.getJobEntryAttributeString( id_jobentry, "username" );

  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "JobEntryConnectedToRepository.Meta.UnableToLoadFromRep" )
      + id_jobentry, dbe );

  }
}
 
Example 7
Source File: JobEntryWaitForFile.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    filename = rep.getJobEntryAttributeString( id_jobentry, "filename" );
    maximumTimeout = rep.getJobEntryAttributeString( id_jobentry, "maximum_timeout" );
    checkCycleTime = rep.getJobEntryAttributeString( id_jobentry, "check_cycle_time" );
    successOnTimeout = rep.getJobEntryAttributeBoolean( id_jobentry, "success_on_timeout" );
    fileSizeCheck = rep.getJobEntryAttributeBoolean( id_jobentry, "file_size_check" );
    addFilenameToResult = rep.getJobEntryAttributeBoolean( id_jobentry, "add_filename_result" );
  } catch ( KettleException dbe ) {
    throw new KettleException(
      "Unable to load job entry of type 'wait for file' from the repository for id_jobentry=" + id_jobentry,
      dbe );
  }
}
 
Example 8
Source File: JobEntryCreateFolder.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    foldername = rep.getJobEntryAttributeString( id_jobentry, "foldername" );
    failOfFolderExists = rep.getJobEntryAttributeBoolean( id_jobentry, "fail_of_folder_exists" );
  } catch ( KettleException dbe ) {
    throw new KettleException(
      "Unable to load job entry of type 'create Folder' from the repository for id_jobentry=" + id_jobentry,
      dbe );
  }
}
 
Example 9
Source File: JobEntryPing.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    hostname = rep.getJobEntryAttributeString( id_jobentry, "hostname" );
    nbrPackets = rep.getJobEntryAttributeString( id_jobentry, "nbr_packets" );

    // TODO: The following lines may be removed 3 versions after 2.5.0
    String nbrPaquets = rep.getJobEntryAttributeString( id_jobentry, "nbrpaquets" );
    if ( nbrPackets == null && nbrPaquets != null ) {
      // if only nbrpaquets exists this means that the file was
      // save by a version 2.5.0 ping job entry
      nbrPackets = nbrPaquets;
    }
    timeout = rep.getJobEntryAttributeString( id_jobentry, "timeout" );

    pingtype = rep.getJobEntryAttributeString( id_jobentry, "pingtype" );
    if ( Utils.isEmpty( pingtype ) ) {
      pingtype = classicPing;
      ipingtype = iclassicPing;
    } else {
      if ( pingtype.equals( systemPing ) ) {
        ipingtype = isystemPing;
      } else if ( pingtype.equals( bothPings ) ) {
        ipingtype = ibothPings;
      } else {
        ipingtype = iclassicPing;
      }
    }
  } catch ( KettleException dbe ) {
    throw new KettleException(
      "Unable to load job entry of type 'ping' exists from the repository for id_jobentry=" + id_jobentry, dbe );
  }
}
 
Example 10
Source File: JobEntryMailValidator.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    smtpCheck = rep.getJobEntryAttributeBoolean( id_jobentry, "smtpCheck" );
    timeout = rep.getJobEntryAttributeString( id_jobentry, "timeout" );
    defaultSMTP = rep.getJobEntryAttributeString( id_jobentry, "defaultSMTP" );
    emailSender = rep.getJobEntryAttributeString( id_jobentry, "emailSender" );
    emailAddress = rep.getJobEntryAttributeString( id_jobentry, "emailAddress" );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( BaseMessages.getString( PKG, "JobEntryMailValidator.Meta.UnableToLoadFromRep" )
      + id_jobentry, dbe );
  }
}
 
Example 11
Source File: JobEntryDTDValidator.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
    List<SlaveServer> slaveServers ) throws KettleException {
  try {
    xmlfilename = rep.getJobEntryAttributeString( id_jobentry, "xmlfilename" );
    dtdfilename = rep.getJobEntryAttributeString( id_jobentry, "dtdfilename" );
    dtdintern = rep.getJobEntryAttributeBoolean( id_jobentry, "dtdintern" );

  } catch ( KettleException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'DTDvalidator' from the repository for id_jobentry="
        + id_jobentry, dbe );
  }
}
 
Example 12
Source File: JobEntryFolderIsEmpty.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    foldername = rep.getJobEntryAttributeString( id_jobentry, "foldername" );
    includeSubfolders = rep.getJobEntryAttributeBoolean( id_jobentry, "include_subfolders" );
    specifywildcard = rep.getJobEntryAttributeBoolean( id_jobentry, "specify_wildcard" );
    wildcard = rep.getJobEntryAttributeString( id_jobentry, "wildcard" );
  } catch ( KettleException dbe ) {
    throw new KettleException(
      "Unable to load job entry of type 'create Folder' from the repository for id_jobentry=" + id_jobentry,
      dbe );
  }
}
 
Example 13
Source File: JobEntryExportRepository.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    repositoryname = rep.getJobEntryAttributeString( id_jobentry, "repositoryname" );
    username = rep.getJobEntryAttributeString( id_jobentry, "username" );
    password =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "password" ) );
    targetfilename = rep.getJobEntryAttributeString( id_jobentry, "targetfilename" );
    iffileexists = rep.getJobEntryAttributeString( id_jobentry, "iffileexists" );
    export_type = rep.getJobEntryAttributeString( id_jobentry, "export_type" );
    directoryPath = rep.getJobEntryAttributeString( id_jobentry, "directoryPath" );
    add_date = rep.getJobEntryAttributeBoolean( id_jobentry, "add_date" );
    add_time = rep.getJobEntryAttributeBoolean( id_jobentry, "add_time" );
    SpecifyFormat = rep.getJobEntryAttributeBoolean( id_jobentry, "SpecifyFormat" );
    date_time_format = rep.getJobEntryAttributeString( id_jobentry, "date_time_format" );
    createfolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createfolder" );
    newfolder = rep.getJobEntryAttributeBoolean( id_jobentry, "newfolder" );
    add_result_filesname = rep.getJobEntryAttributeBoolean( id_jobentry, "add_result_filesname" );
    nr_errors_less_than = rep.getJobEntryAttributeString( id_jobentry, "nr_errors_less_than" );

    success_condition = rep.getJobEntryAttributeString( id_jobentry, "success_condition" );

  } catch ( KettleException dbe ) {
    throw new KettleException( BaseMessages.getString( PKG, "JobExportRepository.Meta.UnableLoadRep", ""
      + id_jobentry ), dbe );
  }
}
 
Example 14
Source File: JobEntryTelnet.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    hostname = rep.getJobEntryAttributeString( id_jobentry, "hostname" );
    port = rep.getJobEntryAttributeString( id_jobentry, "port" );
    timeout = rep.getJobEntryAttributeString( id_jobentry, "timeout" );
  } catch ( KettleException dbe ) {
    throw new KettleException(
      "Unable to load job entry of type 'Telnet' exists from the repository for id_jobentry=" + id_jobentry,
      dbe );
  }
}
 
Example 15
Source File: HL7MLLPInput.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId idJobentry, List<DatabaseMeta> databases,
    List<SlaveServer> slaveServers ) throws KettleException {
  try {
    server = rep.getJobEntryAttributeString( idJobentry, "server" );
    port = rep.getJobEntryAttributeString( idJobentry, "port" );
    messageVariableName = rep.getJobEntryAttributeString( idJobentry, "message_variable" );
    messageTypeVariableName = rep.getJobEntryAttributeString( idJobentry, "type_variable" );
    versionVariableName = rep.getJobEntryAttributeString( idJobentry, "version_variable" );
  } catch ( KettleException dbe ) {
    throw new KettleException( "Unable to load job entry from the repository for id_jobentry=" + idJobentry, dbe );
  }
}
 
Example 16
Source File: JobEntryCopyFiles.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
protected String loadDestinationRep( Repository rep, ObjectId id_jobentry, int a ) throws KettleException {
  String destination_filefolder = rep.getJobEntryAttributeString( id_jobentry, a, DESTINATION_FILE_FOLDER );
  String ncName = rep.getJobEntryAttributeString( id_jobentry, a, DESTINATION_CONFIGURATION_NAME );
  return loadURL( destination_filefolder, ncName, getMetaStore(), configurationMappings );
}
 
Example 17
Source File: JobEntrySFTPPUT.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    serverName = rep.getJobEntryAttributeString( id_jobentry, "servername" );
    serverPort = rep.getJobEntryAttributeString( id_jobentry, "serverport" );

    userName = rep.getJobEntryAttributeString( id_jobentry, "username" );
    password =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "password" ) );
    sftpDirectory = rep.getJobEntryAttributeString( id_jobentry, "sftpdirectory" );
    localDirectory = rep.getJobEntryAttributeString( id_jobentry, "localdirectory" );
    wildcard = rep.getJobEntryAttributeString( id_jobentry, "wildcard" );
    copyprevious = rep.getJobEntryAttributeBoolean( id_jobentry, "copyprevious" );
    copypreviousfiles = rep.getJobEntryAttributeBoolean( id_jobentry, "copypreviousfiles" );
    addFilenameResut = rep.getJobEntryAttributeBoolean( id_jobentry, "addFilenameResut" );

    usekeyfilename = rep.getJobEntryAttributeBoolean( id_jobentry, "usekeyfilename" );
    keyfilename = rep.getJobEntryAttributeString( id_jobentry, "keyfilename" );
    keyfilepass =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "keyfilepass" ) );
    compression = rep.getJobEntryAttributeString( id_jobentry, "compression" );
    proxyType = rep.getJobEntryAttributeString( id_jobentry, "proxyType" );
    proxyHost = rep.getJobEntryAttributeString( id_jobentry, "proxyHost" );
    proxyPort = rep.getJobEntryAttributeString( id_jobentry, "proxyPort" );
    proxyUsername = rep.getJobEntryAttributeString( id_jobentry, "proxyUsername" );
    proxyPassword =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "proxyPassword" ) );

    createRemoteFolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createRemoteFolder" );

    boolean remove = rep.getJobEntryAttributeBoolean( id_jobentry, "remove" );
    setAfterFTPS( getAfterSFTPPutByCode( Const.NVL(
      rep.getJobEntryAttributeString( id_jobentry, "aftersftpput" ), "" ) ) );
    if ( remove && getAfterFTPS() == AFTER_FTPSPUT_NOTHING ) {
      setAfterFTPS( AFTER_FTPSPUT_DELETE );
    }
    destinationfolder = rep.getJobEntryAttributeString( id_jobentry, "destinationfolder" );
    createDestinationFolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createdestinationfolder" );
    successWhenNoFile = rep.getJobEntryAttributeBoolean( id_jobentry, "successWhenNoFile" );

  } catch ( KettleException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'SFTPPUT' from the repository for id_jobentry="
      + id_jobentry, dbe );
  }
}
 
Example 18
Source File: JobEntryPGPEncryptFiles.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    gpglocation = rep.getJobEntryAttributeString( id_jobentry, "gpglocation" );
    arg_from_previous = rep.getJobEntryAttributeBoolean( id_jobentry, "arg_from_previous" );
    include_subfolders = rep.getJobEntryAttributeBoolean( id_jobentry, "include_subfolders" );
    add_result_filesname = rep.getJobEntryAttributeBoolean( id_jobentry, "add_result_filesname" );
    destination_is_a_file = rep.getJobEntryAttributeBoolean( id_jobentry, "destination_is_a_file" );
    create_destination_folder = rep.getJobEntryAttributeBoolean( id_jobentry, "create_destination_folder" );
    nr_errors_less_than = rep.getJobEntryAttributeString( id_jobentry, "nr_errors_less_than" );
    success_condition = rep.getJobEntryAttributeString( id_jobentry, "success_condition" );
    add_date = rep.getJobEntryAttributeBoolean( id_jobentry, "add_date" );
    add_time = rep.getJobEntryAttributeBoolean( id_jobentry, "add_time" );
    SpecifyFormat = rep.getJobEntryAttributeBoolean( id_jobentry, "SpecifyFormat" );
    date_time_format = rep.getJobEntryAttributeString( id_jobentry, "date_time_format" );
    AddDateBeforeExtension = rep.getJobEntryAttributeBoolean( id_jobentry, "AddDateBeforeExtension" );
    DoNotKeepFolderStructure = rep.getJobEntryAttributeBoolean( id_jobentry, "DoNotKeepFolderStructure" );
    iffileexists = rep.getJobEntryAttributeString( id_jobentry, "iffileexists" );
    destinationFolder = rep.getJobEntryAttributeString( id_jobentry, "destinationFolder" );
    ifmovedfileexists = rep.getJobEntryAttributeString( id_jobentry, "ifmovedfileexists" );
    moved_date_time_format = rep.getJobEntryAttributeString( id_jobentry, "moved_date_time_format" );
    AddMovedDateBeforeExtension = rep.getJobEntryAttributeBoolean( id_jobentry, "AddMovedDateBeforeExtension" );
    create_move_to_folder = rep.getJobEntryAttributeBoolean( id_jobentry, "create_move_to_folder" );
    add_moved_date = rep.getJobEntryAttributeBoolean( id_jobentry, "add_moved_date" );
    add_moved_time = rep.getJobEntryAttributeBoolean( id_jobentry, "add_moved_time" );
    SpecifyMoveFormat = rep.getJobEntryAttributeBoolean( id_jobentry, "SpecifyMoveFormat" );
    asciiMode = rep.getJobEntryAttributeBoolean( id_jobentry, "asciiMode" );

    // How many arguments?
    int argnr = rep.countNrJobEntryAttributes( id_jobentry, "source_filefolder" );
    allocate( argnr );

    // Read them all...
    for ( int a = 0; a < argnr; a++ ) {
      action_type[a] =
        getActionTypeByCode( Const.NVL( rep.getJobEntryAttributeString( id_jobentry, a, "action_type" ), "" ) );
      source_filefolder[a] = rep.getJobEntryAttributeString( id_jobentry, a, "source_filefolder" );
      userid[a] = rep.getJobEntryAttributeString( id_jobentry, a, "userid" );
      destination_filefolder[a] = rep.getJobEntryAttributeString( id_jobentry, a, "destination_filefolder" );
      wildcard[a] = rep.getJobEntryAttributeString( id_jobentry, a, "wildcard" );
    }
  } catch ( KettleException dbe ) {

    throw new KettleException( BaseMessages.getString( PKG, "JobPGPEncryptFiles.Error.Exception.UnableLoadRep" )
      + id_jobentry, dbe );
  }
}
 
Example 19
Source File: CypherScript.java    From knowbi-pentaho-pdi-neo4j-output with Apache License 2.0 4 votes vote down vote up
@Override public void loadRep( Repository rep, IMetaStore metaStore, ObjectId jobEntryId, List<DatabaseMeta> databases, List<SlaveServer> slaveServers ) throws KettleException {
  connectionName = rep.getJobEntryAttributeString( jobEntryId, "connection" );
  script = rep.getJobEntryAttributeString( jobEntryId, "script" );
  replacingVariables = rep.getJobEntryAttributeBoolean( jobEntryId, "replace_variables" );
}
 
Example 20
Source File: JobEntryFTP.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    port = rep.getJobEntryAttributeString( id_jobentry, "port" );
    serverName = rep.getJobEntryAttributeString( id_jobentry, "servername" );
    userName = rep.getJobEntryAttributeString( id_jobentry, "username" );
    password =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "password" ) );
    ftpDirectory = rep.getJobEntryAttributeString( id_jobentry, "ftpdirectory" );
    targetDirectory = rep.getJobEntryAttributeString( id_jobentry, "targetdirectory" );
    wildcard = rep.getJobEntryAttributeString( id_jobentry, "wildcard" );
    binaryMode = rep.getJobEntryAttributeBoolean( id_jobentry, "binary" );
    timeout = (int) rep.getJobEntryAttributeInteger( id_jobentry, "timeout" );
    remove = rep.getJobEntryAttributeBoolean( id_jobentry, "remove" );
    onlyGettingNewFiles = rep.getJobEntryAttributeBoolean( id_jobentry, "only_new" );
    activeConnection = rep.getJobEntryAttributeBoolean( id_jobentry, "active" );
    controlEncoding = rep.getJobEntryAttributeString( id_jobentry, "control_encoding" );
    if ( controlEncoding == null ) {
      // if we couldn't retrieve an encoding, assume it's an old instance and
      // put in the the encoding used before v 2.4.0
      controlEncoding = LEGACY_CONTROL_ENCODING;
    }

    movefiles = rep.getJobEntryAttributeBoolean( id_jobentry, "movefiles" );
    movetodirectory = rep.getJobEntryAttributeString( id_jobentry, "movetodirectory" );

    adddate = rep.getJobEntryAttributeBoolean( id_jobentry, "adddate" );
    addtime = rep.getJobEntryAttributeBoolean( id_jobentry, "addtime" );
    SpecifyFormat = rep.getJobEntryAttributeBoolean( id_jobentry, "SpecifyFormat" );
    date_time_format = rep.getJobEntryAttributeString( id_jobentry, "date_time_format" );
    AddDateBeforeExtension = rep.getJobEntryAttributeBoolean( id_jobentry, "AddDateBeforeExtension" );

    String addToResult = rep.getJobEntryAttributeString( id_jobentry, "isaddresult" );
    if ( Utils.isEmpty( addToResult ) ) {
      isaddresult = true;
    } else {
      isaddresult = rep.getJobEntryAttributeBoolean( id_jobentry, "isaddresult" );
    }

    createmovefolder = rep.getJobEntryAttributeBoolean( id_jobentry, "createmovefolder" );

    proxyHost = rep.getJobEntryAttributeString( id_jobentry, "proxy_host" );
    proxyPort = rep.getJobEntryAttributeString( id_jobentry, "proxy_port" );
    proxyUsername = rep.getJobEntryAttributeString( id_jobentry, "proxy_username" );
    proxyPassword =
      Encr
        .decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString( id_jobentry, "proxy_password" ) );
    socksProxyHost = rep.getJobEntryAttributeString( id_jobentry, "socksproxy_host" );
    socksProxyPort = rep.getJobEntryAttributeString( id_jobentry, "socksproxy_port" );
    socksProxyUsername = rep.getJobEntryAttributeString( id_jobentry, "socksproxy_username" );
    socksProxyPassword =
      Encr.decryptPasswordOptionallyEncrypted( rep.getJobEntryAttributeString(
        id_jobentry, "socksproxy_password" ) );
    SifFileExists = rep.getJobEntryAttributeString( id_jobentry, "ifFileExists" );
    if ( Utils.isEmpty( SifFileExists ) ) {
      ifFileExists = ifFileExistsSkip;
    } else {
      if ( SifFileExists.equals( SifFileExistsCreateUniq ) ) {
        ifFileExists = ifFileExistsCreateUniq;
      } else if ( SifFileExists.equals( SifFileExistsFail ) ) {
        ifFileExists = ifFileExistsFail;
      } else {
        ifFileExists = ifFileExistsSkip;
      }
    }
    nr_limit = rep.getJobEntryAttributeString( id_jobentry, "nr_limit" );
    success_condition =
      Const.NVL( rep.getJobEntryAttributeString( id_jobentry, "success_condition" ), SUCCESS_IF_NO_ERRORS );

  } catch ( KettleException dbe ) {
    throw new KettleException( "Unable to load job entry of type 'ftp' from the repository for id_jobentry="
      + id_jobentry, dbe );
  }
}