Interface ADocument

All Known Implementing Classes:
DocumentImpl

public interface ADocument
The PTC Arbortext extension to the W3C DOM Document interface.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Include the source document's caret position in the cloned content.
    static final int
    Include every block oid in the source document as a pi in the cloned content.
    static final int
    Sets the name of the cloned documnt to the name of the source document.
    static final int
    No content will be cloned.
    static final int
    Makes the empty document not inherit entity declarations from the source document.
    static final int
    Resolve any change tracking markup according to the value of the viewchangetracking option for the current view of the source document.
    static final int
    Force clone to be XML even if the source is SGML.
    static final int
    The document is an HTML document.
    static final int
    Indicates that the burst configuration file associated with the doctype of the document given to the modifyReferences method should not be consulted in order to determine which DOM nodes are considered customref references.
    static final int
    Indicates that file entity references will not be modified.
    static final int
    Indicates that neither the PTC Arbortext Styler stylesheet nor DCF file associated with the document or the doctype of the document given to the modifyReferences method should be consulted in order to determine which DOM nodes are considered “graphics ”.
    static final int
    Indicates that XInclude references will not be modified.
    static final int
    The document does not use XML, SGML, or HTML markup.
    static final short
    There is no selection.
    static final int
    For documents with change tracking markup, save as if all changes are pending (highlighted view).
    static final int
    For documents with change tracking markup, save as if all changes are accepted (latest view).
    static final int
    For documents with change tracking markup, save as if all changes are rejected (original view).
    static final int
    Enables entity output conversion.
    static final int
    Expands all file entities recursively.
    static final int
    Expands all XInclude references recursively.
    static final int
    Expands all text entities recursively.
    static final int
    Writes non-ASCII characters as characters in the target encoding.
    static final int
    Writes non-ASCII characters as character entity references.
    static final int
    Writes non-ASCII characters as numeric character references.
    static final int
    Used internally for HTML output.
    static final int
    Suppresses entity output conversion.
    static final int
    Removes the DOCTYPE header and internal subset including any private ENTITY declarations.
    static final int
    Writes a non-fragment header if possible.
    static final int
    Removes PTC Arbortext-specific processing instructions.
    static final int
    Write the document as an SGML document.
    static final int
    Write a text-only version of the document.
    static final int
    Write the document as XML.
    static final int
    The document uses SGML markup.
    static final short
    There is a table selection.
    static final short
    There is a text selection.
    static final int
    The document uses XML markup.
  • Method Summary

    Modifier and Type
    Method
    Description
    short
    canRenameNode(Node node, String namespaceURI, String qualifiedName)
    Tests whether an existing node of type ELEMENT_NODE or ATTRIBUTE_NODE can be renamed such that the resulting node is compliant with VAL_SCHEMA validity type.
    Method overload which omits the last parameter.
    cloneDocument(int flags)
    Creates a completely independent copy of this document.
    boolean
    Closes the document, freeing all associated memory and system resources (for example, file handles).
    void
    The editBegin and editEnd methods provide a mechanism to bracket a series of document changes which may optionally be rolled back.
    void
    editEnd(boolean commit)
    This method commits or rolls back the changes made to the document since the matching editBegin call.
    Method overload which omits the last parameter.
    Generates an entity name suitable for use with this document.
    int
    An integer constant uniquely identifying the document.
    Returns an collection of all the objects in this document.
    The directory associated with the document.
    getElementsByAttribute(String name, String value, short selector)
    Returns a NodeList of all descendant Elements that match the given attribute name and attribute value, in the order in which they are encountered in a pre-order traversal of this Document tree.
    getElementsByAttributeNS(String namespaceURI, String localName, String value, short selector)
    Returns a NodeList of all descendant Elements that match the given attribute namespace URI, local name, and attribute value, in the order in which they are encountered in a pre-order traversal of this Document tree.
    A collapsed DOM Range indicating the current location of the cursor.
    short
    An integer constant indicating the type of markup used by the document.
    boolean
    A boolean indicating whether the document has been modified.
    The name of the document or a null string if the document was created without a name.
    This method returns the value of the PTC Arbortext set option, scoped to this document.
    A StringList containing the names of all document-scope PTC Arbortext set options.
    A PropertyMap object containing user-defined properties for the document.
    short
    An integer constant indicating whether there is no selection ( NO_SELECTION), a text selection ( TEXT_SELECTION), or a table selection ( TABLE_SELECTION).
    A TableObjectStore containing all of the TableSets in the document.
    A TableTilePlex representing the current table selection.
    A DOM Range indicating the current text selection.
    int
    modifyReferences(PropertyMap map, int flags)
    This method will replace references within the given ADocument.
    void
    The redo method reverses the change made by the last undo.
    void
    Method overload which omits the last 5 parameters.
    void
    save(int flags)
    Method overload which omits the last 4 parameters.
    void
    save(int flags, String path)
    Method overload which omits the last 3 parameters.
    void
    save(int flags, String path, String encoding)
    Method overload which omits the last 2 parameters.
    void
    save(int flags, String path, String encoding, String publicId)
    Method overload which omits the last parameter.
    void
    save(int flags, String path, String encoding, String publicId, String systemId)
    Saves this document.
    void
    setInsertionPoint(Range insertionPoint)
    A collapsed DOM Range indicating the current location of the cursor.
    void
    setModified(boolean modified)
    A boolean indicating whether the document has been modified.
    void
    The name of the document or a null string if the document was created without a name.
    void
    setOption(String name, String value)
    This method sets the value of the PTC Arbortext set option, scoped to this document.
    void
    A TableTilePlex representing the current table selection.
    void
    setTextSelection(Range textSelection)
    A DOM Range indicating the current text selection.
    void
    This method reverses the previous change to the document.
    void
    Method overload which omits the last parameter.
    void
    undoBoundary(String description)
    This method inserts a boundary in the undo history so that a subsequent undo will restore changes up to the current state.
    void
    Clears the document's undo history.
  • Field Details

    • NO_SELECTION

      static final short NO_SELECTION
      There is no selection.
      See Also:
    • TEXT_SELECTION

      static final short TEXT_SELECTION
      There is a text selection.
      See Also:
    • TABLE_SELECTION

      static final short TABLE_SELECTION
      There is a table selection.
      See Also:
    • NO_MARKUP

      static final int NO_MARKUP
      The document does not use XML, SGML, or HTML markup. That is, it is untagged.
      See Also:
    • XML_MARKUP

      static final int XML_MARKUP
      The document uses XML markup.
      See Also:
    • SGML_MARKUP

      static final int SGML_MARKUP
      The document uses SGML markup.
      See Also:
    • HTML_MARKUP

      static final int HTML_MARKUP
      The document is an HTML document. This value is not used for XHTML documents, which have markupType of XML_MARKUP.
      See Also:
    • SAVE_CT_ORIG

      static final int SAVE_CT_ORIG
      For documents with change tracking markup, save as if all changes are rejected (original view).
      See Also:
    • SAVE_CT_LATEST

      static final int SAVE_CT_LATEST
      For documents with change tracking markup, save as if all changes are accepted (latest view).
      See Also:
    • SAVE_CT_ALL

      static final int SAVE_CT_ALL
      For documents with change tracking markup, save as if all changes are pending (highlighted view).
      If none of the SAVE_CT_xxx flags are set, the document is written as specified by the Application.getOption("writechangetracking") setting. If SAVE_CT_ORIG is specified with either of the other options, SAVE_CT_ORIG is obeyed. If SAVE_CT_LATEST and SAVE_CT_ALL are both specified, SAVE_CT_LATEST is obeyed.
      See Also:
    • SAVE_SGML

      static final int SAVE_SGML
      Write the document as an SGML document.
      See Also:
    • SAVE_UNTAGGED

      static final int SAVE_UNTAGGED
      Write a text-only version of the document.
      See Also:
    • SAVE_XML

      static final int SAVE_XML
      Write the document as XML.
      If one of the SAVE_SGML, SAVE_UNTAGGED, or SAVE_XML options is not specified, an SGML document is written as SGML and an XML document is written as XML. If more than one option is specified and SAVE_XML is specified, it is obeyed; otherwise, SAVE_SGML is used.
      See Also:
    • SAVE_NOHEADER

      static final int SAVE_NOHEADER
      Removes the DOCTYPE header and internal subset including any private ENTITY declarations.
      See Also:
    • SAVE_NOPI

      static final int SAVE_NOPI
      Removes PTC Arbortext-specific processing instructions.
      If not specified, behavior is controlled by the Application.getOption("writepi") setting.
      See Also:
    • SAVE_EOC

      static final int SAVE_EOC
      Enables entity output conversion.
      See Also:
    • SAVE_NOEOC

      static final int SAVE_NOEOC
      Suppresses entity output conversion.
      If neither SAVE_EOC nor SAVE_NOEC is specified, entity output conversion is controlled by the Application.getOption("entityoutputconvert") setting. If both are specified, entity output conversion is enabled.
      See Also:
    • SAVE_NAC_ENTREF

      static final int SAVE_NAC_ENTREF
      Writes non-ASCII characters as character entity references.
      See Also:
    • SAVE_NAC_CHAR

      static final int SAVE_NAC_CHAR
      Writes non-ASCII characters as characters in the target encoding.
      See Also:
    • SAVE_NAC_NUMREF

      static final int SAVE_NAC_NUMREF
      Writes non-ASCII characters as numeric character references.
      If none of the SAVE_NAC_xxx options are specified, behavior is controlled by the Application.getOption("writenonasciichar") setting. If more than one is specified, SAVE_NAC_ENTREF takes precedence if specified; otherwise SAVE_NAC_CHAR takes precedence if specified.
      See Also:
    • SAVE_NOBREAK

      static final int SAVE_NOBREAK
      Used internally for HTML output.
      See Also:
    • SAVE_FLATTEN_FILE

      static final int SAVE_FLATTEN_FILE
      Expands all file entities recursively.
      See Also:
    • SAVE_FLATTEN_TEXT

      static final int SAVE_FLATTEN_TEXT
      Expands all text entities recursively.
      See Also:
    • SAVE_NON_FRAGMENT

      static final int SAVE_NON_FRAGMENT
      Writes a non-fragment header if possible.
      See Also:
    • SAVE_FLATTEN_INCLUDE

      static final int SAVE_FLATTEN_INCLUDE
      Expands all XInclude references recursively.
      See Also:
    • CLONE_NO_CONTENT

      static final int CLONE_NO_CONTENT
      No content will be cloned. This will result in an empty document.
      See Also:
    • CLONE_RESOLVE_CT

      static final int CLONE_RESOLVE_CT
      Resolve any change tracking markup according to the value of the viewchangetracking option for the current view of the source document. If there is no view setting associated with the source document, the global value of the viewchangetracking option will be used.
      The viewchangetracking option interacts with this function in the following way:
      original — The cloned document will have the original markup (changes not applied) but no change tracking markup.
      changesapplied — The cloned document will have the latest markup (changes applied) but no change tracking markup.
      changeshighlighted — The cloned document will be as if CLONE_RESOLVE_CT were not set. It will have the change tracking markup (no data is lost; changes are still tracked).
      See Also:
    • CLONE_NO_ENT_DECLS

      static final int CLONE_NO_ENT_DECLS
      Makes the empty document not inherit entity declarations from the source document. Only obeyed if CLONE_NO_CONTENT is also specified.
      See Also:
    • CLONE_XML

      static final int CLONE_XML
      Force clone to be XML even if the source is SGML. Only obeyed if source document is made up of markup (not pure text).
      See Also:
    • CLONE_CARET

      static final int CLONE_CARET
      Include the source document's caret position in the cloned content. Only obeyed if CLONE_NO_CONTENT is not specified.
      See Also:
    • CLONE_LOCATION

      static final int CLONE_LOCATION
      Include every block oid in the source document as a pi in the cloned content. Only obeyed if CLONE_NO_CONTENT is not specified. The PI has the format of <?APTCOMP EPIC _OID_?> where _OLD_ = (dfid, generate_no, docid)
      See Also:
    • CLONE_NAME

      static final int CLONE_NAME
      Sets the name of the cloned documnt to the name of the source document.
      See Also:
    • MODIFYREF_NO_CUSTOMREF

      static final int MODIFYREF_NO_CUSTOMREF
      Indicates that the burst configuration file associated with the doctype of the document given to the modifyReferences method should not be consulted in order to determine which DOM nodes are considered customref references. The result of this flag is that no customref references will be modified.
      See Also:
    • MODIFYREF_NO_GRAPHICS

      static final int MODIFYREF_NO_GRAPHICS
      Indicates that neither the PTC Arbortext Styler stylesheet nor DCF file associated with the document or the doctype of the document given to the modifyReferences method should be consulted in order to determine which DOM nodes are considered “graphics ”. The result of this flag is that no graphics references will be modified.
      See Also:
    • MODIFYREF_NO_FILEENTS

      static final int MODIFYREF_NO_FILEENTS
      Indicates that file entity references will not be modified.
      See Also:
    • MODIFYREF_NO_XINCLUDES

      static final int MODIFYREF_NO_XINCLUDES
      Indicates that XInclude references will not be modified.
      See Also:
  • Method Details

    • getAclId

      int getAclId()
      An integer constant uniquely identifying the document. This is the value that would be returned by the ACL function current_doc if the document were current.
      Since:
      Epic 4.0
    • getInsertionPoint

      Range getInsertionPoint()
      A collapsed DOM Range indicating the current location of the cursor.
      Throws:
      DOMException - INVALID_STATE_ERR: Raised if the Range has already been detached.
      Since:
      Epic 4.0
    • setInsertionPoint

      void setInsertionPoint(Range insertionPoint) throws DOMException
      A collapsed DOM Range indicating the current location of the cursor.
      Throws:
      DOMException - INVALID_STATE_ERR: Raised if the Range has already been detached.
      Since:
      Epic 4.0
    • getTextSelection

      Range getTextSelection()
      A DOM Range indicating the current text selection. If there is no text selection, the value will be the same as insertionPoint.
      If the text selection is set to a collapsed range, the selection is cleared. The insertion point is not changed.
      Throws:
      DOMException - INVALID_STATE_ERR: Raised if the Range has already been detached.
      Since:
      Epic 4.0
    • setTextSelection

      void setTextSelection(Range textSelection) throws DOMException
      A DOM Range indicating the current text selection. If there is no text selection, the value will be the same as insertionPoint.
      If the text selection is set to a collapsed range, the selection is cleared. The insertion point is not changed.
      Throws:
      DOMException - INVALID_STATE_ERR: Raised if the Range has already been detached.
      Since:
      Epic 4.0
    • getSelectionType

      short getSelectionType()
      An integer constant indicating whether there is no selection ( NO_SELECTION), a text selection ( TEXT_SELECTION), or a table selection ( TABLE_SELECTION).
      Since:
      Epic 4.0
    • getElementsByAttribute

      NodeList getElementsByAttribute(String name, String value, short selector) throws DOMException
      Returns a NodeList of all descendant Elements that match the given attribute name and attribute value, in the order in which they are encountered in a pre-order traversal of this Document tree.
      Parameters:
      name - Specifies the name of the attribute to match. The value "*" matches all attribute names.
      value - Specifies the value of the attribute to match.
      selector - Specifies how the attribute value should be matched. When selector is 0, the value parameter is ignored. When selector is 1, only the elements that match both the name and the value are included.
      Returns:
      A list of matching element nodes.
      Throws:
      DOMException - SYNTAX_ERR: If selector is invalid.
      INVALID_CHARACTER_ERR: If name is namespace qualified.
      Since:
      Epic 4.1
    • getElementsByAttributeNS

      NodeList getElementsByAttributeNS(String namespaceURI, String localName, String value, short selector) throws DOMException
      Returns a NodeList of all descendant Elements that match the given attribute namespace URI, local name, and attribute value, in the order in which they are encountered in a pre-order traversal of this Document tree.
      Parameters:
      namespaceURI - The namespace URI of the attribute to retrieve. The value "*" matches all namespaces.
      localName - Specifies the local name of the attribute to match. The value "*" matches all local attribute names.
      value - Specifies the value of the attribute to match.
      selector - Specifies how the attribute value should be matched. When selector is 0, the value parameter is ignored. When selector is 1, only the elements that match both the name and the value are included.
      Returns:
      A list of matching element nodes.
      Throws:
      DOMException - SYNTAX_ERR: If selector is invalid.
      INVALID_CHARACTER_ERR: If localname is namespace qualified.
      Since:
      Epic 4.1
    • getOptionNames

      StringList getOptionNames()
      A StringList containing the names of all document-scope PTC Arbortext set options.
      Since:
      Epic 4.3
    • getMarkupType

      short getMarkupType()
      An integer constant indicating the type of markup used by the document. One of the following values: XML_MARKUP, SGML_MARKUP, HTML_MARKUP, or NO_MARKUP.
      Since:
      Epic 4.3
    • getModified

      boolean getModified()
      A boolean indicating whether the document has been modified. This attribute is reset when the document in saved.
      Since:
      Epic 4.3
    • setModified

      void setModified(boolean modified)
      A boolean indicating whether the document has been modified. This attribute is reset when the document in saved.
      Since:
      Epic 4.3
    • getName

      String getName()
      The name of the document or a null string if the document was created without a name. For documents read from the file system, the name is the base name of the documentURI, including the extension, if any.
      Since:
      Epic 4.3
    • setName

      void setName(String name)
      The name of the document or a null string if the document was created without a name. For documents read from the file system, the name is the base name of the documentURI, including the extension, if any.
      Since:
      Epic 4.3
    • getTables

      TableObjectStore getTables()
      A TableObjectStore containing all of the TableSets in the document. If there are no tables in the document, an empty store is returned.
      Since:
      Epic 4.3
    • getTableSelection

      TableTilePlex getTableSelection()
      A TableTilePlex representing the current table selection. If there is no table selection, the value of tableSelection is an empty TableTilePlex.
      Since:
      Epic 4.3
    • setTableSelection

      void setTableSelection(TableTilePlex tableSelection)
      A TableTilePlex representing the current table selection. If there is no table selection, the value of tableSelection is an empty TableTilePlex.
      Since:
      Epic 4.3
    • close

      boolean close() throws AOMException
      Closes the document, freeing all associated memory and system resources (for example, file handles). This method actually decrements the reference count for the document and does not free resources until the reference count becomes zero. The reference count is incremented when the document is associated with a View object.
      Returns:
      Returns true if the document was actually closed. false otherwise. Since an exception is thrown on an error, this will always be true when no exception is thrown.
      Throws:
      AOMException - Raised if the method detects any error.
      Since:
      Epic 4.3
    • save

      void save(int flags, String path, String encoding, String publicId, String systemId) throws AOMException
      Saves this document.
      Parameters:
      flags - A bitmask that specifies save options. Constructed by ORing the bits from the SaveFlags enumeration.
      path - Specifies the path name of the output file. It may be any of the following values:
      • The name of a file. If it exists, it is silently rewritten.
      • A WebDAV URL (Windows only).
      • (UNIX only) A dash ( "-") indicating standard input.
      • An asterisk ( "*") indicating the message window.
      • (UNIX only) a UNIX pipeline ("|").
      If the path is omitted or a null string, the document is saved to the original path name or Logical ID. If the document does not have a path, or if the path is not writable (for example, the document was read from an http: URL not on a WebDAV server, or the backing object was not checked out from the DMS), the method raises an exception.
      encoding - Determines the encoding of the file being written. This parameter overrides the encoding declaration in the document. The following table lists the valid strings for the encoding parameter.
      Adobe-Standard-Encoding ISO-8859-9
      ISO-8859-1 EUC-JP
      ISO-8859-1-Windows-3.1-Latin-1* Shift_JIS
      ISO-8859-2 Big5
      ISO-8859-3 GB_2312-80
      ISO-8859-4 KSC_5601
      ISO-8859-5 UTF-8
      ISO-8859-7 US-ASCII
      ISO-8859-8 ISO-10646-UCS-2
      *Windows only
      If encoding is null or the empty string, the encoding is determined using the following rules:
      • If the original document is an SGML document and the xml option is specified, the resulting XML file will use the original encoding if the SGML document has a byte-order mark (an ISO-10646-UCS-2 file) or a special encoding was set using edit encoding. If there was no special encoding or it is not an ISO-10646-UCS-2 file, the resulting XML file will use UTF-8 encoding. UTF-8 is the default encoding for XML documents.
      • If the original document is an SGML document and either no option is specified or the sgml option is specified, the resulting SGML file will use the same encoding as the original document.
      • If the original document is an XML document and the sgml option is specified, the resulting SGML file will use the encoding used by the operating system.
      • If the original document is an XML document and either no option is specified or the xml option is specified, the resulting XML file will use the same encoding as the original document.
      XML documents that do not contain an encoding declaration in their header are assumed to have the default XML encoding of UTF-8.
      publicId - If this parameter is not null and not an empty string, it is written as the public identifier of the DOCTYPE declaration instead of the original value (if any). If it is "<none>" then the PUBLIC identifier will be omitted.
      systemId - If this parameter is not null and not an empty string, it is written as the SYSTEM identifier on the DOCTYPE declaration. If it is "<none>", the SYSTEM identifier will be omitted.If this option is null or an empty string, the Application.getOption("writeabsolutesysid") setting determines how the SYSTEM identifier is written.
      Throws:
      AOMException - Raised if the method detects any error.
      Since:
      Epic 4.3
    • save

      void save(int flags, String path, String encoding, String publicId) throws AOMException
      Method overload which omits the last parameter.
      Throws:
      AOMException
    • save

      void save(int flags, String path, String encoding) throws AOMException
      Method overload which omits the last 2 parameters.
      Throws:
      AOMException
    • save

      void save(int flags, String path) throws AOMException
      Method overload which omits the last 3 parameters.
      Throws:
      AOMException
    • save

      void save(int flags) throws AOMException
      Method overload which omits the last 4 parameters.
      Throws:
      AOMException
    • save

      void save() throws AOMException
      Method overload which omits the last 5 parameters.
      Throws:
      AOMException
    • getOption

      String getOption(String name)
      This method returns the value of the PTC Arbortext set option, scoped to this document.
      Parameters:
      name - Specifies the option name, which must be a document-scope option.
      Returns:
      The string value of the option, or null if name is not a valid option name. Boolean values return on or off.
      Since:
      Epic 4.3
    • setOption

      void setOption(String name, String value) throws AOMException
      This method sets the value of the PTC Arbortext set option, scoped to this document.
      Parameters:
      name - Specifies the option name, which must be a document-scope option.
      value - Specifies the new value of the option. Boolean values are specified using the string on or off.
      Throws:
      AOMException - Raised if the method detects an error, for example, if name is not a valid document-scope option.
      Since:
      Epic 4.3
    • undo

      void undo() throws AOMException
      This method reverses the previous change to the document. If called repeatedly, reverses earlier changes.
      Throws:
      AOMException - Raised if the method detects an error, for example, when no undo information is available. The associated message gives the reason for the failure.
      Since:
      Epic 5.0
    • undoBoundary

      void undoBoundary(String description)
      This method inserts a boundary in the undo history so that a subsequent undo will restore changes up to the current state. Normally, the editor inserts a boundary automatically before changes are made by a menu item, toolbar selection, or keyboard shortcut. When implementing a custom application dialog, it may be necessary to call the undoBoundary method before making document changes using the AOM, especially if the dialog is modeless and allows multiple changes to be made which should be undone individually.
      The undoBoundary method enables undo history on this document. Normally, a document not associated with a window will not have undo history enabled.
      The optional description parameter may be specified to set the label for the Undo menu. Application code can access this label by calling the eval method on the Acl interface. For example, in JavaScript:
      var lbl = 
       Acl.eval("main::undo_label");
      Parameters:
      description - Specifies the description to use as the Undo menu label for the next undoable change to the document.
      Since:
      Epic 5.0
    • undoBoundary

      void undoBoundary()
      Method overload which omits the last parameter.
    • undoClear

      void undoClear()
      Clears the document's undo history. No changes made before this call can be undone.
      Since:
      Epic 5.0
    • redo

      void redo() throws AOMException
      The redo method reverses the change made by the last undo. A series of consecutive undos may be reversed by the corresponding number of redos. Redo operations do not get added to the undo history.
      Throws:
      AOMException - Raised if the method detects an error, for example, when the last change was not an undo or redo.
      Since:
      Epic 5.0
    • editBegin

      void editBegin()
      The editBegin and editEnd methods provide a mechanism to bracket a series of document changes which may optionally be rolled back. Before beginning a series of changes, call editBegin for this document. At the end of the changes, call editEnd to either commit the changes or to roll them back by specifying false as the commit parameter.
      Multiple calls may be made to editBegin before an editEnd call, for example if one top-level script calls another as part of its implementation. In this case, the changes are not committed or rolled back until the outermost editEnd call is made. All changes since the first editBegin call will be rolled back if any nested call to editEnd or the outermost editEnd call specifies false as the commit parameter.
      For example, in JavaScript:
      doc.undoBoundary("Big Changes"); 
       doc.editBegin(); var commit = true; try { doBigChanges(); } catch 
       (e) { commit = false; } doc.editEnd(commit);
      This example assumes doBigChanges or a method it calls throws an exception if it detects an error condition after making some document changes which should then be discarded.Each call to editBegin must be matched with a call to editEnd. Failure to do so may cause unexpected behavior until PTC Arbortext Editor or PTC Arbortext Publishing Engine is restarted. For language bindings that support exceptions, DOM or AOM calls between editBegin and editEnd calls must be wrapped in a try/catch block so that editEnd is called if an exception is raised.
      Since:
      Epic 5.0
    • editEnd

      void editEnd(boolean commit)
      This method commits or rolls back the changes made to the document since the matching editBegin call. The commit or roll back does not actually happen until the outermost editEnd call is made. Refer to the description of editBegin for details.Each call to editBegin must be matched with a call to editEnd. Failure to do so may cause unexpected behavior until PTC Arbortext Editor or PTC Arbortext Publishing Engine is restarted. For language bindings that support exceptions, DOM or AOM calls between editBegin and editEnd calls must be wrapped in a try/catch block so that editEnd is called if an exception is raised.
      Parameters:
      commit - If true, specifies that the change should be committed. If false, changes will be rolled back (undone).
      Since:
      Epic 5.0
    • canRenameNode

      short canRenameNode(Node node, String namespaceURI, String qualifiedName)
      Tests whether an existing node of type ELEMENT_NODE or ATTRIBUTE_NODE can be renamed such that the resulting node is compliant with VAL_SCHEMA validity type.
      Parameters:
      node - The Node to be renamed.
      namespaceURI - The new namespace URI.
      qualifiedName - The new qualified name.
      Returns:
      A validation state constant.
      Since:
      Epic 5.0
    • getDirectory

      String getDirectory()
      The directory associated with the document. For documents read from the file system, this is the directory part of the documentURI attribute, excluding the name, and expressed as a file system path not as a URI. If the document has no directory, for example, a new document created from a template and not yet saved, this is the null string. A document created by calling cloneNode on another Document node inherits this attribute.
      This attribute is read-only. However, changing the documentURI attribute will also change the value of the directory attribute.
      Since:
      Epic 5.1
    • getCMSObjects

      CMSObjectList getCMSObjects() throws CMSException
      Returns an collection of all the objects in this document. The objects in this collection may be in any order but each will be present exactly once. Note that if a document contains a given child object in two locations then the returned collection will contain two objects; one for each reference. Each object will reference the same repository object but, for example, will have different start and end values associated with them.
      Throws:
      CMSException - Raised for any error.
      Since:
      Epic 5.2
    • generateEntityName

      String generateEntityName(String logicalId) throws CMSException
      Generates an entity name suitable for use with this document. If no logicalId is given (or if it doesn't map to an active session), a random number is used to create an entity name which is currently not in use by this document. Otherwise the associated CMS adapter session will be called to produce the entity name. The adapter guarantees that the returned entity name will be unique as per the given logicalId. Thus, if given the same logicalId twice, this may return the same entity name twice. However, if given different logicalId's, this will return different entity names.
      Parameters:
      logicalId - Logical ID used to ask an associated CMS adapter session to generate the unique name.
      Returns:
      Unique entity name suitable for use with this document.
      Throws:
      CMSException - Raised for any error.
      Since:
      Epic 5.2
    • generateEntityName

      String generateEntityName() throws CMSException
      Method overload which omits the last parameter.
      Throws:
      CMSException
    • cloneDocument

      Document cloneDocument(int flags) throws CMSException
      Creates a completely independent copy of this document. The cloned document will have no Document.documentURI or ADocument.name attributes set for it. However, the ADocument.directory attribute will be identical to the source document so that relatively-referenced resources (such as graphic files) will be correctly resolved in the context of the cloned document.You should avoid using the Document.documentURI attribute to give the cloned document a URI identical to the source document because any subsequent changes made to either document will be reflected in the other document.
      Parameters:
      flags - A bitmask constructed by ORing some combination of the following constants: CLONE_EMPTY, CLONE_RESOLVE_CHANGE_TRACKING, CLONE_NO_ENT_DECLS, CLONE_XML, CLONE_CARET.See the descriptions of these constants for more information.
      Returns:
      Cloned document.
      Throws:
      CMSException - Raised for any error.
      Since:
      Epic 5.2
    • cloneDocument

      Document cloneDocument() throws CMSException
      Method overload which omits the last parameter.
      Throws:
      CMSException
    • getProperties

      PropertyMap getProperties()
      A PropertyMap object containing user-defined properties for the document. The properties are stored at the beginning of the XML file as processing instructions.
      Since:
      Epic 5.2
    • modifyReferences

      int modifyReferences(PropertyMap map, int flags) throws AOMException
      This method will replace references within the given ADocument. The references to be replaced are those listed as keys in the given PropertyMap, and will be replaced by the value of each associated PropertyMap key. If the given ADocument contains any inclusions (such as file entities or XIncludes), unlike IOHost::modifyReferences, this method will descend into those inclusions in order to update any references that might be found in their content if the reference is found as a key in the given PropertyMap.
      What is considered an “inclusion”, as far as this method is concerned, is limited to file entities and XIncludes. Any elements or attributes of elements which are encountered that match a customref burst configuration file rule (as found in the burst configuration file associated with the doctype of the Document or CMSObject to which the scrutinized node belongs) is not considered an “inclusion ” by this method since customref is a referencing mechanism and not intended for inline inclusions. Any matching customref references will be replaced by this method, but since customref is not considered an “inclusion” mechanism, this method will not open the file or logical id the customref references in order to descend into its contents.
      All keys in the PropertyMap that reference the file system will be made a canonicalized universal name before any lookups occur. Also, each reference that is to be looked up in the PropertyMap that is a filesystem reference will also be temporarily made into a canonicalized universal name before the lookup occurs. By making all filesystem references canonicalized universal names, the caller will be assured that multiple references that use different conventions but still reference the same filesystem location are actually recognized as the same reference. No such manipulation will be made to CMS logical ID references.
      If the MODIFYREF_NO_CUSTOMREF flag is not included in the flags parameter, any elements or attributes of elements that are encountered that match a customref burst configuration file rule (as found in the burst configuration file associated with the doctype of the Document or CMSObject to which the scrutinized node belongs) will be recognized as a reference and as such will be modified as long as that reference is listed as a key in the given PropertyMap. If the mode of the customref rule is “dita-full”, then the reference will be replaced with the value of the relevant PropertyMap key, appended with any DITA fragment identifier (including the leading “#”) copied from the original reference. All customref rules whose mode is “dita-partial” are always ignored and never replaced by this method, even if the reference of the “dita-partial” customref is found as a key in the given PropertyMap.
      Documents and CMSObjects have a notion of whether or not they contain unsaved modifications. The modified state of the Document or CMSObject to which the given DocumentFragment belongs will be preserved by this method.
      Parameters:
      map - The given PropertyMap that associates the list of references to be replaced with the references to replace them with.Any values in the PropertyMap that are numbers (TYPE_NUMBER) or StringLists (TYPE_STRINGLIST) will be ignored.
      flags - Specifies which constraints are placed upon the modifyReferences processing. The value is determined through a bit-wise OR of the ModifyRefFlags constants.
      Returns:
      Throws:
      AOMException - Raised if an error occurs. If during processing, a reference named in the PropertyMap cannot be updated for whatever reason, the processing will stop immediately and an exception will be thrown.
      Since:
      Arbortext 5.3 M030