Class: AuthorEditingSupport

sync.api. AuthorEditingSupport


new AuthorEditingSupport(options)

Instance of sync.api.EditingSupport used when the current document is an XML document opened in "Author" mode.
Parameters:
Name Type Description
options sync.api.Workspace.LoadingOptions The options to be used by the editing support.

Classes

AuthorModelChangedEvent
ModelChangedMutation

Members


<static> EventType :string

Event types generated by this editing support.
Type:
  • string
Properties:
Name Type Default Description
BEFORE_MODEL_CHANGED string AES_before_model_changed Generated before the editor content changes.
See sync.api.AuthorEditingSupport.AuthorModelChangedEvent for more details.
MODEL_CHANGED string AES_model_changed Generated after the editor content changes.
See sync.api.AuthorEditingSupport.AuthorModelChangedEvent for more details.

Methods


getChangeTrackingManager()

Returns the change tracking manager for the current editor.
Returns:
the change tracking manager.
Type
sync.api.ChangeTrackingManager

getDocument()

Returns the document node of the XML DOM model. The returned node partially respects the DOM Level 3 specification with some limitations:
  • operations that modify the DOM are not supported.
  • Node.baseURI works for nodes included from other documents, but does not take the xml:base attribute into acount.
  • the Attribute.isId function does not take schema information into account
  • TextNode.wholeText does not take into account entity reference nodes.
  • isElementContentWhitespace always returns false
  • the schemaTypeInfo property is not supported.
  • the documentType property of document always returns null.
  • the API may return multiple JS objects corresponding to the same XML node - use the isSameNode method to detect these cases.

    Note that the document may change during an editing session - for example when replacing it in text mode. In this case a different instance is returned.

  • Since:
    • 22.1
    Returns:
    The document node of the XML DOM model.
    Type
    Document

    getPersistentHighlightsManager()

    Returns the handler for custom persistent highlights.
    Since:
    • 22.1
    Returns:
    The persistent highlights manager.
    Type
    sync.api.PersistentHighlightsManager | null

    getWidgetsFactory()

    Returns the Author widgets factory.
    Since:
    • 22.1
    Returns:
    The Author editing support widgets factory.
    Type
    sync.api.AuthorWidgetsFactory

    registerEnhancer(name, enhancer)

    Registers an enhancer for a type of form controls.

    This registration should be performed before the editor is loaded, so that the enhancer can be used for the initial rendering of the document.

    Parameters:
    Name Type Description
    name string The type of the form-control, which is the fully qualified name of the Java WebappFormControlRenderer class.
    enhancer function The constructor for an instance of sync.formctrls.Enhancer that will be used to enhance form controls rendered by the specified Java renderer.