Skip to content

How to enable and disable plugins

rkboyce edited this page Jan 17, 2014 · 3 revisions

Domeo is build to support profiles where basically plugins get switched on/off according to your profile. This means that you can enable and disable plugins by configuration. One use for this is to speed the development cycle by having DomeoClient only load those plugins that are needed. Similarly, in a deployment situation, you can use this mechanisms to configure the plugins available to your users.

Plugins will make themselves available to be switched on/off by configuration by providing the following method in the main class for the plugin located in the 'info' subfolder (see Plugins-Architecture) :

 public Boolean getMandatory() {
    return false;
  }

The class JsonProfilesServiceImpl is a service that gets called by Domeo at startup. The call decides which plugins will be enabled/disabled. For now, you can enable or disable profiles by editing the lines in the method (JsonProfilesServiceImpl.java file look for it in eclipse Project explorer ctrl+shift+r WIN Users - cmd+shift+r MAC Users):

method doGet(HttpServletRequest req, HttpServletResponse resp)

For example, to disable the SPLs plugin, edit:

"{\"status\":\"enabled\",\"name\":\"org.mindinformatics.gwt.domeo.plugins.annotation.spls\"},"+

To be:

"{\"status\":\"disabled\",\"name\":\"org.mindinformatics.gwt.domeo.plugins.annotation.spls\"},"+

The mechanism is implemented by the code in Domeo.java

if(_profileManager.getUserCurrentProfile().isPluginEnabled(SPLsPlugin.getInstance().getPluginName())) {   
            annotationFormsManager.registerAnnotationForm(MSPLsAnnotation.class.getName(),
                new SPLsFormProvider(this));
        }

As a result, by changing the service response you will have only the annotation tabs that have been enabled.