Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this post we are going to explain how to create a new element managed by the Platform. As a demostration we are going to create the concept of Model.

Add new entities to ConfigDB

There is a module within the Platform where all the JPA Entities and JPA Repositories are created, its name is onesaitplatform-config-model:

...

We have to execute the SystemConfigInitApplication.java as Java Application. If everything goes OK we can open the MySQL Query Browser and see our table created:

Add a new menu option

We are going to create a new menu option for this funcionality. The menu configuration is defined in a JSON file in the onesaitplatforn-config-init module. 

...

Finally, we have to execute the SystemConfigInitApplication.java as Java Application again.

Add the funcionality to the ControlPanel

Once the entities have been created, the next step is to add the funcionality to the ControlPanel. The ControlPanel is the module onesaitplatform-controlpanel, this module is in charge of managing the Model View Controller (MVC):

...

Info

We are using the annotation @RequestMapping of Spring Web, this annotation maps HTTP requests to handler methods of MVC and REST controllers. We also use the annotation @Slf4j for log.


The method we are going to create is for listing all the models that the user has. The controller will need another class for doing all the business logic, for this, we will use the module onesaitplatform-config-service where we have to create the package com.minsait.onesait.platform.config.services.model and inside of it we are going to create an interface and its implementations where we'll define all the functions necessary to implement our new funcionality:

...