Table of contents
Creating modules
Veva is designed to be highly modular and to fulfill that design goal, it includes a powerful module loading system. Developers can easily extend the system by writing custom modules.
What is a module in Veva?
A module is basically a class which implements the IModule interface in Veva. A single Module in Veva can contain a variety of things, like custom components, custom themes and various other custom extensions which the core system supports.
A custom module is usually a separate VS project, with a Module.cs class which implements the IModule interface in Veva. Upon startup, Veva automatically locates and instantiates classes which implement this interface and calls various methods which are defined in the interface.
All modules are required to have public properties for name and priority which enables developers to control in what order the modules are loaded up, if required.
public string Name => "My Custom Module";
public int Priority => (int)ModulePriorityEnum.Default;
Required methods
ConfigureMvc() is where the module can access the IMvcBuilder if the module needs to do some MVC configuration changes.
Optional methods
These methods have default bodies in the IModule interface and as such do not need to be implemented specifically.
public void ConfigureComponents(IComponentService componentService, IComponentViewService componentViewService)
{
componentService.RegisterComponent
}
public void InitializeDatabase(IServiceProvider serviceProvider)
public bool DatabaseMigrationsNeeded(IServiceProvider serviceProvider)
{
return false;
}
public IEnumerable
{
return new List
}
public void ConfigureBuilder(IWebHostBuilder builder)