Ejemplo n.º 1
0
 public void readRep(
     Repository rep, long id_step, List<DatabaseMeta> databases, Map<String, Counter> counters)
     throws KettleException {
   try {
     long id_connection = rep.getStepAttributeInteger(id_step, "id_connection"); // $NON-NLS-1$
     databaseMeta = DatabaseMeta.findDatabase(databases, id_connection);
     rowLimit = (int) rep.getStepAttributeInteger(id_step, "rowlimit"); // $NON-NLS-1$
     sql = rep.getStepAttributeString(id_step, "sql"); // $NON-NLS-1$
     outerJoin = rep.getStepAttributeBoolean(id_step, "outer_join"); // $NON-NLS-1$
     replacevars = rep.getStepAttributeBoolean(id_step, "replace_vars");
     sqlfieldname = rep.getStepAttributeString(id_step, "sql_fieldname"); // $NON-NLS-1$
     queryonlyonchange =
         rep.getStepAttributeBoolean(id_step, "query_only_on_change"); // $NON-NLS-1$
   } catch (Exception e) {
     throw new KettleException(
         Messages.getString("DynamicSQLRowMeta.Exception.UnexpectedErrorReadingStepInfo"),
         e); //$NON-NLS-1$
   }
 }
Ejemplo n.º 2
0
  public void readRep(
      Repository rep, long id_step, List<DatabaseMeta> databases, Map<String, Counter> counters)
      throws KettleException {
    try {
      int nrfiles = rep.countNrStepAttributes(id_step, "file_name");

      dynamicFoldernameField = rep.getStepAttributeString(id_step, "foldername_Field");

      includeRowNumber = rep.getStepAttributeBoolean(id_step, "rownum");
      isFoldernameDynamic = rep.getStepAttributeBoolean(id_step, "foldername_dynamic");
      rowNumberField = rep.getStepAttributeString(id_step, "rownum_field");
      rowLimit = rep.getStepAttributeInteger(id_step, "limit");

      allocate(nrfiles);

      for (int i = 0; i < nrfiles; i++) {
        folderName[i] = rep.getStepAttributeString(id_step, i, "file_name");
        folderRequired[i] = rep.getStepAttributeString(id_step, i, "file_required");
      }
    } catch (Exception e) {
      throw new KettleException("Unexpected error reading step information from the repository", e);
    }
  }