BEXIS2 / Core

This is the public code repository of the BEXIS2 data management software. It contains only modules, components, and packages of the core system. Contributed modules and components will be available in separate repositories. For more information on BEXIS2, please visit our website.
https://bexis2.github.io/
17 stars 12 forks source link

Concept for settings/modes (per mode, general) -> JSON-Structure #1817

Open geofranzi opened 3 weeks ago

geofranzi commented 3 weeks ago

Template

Final settings

{
    "meta": {
       "info": {
         "title": "Map",
         "description": "Settings for Map component",
         "version": "1.0.0"
       },
       "settings": {
         "initViewExtent": {
           "name": "initial view extent",
           "description": "description",
           "default_value": "..."
         },
         "maxViewExtent": {
           "name": "name",
           "description": "description",
           "default_value": "value"
         },
         "areaAsPolygon": { 
           "name": "area",
           "description": "areas stored as FeatureCollection"       
         }
       },
       "variables": {
         "areaAsText": {
           "name": "area",
           "description": "areas stored as text in a field",
           "type": "string"
         }
       },
       "modes": {
        "mode_select_area": { 
          "name": "mode select area",
          "description": "description"
        },
      "mode_view_area": { 
          "name": "mode select area",
          "description": "description"
        },
       }
    },
   "edit": {
     "mode_select_area": { // template part -> once selected only copy this to final setting
       "settings": { // overwrite default settings
         "initViewExtent": {
           "value": ""
         },
         "areaAsPolygon": { // as long the internal variable knows the attributes they are free
           "type": "url|text", 
           "url": "",  //  "path/to/file.geojson"
           "text": {} // JSON data
         }
       },
       "input_variables": {
         "areaAsText": {
           "JSONPath": "",
           "regex": "",
           "format": ""
         }
       },
       "output_variables": {
         "areaAsText": {
           "JSONPath": "",
           "regex": "",
           "format": ""
         }
       }
      },
  "view":{    
       "mode_view_area": { // template part -> once selected only copy this to final setting
       "settings": { 
         "initViewExtent": {
           "value": ""
         },
         "areaAsPolygon": { // as long the internal variable knows the attributes they are free
           "type": "url|text", // 
           "url": "",
           "polygon": {}
         }
       },
       "input_variables": {
         "areaAsText": {
           "JSONPath": "",
           "regex": "",
           "format": ""
         }
       }
     }
   }
  }
}
{
    "componets":[{
            "name": "map",
            "JSONPath": ".data[1].contrymap", // path to metadata field

            "edit": {
                "mode_select_area": { // template part -> once selected only copy this to final setting
                    "settings": { // overwrite default settings
                        "initViewExtent": {
                        "value": "10,10,35,40"
                        },
                        "areaAsPolygon": { // as long the internal variable knows the attributes they are free
                        "type": "url",
                        "url": "path/to/file.geojson",
                        "text": {} 
                        }
                    },
                    "input_variables": {
                        "areaAsText": {
                        "JSONPath": ".data[1].areaAsText",
                        "regex": "",
                        "format": ""
                        }
                    },
                    "output_variables": {
                        "areaAsText": {
                        "JSONPath": ".data[1].areaAsText",
                        "regex": "",
                        "format": ""
                        }
                    }
                }
            },
            "view": {    
                "mode_view_area": { // template part -> once selected only copy this to final setting
                    "settings": { // overwrtie default settings
                        "initViewExtent": {
                        "value": "10,10,35,40",
                        },
                        "areaAsPolygon": { // as long the internal variable knows the attributes they are free
                        "type": "url",
                        "url": "path/to/file.geojson",
                        "text": {},
                        }
                    },
                    "input_variables": {
                        "areaAsText": {
                        "JSONPath": ".data[1].areaAsText",
                        "regex": "",
                        "format": ""
                        }
                    }
                }
            }
        },
        {
            "name": "map",
            "JSONPath": ".data[2].locationmap", 

            "edit": {
                "mode_select_area": { // template part -> once selected only copy this to final setting
                    "settings": { // overwrtie default settings
                        "initViewExtent": {
                        "value": "10,10,35,40"
                        },
                        "areaAsPolygon": { // as long the internal variable knows the attributes they are free
                        "type": "url",
                        "url": "path/to/file.geojson",
                        "text": {} 
                        }
                    },
                    "input_variables": {
                        "areaAsText": {
                        "JSONPath": "$.data[2].areaAsText",
                        "regex": "",
                        "format": ""
                        }
                    },
                    "output_variables": {
                        "areaAsText": {
                        "JSONPath": ".data[2].areaAsText",
                        "regex": "",
                        "format": ""
                        }
                    }
                }
            },
            "view": {    
                "mode_view_area": { // template part -> once selected only copy this to final setting
                    "settings": { // overwrtie default settings
                        "initViewExtent": {
                        "value": "10,10,35,40",
                        },
                        "areaAsPolygon": { // as long the internal variable knows the attributes they are free
                        "type": "url",
                        "url": "path/to/file.geojson",
                        "text": {}
                        }
                    },
                    "input_variables": {
                        "areaAsText": {
                        "xpath": ".data[2].areaAsText",
                        "regex": "",
                        "format": "",
                        }
                    }
                }
            }
        }]
}
MaJoHo commented 3 weeks ago

the updated json files

settings.json template.json