Beans (extension point)

From BioUML platform
Revision as of 16:14, 13 May 2013 by Tagir Valeev (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Identifier
ru.biosoft.access.beans
Plugin
ru.biosoft.access
Since
0.9.4
Registry
BeanRegistry

Description

This extension point allows you to resolve Java objects by paths in BioUML runtime. Objects located in the tree can be resolved via BioUML repository, but sometimes it's desired to have a static link to some other object (even not DataElement). For this purpose BeanRegistry.getBean(String) method can be used.

Using this extension point you may register your own prefix to resolve all objects which names start with given prefix. To achieve this you have to implement BeanProvider interface and register the created class as an extension.

Configuration Markup

<!ELEMENT provider>
<!ATTLIST provider
     class     CDATA #REQUIRED
     prefix    CDATA #REQUIRED
>
class
Fully-qualified name of the class implementing BeanProvider interface.
prefix
Prefix, cannot end with "/". Only latin letters and "/" are allowed to use in prefix. All paths starting with this prefix will be handled by your class unless more detailed handler is registered. For example, if class A is registered for "properties/myplugin" prefix and class B is registered for "properties/myplugin/deep" prefix, then all paths starting with "properties/myplugin/deep" will be handled by class B, while all other paths starting with "properties/myplugin" will be handled by class A. If two classes are registered for the same prefix, it's undefined which one will handle it.

Notes

  • BeanRegistry.getBean method always looks first in the BioUML repository for the supplied path. Thus be careful to avoid names collisions. It's recommended to start prefix with "properties/".
  • When you implement BeanProvider interface, please note that parameter passed to BeanProvider.getBean method is not the full path, but the path except the prefix.
  • Currently this extension point is mainly used by BioUML web edition code. See WebBeanProvider for details.

Example

<extension point="ru.biosoft.access.beans">
	<provider class="ru.biosoft.table.TableCellBeanProvider" prefix="properties/tableCell"/>
</extension>

All paths starting with "properties/tableCell" will be handled by TableCellBeanProvider.

Personal tools
Namespaces

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