Skip to content

Commit

Permalink
moved adaptation setup guide README to cws-adaptation/README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
voxparcxls committed Jan 31, 2024
1 parent 7834d70 commit 05a5faa
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 53 deletions.
54 changes: 1 addition & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,60 +180,8 @@ Start `test.sh` script by running:

This will produce jacoco reports with code coverage measurements.

## Adaptation Setup Guide
##[Adaptation Setup Guide](cws-adaptation/README.md)

CWS can be adapted and tailored for a mission. This can be done by modifying certain resources and source code of CWS-CORE.

Create new functionalities by adding:

* External Database Config
* Custom Java code
* Custom Rest Service API
* Custom Initiators
* etc...

### Adaptation Database

Adaptation Database feature lets you connect to a external database separate from that of the main `cws_dev` database.

**(1)** You must first include the following SQL Template files to the `install/sql/` directory:
* `install/sql/adaptation.sql.template` **(Core Database: `cws_dev`)**
* `install/sql/adaptation_core.sql.template` **(Core Database: `cws_dev`)**
* `install/sql/adaptation_external.sql.template` **(Adaptation Database: `cws_external_db`)**

**(2)** Create your schema/tables within the added Adaptation SQL Template files.
* Example (`adaptation_external.sql.template`):
```
CREATE TABLE IF NOT EXISTS `cws_external_table` (
...
...
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
```

**(3)** Write Custom Java Code.

By referencing your adaptation tables, you can connect and communicate with your external database.

Write Java custom code that extends from DbService and use the `jdbcTemplate` or `jdbcAdaptationTemplate` JDBC source to query the core and external databases.
```
jdbcAdaptationTemplate (adaptation external database)
jdbcTemplate (core database)
```

### Adaptation Workers Modal

Custom your Deployment page Workers view with add-ons and filters.

The UI for the Worker listview is customizable with through the javascript `addAdaptationWorkersInfo` function.

File: `cws-ui/src/main/webapp/js/adaptation-workers-modal.js`

Write your custom code here:
```
function addAdaptationWorkersInfo(dataProcKey, listWorkers) {
return;
}
```
# Contributing

Please see our [contribution guidelines](https://github.com/NASA-AMMOS/common-workflow-service/blob/main/CONTRIBUTING.md).
Expand Down
54 changes: 54 additions & 0 deletions cws-adaptation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Adaptation Setup Guide

CWS can be adapted and tailored for a mission. This can be done by modifying certain resources and source code of CWS-CORE.

Create new functionalities by adding:

* External Database Config
* Custom Java code
* Custom Rest Service API
* Custom Initiators
* etc...

### Adaptation Database

Adaptation Database feature lets you connect to a external database separate from that of the main `cws_dev` database.

**(1)** You must first include the following SQL Template files to the `install/sql/` directory:
* `install/sql/adaptation.sql.template` **(Core Database: `cws_dev`)**
* `install/sql/adaptation_core.sql.template` **(Core Database: `cws_dev`)**
* `install/sql/adaptation_external.sql.template` **(Adaptation Database: `cws_external_db`)**

**(2)** Create your schema/tables within the added Adaptation SQL Template files.
* Example (`adaptation_external.sql.template`):
```
CREATE TABLE IF NOT EXISTS `cws_external_table` (
...
...
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
```

**(3)** Write Custom Java Code.

By referencing your adaptation tables, you can connect and communicate with your external database.

Write Java custom code that extends from DbService and use the `jdbcTemplate` or `jdbcAdaptationTemplate` JDBC source to query the core and external databases.
```
jdbcAdaptationTemplate (adaptation external database)
jdbcTemplate (core database)
```

### Adaptation Workers Modal

Custom your Deployment page Workers view with add-ons and filters.

The UI for the Worker listview is customizable with through the javascript `addAdaptationWorkersInfo` function.

File: `cws-ui/src/main/webapp/js/adaptation-workers-modal.js`

Write your custom code here:
```
function addAdaptationWorkersInfo(dataProcKey, listWorkers) {
return;
}
```

0 comments on commit 05a5faa

Please sign in to comment.