Jump to content

Extending The Universal Module Or Create Plugin


Adam

Recommended Posts

Howdy,

Is it possible to extend an existing module?

For example, I would like to extend the universal_module and add a few features to it for server management. For compatibility reasons and general separation of concerns, this would make sense, however I am not sure if this is feasible.

I am currently developing a few extra features like IP address management (PTR/RDNS), password / public key generation, bandwidth graphs, monitoring and general IPMI interface. My assumption is that this should go under a module and _not_ a plugin. Is this correct?

The reason for creating a plugin is that these items are very specific to a service and product and not necessarily to all products and services. I did read http://docs.blesta.com/display/dev/Creating+a+Plugin and it seems like a plugin would also work for these requirements. However looking at both plugins and modules, it seems that modules tend to have the characteristics I am building, hence my assumption.

thanks,

/adam

Link to comment
Share on other sites

is better to clone the module and change it , because if you change the core module every upgrade you need to revert you changes and maybe you can't use the universal module for other use .

 

Does have other downsides though.

All the modules being totally independent are a pain if you want to translate Blesta to another language.

 

You end up with each module having e.g. 100 translatable strings, will only 10 are really specific to that module.

Would rather see inheritance being used more.

And it would also be nice if it was possible to assign more than one module to a service (e.g. one main module that handles the actual server provisioning, and a completely different one to offer monitoring through Observium)

Link to comment
Share on other sites

And it would also be nice if it was possible to assign more than one module to a service (e.g. one main module that handles the actual server provisioning, and a completely different one to offer monitoring through Observium)

This request is a semilar to a old request i have made , it was simple as attach a module to another module to allow service be managed by two module, each one for a specific tab . my exemple at that time was

cpanel for hosting, and add softwacolous for install apps .

registrar module for domains, and add DNS management for other module .

if blesta can make this is really a dream .

Link to comment
Share on other sites

And it would also be nice if it was possible to assign more than one module to a service (e.g. one main module that handles the actual server provisioning, and a completely different one to offer monitoring through Observium)

That would be awesome. It would make for more features and shorter development cycles. For example, SolusVM has IP management and rebooting of VMs (among other features). If someone wants to do the same for lets say VPS.net module (already written) or new module xyz for a cloud provider, why should they reinvent?

If we can assign more then module per product, things like adding Observium (or another monitoring platforms) would be easier and fit a wider audience.

Unless, of course, plugins are the answer? Would be interesting to know what the Blesta Developers have to say where the "line in the sand" is drawn between module and plugin.

/adam

Link to comment
Share on other sites

Use a module for service management, and a plugin for just about anything else. While a plugin could potentially be created to handle service management, it wouldn't be able to provide the same level of service management as a module in Blesta, unless you completely recreated the entire system's service management through your plugin. For example, Blesta wouldn't tell the plugin that it's adding a service until it has already been added, so any validation/requirements the plugin may impose would be ineffective.

 

If you're just wanting to add a general module that provides server management, a new module sounds like the way to go.

Link to comment
Share on other sites

Use a module for service management, and a plugin for just about anything else. While a plugin could potentially be created to handle service management, it wouldn't be able to provide the same level of service management as a module in Blesta, unless you completely recreated the entire system's service management through your plugin. For example, Blesta wouldn't tell the plugin that it's adding a service until it has already been added, so any validation/requirements the plugin may impose would be ineffective.

 

If you're just wanting to add a general module that provides server management, a new module sounds like the way to go.

your answer is just for the OP question . what about the other questions , use two module to manage 1 service ?

Link to comment
Share on other sites

  • 2 weeks later...

Using 2+ modules on a single service adds an additional layer of complexity to the module system for services and invoices which poses several design and backward compatibility issues. It's something we will need to discuss internally more before we would have anything more specific to share about it.

Link to comment
Share on other sites

Tyson , First module is the master . used to provisioning to the service .

Second is a slave. Used just to achieve some task from tabs not more .

Nothing related to addons .

If you search the first threads from the first beta stage . you can find aa discussion about attaching modules to a specific tab in other module . that is the real behavior should be done .

Link to comment
Share on other sites

Using 2+ modules on a single service adds an additional layer of complexity to the module system for services and invoices which poses several design and backward compatibility issues. It's something we will need to discuss internally more before we would have anything more specific to share about it.

Yes and, inheritance! I think having the inheritance model would allow for this. For example, if we want to create a new module, we can inherit from the universal plugin and simply override or and add new features. At some level, this is already built in from the base class Modules. This adds a great level of separation and adds features!

Tyson , First module is the master . used to provisioning to the service .

Second is a slave. Used just to achieve some task from tabs not more .

Nothing related to addons .

If you search the first threads from the first beta stage . you can find aa discussion about attaching modules to a specific tab in other module . that is the real behavior should be done .

Yup, keyword is inheritance.

/adam

Link to comment
Share on other sites

Attaching additional modules to tabs sounds like a nice addition, but I can see limitations in it. We can't assume a secondary module only needs to have its own tab where it can make calls from the tab (or something of that nature). The next step after that is a need for multiple tabs for a single secondary module, then service field manipulation, and so on. Ideally, we'd like it to be as open as possible, but like I said, it's something we need to discuss more.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...