Tutorial on developing an XDS spot search plugin

From EdnaWiki
Jump to: navigation, search

This tutorial is not yet complete.

This tutorial is based on the development described in the small workshop minutes:

Use Case

This plugin finds spots on a single sub wedge using XDS.

Create Plugin Directories

  1. In $EDNA_HOME/prototype/plugins create a new directory “EDPluginXDSSpotSearch-v0.1”
  2. 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

  1. Open Enterprise Architect (see How to install Enterprise Architect)
  2. File → New Project → Save project as EDNA_HOME/prototype/plugins/ EDPluginXDSSpotSearch-v0.1/datamodel/XSDataXDSSpotSearchv01.EAP
  3. Don't choose any option, just click on OK.
  4. Open the "Project Browser"
  5. Rename "Model" to "XSDataXDSSpotSearchv01"
  6. Rightclick on "XSDataXDSSpotSearchv01" icon, choose "Import data model from XMI"
  7. Choose to import "EDNA_HOME/prototype/datamodel/XSDataCommonv01.xmi"
  8. Answer “Yes” to “Ok to import XMI file?” question
  9. Click on “Close” to close the import dialog window
  10. Rightclick again on the top “XSDataXDSSpotSearchv01” icon in the project browser and choose “New view...”
  11. Type the name “XSDataXDSSpotSearchv01” and choose “Class view”, click on OK
  12. Rightclick on the new icon “XSDataXDSSpotSearch” and choose “add → Add diagram...”
  13. Choose “UML Structural” and “Class”, keep the name and click on OK
  14. You should now see “Logical diagram 'XSDataXDSSpotSearch'” in the main window, if not double click on the new “XSDataSpotSearch” diagram icon
  15. Select by clicking once on the “XSDataXDSSpotSearchv01” model icon (not top level nor the diagram icon, but the one in the middle)
  16. Choose "View → Tagged values"
  17. Click on the new tag icon
  18. TODO: More detailed explanation! Add a new tag with "Tag: schemaLocation = XSDataCommonv01.xsd" and "targetNamespace = http://www.edna-site.org"
  19. Start to construct the data model...
    • How to derive from XSDataInput etc.
    • Use associations and notes for clarity
  20. Save data model
  21. 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.
  22. Export xmi file : Project → Import/Export → Export package to XMI. Choose file name "EDNA_HOME/prototype/plugins/EDPluginXDSSpotSearch-v0.1/datamodel/XSDataXDSSpotSearchv01.xmi"
  23. 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:

  1. Create input test data in $EDNA_HOME/prototype/plugins/EDPluginXDSSpotSearch-v0.1/tests/data
  2. Write a execute test case $EDNA_HOME/prototype/plugins/EDPluginXDSSpotSearch-v0.1/tests/testsuite/EDTestCasePluginXDSSpotSearchv01.py

Write configuration for the plugin

  1. Define essential configuration information like path to executable etc.

Write the plugin

  1. To be visualised in the wiki...