Creating a new plugin
Basic structure and principals
Creating a new plugin is a fairly straight forward process: For the purpose of this example, let's call our new plugin for customers plugin, to handle a list of customers, with a simple object structure. All plugins consist of a base nuget, which is going to contain database structure and constants.
Create a repository for your plugin in lowercase and each word seperated by "-" eg.: eform-angular-basecustomer-plugin
Create a repository for the nuget base of your plugin eg.: eform-basecustomer-base
Base nuget project
The base which is going to be a nuget, needs to follow this pattern:
A console application project called DBMigrator, with reference to the Microting.eFormBaseCustomerBase project.
A class library called the name of your base, eg.: Microting.eFormBaseCustomerBase
.travis.yml for testing, modify this to fit your base
upgradeeformnugets.sh for upgrading Microting.eFormApi.BasePn and Microting.eForm
The Microting.eFormBaseCustomerBase project needs to have the following folder structure:
See the basecustomer project for reference.
Keynotes to have in mind, is that every entity needs to enherit from the BaseEntity and they need to have a Versioned equivalent of the class. Each Entity needs to implement the following methods:
public async Task Create(CustomersPnDbAnySql dbContext)
public async Task Update(CustomersPnDbAnySql dbContext)
public async Task Delete(CustomersPnDbAnySql dbContext)
private CustomerVersion MapVersions(CustomersPnDbAnySql dbContext, Customer customer) ^ replace CustomerVersion and Customer customer with the respective class names for your entity.
This is to ensure that all entities used in the ecosystem conforms to the same standard. See https://github.com/microting/eform-basecustomer-base/blob/master/Microting.eFormBaseCustomerBase/Infrastructure/Data/Entities/Customer.cs for reference.
Plugin project
The repository needs to have the following folder structure/files.
eform-client (for the angular part of the plugin)
e2e (for the End 2 end tests)
src
app
plugins
modules
customers-pn (for the actual TypeScript for the plugin)
eFormAPI (for the C# part of the project)
.travis.yml for testing
upgradeeformnugets.sh for upgrading Microting.eFormApi.BasePn, Microting.eForm and Microting.eFormBaseCustomerBase
testinginstallpn.sh for installing the route for the TypeScript part into main frontend project
devinstall.sh for installing the plugin into the main project
devgetchanges.sh for getting changes back to the repository, when changes have been done to the plugin in the main project.
See the customers project for reference.
Last updated
Was this helpful?