Difference between revisions of "Document factory (extension point)"

From BioUML platform
Jump to: navigation, search
(Created page with "{{Extension point|documentFactory|ru.biosoft.workbench}} ;Applicable for :BioUML workbench === Description === This extension points configures document type in [[BioUML w...")
 

Latest revision as of 13:35, 26 August 2013

Identifier
ru.biosoft.workbench.documentFactory
Plugin
ru.biosoft.workbench
Applicable for
BioUML workbench

[edit] Description

This extension points configures document type in BioUML workbench.

[edit] Configuration Markup

<!ELEMENT documentFactory>
<!ATTLIST documentFactory
     key           CDATA #REQUIRED
     documentClass CDATA #IMPLIED 
     class         CDATA #IMPLIED
>
key
Fully qualified name of the class implementing DataElement interface. Registered document type will be used for elements of given class.
documentClass
(since 0.9.6) Fully qualified name of the class extending Document abstract class. This class is the implementation of the document itself.
class
Fully qualified name of the class implementing DocumentFactory interface. This class should create Document instances in DocumentFactory.openDocument method.

[edit] Examples

<extension id="TreeTable document factory" point="ru.biosoft.workbench.documentFactory"> 
     <documentFactory 
       documentClass="ru.biosoft.treetable.TreeTableDocument"
       key="ru.biosoft.treetable.TreeTableElement"
     /> 
</extension>

This extension specifies that Type-tree-table-icon.png tree-tables will be displayed via TreeTableDocument.

<extension id="table document factory" point="ru.biosoft.workbench.documentFactory"> 
    <documentFactory 
      class="ru.biosoft.table.document.TableFactory"
      key="ru.biosoft.table.TableDataCollection"
    /> 
</extension>

This extension specifies that Type-table-icon.png tables will be displayed using TableFactory factory.

[edit] API information

You must use either documentClass or class attribute. If documentClass is specified, then DefaultDocumentFactory will be used as factory. If this factory doesn't satisfy your needs (for example, you may want to produce documents of different class), you should create your own factory.

Classes implementing DocumentFactory interface must have default constructor. Classes extending Document must have constructor taking one argument of the type specified in key property.

Personal tools
Namespaces

Variants
Actions
BioUML platform
Community
Modelling
Analysis & Workflows
Collaborative research
Development
Virtual biology
Wiki
Toolbox