Subversion Repositories oidplus

Rev

Rev 362 | Go to most recent revision | Blame | Last modification | View Log | RSS feed


FEATURE OIDS
============

PHP classes belonging to the OIDplus system (such as the class handling the tree menu structure,
the sitemap, the AJAX handling, etc) are communicating to plugins the "normal way", i.e.
the plugin class defines a function which is called by the OIDplus system.

Plugins can offer interfaces/functionalities that can be used by other plugins.
For Example: The OOBE plugin queries other plugins if they want to be included
in the Out-Of-Box-Experience configuration. Therefore the plugins need to implement an
"oobeEntry" function. However, if we would do it the normal way (the OOBE plugin defining
a PHP interface and the other plugins implementing it), the plugins would not work
anymore if the plugin offering the interface is missing, due to a PHP compilation error.
Therefore, we use a functionality called "features".
A plugin can ask another plugin if it supports a feature (defined as OID) using
the function OIDplusPlugin::implementsFeature().
If it supports the feature with a given OID, the plugin promises that it
contains a set of functions defined by that OID.

Currently, there are following features defined in the standard plugins of OIDplus:

Interface <1.3.6.1.4.1.37476.2.5.2.3.1> {
        // called by plugin adminPages/050_oobe
        public function oobeEntry($step, $do_edits, &$errors_happened): void;
        public function oobeRequested(): bool;
}

Interface <1.3.6.1.4.1.37476.2.5.2.3.2> {
        // called by plugin publicPages/000_objects (gui)
        public function modifyContent($id, &$title, &$icon, &$text);
}

Interface <1.3.6.1.4.1.37476.2.5.2.3.3> {
        // called by plugin publicPages/000_objects (ajax)
        public function beforeObjectDelete($id);
        public function afterObjectDelete($id);
        public function beforeObjectUpdateSuperior($id, &$params);
        public function afterObjectUpdateSuperior($id, &$params);
        public function beforeObjectUpdateSelf($id, &$params);
        public function afterObjectUpdateSelf($id, &$params);
        public function beforeObjectInsert($id, &$params);
        public function afterObjectInsert($id, &$params);
}

Interface <1.3.6.1.4.1.37476.2.5.2.3.4> {
        // called by plugin publicPages/100_whois
        public function whoisObjectAttributes($id, &$out);
        public function whoisRaAttributes($email, &$out);
}


TL;DR:
Plugins communicate with other plugins using the OIDplusPlugin::implementsFeature()
function, which provide a way of "optional" interfaces.