Creating Service Plugins

Developers can extend the functionality of generated applications by writing implementations of various kinds of services. This section provides a quick reference for materials they can use to write their own plugins.

In general, it is advisible to read the sections on architecture to better understand how to write your own services. In particular, you should read the sections on service anatomy, service families, and accessing variables via contexts. These describe both general and specialised services along with supported scopes and how services can be manipulated. As well, you should read the section on native data structures, which can be found as a reference section under the detailed section on the core architecture. This gives information about how to extract information from data dtructures being used to hold record data.

Sections


General Purpose Plugins - see also Plugins Architecture

Code Interfaces

Examples

Class SampleEditFieldPlugin
Location .\models\developer_tutorial\src\plugins
Notes
  • A field-level plugin that shows you how to change the value of an edit field.


Class DefaultConfigurationFileCreationPlugin
Location project35.configurationTool.DefaultConfigurationFileCreationPlugin
Notes
  • Shows an example of how a plugin can create and insert a sub-tree of records;
  • An example document validation service specified in the ConfigurationFile.xml of the project35_form_configuration data model.


Class TestApplicationPlugin
Location project35.configurationTool.TestApplicationPlugin
Notes
  • An example of a plugin that can traverse and analyse the current data file;
  • A document-level plugin that is specified in the ConfigurationFile.xml of the project35_form_configuration data model.


Class DefaultOntologyServiceDescriptionsPlugin
Location project35.configurationTool.DefaultOntologyServiceDescriptionsPlugin
Notes
  • Shows a plugin that uses a modal dialog to gather additional information from end-users before completing an action;
  • Linked to record "record_field" field "ontology_service" in the ConfigurationFile.xml of the developer tutorial model.


Class SaveMetaDataFile
Location project35.metaData.SaveMetaDataFile
Notes
  • Shows an example of how to override a standard file menu function. In the ConfigurationFile.xml file associated with the model project35_meta_data, the option for "show_save_file" is set to "false". This part removes the standard "Save" feature from the File menu of the generated Project35 Meta Data Editor. Then a plugin by the same menu is associated with the menu;
  • A document-level plugin found for the model project35_meta_data.

Back to top


ID Generator Services - see also ID Generation Architecture

Code Interfaces

Examples

Class DefaultIDGeneratorService
Location project35.soa.id.DefaultIDGeneratorService
Notes
  • Shows an example of parameterised service that can recognise a prefix for identifier values and values to exclude from the key generation process;
  • This is the ID service that is used when no ID Generator Service is associated with an attribute field.


Class ExampleIDGeneratorService
Location .\models\developer_tutorial\src\developerTutorial\idServices
Notes
  • This is a typical example of an ID Generator Service that is linked to record "id_generator_services" field "id_field" in the ConfigurationFile.xml of the developer tutorial model.

Back to top


Ontology Services - see also Ontologies Architecture

Relevant Interfaces

Examples

Class LessThan40Words
Location .\models\developer_tutorial\src\developerTutorial\ontologySources
Notes
  • This shows an example of a simple ontology which contains less than 40 terms;
  • It is used to demonstrate how Project35 attempts to render right-click sub-menus for ontologies which have a small number of terms;
  • Is linked to record "sources_and_viewers" field "MoreWords" in the ConfigurationFile.xml of the developer tutorial model.


Class CachedExample
Location .\models\developer_tutorial\src\developerTutorial\ontologySources
Notes
  • Shows an example of an ontology source that implements OntologyCaching interface;
  • Is linked to record "sources_and_viewers" field "CachedOntology" in the ConfigurationFile.xml of the developer tutorial model.


Class TableExample
Location .\models\developer_tutorial\src\developerTutorial\ontologySources
Notes
  • Shows an example of an ontology source that implements the DictionaryDescriptionSupport interface. Sources that implement this marker interface are rendered as dictionary entries in a table with columns for "term" and "definition";
  • Is linked to record "sources_and_viewers" field "Definitions" in the ConfigurationFile.xml of the developer tutorial model.


Class XMLOntologySource
Location project35.soa.ontology.sources.XMLOntologySource
Notes
  • This is demonstrated in the developer tutorial model, under record "sources_and_viewers", field "Definitions";
  • This example shows an ontology source that supports thumbnail images for each term.


Class WebPageAndTableExample
Location .\models\developer_tutorial\src\developerTutorial\ontologySources
Notes
  • Mostly based on project35.soa.ontology.sources.XMLOntologySource;
  • This shows an example of an ontology source which implements support for marker interfaces for URLDescriptionSupport. This interface causes the default viewer to include a panel to display the web page for a selected ontology term.


Class ImageOntologyViewer
Location .\models\developer_tutorial\src\developerTutorial\ontologyViewers
Notes
  • This shows an example of how a third-party viewer component could be wrapped as an OntologyViewer;
  • It shows how a viewer component can use the OntologyContext to determine the values of other form fields. These field values can be used to limit the terms returned to the users;
  • Is linked to record "ontology_context" field "Specimen_Part" in the ConfigurationFile.xml of the developer tutorial model.


Class ExperimentersSource
Location .\models\developer_tutorial\src\developerTutorial\ontologyContext
Notes
  • Shows how developers can use the OntologyContext object to find out the values of other fields on the current form. The field values can be used to help limit the terms that are returned to the end-user;
  • Is linked to record "ontology_context" field "Experimenter" in the ConfigurationFile.xml of the developer tutorial model.


Class TabIndentedTextSource
Location project35.soa.ontology.source.TabIndentedTextSource
Notes
  • This shows a common ontology source used to parse ontologies stored in tab-delimited files.


Class SingleColumnTextSource
Location project35.soa.ontology.source.SingleColumnTextSource
Notes
  • Shows a common ontology source used to parse ontologies stored in text files having a single column of values.


Class DefaultOntologyViewer
Location project35.soa.ontology.views.DefaultOntologyViewer
Notes
  • This is an elaborate ontology viewer that supports multiple ways of visualising ontologies. It contains code for recognising rendering hints in ontology sources based on other marker interfaces the sources implement such as DictionaryDescriptionSupport, ImageDescriptionSupport, etc.


Class Project35ConfigurationOntologySource
Location project35.configurationTool.Project35ConfigurationOntologySource
Notes
  • This gives an example of how an ontology source can provide terms based on record and field concepts managed by record templates found in RecordModelFactory.

Back to top


Validation Service - see also Validation Architecture

Code Interfaces

Examples

Class StringMaskValidator
Location project35.soa.validation.StringMaskValidator
Notes
  • Provides an example of how regular expressions can be used to validate a field value.


Class BoundedDoubleValidator
Location project35.soa.validation.BoundedDoubleValidator
Notes
  • This shows how a validation service can publish constraint information that can be included in auto-generated functional specifications;
  • Shows an example of a validation service that checks that a field value is within the limits of a domain.


Class DuplicateRecordConfigurationsValidationService
Location project35.soa.validation.DuplicateRecordConfigurationsValidationService
Notes
  • Shows how a document validation service can check to see whether a list field contains records that have duplicate identifiers. This example could have also been implemented as a ListFieldValidationService


Class OntologyTermValidationService
Location project35.soa.metaData.OntologyTermValidationService
Notes
  • This shows how a validation service can be used to make complex checks;
  • It is specified as a document level validation service in the project35_meta_data model.


Class ValidateCancerGenderCombination
Location .\models\developer_tutorial\src\developerTutorial\validationServices
Notes
  • This shows an example of a RecordModelValidationService that checks for illegal combinations of field values on the same form;
  • It is linked to record "validation_services".


Class ListFieldValidationService
Location .\models\developer_tutorial\src\developerTutorial\validationServices
Notes
  • Shows an example of a ListFieldValidationService that checks that a list field has a certain number of children of a particular type.

Back to top