Skip to content

Commit

Permalink
Feature: Add CAP template and plugin to dataset editor (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoryPTB authored Aug 23, 2024
1 parent 7fe07c2 commit b0325dc
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions public/plugins/plugin-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
"defaultBuckets": ["wis2box-public"],
"defaultFilePattern": "^WIGOS_(\\d-\\d+-\\d+-\\w+)_.*\\.bufr4$",
"hint": "The regex pattern must contain the WIGOS station identifier"
},
{
"title": "CAP messages",
"id": "wis2box.data.cap_message.CAPMessageData",
"defaultFileExtension": "xml",
"defaultBuckets": ["wis2box-incoming"],
"defaultFilePattern": "^.*\\.xml$",
"hint": ""
}
],
"templates": [
Expand Down
2 changes: 2 additions & 0 deletions src/components/DatasetEditorForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,8 @@ export default defineComponent({
console.error(error);
// Display error message to the user
message.value = 'Error loading discovery metadata list.';
// Empty items
items.value = []
}
// Now add the option to create a new dataset, regardless of whether
// the list could be loaded or not
Expand Down
35 changes: 35 additions & 0 deletions src/templates/cap-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"label": "weather/advisories-warnings",
"title": "CAP Alerts published by $CENTRE_ID",
"identifier": "urn:wmo:md:$CENTRE_ID:$DATA_POLICY.weather.cap",
"topicHierarchy": "$CENTRE_ID/data/$DATA_POLICY/weather/advisories-warnings",
"language": "en",
"resolution": "",
"keywords": [
"CAP",
"warnings",
"alerts"
],
"themes": [
{
"concepts": [{ "id": "weather", "label": "weather" }],
"scheme": "http://codes.wmo.int/wis/topic-hierarchy/earth-system-discipline"
}
],
"wis2box": {
"retention": "P30D",
"topic_hierarchy": "$CENTRE_ID.data.$DATA_POLICY.weather.advisories-warnings",
"data_mappings": {
"plugins": {
"xml": [
{
"plugin": "wis2box.data.cap_message.CAPMessageData",
"notify": true,
"buckets": ["wis2box-incoming"],
"file-pattern": "^.*\\.xml$"
}
]
}
}
}
}

0 comments on commit b0325dc

Please sign in to comment.