Class FormProcessor

  • All Implemented Interfaces:
    PacketHandler

    public final class FormProcessor
    extends Agent
    A class to facilitate the loading of XML documents containing an XFA template. It is intended that this class parallels the functionality offered by XFA's "xmlform -pa" application.

    Here's a snippet of code illustrating the use of a FormProcessor().

    
     
      import com.adobe.xfa.formprocessor.FormProcessor;
      ...
      FormProcessor pa = new FormProcessor();
      try  {
          InputStream template = ...
          InputStream config = ...
          InputStream data = ...
          OutputStream out = ...
          OutputStream log = ...
          int ok = pa.execute(template, config, data, null, out, log, null, null);
          if (ok == FAIL) {
              // look at resulting log stream.
          }
                    else {
              // look at resulting out stream.
          }
      } catch (IOException o) {
          ...
      } catch (ExFull e) {
          System.err.println(e.toString());
      }
      
     
    • Constructor Summary

      Constructors 
      Constructor Description
      FormProcessor()
      Instantiates an XFA form processor.
      FormProcessor​(int cacheSize)
      Instantiates an XFA form processor with a template fragment cache of specified size.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int execute​(java.io.InputStream oTemplate, java.io.InputStream oXCI, java.io.InputStream oData, java.io.InputStream oXDC, java.io.OutputStream oOutput, java.io.OutputStream oInfo, java.lang.String masterPassword, java.lang.String userPassword)
      Executes a form as directed by the specified inputs.
      java.lang.String getConfigSchemaName()
      Retrieve the configuration schema tag name where the config options are stored for this agent.
      boolean loadXDP​(java.io.InputStream is, java.lang.String sPackets, boolean bReload)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • HREF_CACHE_SIZE

        public static final int HREF_CACHE_SIZE
        The default size (51200), in filesystem bytes of memory, for the cache used to hold loaded template fragments.

        Server-based applications may prefer to use custom values instead -- this being a relatively small value.

        See Also:
        FormProcessor(int), Constant Field Values
    • Constructor Detail

      • FormProcessor

        public FormProcessor()
        Instantiates an XFA form processor.
      • FormProcessor

        public FormProcessor​(int cacheSize)
        Instantiates an XFA form processor with a template fragment cache of specified size.
        Parameters:
        cacheSize - the size of the template fragment cache.

        This is the maximal size, in filesize bytes of memory, allowed of all loaded template fragments. Once exceeded, the DOM of loaded template fragments gets discarded on a fifo basis.

    • Method Detail

      • getConfigSchemaName

        public java.lang.String getConfigSchemaName()
        Description copied from class: Agent
        Retrieve the configuration schema tag name where the config options are stored for this agent.
        Specified by:
        getConfigSchemaName in class Agent
      • execute

        public int execute​(java.io.InputStream oTemplate,
                           java.io.InputStream oXCI,
                           java.io.InputStream oData,
                           java.io.InputStream oXDC,
                           java.io.OutputStream oOutput,
                           java.io.OutputStream oInfo,
                           java.lang.String masterPassword,
                           java.lang.String userPassword)
                    throws ExFull
        Executes a form as directed by the specified inputs.
        Parameters:
        oTemplate - the template input stream.
        oXCI - the configuration input stream.
        oData - the data input stream, if available.
        oXDC - the XFA XDC input stream if available. This is not currently supported.
        oOutput - the output stream. Currently, only XDP output is supported.
        oInfo - the info output stream.
        masterPassword - the encrypted PDF master password, if applicable.
        userPassword - the encrypted PDF user password, if applicable.
        Returns:
        the completion code, e.g., Agent.SUCCESS, Agent.FAIL, ...
        Throws:
        ExFull - upon error.
      • loadXDP

        public boolean loadXDP​(java.io.InputStream is,
                               java.lang.String sPackets,
                               boolean bReload)