Community articleReadFormFromASPRequest function
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars


This function will read a form into memory from the ASP request object.


   Function ReadFormFromASPRequest(
      flags As Long
      ) As IFormNodeP


flagsLongThe following flags cause special behaviors. If using multiple flags, combine them using a bitwise OR. For example:

0 — no special behavior.
UFL_AUTOCOMPUTE_OFF — Reads the form into memory, but disables the compute system so that no computes are evaluated.
UFL_AUTOCREATE_CONTROLLED_OFF — Reads the form into memory, but disables the creation of all options that are maintained only in memory (for example, itemnext, itemprevious, pagenext, pageprevious, and so on).
UFL_AUTOCREATE_FORMATS_OFF — Reads the form into memory, but disables the evaluation of all format options.
UFL_SERVER_SPEED_FLAGS — Turns off the following features: computes, automatic formatting, duplicate sid detection, the event model, and relative page and item tags (for example, itemprevious, itemnext, and so on). This is intended to decrease server processing times.
UFL_XFORMS_INITIALIZE_ONLY — Turns off the following features: controlled item construction, UI connection to the XForms model, action handling set up, and the rebuild/recalculate/revalidate/refresh sequence after instance replacements.


Returns an IFormNodeP that is the root node of the form, or throws an exception if an error occurs.


Note: Duplicate Scope IDs
If a form contains duplicate scope IDs (for example, two items on the same page with the same SID), ReadForm will fail to read the form and will return an error. This enforces correct XFDL syntax, and eliminates certain security risks that exist when duplicate scope IDs appear in signed forms.
Digital Signatures
When a form containing one or more digital signatures is read, the signatures will be verified. The result of the verification is stored in a flag that can be checked by calling GetSignatureVerificationStatus.
Note that this flag is only set by ReadForm, and its value will not be adjusted by changes made to the form after it has been read. This means that calls such as SetLiteralEx may actually break a signature (by changing the value of a signed item), but that this will not adjust the flag''s value. To verify a signature after changes have been made to a form, it is best to use VerifyAllSignatures.
Note that when a form is signed, all signed computes are frozen at their start value (regardless of whether the compute system is disabled).


The following example uses ReadFormFromASPRequest to load a form into memory and return the root node of the form.
   Function LoadFormFromRequestObject()
      Dim DTK, XFDL, TempForm    ' objects
      ' Get a DTK object and initialize the API
      Set DTK = CreateObject("PureEdge.DTK")
      DTK.IFSInitialize "aspApp", "1.0.0", "6.5.0"
      ' Get an XFDL object and read the form from the request object
      Set XFDL = CreateObject("PureEdge.xfdl_XFDL")
      ' Read the form into memory
      Set TempForm = XFDL.ReadFormFromASPRequest(0)
      ' Return the form
      Set LoadFormFromRequestObject = TempForm   
End Function

Parent topic:
XFDL functions