コード例 #1
0
  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");
      includeSubfolders = rep.getJobEntryAttributeBoolean(id_jobentry, "include_subfolders");

      // How many arguments?
      int argnr = rep.countNrJobEntryAttributes(id_jobentry, "name");
      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");
        filemasks[a] = rep.getJobEntryAttributeString(id_jobentry, a, "filemask");
      }
    } catch (KettleException dbe) {
      throw new KettleException(
          BaseMessages.getString(
              PKG, "JobEntryCheckFilesLocked.UnableToLoadFromRepo", String.valueOf(id_jobentry)),
          dbe);
    }
  }
コード例 #2
0
  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");
      xslfilename = rep.getJobEntryAttributeString(id_jobentry, "xslfilename");
      outputfilename = rep.getJobEntryAttributeString(id_jobentry, "outputfilename");
      iffileexists = (int) rep.getJobEntryAttributeInteger(id_jobentry, "iffileexists");
      addfiletoresult = rep.getJobEntryAttributeBoolean(id_jobentry, "addfiletoresult");
      filenamesfromprevious = rep.getJobEntryAttributeBoolean(id_jobentry, "filenamesfromprevious");
      xsltfactory = rep.getJobEntryAttributeString(id_jobentry, "xsltfactory");
      if (xsltfactory == null) {
        xsltfactory = FACTORY_JAXP;
      }

      int nrparams = rep.countNrJobEntryAttributes(id_jobentry, "param_name");
      int nroutputprops = rep.countNrJobEntryAttributes(id_jobentry, "output_property_name");
      allocate(nrparams, nroutputprops);

      for (int i = 0; i < nrparams; i++) {
        parameterField[i] = rep.getJobEntryAttributeString(id_jobentry, i, "param_field");
        parameterName[i] = rep.getJobEntryAttributeString(id_jobentry, i, "param_name");
      }
      for (int i = 0; i < nroutputprops; i++) {
        outputPropertyName[i] =
            rep.getJobEntryAttributeString(id_jobentry, i, "output_property_name");
        outputPropertyValue[i] =
            rep.getJobEntryAttributeString(id_jobentry, i, "output_property_value");
      }
    } catch (KettleException dbe) {
      throw new KettleException(
          "Unable to load job entry of type 'xslt' from the repository for id_jobentry="
              + id_jobentry,
          dbe);
    }
  }
コード例 #3
0
  // Load the jobentry from repository
  public void loadRep(
      Repository rep,
      IMetaStore metaStore,
      ObjectId id_jobentry,
      List<DatabaseMeta> databases,
      List<SlaveServer> slaveServers)
      throws KettleException {
    try {
      setFileName(rep.getJobEntryAttributeString(id_jobentry, "file_name"));
      setWorkDirectory(rep.getJobEntryAttributeString(id_jobentry, "work_directory"));
      argFromPrevious = rep.getJobEntryAttributeBoolean(id_jobentry, "arg_from_previous");
      execPerRow = rep.getJobEntryAttributeBoolean(id_jobentry, "exec_per_row");

      setLogfile = rep.getJobEntryAttributeBoolean(id_jobentry, "set_logfile");
      setAppendLogfile = rep.getJobEntryAttributeBoolean(id_jobentry, "set_append_logfile");
      addDate = rep.getJobEntryAttributeBoolean(id_jobentry, "add_date");
      addTime = rep.getJobEntryAttributeBoolean(id_jobentry, "add_time");
      logfile = rep.getJobEntryAttributeString(id_jobentry, "logfile");
      logext = rep.getJobEntryAttributeString(id_jobentry, "logext");
      logFileLevel =
          LogLevel.getLogLevelForCode(rep.getJobEntryAttributeString(id_jobentry, "loglevel"));
      insertScript = rep.getJobEntryAttributeBoolean(id_jobentry, "insertScript");

      script = rep.getJobEntryAttributeString(id_jobentry, "script");
      // How many arguments?
      int argnr = rep.countNrJobEntryAttributes(id_jobentry, "argument");
      arguments = new String[argnr];

      // Read them all...
      for (int a = 0; a < argnr; a++) {
        arguments[a] = rep.getJobEntryAttributeString(id_jobentry, a, "argument");
      }
    } catch (KettleDatabaseException dbe) {
      throw new KettleException(
          "Unable to load job entry of type 'shell' from the repository with id_jobentry="
              + id_jobentry,
          dbe);
    }
  }
コード例 #4
0
  public void loadRep(
      Repository rep,
      IMetaStore metaStore,
      ObjectId id_jobentry,
      List<DatabaseMeta> databases,
      List<SlaveServer> slaveServers)
      throws KettleException {
    try {
      replaceVars = rep.getJobEntryAttributeBoolean(id_jobentry, "replacevars");

      filename = rep.getJobEntryAttributeString(id_jobentry, "filename");
      fileVariableType =
          getVariableType(rep.getJobEntryAttributeString(id_jobentry, "file_variable_type"));

      // How many variableName?
      int argnr = rep.countNrJobEntryAttributes(id_jobentry, "variable_name");
      variableName = new String[argnr];
      variableValue = new String[argnr];
      variableType = new int[argnr];

      // Read them all...
      for (int a = 0; a < argnr; a++) {
        variableName[a] = rep.getJobEntryAttributeString(id_jobentry, a, "variable_name");
        variableValue[a] = rep.getJobEntryAttributeString(id_jobentry, a, "variable_value");
        variableType[a] =
            getVariableType(rep.getJobEntryAttributeString(id_jobentry, a, "variable_type"));
      }
    } catch (KettleException dbe) {
      throw new KettleException(
          BaseMessages.getString(
              PKG,
              "JobEntrySetVariables.Meta.UnableLoadRep",
              String.valueOf(id_jobentry),
              dbe.getMessage()),
          dbe);
    }
  }