Subversion Repositories oidplus

Rev

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


FEATURE OIDS ("Weak interfaces")
============

TL;DR:  The system communicates with its plugins using normal PHP interfaces
        or function calls.
        Plugins communicate with other plugins using the OIDplusPlugin::implementsFeature()
        function, which provides a way of "optional" interfaces that do not raise
        an Exception if they are missing.

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 implementsFeature().
If it supports the feature with a given OID, the plugin promises that it
contains a set of functions defined by that OID.

All classes of OIDplus inherit from OIDplusBaseClass, which implements
OIDplusBaseClass::implementsFeature(). Therefore, the "feature OID" functionality
works also for plugin-like classes (e.g. OIDplusObject) and not only for the
real plugin classes (OIDplusPlugin).

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);
}

Interface <1.3.6.1.4.1.37476.2.5.2.3.5> {
        // called by plugin publicPages/090_login
        public function alternativeLoginMethods();
}

Interface <1.3.6.1.4.1.37476.2.5.2.3.6> {
        // called by publicPages/000_objects
        public function gridGeneratorLinks($objParent);
}