Compare commits
137 Commits
master
...
event_mana
|
@ -2,6 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for org.gcube.spatial.data.gcube-sdi-suite
|
# Changelog for org.gcube.spatial.data.gcube-sdi-suite
|
||||||
|
|
||||||
|
## [v1.0.6-SNAPSHOT]
|
||||||
|
- Integrated an EventManager centrally [#26321]
|
||||||
|
- sdi-plugins: add the logic to apply a regex to the value that must be added to index [#26322]
|
||||||
|
- notifications-plugins: integrated [#26453]
|
||||||
|
|
||||||
## [v1.0.5]
|
## [v1.0.5]
|
||||||
- Added maven profiles `geoportal-release-profile` and `geoportal-snapshot-profile` [#25570]
|
- Added maven profiles `geoportal-release-profile` and `geoportal-snapshot-profile` [#25570]
|
||||||
- Moved to maven-parent.v1.2.0 [#25570]
|
- Moved to maven-parent.v1.2.0 [#25570]
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 67 KiB |
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
|
@ -94,7 +94,7 @@
|
||||||
"_description": "Embedded profile for concessioni [mibac] management",
|
"_description": "Embedded profile for concessioni [mibac] management",
|
||||||
"_creationInfo": {
|
"_creationInfo": {
|
||||||
"_user": {
|
"_user": {
|
||||||
"_username": "fabio.sinibaldi"
|
"_username": "francesco.mangiacrapa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"_dataAccessPolicies": [
|
"_dataAccessPolicies": [
|
||||||
|
@ -212,21 +212,11 @@
|
||||||
"path": "$._theDocument.descrizioneContenuto",
|
"path": "$._theDocument.descrizioneContenuto",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "autore",
|
|
||||||
"path": "$._theDocument.authors",
|
|
||||||
"type": "TEXT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "contributore",
|
"name": "contributore",
|
||||||
"path": "$._theDocument.contributore",
|
"path": "$._theDocument.contributore",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "titolare",
|
|
||||||
"path": "$._theDocument.titolari",
|
|
||||||
"type": "TEXT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "responsabile",
|
"name": "responsabile",
|
||||||
"path": "$._theDocument.responsabile",
|
"path": "$._theDocument.responsabile",
|
||||||
|
@ -237,6 +227,16 @@
|
||||||
"path": "$._theDocument.editore",
|
"path": "$._theDocument.editore",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ufficio_mic_competente",
|
||||||
|
"path": "$._theDocument.ufficioMic",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "funzionario_responsabile",
|
||||||
|
"path": "$._theDocument.funzionarioResponsabile",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "finanziamento",
|
"name": "finanziamento",
|
||||||
"path": "$._theDocument.fontiFinanziamento",
|
"path": "$._theDocument.fontiFinanziamento",
|
||||||
|
@ -272,11 +272,6 @@
|
||||||
"path": "$._info._access._license",
|
"path": "$._info._access._license",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "titolare_licenza",
|
|
||||||
"path": "$._theDocument.titolareLicenza",
|
|
||||||
"type": "TEXT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "accesso",
|
"name": "accesso",
|
||||||
"path": "$._info._access._license",
|
"path": "$._info._access._license",
|
||||||
|
@ -286,6 +281,56 @@
|
||||||
"name": "parole_chiave",
|
"name": "parole_chiave",
|
||||||
"path": "$._theDocument.paroleChiaveLibere",
|
"path": "$._theDocument.paroleChiaveLibere",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "modalita_individuazione",
|
||||||
|
"path": "$._theDocument.modalitaIndividuazione",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "contesto_indagine",
|
||||||
|
"path": "$._theDocument.contestoIndagine",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "denominazione",
|
||||||
|
"path": "$._theDocument.denominazione",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stato_attuale",
|
||||||
|
"path": "$._theDocument.statoAttuale",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "accessibilita",
|
||||||
|
"path": "$._theDocument.accessibilita",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cronologia_macrofase",
|
||||||
|
"path": "$._theDocument.cronologiaMacrofase",
|
||||||
|
"type": "TEXT",
|
||||||
|
"apply_regex": {
|
||||||
|
"type": "replaceAll",
|
||||||
|
"regex": "(\\s)?\\([\\s\\S]*",
|
||||||
|
"replacement": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "specifiche_cronologia",
|
||||||
|
"path": "$._theDocument.specificheCronologia",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quota_max",
|
||||||
|
"path": "$._theDocument.quotaMax",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quota_min",
|
||||||
|
"path": "$._theDocument.quotaMin",
|
||||||
|
"type": "TEXT"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"jslt": {},
|
"jslt": {},
|
||||||
|
@ -299,6 +344,101 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"_id": "Notifications-Plugin",
|
||||||
|
"_type": "EventListener",
|
||||||
|
"_configuration": {
|
||||||
|
"subscribeNotifications": [
|
||||||
|
{
|
||||||
|
"event": "LIFECYCLE_STEP_PERFORMED",
|
||||||
|
"notificationFor": [
|
||||||
|
{
|
||||||
|
"roles": [
|
||||||
|
"Data-Manager"
|
||||||
|
],
|
||||||
|
"when": [
|
||||||
|
{
|
||||||
|
"target_phase": [
|
||||||
|
"Pending Approval"
|
||||||
|
],
|
||||||
|
"last_invoked_step": "SUBMIT-FOR-REVIEW",
|
||||||
|
"notify": [
|
||||||
|
{
|
||||||
|
"type": "USER_NOTIFICATION",
|
||||||
|
"send": true,
|
||||||
|
"placeholder_title": "TITLE_REVIEW_REQUIRED",
|
||||||
|
"placeholder_msg": "MSG_REVIEW_REQUIRED"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"target_phase": [
|
||||||
|
"DRAFT"
|
||||||
|
],
|
||||||
|
"last_invoked_step": "REJECT-DRAFT",
|
||||||
|
"notify": [
|
||||||
|
{
|
||||||
|
"type": "USER_NOTIFICATION",
|
||||||
|
"send": true,
|
||||||
|
"placeholder_title": "TITLE_ITEM_REJECTED",
|
||||||
|
"placeholder_msg": "MSG_ITEM_REJECTED"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"roles": [
|
||||||
|
"Item_Creator"
|
||||||
|
],
|
||||||
|
"when": [
|
||||||
|
{
|
||||||
|
"target_phase": [
|
||||||
|
"DRAFT"
|
||||||
|
],
|
||||||
|
"last_invoked_step": "REJECT-DRAFT",
|
||||||
|
"notify": [
|
||||||
|
{
|
||||||
|
"type": "USER_NOTIFICATION",
|
||||||
|
"send": true,
|
||||||
|
"placeholder_title": "TITLE_ITEM_REJECTED_REVIEW_REQUIRED",
|
||||||
|
"placeholder_msg": "MSG_ITEM_REJECTED_REVIEW_REQUIRED"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"roles": [
|
||||||
|
"Any"
|
||||||
|
],
|
||||||
|
"when": [
|
||||||
|
{
|
||||||
|
"target_phase": [
|
||||||
|
"Published"
|
||||||
|
],
|
||||||
|
"last_invoked_step": "APPROVE-SUBMITTED",
|
||||||
|
"notify": [
|
||||||
|
{
|
||||||
|
"type": "VRE_POST",
|
||||||
|
"send": true,
|
||||||
|
"placeholder_msg": "MSG_ITEM_PUBLISHED",
|
||||||
|
"export_as_pdf": {
|
||||||
|
"export": false,
|
||||||
|
"placeholder_msg": "MSG_GO_TO_PDF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enabled": true,
|
||||||
|
"link_to_notifications_messages": "https://code-repo.d4science.org/gCubeSystem/gcube-cms-suite/raw/branch/event_manager/D4S_UCDs/DEV/devVRE/notifications/Notifications_Messages_ita.properties"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"_id": "org.gcube.portlets.user.geoportal-data-entry-app",
|
"_id": "org.gcube.portlets.user.geoportal-data-entry-app",
|
||||||
"_type": "DATA_ENTRY_GUI",
|
"_type": "DATA_ENTRY_GUI",
|
||||||
|
@ -399,17 +539,16 @@
|
||||||
"_configuration": {
|
"_configuration": {
|
||||||
"itemFields": [
|
"itemFields": [
|
||||||
{
|
{
|
||||||
"label": "Descriptive Fields",
|
"label": "Any Field",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.nome",
|
"_theDocument.nome",
|
||||||
"_theDocument.introduzione",
|
"_theDocument.introduzione",
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
|
||||||
"_theDocument.dataInizioProgetto",
|
|
||||||
"_theDocument.editore",
|
"_theDocument.editore",
|
||||||
"_theDocument.responsabile",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
|
"_theDocument.contestoIndagine",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -437,16 +576,6 @@
|
||||||
"sortable": false,
|
"sortable": false,
|
||||||
"asResult": true
|
"asResult": true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"label": "Author/s",
|
|
||||||
"paths": [
|
|
||||||
"_theDocument.authors"
|
|
||||||
],
|
|
||||||
"operator": "$and",
|
|
||||||
"searchable": false,
|
|
||||||
"sortable": true,
|
|
||||||
"asResult": true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"label": "Project Start (yyyy-mm-dd)",
|
"label": "Project Start (yyyy-mm-dd)",
|
||||||
"paths": [
|
"paths": [
|
||||||
|
@ -460,11 +589,9 @@
|
||||||
{
|
{
|
||||||
"label": "Director/Staff",
|
"label": "Director/Staff",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.editore",
|
"_theDocument.editore"
|
||||||
"_theDocument.responsabile"
|
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
"searchable": true,
|
"searchable": true,
|
||||||
|
@ -475,6 +602,7 @@
|
||||||
"label": "Keywords",
|
"label": "Keywords",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -535,12 +663,12 @@
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.nome",
|
"_theDocument.nome",
|
||||||
"_theDocument.introduzione",
|
"_theDocument.introduzione",
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
|
||||||
"_theDocument.editore",
|
"_theDocument.editore",
|
||||||
"_theDocument.responsabile",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
|
"_theDocument.contestoIndagine",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -591,11 +719,9 @@
|
||||||
{
|
{
|
||||||
"label": "Director/Staff",
|
"label": "Director/Staff",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.editore",
|
"_theDocument.editore"
|
||||||
"_theDocument.responsabile"
|
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
"searchable": true,
|
"searchable": true,
|
||||||
|
@ -606,6 +732,7 @@
|
||||||
"label": "Keywords",
|
"label": "Keywords",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
"Member"
|
"Member"
|
||||||
],
|
],
|
||||||
"_enforcer": {
|
"_enforcer": {
|
||||||
"_filter": "{\"_lifecycleInformation._phase\" : {\"$eq\" : \"PUBLISHED\"}}"
|
"_filter": "{\"_lifecycleInformation._phase\" : {\"$eq\" : \"Published\"}}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -106,12 +106,6 @@
|
||||||
"Data-Manager",
|
"Data-Manager",
|
||||||
"Data-Editor"
|
"Data-Editor"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"STEP": "UNPUBLISH",
|
|
||||||
"roles": [
|
|
||||||
"Data-Manager"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -123,7 +117,7 @@
|
||||||
"registeredFileSetPaths": [
|
"registeredFileSetPaths": [
|
||||||
{
|
{
|
||||||
"schemaField": "datiAltimetrici",
|
"schemaField": "datiAltimetrici",
|
||||||
"documentPath": "datiAltimetrici[*].fileset"
|
"documentPath": "datiAltimetrici.fileset"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"schemaField": "planimetria",
|
"schemaField": "planimetria",
|
||||||
|
@ -500,59 +494,15 @@
|
||||||
"display_on_phase": []
|
"display_on_phase": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "submit_for_review",
|
"id": "publish",
|
||||||
"title": "Submit for Review",
|
"title": "Publish the Project",
|
||||||
"call_STEPS": [
|
"call_STEPS": [
|
||||||
"SUBMIT-FOR-REVIEW"
|
"PUBLISH"
|
||||||
],
|
],
|
||||||
"description": "Submit the Project (for review)",
|
"description": "Publish the Project",
|
||||||
"display_on_phase": [
|
"display_on_phase": [
|
||||||
"DRAFT"
|
"DRAFT"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "reject",
|
|
||||||
"title": "Reject",
|
|
||||||
"call_STEPS": [
|
|
||||||
"REJECT-DRAFT"
|
|
||||||
],
|
|
||||||
"description": "Reject the Project",
|
|
||||||
"display_on_phase": [
|
|
||||||
"Pending Approval"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "approve",
|
|
||||||
"title": "Approve",
|
|
||||||
"call_STEPS": [
|
|
||||||
"APPROVE-SUBMITTED"
|
|
||||||
],
|
|
||||||
"description": "Approve the Project",
|
|
||||||
"display_on_phase": [
|
|
||||||
"Pending Approval"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "unpublish",
|
|
||||||
"title": "UnPublish",
|
|
||||||
"call_STEPS": [
|
|
||||||
"UNPUBLISH"
|
|
||||||
],
|
|
||||||
"description": "UnPublish the Project",
|
|
||||||
"display_on_phase": [
|
|
||||||
"Published"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "unpublish",
|
|
||||||
"title": "UnPublish",
|
|
||||||
"call_STEPS": [
|
|
||||||
"UNPUBLISH"
|
|
||||||
],
|
|
||||||
"description": "UnPublish the Project",
|
|
||||||
"display_on_phase": [
|
|
||||||
"PUBLISHED"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,333 @@
|
||||||
|
{
|
||||||
|
"_id": "test_basemodel",
|
||||||
|
"_version": "1.0.0",
|
||||||
|
"_name": "Test_BaseModel",
|
||||||
|
"_schema": {
|
||||||
|
"planimetria": {
|
||||||
|
"_children": [
|
||||||
|
{
|
||||||
|
"fileset": {
|
||||||
|
"_type": "RegisteredFileSet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"_description": "UCD for BaseModel Test",
|
||||||
|
"_creationInfo": {
|
||||||
|
"_user": {
|
||||||
|
"_username": "francesco.mangiacrapa"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"_dataAccessPolicies": [
|
||||||
|
{
|
||||||
|
"_policy": {
|
||||||
|
"_read": "any",
|
||||||
|
"_write": "any"
|
||||||
|
},
|
||||||
|
"_roles": [
|
||||||
|
"Data-Manager"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_policy": {
|
||||||
|
"_read": "own",
|
||||||
|
"_write": "own"
|
||||||
|
},
|
||||||
|
"_roles": [
|
||||||
|
"Data-Editor"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_policy": {
|
||||||
|
"_read": "any",
|
||||||
|
"_write": "none"
|
||||||
|
},
|
||||||
|
"_roles": [
|
||||||
|
"Member"
|
||||||
|
],
|
||||||
|
"_enforcer": {
|
||||||
|
"_filter": "{\"_lifecycleInformation._phase\" : {\"$eq\" : \"Published\"}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_policy": {
|
||||||
|
"_read": "none",
|
||||||
|
"_write": "none"
|
||||||
|
},
|
||||||
|
"_roles": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_handlers": [
|
||||||
|
{
|
||||||
|
"_id": "DEFAULT-SINGLE-STEP",
|
||||||
|
"_type": "LifecycleManagement",
|
||||||
|
"_configuration": {
|
||||||
|
"step_access": [
|
||||||
|
{
|
||||||
|
"STEP": "PUBLISH",
|
||||||
|
"roles": [
|
||||||
|
"Data-Manager",
|
||||||
|
"Data-Editor"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "SDI-Default-Materializer",
|
||||||
|
"_type": "Materializer",
|
||||||
|
"_configuration": {
|
||||||
|
"registeredFileSetPaths": [
|
||||||
|
{
|
||||||
|
"schemaField": "planimetria",
|
||||||
|
"documentPath": "planimetria.fileset"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "SDI-Indexer-Plugin",
|
||||||
|
"_type": "Indexer",
|
||||||
|
"_configuration": {
|
||||||
|
"bboxEvaluation": [
|
||||||
|
"$..planimetria.._bbox"
|
||||||
|
],
|
||||||
|
"explicitFieldMapping": [
|
||||||
|
{
|
||||||
|
"name": "titolo",
|
||||||
|
"path": "$._theDocument.titolo",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "denominazione",
|
||||||
|
"path": "$._theDocument.denominazione",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "descrizione",
|
||||||
|
"path": "$._theDocument.descrizione",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cronologia",
|
||||||
|
"path": "$._theDocument.cronologia",
|
||||||
|
"type": "TEXT"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"jslt": {
|
||||||
|
},
|
||||||
|
"additionalLayers": [
|
||||||
|
{
|
||||||
|
"source": {
|
||||||
|
"url": "..."
|
||||||
|
},
|
||||||
|
"toSetTitle": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "org.gcube.portlets.user.geoportal-data-entry-app",
|
||||||
|
"_type": "DATA_ENTRY_GUI",
|
||||||
|
"_configuration": {
|
||||||
|
"gcubeProfiles": [
|
||||||
|
{
|
||||||
|
"gcubeSecondaryType": "GeoportalMetadata",
|
||||||
|
"gcubeName": "Test_Dati_Descrittivi",
|
||||||
|
"sectionName": "$.",
|
||||||
|
"sectionTitle": "Dati Descrittivi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gcubeSecondaryType": "GeoportalMetadata",
|
||||||
|
"gcubeName": "Test_Planimetria",
|
||||||
|
"sectionName": "planimetria",
|
||||||
|
"sectionTitle": "Planimetria",
|
||||||
|
"parentName": "$.",
|
||||||
|
"filePaths": [
|
||||||
|
{
|
||||||
|
"gcubeProfileFieldName": "File",
|
||||||
|
"fieldDefinition": "$.planimetria._children[?(@.fileset)]",
|
||||||
|
"fieldName": "fileset"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"saveStep": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "org.gcube.portlets.user.geoportal-data-list",
|
||||||
|
"_type": "DATA_LIST_GUI",
|
||||||
|
"_configuration": {
|
||||||
|
"itemFields": [
|
||||||
|
{
|
||||||
|
"label": "Any Field",
|
||||||
|
"paths": [
|
||||||
|
"_theDocument.titolo",
|
||||||
|
"_theDocument.denominazione",
|
||||||
|
"_theDocument.descrizione",
|
||||||
|
"_theDocument.cronologia"
|
||||||
|
],
|
||||||
|
"operator": "$or",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": false,
|
||||||
|
"asResult": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Titolo",
|
||||||
|
"paths": [
|
||||||
|
"_theDocument.titolo"
|
||||||
|
],
|
||||||
|
"operator": "$and",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": true,
|
||||||
|
"asResult": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Denominazione/Descrizione",
|
||||||
|
"paths": [
|
||||||
|
"_theDocument.denominazione",
|
||||||
|
"_theDocument.descrizione"
|
||||||
|
],
|
||||||
|
"operator": "$or",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": false,
|
||||||
|
"asResult": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Chronology",
|
||||||
|
"paths": [
|
||||||
|
"_theDocument.cronologia"
|
||||||
|
],
|
||||||
|
"operator": "$and",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": true,
|
||||||
|
"asResult": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Creator",
|
||||||
|
"paths": [
|
||||||
|
"_info._creationInfo._user._username"
|
||||||
|
],
|
||||||
|
"operator": "$or",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": false,
|
||||||
|
"asResult": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Updated",
|
||||||
|
"paths": [
|
||||||
|
"_info._lastEditInfo._instant"
|
||||||
|
],
|
||||||
|
"operator": "$or",
|
||||||
|
"searchable": false,
|
||||||
|
"sortable": true,
|
||||||
|
"asResult": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Phase",
|
||||||
|
"paths": [
|
||||||
|
"_lifecycleInformation._phase"
|
||||||
|
],
|
||||||
|
"operator": "$or",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": true,
|
||||||
|
"asResult": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Status",
|
||||||
|
"paths": [
|
||||||
|
"_lifecycleInformation._lastOperationStatus"
|
||||||
|
],
|
||||||
|
"operator": "$or",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": true,
|
||||||
|
"asResult": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "org.gcube.portlets.user.geoportal-basic-data-list",
|
||||||
|
"_type": "BASIC_DATA_LIST_GUI",
|
||||||
|
"_configuration": {
|
||||||
|
"itemFields": [
|
||||||
|
{
|
||||||
|
"label": "Any Field",
|
||||||
|
"paths": [
|
||||||
|
"_theDocument.titolo",
|
||||||
|
"_theDocument.denominazione",
|
||||||
|
"_theDocument.descrizione",
|
||||||
|
"_theDocument.cronologia"
|
||||||
|
],
|
||||||
|
"operator": "$or",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": false,
|
||||||
|
"asResult": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Title",
|
||||||
|
"paths": [
|
||||||
|
"_theDocument.titolo"
|
||||||
|
],
|
||||||
|
"operator": "$and",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": true,
|
||||||
|
"asResult": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Name",
|
||||||
|
"paths": [
|
||||||
|
"_theDocument.denominazione"
|
||||||
|
],
|
||||||
|
"operator": "$and",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": true,
|
||||||
|
"asResult": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Chronology",
|
||||||
|
"paths": [
|
||||||
|
"_theDocument.cronologia"
|
||||||
|
],
|
||||||
|
"operator": "$or",
|
||||||
|
"searchable": true,
|
||||||
|
"sortable": false,
|
||||||
|
"asResult": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "org.gcube.portlets.user.geoportal-workflow-action-list",
|
||||||
|
"_type": "WORKFLOW_ACTION_LIST_GUI",
|
||||||
|
"_configuration": {
|
||||||
|
"actionsDefinition": [
|
||||||
|
{
|
||||||
|
"id": "post_creation_action",
|
||||||
|
"title": "Post Creation Action",
|
||||||
|
"call_STEPS": [
|
||||||
|
"PUBLISH"
|
||||||
|
],
|
||||||
|
"description": "Action fired after the Project creation",
|
||||||
|
"display_on_phase": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "publish",
|
||||||
|
"title": "Publish the Project",
|
||||||
|
"call_STEPS": [
|
||||||
|
"PUBLISH"
|
||||||
|
],
|
||||||
|
"description": "Publish the Project",
|
||||||
|
"display_on_phase": [
|
||||||
|
"DRAFT"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
# REVIEW ACTION
|
||||||
|
TITLE_REVIEW_REQUIRED=Review required for ${project_name}
|
||||||
|
MSG_REVIEW_REQUIRED=@${user_caller} submitted the project ${project_name}. You are kindly requested to review it and decide either to APPROVE or REJECT it. See the Project at ${private_data_entry_link}
|
||||||
|
# REJECTED ACTION
|
||||||
|
TITLE_ITEM_REJECTED=Rejected ${project_name}
|
||||||
|
MSG_ITEM_REJECTED=The project ${project_name} (id: ${project_id}) has just been rejected by @${user_caller}. See the Project at ${private_data_entry_link}
|
||||||
|
# REJECTED ACTION
|
||||||
|
TITLE_ITEM_REJECTED_REVIEW_REQUIRED=Rejected ${project_name}
|
||||||
|
MSG_ITEM_REJECTED_REVIEW_REQUIRED=The project ${project_name} has just been rejected. You are kindly requested to review it. See the Project at ${private_data_entry_link}
|
||||||
|
# PUBLISHED ACTION
|
||||||
|
TITLE_ITEM_PUBLISHED=Published ${project_name}
|
||||||
|
MSG_ITEM_PUBLISHED=The project ${project_name} created by @${item_creator} has just been published. See the Project at ${public_data_viewer_link}
|
||||||
|
# CREATED ACTION
|
||||||
|
TITLE_ITEM_CREATED=Created ${project_name}
|
||||||
|
MSG_ITEM_CREATED=The project ${project_name} has just been created. See the Project at ${private_data_entry_link}
|
||||||
|
# DELETED ACTION
|
||||||
|
TITLE_ITEM_DELETED=Deleted ${project_name}
|
||||||
|
MSG_ITEM_DELETED=The project ${project_name} has just been deleted
|
||||||
|
# UPDATED ACTION
|
||||||
|
TITLE_ITEM_UPDATED=Updated ${project_name}
|
||||||
|
MSG_ITEM_UPDATED=The project ${project_name} (id: ${project_id}) has just been updated. See the Project at ${private_data_entry_link}
|
||||||
|
# GO TO PDF ACTION
|
||||||
|
MSG_GO_TO_PDF=Go to PDF report at ${project_as_pdf_link}
|
|
@ -0,0 +1,23 @@
|
||||||
|
# REVIEW ACTION
|
||||||
|
TITLE_REVIEW_REQUIRED=Richiesta di revisione per ${project_name}
|
||||||
|
MSG_REVIEW_REQUIRED=@${user_caller} ha sottomesso il progetto ${project_name}. Si prega di esaminarlo e decidere se APPROVARLO o RIFIUTARLO. Vedi il progetto ${private_data_entry_link}
|
||||||
|
# REJECTED ACTION
|
||||||
|
TITLE_ITEM_REJECTED=Rigettato ${project_name}
|
||||||
|
MSG_ITEM_REJECTED=Il progetto ${project_name} (id: ${project_id}) è stato rigettato da @${user_caller}. Vedi il progetto ${private_data_entry_link}
|
||||||
|
# REJECTED ACTION
|
||||||
|
TITLE_ITEM_REJECTED_REVIEW_REQUIRED=Rigettato ${project_name}
|
||||||
|
MSG_ITEM_REJECTED_REVIEW_REQUIRED=Il progetto ${project_name} è stato rigettato. Si prega di rivederlo. Vedi il progetto ${private_data_entry_link}
|
||||||
|
# PUBLISHED ACTION
|
||||||
|
TITLE_ITEM_PUBLISHED=Pubblicato ${project_name}
|
||||||
|
MSG_ITEM_PUBLISHED=Il progetto ${project_name} creato da @${item_creator} è stato pubblicato. Vedi il progetto ${public_data_viewer_link}
|
||||||
|
# CREATED ACTION
|
||||||
|
TITLE_ITEM_CREATED=Creato ${project_name}
|
||||||
|
MSG_ITEM_CREATED=Il progetto ${project_name} è stato creato. Vedi il progetto ${private_data_entry_link}
|
||||||
|
# DELETED ACTION
|
||||||
|
TITLE_ITEM_DELETED=Cancellato ${project_name}
|
||||||
|
MSG_ITEM_DELETED=Il progetto ${project_name} è stato cancellato
|
||||||
|
# UPDATED ACTION
|
||||||
|
TITLE_ITEM_UPDATED=Aggiornato ${project_name}
|
||||||
|
MSG_ITEM_UPDATED=Il progetto ${project_name} (id: ${project_id}) è stato aggiornato. Vedi il progetto ${private_data_entry_link}
|
||||||
|
# GO TO PDF ACTION
|
||||||
|
MSG_GO_TO_PDF=Vai al report PDF ${project_as_pdf_link}
|
|
@ -94,7 +94,7 @@
|
||||||
"_description": "Embedded profile for concessioni [mibac] management",
|
"_description": "Embedded profile for concessioni [mibac] management",
|
||||||
"_creationInfo": {
|
"_creationInfo": {
|
||||||
"_user": {
|
"_user": {
|
||||||
"_username": "fabio.sinibaldi"
|
"_username": "francesco.mangiacrapa"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"_dataAccessPolicies": [
|
"_dataAccessPolicies": [
|
||||||
|
@ -212,21 +212,11 @@
|
||||||
"path": "$._theDocument.descrizioneContenuto",
|
"path": "$._theDocument.descrizioneContenuto",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "autore",
|
|
||||||
"path": "$._theDocument.authors",
|
|
||||||
"type": "TEXT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "contributore",
|
"name": "contributore",
|
||||||
"path": "$._theDocument.contributore",
|
"path": "$._theDocument.contributore",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "titolare",
|
|
||||||
"path": "$._theDocument.titolari",
|
|
||||||
"type": "TEXT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "responsabile",
|
"name": "responsabile",
|
||||||
"path": "$._theDocument.responsabile",
|
"path": "$._theDocument.responsabile",
|
||||||
|
@ -237,6 +227,16 @@
|
||||||
"path": "$._theDocument.editore",
|
"path": "$._theDocument.editore",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ufficio_mic_competente",
|
||||||
|
"path": "$._theDocument.ufficioMic",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "funzionario_responsabile",
|
||||||
|
"path": "$._theDocument.funzionarioResponsabile",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "finanziamento",
|
"name": "finanziamento",
|
||||||
"path": "$._theDocument.fontiFinanziamento",
|
"path": "$._theDocument.fontiFinanziamento",
|
||||||
|
@ -272,11 +272,6 @@
|
||||||
"path": "$._info._access._license",
|
"path": "$._info._access._license",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "titolare_licenza",
|
|
||||||
"path": "$._theDocument.titolareLicenza",
|
|
||||||
"type": "TEXT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "accesso",
|
"name": "accesso",
|
||||||
"path": "$._info._access._license",
|
"path": "$._info._access._license",
|
||||||
|
@ -286,6 +281,56 @@
|
||||||
"name": "parole_chiave",
|
"name": "parole_chiave",
|
||||||
"path": "$._theDocument.paroleChiaveLibere",
|
"path": "$._theDocument.paroleChiaveLibere",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "modalita_individuazione",
|
||||||
|
"path": "$._theDocument.modalitaIndividuazione",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "contesto_indagine",
|
||||||
|
"path": "$._theDocument.contestoIndagine",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "denominazione",
|
||||||
|
"path": "$._theDocument.denominazione",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stato_attuale",
|
||||||
|
"path": "$._theDocument.statoAttuale",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "accessibilita",
|
||||||
|
"path": "$._theDocument.accessibilita",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cronologia_macrofase",
|
||||||
|
"path": "$._theDocument.cronologiaMacrofase",
|
||||||
|
"type": "TEXT",
|
||||||
|
"apply_regex": {
|
||||||
|
"type": "replaceAll",
|
||||||
|
"regex": "(\\s)?\\([\\s\\S]*",
|
||||||
|
"replacement": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "specifiche_cronologia",
|
||||||
|
"path": "$._theDocument.specificheCronologia",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quota_max",
|
||||||
|
"path": "$._theDocument.quotaMax",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quota_min",
|
||||||
|
"path": "$._theDocument.quotaMin",
|
||||||
|
"type": "TEXT"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"jslt": {},
|
"jslt": {},
|
||||||
|
@ -403,12 +448,12 @@
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.nome",
|
"_theDocument.nome",
|
||||||
"_theDocument.introduzione",
|
"_theDocument.introduzione",
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
|
||||||
"_theDocument.editore",
|
"_theDocument.editore",
|
||||||
"_theDocument.responsabile",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
|
"_theDocument.contestoIndagine",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -436,16 +481,6 @@
|
||||||
"sortable": false,
|
"sortable": false,
|
||||||
"asResult": true
|
"asResult": true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"label": "Author/s",
|
|
||||||
"paths": [
|
|
||||||
"_theDocument.authors"
|
|
||||||
],
|
|
||||||
"operator": "$and",
|
|
||||||
"searchable": false,
|
|
||||||
"sortable": true,
|
|
||||||
"asResult": true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"label": "Project Start (yyyy-mm-dd)",
|
"label": "Project Start (yyyy-mm-dd)",
|
||||||
"paths": [
|
"paths": [
|
||||||
|
@ -459,11 +494,9 @@
|
||||||
{
|
{
|
||||||
"label": "Director/Staff",
|
"label": "Director/Staff",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.editore",
|
"_theDocument.editore"
|
||||||
"_theDocument.responsabile"
|
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
"searchable": true,
|
"searchable": true,
|
||||||
|
@ -474,6 +507,7 @@
|
||||||
"label": "Keywords",
|
"label": "Keywords",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -534,12 +568,12 @@
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.nome",
|
"_theDocument.nome",
|
||||||
"_theDocument.introduzione",
|
"_theDocument.introduzione",
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
|
||||||
"_theDocument.editore",
|
"_theDocument.editore",
|
||||||
"_theDocument.responsabile",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
|
"_theDocument.contestoIndagine",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -590,11 +624,9 @@
|
||||||
{
|
{
|
||||||
"label": "Director/Staff",
|
"label": "Director/Staff",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.editore",
|
"_theDocument.editore"
|
||||||
"_theDocument.responsabile"
|
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
"searchable": true,
|
"searchable": true,
|
||||||
|
@ -605,6 +637,7 @@
|
||||||
"label": "Keywords",
|
"label": "Keywords",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
|
|
@ -98,15 +98,43 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"_dataAccessPolicies": [
|
"_dataAccessPolicies": [
|
||||||
{"_policy": {"_read": "any","_write": "any"},
|
{
|
||||||
"_roles": ["Data-Manager"]},
|
"_policy": {
|
||||||
{"_policy": {"_read": "own","_write": "own"},
|
"_read": "any",
|
||||||
"_roles": ["Data-Editor"]},
|
"_write": "any"
|
||||||
{"_policy": {"_read": "any","_write": "none"},
|
},
|
||||||
"_roles": ["Member"],
|
"_roles": [
|
||||||
"_enforcer": {"_filter": "{\"_lifecycleInformation._phase\" : {\"$eq\" : \"Published\"}}"}},
|
"Data-Manager"
|
||||||
{"_policy": {"_read": "none","_write": "none"},
|
]
|
||||||
"_roles": []}
|
},
|
||||||
|
{
|
||||||
|
"_policy": {
|
||||||
|
"_read": "own",
|
||||||
|
"_write": "own"
|
||||||
|
},
|
||||||
|
"_roles": [
|
||||||
|
"Data-Editor"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_policy": {
|
||||||
|
"_read": "any",
|
||||||
|
"_write": "none"
|
||||||
|
},
|
||||||
|
"_roles": [
|
||||||
|
"Member"
|
||||||
|
],
|
||||||
|
"_enforcer": {
|
||||||
|
"_filter": "{\"_lifecycleInformation._phase\" : {\"$eq\" : \"Published\"}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_policy": {
|
||||||
|
"_read": "none",
|
||||||
|
"_write": "none"
|
||||||
|
},
|
||||||
|
"_roles": []
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"_handlers": [
|
"_handlers": [
|
||||||
{
|
{
|
||||||
|
@ -184,21 +212,11 @@
|
||||||
"path": "$._theDocument.descrizioneContenuto",
|
"path": "$._theDocument.descrizioneContenuto",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "autore",
|
|
||||||
"path": "$._theDocument.authors",
|
|
||||||
"type": "TEXT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "contributore",
|
"name": "contributore",
|
||||||
"path": "$._theDocument.contributore",
|
"path": "$._theDocument.contributore",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "titolare",
|
|
||||||
"path": "$._theDocument.titolari",
|
|
||||||
"type": "TEXT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "responsabile",
|
"name": "responsabile",
|
||||||
"path": "$._theDocument.responsabile",
|
"path": "$._theDocument.responsabile",
|
||||||
|
@ -209,6 +227,16 @@
|
||||||
"path": "$._theDocument.editore",
|
"path": "$._theDocument.editore",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ufficio_competente",
|
||||||
|
"path": "$._theDocument.ufficioCompetente",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "funzionario_responsabile",
|
||||||
|
"path": "$._theDocument.funzionarioResponsabile",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "finanziamento",
|
"name": "finanziamento",
|
||||||
"path": "$._theDocument.fontiFinanziamento",
|
"path": "$._theDocument.fontiFinanziamento",
|
||||||
|
@ -244,11 +272,6 @@
|
||||||
"path": "$._info._access._license",
|
"path": "$._info._access._license",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "titolare_licenza",
|
|
||||||
"path": "$._theDocument.titolareLicenza",
|
|
||||||
"type": "TEXT"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "accesso",
|
"name": "accesso",
|
||||||
"path": "$._info._access._license",
|
"path": "$._info._access._license",
|
||||||
|
@ -258,6 +281,56 @@
|
||||||
"name": "parole_chiave",
|
"name": "parole_chiave",
|
||||||
"path": "$._theDocument.paroleChiaveLibere",
|
"path": "$._theDocument.paroleChiaveLibere",
|
||||||
"type": "TEXT"
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "modalita_individuazione",
|
||||||
|
"path": "$._theDocument.modalitaIndividuazione",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "contesto_indagine",
|
||||||
|
"path": "$._theDocument.contestoIndagine",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "denominazione",
|
||||||
|
"path": "$._theDocument.denominazione",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "stato_attuale",
|
||||||
|
"path": "$._theDocument.statoAttuale",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "accessibilita",
|
||||||
|
"path": "$._theDocument.accessibilita",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cronologia_macrofase",
|
||||||
|
"path": "$._theDocument.cronologiaMacrofase",
|
||||||
|
"type": "TEXT",
|
||||||
|
"apply_regex": {
|
||||||
|
"type": "replaceAll",
|
||||||
|
"regex": "(\\s)?\\([\\s\\S]*",
|
||||||
|
"replacement": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "specifiche_cronologia",
|
||||||
|
"path": "$._theDocument.specificheCronologia",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quota_max",
|
||||||
|
"path": "$._theDocument.quotaMax",
|
||||||
|
"type": "TEXT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quota_min",
|
||||||
|
"path": "$._theDocument.quotaMin",
|
||||||
|
"type": "TEXT"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"jslt": {},
|
"jslt": {},
|
||||||
|
@ -278,9 +351,9 @@
|
||||||
"gcubeProfiles": [
|
"gcubeProfiles": [
|
||||||
{
|
{
|
||||||
"gcubeSecondaryType": "GeoNaMetadata",
|
"gcubeSecondaryType": "GeoNaMetadata",
|
||||||
"gcubeName": "Informazioni_di_progetto",
|
"gcubeName": "Informazioni_di_progetto_estero",
|
||||||
"sectionName": "$.",
|
"sectionName": "$.",
|
||||||
"sectionTitle": "Informazioni di Progetto"
|
"sectionTitle": "Informazioni di Progetto per l'Estero"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"gcubeSecondaryType": "GeoNaMetadata",
|
"gcubeSecondaryType": "GeoNaMetadata",
|
||||||
|
@ -375,12 +448,12 @@
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.nome",
|
"_theDocument.nome",
|
||||||
"_theDocument.introduzione",
|
"_theDocument.introduzione",
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
|
||||||
"_theDocument.editore",
|
"_theDocument.editore",
|
||||||
"_theDocument.responsabile",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
|
"_theDocument.contestoIndagine",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -408,16 +481,6 @@
|
||||||
"sortable": false,
|
"sortable": false,
|
||||||
"asResult": true
|
"asResult": true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"label": "Author/s",
|
|
||||||
"paths": [
|
|
||||||
"_theDocument.authors"
|
|
||||||
],
|
|
||||||
"operator": "$and",
|
|
||||||
"searchable": false,
|
|
||||||
"sortable": true,
|
|
||||||
"asResult": true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"label": "Project Start (yyyy-mm-dd)",
|
"label": "Project Start (yyyy-mm-dd)",
|
||||||
"paths": [
|
"paths": [
|
||||||
|
@ -431,11 +494,9 @@
|
||||||
{
|
{
|
||||||
"label": "Director/Staff",
|
"label": "Director/Staff",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.editore",
|
"_theDocument.editore"
|
||||||
"_theDocument.responsabile"
|
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
"searchable": true,
|
"searchable": true,
|
||||||
|
@ -446,6 +507,7 @@
|
||||||
"label": "Keywords",
|
"label": "Keywords",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -506,12 +568,12 @@
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.nome",
|
"_theDocument.nome",
|
||||||
"_theDocument.introduzione",
|
"_theDocument.introduzione",
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
|
||||||
"_theDocument.editore",
|
"_theDocument.editore",
|
||||||
"_theDocument.responsabile",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
|
"_theDocument.contestoIndagine",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -562,11 +624,9 @@
|
||||||
{
|
{
|
||||||
"label": "Director/Staff",
|
"label": "Director/Staff",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.authors",
|
|
||||||
"_theDocument.contributore",
|
"_theDocument.contributore",
|
||||||
"_theDocument.titolari",
|
"_theDocument.responsabile",
|
||||||
"_theDocument.editore",
|
"_theDocument.editore"
|
||||||
"_theDocument.responsabile"
|
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
"searchable": true,
|
"searchable": true,
|
||||||
|
@ -577,6 +637,7 @@
|
||||||
"label": "Keywords",
|
"label": "Keywords",
|
||||||
"paths": [
|
"paths": [
|
||||||
"_theDocument.paroleChiaveLibere",
|
"_theDocument.paroleChiaveLibere",
|
||||||
|
"_theDocument.cronologiaMacrofase",
|
||||||
"_theDocument.paroleChiaveICCD"
|
"_theDocument.paroleChiaveICCD"
|
||||||
],
|
],
|
||||||
"operator": "$or",
|
"operator": "$or",
|
||||||
|
@ -586,8 +647,7 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
,
|
|
||||||
{
|
{
|
||||||
"_id": "org.gcube.portlets.user.geoportal-timeline-json-template",
|
"_id": "org.gcube.portlets.user.geoportal-timeline-json-template",
|
||||||
"_type": "TIMELINE_JSON_TEMPLATE",
|
"_type": "TIMELINE_JSON_TEMPLATE",
|
||||||
|
@ -661,9 +721,15 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_relationshipDefinitions": [
|
"_relationshipDefinitions": [
|
||||||
{"_id": "precedes", "_label" : "Precede",
|
{
|
||||||
"_reverseRelationId" : "follows"},
|
"_id": "precedes",
|
||||||
{"_id": "follows", "_label" : "Segue",
|
"_label": "Precede",
|
||||||
"_reverseRelationId" : "precedes"}
|
"_reverseRelationId": "follows"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"_id": "follows",
|
||||||
|
"_label": "Segue",
|
||||||
|
"_reverseRelationId": "precedes"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -83,7 +83,7 @@
|
||||||
"Member"
|
"Member"
|
||||||
],
|
],
|
||||||
"_enforcer": {
|
"_enforcer": {
|
||||||
"_filter": "{\"_lifecycleInformation._phase\" : {\"$eq\" : \"PUBLISHED\"}}"
|
"_filter": "{\"_lifecycleInformation._phase\" : {\"$eq\" : \"Published\"}}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
"registeredFileSetPaths": [
|
"registeredFileSetPaths": [
|
||||||
{
|
{
|
||||||
"schemaField": "datiAltimetrici",
|
"schemaField": "datiAltimetrici",
|
||||||
"documentPath": "datiAltimetrici[*].fileset"
|
"documentPath": "datiAltimetrici.fileset"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"schemaField": "planimetria",
|
"schemaField": "planimetria",
|
||||||
|
|
|
@ -3,7 +3,7 @@ gCube CMS Suite
|
||||||
|
|
||||||
gCube CMS Suite is a distributed full stack application for publication management in a gCube Hybrid e-infrastructure. Check wiki [here](https://sublime-and-sphinx-guide.readthedocs.io)
|
gCube CMS Suite is a distributed full stack application for publication management in a gCube Hybrid e-infrastructure. Check wiki [here](https://sublime-and-sphinx-guide.readthedocs.io)
|
||||||
|
|
||||||
[<img src="https://gcube.wiki.gcube-system.org/images_gcube/e/e4/Geo_Portale%281%29.png">](https://www.sphinx-doc.org/en/master/)
|
[<img src="https://gcube.wiki.gcube-system.org/images_gcube/e/e4/Geo_Portale%281%29.png">](https://geoportal.cloud.d4science.org/geoportal-service/docs/index.html)
|
||||||
|
|
||||||
|
|
||||||
Rationale :
|
Rationale :
|
||||||
|
@ -14,6 +14,9 @@ High modularity of plugins allows for the composition of ad hoc use cases with m
|
||||||
|
|
||||||
The suite comes with a set of pre-built plugins and GUIs that communities can easily extend and / or reuse.
|
The suite comes with a set of pre-built plugins and GUIs that communities can easily extend and / or reuse.
|
||||||
|
|
||||||
|
## General Architecture
|
||||||
|
[<img src="https://gcube.wiki.gcube-system.org/images_gcube/c/ce/Geoportal_General_Architecture.jpg">](https://geoportal.cloud.d4science.org/geoportal-service/docs/architecture.html)
|
||||||
|
|
||||||
## Use Case
|
## Use Case
|
||||||
##### D4GNA: component diagram
|
##### D4GNA: component diagram
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
|
</classpath>
|
|
@ -0,0 +1 @@
|
||||||
|
/target/
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>ckan-plugin</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Changelog for org.gcube.application.cms.catalogue-binding-plugin
|
||||||
|
|
||||||
|
## [v1.0.0-SNAPSHOT] - 2023-12-21
|
||||||
|
|
||||||
|
- First release
|
||||||
|
|
||||||
|
- This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Acknowledgments
|
||||||
|
|
||||||
|
The projects leading to this software have received funding from a series of European Union programmes including:
|
||||||
|
|
||||||
|
- the Sixth Framework Programme for Research and Technological Development
|
||||||
|
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
|
||||||
|
- the Seventh Framework Programme for research, technological development and demonstration
|
||||||
|
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
|
||||||
|
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
|
||||||
|
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
|
||||||
|
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
|
||||||
|
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
|
||||||
|
- the H2020 research and innovation programme
|
||||||
|
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
|
||||||
|
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
|
||||||
|
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
|
||||||
|
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
|
||||||
|
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
|
||||||
|
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
|
||||||
|
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
|
||||||
|
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
|
||||||
|
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
|
||||||
|
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
|
||||||
|
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
|
||||||
|
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
|
||||||
|
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);
|
|
@ -0,0 +1,312 @@
|
||||||
|
# European Union Public Licence V. 1.1
|
||||||
|
|
||||||
|
|
||||||
|
EUPL © the European Community 2007
|
||||||
|
|
||||||
|
|
||||||
|
This European Union Public Licence (the “EUPL”) applies to the Work or Software
|
||||||
|
(as defined below) which is provided under the terms of this Licence. Any use of
|
||||||
|
the Work, other than as authorised under this Licence is prohibited (to the
|
||||||
|
extent such use is covered by a right of the copyright holder of the Work).
|
||||||
|
|
||||||
|
The Original Work is provided under the terms of this Licence when the Licensor
|
||||||
|
(as defined below) has placed the following notice immediately following the
|
||||||
|
copyright notice for the Original Work:
|
||||||
|
|
||||||
|
Licensed under the EUPL V.1.1
|
||||||
|
|
||||||
|
or has expressed by any other mean his willingness to license under the EUPL.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 1. Definitions
|
||||||
|
|
||||||
|
In this Licence, the following terms have the following meaning:
|
||||||
|
|
||||||
|
- The Licence: this Licence.
|
||||||
|
|
||||||
|
- The Original Work or the Software: the software distributed and/or
|
||||||
|
communicated by the Licensor under this Licence, available as Source Code and
|
||||||
|
also as Executable Code as the case may be.
|
||||||
|
|
||||||
|
- Derivative Works: the works or software that could be created by the Licensee,
|
||||||
|
based upon the Original Work or modifications thereof. This Licence does not
|
||||||
|
define the extent of modification or dependence on the Original Work required
|
||||||
|
in order to classify a work as a Derivative Work; this extent is determined by
|
||||||
|
copyright law applicable in the country mentioned in Article 15.
|
||||||
|
|
||||||
|
- The Work: the Original Work and/or its Derivative Works.
|
||||||
|
|
||||||
|
- The Source Code: the human-readable form of the Work which is the most
|
||||||
|
convenient for people to study and modify.
|
||||||
|
|
||||||
|
- The Executable Code: any code which has generally been compiled and which is
|
||||||
|
meant to be interpreted by a computer as a program.
|
||||||
|
|
||||||
|
- The Licensor: the natural or legal person that distributes and/or communicates
|
||||||
|
the Work under the Licence.
|
||||||
|
|
||||||
|
- Contributor(s): any natural or legal person who modifies the Work under the
|
||||||
|
Licence, or otherwise contributes to the creation of a Derivative Work.
|
||||||
|
|
||||||
|
- The Licensee or “You”: any natural or legal person who makes any usage of the
|
||||||
|
Software under the terms of the Licence.
|
||||||
|
|
||||||
|
- Distribution and/or Communication: any act of selling, giving, lending,
|
||||||
|
renting, distributing, communicating, transmitting, or otherwise making
|
||||||
|
available, on-line or off-line, copies of the Work or providing access to its
|
||||||
|
essential functionalities at the disposal of any other natural or legal
|
||||||
|
person.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 2. Scope of the rights granted by the Licence
|
||||||
|
|
||||||
|
The Licensor hereby grants You a world-wide, royalty-free, non-exclusive,
|
||||||
|
sub-licensable licence to do the following, for the duration of copyright vested
|
||||||
|
in the Original Work:
|
||||||
|
|
||||||
|
- use the Work in any circumstance and for all usage, reproduce the Work, modify
|
||||||
|
- the Original Work, and make Derivative Works based upon the Work, communicate
|
||||||
|
- to the public, including the right to make available or display the Work or
|
||||||
|
- copies thereof to the public and perform publicly, as the case may be, the
|
||||||
|
- Work, distribute the Work or copies thereof, lend and rent the Work or copies
|
||||||
|
- thereof, sub-license rights in the Work or copies thereof.
|
||||||
|
|
||||||
|
Those rights can be exercised on any media, supports and formats, whether now
|
||||||
|
known or later invented, as far as the applicable law permits so.
|
||||||
|
|
||||||
|
In the countries where moral rights apply, the Licensor waives his right to
|
||||||
|
exercise his moral right to the extent allowed by law in order to make effective
|
||||||
|
the licence of the economic rights here above listed.
|
||||||
|
|
||||||
|
The Licensor grants to the Licensee royalty-free, non exclusive usage rights to
|
||||||
|
any patents held by the Licensor, to the extent necessary to make use of the
|
||||||
|
rights granted on the Work under this Licence.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 3. Communication of the Source Code
|
||||||
|
|
||||||
|
The Licensor may provide the Work either in its Source Code form, or as
|
||||||
|
Executable Code. If the Work is provided as Executable Code, the Licensor
|
||||||
|
provides in addition a machine-readable copy of the Source Code of the Work
|
||||||
|
along with each copy of the Work that the Licensor distributes or indicates, in
|
||||||
|
a notice following the copyright notice attached to the Work, a repository where
|
||||||
|
the Source Code is easily and freely accessible for as long as the Licensor
|
||||||
|
continues to distribute and/or communicate the Work.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 4. Limitations on copyright
|
||||||
|
|
||||||
|
Nothing in this Licence is intended to deprive the Licensee of the benefits from
|
||||||
|
any exception or limitation to the exclusive rights of the rights owners in the
|
||||||
|
Original Work or Software, of the exhaustion of those rights or of other
|
||||||
|
applicable limitations thereto.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 5. Obligations of the Licensee
|
||||||
|
|
||||||
|
The grant of the rights mentioned above is subject to some restrictions and
|
||||||
|
obligations imposed on the Licensee. Those obligations are the following:
|
||||||
|
|
||||||
|
Attribution right: the Licensee shall keep intact all copyright, patent or
|
||||||
|
trademarks notices and all notices that refer to the Licence and to the
|
||||||
|
disclaimer of warranties. The Licensee must include a copy of such notices and a
|
||||||
|
copy of the Licence with every copy of the Work he/she distributes and/or
|
||||||
|
communicates. The Licensee must cause any Derivative Work to carry prominent
|
||||||
|
notices stating that the Work has been modified and the date of modification.
|
||||||
|
|
||||||
|
Copyleft clause: If the Licensee distributes and/or communicates copies of the
|
||||||
|
Original Works or Derivative Works based upon the Original Work, this
|
||||||
|
Distribution and/or Communication will be done under the terms of this Licence
|
||||||
|
or of a later version of this Licence unless the Original Work is expressly
|
||||||
|
distributed only under this version of the Licence. The Licensee (becoming
|
||||||
|
Licensor) cannot offer or impose any additional terms or conditions on the Work
|
||||||
|
or Derivative Work that alter or restrict the terms of the Licence.
|
||||||
|
|
||||||
|
Compatibility clause: If the Licensee Distributes and/or Communicates Derivative
|
||||||
|
Works or copies thereof based upon both the Original Work and another work
|
||||||
|
licensed under a Compatible Licence, this Distribution and/or Communication can
|
||||||
|
be done under the terms of this Compatible Licence. For the sake of this clause,
|
||||||
|
“Compatible Licence” refers to the licences listed in the appendix attached to
|
||||||
|
this Licence. Should the Licensee’s obligations under the Compatible Licence
|
||||||
|
conflict with his/her obligations under this Licence, the obligations of the
|
||||||
|
Compatible Licence shall prevail.
|
||||||
|
|
||||||
|
Provision of Source Code: When distributing and/or communicating copies of the
|
||||||
|
Work, the Licensee will provide a machine-readable copy of the Source Code or
|
||||||
|
indicate a repository where this Source will be easily and freely available for
|
||||||
|
as long as the Licensee continues to distribute and/or communicate the Work.
|
||||||
|
|
||||||
|
Legal Protection: This Licence does not grant permission to use the trade names,
|
||||||
|
trademarks, service marks, or names of the Licensor, except as required for
|
||||||
|
reasonable and customary use in describing the origin of the Work and
|
||||||
|
reproducing the content of the copyright notice.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 6. Chain of Authorship
|
||||||
|
|
||||||
|
The original Licensor warrants that the copyright in the Original Work granted
|
||||||
|
hereunder is owned by him/her or licensed to him/her and that he/she has the
|
||||||
|
power and authority to grant the Licence.
|
||||||
|
|
||||||
|
Each Contributor warrants that the copyright in the modifications he/she brings
|
||||||
|
to the Work are owned by him/her or licensed to him/her and that he/she has the
|
||||||
|
power and authority to grant the Licence.
|
||||||
|
|
||||||
|
Each time You accept the Licence, the original Licensor and subsequent
|
||||||
|
Contributors grant You a licence to their contributions to the Work, under the
|
||||||
|
terms of this Licence.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 7. Disclaimer of Warranty
|
||||||
|
|
||||||
|
The Work is a work in progress, which is continuously improved by numerous
|
||||||
|
contributors. It is not a finished work and may therefore contain defects or
|
||||||
|
“bugs” inherent to this type of software development.
|
||||||
|
|
||||||
|
For the above reason, the Work is provided under the Licence on an “as is” basis
|
||||||
|
and without warranties of any kind concerning the Work, including without
|
||||||
|
limitation merchantability, fitness for a particular purpose, absence of defects
|
||||||
|
or errors, accuracy, non-infringement of intellectual property rights other than
|
||||||
|
copyright as stated in Article 6 of this Licence.
|
||||||
|
|
||||||
|
This disclaimer of warranty is an essential part of the Licence and a condition
|
||||||
|
for the grant of any rights to the Work.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 8. Disclaimer of Liability
|
||||||
|
|
||||||
|
Except in the cases of wilful misconduct or damages directly caused to natural
|
||||||
|
persons, the Licensor will in no event be liable for any direct or indirect,
|
||||||
|
material or moral, damages of any kind, arising out of the Licence or of the use
|
||||||
|
of the Work, including without limitation, damages for loss of goodwill, work
|
||||||
|
stoppage, computer failure or malfunction, loss of data or any commercial
|
||||||
|
damage, even if the Licensor has been advised of the possibility of such
|
||||||
|
damage. However, the Licensor will be liable under statutory product liability
|
||||||
|
laws as far such laws apply to the Work.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 9. Additional agreements
|
||||||
|
|
||||||
|
While distributing the Original Work or Derivative Works, You may choose to
|
||||||
|
conclude an additional agreement to offer, and charge a fee for, acceptance of
|
||||||
|
support, warranty, indemnity, or other liability obligations and/or services
|
||||||
|
consistent with this Licence. However, in accepting such obligations, You may
|
||||||
|
act only on your own behalf and on your sole responsibility, not on behalf of
|
||||||
|
the original Licensor or any other Contributor, and only if You agree to
|
||||||
|
indemnify, defend, and hold each Contributor harmless for any liability incurred
|
||||||
|
by, or claims asserted against such Contributor by the fact You have accepted
|
||||||
|
any such warranty or additional liability.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 10. Acceptance of the Licence
|
||||||
|
|
||||||
|
The provisions of this Licence can be accepted by clicking on an icon “I agree”
|
||||||
|
placed under the bottom of a window displaying the text of this Licence or by
|
||||||
|
affirming consent in any other similar way, in accordance with the rules of
|
||||||
|
applicable law. Clicking on that icon indicates your clear and irrevocable
|
||||||
|
acceptance of this Licence and all of its terms and conditions.
|
||||||
|
|
||||||
|
Similarly, you irrevocably accept this Licence and all of its terms and
|
||||||
|
conditions by exercising any rights granted to You by Article 2 of this Licence,
|
||||||
|
such as the use of the Work, the creation by You of a Derivative Work or the
|
||||||
|
Distribution and/or Communication by You of the Work or copies thereof.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 11. Information to the public
|
||||||
|
|
||||||
|
In case of any Distribution and/or Communication of the Work by means of
|
||||||
|
electronic communication by You (for example, by offering to download the Work
|
||||||
|
from a remote location) the distribution channel or media (for example, a
|
||||||
|
website) must at least provide to the public the information requested by the
|
||||||
|
applicable law regarding the Licensor, the Licence and the way it may be
|
||||||
|
accessible, concluded, stored and reproduced by the Licensee.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 12. Termination of the Licence
|
||||||
|
|
||||||
|
The Licence and the rights granted hereunder will terminate automatically upon
|
||||||
|
any breach by the Licensee of the terms of the Licence.
|
||||||
|
|
||||||
|
Such a termination will not terminate the licences of any person who has
|
||||||
|
received the Work from the Licensee under the Licence, provided such persons
|
||||||
|
remain in full compliance with the Licence.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 13. Miscellaneous
|
||||||
|
|
||||||
|
Without prejudice of Article 9 above, the Licence represents the complete
|
||||||
|
agreement between the Parties as to the Work licensed hereunder.
|
||||||
|
|
||||||
|
If any provision of the Licence is invalid or unenforceable under applicable
|
||||||
|
law, this will not affect the validity or enforceability of the Licence as a
|
||||||
|
whole. Such provision will be construed and/or reformed so as necessary to make
|
||||||
|
it valid and enforceable.
|
||||||
|
|
||||||
|
The European Commission may publish other linguistic versions and/or new
|
||||||
|
versions of this Licence, so far this is required and reasonable, without
|
||||||
|
reducing the scope of the rights granted by the Licence. New versions of the
|
||||||
|
Licence will be published with a unique version number.
|
||||||
|
|
||||||
|
All linguistic versions of this Licence, approved by the European Commission,
|
||||||
|
have identical value. Parties can take advantage of the linguistic version of
|
||||||
|
their choice.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 14. Jurisdiction
|
||||||
|
|
||||||
|
Any litigation resulting from the interpretation of this License, arising
|
||||||
|
between the European Commission, as a Licensor, and any Licensee, will be
|
||||||
|
subject to the jurisdiction of the Court of Justice of the European Communities,
|
||||||
|
as laid down in article 238 of the Treaty establishing the European Community.
|
||||||
|
|
||||||
|
Any litigation arising between Parties, other than the European Commission, and
|
||||||
|
resulting from the interpretation of this License, will be subject to the
|
||||||
|
exclusive jurisdiction of the competent court where the Licensor resides or
|
||||||
|
conducts its primary business.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 15. Applicable Law
|
||||||
|
|
||||||
|
This Licence shall be governed by the law of the European Union country where
|
||||||
|
the Licensor resides or has his registered office.
|
||||||
|
|
||||||
|
This licence shall be governed by the Belgian law if:
|
||||||
|
|
||||||
|
- a litigation arises between the European Commission, as a Licensor, and any
|
||||||
|
- Licensee; the Licensor, other than the European Commission, has no residence
|
||||||
|
- or registered office inside a European Union country.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Appendix
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
“Compatible Licences” according to article 5 EUPL are:
|
||||||
|
|
||||||
|
|
||||||
|
- GNU General Public License (GNU GPL) v. 2
|
||||||
|
|
||||||
|
- Open Software License (OSL) v. 2.1, v. 3.0
|
||||||
|
|
||||||
|
- Common Public License v. 1.0
|
||||||
|
|
||||||
|
- Eclipse Public License v. 1.0
|
||||||
|
|
||||||
|
- Cecill v. 2.0
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
gCube CMS Suite : Catalogue Binding Plugin
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
The "Catalogue Binding Plugin" implements the binding from
|
||||||
|
(the products registered in) the Geoportal system to the D4Science Catalogue system.
|
||||||
|
|
||||||
|
## Built with
|
||||||
|
* [gCube SmartGears] (https://gcube.wiki.gcube-system.org/gcube/SmartGears) - The gCube SmartGears framework
|
||||||
|
* [OpenJDK](https://openjdk.java.net/) - The JDK used
|
||||||
|
* [JAX-RS](https://github.com/eclipse-ee4j/jaxrs-api) - Java™ API for RESTful Web Services
|
||||||
|
* [Jersey](https://jersey.github.io/) - JAX-RS runtime
|
||||||
|
* [Maven](https://maven.apache.org/) - Dependency Management
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
[gCube CMS Suite](../) parent module containing references, documentation, guides ad utilities.
|
||||||
|
|
||||||
|
The "Catalogue Binding Plugin" requires a handler registered in the UCD so defined:
|
||||||
|
|
||||||
|
{
|
||||||
|
"_id": "Catalogue-Binding-Plugin",
|
||||||
|
"_type": "EventListener",
|
||||||
|
"_configuration": {
|
||||||
|
"subscribeEvents": [
|
||||||
|
{
|
||||||
|
"event": "{EVENT_NAME_1}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"event": "{EVENT_NAME_2}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
where the supported events are:
|
||||||
|
|
||||||
|
"PROJECT_CREATED"
|
||||||
|
"PROJECT_UPDATED"
|
||||||
|
"PROJECT_DELETED"
|
||||||
|
"LIFECYCLE_STEP_PERFORMED"
|
||||||
|
|
||||||
|
|
||||||
|
## Change log
|
||||||
|
See [CHANGELOG.md](CHANGELOG.md).
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
* **Francesco Mangiacrapa** ([ORCID](https://orcid.org/0000-0002-6528-664X)) Computer Scientist at [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
|
||||||
|
|
||||||
|
## License
|
||||||
|
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
|
||||||
|
|
||||||
|
## About the gCube Framework
|
||||||
|
This software is part of the [gCubeFramework](https://www.gcube-system.org/ "gCubeFramework"): an
|
||||||
|
open-source software toolkit used for building and operating Hybrid Data
|
||||||
|
Infrastructures enabling the dynamic deployment of Virtual Research Environments
|
||||||
|
by favouring the realisation of reuse oriented policies.
|
||||||
|
|
||||||
|
The projects leading to this software have received funding from a series of European Union programmes including:
|
||||||
|
|
||||||
|
- the Sixth Framework Programme for Research and Technological Development
|
||||||
|
- DILIGENT (grant no. 004260).
|
||||||
|
- the Seventh Framework Programme for research, technological development and demonstration
|
||||||
|
- D4Science (grant no. 212488);
|
||||||
|
- D4Science-II (grant no.239019);
|
||||||
|
- ENVRI (grant no. 283465);
|
||||||
|
- iMarine(grant no. 283644);
|
||||||
|
- EUBrazilOpenBio (grant no. 288754).
|
||||||
|
- the H2020 research and innovation programme
|
||||||
|
- SoBigData (grant no. 654024);
|
||||||
|
- PARTHENOS (grant no. 654119);
|
||||||
|
- EGIEngage (grant no. 654142);
|
||||||
|
- ENVRIplus (grant no. 654182);
|
||||||
|
- BlueBRIDGE (grant no. 675680);
|
||||||
|
- PerformFish (grant no. 727610);
|
||||||
|
- AGINFRAplus (grant no. 731001);
|
||||||
|
- DESIRA (grant no. 818194);
|
||||||
|
- ARIADNEplus (grant no. 823914);
|
||||||
|
- RISIS2 (grant no. 824091);
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>catalogue-binding-plugins</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<name>gCube CMS - Catalogue Binding Plugin</name>
|
||||||
|
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
<artifactId>gcube-cms-suite</artifactId>
|
||||||
|
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<scm>
|
||||||
|
<connection>scm:git:${gitBaseUrl}/gcube-cms-suite</connection>
|
||||||
|
<developerConnection>scm:git:${gitBaseUrl}/gcube-cms-suite</developerConnection>
|
||||||
|
<url>${gitBaseUrl}/gcube-cms-suite</url>
|
||||||
|
</scm>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.distribution</groupId>
|
||||||
|
<artifactId>gcube-smartgears-bom</artifactId>
|
||||||
|
<version>${gcube-smartgears-bom-version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
<artifactId>cms-plugin-framework</artifactId>
|
||||||
|
<version>${plugin-framework-version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
<artifactId>cms-plugin-framework</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
<artifactId>default-lc-managers</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
<artifactId>cms-test-commons</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>make-uberjar</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>make-servicearchive</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,320 @@
|
||||||
|
package org.gcube.application.cms.cataloguebinding;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.bson.Document;
|
||||||
|
import org.gcube.application.cms.cataloguebinding.doaction.BindingAction;
|
||||||
|
import org.gcube.application.cms.implementations.utils.UserUtils;
|
||||||
|
import org.gcube.application.cms.plugins.EventListenerPluginInterface;
|
||||||
|
import org.gcube.application.cms.plugins.events.EventListener;
|
||||||
|
import org.gcube.application.cms.plugins.events.EventManager;
|
||||||
|
import org.gcube.application.cms.plugins.events.EventManager.Event;
|
||||||
|
import org.gcube.application.cms.plugins.events.ItemObserved;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InitializationException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InvalidProfileException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.MaterializationException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.ShutDownException;
|
||||||
|
import org.gcube.application.cms.plugins.implementations.AbstractPlugin;
|
||||||
|
import org.gcube.application.cms.plugins.reports.InitializationReport;
|
||||||
|
import org.gcube.application.cms.plugins.reports.Report;
|
||||||
|
import org.gcube.application.cms.plugins.reports.Report.Status;
|
||||||
|
import org.gcube.application.cms.serialization.Serialization;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
|
import org.gcube.application.geoportal.common.model.plugins.PluginDescriptor;
|
||||||
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
|
||||||
|
import com.vdurmont.semver4j.Semver;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Synchronized;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class CatalogueBindingPlugin.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jan 19, 2024
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class CatalogueBindingPlugin extends AbstractPlugin implements EventListenerPluginInterface {
|
||||||
|
|
||||||
|
public static final String SUBSCRIBE_EVENTS_CONFIG = "subscribeEvents";
|
||||||
|
public static final String PLUGIN_ID = "Catalogue-Binding-Plugin";
|
||||||
|
public static final String PLUGIN_TYPE = "EventListener";
|
||||||
|
|
||||||
|
public static final PluginDescriptor DESCRIPTOR = new PluginDescriptor(PLUGIN_ID, PLUGIN_TYPE);
|
||||||
|
|
||||||
|
static {
|
||||||
|
DESCRIPTOR.setVersion(new Semver("1.0.0"));
|
||||||
|
DESCRIPTOR.setDescription("Manage the data binding from geoportal to catalogue");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the descriptor.
|
||||||
|
*
|
||||||
|
* @return the descriptor
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PluginDescriptor getDescriptor() {
|
||||||
|
|
||||||
|
return DESCRIPTOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SubscribeEventsConfig {
|
||||||
|
private String event;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inits the.
|
||||||
|
*
|
||||||
|
* @return the initialization report
|
||||||
|
* @throws InitializationException the initialization exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InitializationReport init() throws InitializationException {
|
||||||
|
log.debug("Called init");
|
||||||
|
InitializationReport report = null;
|
||||||
|
try {
|
||||||
|
// Creating all listeners
|
||||||
|
EventListener<ItemObserved<Project>> listenerCreated = new EventListener<ItemObserved<Project>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updated(ItemObserved<Project> observerd) {
|
||||||
|
log.info("listenerCreated fired on item: {} " + observerd);
|
||||||
|
|
||||||
|
boolean subscribed = checkIfSubscribedEvent(observerd);
|
||||||
|
|
||||||
|
if (subscribed) {
|
||||||
|
doAction(observerd);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
EventListener<ItemObserved<Project>> listenerUpdated = new EventListener<ItemObserved<Project>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updated(ItemObserved<Project> observerd) {
|
||||||
|
log.info("listenerUpdated fired on item: {} " + observerd);
|
||||||
|
boolean subscribed = checkIfSubscribedEvent(observerd);
|
||||||
|
|
||||||
|
if (subscribed) {
|
||||||
|
doAction(observerd);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
EventListener<ItemObserved<Project>> listenerDeleted = new EventListener<ItemObserved<Project>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updated(ItemObserved<Project> observerd) {
|
||||||
|
log.info("listenerDeleted fired on item: {} " + observerd);
|
||||||
|
boolean subscribed = checkIfSubscribedEvent(observerd);
|
||||||
|
|
||||||
|
if (subscribed) {
|
||||||
|
doAction(observerd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
EventListener<ItemObserved<Project>> listenerLCStepPerformed = new EventListener<ItemObserved<Project>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updated(ItemObserved<Project> observerd) {
|
||||||
|
log.info("listenerLCStepPerformed fired on item: {} " + observerd);
|
||||||
|
boolean subscribed = checkIfSubscribedEvent(observerd);
|
||||||
|
|
||||||
|
if (subscribed) {
|
||||||
|
doAction(observerd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Subscribing all events
|
||||||
|
EventManager eventMngInst = EventManager.getInstance();
|
||||||
|
eventMngInst.subscribe(Event.PROJECT_CREATED, listenerCreated);
|
||||||
|
eventMngInst.subscribe(Event.PROJECT_UPDATED, listenerUpdated);
|
||||||
|
eventMngInst.subscribe(Event.PROJECT_DELETED, listenerDeleted);
|
||||||
|
eventMngInst.subscribe(Event.LIFECYCLE_STEP_PERFORMED, listenerLCStepPerformed);
|
||||||
|
|
||||||
|
report = new InitializationReport(Status.OK, PLUGIN_ID + " init performed");
|
||||||
|
} catch (Exception e) {
|
||||||
|
InitializationException exc = new InitializationException("Unable to initialize " + DESCRIPTOR.getId(), e);
|
||||||
|
log.error("init error: {} ", exc);
|
||||||
|
throw exc;
|
||||||
|
}
|
||||||
|
|
||||||
|
return report;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inits the in context.
|
||||||
|
*
|
||||||
|
* @return the initialization report
|
||||||
|
* @throws InitializationException the initialization exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Synchronized
|
||||||
|
public InitializationReport initInContext() throws InitializationException {
|
||||||
|
InitializationReport report = new InitializationReport();
|
||||||
|
try {
|
||||||
|
String context = UserUtils.getCurrent().getContext();
|
||||||
|
if (getCatalogueBindingMapPerContext() == null) {
|
||||||
|
log.info("Initializing in " + context);
|
||||||
|
catalogueBindingMap.put(context, new EventsSubscribed());
|
||||||
|
}
|
||||||
|
report.setStatus(Report.Status.OK);
|
||||||
|
report.putMessage("Initialized " + DESCRIPTOR.getId() + " in the " + context);
|
||||||
|
} catch (Exception e) {
|
||||||
|
InitializationException exc = new InitializationException("Unable to initialize " + DESCRIPTOR.getId(), e);
|
||||||
|
log.error("initInContext error: {} ", exc);
|
||||||
|
throw exc;
|
||||||
|
}
|
||||||
|
return report;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Map<String, EventsSubscribed> catalogueBindingMap = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the catalogue binding map per context.
|
||||||
|
*
|
||||||
|
* @return the catalogue binding map per context
|
||||||
|
*/
|
||||||
|
protected EventsSubscribed getCatalogueBindingMapPerContext() {
|
||||||
|
String context = UserUtils.getCurrent().getContext();
|
||||||
|
log.debug("Getting {} from cache map for context {}", CatalogueBindingPlugin.PLUGIN_ID, context);
|
||||||
|
if (catalogueBindingMap == null)
|
||||||
|
catalogueBindingMap = new LinkedHashMap<String, EventsSubscribed>();
|
||||||
|
|
||||||
|
return catalogueBindingMap.get(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read events subscribed from configuration in the UCD.
|
||||||
|
*
|
||||||
|
* @param useCaseDescriptor the use case descriptor
|
||||||
|
* @return the events subscribed
|
||||||
|
* @throws Exception the exception
|
||||||
|
*/
|
||||||
|
public EventsSubscribed readEventsSubscribedFromConfigurationInTheUCD(UseCaseDescriptor useCaseDescriptor)
|
||||||
|
throws Exception {
|
||||||
|
|
||||||
|
log.debug("Reading subscribed events from UCD");
|
||||||
|
|
||||||
|
EventsSubscribed eventsSubscrInTheUCD = new EventsSubscribed();
|
||||||
|
|
||||||
|
if (useCaseDescriptor == null)
|
||||||
|
throw new Exception("Error reading UCD null found");
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
String context = UserUtils.getCurrent().getContext();
|
||||||
|
|
||||||
|
eventsSubscrInTheUCD = getCatalogueBindingMapPerContext();
|
||||||
|
|
||||||
|
List<Event> listEventsSubscribedPerUCD = new ArrayList<EventManager.Event>();
|
||||||
|
if (eventsSubscrInTheUCD == null || listEventsSubscribedPerUCD.isEmpty()) {
|
||||||
|
|
||||||
|
Document profileConfiguration = getConfigurationFromProfile(useCaseDescriptor).getConfiguration();
|
||||||
|
log.debug("UseCaseDescriptor Configuration is {} ", profileConfiguration);
|
||||||
|
// JSONPathWrapper schemaNavigator = new
|
||||||
|
// JSONPathWrapper(useCaseDescriptor.getSchema().toJson());
|
||||||
|
|
||||||
|
for (Object fsConfigObj : profileConfiguration.get(SUBSCRIBE_EVENTS_CONFIG, List.class)) {
|
||||||
|
log.debug("Managing {} ", fsConfigObj);
|
||||||
|
SubscribeEventsConfig fsConfig = Serialization.convert(fsConfigObj, SubscribeEventsConfig.class);
|
||||||
|
log.debug("Converted config {}", fsConfig);
|
||||||
|
String theEventSubsribed = fsConfig.getEvent();
|
||||||
|
if (theEventSubsribed == null || theEventSubsribed.isEmpty())
|
||||||
|
throw new MaterializationException(
|
||||||
|
"Invalid Field Definition path in configuration [NO MATCH] : " + fsConfig.getEvent());
|
||||||
|
|
||||||
|
Event event = Serialization.convert(theEventSubsribed, Event.class);
|
||||||
|
log.debug("Added event {} to list ", event);
|
||||||
|
listEventsSubscribedPerUCD.add(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventsSubscrInTheUCD = new EventsSubscribed();
|
||||||
|
eventsSubscrInTheUCD.setContext(context);
|
||||||
|
eventsSubscrInTheUCD.setListEventSubscribed(listEventsSubscribedPerUCD);
|
||||||
|
catalogueBindingMap.put(context, eventsSubscrInTheUCD);
|
||||||
|
|
||||||
|
log.info("Events subscribed read from config {} ", eventsSubscrInTheUCD);
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (InvalidProfileException e) {
|
||||||
|
log.warn("Unable to read configuration for {} in the UCD {}", CatalogueBindingPlugin.PLUGIN_ID,
|
||||||
|
useCaseDescriptor.getId());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Unable to read configuration ", e);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
log.error("Exception, Unable to read configuration ", t);
|
||||||
|
}
|
||||||
|
|
||||||
|
return eventsSubscrInTheUCD;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if subscribed event.
|
||||||
|
*
|
||||||
|
* @param observerd the observerd
|
||||||
|
* @return true, if successful
|
||||||
|
*/
|
||||||
|
public boolean checkIfSubscribedEvent(ItemObserved<Project> observerd) {
|
||||||
|
log.info("Checking if {} is an subscribed event", observerd.getEvent());
|
||||||
|
try {
|
||||||
|
EventsSubscribed eventsSub = readEventsSubscribedFromConfigurationInTheUCD(
|
||||||
|
observerd.getUseCaseDescriptor());
|
||||||
|
|
||||||
|
List<Event> listEvents = eventsSub.getListEventSubscribed();
|
||||||
|
log.info("List events is {}", listEvents);
|
||||||
|
|
||||||
|
if(listEvents==null) {
|
||||||
|
log.info("no event subscribed, returing false");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (listEvents.contains(observerd.getEvent())) {
|
||||||
|
log.info("the event {} is subscribed from config ", observerd.getEvent());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
log.info("the event {} is not subscribed from config ", observerd.getEvent());
|
||||||
|
return false;
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("Exception, Error on checking subscribed events", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shutdown.
|
||||||
|
*
|
||||||
|
* @throws ShutDownException the shut down exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void shutdown() throws ShutDownException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do action.
|
||||||
|
*
|
||||||
|
* @param observerd the observerd
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void doAction(ItemObserved<Project> observerd) {
|
||||||
|
new BindingAction().doAction(observerd);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package org.gcube.application.cms.cataloguebinding;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.plugins.events.EventManager.Event;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EventsSubscribed {
|
||||||
|
String context;
|
||||||
|
List<Event> listEventSubscribed;
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package org.gcube.application.cms.cataloguebinding.doaction;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.plugins.events.ItemObserved;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class BindingAction {
|
||||||
|
|
||||||
|
public void doAction(ItemObserved<Project> itemObserved) {
|
||||||
|
log.info("Do action called on: {}", itemObserved.getEvent());
|
||||||
|
switch (itemObserved.getEvent()) {
|
||||||
|
case PROJECT_CREATED:
|
||||||
|
|
||||||
|
break;
|
||||||
|
case PROJECT_DELETED:
|
||||||
|
|
||||||
|
break;
|
||||||
|
case PROJECT_UPDATED:
|
||||||
|
|
||||||
|
break;
|
||||||
|
case LIFECYCLE_STEP_PERFORMED:
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
|
||||||
|
import org.gcube.application.cms.cataloguebinding.CatalogueBindingPlugin;
|
||||||
|
import org.gcube.application.cms.cataloguebinding.EventsSubscribed;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InitializationException;
|
||||||
|
import org.gcube.application.cms.tests.TestProfiles;
|
||||||
|
import org.gcube.application.cms.tests.plugins.BasicPluginTest;
|
||||||
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class CatalogueBindingPluginTest extends BasicPluginTest {
|
||||||
|
|
||||||
|
//@Test
|
||||||
|
public void checkPlugin() {
|
||||||
|
org.junit.Assume.assumeTrue(GCubeTest.isTestInfrastructureEnabled());
|
||||||
|
CatalogueBindingPlugin plugin = (CatalogueBindingPlugin) plugins.get(CatalogueBindingPlugin.DESCRIPTOR.getId());
|
||||||
|
|
||||||
|
try {
|
||||||
|
plugin.init();
|
||||||
|
} catch (InitializationException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
plugin.initInContext();
|
||||||
|
} catch (InitializationException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("Plugin check: " + plugin);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void checkPluginConfig() {
|
||||||
|
org.junit.Assume.assumeTrue(GCubeTest.isTestInfrastructureEnabled());
|
||||||
|
CatalogueBindingPlugin plugin = (CatalogueBindingPlugin) plugins.get(CatalogueBindingPlugin.DESCRIPTOR.getId());
|
||||||
|
UseCaseDescriptor descriptor = TestProfiles.profiles.get("profiledConcessioni");
|
||||||
|
|
||||||
|
try {
|
||||||
|
plugin.init();
|
||||||
|
} catch (InitializationException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
plugin.initInContext();
|
||||||
|
} catch (InitializationException e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
EventsSubscribed events;
|
||||||
|
try {
|
||||||
|
events = plugin.readEventsSubscribedFromConfigurationInTheUCD(descriptor);
|
||||||
|
System.out.println("Events: " + events);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
/tokens.properties
|
|
@ -1,6 +1,11 @@
|
||||||
# Changelog for org.gcube.application.cms-plugin-framework
|
# Changelog for org.gcube.application.cms-plugin-framework
|
||||||
|
|
||||||
|
## [v1.0.5-SNAPSHOT] - 2023-12-21
|
||||||
|
|
||||||
|
- Implemented Event Broker [#26321]
|
||||||
|
|
||||||
## [v1.0.4] - 2023-09-06
|
## [v1.0.4] - 2023-09-06
|
||||||
|
|
||||||
- Using parent range version [#25572]
|
- Using parent range version [#25572]
|
||||||
|
|
||||||
## [v1.0.3] - 2023-01-10
|
## [v1.0.3] - 2023-01-10
|
||||||
|
|
|
@ -6,6 +6,9 @@ Basic and abstract implementations are provided in different module default-lc-m
|
||||||
|
|
||||||
Basic providers (e.g. WSProvider, ISProvider) used both in test and by the service are implemented here for simplicity.
|
Basic providers (e.g. WSProvider, ISProvider) used both in test and by the service are implemented here for simplicity.
|
||||||
|
|
||||||
|
Morover, this module provides an `EventManager` to notify the events {`PROJECT_CREATED`, `PROJECT_UPDATED`, `PROJECT_DELETED` `LIFECYCLE_STEP_PERFORMED`}
|
||||||
|
to the plugins that subscribe to them.
|
||||||
|
|
||||||
## Built with
|
## Built with
|
||||||
* [gCube SDI] (https://gcube.wiki.gcube-system.org/gcube/) - The gCube SDI
|
* [gCube SDI] (https://gcube.wiki.gcube-system.org/gcube/) - The gCube SDI
|
||||||
* [gCube SmartGears] (https://gcube.wiki.gcube-system.org/gcube/SmartGears) - The gCube SmartGears framework
|
* [gCube SmartGears] (https://gcube.wiki.gcube-system.org/gcube/SmartGears) - The gCube SmartGears framework
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>cms-plugin-framework</artifactId>
|
<artifactId>cms-plugin-framework</artifactId>
|
||||||
<version>1.0.4</version>
|
<version>1.0.5-SNAPSHOT</version>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.gcube.application.cms</groupId>
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>authorization-utils</artifactId>
|
<artifactId>authorization-utils</artifactId>
|
||||||
<version>[2.0.0, 3.0.0-SNAPSHOT)</version>
|
<version>${authorization-utils-range}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package org.gcube.application.cms.caches;
|
package org.gcube.application.cms.caches;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.implementations.utils.UserUtils;
|
||||||
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
|
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.gcube.application.cms.implementations.utils.UserUtils;
|
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
|
||||||
import org.gcube.application.geoportal.common.utils.ContextUtils;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package org.gcube.application.cms.caches;
|
package org.gcube.application.cms.caches;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@ToString
|
@ToString
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
package org.gcube.application.cms.caches;
|
package org.gcube.application.cms.caches;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.TemporalAmount;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.temporal.TemporalAmount;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.gcube.application.cms.implementations;
|
package org.gcube.application.cms.implementations;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.cms.caches.Engine;
|
import org.gcube.application.cms.caches.Engine;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
||||||
|
@ -7,8 +9,6 @@ import org.gcube.application.geoportal.common.utils.ISUtils;
|
||||||
import org.gcube.common.resources.gcore.GenericResource;
|
import org.gcube.common.resources.gcore.GenericResource;
|
||||||
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DefaultISProvider implements ISInterface, Engine<ISInterface> {
|
public class DefaultISProvider implements ISInterface, Engine<ISInterface> {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package org.gcube.application.cms.implementations;
|
package org.gcube.application.cms.implementations;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
||||||
import org.gcube.common.resources.gcore.GenericResource;
|
import org.gcube.common.resources.gcore.GenericResource;
|
||||||
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface ISInterface {
|
public interface ISInterface {
|
||||||
|
|
||||||
public DatabaseConnection queryForDatabase(String category, String platform,String flagName, String flagValue) throws ConfigurationException;
|
public DatabaseConnection queryForDatabase(String category, String platform,String flagName, String flagValue) throws ConfigurationException;
|
||||||
|
|
|
@ -1,17 +1,18 @@
|
||||||
package org.gcube.application.cms.implementations;
|
package org.gcube.application.cms.implementations;
|
||||||
|
|
||||||
|
|
||||||
import lombok.Synchronized;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.gcube.application.cms.caches.Engine;
|
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
|
||||||
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.caches.Engine;
|
||||||
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
|
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
||||||
|
|
||||||
|
import lombok.Synchronized;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ImplementationProvider {
|
public class ImplementationProvider {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.gcube.application.cms.implementations;
|
package org.gcube.application.cms.implementations;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.implementations.faults.InvalidUserRoleException;
|
import org.gcube.application.cms.implementations.faults.InvalidUserRoleException;
|
||||||
import org.gcube.application.cms.implementations.faults.ProjectNotFoundException;
|
import org.gcube.application.cms.implementations.faults.ProjectNotFoundException;
|
||||||
|
@ -10,8 +12,6 @@ import org.gcube.application.geoportal.common.model.document.relationships.Relat
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface ProjectAccess {
|
public interface ProjectAccess {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.gcube.application.cms.implementations;
|
package org.gcube.application.cms.implementations;
|
||||||
|
|
||||||
import lombok.*;
|
import java.io.InputStream;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.gcube.application.geoportal.common.model.configuration.Archive;
|
import org.gcube.application.geoportal.common.model.configuration.Archive;
|
||||||
import org.gcube.application.geoportal.common.model.document.filesets.RegisteredFile;
|
import org.gcube.application.geoportal.common.model.document.filesets.RegisteredFile;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
|
@ -11,7 +11,13 @@ import org.gcube.common.storagehub.client.dsl.FolderContainer;
|
||||||
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
||||||
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
|
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.Synchronized;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WorkspaceManager {
|
public class WorkspaceManager {
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
package org.gcube.application.cms.implementations.utils;
|
package org.gcube.application.cms.implementations.utils;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import java.time.LocalDateTime;
|
||||||
import lombok.Getter;
|
import java.util.ArrayList;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.AccountingInfo;
|
import org.gcube.application.geoportal.common.model.document.accounting.AccountingInfo;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
||||||
|
@ -11,11 +14,9 @@ import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.common.authorization.utils.manager.SecretManager;
|
import org.gcube.common.authorization.utils.manager.SecretManager;
|
||||||
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
|
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import lombok.AllArgsConstructor;
|
||||||
import java.util.ArrayList;
|
import lombok.Getter;
|
||||||
import java.util.HashSet;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class UserUtils {
|
public class UserUtils {
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package org.gcube.application.cms.plugins;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.plugins.events.ItemObserved;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
|
|
||||||
|
public interface EventListenerPluginInterface extends InitializablePlugin {
|
||||||
|
|
||||||
|
public void doAction(ItemObserved<Project> itemObserved);
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,10 @@
|
||||||
package org.gcube.application.cms.plugins;
|
package org.gcube.application.cms.plugins;
|
||||||
|
|
||||||
import org.gcube.application.cms.plugins.faults.*;
|
import org.gcube.application.cms.plugins.faults.EventException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InsufficientPrivileges;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.InvalidProfileException;
|
||||||
|
import org.gcube.application.cms.plugins.faults.StepException;
|
||||||
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
import org.gcube.application.cms.plugins.reports.EventExecutionReport;
|
||||||
import org.gcube.application.cms.plugins.reports.StepExecutionReport;
|
import org.gcube.application.cms.plugins.reports.StepExecutionReport;
|
||||||
import org.gcube.application.cms.plugins.requests.BaseRequest;
|
import org.gcube.application.cms.plugins.requests.BaseRequest;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package org.gcube.application.cms.plugins;
|
package org.gcube.application.cms.plugins;
|
||||||
|
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
|
|
||||||
public interface PluginManagerInterface {
|
public interface PluginManagerInterface {
|
||||||
|
|
||||||
public Plugin getById(String pluginID) throws ConfigurationException;
|
public Plugin getById(String pluginID) throws ConfigurationException;
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
package org.gcube.application.cms.plugins;
|
package org.gcube.application.cms.plugins;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.reflections.Reflections;
|
|
||||||
import org.reflections.util.ConfigurationBuilder;
|
|
||||||
import org.reflections.util.FilterBuilder;
|
|
||||||
|
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.reflections.Reflections;
|
||||||
|
import org.reflections.util.ConfigurationBuilder;
|
||||||
|
import org.reflections.util.FilterBuilder;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class PluginsReflections {
|
public class PluginsReflections {
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ public class PluginsReflections {
|
||||||
.filterInputsBy(new FilterBuilder().includePackage("org.gcube.application.cms")));
|
.filterInputsBy(new FilterBuilder().includePackage("org.gcube.application.cms")));
|
||||||
|
|
||||||
reflections.getSubTypesOf(Plugin.class).iterator().forEachRemaining(pluginClass->{
|
reflections.getSubTypesOf(Plugin.class).iterator().forEachRemaining(pluginClass->{
|
||||||
log.trace("Evaluating class {}",pluginClass);
|
log.debug("Evaluating class {}",pluginClass);
|
||||||
if(!pluginClass.isInterface() && !Modifier.isAbstract(pluginClass.getModifiers())){
|
if(!pluginClass.isInterface() && !Modifier.isAbstract(pluginClass.getModifiers())){
|
||||||
try {
|
try {
|
||||||
log.debug("Found implementation {} ",pluginClass);
|
log.debug("Found implementation {} ",pluginClass);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
package org.gcube.application.cms.plugins.events;
|
||||||
|
|
||||||
|
public interface EventListener<T extends ItemObservable> {
|
||||||
|
|
||||||
|
public void updated(T observerd);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,132 @@
|
||||||
|
package org.gcube.application.cms.plugins.events;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class EventManager.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Dec 11, 2023
|
||||||
|
*/
|
||||||
|
public class EventManager implements EventManagerInterface<ItemObserved<Project>> {
|
||||||
|
|
||||||
|
private HashMap<Event, List<EventListener<ItemObserved<Project>>>> listeners = new HashMap<Event, List<EventListener<ItemObserved<Project>>>>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class Event.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Nov 29, 2023
|
||||||
|
*/
|
||||||
|
public static enum Event {
|
||||||
|
|
||||||
|
PROJECT_CREATED("PROJECT_CREATED"),
|
||||||
|
PROJECT_UPDATED("PROJECT_UPDATED"),
|
||||||
|
PROJECT_DELETED("PROJECT_DELETED"),
|
||||||
|
LIFECYCLE_STEP_PERFORMED("LIFECYCLE_STEP_PERFORMED");
|
||||||
|
|
||||||
|
String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new event.
|
||||||
|
*
|
||||||
|
* @param name the name
|
||||||
|
*/
|
||||||
|
Event(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the name.
|
||||||
|
*
|
||||||
|
* @return the name
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// private instance, so that it can be
|
||||||
|
// accessed by only by getInstance() method
|
||||||
|
private static EventManager instance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new event manager.
|
||||||
|
*/
|
||||||
|
private EventManager() {
|
||||||
|
// private constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the single instance of EventManager.
|
||||||
|
*
|
||||||
|
* @return single instance of EventManager
|
||||||
|
*/
|
||||||
|
public static EventManager getInstance() {
|
||||||
|
if (instance == null) {
|
||||||
|
// synchronized block to remove overhead
|
||||||
|
synchronized (EventManager.class) {
|
||||||
|
if (instance == null) {
|
||||||
|
// if instance is null, initialize
|
||||||
|
instance = new EventManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Subscribe.
|
||||||
|
*
|
||||||
|
* @param eventType the event type
|
||||||
|
* @param listener the listener
|
||||||
|
*/
|
||||||
|
public void subscribe(Event eventType, EventListener<ItemObserved<Project>> listener) {
|
||||||
|
List<EventListener<ItemObserved<Project>>> list = listeners.get(eventType);
|
||||||
|
if (list == null)
|
||||||
|
list = new ArrayList<EventListener<ItemObserved<Project>>>();
|
||||||
|
|
||||||
|
list.add(listener);
|
||||||
|
listeners.put(eventType, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unsubscribe.
|
||||||
|
*
|
||||||
|
* @param eventType the event type
|
||||||
|
* @param listener the listener
|
||||||
|
*/
|
||||||
|
public void unsubscribe(Event eventType, EventListener<ItemObserved<Project>> listener) {
|
||||||
|
List<EventListener<ItemObserved<Project>>> list = listeners.get(eventType);
|
||||||
|
if (list == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
list.remove(listener);
|
||||||
|
listeners.put(eventType, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notify.
|
||||||
|
*
|
||||||
|
* @param eventType the event type
|
||||||
|
* @param item the item
|
||||||
|
*/
|
||||||
|
public void notify(Event eventType, ItemObserved<Project> item) {
|
||||||
|
for (EventManager.Event event : listeners.keySet()) {
|
||||||
|
if (event.equals(eventType)) {
|
||||||
|
for (EventListener<ItemObserved<Project>> eventListner : listeners.get(eventType)) {
|
||||||
|
eventListner.updated(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package org.gcube.application.cms.plugins.events;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.plugins.events.EventManager.Event;
|
||||||
|
|
||||||
|
public interface EventManagerInterface<T extends ItemObservable> {
|
||||||
|
|
||||||
|
public void subscribe(Event eventType, EventListener<T> listener);
|
||||||
|
|
||||||
|
public void unsubscribe(Event eventType, EventListener<T> listener);
|
||||||
|
|
||||||
|
public void notify(Event eventType, T item);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package org.gcube.application.cms.plugins.events;
|
||||||
|
|
||||||
|
public interface ItemObservable {
|
||||||
|
|
||||||
|
public String getProjectId();
|
||||||
|
|
||||||
|
public String getUCD_Id();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,110 @@
|
||||||
|
package org.gcube.application.cms.plugins.events;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import org.bson.Document;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
||||||
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class ItemObserved<T extends Project> implements ItemObservable {
|
||||||
|
|
||||||
|
private User userCaller;
|
||||||
|
private Context context;
|
||||||
|
private UseCaseDescriptor useCaseDescriptor;
|
||||||
|
private T project;
|
||||||
|
private EventManager.Event event;
|
||||||
|
private Document optional;
|
||||||
|
|
||||||
|
public static enum OPTIONAL_FIELD {
|
||||||
|
message, preview_url
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectId() {
|
||||||
|
log.debug("Called getProjectId");
|
||||||
|
if (project == null)
|
||||||
|
return null;
|
||||||
|
return project.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUCD_Id() {
|
||||||
|
log.debug("Called getUCD_Id");
|
||||||
|
if (useCaseDescriptor == null)
|
||||||
|
return null;
|
||||||
|
return useCaseDescriptor.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinkedHashMap<String, Object> getDocumentEntries(int limit) {
|
||||||
|
|
||||||
|
LinkedHashMap<String, Object> documentAsMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
Iterator<Entry<String, Object>> entrySetsIt = project.getTheDocument().entrySet().iterator();
|
||||||
|
int i = 0;
|
||||||
|
while (entrySetsIt.hasNext()) {
|
||||||
|
if (i + 1 > limit)
|
||||||
|
break;
|
||||||
|
|
||||||
|
Entry<String, Object> entry = entrySetsIt.next();
|
||||||
|
documentAsMap.put(entry.getKey(), entry.getValue() != null ? entry.getValue().toString() : null);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return documentAsMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOptional(OPTIONAL_FIELD optionalField, String value) {
|
||||||
|
this.optional = new Document();
|
||||||
|
if (optional == null)
|
||||||
|
this.optional = new Document();
|
||||||
|
|
||||||
|
this.optional.put(optionalField.name(), value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOptionalValue(OPTIONAL_FIELD optionalField) {
|
||||||
|
if (this.optional != null) {
|
||||||
|
return this.optional.getString(optionalField.name());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("ItemObserved [userCaller=");
|
||||||
|
builder.append(userCaller);
|
||||||
|
builder.append(", context=");
|
||||||
|
builder.append(context);
|
||||||
|
builder.append(", useCaseDescriptor id=");
|
||||||
|
builder.append(useCaseDescriptor != null ? useCaseDescriptor.getId() : null);
|
||||||
|
builder.append(", project id=");
|
||||||
|
builder.append(project != null ? project.getId() : null);
|
||||||
|
builder.append(", event=");
|
||||||
|
builder.append(event);
|
||||||
|
builder.append(", optional=");
|
||||||
|
builder.append(optional);
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,15 @@
|
||||||
package org.gcube.application.cms.plugins.model;
|
package org.gcube.application.cms.plugins.model;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.ArrayDeque;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Deque;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
@ -18,11 +28,11 @@ package org.gcube.application.cms.plugins.model;
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.*;
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import java.math.BigInteger;
|
import lombok.Setter;
|
||||||
import java.util.*;
|
import lombok.ToString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package org.gcube.application.cms.plugins.reports;
|
package org.gcube.application.cms.plugins.reports;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import java.util.ArrayList;
|
||||||
import lombok.Data;
|
import java.util.List;
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
||||||
|
@ -12,8 +11,11 @@ import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
import org.gcube.application.geoportal.common.model.document.identification.IdentificationReference;
|
import org.gcube.application.geoportal.common.model.document.identification.IdentificationReference;
|
||||||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import java.util.List;
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
package org.gcube.application.cms.plugins.reports;
|
package org.gcube.application.cms.plugins.reports;
|
||||||
|
|
||||||
import lombok.ToString;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
||||||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||||
|
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class EventExecutionReport extends DocumentHandlingReport<EventExecutionRequest>{
|
public class EventExecutionReport extends DocumentHandlingReport<EventExecutionRequest>{
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
package org.gcube.application.cms.plugins.reports;
|
package org.gcube.application.cms.plugins.reports;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
|
import org.gcube.application.cms.plugins.requests.IndexDocumentRequest;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
|
||||||
import org.gcube.application.cms.plugins.requests.IndexDocumentRequest;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
package org.gcube.application.cms.plugins.reports;
|
package org.gcube.application.cms.plugins.reports;
|
||||||
|
|
||||||
import lombok.NonNull;
|
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
import org.gcube.application.cms.plugins.requests.MaterializationRequest;
|
import org.gcube.application.cms.plugins.requests.MaterializationRequest;
|
||||||
|
|
||||||
|
import lombok.NonNull;
|
||||||
|
|
||||||
|
|
||||||
public class MaterializationReport extends DocumentHandlingReport<MaterializationRequest>{
|
public class MaterializationReport extends DocumentHandlingReport<MaterializationRequest>{
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
package org.gcube.application.cms.plugins.reports;
|
package org.gcube.application.cms.plugins.reports;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
package org.gcube.application.cms.plugins.reports;
|
package org.gcube.application.cms.plugins.reports;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import java.util.ArrayList;
|
||||||
import lombok.Getter;
|
import java.util.List;
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
||||||
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
||||||
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
|
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import java.util.List;
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
package org.gcube.application.cms.plugins.requests;
|
package org.gcube.application.cms.plugins.requests;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.gcube.application.cms.plugins.requests;
|
package org.gcube.application.cms.plugins.requests;
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
import org.gcube.application.cms.plugins.faults.InvalidPluginRequestException;
|
||||||
import org.gcube.application.cms.serialization.Serialization;
|
import org.gcube.application.cms.serialization.Serialization;
|
||||||
|
@ -8,6 +7,12 @@ import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
package org.gcube.application.cms.plugins.requests;
|
package org.gcube.application.cms.plugins.requests;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
||||||
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
package org.gcube.application.cms.plugins.requests;
|
package org.gcube.application.cms.plugins.requests;
|
||||||
|
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class IndexDocumentRequest extends BaseExecutionRequest{
|
public class IndexDocumentRequest extends BaseExecutionRequest{
|
||||||
public IndexDocumentRequest(@NonNull UseCaseDescriptor useCaseDescriptor, @NonNull User caller, @NonNull Context context, Project document) {
|
public IndexDocumentRequest(@NonNull UseCaseDescriptor useCaseDescriptor, @NonNull User caller, @NonNull Context context, Project document) {
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
package org.gcube.application.cms.plugins.requests;
|
package org.gcube.application.cms.plugins.requests;
|
||||||
|
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class MaterializationRequest extends BaseExecutionRequest{
|
public class MaterializationRequest extends BaseExecutionRequest{
|
||||||
public MaterializationRequest(@NonNull UseCaseDescriptor useCaseDescriptor, @NonNull User caller, @NonNull Context context, Project document) {
|
public MaterializationRequest(@NonNull UseCaseDescriptor useCaseDescriptor, @NonNull User caller, @NonNull Context context, Project document) {
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
package org.gcube.application.cms.plugins.requests;
|
package org.gcube.application.cms.plugins.requests;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
||||||
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.Context;
|
|
||||||
import org.gcube.application.geoportal.common.model.document.accounting.User;
|
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
package org.gcube.application.cms.serialization;
|
package org.gcube.application.cms.serialization;
|
||||||
|
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportal.common.JSONSerializationProvider;
|
||||||
|
|
||||||
import com.jayway.jsonpath.Configuration;
|
import com.jayway.jsonpath.Configuration;
|
||||||
import com.jayway.jsonpath.Option;
|
import com.jayway.jsonpath.Option;
|
||||||
import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
|
import com.jayway.jsonpath.spi.json.JacksonJsonProvider;
|
||||||
import com.jayway.jsonpath.spi.json.JsonProvider;
|
import com.jayway.jsonpath.spi.json.JsonProvider;
|
||||||
import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider;
|
import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider;
|
||||||
import com.jayway.jsonpath.spi.mapper.MappingProvider;
|
import com.jayway.jsonpath.spi.mapper.MappingProvider;
|
||||||
import org.gcube.application.geoportal.common.JSONSerializationProvider;
|
|
||||||
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class JacksonProvider implements JSONSerializationProvider {
|
public class JacksonProvider implements JSONSerializationProvider {
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,30 @@
|
||||||
package org.gcube.application.cms.serialization;
|
package org.gcube.application.cms.serialization;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import java.io.IOException;
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
import java.time.format.DateTimeFormatter;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import java.util.Iterator;
|
||||||
import com.fasterxml.jackson.databind.*;
|
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
||||||
import com.vdurmont.semver4j.Semver;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.bson.types.ObjectId;
|
import org.bson.types.ObjectId;
|
||||||
import org.gcube.application.cms.plugins.model.ComparableVersion;
|
import org.gcube.application.cms.plugins.model.ComparableVersion;
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||||
|
|
||||||
import java.io.IOException;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
import java.time.format.DateTimeFormatter;
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
import java.util.Iterator;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||||
|
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||||
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
|
import com.vdurmont.semver4j.Semver;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class Serialization {
|
public class Serialization {
|
||||||
|
@ -80,6 +88,13 @@ public class Serialization {
|
||||||
return mapper.convertValue(d,clazz);
|
return mapper.convertValue(d,clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final <T> T convertAcceptStringAsNull(Object d,Class<T> clazz){
|
||||||
|
mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,true);
|
||||||
|
T converted = mapper.convertValue(d,clazz);
|
||||||
|
mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT,false);
|
||||||
|
return converted;
|
||||||
|
}
|
||||||
|
|
||||||
public static final Document asDocument(Object obj) throws JsonProcessingException {
|
public static final Document asDocument(Object obj) throws JsonProcessingException {
|
||||||
return Document.parse(mapper.writeValueAsString(obj));
|
return Document.parse(mapper.writeValueAsString(obj));
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.gcube.application.cms</groupId>
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
<artifactId>gcube-cms-suite</artifactId>
|
<artifactId>gcube-cms-suite</artifactId>
|
||||||
<version>1.0.4</version>
|
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,9 +37,9 @@ public class TokenSetter {
|
||||||
|
|
||||||
static{
|
static{
|
||||||
try {
|
try {
|
||||||
props.load(TokenSetter.class.getResourceAsStream("/tokens.properties"));
|
props.load(TokenSetter.class.getResourceAsStream("./tokens.properties"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException("YOU NEED TO SET TOKEN FILE IN CONFIGURATION",e);
|
throw new RuntimeException("YOU NEED TO SET tokens.properties TOKEN FILE IN CONFIGURATION",e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
# Changelog for org.gcube.application.cms.ckan-plugin
|
# Changelog for org.gcube.application.cms.ckan-plugin
|
||||||
|
|
||||||
|
## [v1.3.0-SNAPSHOT]- 2024-03-22
|
||||||
|
- Updated visibility of phases and steps
|
||||||
|
|
||||||
## [v1.2.2]- 2023-09-06
|
## [v1.2.2]- 2023-09-06
|
||||||
- Using parent version range [#25572]
|
- Using parent version range [#25572]
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,15 @@ Plugins SHOULD be defined extending the definitions provided in this module.
|
||||||
## Documentation
|
## Documentation
|
||||||
[gCube CMS Suite](../) parent module containing references, documentation, guides ad utilities.
|
[gCube CMS Suite](../) parent module containing references, documentation, guides ad utilities.
|
||||||
|
|
||||||
|
#### Default Lifecycle Managements
|
||||||
|
|
||||||
|
##### Single Step (no moderation)
|
||||||
|
<img src="https://gcube.wiki.gcube-system.org/images_gcube/8/8c/SingleStep_LC.png" style="max-width:800px;" alt="Default Single Step lifecycle">
|
||||||
|
|
||||||
|
|
||||||
|
##### 3 Phases (content moderation)
|
||||||
|
|
||||||
|
<img src="https://gcube.wiki.gcube-system.org/images_gcube/d/d8/Default3Phases_LC.png" style="max-width:800px;" alt="Default 3 Phases lifecycle">
|
||||||
|
|
||||||
## Change log
|
## Change log
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>default-lc-managers</artifactId>
|
<artifactId>default-lc-managers</artifactId>
|
||||||
<version>1.2.2</version>
|
<version>1.3.0-SNAPSHOT</version>
|
||||||
<name>gCube CMS - Default LC Managers</name>
|
<name>gCube CMS - Default LC Managers</name>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
|
|
@ -132,7 +132,9 @@ public abstract class AbstractLifeCycleManager extends AbstractPlugin implements
|
||||||
request.getUseCaseDescriptor().getId(),
|
request.getUseCaseDescriptor().getId(),
|
||||||
request.getDocument().getId(),
|
request.getDocument().getId(),
|
||||||
request.getStep());
|
request.getStep());
|
||||||
log.debug("Serving Request full log {}",request);
|
log.trace("Serving Request full log {}", request);
|
||||||
|
|
||||||
|
log.debug("Serving Request on document {}", request.getDocument());
|
||||||
|
|
||||||
log.debug("Checking is STEP {} is supported by {}",request.getStep(),DESCRIPTOR.getId());
|
log.debug("Checking is STEP {} is supported by {}",request.getStep(),DESCRIPTOR.getId());
|
||||||
if(!registeredSteps.containsKey(request.getStep()))
|
if(!registeredSteps.containsKey(request.getStep()))
|
||||||
|
|
|
@ -29,7 +29,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class Default3PhaseManager extends SimpleLifeCycleManager implements LifecycleManager {
|
public class Default3PhaseManager extends SimpleLifeCycleManager implements LifecycleManager {
|
||||||
|
|
||||||
protected static class Phases {
|
public static final class Phases {
|
||||||
public static final String PENDING_APPROVAL="Pending Approval";
|
public static final String PENDING_APPROVAL="Pending Approval";
|
||||||
public static final String PUBLISHED=SimpleLifeCycleManager.Phases.PUBLISHED;
|
public static final String PUBLISHED=SimpleLifeCycleManager.Phases.PUBLISHED;
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.gcube.application.geoportal.common.model.plugins.OperationDescriptor;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||||
import org.gcube.application.geoportal.common.utils.Files;
|
import org.gcube.application.geoportal.common.utils.Files;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
@ -49,14 +50,14 @@ public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements
|
||||||
}
|
}
|
||||||
|
|
||||||
//Updated by Francesco
|
//Updated by Francesco
|
||||||
protected static class Phases {
|
public static final class Phases {
|
||||||
public static final String PUBLISHED="Published";
|
public static final String PUBLISHED="Published";
|
||||||
public static final String UNPUBLISHED="UnPublished";
|
public static final String UNPUBLISHED="UnPublished";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Updated by Francesco
|
//Updated by Francesco
|
||||||
private static class Steps {
|
public static final class Steps {
|
||||||
public static final OperationDescriptor PUBLISH = new OperationDescriptor("PUBLISH","Materialize & index project");
|
public static final OperationDescriptor PUBLISH = new OperationDescriptor("PUBLISH","Materialize & index project");
|
||||||
public static final OperationDescriptor UNPUBLISH = new OperationDescriptor("UNPUBLISH","UnPublish the project. DeMaterialize and DeIndex the project");
|
public static final OperationDescriptor UNPUBLISH = new OperationDescriptor("UNPUBLISH","UnPublish the project. DeMaterialize and DeIndex the project");
|
||||||
|
|
||||||
|
@ -187,6 +188,9 @@ public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements
|
||||||
return super.onUpdateDocument(report);
|
return super.onUpdateDocument(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updated by Francesco M.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected EventExecutionReport onDeleteDocument(EventExecutionReport report) throws ConfigurationException, InvalidPluginRequestException, MaterializationException, EventException {
|
protected EventExecutionReport onDeleteDocument(EventExecutionReport report) throws ConfigurationException, InvalidPluginRequestException, MaterializationException, EventException {
|
||||||
// Block non draft only if not force
|
// Block non draft only if not force
|
||||||
|
@ -197,8 +201,17 @@ public class SimpleLifeCycleManager extends AbstractLifeCycleManager implements
|
||||||
JSONPathWrapper wrapper = new JSONPathWrapper(report.getTheRequest().getDocument().getTheDocument().toJson());
|
JSONPathWrapper wrapper = new JSONPathWrapper(report.getTheRequest().getDocument().getTheDocument().toJson());
|
||||||
for (String s : wrapper.getMatchingPaths("$..[?(@." + RegisteredFileSet.PAYLOADS + ")]")){
|
for (String s : wrapper.getMatchingPaths("$..[?(@." + RegisteredFileSet.PAYLOADS + ")]")){
|
||||||
log.info("Requesting dematerialization for {} ",s);
|
log.info("Requesting dematerialization for {} ",s);
|
||||||
for(MaterializationPlugin mat : getMaterializers(report.getTheRequest()))
|
for(MaterializationPlugin mat : getMaterializers(report.getTheRequest())) {
|
||||||
report = deMaterialize(report,mat,new Document("fileSetPath",s));
|
Document params = new Document("fileSetPath",s);
|
||||||
|
Boolean ignoreErrors;
|
||||||
|
try {
|
||||||
|
ignoreErrors = (Boolean) report.getTheRequest().getCallParameters().getOrDefault(InterfaceConstants.Parameters.IGNORE_ERRORS, false);
|
||||||
|
}catch (Exception e) {
|
||||||
|
ignoreErrors = false;
|
||||||
|
}
|
||||||
|
params.append(InterfaceConstants.Parameters.IGNORE_ERRORS, ignoreErrors);
|
||||||
|
report = deMaterialize(report,mat, params);
|
||||||
|
}
|
||||||
if(!report.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK))
|
if(!report.getToSetLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class SimpleLifecycleTests {
|
||||||
// public void testFullCycle(){
|
// public void testFullCycle(){
|
||||||
// SimpleLifeCycleManager manager = plugins.get(SimpleLifeCycleManager.PLUGIN_ID);
|
// SimpleLifeCycleManager manager = plugins.get(SimpleLifeCycleManager.PLUGIN_ID);
|
||||||
//
|
//
|
||||||
// StepExecutionRequest request = new StepExecutionRequest();
|
// PerformStepRequest request = new PerformStepRequest();
|
||||||
//
|
//
|
||||||
// Project p = null;
|
// Project p = null;
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
# Changelog for org.gcube.application.geoportal-client
|
# Changelog for org.gcube.application.geoportal-client
|
||||||
|
|
||||||
|
## [v1.2.2-SNAPSHOT] - 2024-04-11
|
||||||
|
- Refactored
|
||||||
|
|
||||||
## [v1.2.1] - 2023-09-06
|
## [v1.2.1] - 2023-09-06
|
||||||
- Using parent version range [#25572]
|
- Using parent version range [#25572]
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.application</groupId>
|
<groupId>org.gcube.application</groupId>
|
||||||
<artifactId>geoportal-client</artifactId>
|
<artifactId>geoportal-client</artifactId>
|
||||||
<version>1.2.1</version>
|
<version>1.2.2-SNAPSHOT</version>
|
||||||
<name>Geoportal Client</name>
|
<name>Geoportal Client</name>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.gcube.application.geoportal.common.model.rest.CreateRelationshipReque
|
||||||
import org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest;
|
import org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
|
import org.gcube.application.geoportal.common.model.rest.PerformStepRequest;
|
||||||
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||||
import org.gcube.application.geoportal.common.rest.Projects;
|
import org.gcube.application.geoportal.common.rest.Projects;
|
||||||
import org.gcube.common.clients.Call;
|
import org.gcube.common.clients.Call;
|
||||||
|
@ -253,7 +253,7 @@ public class DefaultDocumentsClient<T extends Project> implements Projects<T> {
|
||||||
* @throws RemoteException the remote exception
|
* @throws RemoteException the remote exception
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public T performStep(String id, StepExecutionRequest request) throws RemoteException {
|
public T performStep(String id, PerformStepRequest request) throws RemoteException {
|
||||||
try {
|
try {
|
||||||
log.debug("Executing step on {} (class {}, useCaseDescriptor {}) with request {} ", id, getManagedClass(),
|
log.debug("Executing step on {} (class {}, useCaseDescriptor {}) with request {} ", id, getManagedClass(),
|
||||||
profileID, request);
|
profileID, request);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package org.gcube.application.geoportal;
|
package org.gcube.application.geoportal;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.gcube.application.cms.tests.TokenSetter;
|
import org.gcube.application.cms.tests.TokenSetter;
|
||||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class StorageTests {
|
public class StorageTests {
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package org.gcube.application.geoportal.clients;
|
package org.gcube.application.geoportal.clients;
|
||||||
|
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
import org.gcube.application.cms.tests.TokenSetter;
|
import org.gcube.application.cms.tests.TokenSetter;
|
||||||
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
|
||||||
import static org.junit.Assume.assumeTrue;
|
|
||||||
|
|
||||||
public class BasicVreTests extends GCubeTest {
|
public class BasicVreTests extends GCubeTest {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
package org.gcube.application.geoportal.clients;
|
package org.gcube.application.geoportal.clients;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.projects;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.rmi.RemoteException;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.tests.Tests;
|
import org.gcube.application.cms.tests.Tests;
|
||||||
import org.gcube.application.geoportal.client.utils.Serialization;
|
import org.gcube.application.geoportal.client.utils.Serialization;
|
||||||
|
@ -12,11 +17,7 @@ import org.gcube.application.geoportal.common.utils.FileSets;
|
||||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.rmi.RemoteException;
|
|
||||||
|
|
||||||
import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.projects;
|
|
||||||
|
|
||||||
public abstract class GenericUseCases extends BasicVreTests{
|
public abstract class GenericUseCases extends BasicVreTests{
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,15 @@
|
||||||
package org.gcube.application.geoportal.clients;
|
package org.gcube.application.geoportal.clients;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import static org.junit.Assert.assertEquals;
|
||||||
import lombok.Data;
|
import static org.junit.Assert.assertTrue;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.rmi.RemoteException;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.tests.TestDocuments;
|
import org.gcube.application.cms.tests.TestDocuments;
|
||||||
import org.gcube.application.cms.tests.Tests;
|
import org.gcube.application.cms.tests.Tests;
|
||||||
|
@ -17,7 +24,7 @@ import org.gcube.application.geoportal.common.model.document.relationships.Relat
|
||||||
import org.gcube.application.geoportal.common.model.rest.CreateRelationshipRequest;
|
import org.gcube.application.geoportal.common.model.rest.CreateRelationshipRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest;
|
import org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
|
import org.gcube.application.geoportal.common.model.rest.PerformStepRequest;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.Field;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.Field;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
@ -28,16 +35,10 @@ import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||||
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.rmi.RemoteException;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import lombok.Data;
|
||||||
import static org.junit.Assert.assertTrue;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import static org.junit.Assume.assumeTrue;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ProfiledConcessioniTest <M extends Project,C extends Projects<M>> extends GenericUseCases{
|
public class ProfiledConcessioniTest <M extends Project,C extends Projects<M>> extends GenericUseCases{
|
||||||
|
@ -66,8 +67,8 @@ public class ProfiledConcessioniTest <M extends Project,C extends Projects<M>> e
|
||||||
Project p=client.createNew(getNewDocument());
|
Project p=client.createNew(getNewDocument());
|
||||||
|
|
||||||
p=prepareWithFileSet(p);
|
p=prepareWithFileSet(p);
|
||||||
|
String optionalMessage = null;
|
||||||
p = getClient().performStep(p.getId(), new StepExecutionRequest("SUBMIT-FOR-REVIEW",new Document()));
|
p = getClient().performStep(p.getId(), new PerformStepRequest("SUBMIT-FOR-REVIEW", optionalMessage, new Document()));
|
||||||
System.out.println("Result is "+Serialization.write(p));
|
System.out.println("Result is "+Serialization.write(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
package org.gcube.application.geoportal.clients;
|
package org.gcube.application.geoportal.clients;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import static org.gcube.application.geoportal.client.utils.Serialization.write;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.rmi.RemoteException;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.tests.Tests;
|
|
||||||
import org.gcube.application.geoportal.client.utils.Serialization;
|
import org.gcube.application.geoportal.client.utils.Serialization;
|
||||||
import org.gcube.application.geoportal.common.faults.InvalidRequestException;
|
import org.gcube.application.geoportal.common.faults.InvalidRequestException;
|
||||||
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
||||||
|
@ -12,28 +18,15 @@ import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
import org.gcube.application.geoportal.common.model.document.access.Access;
|
import org.gcube.application.geoportal.common.model.document.access.Access;
|
||||||
import org.gcube.application.geoportal.common.model.document.access.AccessPolicy;
|
import org.gcube.application.geoportal.common.model.document.access.AccessPolicy;
|
||||||
import org.gcube.application.geoportal.common.model.document.filesets.RegisteredFileSet;
|
import org.gcube.application.geoportal.common.model.document.filesets.RegisteredFileSet;
|
||||||
import org.gcube.application.geoportal.common.model.document.relationships.RelationshipNavigationObject;
|
|
||||||
import org.gcube.application.geoportal.common.model.rest.CreateRelationshipRequest;
|
|
||||||
import org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest;
|
|
||||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
||||||
import org.gcube.application.geoportal.common.rest.Projects;
|
import org.gcube.application.geoportal.common.rest.Projects;
|
||||||
import org.gcube.application.geoportal.common.utils.FileSets;
|
|
||||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
|
||||||
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.rmi.RemoteException;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
|
||||||
|
|
||||||
import static org.gcube.application.geoportal.client.utils.Serialization.write;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assume.assumeTrue;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ProfiledDocumentsTest<M extends Project,C extends Projects<M>> extends GenericUseCases {
|
public class ProfiledDocumentsTest<M extends Project,C extends Projects<M>> extends GenericUseCases {
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
package org.gcube.application.geoportal.clients;
|
package org.gcube.application.geoportal.clients;
|
||||||
|
|
||||||
|
import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.useCaseDescriptors;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assume.assumeTrue;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.tests.TokenSetter;
|
import org.gcube.application.cms.tests.TokenSetter;
|
||||||
import org.gcube.application.geoportal.client.utils.Serialization;
|
import org.gcube.application.geoportal.client.utils.Serialization;
|
||||||
|
@ -12,15 +20,6 @@ import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
|
||||||
|
|
||||||
import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.useCaseDescriptors;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assume.assumeTrue;
|
|
||||||
|
|
||||||
public class UCDTests{
|
public class UCDTests{
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
package org.gcube.application.geoportal.clients.serialization;
|
package org.gcube.application.geoportal.clients.serialization;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.gcube.application.geoportal.client.utils.Serialization;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportal.client.utils.Serialization;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SerializationTests {
|
public class SerializationTests {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
package org.gcube.application.geoportal.clients.serialization;
|
package org.gcube.application.geoportal.clients.serialization;
|
||||||
|
|
||||||
|
import static junit.framework.TestCase.assertEquals;
|
||||||
|
import static junit.framework.TestCase.assertTrue;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.application.cms.tests.TestProfiles;
|
import org.gcube.application.cms.tests.TestProfiles;
|
||||||
import org.gcube.application.geoportal.client.utils.Serialization;
|
import org.gcube.application.geoportal.client.utils.Serialization;
|
||||||
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
||||||
|
@ -9,15 +18,6 @@ import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDes
|
||||||
import org.gcube.application.geoportal.common.utils.Files;
|
import org.gcube.application.geoportal.common.utils.Files;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertEquals;
|
|
||||||
import static junit.framework.TestCase.assertTrue;
|
|
||||||
|
|
||||||
public class UseCaseDescriptors {
|
public class UseCaseDescriptors {
|
||||||
|
|
||||||
private static UseCaseDescriptor readProfile(String file) throws IOException {
|
private static UseCaseDescriptor readProfile(String file) throws IOException {
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
# Changelog for org.gcube.application.geoportal-common
|
# Changelog for org.gcube.application.geoportal-common
|
||||||
|
|
||||||
|
## [v1.1.0-SNAPSHOT] - 2024-04-08
|
||||||
|
- Added message to StepExecutionRequest [#27192]
|
||||||
|
|
||||||
## [v1.0.13] - 2023-09-06
|
## [v1.0.13] - 2023-09-06
|
||||||
- Using parent range version [#25572]
|
- Using parent range version [#25572]
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>geoportal-common</artifactId>
|
<artifactId>geoportal-common</artifactId>
|
||||||
<version>1.0.13</version>
|
<version>1.1.0-SNAPSHOT</version>
|
||||||
<name>Geoportal Common</name>
|
<name>Geoportal Common</name>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.application.geoportal.common.model.rest;
|
package org.gcube.application.geoportal.common.model.rest;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
|
@ -12,8 +13,10 @@ import lombok.NoArgsConstructor;
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class StepExecutionRequest {
|
public class PerformStepRequest {
|
||||||
|
|
||||||
private String stepID;
|
private String stepID;
|
||||||
|
@XmlAttribute(required = false)
|
||||||
|
private String message;
|
||||||
private Document options;
|
private Document options;
|
||||||
}
|
}
|
|
@ -13,7 +13,7 @@ import org.gcube.application.geoportal.common.model.rest.CreateRelationshipReque
|
||||||
import org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest;
|
import org.gcube.application.geoportal.common.model.rest.DeleteRelationshipRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
|
import org.gcube.application.geoportal.common.model.rest.PerformStepRequest;
|
||||||
|
|
||||||
public interface Projects<P extends Project> {
|
public interface Projects<P extends Project> {
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public interface Projects<P extends Project> {
|
||||||
public String queryForJSON(QueryRequest request)throws RemoteException;
|
public String queryForJSON(QueryRequest request)throws RemoteException;
|
||||||
|
|
||||||
//Execution
|
//Execution
|
||||||
public P performStep(String id, StepExecutionRequest request) throws RemoteException;
|
public P performStep(String id, PerformStepRequest request) throws RemoteException;
|
||||||
|
|
||||||
//FileSets
|
//FileSets
|
||||||
public P registerFileSet(String id, RegisterFileSetRequest req) throws RemoteException, InvalidRequestException;
|
public P registerFileSet(String id, RegisterFileSetRequest req) throws RemoteException, InvalidRequestException;
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class FilesTests {
|
||||||
|
|
||||||
static File baseFolder=new File("../test-data/concessioni");
|
static File baseFolder=new File("../test-data/concessioni");
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testNames(){
|
public void testNames(){
|
||||||
|
|
||||||
ArrayList<String> toTestStrings=new ArrayList<>(Arrays.asList(baseFolder.list()));
|
ArrayList<String> toTestStrings=new ArrayList<>(Arrays.asList(baseFolder.list()));
|
||||||
|
@ -36,7 +36,7 @@ public class FilesTests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testClustering() throws IOException {
|
public void testClustering() throws IOException {
|
||||||
Map<String, List<File>> map=Files.getAllShapeSet(baseFolder.getParentFile(),true);
|
Map<String, List<File>> map=Files.getAllShapeSet(baseFolder.getParentFile(),true);
|
||||||
map.forEach((k, v)->{
|
map.forEach((k, v)->{
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class StorageUtilsTest {
|
||||||
|
|
||||||
IClient client= null;
|
IClient client= null;
|
||||||
|
|
||||||
@Before
|
//@Before
|
||||||
public void init(){
|
public void init(){
|
||||||
assumeTrue(GCubeTest.isTestInfrastructureEnabled());
|
assumeTrue(GCubeTest.isTestInfrastructureEnabled());
|
||||||
TokenSetter.set(GCubeTest.getContext());
|
TokenSetter.set(GCubeTest.getContext());
|
||||||
|
@ -47,7 +47,7 @@ public class StorageUtilsTest {
|
||||||
return client.getHttpsUrl().RFile(id);
|
return client.getHttpsUrl().RFile(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testParallelStorage() throws FileNotFoundException, InterruptedException {
|
public void testParallelStorage() throws FileNotFoundException, InterruptedException {
|
||||||
assumeTrue(GCubeTest.isTestInfrastructureEnabled());
|
assumeTrue(GCubeTest.isTestInfrastructureEnabled());
|
||||||
ExecutorService service = Executors.newFixedThreadPool(10);
|
ExecutorService service = Executors.newFixedThreadPool(10);
|
||||||
|
@ -81,7 +81,7 @@ public class StorageUtilsTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testSerialStorage() throws FileNotFoundException {
|
public void testSerialStorage() throws FileNotFoundException {
|
||||||
assumeTrue(GCubeTest.isTestInfrastructureEnabled());
|
assumeTrue(GCubeTest.isTestInfrastructureEnabled());
|
||||||
//get client
|
//get client
|
||||||
|
|
|
@ -11,14 +11,14 @@ import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
public class DefaultsTests {
|
public class DefaultsTests {
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void checkConstraints(){
|
public void checkConstraints(){
|
||||||
assertEquals(AccessPolicy.OPEN,ConstraintCheck.defaultFor(null,AccessPolicy.OPEN).evaluate());
|
assertEquals(AccessPolicy.OPEN,ConstraintCheck.defaultFor(null,AccessPolicy.OPEN).evaluate());
|
||||||
assertEquals(AccessPolicy.EMBARGOED,ConstraintCheck.defaultFor(AccessPolicy.EMBARGOED,AccessPolicy.OPEN).evaluate());
|
assertEquals(AccessPolicy.EMBARGOED,ConstraintCheck.defaultFor(AccessPolicy.EMBARGOED,AccessPolicy.OPEN).evaluate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void checkDefaults(){
|
public void checkDefaults(){
|
||||||
|
|
||||||
Concessione c= new Concessione();
|
Concessione c= new Concessione();
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class JSONPathTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void readElements() throws IOException {
|
public void readElements() throws IOException {
|
||||||
JSONPathWrapper documentNavigator=getNavigator("profiledConcessioniExample.json");
|
JSONPathWrapper documentNavigator=getNavigator("profiledConcessioniExample.json");
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public class JSONPathTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void writeTest() throws IOException {
|
public void writeTest() throws IOException {
|
||||||
JSONPathWrapper wrapper =getNavigator("emptyProfiledDocument.json");
|
JSONPathWrapper wrapper =getNavigator("emptyProfiledDocument.json");
|
||||||
checkSetValue(wrapper,"firstField","value1");
|
checkSetValue(wrapper,"firstField","value1");
|
||||||
|
@ -112,7 +112,7 @@ public class JSONPathTests {
|
||||||
assertTrue(foundElements.size()==sizeBefore+1);
|
assertTrue(foundElements.size()==sizeBefore+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testTokenizer(){
|
public void testTokenizer(){
|
||||||
assertTrue(JSONPathWrapper.tokenizePath("$.firstField").size()==1);
|
assertTrue(JSONPathWrapper.tokenizePath("$.firstField").size()==1);
|
||||||
assertTrue(JSONPathWrapper.tokenizePath("$.firstField.child").size()==2);
|
assertTrue(JSONPathWrapper.tokenizePath("$.firstField.child").size()==2);
|
||||||
|
@ -129,7 +129,7 @@ public class JSONPathTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testGetFieldNameFromPathElement(){
|
public void testGetFieldNameFromPathElement(){
|
||||||
assertEquals(JSONPathWrapper.extractFieldNameFromPathElement("$.firstField"),"firstField");
|
assertEquals(JSONPathWrapper.extractFieldNameFromPathElement("$.firstField"),"firstField");
|
||||||
assertEquals(JSONPathWrapper.extractFieldNameFromPathElement("firstField"),"firstField");
|
assertEquals(JSONPathWrapper.extractFieldNameFromPathElement("firstField"),"firstField");
|
||||||
|
@ -137,7 +137,7 @@ public class JSONPathTests {
|
||||||
assertEquals(JSONPathWrapper.extractFieldNameFromPathElement("$['book'][?(@.isbn)]"),"book");
|
assertEquals(JSONPathWrapper.extractFieldNameFromPathElement("$['book'][?(@.isbn)]"),"book");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
//@Test
|
||||||
public void testDefinitePath(){
|
public void testDefinitePath(){
|
||||||
assertTrue(JsonPath.isPathDefinite("$.firstField"));
|
assertTrue(JsonPath.isPathDefinite("$.firstField"));
|
||||||
assertTrue(JsonPath.isPathDefinite("$.firstField.child"));
|
assertTrue(JsonPath.isPathDefinite("$.firstField.child"));
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
# Changelog for org.gcube.application.geoportal-service
|
# Changelog for org.gcube.application.geoportal-service
|
||||||
|
|
||||||
|
## [v1.2.0-SNAPSHOT] - 2024-04-08
|
||||||
|
|
||||||
|
- Integrated the EventManager of the cms-plugin-framework [#26321]
|
||||||
|
- Added optional message when performing lifecycle step [#27192]
|
||||||
|
- Rewritten calledMethod to allow aggregation [#26707]
|
||||||
|
|
||||||
## [v1.1.1] - 2023-09-06
|
## [v1.1.1] - 2023-09-06
|
||||||
|
|
||||||
- Fixed data accounting issue [#25571]
|
- Fixed data accounting issue [#25571]
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.application</groupId>
|
<groupId>org.gcube.application</groupId>
|
||||||
<artifactId>geoportal-service</artifactId>
|
<artifactId>geoportal-service</artifactId>
|
||||||
<version>1.1.1</version>
|
<version>1.2.0-SNAPSHOT</version>
|
||||||
<name>Geoportal Service</name>
|
<name>Geoportal Service</name>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package org.gcube.application.geoportal.service.accounting;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.provider.CalledMethodProvider;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
public class CalledMethodHandler {
|
||||||
|
|
||||||
|
private final static Logger logger = LoggerFactory.getLogger(CalledMethodHandler.class);
|
||||||
|
|
||||||
|
public static void setCalledMethod(String method) {
|
||||||
|
logger.debug("setCalledMethod as {}", method);
|
||||||
|
CalledMethodProvider.instance.set(method);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String buildCalledResource(String httpMethod, String path) {
|
||||||
|
if(!path.startsWith("/"))
|
||||||
|
path = "/"+path;
|
||||||
|
|
||||||
|
return String.format("%s %s", httpMethod.toString(), path);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -141,6 +141,7 @@ public interface MongoManagerI<T> {
|
||||||
*
|
*
|
||||||
* @param id the id
|
* @param id the id
|
||||||
* @param force the force
|
* @param force the force
|
||||||
|
* @param ignoreErrors the ignore errors
|
||||||
* @throws DeletionException the deletion exception
|
* @throws DeletionException the deletion exception
|
||||||
* @throws InvalidUserRoleException the invalid user role exception
|
* @throws InvalidUserRoleException the invalid user role exception
|
||||||
* @throws ProjectLockedException the project locked exception
|
* @throws ProjectLockedException the project locked exception
|
||||||
|
@ -149,7 +150,7 @@ public interface MongoManagerI<T> {
|
||||||
* @throws JsonProcessingException the json processing exception
|
* @throws JsonProcessingException the json processing exception
|
||||||
* @throws InvalidLockException the invalid lock exception
|
* @throws InvalidLockException the invalid lock exception
|
||||||
*/
|
*/
|
||||||
public void delete(String id, boolean force)
|
public void delete(String id, boolean force, Boolean ignoreErrors)
|
||||||
throws DeletionException, InvalidUserRoleException, ProjectLockedException, ProjectNotFoundException,
|
throws DeletionException, InvalidUserRoleException, ProjectLockedException, ProjectNotFoundException,
|
||||||
UnauthorizedAccess, JsonProcessingException, InvalidLockException;
|
UnauthorizedAccess, JsonProcessingException, InvalidLockException;
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ import org.gcube.application.geoportal.common.model.useCaseDescriptor.Field;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.RelationshipDefinition;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.RelationshipDefinition;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
|
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||||
import org.gcube.application.geoportal.service.engine.providers.PluginManager;
|
import org.gcube.application.geoportal.service.engine.providers.PluginManager;
|
||||||
import org.gcube.common.storagehub.client.dsl.FolderContainer;
|
import org.gcube.common.storagehub.client.dsl.FolderContainer;
|
||||||
|
@ -704,6 +705,7 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
|
||||||
*
|
*
|
||||||
* @param id the id
|
* @param id the id
|
||||||
* @param force the force
|
* @param force the force
|
||||||
|
* @param ignoreErrors the ignore errors
|
||||||
* @throws DeletionException the deletion exception
|
* @throws DeletionException the deletion exception
|
||||||
* @throws InvalidUserRoleException the invalid user role exception
|
* @throws InvalidUserRoleException the invalid user role exception
|
||||||
* @throws ProjectLockedException the project locked exception
|
* @throws ProjectLockedException the project locked exception
|
||||||
|
@ -711,12 +713,14 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
|
||||||
* @throws UnauthorizedAccess the unauthorized access
|
* @throws UnauthorizedAccess the unauthorized access
|
||||||
* @throws JsonProcessingException the json processing exception
|
* @throws JsonProcessingException the json processing exception
|
||||||
* @throws InvalidLockException the invalid lock exception
|
* @throws InvalidLockException the invalid lock exception
|
||||||
|
*
|
||||||
|
* Updated by Francesco Mangiacrapa
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void delete(String id, boolean force)
|
public void delete(String id, boolean force, Boolean ignoreErrors)
|
||||||
throws DeletionException, InvalidUserRoleException, ProjectLockedException, ProjectNotFoundException,
|
throws DeletionException, InvalidUserRoleException, ProjectLockedException, ProjectNotFoundException,
|
||||||
UnauthorizedAccess, JsonProcessingException, InvalidLockException {
|
UnauthorizedAccess, JsonProcessingException, InvalidLockException {
|
||||||
log.info("Deleting by ID {}, force {}", id, force);
|
log.info("Deleting by ID {}, force {} ignoreErrors {}", id, force, ignoreErrors);
|
||||||
Project doc = lock(id, "Deletion { force : " + force + "}");
|
Project doc = lock(id, "Deletion { force : " + force + "}");
|
||||||
boolean deleted = false;
|
boolean deleted = false;
|
||||||
try {
|
try {
|
||||||
|
@ -728,7 +732,10 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
|
||||||
if (!policy.canWrite(doc, u))
|
if (!policy.canWrite(doc, u))
|
||||||
throw new UnauthorizedAccess("No edit rights on project " + id);
|
throw new UnauthorizedAccess("No edit rights on project " + id);
|
||||||
|
|
||||||
doc = triggerEvent(doc, EventExecutionRequest.Events.ON_DELETE_DOCUMENT, new Document("force", force));
|
Document parameters = new Document();
|
||||||
|
parameters.append(InterfaceConstants.Parameters.FORCE, force);
|
||||||
|
parameters.append(InterfaceConstants.Parameters.IGNORE_ERRORS, ignoreErrors);
|
||||||
|
doc = triggerEvent(doc, EventExecutionRequest.Events.ON_DELETE_DOCUMENT, parameters);
|
||||||
// Only continue deleting if event was ok
|
// Only continue deleting if event was ok
|
||||||
if (doc.getLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK)) {
|
if (doc.getLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK)) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
import javax.ws.rs.DefaultValue;
|
import javax.ws.rs.DefaultValue;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.HttpMethod;
|
||||||
import javax.ws.rs.POST;
|
import javax.ws.rs.POST;
|
||||||
import javax.ws.rs.PUT;
|
import javax.ws.rs.PUT;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
|
@ -15,20 +16,30 @@ import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||||
|
import org.gcube.application.cms.implementations.utils.UserUtils;
|
||||||
|
import org.gcube.application.cms.plugins.events.EventManager;
|
||||||
|
import org.gcube.application.cms.plugins.events.EventManager.Event;
|
||||||
|
import org.gcube.application.cms.plugins.events.ItemObserved;
|
||||||
|
import org.gcube.application.cms.plugins.events.ItemObserved.OPTIONAL_FIELD;
|
||||||
import org.gcube.application.cms.serialization.Serialization;
|
import org.gcube.application.cms.serialization.Serialization;
|
||||||
import org.gcube.application.geoportal.common.model.configuration.Configuration;
|
import org.gcube.application.geoportal.common.model.configuration.Configuration;
|
||||||
import org.gcube.application.geoportal.common.model.document.Project;
|
import org.gcube.application.geoportal.common.model.document.Project;
|
||||||
import org.gcube.application.geoportal.common.model.document.access.Access;
|
import org.gcube.application.geoportal.common.model.document.access.Access;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.accounting.AccountingInfo;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||||
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation.Status;
|
||||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||||
|
import org.gcube.application.geoportal.common.model.rest.PerformStepRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
|
|
||||||
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||||
|
import org.gcube.application.geoportal.service.accounting.CalledMethodHandler;
|
||||||
import org.gcube.application.geoportal.service.engine.mongo.ProfiledMongoManager;
|
import org.gcube.application.geoportal.service.engine.mongo.ProfiledMongoManager;
|
||||||
import org.gcube.application.geoportal.service.engine.providers.ConfigurationCache;
|
import org.gcube.application.geoportal.service.engine.providers.ConfigurationCache;
|
||||||
import org.gcube.application.geoportal.service.engine.providers.ProjectAccessImpl;
|
import org.gcube.application.geoportal.service.engine.providers.ProjectAccessImpl;
|
||||||
import org.gcube.application.geoportal.service.http.PATCH;
|
import org.gcube.application.geoportal.service.http.PATCH;
|
||||||
|
|
||||||
|
import com.webcohesion.enunciate.metadata.Ignore;
|
||||||
import com.webcohesion.enunciate.metadata.rs.RequestHeader;
|
import com.webcohesion.enunciate.metadata.rs.RequestHeader;
|
||||||
import com.webcohesion.enunciate.metadata.rs.RequestHeaders;
|
import com.webcohesion.enunciate.metadata.rs.RequestHeaders;
|
||||||
|
|
||||||
|
@ -38,8 +49,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
* The Class ProfiledDocuments.
|
* The Class ProfiledDocuments.
|
||||||
*
|
*
|
||||||
* @author created by Fabio Sinibaldi
|
* @author created by Fabio Sinibaldi
|
||||||
* @author new manager/developer and mantainer - Francesco Mangiacrapa at ISTI-CNR
|
* @author new manager/developer and mantainer - Francesco Mangiacrapa at
|
||||||
* francesco.mangiacrapa@isti.cnr.it
|
* ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
*
|
*
|
||||||
* Apr 18, 2023
|
* Apr 18, 2023
|
||||||
*/
|
*/
|
||||||
|
@ -50,7 +61,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
@RequestHeader(name = "Content-Type", description = "application/json") })
|
@RequestHeader(name = "Content-Type", description = "application/json") })
|
||||||
public class ProfiledDocuments {
|
public class ProfiledDocuments {
|
||||||
|
|
||||||
|
public static final String HIDDEN_PATH = "hidden";
|
||||||
private ProfiledMongoManager manager;
|
private ProfiledMongoManager manager;
|
||||||
|
private EventManager eventManager = EventManager.getInstance(); // as singleton
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new profiled documents.
|
* Instantiates a new profiled documents.
|
||||||
|
@ -79,6 +92,11 @@ public class ProfiledDocuments {
|
||||||
@Path(InterfaceConstants.Methods.CONFIGURATION_PATH)
|
@Path(InterfaceConstants.Methods.CONFIGURATION_PATH)
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Configuration getConfiguration(@PathParam(InterfaceConstants.Parameters.UCID) String profileID) {
|
public Configuration getConfiguration(@PathParam(InterfaceConstants.Parameters.UCID) String profileID) {
|
||||||
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.GET,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + profileID);
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/"+InterfaceConstants.Methods.CONFIGURATION_PATH);
|
||||||
|
|
||||||
return new GuardedMethod<Configuration>() {
|
return new GuardedMethod<Configuration>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -99,7 +117,12 @@ public class ProfiledDocuments {
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Project createNew(Document d) {
|
public Project createNew(Document d) {
|
||||||
return new GuardedMethod<Project>() {
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.POST,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/createNew");
|
||||||
|
|
||||||
|
Project theNewProject = new GuardedMethod<Project>() {
|
||||||
@Override
|
@Override
|
||||||
protected Project run() throws Exception, WebApplicationException {
|
protected Project run() throws Exception, WebApplicationException {
|
||||||
log.info("Creating new Project ({})", manager.getUseCaseDescriptor().getId());
|
log.info("Creating new Project ({})", manager.getUseCaseDescriptor().getId());
|
||||||
|
@ -108,6 +131,25 @@ public class ProfiledDocuments {
|
||||||
return toReturn;
|
return toReturn;
|
||||||
}
|
}
|
||||||
}.execute().getResult();
|
}.execute().getResult();
|
||||||
|
|
||||||
|
Status status = theNewProject.getLifecycleInformation().getLastOperationStatus();
|
||||||
|
// If latest operation status is not ERROR, notify PROJECT_CREATED event
|
||||||
|
if (status != null && !status.equals(LifecycleInformation.Status.ERROR)) {
|
||||||
|
// notifying the Event.PROJECT_CREATED;
|
||||||
|
ItemObserved<Project> item = new ItemObserved<Project>();
|
||||||
|
EventManager.Event event = Event.PROJECT_CREATED;
|
||||||
|
AccountingInfo user = UserUtils.getCurrent().asInfo();
|
||||||
|
item.setUserCaller(user.getUser());
|
||||||
|
item.setContext(user.getContext());
|
||||||
|
item.setOptional(null);
|
||||||
|
item.setEvent(event);
|
||||||
|
item.setProject(theNewProject);
|
||||||
|
item.setUseCaseDescriptor(manager.getUseCaseDescriptor());
|
||||||
|
log.info("By notifying event ({}, ID {})", event, item.getProjectId());
|
||||||
|
eventManager.notify(event, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return theNewProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -122,13 +164,37 @@ public class ProfiledDocuments {
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Project update(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String documentId, Document d) {
|
public Project update(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String documentId, Document d) {
|
||||||
return new GuardedMethod<Project>() {
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.PUT,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}");
|
||||||
|
|
||||||
|
Project theUpdatedProject = new GuardedMethod<Project>() {
|
||||||
@Override
|
@Override
|
||||||
protected Project run() throws Exception, WebApplicationException {
|
protected Project run() throws Exception, WebApplicationException {
|
||||||
log.info("Updating Project ({}, ID {})", manager.getUseCaseDescriptor().getId(), documentId);
|
log.info("Updating Project ({}, ID {})", manager.getUseCaseDescriptor().getId(), documentId);
|
||||||
return manager.update(documentId, d);
|
return manager.update(documentId, d);
|
||||||
}
|
}
|
||||||
}.execute().getResult();
|
}.execute().getResult();
|
||||||
|
|
||||||
|
Status status = theUpdatedProject.getLifecycleInformation().getLastOperationStatus();
|
||||||
|
// If latest operation status is not ERROR, notify PROJECT_UPDATED event
|
||||||
|
if (status != null && !status.equals(LifecycleInformation.Status.ERROR)) {
|
||||||
|
|
||||||
|
ItemObserved<Project> item = new ItemObserved<Project>();
|
||||||
|
EventManager.Event event = Event.PROJECT_UPDATED;
|
||||||
|
AccountingInfo user = UserUtils.getCurrent().asInfo();
|
||||||
|
item.setUserCaller(user.getUser());
|
||||||
|
item.setContext(user.getContext());
|
||||||
|
item.setOptional(null);
|
||||||
|
item.setEvent(event);
|
||||||
|
item.setProject(theUpdatedProject);
|
||||||
|
item.setUseCaseDescriptor(manager.getUseCaseDescriptor());
|
||||||
|
log.info("By notifying event ({}, ID {})", event, item.getProjectId());
|
||||||
|
eventManager.notify(event, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return theUpdatedProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -143,6 +209,11 @@ public class ProfiledDocuments {
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Project patch(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String documentId, Document d) {
|
public Project patch(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String documentId, Document d) {
|
||||||
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource("PATCH",
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}");
|
||||||
|
|
||||||
return new GuardedMethod<Project>() {
|
return new GuardedMethod<Project>() {
|
||||||
@Override
|
@Override
|
||||||
protected Project run() throws Exception, WebApplicationException {
|
protected Project run() throws Exception, WebApplicationException {
|
||||||
|
@ -159,21 +230,67 @@ public class ProfiledDocuments {
|
||||||
* @param id the id
|
* @param id the id
|
||||||
* @param force the force
|
* @param force the force
|
||||||
* @return the boolean
|
* @return the boolean
|
||||||
|
*
|
||||||
|
* Added by Francesco M.
|
||||||
*/
|
*/
|
||||||
@DELETE
|
@DELETE
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
@Path("{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
||||||
public Boolean delete(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
public Boolean delete(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
||||||
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force) {
|
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force) {
|
||||||
return new GuardedMethod<Boolean>() {
|
return delete(id, force, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete.
|
||||||
|
*
|
||||||
|
* @param id the id
|
||||||
|
* @param force the force
|
||||||
|
* @return the boolean
|
||||||
|
*
|
||||||
|
* @Ignore means excluded by API doc
|
||||||
|
* Updated by Francesco M.
|
||||||
|
*/
|
||||||
|
@DELETE
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@Path("{" + InterfaceConstants.Parameters.PROJECT_ID + "}"+"/"+HIDDEN_PATH)
|
||||||
|
@Ignore
|
||||||
|
public Boolean delete(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
||||||
|
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force, @QueryParam(InterfaceConstants.Parameters.IGNORE_ERRORS) Boolean ignoreErrors) {
|
||||||
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.DELETE,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}");
|
||||||
|
|
||||||
|
Boolean deleted = new GuardedMethod<Boolean>() {
|
||||||
@Override
|
@Override
|
||||||
protected Boolean run() throws Exception, WebApplicationException {
|
protected Boolean run() throws Exception, WebApplicationException {
|
||||||
log.info("Deleting Project ({}, ID {}). Force is {}", manager.getUseCaseDescriptor().getId(), id,
|
log.info("Deleting Project ({}, ID {}). Force is {}, Ignore_Errors is {}", manager.getUseCaseDescriptor().getId(), id,
|
||||||
force);
|
force, ignoreErrors);
|
||||||
manager.delete(id, force);
|
manager.delete(id, force, ignoreErrors);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}.execute().getResult();
|
}.execute().getResult();
|
||||||
|
|
||||||
|
// If deleted, notify PROJECT_DELETED event
|
||||||
|
if (deleted) {
|
||||||
|
ItemObserved<Project> item = new ItemObserved<Project>();
|
||||||
|
EventManager.Event event = Event.PROJECT_DELETED;
|
||||||
|
AccountingInfo user = UserUtils.getCurrent().asInfo();
|
||||||
|
item.setUserCaller(user.getUser());
|
||||||
|
item.setContext(user.getContext());
|
||||||
|
item.setEvent(event);
|
||||||
|
item.setUseCaseDescriptor(manager.getUseCaseDescriptor());
|
||||||
|
// Referencing delete project
|
||||||
|
Project deletedProject = new Project();
|
||||||
|
deletedProject.setId(id);
|
||||||
|
deletedProject.setProfileID(manager.getUseCaseDescriptor().getId());
|
||||||
|
item.setProject(deletedProject);
|
||||||
|
log.info("By notifying event ({}, ID {})", event, item.getProjectId());
|
||||||
|
eventManager.notify(event, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -189,6 +306,12 @@ public class ProfiledDocuments {
|
||||||
@Path("/" + InterfaceConstants.Methods.REGISTER_FILES_PATH + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
@Path("/" + InterfaceConstants.Methods.REGISTER_FILES_PATH + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
||||||
public Project registerFileSet(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
public Project registerFileSet(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
||||||
RegisterFileSetRequest request) {
|
RegisterFileSetRequest request) {
|
||||||
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.POST,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/" + InterfaceConstants.Methods.REGISTER_FILES_PATH + "/{"
|
||||||
|
+ InterfaceConstants.Parameters.PROJECT_ID + "}");
|
||||||
|
|
||||||
return new GuardedMethod<Project>() {
|
return new GuardedMethod<Project>() {
|
||||||
@Override
|
@Override
|
||||||
protected Project run() throws Exception, WebApplicationException {
|
protected Project run() throws Exception, WebApplicationException {
|
||||||
|
@ -200,6 +323,7 @@ public class ProfiledDocuments {
|
||||||
}.execute().getResult();
|
}.execute().getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete file set. the Authorization must be a VRE token
|
* Delete file set. the Authorization must be a VRE token
|
||||||
*
|
*
|
||||||
|
@ -207,6 +331,8 @@ public class ProfiledDocuments {
|
||||||
* @param force the force
|
* @param force the force
|
||||||
* @param path the path must be passed as text in the body
|
* @param path the path must be passed as text in the body
|
||||||
* @return the project
|
* @return the project
|
||||||
|
*
|
||||||
|
* Added by Francesco M
|
||||||
*/
|
*/
|
||||||
@RequestHeaders({
|
@RequestHeaders({
|
||||||
@RequestHeader(name = "Authorization", description = "VRE Bearer token, see https://dev.d4science.org/how-to-access-resources"),
|
@RequestHeader(name = "Authorization", description = "VRE Bearer token, see https://dev.d4science.org/how-to-access-resources"),
|
||||||
|
@ -217,7 +343,40 @@ public class ProfiledDocuments {
|
||||||
@Path("/" + InterfaceConstants.Methods.DELETE_FILES_PATH + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
@Path("/" + InterfaceConstants.Methods.DELETE_FILES_PATH + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
||||||
public Project deleteFileSet(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
public Project deleteFileSet(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
||||||
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force,
|
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force,
|
||||||
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.IGNORE_ERRORS) Boolean ignore_errors, String path) {
|
String path) {
|
||||||
|
return deleteFileSet(id, force, false, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete file set. the Authorization must be a VRE token
|
||||||
|
*
|
||||||
|
* @param id the id
|
||||||
|
* @param force the force
|
||||||
|
* @param path the path must be passed as text in the body
|
||||||
|
* @return the project
|
||||||
|
*
|
||||||
|
* @Ignore means that is excluded by API doc
|
||||||
|
* Updated by Francesco M.
|
||||||
|
*/
|
||||||
|
@RequestHeaders({
|
||||||
|
@RequestHeader(name = "Authorization", description = "VRE Bearer token, see https://dev.d4science.org/how-to-access-resources"),
|
||||||
|
@RequestHeader(name = "Content-Type", description = "application/json") })
|
||||||
|
@POST
|
||||||
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
@Path("/" + InterfaceConstants.Methods.DELETE_FILES_PATH +"/"+HIDDEN_PATH+"/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
||||||
|
@Ignore
|
||||||
|
public Project deleteFileSet(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
||||||
|
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force,
|
||||||
|
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.IGNORE_ERRORS) Boolean ignore_errors,
|
||||||
|
String path) {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.POST,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(pathCalledResource + "/" + InterfaceConstants.Methods.DELETE_FILES_PATH
|
||||||
|
+ "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}");
|
||||||
|
|
||||||
return new GuardedMethod<Project>() {
|
return new GuardedMethod<Project>() {
|
||||||
@Override
|
@Override
|
||||||
protected Project run() throws Exception, WebApplicationException {
|
protected Project run() throws Exception, WebApplicationException {
|
||||||
|
@ -240,15 +399,40 @@ public class ProfiledDocuments {
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("/" + InterfaceConstants.Methods.STEP + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
@Path("/" + InterfaceConstants.Methods.STEP + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
||||||
public Project performStep(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
public Project performStep(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
||||||
StepExecutionRequest request) {
|
PerformStepRequest performStepRequest) {
|
||||||
return new GuardedMethod<Project>() {
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.POST,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(pathCalledResource + "/" + InterfaceConstants.Methods.STEP + "/{"
|
||||||
|
+ InterfaceConstants.Parameters.PROJECT_ID + "}");
|
||||||
|
|
||||||
|
Project theProject = new GuardedMethod<Project>() {
|
||||||
@Override
|
@Override
|
||||||
protected Project run() throws Exception, WebApplicationException {
|
protected Project run() throws Exception, WebApplicationException {
|
||||||
log.info("Executing step {} on Project ({},ID,{}) with options {}", request.getStepID(),
|
log.info("Executing step {} on Project ({},ID,{}) with options {}", performStepRequest.getStepID(),
|
||||||
manager.getUseCaseDescriptor().getId(), id, request.getOptions());
|
manager.getUseCaseDescriptor().getId(), id, performStepRequest.getOptions());
|
||||||
return manager.performStep(id, request.getStepID(), request.getOptions());
|
return manager.performStep(id, performStepRequest.getStepID(), performStepRequest.getOptions());
|
||||||
}
|
}
|
||||||
}.execute().getResult();
|
}.execute().getResult();
|
||||||
|
|
||||||
|
Status status = theProject.getLifecycleInformation().getLastOperationStatus();
|
||||||
|
// If latest operation status is not ERROR, notify LIFECYCLE_STEP_PERFORMED
|
||||||
|
// event
|
||||||
|
if (status != null && !status.equals(LifecycleInformation.Status.ERROR)) {
|
||||||
|
ItemObserved<Project> item = new ItemObserved<Project>();
|
||||||
|
EventManager.Event event = Event.LIFECYCLE_STEP_PERFORMED;
|
||||||
|
AccountingInfo user = UserUtils.getCurrent().asInfo();
|
||||||
|
item.setUserCaller(user.getUser());
|
||||||
|
item.setContext(user.getContext());
|
||||||
|
item.setEvent(event);
|
||||||
|
item.setOptional(OPTIONAL_FIELD.message, performStepRequest.getMessage());
|
||||||
|
item.setUseCaseDescriptor(manager.getUseCaseDescriptor());
|
||||||
|
item.setProject(theProject);
|
||||||
|
log.info("By notifying event ({}, ID {})", event, item.getProjectId());
|
||||||
|
eventManager.notify(event, item);
|
||||||
|
}
|
||||||
|
|
||||||
|
return theProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -262,6 +446,12 @@ public class ProfiledDocuments {
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("/" + InterfaceConstants.Methods.FORCE_UNLOCK + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
@Path("/" + InterfaceConstants.Methods.FORCE_UNLOCK + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
||||||
public Project forceUnlock(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id) {
|
public Project forceUnlock(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id) {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.PUT,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(pathCalledResource + "/" + InterfaceConstants.Methods.FORCE_UNLOCK + "/{"
|
||||||
|
+ InterfaceConstants.Parameters.PROJECT_ID + "}");
|
||||||
|
|
||||||
return new GuardedMethod<Project>() {
|
return new GuardedMethod<Project>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -285,6 +475,13 @@ public class ProfiledDocuments {
|
||||||
@Path("/" + InterfaceConstants.Methods.SET_PROJECT_ACCESS_POLICY + "/{" + InterfaceConstants.Parameters.PROJECT_ID
|
@Path("/" + InterfaceConstants.Methods.SET_PROJECT_ACCESS_POLICY + "/{" + InterfaceConstants.Parameters.PROJECT_ID
|
||||||
+ "}")
|
+ "}")
|
||||||
public Project setAccessPolicy(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id, Access toSet) {
|
public Project setAccessPolicy(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id, Access toSet) {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.PUT,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler
|
||||||
|
.setCalledMethod(pathCalledResource + "/" + InterfaceConstants.Methods.SET_PROJECT_ACCESS_POLICY + "/{"
|
||||||
|
+ InterfaceConstants.Parameters.PROJECT_ID + "}");
|
||||||
|
|
||||||
return new GuardedMethod<Project>() {
|
return new GuardedMethod<Project>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -305,6 +502,11 @@ public class ProfiledDocuments {
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public Iterable<?> list() {
|
public Iterable<?> list() {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.GET,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(pathCalledResource);
|
||||||
|
|
||||||
return new GuardedMethod<Iterable<?>>() {
|
return new GuardedMethod<Iterable<?>>() {
|
||||||
protected Iterable<?> run() throws Exception, WebApplicationException {
|
protected Iterable<?> run() throws Exception, WebApplicationException {
|
||||||
return manager.query(new QueryRequest());
|
return manager.query(new QueryRequest());
|
||||||
|
@ -323,6 +525,12 @@ public class ProfiledDocuments {
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
@Path("{" + InterfaceConstants.Parameters.PROJECT_ID + "}")
|
||||||
public Project getById(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id) {
|
public Project getById(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id) {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.GET,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler
|
||||||
|
.setCalledMethod(pathCalledResource + "/{" + InterfaceConstants.Parameters.PROJECT_ID + "}");
|
||||||
|
|
||||||
return new GuardedMethod<Project>() {
|
return new GuardedMethod<Project>() {
|
||||||
@Override
|
@Override
|
||||||
protected Project run() throws Exception, WebApplicationException {
|
protected Project run() throws Exception, WebApplicationException {
|
||||||
|
@ -342,6 +550,11 @@ public class ProfiledDocuments {
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("/" + InterfaceConstants.Methods.SEARCH_PATH)
|
@Path("/" + InterfaceConstants.Methods.SEARCH_PATH)
|
||||||
public String search(String filter) {
|
public String search(String filter) {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.POST,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(pathCalledResource + "/" + InterfaceConstants.Methods.SEARCH_PATH);
|
||||||
|
|
||||||
return new GuardedMethod<String>() {
|
return new GuardedMethod<String>() {
|
||||||
@Override
|
@Override
|
||||||
protected String run() throws Exception, WebApplicationException {
|
protected String run() throws Exception, WebApplicationException {
|
||||||
|
@ -363,6 +576,11 @@ public class ProfiledDocuments {
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("/" + InterfaceConstants.Methods.QUERY_PATH)
|
@Path("/" + InterfaceConstants.Methods.QUERY_PATH)
|
||||||
public Iterable<?> query(String queryString) {
|
public Iterable<?> query(String queryString) {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.POST,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(pathCalledResource + "/" + InterfaceConstants.Methods.QUERY_PATH);
|
||||||
|
|
||||||
return new GuardedMethod<Iterable<?>>() {
|
return new GuardedMethod<Iterable<?>>() {
|
||||||
@Override
|
@Override
|
||||||
protected Iterable<?> run() throws Exception, WebApplicationException {
|
protected Iterable<?> run() throws Exception, WebApplicationException {
|
||||||
|
@ -388,6 +606,13 @@ public class ProfiledDocuments {
|
||||||
public String getRelationshipChain(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
public String getRelationshipChain(@PathParam(InterfaceConstants.Parameters.PROJECT_ID) String id,
|
||||||
@PathParam(InterfaceConstants.Parameters.RELATIONSHIP_ID) String relationshipId,
|
@PathParam(InterfaceConstants.Parameters.RELATIONSHIP_ID) String relationshipId,
|
||||||
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.DEEP) Boolean deep) {
|
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.DEEP) Boolean deep) {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.GET,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(pathCalledResource + "/{"
|
||||||
|
+ InterfaceConstants.Methods.RELATIONSHIP + "}/{" + InterfaceConstants.Parameters.PROJECT_ID + "}"
|
||||||
|
+ "/{" + InterfaceConstants.Parameters.RELATIONSHIP_ID + "}");
|
||||||
|
|
||||||
return new GuardedMethod<String>() {
|
return new GuardedMethod<String>() {
|
||||||
@Override
|
@Override
|
||||||
protected String run() throws Exception, WebApplicationException {
|
protected String run() throws Exception, WebApplicationException {
|
||||||
|
@ -414,6 +639,13 @@ public class ProfiledDocuments {
|
||||||
@PathParam(InterfaceConstants.Parameters.RELATIONSHIP_ID) String relationshipId,
|
@PathParam(InterfaceConstants.Parameters.RELATIONSHIP_ID) String relationshipId,
|
||||||
@QueryParam(InterfaceConstants.Parameters.TARGET_ID) String targetId,
|
@QueryParam(InterfaceConstants.Parameters.TARGET_ID) String targetId,
|
||||||
@QueryParam(InterfaceConstants.Parameters.TARGET_UCD) String targetUCD) {
|
@QueryParam(InterfaceConstants.Parameters.TARGET_UCD) String targetUCD) {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.PUT,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(pathCalledResource + "/{"
|
||||||
|
+ InterfaceConstants.Methods.RELATIONSHIP + "}/{" + InterfaceConstants.Parameters.PROJECT_ID + "}"
|
||||||
|
+ "/{" + InterfaceConstants.Parameters.RELATIONSHIP_ID + "}");
|
||||||
|
|
||||||
return new GuardedMethod<Project>() {
|
return new GuardedMethod<Project>() {
|
||||||
@Override
|
@Override
|
||||||
protected Project run() throws Exception, WebApplicationException {
|
protected Project run() throws Exception, WebApplicationException {
|
||||||
|
@ -447,6 +679,13 @@ public class ProfiledDocuments {
|
||||||
@PathParam(InterfaceConstants.Parameters.RELATIONSHIP_ID) String relationshipId,
|
@PathParam(InterfaceConstants.Parameters.RELATIONSHIP_ID) String relationshipId,
|
||||||
@QueryParam(InterfaceConstants.Parameters.TARGET_ID) String targetId,
|
@QueryParam(InterfaceConstants.Parameters.TARGET_ID) String targetId,
|
||||||
@QueryParam(InterfaceConstants.Parameters.TARGET_UCD) String targetUCD) {
|
@QueryParam(InterfaceConstants.Parameters.TARGET_UCD) String targetUCD) {
|
||||||
|
|
||||||
|
String pathCalledResource = CalledMethodHandler.buildCalledResource(HttpMethod.DELETE,
|
||||||
|
"/" + InterfaceConstants.Methods.PROJECTS + "/" + manager.getUseCaseDescriptor().getId());
|
||||||
|
CalledMethodHandler.setCalledMethod(pathCalledResource + "/{"
|
||||||
|
+ InterfaceConstants.Methods.RELATIONSHIP + "}/{" + InterfaceConstants.Parameters.PROJECT_ID + "}"
|
||||||
|
+ "/{" + InterfaceConstants.Parameters.RELATIONSHIP_ID + "}");
|
||||||
|
|
||||||
return new GuardedMethod<Project>() {
|
return new GuardedMethod<Project>() {
|
||||||
@Override
|
@Override
|
||||||
protected Project run() throws Exception, WebApplicationException {
|
protected Project run() throws Exception, WebApplicationException {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
import javax.ws.rs.DefaultValue;
|
import javax.ws.rs.DefaultValue;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.HttpMethod;
|
||||||
import javax.ws.rs.POST;
|
import javax.ws.rs.POST;
|
||||||
import javax.ws.rs.PUT;
|
import javax.ws.rs.PUT;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
|
@ -18,6 +19,7 @@ import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||||
import org.gcube.application.cms.serialization.Serialization;
|
import org.gcube.application.cms.serialization.Serialization;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor;
|
||||||
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||||
|
import org.gcube.application.geoportal.service.accounting.CalledMethodHandler;
|
||||||
import org.gcube.application.geoportal.service.engine.mongo.UCDManagerI;
|
import org.gcube.application.geoportal.service.engine.mongo.UCDManagerI;
|
||||||
|
|
||||||
import com.webcohesion.enunciate.metadata.rs.RequestHeader;
|
import com.webcohesion.enunciate.metadata.rs.RequestHeader;
|
||||||
|
@ -29,11 +31,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RequestHeaders({
|
@RequestHeaders({
|
||||||
@RequestHeader(name = "Authorization", description = "Bearer token, see https://dev.d4science.org/how-to-access-resources"),
|
@RequestHeader(name = "Authorization", description = "Bearer token, see https://dev.d4science.org/how-to-access-resources"),
|
||||||
@RequestHeader( name = "Content-Type", description = "application/json")
|
@RequestHeader(name = "Content-Type", description = "application/json") })
|
||||||
})
|
|
||||||
public class UseCaseDescriptors {
|
public class UseCaseDescriptors {
|
||||||
|
|
||||||
|
|
||||||
private UCDManagerI getManager() {
|
private UCDManagerI getManager() {
|
||||||
try {
|
try {
|
||||||
return ImplementationProvider.get().getProvidedObjectByClass(UCDManagerI.class);
|
return ImplementationProvider.get().getProvidedObjectByClass(UCDManagerI.class);
|
||||||
|
@ -43,19 +43,23 @@ public class UseCaseDescriptors {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public UseCaseDescriptor createNew(UseCaseDescriptor toCreate) {
|
public UseCaseDescriptor createNew(UseCaseDescriptor toCreate) {
|
||||||
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.POST, "/" + InterfaceConstants.Methods.UCD);
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/createNew");
|
||||||
|
|
||||||
return new GuardedMethod<UseCaseDescriptor>() {
|
return new GuardedMethod<UseCaseDescriptor>() {
|
||||||
@Override
|
@Override
|
||||||
protected UseCaseDescriptor run() throws Exception, WebApplicationException {
|
protected UseCaseDescriptor run() throws Exception, WebApplicationException {
|
||||||
log.info("Creating new UseCaseDescriptor ({})", toCreate);
|
log.info("Creating new UseCaseDescriptor ({})", toCreate);
|
||||||
if(toCreate.getMongoId()!=null) throw new WebApplicationException("Cannot register Use Case Descriptor with mongo ID", Response.Status.BAD_REQUEST);
|
if (toCreate.getMongoId() != null)
|
||||||
if(toCreate.getId()==null) throw new WebApplicationException("Missing mandatory field ID", Response.Status.BAD_REQUEST);
|
throw new WebApplicationException("Cannot register Use Case Descriptor with mongo ID",
|
||||||
|
Response.Status.BAD_REQUEST);
|
||||||
|
if (toCreate.getId() == null)
|
||||||
|
throw new WebApplicationException("Missing mandatory field ID", Response.Status.BAD_REQUEST);
|
||||||
UseCaseDescriptor toReturn = getManager().put(toCreate);
|
UseCaseDescriptor toReturn = getManager().put(toCreate);
|
||||||
if (toReturn == null) {
|
if (toReturn == null) {
|
||||||
log.warn("NB Cached backend implementation is slow beware of that");
|
log.warn("NB Cached backend implementation is slow beware of that");
|
||||||
|
@ -70,7 +74,12 @@ public class UseCaseDescriptors {
|
||||||
@Path("{" + InterfaceConstants.Parameters.UCID + "}")
|
@Path("{" + InterfaceConstants.Parameters.UCID + "}")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public UseCaseDescriptor update(@PathParam(InterfaceConstants.Parameters.UCID) String profileId, UseCaseDescriptor d) {
|
public UseCaseDescriptor update(@PathParam(InterfaceConstants.Parameters.UCID) String profileId,
|
||||||
|
UseCaseDescriptor d) {
|
||||||
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.PUT, "/" + InterfaceConstants.Methods.UCD);
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/" + profileId);
|
||||||
|
|
||||||
return new GuardedMethod<UseCaseDescriptor>() {
|
return new GuardedMethod<UseCaseDescriptor>() {
|
||||||
@Override
|
@Override
|
||||||
protected UseCaseDescriptor run() throws Exception, WebApplicationException {
|
protected UseCaseDescriptor run() throws Exception, WebApplicationException {
|
||||||
|
@ -81,13 +90,15 @@ public class UseCaseDescriptors {
|
||||||
}.execute().getResult();
|
}.execute().getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{" + InterfaceConstants.Parameters.UCID + "}")
|
@Path("{" + InterfaceConstants.Parameters.UCID + "}")
|
||||||
public Boolean delete(@PathParam(InterfaceConstants.Parameters.UCID) String id,
|
public Boolean delete(@PathParam(InterfaceConstants.Parameters.UCID) String id,
|
||||||
@DefaultValue("false")
|
@DefaultValue("false") @QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force) {
|
||||||
@QueryParam(InterfaceConstants.Parameters.FORCE) Boolean force) {
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.DELETE, "/" + InterfaceConstants.Methods.UCD);
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/"+id);
|
||||||
|
|
||||||
return new GuardedMethod<Boolean>() {
|
return new GuardedMethod<Boolean>() {
|
||||||
@Override
|
@Override
|
||||||
protected Boolean run() throws Exception, WebApplicationException {
|
protected Boolean run() throws Exception, WebApplicationException {
|
||||||
|
@ -98,18 +109,23 @@ public class UseCaseDescriptors {
|
||||||
}.execute().getResult();
|
}.execute().getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// BY ID
|
// BY ID
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("{" + InterfaceConstants.Parameters.UCID + "}")
|
@Path("{" + InterfaceConstants.Parameters.UCID + "}")
|
||||||
public UseCaseDescriptor getById(@PathParam(InterfaceConstants.Parameters.UCID) String id) {
|
public UseCaseDescriptor getById(@PathParam(InterfaceConstants.Parameters.UCID) String id) {
|
||||||
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.GET, "/" + InterfaceConstants.Methods.UCD);
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/"+ id);
|
||||||
|
|
||||||
return new GuardedMethod<UseCaseDescriptor>() {
|
return new GuardedMethod<UseCaseDescriptor>() {
|
||||||
@Override
|
@Override
|
||||||
protected UseCaseDescriptor run() throws Exception, WebApplicationException {
|
protected UseCaseDescriptor run() throws Exception, WebApplicationException {
|
||||||
UseCaseDescriptor toReturn = getManager().getById(id);
|
UseCaseDescriptor toReturn = getManager().getById(id);
|
||||||
if(toReturn == null ) throw new WebApplicationException("No UCD Matching ID "+id, Response.Status.NOT_FOUND);
|
if (toReturn == null)
|
||||||
else return toReturn;
|
throw new WebApplicationException("No UCD Matching ID " + id, Response.Status.NOT_FOUND);
|
||||||
|
else
|
||||||
|
return toReturn;
|
||||||
}
|
}
|
||||||
}.execute().getResult();
|
}.execute().getResult();
|
||||||
}
|
}
|
||||||
|
@ -119,6 +135,10 @@ public class UseCaseDescriptors {
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Path("/" + InterfaceConstants.Methods.QUERY_PATH)
|
@Path("/" + InterfaceConstants.Methods.QUERY_PATH)
|
||||||
public Iterable<?> query(String queryString) {
|
public Iterable<?> query(String queryString) {
|
||||||
|
|
||||||
|
String path = CalledMethodHandler.buildCalledResource(HttpMethod.POST, "/" + InterfaceConstants.Methods.UCD);
|
||||||
|
CalledMethodHandler.setCalledMethod(path + "/"+ InterfaceConstants.Methods.QUERY_PATH);
|
||||||
|
|
||||||
return new GuardedMethod<Iterable<?>>() {
|
return new GuardedMethod<Iterable<?>>() {
|
||||||
@Override
|
@Override
|
||||||
protected Iterable<?> run() throws Exception, WebApplicationException {
|
protected Iterable<?> run() throws Exception, WebApplicationException {
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.gcube.application.geoportal.common.model.document.access.Access;
|
||||||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
|
import org.gcube.application.geoportal.common.model.rest.PerformStepRequest;
|
||||||
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||||
import org.gcube.application.geoportal.common.utils.FileSets;
|
import org.gcube.application.geoportal.common.utils.FileSets;
|
||||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||||
|
@ -180,7 +180,7 @@ public abstract class AbstractProfiledDocumentsTests extends BasicServiceTestUni
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected Project step(String id, StepExecutionRequest request) throws Exception {
|
protected Project step(String id, PerformStepRequest request) throws Exception {
|
||||||
Project toReturn= check(baseTarget().
|
Project toReturn= check(baseTarget().
|
||||||
path(InterfaceConstants.Methods.STEP).path(id).request(MediaType.APPLICATION_JSON).
|
path(InterfaceConstants.Methods.STEP).path(id).request(MediaType.APPLICATION_JSON).
|
||||||
post(Entity.entity(Serialization.write(request),
|
post(Entity.entity(Serialization.write(request),
|
||||||
|
|
|
@ -9,7 +9,7 @@ import org.gcube.application.geoportal.common.model.document.access.Access;
|
||||||
import org.gcube.application.geoportal.common.model.document.identification.SpatialReference;
|
import org.gcube.application.geoportal.common.model.document.identification.SpatialReference;
|
||||||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||||
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
||||||
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
|
import org.gcube.application.geoportal.common.model.rest.PerformStepRequest;
|
||||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.Field;
|
import org.gcube.application.geoportal.common.model.useCaseDescriptor.Field;
|
||||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||||
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
import org.gcube.application.geoportal.common.utils.tests.GCubeTest;
|
||||||
|
@ -69,7 +69,7 @@ public class ProfiledConcessioniTests extends AbstractProfiledDocumentsTests{
|
||||||
|
|
||||||
System.out.println("Registered posizionamento, result is "+ Serialization.write(doc));
|
System.out.println("Registered posizionamento, result is "+ Serialization.write(doc));
|
||||||
// invoke step SUBMIT-FOR-REVIEW
|
// invoke step SUBMIT-FOR-REVIEW
|
||||||
StepExecutionRequest submitReq=new StepExecutionRequest();
|
PerformStepRequest submitReq=new PerformStepRequest();
|
||||||
submitReq.setStepID("SUBMIT-FOR-REVIEW");
|
submitReq.setStepID("SUBMIT-FOR-REVIEW");
|
||||||
// doc=step(doc.getId(),submitReq);
|
// doc=step(doc.getId(),submitReq);
|
||||||
doc=step(doc.getId(),submitReq);
|
doc=step(doc.getId(),submitReq);
|
||||||
|
@ -79,7 +79,7 @@ public class ProfiledConcessioniTests extends AbstractProfiledDocumentsTests{
|
||||||
|
|
||||||
// invoke step Publish
|
// invoke step Publish
|
||||||
|
|
||||||
StepExecutionRequest approveDraftReq=new StepExecutionRequest();
|
PerformStepRequest approveDraftReq=new PerformStepRequest();
|
||||||
approveDraftReq.setStepID("APPROVE-SUBMITTED");
|
approveDraftReq.setStepID("APPROVE-SUBMITTED");
|
||||||
doc=step(doc.getId(),approveDraftReq);
|
doc=step(doc.getId(),approveDraftReq);
|
||||||
System.out.println(doc);
|
System.out.println(doc);
|
||||||
|
@ -137,7 +137,7 @@ public class ProfiledConcessioniTests extends AbstractProfiledDocumentsTests{
|
||||||
assertEquals(doc2.getRelationships().get(0).getTargetUCD(),doc1.getProfileID());
|
assertEquals(doc2.getRelationships().get(0).getTargetUCD(),doc1.getProfileID());
|
||||||
assertEquals(doc2.getRelationships().get(0).getRelationshipName(),reverse);
|
assertEquals(doc2.getRelationships().get(0).getRelationshipName(),reverse);
|
||||||
|
|
||||||
StepExecutionRequest stepReq = new StepExecutionRequest();
|
PerformStepRequest stepReq = new PerformStepRequest();
|
||||||
stepReq.setStepID("SUBMIT-FOR-REVIEW");
|
stepReq.setStepID("SUBMIT-FOR-REVIEW");
|
||||||
|
|
||||||
step(doc1.getId(),stepReq);
|
step(doc1.getId(),stepReq);
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# Changelog for org.gcube.application.cms.notifications-plugins
|
# Changelog for org.gcube.application.cms.notifications-plugins
|
||||||
|
|
||||||
## [v1.0.4-SNAPSHOT] - 2023-09-06
|
## [v1.0.5-SNAPSHOT] - 2024-04-10
|
||||||
|
- Implemented the notification-plugin [#26453]
|
||||||
|
|
||||||
|
## [v1.0.4] - 2023-09-06
|
||||||
- Using parent version range [#25572]
|
- Using parent version range [#25572]
|
||||||
|
|
||||||
## [v1.0.3] - 2023-03-06
|
## [v1.0.3] - 2023-03-06
|
||||||
|
|
|
@ -16,11 +16,115 @@ This module is expected to contain plugin definitions for the generations of not
|
||||||
## Documentation
|
## Documentation
|
||||||
[gCube CMS Suite](../) parent module containing references, documentation, guides ad utilities.
|
[gCube CMS Suite](../) parent module containing references, documentation, guides ad utilities.
|
||||||
|
|
||||||
|
This plugin requires a configuration of type:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"subscribeNotifications": [
|
||||||
|
{
|
||||||
|
"event": "EVENT_NAME",
|
||||||
|
"notificationFor": [
|
||||||
|
{
|
||||||
|
"roles": [
|
||||||
|
"USER_ROLE"
|
||||||
|
],
|
||||||
|
"when": [
|
||||||
|
{
|
||||||
|
"target_phase": [
|
||||||
|
"TARGET_PHASE"
|
||||||
|
],
|
||||||
|
"last_invoked_step": LAST_INVOKED_STEP_1,
|
||||||
|
"notify": [
|
||||||
|
{
|
||||||
|
"type": "NOTIFICATION_TYPE",
|
||||||
|
"send": "true/false",
|
||||||
|
"placeholder_title": "PLACEHOLDER_TITLE_1",
|
||||||
|
"placeholder_msg": "PLACEHOLDER_MESSAGE_1",
|
||||||
|
"export_as_pdf": {
|
||||||
|
"placeholder_msg": "Export as PDF placeholder",
|
||||||
|
"export": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"target_phase": [
|
||||||
|
"TARGET_PHASE"
|
||||||
|
],
|
||||||
|
"last_invoked_step": LAST_INVOKED_STEP_2,
|
||||||
|
"notify": [
|
||||||
|
{
|
||||||
|
"type": "NOTIFICATION_TYPE",
|
||||||
|
"send": "true/false",
|
||||||
|
"placeholder_title": "PLACEHOLDER_TITLE_2",
|
||||||
|
"placeholder_msg": "PLACEHOLDER_MESSAGE_2",
|
||||||
|
"export_as_pdf": {
|
||||||
|
"placeholder_msg": "Export as PDF placeholder",
|
||||||
|
"export": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enabled":true/false,
|
||||||
|
"link_to_notifications_messages": "link to file containing the messages as properties like PLACEHOLDER_MESSAGE_{N} = value"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Where:
|
||||||
|
|
||||||
|
* `enabled` (optional) can be: true/false. Default is true. It enables or not the plugin.
|
||||||
|
* `link_to_notifications_messages` (mandatory): it is the URL to Notifications Messages file with placeholder values. A property file like PLACEHOLDER_MESSAGE_{N} = value
|
||||||
|
|
||||||
|
and
|
||||||
|
|
||||||
|
* `EVENT_NAME` (mandatory) can be: `PROJECT_CREATED`, `PROJECT_UPDATED`, `PROJECT_DELETED`, `LIFECYCLE_STEP_PERFORMED`;
|
||||||
|
* `USER_ROLE` (mandatory) can be: `Data-Manager`, `Data-Editor`, `Member`, `Item_Creator`, `Any`;
|
||||||
|
* `TARGET_PHASE` (mandatory) can be: `DRAFT`, `Pending Approval`, `Published`, `Any`;
|
||||||
|
* `LAST_INVOKED_STEP` (optional) can be: `SUBMIT-FOR-REVIEW`, `APPROVE-SUBMITTED`, `REJECT-DRAFT`, `UNPUBLISH`;
|
||||||
|
* `NOTIFICATION_TYPE` (mandatory) can be: `USER_NOTIFICATION`, `VRE_POST`, `EMAIL`;
|
||||||
|
|
||||||
|
**PLACEHOLDER_MESSAGE_{N}.properties** managed/known placeholders:
|
||||||
|
|
||||||
|
* `${project_name}`
|
||||||
|
* `${project_id}`
|
||||||
|
* `${private_data_entry_link}`
|
||||||
|
* `${public_data_entry_link}`
|
||||||
|
* `${private_data_viewer_link}`
|
||||||
|
* `${public_data_viewer_link}`
|
||||||
|
* `${project_as_pdf_link}`
|
||||||
|
* `${user_caller}`
|
||||||
|
|
||||||
|
|
||||||
|
e.g. Messages using the placeholders:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
# REVIEW ACTION
|
||||||
|
TITLE_REVIEW_REQUIRED=Review required for ${project_name}
|
||||||
|
MSG_REVIEW_REQUIRED=@${user_caller} submitted the project ${project_name}. You are kindly requested to review it and decide either to APPROVE or REJECT it. See the Project at ${private_data_entry_link}
|
||||||
|
# REJECTED ACTION
|
||||||
|
TITLE_ITEM_REJECTED=Rejected ${project_name}
|
||||||
|
MSG_ITEM_REJECTED=The project ${project_name} (id: ${project_id}) has just been rejected by @${user_caller}. See the Project at ${private_data_entry_link}
|
||||||
|
# REJECTED ACTION
|
||||||
|
TITLE_ITEM_REJECTED_REVIEW_REQUIRED=Rejected ${project_name}
|
||||||
|
MSG_ITEM_REJECTED_REVIEW_REQUIRED=The project ${project_name} has just been rejected. You are kindly requested to review it. See the Project at ${private_data_entry_link}
|
||||||
|
```
|
||||||
|
|
||||||
|
[See here a full file with messages](https://code-repo.d4science.org/gCubeSystem/gcube-cms-suite/raw/branch/event_manager/D4S_UCDs/DEV/devVRE/notifications/Notifications_Messages.properties)
|
||||||
|
|
||||||
|
|
||||||
## Change log
|
## Change log
|
||||||
|
|
||||||
See [CHANGELOG.md](CHANGELOG.md).
|
See [CHANGELOG.md](CHANGELOG.md).
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
* **Francesco Mangiacrapa** ([ORCID](https://orcid.org/0000-0002-6528-664X)) Computer Scientist at [ISTI-CNR Infrascience Group](http://nemis.isti.cnr.it/groups/infrascience)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
|
This project is licensed under the EUPL V.1.1 License - see the [LICENSE.md](LICENSE.md) file for details.
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue