Jump to content
  • Extending the Document using the Spotfire® Document Model Framework API


    This article describes how to extend the document model in Spotfire® using the Document Model Framework API.

    Overview

    This page describes how to extend the document model in Spotfire® using the Document Model Framework API.

    The document model is a node tree. It is extended by adding new nodes.

    Usually the custom document node will be designed for a specific purpose, which may greatly differ between nodes. You will inherit from the specialised classes such as CustomPanel or CustomVisual or from the all-purpose CustomNode. In the end, all these classes inherit from DocumentNode. If your specialized node contains additional nodes, you can add nodes directly inheriting from DocumentNode.

    Creating a document node

    The general work order when adding a document node is as follows:

    1. Create a DocumentNode class.

      DocumentNode is the abstract base class for all types in the model. The document is extended by creating, attaching and configuring nodes. The class must derive from the DocumentNode base class or a subclass to it. 

      The class must be marked with the Serializable and PersistenceVersion attributes.
       

    2. Create an inner PropertyNames class.

      Every property of a custom document node must have an associated identifier, a Property Name.
       

    3. Add Undoable Nodes.

      Document nodes must not be modified. Instead they may contain Undoable Nodes, a special, modifiable kind of nodes.
       

    4. Add Readonly Properties.

      Some properties stored in ordinary readonly fields never change after initialization. They nevertheless must be initialized in a special way for the Document Model Framework to keep track of them.
       

    5. Optionally, add the following entities to your node:
      1. Runtime Properties.

        A runtime property is defined at runtime. It can be computed from other properties in the document.
         

      2. Event Handlers for internal events.

        The Document Model Framework separates internal and external events. Internal events update the model to a consistent state. External events update the view to reflect the state of the model.
         

      3. configuration phase.

         

      4. Public methods

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...