1.6 Hooks and their relevant Tie Ins


  • Senior Developer

    Here’s a couple of quick and dirty txt files containing all the hook events, and their respective tie-ins for plugins or hooks for operationally using them.

    I’m posting this because the AccessControl plugins uses these very emphatically to help with granularly controlling access. This, ultimately, means a full documentation of all the things that can be done natively.

    One file is the “Core” events. These are the events that can be enacted upon and integrated directly with the “base” of FOG using no plugins. The other file is all the hooks that plugins also generate.

    My hope is to get the access control plugin more on a dynamic nature than a guessing game. In the past I had tried documenting all the hook events into the database, and while this approach can work, it only inserts new entries when the event is to be processed in the first place.

    What’s wrong with the above approach? Well, to limit constant read/write to the database, the hooks were only inserted into the database as they were spawned. So let’s just say, for example, you never visited the User page. Your hookEvent’s table would never contain any of the hooks that are available on the user page.

    In these files, particularly the core file, is some commonalities between all pages I think. This will be evident just by looking at these files. A couple of places, however, use a generic approach to generate the event. These are using a % symbol to symbolize Host, Group, User, etc…

    Some of these will also function for the Plugins too (just a note).

    Hopefully this will help prepare people with some of our changes for when 1.6 is able to be published.

    Hooks_And_Tie-ins.txt

    Hooks_And_Tie-ins - Plugins.txt



  • @Tom-Elliott ok thank you. We are starting with doing only some basic things, so I will just continue to get it up and running on 1.5.x.

    Right now, I am using the doxygen generated focdoc/ folder and mostly some examples in other plugins. Sometimes a bit tricky, but IMHO no need to generate the files for 1.5


  • Senior Developer

    @imt_fog the information in these files are specific to 1.6 as I’m not sure what was present for 1.5.x, of course I can get them but for the most part things are similar or as much as I could make them.

    I couldn’t tell you what those changes are and I believe, for the most part, the majority are the same. There’s of course bound to be a few changes and I don’t think it would be too difficult to update your plugin for 1.6 when it is published. Of course I’ll be available to help out if needed as well.

    There actually is a new plugin being worked on right now that I fully integrated into 1.6 and is being worked separately for 1.5.x, so I think most things will be simple enough to see the differences.



  • @Tom-Elliott
    Hi Tom, I am just starting to develop an internal plugin for some data we need to handle for our client computers and want to assign to hosts and groups, so that this data can be accesed both via FOG management and FOG API so that we have this info to be used in our snapins.

    I did not go very deeply into the sources of FOG yet and just started by checking the example plugin and some other plugins to get a feeling how to do things, (coming from the Laravel world…).

    As I am not familiar with all the hook-event thing yet: does your post mean there are any significant changes in the plugin system coming in 1.6 - at least changes which would break a plugin developed using 1.5.x?


Log in to reply
 

304
Online

5.8k
Users

13.1k
Topics

123.3k
Posts