com.ibm.cics.server

Class Document



  • public class Document
    extends API

    This Class provides the Java implementation of the CICS DOCUMENT API.

    This consists of the following CICS DOCUMENT API commands:
    • DOCUMENT CREATE
    • DOCUMENT INSERT
    • DOCUMENT RETRIEVE
    • DOCUMENT SET
    • DOCUMENT DELETE

    The constructor and methods within this class perform the following functions:

    • The public default constructor creates an empty Document object. This is equivalent to the basic CICS API command DOCUMENT CREATE, no data is associated with the create command.
    • The alternative constructor accepts a document token for an existing document. It does not perform a DOCUMENT CREATE command.
    • The create*() methods will add the required data to the empty Document object created by the constructor. Although CICS API command DOCUMENT INSERT is used to add the data, this can be thought of as equivalent to CICS API command DOCUMENT CREATE with data associated with the create. No check is made to ensure that the Document object is empty by these methods, in fact the create*() and append*() methods perform the same function and a create*() method can be used instead of the corresponding append*() method and vice versa.
    • The append*() methods will append the required data to the Document object. This is equivalent to CICS API command DOCUMENT INSERT without the AT or TO options.
    • The insert*() methods will insert the required data into the Document object at the specified bookmark or replace existing data between two bookmarks. This is equivalent to CICS API command DOCUMENT INSERT with either the AT option or both the AT and TO options.
    • The retrieve() methods will copy the Document object into a Java byte array. This is equivalent to CICS API command DOCUMENT RETRIEVE DATAONLY.
    • The addSymbol() and setSymbolList() methods allow symbols and their associated values to be added to the symbol table associated with the Document object. This is equivalent to CICS API command DOCUMENT SET.
    • The getDocSize() method returns the size of the Document object. This is equivalent to the DOCSIZE keyword on CICS API command DOCUMENT INSERT.
    • The getDocToken() method returns the document token value of the Document object. This is equivalent to the DOCTOKEN keyword on CICS API command DOCUMENT INSERT.
    • The delete() method will delete the Document object. This is equivalent to CICS API command DOCUMENT DELETE.
    See Also:
    API for general restrictions on using the JCICS API.
    Since CICS TS version:
    2.3
    Since package version:
    1.0.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      Document()
      Public default constructor which will create a empty (default) Document object which can have relevant DOCUMENT calls performed on it by relevant methods from this class.
      Document(byte[] docToken)
      Constructor which accepts a document token as input, to allow access to an existing document.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addSymbol(java.lang.String symbol, java.lang.String value)
      Add a symbol and it's value to the symbol table associated with the Document object.
      void appendBinary(byte[] binary)
      Append a Java byte array to the Document object.
      void appendBookmark(java.lang.String bookmark)
      Append a bookmark to the Document object.
      void appendCRLF()
      Append EBCDIC CRLF to the Document object.
      void appendDocument(Document doc)
      Append another Document object to the Document object.
      void appendFromDocRetrieve(byte[] from)
      Append a retrieved document to the Document object.
      void appendFromTemplate(java.lang.String from)
      Append a template to the Document object.
      void appendLine(java.lang.String text, java.lang.String hostCodePage)
      Append a line of text to the Document object, including a terminating CRLF.
      void appendSymbol(java.lang.String symbol)
      Append the data associated with the symbol in the symbol table to the Document object.
      void appendSymbol(java.lang.String symbol, java.lang.String hostCodePage)
      Append the data associated with the symbol in the symbol table to the Document object.
      void appendTemplate(java.lang.String template)
      Append the template specified by the document template definition to the Document object.
      void appendTemplate(java.lang.String template, java.lang.String hostCodePage)
      Append the template specified by the document template definition to the Document object.
      void appendText(java.lang.String text)
      Append text to the Document object.
      void appendText(java.lang.String text, java.lang.String hostCodePage)
      Append text to the Document object.
      void createBinary(byte[] binary)
      Add a Java byte array to the empty Document object.
      void createFromDoc(Document fromDoc)
      Add another Document object to the empty Document object.
      void createFromDocRetrieve(byte[] from)
      Add a retrieved document to the empty Document object.
      void createFromTemplate(java.lang.String from)
      Add a template to the empty Document object.
      void createTemplate(java.lang.String template)
      Add the template specified by the document template definition to the empty Document object.
      void createTemplate(java.lang.String template, java.lang.String hostCodePage)
      Add the template specified by the document template definition to the empty Document object.
      void createText(java.lang.String text)
      Add text to the empty Document object.
      void createText(java.lang.String text, java.lang.String hostCodePage)
      Add text to the empty Document object.
      void delete()
      Delete the Document.
      int getDocSize()
      Returns the size of the document associated with the Document object.
      byte[] getDocToken()
      Returns the document token associated with the Document object.
      void insertBinary(byte[] binary, DocumentLocation locn)
      Insert a Java byte array into the Document object.
      void insertBookmark(java.lang.String bookmark, DocumentLocation locn)
      Insert a bookmark into the Document object.
      void insertDocument(Document doc, DocumentLocation locn)
      Insert a Document object into the Document object.
      void insertFromDocRetrieve(byte[] from, DocumentLocation locn)
      Insert a retrieved document into the Document object.
      void insertFromTemplate(java.lang.String from, DocumentLocation locn)
      Insert a template into the Document object.
      void insertSymbol(java.lang.String symbol, DocumentLocation locn)
      Insert the data associated with the symbol in the symbol table into the Document object.
      void insertSymbol(java.lang.String symbol, java.lang.String hostCodePage, DocumentLocation locn)
      Insert the data associated with the symbol in the symbol table into the Document object.
      void insertTemplate(java.lang.String template, DocumentLocation locn)
      Insert the template specified by the document template definition into the Document object.
      void insertTemplate(java.lang.String template, java.lang.String hostCodePage, DocumentLocation locn)
      Insert the template specified by the document template definition into the Document object.
      void insertText(java.lang.String text, DocumentLocation locn)
      Insert text into the Document object.
      void insertText(java.lang.String text, java.lang.String hostCodePage, DocumentLocation locn)
      Insert text into the Document object.
      byte[] retrieve()
      Return a copy of the Document object in a Java byte array.
      byte[] retrieve(java.lang.String characterset)
      Return a copy of the Document object in a Java byte array.
      byte[] retrieve(java.lang.String characterset, boolean dataOnly)
      Return a copy of the Document object in a Java byte array.
      void setSymbolList(SymbolList symbolList)
      Add a symbol list to the symbol table associated with the Document object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait