Rev 1000 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
387 | daniel-mar | 1 | |
730 | daniel-mar | 2 | FEATURE OIDS ("Weak interfaces") |
387 | daniel-mar | 3 | ============ |
4 | |||
778 | daniel-mar | 5 | TL;DR: The system communicates with its plugins using normal PHP interfaces |
6 | or function calls. |
||
7 | Plugins communicate with other plugins using the OIDplusPlugin::implementsFeature() |
||
8 | function, which provides a way of "optional" interfaces that do not raise |
||
9 | an Exception if they are missing. |
||
10 | |||
387 | daniel-mar | 11 | PHP classes belonging to the OIDplus system (such as the class handling the tree menu structure, |
12 | the sitemap, the AJAX handling, etc) are communicating to plugins the "normal way", i.e. |
||
13 | the plugin class defines a function which is called by the OIDplus system. |
||
14 | |||
15 | Plugins can offer interfaces/functionalities that can be used by other plugins. |
||
16 | For Example: The OOBE plugin queries other plugins if they want to be included |
||
17 | in the Out-Of-Box-Experience configuration. Therefore the plugins need to implement an |
||
18 | "oobeEntry" function. However, if we would do it the normal way (the OOBE plugin defining |
||
19 | a PHP interface and the other plugins implementing it), the plugins would not work |
||
20 | anymore if the plugin offering the interface is missing, due to a PHP compilation error. |
||
21 | Therefore, we use a functionality called "features". |
||
22 | A plugin can ask another plugin if it supports a feature (defined as OID) using |
||
730 | daniel-mar | 23 | the function implementsFeature(). |
387 | daniel-mar | 24 | If it supports the feature with a given OID, the plugin promises that it |
25 | contains a set of functions defined by that OID. |
||
26 | |||
730 | daniel-mar | 27 | All classes of OIDplus inherit from OIDplusBaseClass, which implements |
28 | OIDplusBaseClass::implementsFeature(). Therefore, the "feature OID" functionality |
||
29 | works also for plugin-like classes (e.g. OIDplusObject) and not only for the |
||
30 | real plugin classes (OIDplusPlugin). |
||
31 | |||
387 | daniel-mar | 32 | Currently, there are following features defined in the standard plugins of OIDplus: |
33 | |||
34 | Interface <1.3.6.1.4.1.37476.2.5.2.3.1> { |
||
35 | // called by plugin adminPages/050_oobe |
||
36 | public function oobeEntry($step, $do_edits, &$errors_happened): void; |
||
37 | public function oobeRequested(): bool; |
||
38 | } |
||
39 | |||
40 | Interface <1.3.6.1.4.1.37476.2.5.2.3.2> { |
||
41 | // called by plugin publicPages/000_objects (gui) |
||
42 | public function modifyContent($id, &$title, &$icon, &$text); |
||
43 | } |
||
44 | |||
45 | Interface <1.3.6.1.4.1.37476.2.5.2.3.3> { |
||
46 | // called by plugin publicPages/000_objects (ajax) |
||
47 | public function beforeObjectDelete($id); |
||
48 | public function afterObjectDelete($id); |
||
49 | public function beforeObjectUpdateSuperior($id, &$params); |
||
50 | public function afterObjectUpdateSuperior($id, &$params); |
||
51 | public function beforeObjectUpdateSelf($id, &$params); |
||
52 | public function afterObjectUpdateSelf($id, &$params); |
||
53 | public function beforeObjectInsert($id, &$params); |
||
54 | public function afterObjectInsert($id, &$params); |
||
55 | } |
||
56 | |||
57 | Interface <1.3.6.1.4.1.37476.2.5.2.3.4> { |
||
58 | // called by plugin publicPages/100_whois |
||
1130 | daniel-mar | 59 | public function whoisObjectAttributes(string $id, array &$out); |
60 | public function whoisRaAttributes(string $email, array &$out); |
||
387 | daniel-mar | 61 | } |
62 | |||
430 | daniel-mar | 63 | Interface <1.3.6.1.4.1.37476.2.5.2.3.5> { |
64 | // called by plugin publicPages/090_login |
||
65 | public function alternativeLoginMethods(); |
||
66 | } |
||
387 | daniel-mar | 67 | |
693 | daniel-mar | 68 | Interface <1.3.6.1.4.1.37476.2.5.2.3.6> { |
69 | // called by publicPages/000_objects |
||
695 | daniel-mar | 70 | public function gridGeneratorLinks($objParent); |
693 | daniel-mar | 71 | } |
951 | daniel-mar | 72 | |
73 | Interface <1.3.6.1.4.1.37476.2.5.2.3.7> { |
||
74 | // called by publicPages/000_objects |
||
75 | public function getAlternativesForQuery($id); |
||
76 | } |
||
1000 | daniel-mar | 77 | |
78 | Interface <1.3.6.1.4.1.37476.2.5.2.3.8> { |
||
79 | // called by raPages/010_notifications |
||
80 | // called by adminPages/010_notifications |
||
81 | public function getNotifications($user=null); // return array of array($severity, $htmlMessage) |
||
82 | } |