Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

202 fine grained #10

Closed
wants to merge 201 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
55f584d
[Upd] Migrate to Spring Boot 3.
ledsoft Oct 12, 2023
b063a03
[Upd] Migrate tests to JUnit 5, fix test issues.
ledsoft Oct 12, 2023
74edd2c
[Ref] Modify login processing URL to match the old configuration.
ledsoft Oct 12, 2023
89efce0
[Upd] Update Dockerfile to work with the new application.
ledsoft Oct 12, 2023
f80fd71
[Upd] Update GitHub actions, make them specific for this repository.
ledsoft Oct 12, 2023
032d1b0
[Doc] Update documentation and readme.
ledsoft Oct 12, 2023
c3e3d38
[Doc] Remove Apache Tomcat from requirements.
ledsoft Oct 12, 2023
5f2f94a
[Ref] Introduce annotation-based transactional processing.
ledsoft Oct 12, 2023
ad8f1d2
[Ref] Refactor tests to use the declarative transactions.
ledsoft Oct 13, 2023
0f4384c
[Fix] Fix OFN link in readme.
ledsoft Oct 13, 2023
c30e609
[Ref] Code cleanup, add some explanatory comments.
ledsoft Oct 13, 2023
a71fc12
[Fix] Fix issues discovered by testing against frontend.
ledsoft Oct 13, 2023
d94d6b0
[Fix] Implement change requested in PR review.
ledsoft Oct 18, 2023
86d8e2d
Merge pull request #2 from akaene/main
blcham Oct 18, 2023
c84e2b6
[Ref] Simplify security code, remove custom AuthenticationToken class…
ledsoft Oct 19, 2023
7e08785
Add support for OIDC authentication.
ledsoft Oct 19, 2023
48ad607
Improve roles extraction from OIDC access token.
ledsoft Oct 19, 2023
6122737
[Ref] Refactor SecurityUtilsTest.
ledsoft Oct 20, 2023
c0f2664
Implement retrieval of current user from OAuth access token.
ledsoft Oct 20, 2023
55c4a48
Disable user management API when OIDC security is used.
ledsoft Oct 20, 2023
0c0e20d
Ensure config.properties are loaded in time for configured correct se…
ledsoft Oct 26, 2023
2d6393b
[OIDC] Use preferred_username claim to load current user from reposit…
ledsoft Oct 26, 2023
a599d89
[OIDC] Add default Keycloak role claim to config.properties.
ledsoft Oct 26, 2023
9ad73ba
[Doc] Add documentation for setting up OIDC authentication.
ledsoft Oct 26, 2023
15f9a14
[Del] Delete unused OIDC-related constant.
ledsoft Oct 26, 2023
31919ea
[kbss-cvut/23ava-distribution#10] Modify Record to use an identifier …
ledsoft Nov 2, 2023
f82229d
Merge pull request #5 from akaene/main
blcham Nov 2, 2023
e095ba4
[kbss-cvut/23ava-distribution#10] Store records in contexts correspon…
ledsoft Nov 2, 2023
6538f26
[kbss-cvut/23ava-distribution#10] Ensure record id is generated in Fo…
ledsoft Nov 2, 2023
c0c86d9
[Ref] More useful exception logging.
ledsoft Nov 2, 2023
fd27017
Merge branch 'kbss-cvut:main' into main
ledsoft Nov 2, 2023
9b84bd6
Add GH action to push docker image
blcham Nov 3, 2023
218ea84
Merge pull request #7 from kbss-cvut/publish-docker-image
blcham Nov 3, 2023
2744e0c
Add basic docker-compose configuration using GraphDB.
ledsoft Nov 8, 2023
1bd4d58
[Del] Delete obsolete s-forms install script.
ledsoft Nov 8, 2023
6d32ac4
[OIDC] Modify role mapping from OIDC access token.
ledsoft Nov 13, 2023
4a4af81
[Docker] Provide working Docker Compose configuration.
ledsoft Nov 13, 2023
921d94a
Merge branch 'kbss-cvut:main' into main
ledsoft Nov 13, 2023
684d6e0
Fix GH actions in PRs from a fork
blcham Nov 19, 2023
8b2e132
Merge pull request #8 from kbss-cvut/fix-gh-action-in-pull-requests-f…
blcham Nov 19, 2023
a6dc9fe
[Upd] Make generic pattern how to retrieve form template
blcham Nov 19, 2023
e792022
[Fix] Fix synatax error in query
blcham Nov 19, 2023
4ac67d4
Update db-server/repo-config/config-record-manager.ttl
ledsoft Nov 19, 2023
63de4a7
Update db-server/repo-init.sh
ledsoft Nov 19, 2023
99e90e4
Update db-server/repo-config/config-record-manager-formgen.ttl
ledsoft Nov 19, 2023
bea609c
Update docker-compose.yml
ledsoft Nov 19, 2023
e4595f7
Update docker-compose.yml
ledsoft Nov 19, 2023
3e3fb65
Apply suggestions from code review
ledsoft Nov 19, 2023
18ba3f2
Merge pull request #6 from akaene/main
blcham Nov 19, 2023
144b60b
[Fix] Fix parsing of AllowedOrigins from appContext variable
blcham Nov 19, 2023
6dffc73
Merge pull request #9 from kbss-cvut/fix-parsing-origin-from-app-context
blcham Nov 19, 2023
2cc636c
[kbss-cvut/record-manager#10] Support configuring allowedOrigins via …
ledsoft Nov 21, 2023
26d6e60
[kbss-cvut/record-manager#10] Test allowedOrigins configuration retri…
ledsoft Nov 22, 2023
42ff464
Merge pull request #11 from akaene/main
blcham Nov 22, 2023
55af753
[kbss-cvut/23ava-distribution#18] Implement user impersonate using Sp…
ledsoft Nov 22, 2023
d538a6f
[kbss-cvut/23ava-distribution#18] Provide client with info that curre…
ledsoft Nov 22, 2023
817dd60
Merge branch 'kbss-cvut:main' into main
ledsoft Nov 23, 2023
5fd9a49
[New] Add logs related to configured Access-Control-Allow-Origin
blcham Nov 23, 2023
9e3437f
[Upd] Update defaults configuration values
blcham Nov 23, 2023
377d738
[Upd] Improve documentation of configuration values
blcham Nov 23, 2023
b1695f2
[Fix] Fix docker compose configuration issues after renaming the app …
ledsoft Nov 23, 2023
e370a5e
[kbss-cvut/23ava-distribution#18] Add getByUsername endpoint back to …
ledsoft Nov 23, 2023
8ad489d
[kbss-cvut/23ava-distribution#18] Enable features required for impers…
ledsoft Nov 23, 2023
1cd111c
[Fix] Fix reference to record-manager-app repository
blcham Nov 23, 2023
31f1ebf
[Fix] Bad name of repository configuration file
blcham Nov 23, 2023
a98a4f2
[#15] Fix CORS issue in keycloak authorization set up
blcham Nov 24, 2023
bb1f321
[New] Add automatic deployment of form templates
blcham Nov 25, 2023
e4c4746
Update docker-image.yml
blcham Nov 28, 2023
fccf3c1
Update docker-image.yml
kostobog Nov 28, 2023
f640512
Merge pull request #16 from kbss-cvut/issues-12
blcham Nov 28, 2023
a4b618a
Update docker-image.yml
kostobog Nov 28, 2023
bdf4653
Update docker-image.yml
kostobog Nov 28, 2023
0489dad
Update docker-image.yml
kostobog Nov 28, 2023
1241e29
Update docker-image.yml
kostobog Nov 28, 2023
f668cbc
Update docker-image.yml
kostobog Nov 28, 2023
e20e9a4
Update docker-image.yml
blcham Nov 28, 2023
44e71d0
Update docker-image.yml
blcham Nov 28, 2023
90b2a2e
[#13] Throw error when allowed origins are not configured
blcham Nov 22, 2023
57b4dac
[#13] Empty origins should not result in *
blcham Nov 28, 2023
931410c
Merge pull request #14 from kbss-cvut/fix-case-when-allowed-origins-a…
blcham Nov 28, 2023
eb19594
[Fix] Fix accidental change of frontend image in docker-compose.yml.
ledsoft Nov 29, 2023
65a7f7b
Merge branch 'kbss-cvut:main' into main
ledsoft Nov 29, 2023
48b8dde
[Fix] Fix upstream merge issues.
ledsoft Nov 29, 2023
aa48e0b
Merge pull request #26 from akaene/main
blcham Nov 29, 2023
001a075
[#27] Fix exception when saving record twice
blcham Dec 1, 2023
f141fbd
Merge remote-tracking branch 'origin/main'
blcham Dec 1, 2023
8840b5c
[kbss-cvut/record-manager-ui#23] Prevent accidental update of user ty…
ledsoft Dec 5, 2023
66bc367
Fix accidental commit
ledsoft Dec 5, 2023
bff6079
Merge pull request #28 from akaene/main
blcham Dec 6, 2023
4e7dddb
[#29] Extend record manager ontology with generic record states.
kostobog Dec 7, 2023
ff09c77
[#29] Add state object property to PatientRecord
kostobog Dec 7, 2023
2807546
[Upd] Remove constraint for User to be part of Institution
blcham Dec 7, 2023
e6cdb6f
[#29] Fix label of rm:has-state
kostobog Dec 8, 2023
af7a2d4
Merge branch 'main' into issues/29-add-record-state
kostobog Dec 8, 2023
54e17e9
[#29] Update resources rm:has-record-state and rm:record-state in ont…
kostobog Dec 8, 2023
874e26c
[#29] Refactor type of PatientRecord.state from URI to RecordState
kostobog Dec 8, 2023
002c328
[#29] Refactor field PatientRecord.state to PatientRecord.phase.
kostobog Dec 11, 2023
1da56ae
[#29] Add phase to PatientRecord.toString
kostobog Dec 11, 2023
164974d
[#29] Refactor state to phase in ontology and jopa model
kostobog Dec 12, 2023
4ae185f
[#29] Fix compilation error
kostobog Dec 12, 2023
64e82b6
[#29] Add phase field to PatientRecordDto
kostobog Dec 12, 2023
dd3eaf2
[kbss-cvut/record-manager-ui#37] Define record export API.
ledsoft Dec 13, 2023
c0f1a7e
Merge pull request #31 from kbss-cvut/issues/29-add-record-state
blcham Dec 13, 2023
3c137e8
[#29] Fix labels of record phase classes in model.ttl
kostobog Dec 13, 2023
815f536
[#29] Add rejected record phase
kostobog Dec 13, 2023
6b3511f
Merge pull request #36 from kbss-cvut/issues/29-add-record-state
blcham Dec 13, 2023
e16bea5
[#33] Add updateUserInstitution in OidcUserController
kostobog Dec 13, 2023
569a8a3
[#33] Refactor method name OidcUserController.updateUserInstitution …
kostobog Dec 13, 2023
29181f7
[#33] Fix implementation of updateUser
kostobog Dec 13, 2023
df0d346
Merge pull request #35 from kbss-cvut/issues/33-set-user-institution-…
blcham Dec 13, 2023
cc03288
[kbss-cvut/record-manager-ui#37] Test record exporting API.
ledsoft Dec 13, 2023
bd2957b
[kbss-cvut/record-manager-ui#37] Implement export of records (filtera…
ledsoft Dec 13, 2023
3a35d84
Merge pull request #1 from akaene/record-manager-ui#37-records-export
ledsoft Dec 13, 2023
a2e28b7
Merge remote-tracking branch 'upstream/main'
ledsoft Dec 13, 2023
001b6d0
[Fix] Fix NPE when adding new institution to user
blcham Dec 14, 2023
34dc285
[#29] Bind server.max-http-request-header-size to MAX_HTTP_REQUEST_SI…
kostobog Dec 14, 2023
e2ad552
[kbss-cvut/record-manager-ui#37] Extend record export with filtering …
ledsoft Dec 15, 2023
8a9c5e4
Remove unused import.
ledsoft Dec 15, 2023
e25b91f
Merge pull request #37 from akaene/main
blcham Dec 15, 2023
ff92ef3
Merge pull request #39 from kbss-cvut/issues/38-configure-max-http-re…
blcham Dec 15, 2023
0bb6e50
Revert "[#29] Bind server.max-http-request-header-size to MAX_HTTP_RE…
blcham Dec 15, 2023
9e041e7
[kbss-cvut/record-manager-ui#38] Add REST endpoint for importing reco…
ledsoft Dec 19, 2023
58e584e
[kbss-cvut/record-manager-ui#38] Implement record import.
ledsoft Dec 19, 2023
ee9872d
[kbss-cvut/record-manager-ui#38] Allow providing phase to set on all …
ledsoft Dec 19, 2023
dce1d6d
[kbss-cvut/record-manager-ui#38] Set imported record provenance accor…
ledsoft Dec 22, 2023
69da5c1
[kbss-cvut/record-manager-ui#38] Set imported record phase to open un…
ledsoft Dec 22, 2023
84ed465
Merge pull request #41 from akaene/main
blcham Dec 27, 2023
2f3a10d
[kbss-cvut/record-manager#40] Use JOPA 2.0.0-SNAPSHOT which removes d…
ledsoft Dec 26, 2023
280b171
Merge pull request #42 from akaene/main
blcham Dec 28, 2023
79b21c4
[Upd] Reformat
blcham Jan 3, 2024
8f5c574
[kbss-cvut/record-manager-ui#71] Reduce the size of PatientRecordDto …
ledsoft Jan 24, 2024
929aecd
[Upd] Update dependencies to work with the latest JOPA 2.0.0-SNAPSHOT…
ledsoft Jan 30, 2024
a5f22d1
[kbss-cvut/record-manager-ui#71] Implement filtering, paging and sort…
ledsoft Jan 31, 2024
7f23273
[kbss-cvut/record-manager-ui#71] Simplify PatientRecordService API, u…
ledsoft Jan 31, 2024
bac3a31
[kbss-cvut/record-manager-ui#71] Add support for paging and sorting t…
ledsoft Jan 31, 2024
5d62bac
[kbss-cvut/record-manager-ui#71] Return HATEOAS response headers when…
ledsoft Jan 31, 2024
db451c8
Merge pull request #2 from akaene/record-manager-ui#71-filtering-pagi…
ledsoft Jan 31, 2024
d08164a
Merge pull request #45 from akaene/main
blcham Feb 1, 2024
a8a1ed1
[kbss-cvut/record-manager-ui#71] Harmonize action history paging with…
ledsoft Feb 6, 2024
96976e8
Merge branch 'kbss-cvut:main' into main
ledsoft Feb 6, 2024
8e28528
[kbss-cvut/record-manager-ui#71] Ensure first and last rel links are …
ledsoft Feb 6, 2024
1a11a75
[kbss-cvut/record-manager-ui#71] Support providing record phase for f…
ledsoft Feb 8, 2024
f554753
Merge pull request #46 from akaene/main
blcham Feb 8, 2024
d164a28
Merge remote-tracking branch 'origin/main'
blcham Feb 9, 2024
b424fa2
Add total item count header to paged responses.
ledsoft Apr 23, 2024
4055307
Merge pull request #49 from akaene/main
blcham Apr 23, 2024
82aa012
[kbss-cvut/23ava-distribution#78] Change rm:user to foaf:Person
blcham May 2, 2024
76959a1
Merge pull request #50 from kbss-cvut/change-rm-user-to-foaf-person
blcham May 3, 2024
c1596aa
[Upd] Migrate registry from docker.pkg.github.com to ghcr.io
blcham May 6, 2024
ee62dbc
Fix documentation
blcham May 6, 2024
355669f
[Upd] Migrate to new address of docker images
blcham May 6, 2024
eb28191
[kbss-cvut/record-manager-ui#168] Add filtering of records according …
blcham Jun 5, 2024
1a1e84d
[Upd] Upgrade JOPA version from snapshot to release
blcham Jun 6, 2024
a2a8a3f
Merge pull request #51 from kbss-cvut/add-record-filtering-by-templates
blcham Jun 6, 2024
a33dde4
[Upd] Suppress warning of unchecked method invocation
blcham Jun 6, 2024
665b025
[Fix partially #36] Add dependency on POI
kostobog Jul 9, 2024
90f3c3c
[Fix partially #36] Add excel template for record export
kostobog Jul 9, 2024
2e3dd4e
[Fix partially #36] Add excel export implementation
kostobog Jul 9, 2024
e5a7048
[Fix partially #36] Extend rest api to support record export in Excel
kostobog Jul 9, 2024
397569d
[Fix partially kbss-cvut/record-manager-ui#36] Remove injected httpSe…
kostobog Jul 10, 2024
1918810
[Fix partially kbss-cvut/record-manager-ui#36] Consider Accept header…
kostobog Jul 10, 2024
0b985cd
[Fix partially kbss-cvut/record-manager-ui#36] Refactor handling of i…
kostobog Jul 10, 2024
d05e5dc
[Fix partially kbss-cvut/record-manager-ui#36] Implement paging reque…
kostobog Jul 10, 2024
077c007
[Fix partially kbss-cvut/record-manager-ui#36] Export modified date
kostobog Jul 10, 2024
483c586
[Fix partially kbss-cvut/record-manager-ui#36] Update record-export-t…
kostobog Jul 10, 2024
4ec18b7
Merge pull request #52 from kbss-cvut/feature/record-manager-ui-36-ex…
blcham Jul 10, 2024
5c35392
[Fix partially kbss-cvut/record-manager-ui#36] Make sure that default…
kostobog Jul 10, 2024
01d40a0
Merge pull request #53 from kbss-cvut/feature/record-manager-ui-36-ex…
blcham Jul 10, 2024
3d485c0
[Fix partially kbss-cvut/record-manager-ui#175] Disable SystemInitial…
kostobog Jul 10, 2024
548d3c1
Merge pull request #54 from kbss-cvut/fix/record-manager-ui-75-disabl…
blcham Jul 10, 2024
432926c
[Fix partially kbss-cvut/23ava-distribution#120] Optimize records export
kostobog Jul 11, 2024
49643ab
[Fix partially kbss-cvut/23ava-distribution#120] Fix failing tests by…
kostobog Jul 11, 2024
dcc2cab
Merge pull request #55 from kbss-cvut/fix/23ava-distribution-120-opti…
kostobog Jul 11, 2024
6761b69
[Fix partially kbss-cvut/record-manager-ui#182] Call onRecordUpdateSe…
kostobog Jul 11, 2024
f91a828
[Fix partially kbss-cvut/record-manager-ui#182] Fix failing test
kostobog Jul 11, 2024
aaca505
Merge pull request #57 from kbss-cvut/feature/record-manager-ui-182-r…
blcham Jul 11, 2024
c55de72
Fix empty excel export, fix fha matching fha question origin in sparq…
kostobog Jul 11, 2024
275851b
Fix missing last modified date in Excel export.
kostobog Jul 11, 2024
ea21b59
Merge pull request #58 from kbss-cvut/fix/fix-excel-export
blcham Jul 11, 2024
550152b
[Fix kbss-cvut/record-manager-ui#185] Fix wrong format of field numbe…
kostobog Jul 17, 2024
7e41992
[Fix kbss-cvut/record-manager-ui#185] Fix exported excel is empty in …
kostobog Jul 17, 2024
70fadd5
[Fix kbss-cvut/record-manager-ui#185] Avoid adding null numbers to ex…
kostobog Jul 17, 2024
9326c05
Merge pull request #59 from kbss-cvut/fix/record-manager-ui-185-fix-e…
blcham Jul 17, 2024
a320b5a
[kbss-cvut/record-manager-ui#184] Add excelImportServiceUrl param to …
palagdan Jul 17, 2024
538cb3a
[kbss-cvut/record-manager-ui#184] Add Excel type to importRecords
palagdan Jul 17, 2024
1d9341f
[kbss-cvut/record-manager-ui#184] Update importRecords endpoint for s…
palagdan Jul 19, 2024
4283ce6
[kbss-cvut/record-manager-ui#184] Changed handler for importing json …
palagdan Jul 20, 2024
8ccea37
[kbss-cvut/record-manager-ui#184] Updated tests for importRecords
palagdan Jul 20, 2024
6405787
[kbss-cvut/record-manager-ui#184] Fix test importRecordsJsonImportsSp…
blcham Jul 20, 2024
f8ddc10
[kbss-cvut/record-manager-ui#184] Fixed importRecordsJsonImportsSpeci…
palagdan Jul 20, 2024
6fff1db
[kbss-cvut/record-manager-ui#184] Implement detached import through T…
blcham Jul 21, 2024
86e9419
Merge pull request #60 from kbss-cvut/184-support-excel-import
blcham Jul 21, 2024
fbfae24
[kbss-cvut/record-manager-ui#186] Improve error message when user is …
palagdan Jul 22, 2024
29aac1c
Reformat
blcham Jul 22, 2024
c9e9b44
Merge pull request #62 from kbss-cvut/186-checkUserInstitutionHandler
blcham Jul 22, 2024
f119fd9
[Fix partially kbss-cvut/record-manager-ui#180] Add publish rest api …
kostobog Jul 11, 2024
133193b
Merge pull request #56 from kbss-cvut/feature/record-manager-ui-180-p…
blcham Jul 23, 2024
1a431e6
[Fix kbss-cvut/record-manager-ui#194] Fix excel export, filter out nu…
kostobog Jul 23, 2024
d467e96
Merge pull request #64 from kbss-cvut/fix/record-manager-ui-194-fix-e…
kostobog Jul 23, 2024
3111977
[#kbss-cvut/23ava-distribution/133] Fix modification author if not admin
blcham Jul 23, 2024
49748c2
[kbss-cvut/record-manager-ui#202] Implement roles
palagdan Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/workflows/build-docker.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
name: Build server docker
name: Publish Docker Image

on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]
workflow_dispatch:
env:
IMAGE_NAME: record-manager-server
MVN_PROFILE: production-docker
MAIN_BRANCH_NAME: master
# The last two fragments of the identifier of the docker image
IMAGE_NAME: ${{ github.repository }}
MAIN_BRANCH_NAME: main
REGISTRY: ghcr.io

jobs:

build-and-publish:

# Skip if PR is from a fork
if: github.event_name != 'pull_request' || github.event.repository.full_name == github.event.pull_request.head.repo.full_name
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build application archive
run: mvn clean package -B -P $MVN_PROFILE

- name: Build docker image
run: docker build . --file Dockerfile --tag $IMAGE_NAME

- name: Log in to the Container registry
run: echo "${{ github.token }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
run: echo "${{ github.token }}" | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=${{ env.REGISTRY }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Get branch name if merge to a branch
GIT_BRANCH_NAME=$(echo "${{ github.ref }}" | grep 'refs/heads/.*' | cut -d"/" -f 3)
# Get pull request id (e.g. "pr-123" from "/pulls/123")
PULL_REQUEST_ID=$(echo "${{ github.event.pull_request.number }}" | grep -v "^$" | sed 's/^/pr-/')
# Get tag id while strip "v" prefix (e.g. "1.2" from "v1.2")
# Get tag id while stripping "v" prefix (e.g. "1.2" from "v1.2")
TAG_ID=$(echo "${{ github.ref }}" | grep 'refs/tags/.*' | cut -d"/" -f 3 | sed -e 's/^v//')
# Version is either "git branch name"/"pull request id"/"tag id"
VERSION=${GIT_BRANCH_NAME:-${PULL_REQUEST_ID:-${TAG_ID}}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: CI
# events but only for the master branch
on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
branches: [ master ]
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -20,12 +20,12 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
# - name: Compile
# run: mvn compile
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

# Runs a set of commands using the runners shell
# - name: Test
# run: mvn test
- name: Test
run: mvn -B test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
target
node_modules
build
logs
**/generated-sources
**/npm-debug.log
.DS_store
Expand Down
19 changes: 15 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
FROM tomcat:9.0-jdk8-slim
FROM maven:3-eclipse-temurin-17 as build

EXPOSE 8080
WORKDIR /record-manager

COPY pom.xml pom.xml

RUN mvn -B de.qaware.maven:go-offline-maven-plugin:resolve-dependencies

COPY src src

COPY /target/record-manager-0.*.war /usr/local/tomcat/webapps/record-manager.war
RUN mvn package -B -DskipTests=true

FROM eclipse-temurin:17-jdk-alpine as runtime
COPY --from=build /record-manager/target/record-manager.jar record-manager.jar

EXPOSE 8080

CMD ["catalina.sh","run"]
ENTRYPOINT ["java","-jar","/record-manager.jar"]
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# OFN Record Manager

Manager of records based on OFN (https://opendata.gov.cz/otevřené-formální-normy:start).
Manager of records based on OFN (https://data.gov.cz/ofn/).

## Required Technologies

- JDK 8 (preferably Oracle)
- Apache Maven 3.5.x
- Apache Tomcat 9 or newer (required by Servlet API 4)
- JDK 17
- Apache Maven 3.5.x or later

## System Architecture

Expand Down
38 changes: 0 additions & 38 deletions bin/install-local-s-forms.sh

This file was deleted.

22 changes: 22 additions & 0 deletions db-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ontotext/graphdb:10.2.0

# Override parent entrypoint
ENTRYPOINT []

ENV GRAPHDB_HOME=/opt/graphdb/home
ENV GRAPHDB_INSTALL_DIR=/opt/graphdb/dist

WORKDIR ${GRAPHDB_HOME}

# Install libs related to RDF processing
RUN apk add py3-rdflib
RUN apk add perl-uri

# Copy initialization data and repository config
COPY init-data /root/graphdb-import
COPY init-config /repo-config
COPY bin/* ${GRAPHDB_INSTALL_DIR}/bin/

EXPOSE 7200

CMD ${GRAPHDB_INSTALL_DIR}/bin/repo-init.sh /repo-config ${GRAPHDB_HOME} & ${GRAPHDB_INSTALL_DIR}/bin/graphdb -Dgraphdb.home=${GRAPHDB_HOME} -Dgraphdb.logback=${GRAPHDB_INSTALL_DIR}/conf/logback.xml
75 changes: 75 additions & 0 deletions db-server/bin/get-rdf-subject-by-type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/usr/bin/python3

import sys
from rdflib import Graph, URIRef

def log(message):
print("ERROR: " + message, file=sys.stderr)

def check_params():
if len(sys.argv) != 3:
log(f"""Illegal number of parameters.

Script returns single subject of triple matching the pattern '?result a <type-uri>'
from the file specified by <rdf-file-path>.

Usage: {sys.argv[0]} <rdf-file-path> <type-uri>

Example: {sys.argv[0]} "./init-data/forms/example-1.ttl" "http://onto.fel.cvut.cz/ontologies/form/form-template"
""")
sys.exit(1)

def check_only_one_instance(results, rdf_type):
if len(results) == 0:
log(f"No instance found for the specified {rdf_type}.")
sys.exit(2)
elif len(results) > 1:
error_message = f"Multiple instances found for the type {rdf_type}. Triple that match pattern '?s a <{rdf_type}>' are:\n"
for row in results:
subject = row[0]
error_message += f" {subject.n3()} a <{rdf_type}> .\n"
log(error_message)
sys.exit(3)


def load_rdf_graph(file_path):
# Load RDF file into an RDFLib graph
g = Graph()

# Explicitly specify the format based on the file extension
if file_path.endswith(".ttl"):
g.parse(file_path, format="turtle")
elif file_path.endswith(".rdf"):
g.parse(file_path, format="xml")
else:
log(f"Unsupported RDF file format of {file_path}.")
sys.exit(1)

return g

def main():
check_params()

file_path = sys.argv[1]
rdf_type = URIRef(sys.argv[2])

g = load_rdf_graph(file_path)

# Query for subjects with the specified RDF type
query = f"""
SELECT ?subject
WHERE {{
?subject a <{rdf_type}>.
}}
"""

results = g.query(query)

check_only_one_instance(results, rdf_type)

for row in results:
subject = row[0]
print(subject.n3())

if __name__ == "__main__":
main()
73 changes: 73 additions & 0 deletions db-server/bin/get-value-of-rdf-property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/python3

import sys
from rdflib import Graph, URIRef

def log(message):
print("ERROR: " + message, file=sys.stderr)

def check_params():
if len(sys.argv) != 3:
log(f"""Illegal number of parameters.

Script returns single value of <rdf-property-uri> from file specified by <rdf-file-path>.

Usage: {sys.argv[0]} <rdf-file-path> <rdf-property-uri>

Example: {sys.argv[0]} "./init-config/repo-config.ttl" "http://www.openrdf.org/config/repository#repositoryID"
""")
sys.exit(1)


def check_property_has_single_value(results, rdf_property):
if len(results) == 0:
log(f"No values found for the specified property {rdf_property}.")
sys.exit(2)
elif len(results) > 1:
error_message = f"Multiple values found for the property {rdf_property}. Triple that match pattern '?s <{rdf_property}> ?o' are:\n"
for row in results:
subject, value = row
error_message += f" {subject} {rdf_property} {value} .\n"
log(error_message)
sys.exit(3)

def load_rdf_graph(file_path):
# Load RDF file into an RDFLib graph
g = Graph()

# Explicitly specify the format based on the file extension
if file_path.endswith(".ttl"):
g.parse(file_path, format="turtle")
elif file_path.endswith(".rdf"):
g.parse(file_path, format="xml")
else:
log(f"Unsupported RDF file format of {file_path}.")
sys.exit(1)
return g

def main():
check_params()

file_path = sys.argv[1]
rdf_property = URIRef(sys.argv[2])

g = load_rdf_graph(file_path)

# Query for subjects with the specified property
query = f"""
SELECT ?subject ?value
WHERE {{
?subject <{rdf_property}> ?value.
}}
"""
results = g.query(query)

check_property_has_single_value(results, rdf_property)

for row in results:
subject, value = row
print(f"{value}")

if __name__ == "__main__":
main()

Loading