diff --git a/vuepress/docs/next/tutorials/create/ms/update-data-model.md b/vuepress/docs/next/tutorials/create/ms/update-data-model.md index 967aa525a6..c5e0f83633 100644 --- a/vuepress/docs/next/tutorials/create/ms/update-data-model.md +++ b/vuepress/docs/next/tutorials/create/ms/update-data-model.md @@ -3,16 +3,16 @@ sidebarDepth: 2 --- # Update the Project Data Model - -## Overview - -This tutorial explains how to use the [Entando Component Generator](../../../docs/create/component-gen-overview.md) powered by [JHipster](https://www.jhipster.tech/) to quickly update the data model for your Entando project. +This tutorial explains how to use the [Entando Component Generator](../../../docs/create/component-gen-overview.md) powered by [JHipster](https://www.jhipster.tech/) to quickly update the data model for your Entando Bundle project. ## Prerequisites -A [Blueprint-generated project](./generate-microservices-and-micro-frontends.md) + +- [A working instance of Entando](../../../docs/getting-started/) +- Verify dependencies with the [Entando CLI](../../../docs/getting-started/entando-cli.md#check-the-environment): `ent check-env develop` +- A [Blueprint-generated bundle project](./generate-microservices-and-micro-frontends.md) ## Tutorial -The steps below assume you're working out of the root directory of the microservice, e.g. /microservices/conference-ms. +Steps 1 through 4 must be performed from the directory of the specific microservice, e.g. YOUR-BUNDLE-PROJECT/microservices/conference-ms. 1. Use JHipster to extract the current application description. The resulting JHipster Domain Language (JDL) file contains your project's application configuration and entity definitions: ``` @@ -22,9 +22,9 @@ ent jhipster export-jdl export.jdl ``` entity Conference { name String -} + } ``` -3. Enhance this definition by adding fields, entities, table mappings, field validation, etc. This is easily accomplished with the [online JDL-Studio or corresponding JHipster IDE plugins/extensions](https://www.jhipster.tech/jdl/intro). For example: +3. Enhance this definition by adding fields, entities, table mappings, field validation, etc. This can be accomplished with the [online JDL-Studio or corresponding JHipster IDE plugins/extensions](https://www.jhipster.tech/jdl/intro). For example: ``` entity Conference { name String required @@ -45,7 +45,7 @@ relationship OneToMany { Conference to Session } ``` -This file content adds two fields to the Conference entity, introduces the Session entity plus an enum, and creates a mapping between the two entities. Below is the updated data model in JDL-Studio: +This content adds two fields to the Conference entity, creates the Session entity and an enumeration, and defines the relationship between the two entities. Below is the updated data model in JDL-Studio: ![conference.jdl](./img/jhipster-jdl.png) @@ -53,9 +53,29 @@ This file content adds two fields to the Conference entity, introduces the Sessi ``` ent jhipster import-jdl conference.jdl ``` -If the default project structure has been retained, this step will update your data model, add entries to Liquibase to upgrade database schema during deployment, add service methods to your microservice, add fields to your MFEs, etc. -5. You can now build your updated project and [run it locally](./run-local.md) or [deploy it to Entando](../pb/publish-project-bundle.md). Definition enhancement through build and test can be repeated as many times as needed. +If the default project structure has been retained, this step updates your data model, adds entries to Liquibase to upgrade the database schema during deployment, adds service methods to your microservice, adds fields to your MFEs, etc. + + - For pre-existing micro frontends, the component files need to be moved because they have been regenerated. From the bundle root directory: + + ```shell + mv microservices/conference-ms/ui/widgets/conference/tableWidget/{.,}* microfrontends/conference-table + ``` + + - For each new micro frontend, use the ent CLI to add it to the bundle descriptor, relocate the component files, and add an API claim to extablish the connection. From the bundle root directory: + 1. Add the new MFE and move it to the `microfrontends/YOUR-NEW-MFE` folder: + ``` + ent bundle mfe add YOUR-NEW-MFE + mv microservices/conference-ms/ui/widgets/conference/YOUR-NEW-MFE/{.,}* microfrontends/YOUR-NEW-MFE + ``` + + 2. Add an API claim to connect the new MFE to the pertinent microservice. If this is an extension of the Blueprint generated project, an API claim should connect the new MFE to the `conference-ms` microservice. + ``` + ent bundle api add YOUR-NEW-MFE conference-api --serviceName=conference-ms --serviceUrl=http://localhost:8081 + ``` + +See the [Generate Microservices and Micro Frontends](./generate-microservices-and-micro-frontends.md#configure-the-components) tutorial for step by step instructions to adjust the bundle. +5. You can now build your updated project and [run it locally](./run-local.md) or [deploy it to Entando](../pb/publish-project-bundle.md). Definition enhancement through build and test can be repeated as many times as needed. diff --git a/vuepress/docs/v7.3/tutorials/create/ms/update-data-model.md b/vuepress/docs/v7.3/tutorials/create/ms/update-data-model.md index 967aa525a6..c5e0f83633 100644 --- a/vuepress/docs/v7.3/tutorials/create/ms/update-data-model.md +++ b/vuepress/docs/v7.3/tutorials/create/ms/update-data-model.md @@ -3,16 +3,16 @@ sidebarDepth: 2 --- # Update the Project Data Model - -## Overview - -This tutorial explains how to use the [Entando Component Generator](../../../docs/create/component-gen-overview.md) powered by [JHipster](https://www.jhipster.tech/) to quickly update the data model for your Entando project. +This tutorial explains how to use the [Entando Component Generator](../../../docs/create/component-gen-overview.md) powered by [JHipster](https://www.jhipster.tech/) to quickly update the data model for your Entando Bundle project. ## Prerequisites -A [Blueprint-generated project](./generate-microservices-and-micro-frontends.md) + +- [A working instance of Entando](../../../docs/getting-started/) +- Verify dependencies with the [Entando CLI](../../../docs/getting-started/entando-cli.md#check-the-environment): `ent check-env develop` +- A [Blueprint-generated bundle project](./generate-microservices-and-micro-frontends.md) ## Tutorial -The steps below assume you're working out of the root directory of the microservice, e.g. /microservices/conference-ms. +Steps 1 through 4 must be performed from the directory of the specific microservice, e.g. YOUR-BUNDLE-PROJECT/microservices/conference-ms. 1. Use JHipster to extract the current application description. The resulting JHipster Domain Language (JDL) file contains your project's application configuration and entity definitions: ``` @@ -22,9 +22,9 @@ ent jhipster export-jdl export.jdl ``` entity Conference { name String -} + } ``` -3. Enhance this definition by adding fields, entities, table mappings, field validation, etc. This is easily accomplished with the [online JDL-Studio or corresponding JHipster IDE plugins/extensions](https://www.jhipster.tech/jdl/intro). For example: +3. Enhance this definition by adding fields, entities, table mappings, field validation, etc. This can be accomplished with the [online JDL-Studio or corresponding JHipster IDE plugins/extensions](https://www.jhipster.tech/jdl/intro). For example: ``` entity Conference { name String required @@ -45,7 +45,7 @@ relationship OneToMany { Conference to Session } ``` -This file content adds two fields to the Conference entity, introduces the Session entity plus an enum, and creates a mapping between the two entities. Below is the updated data model in JDL-Studio: +This content adds two fields to the Conference entity, creates the Session entity and an enumeration, and defines the relationship between the two entities. Below is the updated data model in JDL-Studio: ![conference.jdl](./img/jhipster-jdl.png) @@ -53,9 +53,29 @@ This file content adds two fields to the Conference entity, introduces the Sessi ``` ent jhipster import-jdl conference.jdl ``` -If the default project structure has been retained, this step will update your data model, add entries to Liquibase to upgrade database schema during deployment, add service methods to your microservice, add fields to your MFEs, etc. -5. You can now build your updated project and [run it locally](./run-local.md) or [deploy it to Entando](../pb/publish-project-bundle.md). Definition enhancement through build and test can be repeated as many times as needed. +If the default project structure has been retained, this step updates your data model, adds entries to Liquibase to upgrade the database schema during deployment, adds service methods to your microservice, adds fields to your MFEs, etc. + + - For pre-existing micro frontends, the component files need to be moved because they have been regenerated. From the bundle root directory: + + ```shell + mv microservices/conference-ms/ui/widgets/conference/tableWidget/{.,}* microfrontends/conference-table + ``` + + - For each new micro frontend, use the ent CLI to add it to the bundle descriptor, relocate the component files, and add an API claim to extablish the connection. From the bundle root directory: + 1. Add the new MFE and move it to the `microfrontends/YOUR-NEW-MFE` folder: + ``` + ent bundle mfe add YOUR-NEW-MFE + mv microservices/conference-ms/ui/widgets/conference/YOUR-NEW-MFE/{.,}* microfrontends/YOUR-NEW-MFE + ``` + + 2. Add an API claim to connect the new MFE to the pertinent microservice. If this is an extension of the Blueprint generated project, an API claim should connect the new MFE to the `conference-ms` microservice. + ``` + ent bundle api add YOUR-NEW-MFE conference-api --serviceName=conference-ms --serviceUrl=http://localhost:8081 + ``` + +See the [Generate Microservices and Micro Frontends](./generate-microservices-and-micro-frontends.md#configure-the-components) tutorial for step by step instructions to adjust the bundle. +5. You can now build your updated project and [run it locally](./run-local.md) or [deploy it to Entando](../pb/publish-project-bundle.md). Definition enhancement through build and test can be repeated as many times as needed.