예제 #1
0
  public void runUpdate(CoreItem entry) throws AREasyException {
    if (entry.exists()) {
      // set data values
      setDataFields(
          entry,
          getConfiguration().getBoolean("createifnotexist", false),
          getConfiguration().getBoolean("updateifexists", false));

      RuntimeLogger.debug("Updating data entry: " + entry.toFullString());
      entry.update(getServerConnection());

      if (getConfiguration().getBoolean("multipart", false) && entry instanceof MultiPartItem) {
        // set multipart form names
        setMultiPartForms(entry);

        // execute transactions
        ((MultiPartItem) entry)
            .commitParts(
                getServerConnection(), getMultiPartQueryFields(), getMultiPartDataFields());
      }
    } else if (getConfiguration().getBoolean("createifnotexist", false) && !entry.exists())
      runCreate(entry);
  }