예제 #1
0
  /** Set the preferences for this import object. */
  public void setPrefs(Prefs prefs, DataObject db) throws Exception {
    Errors.logInfo("ImportData.setPrefs(...) started");
    this.pid = Integer.valueOf(prefs.pid).toString();
    this.isid = Integer.valueOf(prefs.isid).toString();
    this.ifid = Integer.valueOf(prefs.ifid).toString();
    this.upPath = prefs.upPath;
    this.systemFileName = prefs.fileName;
    this.updateMethod = prefs.updateMethod;
    this.connection = prefs.connection;
    this.conn_viss = prefs.connViss;
    this.sampleUnitId = prefs.sampleUnitId;
    this.speciesId = prefs.speciesId;
    this.userId = prefs.userId;

    this.db = db;

    debug();

    if (!updateMethod.equals("CREATE")
        && !updateMethod.equals("UPDATE")
        && !updateMethod.equals("CREATE_OR_UPDATE"))
      throw new Exception("UpdateMethod is not CREATE, UPDATE, CREATE_OR_UPDATE");

    Errors.logInfo("ImportData.setPrefs(...) ended");
  }
예제 #2
0
  /** Prints a debug information about the knowledge of this import module. */
  public void debug() {
    Errors.logInfo("ImportData.debug() started");

    if (connection == null) Errors.logDebug("connection is null");
    else Errors.logDebug("connection is not null");

    if (conn_viss == null) Errors.logDebug("conn_viss is null");
    else Errors.logDebug("conn_viss is not null");

    if (pid == null) Errors.logDebug("pid is null");
    else Errors.logDebug("pid=" + pid);

    if (isid == null) Errors.logDebug("isid is null");
    else Errors.logDebug("isid=" + isid);

    if (upPath == null) Errors.logDebug("upPath is null");
    else Errors.logDebug("upPath=" + upPath);

    Errors.logDebug("sampleUnitId=" + sampleUnitId);

    Errors.logDebug("speciesId=" + speciesId);

    if (userId == null) Errors.logDebug("userId is null");
    else Errors.logDebug("userId=" + userId);

    Errors.logDebug("level=" + level);

    Errors.logDebug("maxDev=" + maxDev);

    if (updateMethod == null) Errors.logDebug("updateMethod is null");
    else Errors.logDebug("updateMethod=" + updateMethod);

    Errors.logInfo("ImportData.debug() ended");
  }