Skip to content

Custom plugin selector

Colby Chiste requested to merge custom_plugin_selector into master

Purpose

This exercise has us creating our own plugin system that renders sets of directions to animal dens for Park Rangers. The directions can either be normal or enhanced, with the enhanced providing sound based words to help direct the user to the den.

Approach

  1. Create a plugin manager and define it as a service
  2. Define an annotation class for collecting and documenting metadata about our plugins
  3. Define an interface for plugins of the new type to implement.
  4. Provide an abstract base class as a starting point for anyone implementing our plugin type
  5. Set up three controllers for the different animal dens
  6. Create two example plugins of the new plugin type
  7. Modify which plugin is being used via modules settings form
  8. Render text directions using the selected plugin

How to

Administrator will log in and navigate to the modules settings form at admin/config/thunderdome and be able to select either standard or enhanced for the three listed animal types. From there any user can navigate to one of /sloths,/bison,/meerkat and see the rendered instructions to the respective animals' den. The meerkat directions explicitly need an additional audio device and so will render nothing unless using the enhanced plugin.

Review Checklist

  • Sufficient documentation (can others figure out what's going on without context?
  • Sufficient test coverage.
  • All pipelines pass.
  • Added applicable files to code standards and automated test pipelines.
  • No merge conflicts present.
  • Merge request follows deployment requirements.
Edited by Colby Chiste

Merge request reports