Skip to content

Commit 8b50966

Browse files
author
Doug Wilson
committed
Update README
* Add SDS documentation * Fix a few small Docker and environment (loc vs min) errors
1 parent 5c3bde6 commit 8b50966

File tree

2 files changed

+66
-28
lines changed

2 files changed

+66
-28
lines changed

README.md

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,21 @@
3131
## TL;DR
3232
**Today, AAF Data is**:
3333
- A standalone set of
34-
- Generalized **business entity models**,
35-
- **Database creation scripts** for roles, schemas, tables, functions, and
36-
- **Scripted lookup/reference data**,
34+
- Generalized **business entity models**, e.g. Person, Organization, OrganizationalUnit, Employee, etc,
35+
- **Database creation scripts** for roles, schemas, tables, constraints, indexes, functions, and
36+
- **Scripted lookup/reference data**, e.g. EntityType (Person, Organization, OrganizationalUnit, Employee, etc), EntitySubtype (Organization - C Corp, S Corp, LLC, etc, OrganizationalUnit - Region, Division, Department, etc), etc,
3737
- A Dockerized, **REST**ful **business entity microservice** (BEM) providing
3838
- **C**reate,
3939
- **R**ead,
4040
- **U**pdate, and
4141
- **D**elete (**CRUD**) operations,
42-
- A Dockerized, **REST**ful **system data service** (SDS) providing
43-
- Create **N**ew,
44-
- **C**lone Existing,
45-
- **P**ublish, and
46-
- **U**pdate entity, attribute, and association process operations,
42+
- A Dockerized, **REST**ful **system data service** (SDS) providing the capability to
43+
- Create **N**ew business entity definition,
44+
- **C**lone Existing business entity definition,
45+
- Create New business entity **A**ttribute,
46+
- **A**ssociate business entity attribute with business entity definition(s),
47+
- **P**ublish entities, attributes, and associations, thereby creating corresponding new database schemas, tables, constraints, indexes, etc, and
48+
- **U**pdate the published status of entities, attributes, and associations,
4749
- And **SwaggerDoc** **OpenAPI** application programming interface (API) **documentation**.
4850

4951

@@ -57,25 +59,29 @@
5759

5860
**Features**
5961
- Containerized. Services run in Docker containers, available from DockerHub.
62+
<!-- -->
6063
- The business entity microservice (**BEM**):
61-
- **Validates each HTTP request** using a JSON Web Token (**JWT**) mechanism with optional cryptographic signing and encryption capabilities,
64+
- **Will validate each HTTP request** (near future) using a JSON Web Token (**JWT**) mechanism with optional cryptographic signing and encryption capabilities,
6265
- **Persists and retrieves business entity data** via its **API**, which calls low-level `POST`, `GET`, `PATCH`, and “soft” DELETE database functions to ensure data integrity and performance -- **NO direct table access**,
6366
- **Consistently follows RESTful style and best practices**,
64-
- **Returns standard and appropriate HTTP response codes**, e.g. `200 OK`, `201 Created`, `400 Bad Request`, `401 Unauthorized`, `404 Not Found`, `500 Internal Server Error`, etc
67+
- **Returns standard and appropriate HTTP response codes**, e.g. `200 OK`, `201 Created`, `400 Bad Request`, `401 Unauthorized`, `404 Not Found`, `422 Unprocessable Entity`, `500 Internal Server Error`, etc
6568
- **Accepts and returns structured JSON resource/entity data** in HTTP request/response bodies as specified for each business entity, and
6669
<!-- - **Includes** `entities` **in the request URL**, e.g. `/entities/organization/1234`, to partition low-level resource/entity operations from future high-level process invocation, e.g. `/processes/InformationSystem/RegisterInformationSystemUser/` -->
6770
- The system data service (**SDS**):
68-
- **Validates each HTTP request** using a JSON Web Token (**JWT**) mechanism with optional cryptographic signing and encryption capabilities,
69-
- **Enables authorized entity Modelers and Publishers** to define new EntityTypeDefinitions, EntityTypeAttribtues, and EntityTypeDefinitionEntityTypeAttributeAssociations via its **API**, which calls high-level process `POST` and low-level `POST`, `PATCH`, and “soft” DELETE database functions to add (or "publish") these new entities, attributes, and associations to the database, resulting in new model-driven data structures, e.g. SCHEMAs, TABLEs, COLUMNs, CONSTRAINTs, INDEXs, etc -- **NO direct table access**,
71+
- **Will validate each HTTP request** (near future) using a JSON Web Token (**JWT**) mechanism with optional cryptographic signing and encryption capabilities,
72+
- **Enables authorized entity Modelers and Publishers** to define new EntityTypeDefinitions, EntityTypeAttribtues, and EntityTypeDefinitionEntityTypeAttributeAssociations via its **API**, which calls high-level process `POST` and low-level entity `POST`, `PATCH`, and “soft” DELETE database functions to add (or "publish") these new entities, attributes, and associations to the database, resulting in new model-driven data structures, e.g. SCHEMAs, TABLEs, COLUMNs, CONSTRAINTs, INDEXs, etc,
7073
- **Consistently follows RESTful style and best practices**,
71-
- **Returns standard and appropriate HTTP response codes**, e.g. `200 OK`, `201 Created`, `400 Bad Request`, `401 Unauthorized`, `404 Not Found`, `500 Internal Server Error`, etc
74+
- **Returns standard and appropriate HTTP response codes**, e.g. `200 OK`, `201 Created`, `400 Bad Request`, `401 Unauthenticated`, `404 Not Found`, `422 Unprocessable Entity`, 500 Internal Server Error`, etc
7275
- **Accepts and returns structured JSON resource/entity data** in HTTP request/response bodies as specified for each business entity, and
7376
<!-- - **Includes** `processes` **in the request URL**, e.g. `/processes/organization/1234`, to partition low-level resource/entity operations from future high-level process invocation, e.g. `/processes/InformationSystem/RegisterInformationSystemUser/` -->
7477

7578

7679
**Rules**
7780
- **The custom database roles**, e.g. AafCoreOwner, AafCoreDataReadWrite, etc, **are to be used appropriately** (as designed and demonstrated in this project) **to improve data security**.
7881
- **The current set of business entities and their descriptions can be retrieved** using the `GetEntityTypeDefinitions` database function and includes:
82+
- *`EntityTypeDefinition`
83+
- *`EntityTypeAttribute`
84+
- *`EntityTypeDefinitionEntityTypeAttributeAssociation`
7985
- `EntityType`
8086
- `EntitySubtype`
8187
- `Language`
@@ -88,6 +94,7 @@
8894
- `Person`
8995
- `Employee`
9096
- `LegalEntity`
97+
- **The set of "origin" (*) business entities can produce other business entities and their corresponding database structures**
9198
- **The current set of business entity attributes and their descriptions can be retrieved** using the `GetEntityTypeAttributes` database function and includes:
9299
- *`Id` `bigint`
93100
- *`Uuid` `uuid`
@@ -154,14 +161,14 @@ Before running the EntityDataMicroservice, you must:
154161
1. `./007-CreateDatabaseFunctionsAsAafCoreModeler.sh PostgreSQL 14 localhost 5432 AafCoreModeler AafCore M0d3l3rCl13nt!`
155162
1. `./008-CreateDatabaseDataAsAafCoreModeler.sh PostgreSQL 14 localhost 5432 AafCoreModeler AafCore M0d3l3rCl13nt!`
156163

157-
Please **note** that **this first AAF Data release is primarily for demonstration and evaluation purposes**. It supports very simple local (LOC) and minimal (MIN) environments and **is not intended to be used in a production environment**. **Later releases** will support shared development (DEV), staging (STG), and production (PRD) environments and **will utilize secrets management and other security best practices**. Crawl, walk, run.
164+
Please **note** that **this second AAF Data release is primarily for demonstration and evaluation purposes**. It supports very simple local (LOC) and minimal (MIN) remote/cloud environments and **is not intended to be used in a production environment**. **Later releases** will support shared, remote/cloud development (DEV), staging (STG), and production (PRD) environments and **will utilize secrets management and other security best practices**. Crawl, walk, run.
158165

159166
2. **Run the EntityDataMicroservice**:
160167
1. **Locally** in IDE:
161168
1. **Open** the `aafdata` project in **IntelliJ IDEA**.
162169
1. **Run** the `EntityDataMicroservice` class.
163170
1. **Locally** from the command line:
164-
1. Set the profile environment variable with `export spring_profiles_active=min` (NOTE: Remove it with `unset spring_profiles_active`)
171+
1. Set the profile environment variable with `export spring_profiles_active=loc` (NOTE: Remove it with `unset spring_profiles_active`)
165172
1. **Change directory** (`cd`) to `aafdata/EntityDataMicroservice/`.
166173
1. **Build** the project:
167174
```sh
@@ -174,15 +181,44 @@ Please **note** that **this first AAF Data release is primarily for demonstratio
174181
1. **In Docker**:
175182
1. Set the profile environment variable with `export spring_profiles_active=min` (NOTE: Remove it with `unset spring_profiles_active`)
176183
1. **Build** a Docker image with `docker build -t deceptivelysimpletechnologies/aafdata-entitydatamicroservice:$(date +%Y%m%d_%H%M%S) .`
184+
1. -OR-
177185
1. **Pull** the Docker image from DockerHub:
178186
```sh
179-
docker pull deceptivelysimpletechnologies/aafdata-entitydatamicroservice:latest
187+
docker pull deceptivelysimpletechnologies/aafdata-entitydatamicroservice:20241106_143503
180188
```
181189
1. **Run** the Docker container:
182190
```sh
183-
docker run -d --name aafdata-min -e spring_profiles_active=min -p 8080:8080 -t deceptivelysimpletechnologies/aafdata-entitydatamicroservice:latest
191+
docker run -d --name aafdata-edm-min -e spring_profiles_active=min -p 8080:8080 -t deceptivelysimpletechnologies/aafdata-entitydatamicroservice:latest
184192
```
185193

194+
3. **Run the SystemDataService**:
195+
1. **Locally** in IDE:
196+
1. **Open** the `aafdata` project in **IntelliJ IDEA**.
197+
1. **Run** the `SystemDataService` class.
198+
1. **Locally** from the command line:
199+
1. Set the profile environment variable with `export spring_profiles_active=loc` (NOTE: Remove it with `unset spring_profiles_active`)
200+
1. **Change directory** (`cd`) to `aafdata/SystemDataService/`.
201+
1. **Build** the project:
202+
```sh
203+
mvn clean package
204+
```
205+
1. **Run** the project:
206+
```sh
207+
java -jar target/SystemDataService-0.0.1-SNAPSHOT.jar
208+
```
209+
1. **In Docker**:
210+
1. Set the profile environment variable with `export spring_profiles_active=min` (NOTE: Remove it with `unset spring_profiles_active`)
211+
1. **Build** a Docker image with `docker build -t deceptivelysimpletechnologies/aafdata-systemdataservice:$(date +%Y%m%d_%H%M%S) .`
212+
1. -OR-
213+
1. **Pull** the Docker image from DockerHub:
214+
```sh
215+
docker pull deceptivelysimpletechnologies/aafdata-systemdataservice:20250130_154029
216+
```
217+
1. **Run** the Docker container:
218+
```sh
219+
docker run -d --name aafdata-sds-min -e spring_profiles_active=min -p 8081:8081 -t deceptivelysimpletechnologies/aafdata-systemdataservice:latest
220+
```
221+
186222

187223

188224
<p align="right">(<a href="#top">back to top</a>)</p>
@@ -192,7 +228,7 @@ Please **note** that **this first AAF Data release is primarily for demonstratio
192228
<!-- USAGE EXAMPLES -->
193229
## Usage
194230

195-
A complete set of Postman requests is included with the source code at `aafdata/client/DST AAF Data.postman_collection.json`.
231+
A complete set of Postman requests for both EDM and SDS services is included with the source code at `aafdata/client/DST AAF Data.postman_collection.json`.
196232

197233
<p align="right">(<a href="#top">back to top</a>)</p>
198234

@@ -231,7 +267,7 @@ A complete set of Postman requests is included with the source code at `aafdata/
231267
<a href="#how-are-the-aaf-models-represented-in-the-data-layer">How Are the AAF Models Represented in the Data Layer?</a>
232268
<ul>
233269
<li><a href="#business-entity-microservice">Business Entity Microservice</a></li>
234-
<li><a href="#data-structure-service">Data Structure Service</a></li>
270+
<li><a href="#system-data-service">Data Structure Service</a></li>
235271
</ul>
236272
</li>
237273
</ul>
@@ -313,10 +349,12 @@ Today, AAF Data is:
313349
- **U**pdate, and
314350
- **D**elete (**CRUD**) operations,
315351
- A Dockerized, **REST**ful **system data service** (SDS) providing
316-
- Create **N**ew,
317-
- **C**lone Existing,
318-
- **P**ublish, and
319-
- **U**pdate entity, attribute, and association process operations,
352+
- Create **N**ew business entity definition,
353+
- **C**lone Existing business entity definition,
354+
- Create New business entity **A**ttribute,
355+
- **A**ssociate business entity attribute with business entity definition(s),
356+
- **P**ublish entities, attributes, and associations, thereby creating corresponding new database schemas, tables, constraints, indexes, etc, and
357+
- **U**pdate the published status of entities, attributes, and associations,
320358
- And **SwaggerDoc** **OpenAPI** application programming interface (API) **documentation**.
321359
322360
@@ -333,11 +371,11 @@ EntityType structure and data
333371
EntitySubtype structure and data
334372
335373
336-
#### Data Structure Service
374+
#### System Data Service
337375
338376
TODO: Define LegalEntity, Environment, EnvironmentOwner, Domain, DomainOwner, Entity, EntityOwner, Database, DatabaseOwner, DatabaseSchemaOwner, DatabaseSchemaDataReadOnly, DatabaseSchemaDataReadWrite, DatabaseSchemaDataDelete
339377
340-
Structure service logic:
378+
System data service logic:
341379
- Does the given LegalEntity's local copy of the AAF Core database exist as its AAF Company database as expected in the given environment?
342380
- Create the given LegalEntity's AAF Company database with its own UUID-based name in the given environment.
343381
- Is the given LegalEntity's AAF Company database valid in the given environment?
@@ -369,7 +407,7 @@ Model-based web user interface (UI) components
369407
* Initial Release of EDM and basic business entities
370408
* See [commit change](https://github.com/DeceptivelySimpleTechnologies/aafdata/graphs/commit-activity) or See [release history]()
371409
* 1.0
372-
* Initial Release of SDS
410+
* Initial Release of SDS and related EDM changes
373411
* Various bug fixes and optimizations
374412
* See [commit change](https://github.com/DeceptivelySimpleTechnologies/aafdata/graphs/commit-activity) or See [release history]()
375413

SystemDataService/src/main/java/com/dsimpletech/aafdata/SystemDataService/controller/BusinessEntityController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,8 @@ public ResponseEntity<String> PublishBusinessEntitys(@PathVariable("databaseName
12941294
//TODO: * AAF-90 Check response body for success
12951295

12961296
logger.info("New table " + unpublishedEntityTypeDefinitions.get(i).getLocalizedName() + " created in " + databaseName);
1297+
1298+
//TODO: *** Insert new entity into EntityType table
12971299
}
12981300

12991301
logger.info(unpublishedEntityTypeAssociations.size() + " EntityTypeDefinitionEntityTypeAttributeAssociations published in " + databaseName);
@@ -1445,8 +1447,6 @@ private ResponseEntity<String> UpdatePublishedEntity(@PathVariable("entityTypeNa
14451447
//NOTE: 20 (Cloned Priv) and 21 (CreatedNew Role) Entity Definitions have default (-1) Ordinals.
14461448
//TODO: 5 (Name) ... 6 (Descr) and 7 (Abbrv) Attribs have 100, 200, and 300 Ordinals (should all be 300 Name).
14471449
//NOTE: 20 (Priv) and 21 (Role) Associations have default (-1) Ordinals, and Assoc Ordinals should match Attrib "bands".
1448-
//NOTE: Add CorrelationUuid (jti claim in JWT) to update???
1449-
//NOTE: Make sure CorrelationUuid (jti claim in JWT) is the same for new EntityDefinition and Associations in Clone and CreateNew
14501450
updateActionRequestBody = "{\n" +
14511451
" \"PublishedAtDateTimeUtc\": \"" + asOfDateTimeUtc + "\",\n" +
14521452
" \"PublishedByInformationSystemUserId\": " + userId + ",\n" +

0 commit comments

Comments
 (0)