Community articlewriteForm method (Streaming API)
Added by IBM contributorIBM on August 16, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars




Description

This method will write a form to the specified file or stream. Call this method on the root node of the form. The version number of the form determines the format of the output file.

Method

WRITING TO A FILE:
   public void writeForm(
      String theFilePath,
      FormNodeP triggerItem,
      int flags
      ) throws UWIException;

WRITING TO A STREAM:
   public void writeForm(
      OutputStream theStream,
      FormNodeP triggerItem,
      int flags
      ) throws UWIException;


WRITING TO A WRITER:
   public void writeForm(
      java.io.Writer theWriter,
      FormNodeP triggerItem,
      int flags
      ) throws UWIException;


Parameters

Table 1. Method parameters
ExpressionTypeDescription
theFilePathStringThis is the path to the file on the local disk to which the form will be written.
theStream OutputStreamThis is the stream to which you want to write the form data.
theWriter java.io.WriterThe Java Writer to which you want to write the form data.
triggerItemFormNodePThis is the item that caused the form to be submitted. This parameter is always set to null. The Streaming API does not support filtering.
flagsint
This parameter must always be 0.


Returns

Returns nothing if the call is successful, or throws a generic exception (UWIException) if an error occurs.

Example

The following example uses writeForm to write the form in memory to a file on the local drive.
   private static void saveForm( ) throws Exception
   {
      theForm.writeForm("Output.xfd", null, 0);
   }


Parent topic:
FormNodeP class