Skip to content

Commit f6cbd7e

Browse files
authored
feat(dipa): init (#209)
* feat(dipa): init * feat(dipa): init * chore(dipa): spotless format * chore(dipa): fix pmd warnings * conf(dispatch:local): add dipa test config * docs: add dipa to README * chore(dipa): add logging * fix(dipa): add missing jaxws dependency * conf(dipa:local): add example config * ci: add dipa * docs(dipa): update README * conf(dipa): exclude cxf generated from PMD * chore(dipa): use handler-core v0.4.0 * docs(dipa): add java doc * docs(dipa): add java doc * docs(dipa): add local conf placeholders * fix(dipa): UseCase fix validation and defaults * refact(dipa): extend context * refact(dipa): extract ContentObject extension from filename * chore(dipa): add error log * chore(dipa): fix java doc typos * refact(dipa): rename coo-source to target-source * refact(dipa): use null as default for incoming subject * refact(dipa): use null as default for incoming subject
1 parent 4f47486 commit f6cbd7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3122
-0
lines changed

.github/labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
"Component: Invoice":
2525
- changed-files:
2626
- any-glob-to-any-file: [ 'invoice-service/**' ]
27+
"Component: DiPa":
28+
- changed-files:
29+
- any-glob-to-any-file: [ 'dipa-service/**' ]
2730
"Component: Handler-Core":
2831
- changed-files:
2932
- any-glob-to-any-file: [ 'handler-core/**' ]

.github/workflows/maven-node-build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
build-image: true
2626
- app-path: invoice-service
2727
build-image: true
28+
- app-path: dipa-service
29+
build-image: true
2830
steps:
2931
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3032
- if: ${{ hashFiles(format('./{0}/package.json', matrix.app-path)) != null }}

.github/workflows/release.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- handler-core
1414
- dms-service
1515
- invoice-service
16+
- dipa-service
1617
release-version:
1718
description: 'Release version'
1819
type: string
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="SwimDipaServiceApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
3+
<option name="ACTIVE_PROFILES" value="local" />
4+
<module name="dipa-service" />
5+
<option name="SPRING_BOOT_MAIN_CLASS" value="de.muenchen.oss.swim.dipa.SwimDipaServiceApplication" />
6+
<extension name="net.ashald.envfile">
7+
<option name="IS_ENABLED" value="false" />
8+
<option name="IS_SUBST" value="false" />
9+
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
10+
<option name="IS_IGNORE_MISSING_FILES" value="false" />
11+
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
12+
<ENTRIES>
13+
<ENTRY IS_ENABLED="true" PARSER="runconfig" IS_EXECUTABLE="false" />
14+
</ENTRIES>
15+
</extension>
16+
<method v="2">
17+
<option name="Make" enabled="true" />
18+
</method>
19+
</configuration>
20+
</component>

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Following a list and short description of the different components:
1616
- [dispatch-service](./dispatch-service): Service for notifying other services (i.e. DMS) that a file is ready for further processing via Kafka.
1717
- [handler-core](./handler-core): Library with base components for building a new service for handling notifications from the `dispatch-service`.
1818
- [dms-service](./dms-service): Service for transferring files into DMS when notified by the `dispatch-service` via Kafka. Based on `handler-core`.
19+
- [dipa-service](./dipa-service): Service for transferring files into DiPa when notified by the `dispatch-service` via Kafka. Based on `handler-core`.
1920
- [scripts](./scripts): Helper scripts for maintenance tasks.
2021

2122
## Contributing

dipa-service/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# For documentation see https://jboss-container-images.github.io/openjdk/
2+
FROM registry.access.redhat.com/ubi9/openjdk-21-runtime
3+
4+
# Copy runnable jar to deployments
5+
COPY target/dipa-service-*.jar /deployments/application.jar

dipa-service/README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# SWIM DiPa-Service
2+
3+
SWIM service for transferring files into the "DiPa" (short for German "digitale Personalakte", digital personnel file) when notified by [dispatch-service](../dispatch-service) via Apache Kafka.
4+
Based on [handler-core](../handler-core).
5+
6+
## Architecture
7+
8+
```mermaid
9+
flowchart LR
10+
Kafka --> DiPa-Service
11+
DiPa-Service --> DiPa-SOAP-API
12+
DiPa-Service --> Kafka
13+
```
14+
15+
### Error handling
16+
17+
Errors which occur during processing a file are transmitted via Kafka to the [dispatch-service](../dispatch-service) which handles them accordingly.
18+
19+
## Development
20+
21+
- The dipa-service is built with JDK21
22+
- For local development and testing the dev docker-compose stack of the [dispatch-service](../dispatch-service) can be used.
23+
- Can be started with `docker compose up -d`
24+
- The Spring profile `local` is preconfigured for using the stack
25+
- Activate it either manually or by using the provided run configuration
26+
- Additionally, the dipa credentials need to be configured in the [`application-local.yml`](./src/main/resources/application-local.yml). See [Configuration](#configuration) for reference.
27+
- After starting the application, file processing can be triggered via Kafka in one of the following ways:
28+
- via [dispatch-service](../dispatch-service)
29+
- via [Kafka-UI](http://localhost:8089/)
30+
31+
## Configuration
32+
33+
```yaml
34+
swim:
35+
# dipa connection configuration
36+
dipa:
37+
endpoint-url:
38+
username:
39+
password:
40+
# use cases
41+
use-cases:
42+
- name: # required
43+
type: # required, see section "Type"
44+
target-source:
45+
type: # required, see section "Target source"
46+
static-pers-nr: # for target-source static
47+
static-category: # for target-source static
48+
filename-pers-nr-pattern: # for target-source filename
49+
filename-category-pattern: # for target-source filename
50+
incoming:
51+
incoming-subject-pattern: # define Incoming subject via Regex pattern, default: null
52+
content_object:
53+
filename-overwrite-pattern: # overwrite ContentObject name via Regex pattern, default: filename
54+
context:
55+
username: # user under which the DiPa action is executed
56+
```
57+
58+
### Pattern
59+
60+
The `*-pattern`-fields require a specific syntax (inspired by the sed command and regex substitution).
61+
62+
See [Pattern](../handler-core/README.md#pattern).
63+
64+
### Type
65+
66+
The `type` attribute of a use case defines what type of resource is created in the DiPa.
67+
68+
- `hr_subfile_incoming`: Creates an Incoming inside a given HrSubfile.
69+
70+
### Target source
71+
72+
The `target-source.type` attribute of a use case defines how the target resource, under which the new resource is created, is resolved.
73+
74+
- `static`: The target PersNr and Category are defined statically via the `static-*` use case attributes.
75+
- `filename`: The target PersNr and Category are resolved via the Regex patterns under `filename-*-pattern`.

0 commit comments

Comments
 (0)