Package com.arbortext.epic
Interface ADocument
- All Known Implementing Classes:
DocumentImpl
public interface ADocument
The PTC Arbortext extension to the W3C DOM
Document interface.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intInclude the source document's caret position in the cloned content.static final intInclude every block oid in the source document as a pi in the cloned content.static final intSets the name of the cloned documnt to the name of the source document.static final intNo content will be cloned.static final intMakes the empty document not inherit entity declarations from the source document.static final intResolve any change tracking markup according to the value of theviewchangetrackingoption for the current view of the source document.static final intForce clone to be XML even if the source is SGML.static final intThe document is an HTML document.static final intIndicates that the burst configuration file associated with the doctype of the document given to themodifyReferencesmethod should not be consulted in order to determine which DOM nodes are considered customref references.static final intIndicates that file entity references will not be modified.static final intIndicates that neither the PTC Arbortext Styler stylesheet nor DCF file associated with the document or the doctype of the document given to themodifyReferencesmethod should be consulted in order to determine which DOM nodes are considered “graphics ”.static final intIndicates that XInclude references will not be modified.static final intThe document does not use XML, SGML, or HTML markup.static final shortThere is no selection.static final intFor documents with change tracking markup, save as if all changes are pending (highlighted view).static final intFor documents with change tracking markup, save as if all changes are accepted (latest view).static final intFor documents with change tracking markup, save as if all changes are rejected (original view).static final intEnables entity output conversion.static final intExpands all file entities recursively.static final intExpands all XInclude references recursively.static final intExpands all text entities recursively.static final intWrites non-ASCII characters as characters in the target encoding.static final intWrites non-ASCII characters as character entity references.static final intWrites non-ASCII characters as numeric character references.static final intUsed internally for HTML output.static final intSuppresses entity output conversion.static final intRemoves the DOCTYPE header and internal subset including any private ENTITY declarations.static final intWrites a non-fragment header if possible.static final intRemoves PTC Arbortext-specific processing instructions.static final intWrite the document as an SGML document.static final intWrite a text-only version of the document.static final intWrite the document as XML.static final intThe document uses SGML markup.static final shortThere is a table selection.static final shortThere is a text selection.static final intThe document uses XML markup. -
Method Summary
Modifier and TypeMethodDescriptionshortcanRenameNode(Node node, String namespaceURI, String qualifiedName) Tests whether an existing node of typeELEMENT_NODEorATTRIBUTE_NODEcan 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.booleanclose()Closes the document, freeing all associated memory and system resources (for example, file handles).voidTheeditBeginandeditEndmethods provide a mechanism to bracket a series of document changes which may optionally be rolled back.voideditEnd(boolean commit) This method commits or rolls back the changes made to the document since the matchingeditBegincall.Method overload which omits the last parameter.generateEntityName(String logicalId) Generates an entity name suitable for use with this document.intgetAclId()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 aNodeListof all descendantElementsthat match the given attribute name and attribute value, in the order in which they are encountered in a pre-order traversal of thisDocumenttree.getElementsByAttributeNS(String namespaceURI, String localName, String value, short selector) Returns aNodeListof all descendantElementsthat 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 thisDocumenttree.A collapsed DOMRangeindicating the current location of the cursor.shortAn integer constant indicating the type of markup used by the document.booleanA boolean indicating whether the document has been modified.getName()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.AStringListcontaining the names of all document-scope PTC Arbortext set options.APropertyMapobject containing user-defined properties for the document.shortAn integer constant indicating whether there is no selection (NO_SELECTION), a text selection (TEXT_SELECTION), or a table selection (TABLE_SELECTION).ATableObjectStorecontaining all of theTableSets in the document.ATableTilePlexrepresenting the current table selection.A DOMRangeindicating the current text selection.intmodifyReferences(PropertyMap map, int flags) This method will replace references within the givenADocument.voidredo()The redo method reverses the change made by the last undo.voidsave()Method overload which omits the last 5 parameters.voidsave(int flags) Method overload which omits the last 4 parameters.voidMethod overload which omits the last 3 parameters.voidMethod overload which omits the last 2 parameters.voidMethod overload which omits the last parameter.voidSaves this document.voidsetInsertionPoint(Range insertionPoint) A collapsed DOMRangeindicating the current location of the cursor.voidsetModified(boolean modified) A boolean indicating whether the document has been modified.voidThe name of the document or a null string if the document was created without a name.voidThis method sets the value of the PTC Arbortext set option, scoped to this document.voidsetTableSelection(TableTilePlex tableSelection) ATableTilePlexrepresenting the current table selection.voidsetTextSelection(Range textSelection) A DOMRangeindicating the current text selection.voidundo()This method reverses the previous change to the document.voidMethod overload which omits the last parameter.voidundoBoundary(String description) This method inserts a boundary in the undo history so that a subsequent undo will restore changes up to the current state.voidClears the document's undo history.
-
Field Details
-
NO_SELECTION
static final short NO_SELECTIONThere is no selection.- See Also:
-
TEXT_SELECTION
static final short TEXT_SELECTIONThere is a text selection.- See Also:
-
TABLE_SELECTION
static final short TABLE_SELECTIONThere is a table selection.- See Also:
-
NO_MARKUP
static final int NO_MARKUPThe document does not use XML, SGML, or HTML markup. That is, it is untagged.- See Also:
-
XML_MARKUP
static final int XML_MARKUPThe document uses XML markup.- See Also:
-
SGML_MARKUP
static final int SGML_MARKUPThe document uses SGML markup.- See Also:
-
HTML_MARKUP
static final int HTML_MARKUPThe document is an HTML document. This value is not used for XHTML documents, which havemarkupTypeofXML_MARKUP.- See Also:
-
SAVE_CT_ORIG
static final int SAVE_CT_ORIGFor documents with change tracking markup, save as if all changes are rejected (original view).- See Also:
-
SAVE_CT_LATEST
static final int SAVE_CT_LATESTFor documents with change tracking markup, save as if all changes are accepted (latest view).- See Also:
-
SAVE_CT_ALL
static final int SAVE_CT_ALLFor 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 theApplication.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_SGMLWrite the document as an SGML document.- See Also:
-
SAVE_UNTAGGED
static final int SAVE_UNTAGGEDWrite a text-only version of the document.- See Also:
-
SAVE_XML
static final int SAVE_XMLWrite 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_NOHEADERRemoves the DOCTYPE header and internal subset including any private ENTITY declarations.- See Also:
-
SAVE_NOPI
static final int SAVE_NOPIRemoves PTC Arbortext-specific processing instructions.
If not specified, behavior is controlled by theApplication.getOption("writepi")setting.- See Also:
-
SAVE_EOC
static final int SAVE_EOCEnables entity output conversion.- See Also:
-
SAVE_NOEOC
static final int SAVE_NOEOCSuppresses entity output conversion.
If neither SAVE_EOC nor SAVE_NOEC is specified, entity output conversion is controlled by theApplication.getOption("entityoutputconvert")setting. If both are specified, entity output conversion is enabled.- See Also:
-
SAVE_NAC_ENTREF
static final int SAVE_NAC_ENTREFWrites non-ASCII characters as character entity references.- See Also:
-
SAVE_NAC_CHAR
static final int SAVE_NAC_CHARWrites non-ASCII characters as characters in the target encoding.- See Also:
-
SAVE_NAC_NUMREF
static final int SAVE_NAC_NUMREFWrites non-ASCII characters as numeric character references.
If none of the SAVE_NAC_xxx options are specified, behavior is controlled by theApplication.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_NOBREAKUsed internally for HTML output.- See Also:
-
SAVE_FLATTEN_FILE
static final int SAVE_FLATTEN_FILEExpands all file entities recursively.- See Also:
-
SAVE_FLATTEN_TEXT
static final int SAVE_FLATTEN_TEXTExpands all text entities recursively.- See Also:
-
SAVE_NON_FRAGMENT
static final int SAVE_NON_FRAGMENTWrites a non-fragment header if possible.- See Also:
-
SAVE_FLATTEN_INCLUDE
static final int SAVE_FLATTEN_INCLUDEExpands all XInclude references recursively.- See Also:
-
CLONE_NO_CONTENT
static final int CLONE_NO_CONTENTNo content will be cloned. This will result in an empty document.- See Also:
-
CLONE_RESOLVE_CT
static final int CLONE_RESOLVE_CTResolve any change tracking markup according to the value of theviewchangetrackingoption for the current view of the source document. If there is no view setting associated with the source document, the global value of theviewchangetrackingoption will be used.
Theviewchangetrackingoption 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 ifCLONE_RESOLVE_CTwere 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_DECLSMakes the empty document not inherit entity declarations from the source document. Only obeyed ifCLONE_NO_CONTENTis also specified.- See Also:
-
CLONE_XML
static final int CLONE_XMLForce 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_CARETInclude the source document's caret position in the cloned content. Only obeyed ifCLONE_NO_CONTENTis not specified.- See Also:
-
CLONE_LOCATION
static final int CLONE_LOCATIONInclude every block oid in the source document as a pi in the cloned content. Only obeyed ifCLONE_NO_CONTENTis 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_NAMESets the name of the cloned documnt to the name of the source document.- See Also:
-
MODIFYREF_NO_CUSTOMREF
static final int MODIFYREF_NO_CUSTOMREFIndicates that the burst configuration file associated with the doctype of the document given to themodifyReferencesmethod 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_GRAPHICSIndicates that neither the PTC Arbortext Styler stylesheet nor DCF file associated with the document or the doctype of the document given to themodifyReferencesmethod 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_FILEENTSIndicates that file entity references will not be modified.- See Also:
-
MODIFYREF_NO_XINCLUDES
static final int MODIFYREF_NO_XINCLUDESIndicates 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 functioncurrent_docif the document were current.- Since:
- Epic 4.0
-
getInsertionPoint
Range getInsertionPoint()A collapsed DOMRangeindicating the current location of the cursor.- Throws:
DOMException- INVALID_STATE_ERR: Raised if theRangehas already been detached.- Since:
- Epic 4.0
-
setInsertionPoint
A collapsed DOMRangeindicating the current location of the cursor.- Throws:
DOMException- INVALID_STATE_ERR: Raised if theRangehas already been detached.- Since:
- Epic 4.0
-
getTextSelection
Range getTextSelection()A DOMRangeindicating the current text selection. If there is no text selection, the value will be the same asinsertionPoint.
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 theRangehas already been detached.- Since:
- Epic 4.0
-
setTextSelection
A DOMRangeindicating the current text selection. If there is no text selection, the value will be the same asinsertionPoint.
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 theRangehas 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
Returns aNodeListof all descendantElementsthat match the given attribute name and attribute value, in the order in which they are encountered in a pre-order traversal of thisDocumenttree.- 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 is0, the value parameter is ignored. When selector is1, 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 aNodeListof all descendantElementsthat 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 thisDocumenttree.- 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 is0, the value parameter is ignored. When selector is1, 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()AStringListcontaining 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, orNO_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 thedocumentURI, including the extension, if any.- Since:
- Epic 4.3
-
setName
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 thedocumentURI, including the extension, if any.- Since:
- Epic 4.3
-
getTables
TableObjectStore getTables()ATableObjectStorecontaining all of theTableSets in the document. If there are no tables in the document, an empty store is returned.- Since:
- Epic 4.3
-
getTableSelection
TableTilePlex getTableSelection()ATableTilePlexrepresenting the current table selection. If there is no table selection, the value oftableSelectionis an emptyTableTilePlex.- Since:
- Epic 4.3
-
setTableSelection
ATableTilePlexrepresenting the current table selection. If there is no table selection, the value oftableSelectionis an emptyTableTilePlex.- Since:
- Epic 4.3
-
close
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 aViewobject.- Returns:
- Returns
trueif the document was actually closed.falseotherwise. Since an exception is thrown on an error, this will always betruewhen 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 theSaveFlagsenumeration.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 (
"|").
pathis 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.
If encoding isAdobe-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 nullor the empty string, the encoding is determined using the following rules:-
If the original document is an SGML
document and the
xmloption 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 usingedit 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
sgmloption 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
sgmloption 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
xmloption is specified, the resulting XML file will use the same encoding as the original document.
-
If the original document is an SGML
document and the
publicId- If this parameter is notnulland 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 notnulland 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 isnullor an empty string, theApplication.getOption("writeabsolutesysid")setting determines how the SYSTEM identifier is written.- Throws:
AOMException- Raised if the method detects any error.- Since:
- Epic 4.3
-
save
Method overload which omits the last parameter.- Throws:
AOMException
-
save
Method overload which omits the last 2 parameters.- Throws:
AOMException
-
save
Method overload which omits the last 3 parameters.- Throws:
AOMException
-
save
Method overload which omits the last 4 parameters.- Throws:
AOMException
-
save
Method overload which omits the last 5 parameters.- Throws:
AOMException
-
getOption
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
nameis not a valid option name. Boolean values returnonoroff. - Since:
- Epic 4.3
-
setOption
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 stringonoroff.- Throws:
AOMException- Raised if the method detects an error, for example, ifnameis not a valid document-scope option.- Since:
- Epic 4.3
-
undo
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
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 theundoBoundarymethod 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.
TheundoBoundarymethod 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 theUndomenu. Application code can access this label by calling theevalmethod on the Acl interface. For example, in JavaScript:var lbl = Acl.eval("main::undo_label");- Parameters:
description- Specifies the description to use as theUndomenu 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
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()TheeditBeginandeditEndmethods provide a mechanism to bracket a series of document changes which may optionally be rolled back. Before beginning a series of changes, calleditBeginfor this document. At the end of the changes, calleditEndto either commit the changes or to roll them back by specifyingfalseas the commit parameter.
Multiple calls may be made toeditBeginbefore aneditEndcall, 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 outermosteditEndcall is made. All changes since the firsteditBegincall will be rolled back if any nested call toeditEndor the outermosteditEndcall specifiesfalseas 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 assumesdoBigChangesor 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 toeditBeginmust be matched with a call toeditEnd. 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 betweeneditBeginandeditEndcalls must be wrapped in a try/catch block so thateditEndis 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 matchingeditBegincall. The commit or roll back does not actually happen until the outermosteditEndcall is made. Refer to the description ofeditBeginfor details.Each call toeditBeginmust be matched with a call toeditEnd. 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 betweeneditBeginandeditEndcalls must be wrapped in a try/catch block so thateditEndis called if an exception is raised.- Parameters:
commit- Iftrue, specifies that the change should be committed. Iffalse, changes will be rolled back (undone).- Since:
- Epic 5.0
-
canRenameNode
Tests whether an existing node of typeELEMENT_NODEorATTRIBUTE_NODEcan be renamed such that the resulting node is compliant with VAL_SCHEMA validity type.- Parameters:
node- TheNodeto 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 thedocumentURIattribute, 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 callingcloneNodeon anotherDocumentnode inherits this attribute.
This attribute is read-only. However, changing thedocumentURIattribute will also change the value of thedirectoryattribute.- Since:
- Epic 5.1
-
getCMSObjects
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 differentstartandendvalues associated with them.- Throws:
CMSException- Raised for any error.- Since:
- Epic 5.2
-
generateEntityName
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
Method overload which omits the last parameter.- Throws:
CMSException
-
cloneDocument
Creates a completely independent copy of this document. The cloned document will have noDocument.documentURIorADocument.nameattributes set for it. However, theADocument.directoryattribute 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 theDocument.documentURIattribute 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
Method overload which omits the last parameter.- Throws:
CMSException
-
getProperties
PropertyMap getProperties()APropertyMapobject 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
This method will replace references within the givenADocument. The references to be replaced are those listed as keys in the givenPropertyMap, and will be replaced by the value of each associatedPropertyMapkey. If the givenADocumentcontains any inclusions (such as file entities or XIncludes), unlikeIOHost::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 givenPropertyMap.
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 theDocumentorCMSObjectto 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 thePropertyMapthat 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 thePropertyMapthat 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 theMODIFYREF_NO_CUSTOMREFflag 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 theDocumentorCMSObjectto 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 givenPropertyMap. If the mode of the customref rule is “dita-full”, then the reference will be replaced with the value of the relevantPropertyMapkey, 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 givenPropertyMap.DocumentsandCMSObjectshave a notion of whether or not they contain unsaved modifications. The modified state of theDocumentorCMSObjectto which the givenDocumentFragmentbelongs will be preserved by this method.- Parameters:
map- The givenPropertyMapthat associates the list of references to be replaced with the references to replace them with.Any values in thePropertyMapthat are numbers (TYPE_NUMBER) orStringLists (TYPE_STRINGLIST) will be ignored.flags- Specifies which constraints are placed upon themodifyReferencesprocessing. The value is determined through a bit-wise OR of theModifyRefFlagsconstants.- Returns:
- Throws:
AOMException- Raised if an error occurs. If during processing, a reference named in thePropertyMapcannot be updated for whatever reason, the processing will stop immediately and an exception will be thrown.- Since:
- Arbortext 5.3 M030
-