Tutorial on developing an XDS spot search plugin
This tutorial is not yet complete.
This tutorial is based on the development described in the small workshop minutes:
Contents
Use Case
This plugin finds spots on a single sub wedge using XDS.
Create Plugin Directories
- In $EDNA_HOME/prototype/plugins create a new directory “EDPluginXDSSpotSearch-v0.1”
- In this directory, create "datamodel", "plugins" and "tests" directories. In the "tests" directory create "data" and "testsuite" directories.
How to create the XDS spot search specific data model
- Open Enterprise Architect (see How to install Enterprise Architect)
- File → New Project → Save project as EDNA_HOME/prototype/plugins/ EDPluginXDSSpotSearch-v0.1/datamodel/XSDataXDSSpotSearchv01.EAP
- Don't choose any option, just click on OK.
- Open the "Project Browser"
- Rename "Model" to "XSDataXDSSpotSearchv01"
- Rightclick on "XSDataXDSSpotSearchv01" icon, choose "Import data model from XMI"
- Choose to import "EDNA_HOME/prototype/datamodel/XSDataCommonv01.xmi"
- Answer “Yes” to “Ok to import XMI file?” question
- Click on “Close” to close the import dialog window
- Rightclick again on the top “XSDataXDSSpotSearchv01” icon in the project browser and choose “New view...”
- Type the name “XSDataXDSSpotSearchv01” and choose “Class view”, click on OK
- Rightclick on the new icon “XSDataXDSSpotSearch” and choose “add → Add diagram...”
- Choose “UML Structural” and “Class”, keep the name and click on OK
- You should now see “Logical diagram 'XSDataXDSSpotSearch'” in the main window, if not double click on the new “XSDataSpotSearch” diagram icon
- Select by clicking once on the “XSDataXDSSpotSearchv01” model icon (not top level nor the diagram icon, but the one in the middle)
- Choose "View → Tagged values"
- Click on the new tag icon
- TODO: More detailed explanation! Add a new tag with "Tag: schemaLocation = XSDataCommonv01.xsd" and "targetNamespace = http://www.edna-site.org"
- Start to construct the data model...
- How to derive from XSDataInput etc.
- Use associations and notes for clarity
- Save data model
- Generate XSD file : Project → XML Schema → Generate XML Schema. Choose name "EDNA_HOME/prototype/plugins/EDPluginXDSSpotSearch-v0.1/datamodel/XSDataXDSSpotSearchv01.exsd" - Make sure the correct source package is selected in the project browser.
- Export xmi file : Project → Import/Export → Export package to XMI. Choose file name "EDNA_HOME/prototype/plugins/EDPluginXDSSpotSearch-v0.1/datamodel/XSDataXDSSpotSearchv01.xmi"
- Save the view as image : Diagram → Save as image..., save the image as "EDNA_HOME/prototype/plugins/EDPluginXDSSpotSearch-v0.1/datamodel/XSDataXDSSpotSearchv01.png".
Write the test for the plugin
See How to test an EDNA plugin for general instructions for EDNA plugin testing. For the XDS spot search plugin:
- Create input test data in $EDNA_HOME/prototype/plugins/EDPluginXDSSpotSearch-v0.1/tests/data
- Write a execute test case $EDNA_HOME/prototype/plugins/EDPluginXDSSpotSearch-v0.1/tests/testsuite/EDTestCasePluginXDSSpotSearchv01.py
Write configuration for the plugin
- Define essential configuration information like path to executable etc.
Write the plugin
- To be visualised in the wiki...