Exemple #1
0
  /**
   * Remove/delete data froma Remedy regular form.
   *
   * @param entry <code>CoreItem</code> structure, which should be instantiated.
   * @throws org.areasy.runtime.engine.base.AREasyException if any error will occur.
   */
  public void runRemove(CoreItem entry) throws AREasyException {
    if (entry.exists()) {
      if (getConfiguration().getBoolean("multipart", false) && entry instanceof MultiPartItem) {
        // set multipart form names
        setMultiPartForms(entry);

        setMultiPartQueryFields(entry);
        ((MultiPartItem) entry).readParts(getServerConnection());
        ((MultiPartItem) entry).removeParts(getServerConnection());
      }

      RuntimeLogger.debug("Removing data entry: " + entry.toFullString());
      entry.remove(getServerConnection());
    }
  }
Exemple #2
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);
  }