diff --git a/chart/files/index.html b/chart/files/index.html index 9df30b5cbb279114fab88d2c3f5d364ccd35609f..d779b6afe32386fa6393dcc8f23b039d12826ff0 100644 --- a/chart/files/index.html +++ b/chart/files/index.html @@ -235,16 +235,16 @@ var config = { "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - // "method": "GET", - "rewrite": { - // add __coverage to the coverageId - "from": "({{ "{{" }}id}})", - "to": "$1__coverage" - } } }, {{- end }} diff --git a/client/src/_client.scss b/client/src/_client.scss index c53bed673e97e687e198e96275d91da551b34187..318289ae5046746b9cb880f267c559088d438e9d 100644 --- a/client/src/_client.scss +++ b/client/src/_client.scss @@ -891,6 +891,51 @@ input, transform:rotate(-90deg); } +.error-modal { + .modal-dialog { + .modal-content { + border-radius: 8px !important; + border-color: $c_blue; + background-color: $c_lo; + + .modal-header { + border-top-left-radius: 8px; + border-top-right-radius: 8px; + color: $c_hi; + border-bottom: none; + + .close { + color: $c_lo; + background-color: $c_hi; + text-shadow: none; + opacity: 1; + margin-top: -15px; + padding: 15px 5px 5px 5px; + transition: background-color .25s; + } + .close:hover { + background-color: white; + transition: background-color .25s; + } + + .record-pager { + margin-right: 10px; + } + } + + td, th { + padding-left: 5px; + padding-right: 5px; + a, h4 { + color: $c_lo; + } + } + } + + } + + +} .modal { .modal-content { border-radius: 8px !important; @@ -1148,7 +1193,7 @@ body { color: $c_gray; } -.full-resolution-body, .download-options { +.full-resolution-body, .download-options, .process-parameters { color: $c_gray; .input-group-addon { background-color: $c_green; @@ -1211,6 +1256,24 @@ input[type=radio].visualization-selector { margin-bottom: 10px !important; } +.point1-X, .point1-Y { + margin-bottom: 15px !important; + +} + +.btn-draw-line { + margin-top: 20px; + padding-left: 0px; +} +.line-draw-button{ + padding-left: 0px; +} + +.line-points { + padding-left: 0px; + padding-right: 0px; +} + .upload-input { background-color: $c_blue !important; height: 28px !important; @@ -1226,3 +1289,11 @@ input[type=radio].visualization-selector { .histogram-switch label span:before { color: $c_green; } + +.processing-panel{ + background-color: $c_green; + min-height: 100%; + border-radius: 8px; + padding: 8px; + +} \ No newline at end of file diff --git a/client/src/config-schema.json b/client/src/config-schema.json index 64809aa2dcd787bbf499945cf011d53dc9bfe1c3..046c3fff2887e379311eacc2c6ef02749adeb122 100644 --- a/client/src/config-schema.json +++ b/client/src/config-schema.json @@ -1,551 +1,548 @@ { - "$schema":"http://json-schema.org/draft-04/schema#", - "id":"https://gitlab.eox.at/esa/prism/vs/src/config-schema.json", - "title":"Configuration", - "description":"The main configuration object.", - "type":"object", - "properties":{ - "settings":{ - "$ref":"#/definitions/settings" + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "https://gitlab.eox.at/esa/prism/vs/src/config-schema.json", + "title": "Configuration", + "description": "The main configuration object.", + "type": "object", + "properties": { + "settings": { + "$ref": "#/definitions/settings" }, - "baseLayers":{ - "$ref":"#/definitions/layerSet" + "baseLayers": { + "$ref": "#/definitions/layerSet" }, - "layers":{ - "$ref":"#/definitions/layerSet" + "layers": { + "$ref": "#/definitions/layerSet" }, - "overlayLayers":{ - "$ref":"#/definitions/layerSet" + "overlayLayers": { + "$ref": "#/definitions/layerSet" } }, - "required":[ + "required": [ "settings", "baseLayers", "layers", "overlayLayers" ], - "definitions":{ - "settings":{ - "description":"The initial settings object.", - "properties":{ - "tutorial":{ - "description":"Allows configuration of tutorial functionality.", - "type":"string", - "enum":[ + "definitions": { + "settings": { + "description": "The initial settings object.", + "properties": { + "tutorial": { + "description": "Allows configuration of tutorial functionality.", + "type": "string", + "enum": [ "always", "once", "button", "disabled" ], - "default":"disabled" + "default": "disabled" }, - "searchDebounceTime":{ - "description":"Sets the time in milliseconds to wait for additional user input before actually sending a search request.", - "type":"number", - "default":250 + "searchDebounceTime": { + "description": "Sets the time in milliseconds to wait for additional user input before actually sending a search request.", + "type": "number", + "default": 250 }, - "language":{ - "description":"The language used in the UI.", - "type":"string", - "enum":[ + "language": { + "description": "The language used in the UI.", + "type": "string", + "enum": [ "en", "de", "deinformal" ], - "default":"en" + "default": "en" }, - "center":{ - "description":"The initial center of the map view.", - "type":"array", - "items":[ - { - "description":"The longitude component of the center point.", - "type":"number", - "minimum":-180, - "maximum":180 + "center": { + "description": "The initial center of the map view.", + "type": "array", + "items": [{ + "description": "The longitude component of the center point.", + "type": "number", + "minimum": -180, + "maximum": 180 }, { - "description":"The latitude component of the center point.", - "type":"number", - "minimum":-90, - "maximum":90 + "description": "The latitude component of the center point.", + "type": "number", + "minimum": -90, + "maximum": 90 } ] }, - "zoom":{ - "description":"The initial map zoom level.", - "type":"number", - "default":2 + "zoom": { + "description": "The initial map zoom level.", + "type": "number", + "default": 2 }, "heightFactor":{ "description":"Initial height factor of the 3D Viewer - substitute for zoom in 3D.", "type":"number" }, - "minZoom":{ - "description":"The overall minimum map zoom level on any map.", - "type":"number", - "default":0 + "minZoom": { + "description": "The overall minimum map zoom level on any map.", + "type": "number", + "default": 0 }, - "maxZoom":{ - "description":"The overall maximum map zoom level on any map.", - "type":"number", - "default":28 + "maxZoom": { + "description": "The overall maximum map zoom level on any map.", + "type": "number", + "default": 28 }, - "projection":{ - "oneOf":[ - { - "description":"Chosen map view projection as string in EPSG format - either EPSG:4326 or EPSG:3857", - "type":"string", - "default":"EPSG:4326" + "projection": { + "oneOf": [{ + "description": "Chosen map view projection as string in EPSG format - either EPSG:4326 or EPSG:3857", + "type": "string", + "default": "EPSG:4326" }, { - "description":"Object with custom projection CRS definition with following properties: def, name, extent.", - "type":"object", - "properties":{ - "name":{ - "description":"Name of the custom projection. Usually an EPSG code string.", - "type":"string" + "description": "Object with custom projection CRS definition with following properties: def, name, extent.", + "type": "object", + "properties": { + "name": { + "description": "Name of the custom projection. Usually an EPSG code string.", + "type": "string" }, - "def":{ - "description":"Proj4 definition string.", - "type":"string" + "def": { + "description": "Proj4 definition string.", + "type": "string" }, - "extent":{ - "description":"Array with bounding box of the extent for the custom projection. // example [-8194304, -8194304, 4194304, 4194304]", - "type":"array" - } + "extent": { + "description": "Array with bounding box of the extent for the custom projection. // example [-8194304, -8194304, 4194304, 4194304]", + "type": "array" + } } } ] }, - "extent":{ - "description":"The initially visible extent. This setting is mutually exclusive to 'center' and 'zoom'.", - "type":"array", - "items":[ - { - "description":"The lower longitude component of the extent.", - "type":"number" + "extent": { + "description": "The initially visible extent. This setting is mutually exclusive to 'center' and 'zoom'.", + "type": "array", + "items": [{ + "description": "The lower longitude component of the extent.", + "type": "number" }, { - "description":"The lower latitude component of the extent.", - "type":"number" + "description": "The lower latitude component of the extent.", + "type": "number" }, { - "description":"The upper longitude component of the extent.", - "type":"number" + "description": "The upper longitude component of the extent.", + "type": "number" }, { - "description":"The upper latitude component of the extent.", - "type":"number" + "description": "The upper latitude component of the extent.", + "type": "number" } ] }, - "timeDomain":{ - "description":"The overall time domain of the client. No time can be selected outside of this domain.", - "type":"array", - "items":{ - "type":"string", - "format":"date-time" + "timeDomain": { + "description": "The overall time domain of the client. No time can be selected outside of this domain.", + "type": "array", + "items": { + "type": "string", + "format": "date-time" }, - "minItems":2, - "maxItems":2 - }, - "displayTimeDomain":{ - "description":"The initially displayed time interval.", - "type":"array", - "items":{ - "type":"string", - "format":"date-time" + "minItems": 2, + "maxItems": 2 + }, + "displayTimeDomain": { + "description": "The initially displayed time interval.", + "type": "array", + "items": { + "type": "string", + "format": "date-time" }, - "minItems":2, - "maxItems":2, - "default":"timeDomain" - }, - "selectedTimeDomain":{ - "description":"The initially selected time of interest.", - "type":"array", - "items":{ - "type":"string", - "format":"date-time" + "minItems": 2, + "maxItems": 2, + "default": "timeDomain" + }, + "selectedTimeDomain": { + "description": "The initially selected time of interest.", + "type": "array", + "items": { + "type": "string", + "format": "date-time" }, - "minItems":2, - "maxItems":2 - }, - "constrainTimeDomain":{ - "description":"Whether or not the zoomable area shall be confined to the interval of the 'timeDomain' setting.", - "type":"boolean", - "default":false - }, - "displayInterval":{ - "description":"The maximum allowed interval to display on the time slider as an ISO 8601 period.", - "type":"string", - "pattern":"^P(?:([0-9]+)Y|)?(?:([0-9]+)M|)?(?:([0-9]+)D|)?T?(?:([0-9]+)H|)?(?:([0-9]+)M|)?(?:([0-9]+)S|)?$", - "default":null - }, - "selectableInterval":{ - "description":"The maximum allowed interval to select as an ISO 8601 period.", - "type":"string", - "pattern":"^P(?:([0-9]+)Y|)?(?:([0-9]+)M|)?(?:([0-9]+)D|)?T?(?:([0-9]+)H|)?(?:([0-9]+)M|)?(?:([0-9]+)S|)?$", - "default":null - }, - "maxTooltips":{ - "description":"The maximum number of individual tooltips, before only the beginning of the list is show and a '+ x more' is appended.", - "type":"number", - "default":null - }, - "timeSliderControls":{ - "description":"Whether or not control buttons should be shown for the TimeSlider.", - "type":"boolean", - "default":false - }, - "disableTimeSlider":{ - "description":"Disables TimeSlider completely", - "type":"boolean", - "default":false - }, - "timeSliderAlternativeBrush":{ - "description":"If alternative TimeSlider selection brush (Mundi style) should be used.", - "type":"boolean", - "default":false - }, - "enableDynamicHistogram":{ - "description":"Whether or not current map extent and area filters are used for TimeSlider fetch.", - "type":"boolean", - "default":false - }, - "maxMapInterval":{ - "description":"The maximum time interval for WMTS if sharedTime mode should be used. If selected time would be larger, only maxMapInterval into the past from end of interval is shown. Format is an ISO 8601 period.", - "type":"string", - "pattern":"^P(?:([0-9]+)Y|)?(?:([0-9]+)M|)?(?:([0-9]+)D|)?T?(?:([0-9]+)H|)?(?:([0-9]+)M|)?(?:([0-9]+)S|)?$", - "default":null - }, - "constrainOutCoords":{ - "description":"Coordinates sent to the catalog (from Polygon filter) will be forced to be in CRS bounds to conform to the OpenSeach geo standard", - "type":"boolean", - "default":false - }, - "enableSingleLayerMode":{ - "description":"If there is only one layer with search, enable single panel mode of Search Results.", - "type":"boolean", - "default":true - }, - "disableSearchParams" : { - "description":"Disable using URL parameters for partial initial app config", - "type":"boolean", - "default":false - }, - "highlightFillColor":{ - "description":"The fill color of highlighted footprints/bounding boxes on the map. Any valid CSS color defintion is supported.", - "type":"string", - "default":"rgba(255, 255, 255, 0.2)" - }, - "highlightStrokeColor":{ - "description":"The stroke color of highlighted footprints/bounding boxes on the map. Any valid CSS color defintion is supported.", - "type":"string", - "default":"#cccccc" - }, - "highlightStrokeWidth":{ - "description":"The stroke width (in pixels) for highlighted footprints/bounding boxes on the map.", - "type":"number", - "default":1 - }, - "filterFillColor":{ - "description":"The fill color of selected regions (both on map and on timeslider). Any valid CSS color defintion is supported.", - "type":"string", - "default":"rgba(0, 0, 0, 0)" - }, - "filterStrokeColor":{ - "description":"The stroke color (or point color) of selected regions (both on map and on timeslider). Any valid CSS color definition is supported.", - "type":"string", - "default":"rgba(0, 0, 0, 0)" - }, - "filterOutsideColor":{ - "description":"The fill color of selected regions (both on map and on timeslider). Any valid CSS color definition is supported.", - "type":"string", - "default":"rgba(0, 0, 0, 0.2)" - }, - "footprintFillColor":{ - "description":"The fill color of footprints of the search result. Any valid CSS color definition is supported.", - "type":"string", - "default":"rgba(255, 255, 255, 0.2)" - }, - "footprintStrokeColor":{ - "description":"The stroke color of footprints of the search result. Any valid CSS color definition is supported.", - "type":"string", - "default":"#cccccc" - }, - "selectedFootprintFillColor":{ - "description":"The fill color of footprints of records selected for download. Any valid CSS color definition is supported.", - "type":"string", - "default":"rgba(255, 0, 0, 0.2)" - }, - "selectedFootprintStrokeColor":{ - "description":"The fill color of footprints of records selected for download. Any valid CSS color definition is supported.", - "type":"string", - "default":"#ff0000" - }, - "footprintLabel":{ - "description":"Settings object for footprint labels.", - "type":"object", - "properties":{ - "labelTemplate":{ - "description":"Template for footprint label. Interpolating for each footprint via {{id}} from OpenSeach Record Model attributes. Example: 'Title of Product is: {{properties.title}}'. When not set, 'product.id' is used for label content.", - "type":"string" - }, - "labelRegex":{ - "description":"Either string with regexp of regexp object to allow extracting parts of label via match and join them into one string. If regexp does not have global flag and at least one search group () is specified in regexp, full match (match[0]) is discarded and only individual search groups are joined to the result.", - "type":"string" - }, - "font":{ - "description":"Font of a label. One of many configurations options for a label. Full list contains: [align, baseline, size, height, offsetX, offsetY, weight, placement, rotation, font, color, outline, outlineWidth, maxangle, overflow, maxResolution, text]. More information on those on https://openlayers.org/en/latest/examples/vector-labels.html", - "type":"string" - } + "minItems": 2, + "maxItems": 2 + }, + "constrainTimeDomain": { + "description": "Whether or not the zoomable area shall be confined to the interval of the 'timeDomain' setting.", + "type": "boolean", + "default": false + }, + "displayInterval": { + "description": "The maximum allowed interval to display on the time slider as an ISO 8601 period.", + "type": "string", + "pattern": "^P(?:([0-9]+)Y|)?(?:([0-9]+)M|)?(?:([0-9]+)D|)?T?(?:([0-9]+)H|)?(?:([0-9]+)M|)?(?:([0-9]+)S|)?$", + "default": null + }, + "selectableInterval": { + "description": "The maximum allowed interval to select as an ISO 8601 period.", + "type": "string", + "pattern": "^P(?:([0-9]+)Y|)?(?:([0-9]+)M|)?(?:([0-9]+)D|)?T?(?:([0-9]+)H|)?(?:([0-9]+)M|)?(?:([0-9]+)S|)?$", + "default": null + }, + "maxTooltips": { + "description": "The maximum number of individual tooltips, before only the beginning of the list is show and a '+ x more' is appended.", + "type": "number", + "default": null + }, + "timeSliderControls": { + "description": "Whether or not control buttons should be shown for the TimeSlider.", + "type": "boolean", + "default": false + }, + "disableTimeSlider": { + "description": "Disables TimeSlider completely", + "type": "boolean", + "default": false + }, + "timeSliderAlternativeBrush": { + "description": "If alternative TimeSlider selection brush (Mundi style) should be used.", + "type": "boolean", + "default": false + }, + "enableDynamicHistogram": { + "description": "Whether or not current map extent and area filters are used for TimeSlider fetch.", + "type": "boolean", + "default": false + }, + "maxMapInterval": { + "description": "The maximum time interval for WMTS if sharedTime mode should be used. If selected time would be larger, only maxMapInterval into the past from end of interval is shown. Format is an ISO 8601 period.", + "type": "string", + "pattern": "^P(?:([0-9]+)Y|)?(?:([0-9]+)M|)?(?:([0-9]+)D|)?T?(?:([0-9]+)H|)?(?:([0-9]+)M|)?(?:([0-9]+)S|)?$", + "default": null + }, + "constrainOutCoords": { + "description": "Coordinates sent to the catalog (from Polygon filter) will be forced to be in CRS bounds to conform to the OpenSearch geo standard", + "type": "boolean", + "default": false + }, + "enableSingleLayerMode": { + "description": "If there is only one layer with search, enable single panel mode of Search Results.", + "type": "boolean", + "default": true + }, + "disableSearchParams": { + "description": "Disable using URL parameters for partial initial app config", + "type": "boolean", + "default": false + }, + "highlightFillColor": { + "description": "The fill color of highlighted footprints/bounding boxes on the map. Any valid CSS color definition is supported.", + "type": "string", + "default": "rgba(255, 255, 255, 0.2)" + }, + "highlightStrokeColor": { + "description": "The stroke color of highlighted footprints/bounding boxes on the map. Any valid CSS color definition is supported.", + "type": "string", + "default": "#cccccc" + }, + "highlightStrokeWidth": { + "description": "The stroke width (in pixels) for highlighted footprints/bounding boxes on the map.", + "type": "number", + "default": 1 + }, + "filterFillColor": { + "description": "The fill color of selected regions (both on map and on timeslider). Any valid CSS color definition is supported.", + "type": "string", + "default": "rgba(0, 0, 0, 0)" + }, + "filterStrokeColor": { + "description": "The stroke color (or point color) of selected regions (both on map and on timeslider). Any valid CSS color definition is supported.", + "type": "string", + "default": "rgba(0, 0, 0, 0)" + }, + "filterOutsideColor": { + "description": "The fill color of selected regions (both on map and on timeslider). Any valid CSS color definition is supported.", + "type": "string", + "default": "rgba(0, 0, 0, 0.2)" + }, + "footprintFillColor": { + "description": "The fill color of footprints of the search result. Any valid CSS color definition is supported.", + "type": "string", + "default": "rgba(255, 255, 255, 0.2)" + }, + "footprintStrokeColor": { + "description": "The stroke color of footprints of the search result. Any valid CSS color definition is supported.", + "type": "string", + "default": "#cccccc" + }, + "selectedFootprintFillColor": { + "description": "The fill color of footprints of records selected for download. Any valid CSS color definition is supported.", + "type": "string", + "default": "rgba(255, 0, 0, 0.2)" + }, + "selectedFootprintStrokeColor": { + "description": "The fill color of footprints of records selected for download. Any valid CSS color definition is supported.", + "type": "string", + "default": "#ff0000" + }, + "footprintLabel": { + "description": "Settings object for footprint labels.", + "type": "object", + "properties": { + "labelTemplate": { + "description": "Template for footprint label. Interpolating for each footprint via {{id}} from OpenSearch Record Model attributes. Example: 'Title of Product is: {{properties.title}}'. When not set, 'product.id' is used for label content.", + "type": "string" + }, + "labelRegex": { + "description": "Either string with regexp of regexp object to allow extracting parts of label via match and join them into one string. If regexp does not have global flag and at least one search group () is specified in regexp, full match (match[0]) is discarded and only individual search groups are joined to the result.", + "type": "string" + }, + "font": { + "description": "Font of a label. One of many configurations options for a label. Full list contains: [align, baseline, size, height, offsetX, offsetY, weight, placement, rotation, font, color, outline, outlineWidth, maxangle, overflow, maxResolution, text]. More information on those on https://openlayers.org/en/latest/examples/vector-labels.html", + "type": "string" + } } }, - "maxAreaFilter":{ - "description":"Maximum allowed Area Filter or map bbox in km2. Shows a {{max-area-warning}} if exceed. 0 means disabled.", - "type":"number", - "default":0 - }, - "leftPanelOpen":{ - "description":"Whether or not the left panel shall be open on start.", - "type":"boolean", - "default":false - }, - "rightPanelOpen":{ - "description":"Whether or not the right panel shall be open on start.", - "type":"boolean", - "default":false - }, - "leftPanelTabIndex":{ - "description":"Index of left panel tab to be opened on start, starting from 0.", - "type":"integer", - "default":0 - }, - "rightPanelTabIndex":{ - "description":"Index of right panel tab to be opened on start, starting from 0.", - "type":"integer", - "default":0 - }, - "parameters":{ - "description":"Mapping the parameter type (such as eo:processingCenter) to a settings object.", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "type":{ - "description":"The mandatory parameter type. Use the OpenSeach type, e.g: eo:acquisitionStation.", - "type":"string" + "maxAreaFilter": { + "description": "Maximum allowed Area Filter or map bbox in km2. Shows a {{max-area-warning}} if exceed. 0 means disabled.", + "type": "number", + "default": 0 + }, + "leftPanelOpen": { + "description": "Whether or not the left panel shall be open on start.", + "type": "boolean", + "default": false + }, + "rightPanelOpen": { + "description": "Whether or not the right panel shall be open on start.", + "type": "boolean", + "default": false + }, + "leftPanelTabIndex": { + "description": "Index of left panel tab to be opened on start, starting from 0.", + "type": "integer", + "default": 0 + }, + "rightPanelTabIndex": { + "description": "Index of right panel tab to be opened on start, starting from 0.", + "type": "integer", + "default": 0 + }, + "parameters": { + "description": "Mapping the parameter type (such as eo:processingCenter) to a settings object.", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "description": "The mandatory parameter type. Use the OpenSearch type, e.g: eo:acquisitionStation.", + "type": "string" }, - "title":{ - "description":"A short description of the parameter, used as a tooltip.", - "type":"string" + "title": { + "description": "A short description of the parameter, used as a tooltip.", + "type": "string" }, - "name":{ - "description":"Parameter name to be displayed. If not set, 'type' is used.", - "type":"string" - }, - "privileged":{ - "description":"Marks the filter as privileged. If the filter is set, other non-privileged filters are not used in the requests. (example usage for UID, where area & time otherwise set will not be part of request).", - "type":"boolean", - "default":false + "name": { + "description": "Parameter name to be displayed. If not set, 'type' is used.", + "type": "string" }, - "options":{ - "description":"Selectable options. Will be rendered as a dropdown.", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "label":{ - "description":"The displayed label of a single option. If not supplied, 'value' is used as label.", - "type":"string" + "privileged": { + "description": "Marks the filter as privileged. If the filter is set, other non-privileged filters are not used in the requests. (example usage for UID, where area & time otherwise set will not be part of request).", + "type": "boolean", + "default": false + }, + "options": { + "description": "Selectable options. Will be rendered as a dropdown.", + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "description": "The displayed label of a single option. If not supplied, 'value' is used as label.", + "type": "string" }, - "value":{ - "description":"The search value to be sent in requests once selected", - "type":"string" + "value": { + "description": "The search value to be sent in requests once selected", + "type": "string" } }, - "required":[ + "required": [ "value" ] } }, - "range":{ - "description":"Whether this search parameter shall be rendered as a dual-slider.", - "type":"boolean", - "default":false + "range": { + "description": "Whether this search parameter shall be rendered as a dual-slider.", + "type": "boolean", + "default": false }, - "min":{ - "description":"The lower boundary for the range. Mandatory for range parameters.", - "type":"number" + "min": { + "description": "The lower boundary for the range. Mandatory for range parameters.", + "type": "number" }, - "max":{ - "description":"The upper boundary for the range. Mandatory for range parameters.", - "type":"number" + "max": { + "description": "The upper boundary for the range. Mandatory for range parameters.", + "type": "number" }, - "step":{ - "description":"Step for the range.", - "type":"number", - "default":1 + "step": { + "description": "Step for the range.", + "type": "number", + "default": 1 } } } }, - "downloadFormats":{ - "description":"A list of download format descriptions that are being used in the download options view for the user to select for downloads via EO-WCS.", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "description":"The name of the download format for display. If not set, 'mimeType' is used.", - "type":"string" + "downloadFormats": { + "description": "A list of download format descriptions that are being used in the download options view for the user to select for downloads via EO-WCS.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the download format for display. If not set, 'mimeType' is used.", + "type": "string" }, - "mimeType":{ - "description":"The mime-type of the format that is sent to the server.", - "type":"string" + "mimeType": { + "description": "The mime-type of the format that is sent to the server.", + "type": "string" } }, - "required":[ + "required": [ "mimeType" ] }, - "default":[ + "default": [ ] }, - "multiDownloadFormats":{ - "description":"A list of download Package format descriptions that are being used in the download options view for the user to select for downloads via EO-WCS (GetEOCoverageSet).", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "description":"The name of the download Package format for display. If not set, 'mimeType' is used.", - "type":"string" + "multiDownloadFormats": { + "description": "A list of download Package format descriptions that are being used in the download options view for the user to select for downloads via EO-WCS (GetEOCoverageSet).", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the download Package format for display. If not set, 'mimeType' is used.", + "type": "string" }, - "mimeType":{ - "description":"The mime-type of the Package format that is sent to the server.", - "type":"string" + "mimeType": { + "description": "The mime-type of the Package format that is sent to the server.", + "type": "string" } }, - "required":[ + "required": [ "mimeType" ] }, - "default":[ + "default": [ ] }, - "downloadProjections":{ - "description":"A list of download projection descriptions that are being used in the download options view for the user to select for downloads via EO-WCS.", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "description":"The name of the download projection for display. If not set, 'identifier' is used.", - "type":"string" + "downloadProjections": { + "description": "A list of download projection descriptions that are being used in the download options view for the user to select for downloads via EO-WCS.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The name of the download projection for display. If not set, 'identifier' is used.", + "type": "string" }, - "identifier":{ - "description":"The identifier of the projection (e.g: EPSG-code) that is sent to the server.", - "type":"string" + "identifier": { + "description": "The identifier of the projection (e.g: EPSG-code) that is sent to the server.", + "type": "string" } }, - "required":[ + "required": [ "identifier" ] }, - "default":[ + "default": [ ] }, - "downloadInterpolations":{ - "description":"Available interpolation methods to choose for download via EO-WCS.", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "description":"The displayed name of the interpolation. If not set, 'identifier' is used.", - "type":"string" + "downloadInterpolations": { + "description": "Available interpolation methods to choose for download via EO-WCS.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The displayed name of the interpolation. If not set, 'identifier' is used.", + "type": "string" }, - "identifier":{ - "description":"The identifier of the interpolation to be sent in the download request", - "type":"string" + "identifier": { + "description": "The identifier of the interpolation to be sent in the download request", + "type": "string" } }, - "required":[ + "required": [ "identifier" ] } }, - "filterSettings":{ - "description":"Configuration settings for preset filter filters", - "type":"object", - "properties":{ - "time":{ - "description":"General configuration settings for a time filter", - "type":"object", - "properties":{ - "collapsed":{ - "description":"If a filter panel starts collapsed.", - "type":"boolean", - "default":false + "filterSettings": { + "description": "Configuration settings for preset filter filters", + "type": "object", + "properties": { + "time": { + "description": "General configuration settings for a time filter", + "type": "object", + "properties": { + "collapsed": { + "description": "If a filter panel starts collapsed.", + "type": "boolean", + "default": false }, - "hidden":{ - "description":"If set to true, the filter is hidden and not rendered.", - "type":"boolean", - "default":false + "hidden": { + "description": "If set to true, the filter is hidden and not rendered.", + "type": "boolean", + "default": false }, - "settings":{ - "description":"Concrete configuration settings for time filter", - "type":"object", - "properties":{ - "mapTime":{ - "description":"The initially selected Time Filter. If maxMapInterval is enabled, also overwrites the selectedTimeDomain.", - "type":"array", - "items":{ - "type":"string", - "format":"date-time" + "settings": { + "description": "Concrete configuration settings for time filter", + "type": "object", + "properties": { + "mapTime": { + "description": "The initially selected Time Filter. If maxMapInterval is enabled, also overwrites the selectedTimeDomain.", + "type": "array", + "items": { + "type": "string", + "format": "date-time" }, - "minItems":2, - "maxItems":2 + "minItems": 2, + "maxItems": 2 } } } } }, - "area":{ - "description":"General configuration settings for an area filter", - "type":"object", - "properties":{ - "collapsed":{ - "description":"If a filter panel starts collapsed.", - "type":"boolean", - "default":false + "area": { + "description": "General configuration settings for an area filter", + "type": "object", + "properties": { + "collapsed": { + "description": "If a filter panel starts collapsed.", + "type": "boolean", + "default": false }, - "hidden":{ - "description":"If set to true, the filter is hidden and not rendered.", - "type":"boolean", - "default":false + "hidden": { + "description": "If set to true, the filter is hidden and not rendered.", + "type": "boolean", + "default": false }, - "settings":{ - "description":"Concrete configuration settings for area filter", - "type":"object", - "properties":{ - "type":{ - "description":"Name of the area filter to be preset.", - "type":"string", - "enum":[ + "settings": { + "description": "Concrete configuration settings for area filter", + "type": "object", + "properties": { + "type": { + "description": "Name of the area filter to be preset.", + "type": "string", + "enum": [ "Polygon", "Point", "Rectangle" ] }, - "coordinates":{ - "description":"Area filter coordinates from geojson spec in map CRS. Example Point: [x, y], Rectangle (bbox): [minx, miny, maxx, maxy], Polygon [[[x,y], [x,y] ...]]. Supports setting polygon with inner ring this way, but catalog must accept it too.", - "type":"array" + "coordinates": { + "description": "Area filter coordinates from geojson spec in map CRS. Example Point: [x, y], Rectangle (bbox): [minx, miny, maxx, maxy], Polygon [[[x,y], [x,y] ...]]. Supports setting polygon with inner ring this way, but catalog must accept it too.", + "type": "array" } } } @@ -553,70 +550,68 @@ } } }, - "termsAndConditionsUrl":{ - "oneOf":[ - { - "description":"The URL to the terms and conditions document for the user to accept.", - "type":"string", - "default":null + "termsAndConditionsUrl": { + "oneOf": [{ + "description": "The URL to the terms and conditions document for the user to accept.", + "type": "string", + "default": null }, { - "description":"An object, mapping the language specifier (as specified in settings.language) to a URL.", - "type":"object" + "description": "An object, mapping the language specifier (as specified in settings.language) to a URL.", + "type": "object" } ] }, - "downloadEnabled":{ - "description":"Whether or not the 'Download' button shall be enabled.", - "type":"boolean", - "default":true - }, - "translations":{ - "description":"Additional translations not covered in the base translations. Keys can be one of the language specifiers: 'en', 'de', 'deinformal'. The values must be objects, mapping the (english) key to the translated value. Must not contain the '#' character.", - "type":"object" - }, - "uploadEnabled":{ - "description":"Whether or not the 'Upload' functionality shall be available. (Loading of shapefiles for geometries).", - "type":"boolean", - "default":true - }, - "selectFilesDownloadEnabled":{ - "description":"Whether 'Download selected files' toggle option is visible.", - "type":"boolean", - "default":true - }, - "areaFilterLayerExtent":{ - "description":"Whether area filter limits layer extent, effectively requesting tiles only for bbox of area filter.", - "type":"boolean", - "default":false - }, - "enable3D":{ - "description":"Client can be switched to 3D mode if 'true'.", - "type":"boolean", - "default":false - }, - "mapMode":{ - "description":"Map mode the client is loaded in. 3D is supported only when enable3D is set to 'true'.", - "type":"string", - "enum":[ + "downloadEnabled": { + "description": "Whether or not the 'Download' button shall be enabled.", + "type": "boolean", + "default": true + }, + "translations": { + "description": "Additional translations not covered in the base translations. Keys can be one of the language specifiers: 'en', 'de', 'deinformal'. The values must be objects, mapping the (english) key to the translated value. Must not contain the '#' character.", + "type": "object" + }, + "uploadEnabled": { + "description": "Whether or not the 'Upload' functionality shall be available. (Loading of shapefiles for geometries).", + "type": "boolean", + "default": true + }, + "selectFilesDownloadEnabled": { + "description": "Whether 'Download selected files' toggle option is visible.", + "type": "boolean", + "default": true + }, + "areaFilterLayerExtent": { + "description": "Whether area filter limits layer extent, effectively requesting tiles only for bbox of area filter.", + "type": "boolean", + "default": false + }, + "enable3D": { + "description": "Client can be switched to 3D mode if 'true'.", + "type": "boolean", + "default": false + }, + "mapMode": { + "description": "Map mode the client is loaded in. 3D is supported only when enable3D is set to 'true'.", + "type": "string", + "enum": [ "2D", "3D" ] }, - "terrainUrl":{ - "description":"The URL of the terrain tiles server required by the 3D viewer.", - "type":"string", - "default":null + "terrainUrl": { + "description": "The URL of the terrain tiles server required by the 3D viewer.", + "type": "string", + "default": null }, - "enableGetEOCoverageSet":{ - "description":"Enabling Multi files Download via GetEOCoverageSet requests if 'true'.", - "type":"boolean", - "default":false + "enableGetEOCoverageSet": { + "description": "Enabling Multi files Download via GetEOCoverageSet requests if 'true'.", + "type": "boolean", + "default": false } }, - "oneOf":[ - { - "required":[ + "oneOf": [{ + "required": [ "center", "zoom", "timeDomain", @@ -624,7 +619,7 @@ ] }, { - "required":[ + "required": [ "extent", "timeDomain", "selectedTimeDomain" @@ -632,164 +627,162 @@ } ] }, - "layerSet":{ - "type":"array", - "items":{ - "$ref":"#/definitions/layer" + "layerSet": { + "type": "array", + "items": { + "$ref": "#/definitions/layer" } }, - "layer":{ - "description":"The definition of a single layer.", - "type":"object", - "properties":{ - "id":{ - "description":"The unique identifier of this layer.", - "type":"string" - }, - "displayName":{ - "description":"The layers name to be presented to the user", - "type":"string" - }, - "displayColor":{ - "description":"The color to distinguish the layer in the layer-list and the TimeSlider. Must be a valid HTML color definition.", - "type":"string" - }, - "noTimeSliderBorder":{ - "description":"TimeSlider bins and records will not have a visible border", - "type":"boolean", - "default":false - }, - "link":{ - "description":"An HTTP link for further information for the layer. This is rendered in the layer list.", - "type":"string" - }, - "display":{ - "description":"Structure to describe how the layer is visually presented. Functionally same parameter 'detailsDisplay' with same options can be used to describe how layer is displayed when single item details panel is shown.", - "type":"object", - "properties":{ - "id":{ - "description":"The ID used for the protocol to identify the layer.", - "type":"string" - }, - "visible":{ - "description":"Whether the layer shall be visible on start.", - "type":"boolean", - "default":false - }, - "protocol":{ - "description":"The protocol used to display the layer.", - "type":"string", - "enum":[ + "layer": { + "description": "The definition of a single layer.", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier of this layer.", + "type": "string" + }, + "displayName": { + "description": "The layers name to be presented to the user", + "type": "string" + }, + "displayColor": { + "description": "The color to distinguish the layer in the layer-list and the TimeSlider. Must be a valid HTML color definition.", + "type": "string" + }, + "noTimeSliderBorder": { + "description": "TimeSlider bins and records will not have a visible border", + "type": "boolean", + "default": false + }, + "link": { + "description": "An HTTP link for further information for the layer. This is rendered in the layer list.", + "type": "string" + }, + "display": { + "description": "Structure to describe how the layer is visually presented. Functionally same parameter 'detailsDisplay' with same options can be used to describe how layer is displayed when single item details panel is shown.", + "type": "object", + "properties": { + "id": { + "description": "The ID used for the protocol to identify the layer.", + "type": "string" + }, + "visible": { + "description": "Whether the layer shall be visible on start.", + "type": "boolean", + "default": false + }, + "protocol": { + "description": "The protocol used to display the layer.", + "type": "string", + "enum": [ "WMS", "WMTS", "XYZ" ] }, - "urls":{ - "description":"A list of base-URLs to retrieve tiles", - "items":{ - "type":"string", - "format":"uri" + "urls": { + "description": "A list of base-URLs to retrieve tiles", + "items": { + "type": "string", + "format": "uri" } }, - "url":{ - "description":"A single base-URL to retrieve tiles", - "type":"string", - "format":"uri" + "url": { + "description": "A single base-URL to retrieve tiles", + "type": "string", + "format": "uri" }, - "matrixSet":{ - "description":"The matrix set used to retrieve tiles. Required for WMTS.", - "type":"string" + "matrixSet": { + "description": "The matrix set used to retrieve tiles. Required for WMTS.", + "type": "string" }, - "matrixIdPrefix":{ - "description":"A prefix to be prepended to the numerical part of the tile matrix ID.", - "type":"string" + "matrixIdPrefix": { + "description": "A prefix to be prepended to the numerical part of the tile matrix ID.", + "type": "string" }, - "matrixIdPostfix":{ - "description":"A postfix to be appended to the numerical part of the tile matrix ID.", - "type":"string" + "matrixIdPostfix": { + "description": "A postfix to be appended to the numerical part of the tile matrix ID.", + "type": "string" }, - "tileSize":{ - "description":"The width and height (in pixels) for each WMS tile to be requested.", - "type":[ + "tileSize": { + "description": "The width and height (in pixels) for each WMS tile to be requested.", + "type": [ "array", "integer" ], - "items":[ - { - "type":"integer", - "minimum":0 + "items": [{ + "type": "integer", + "minimum": 0 }, { - "type":"integer", - "minimum":0 + "type": "integer", + "minimum": 0 } ], - "minimum":0, - "default":256 - }, - "format":{ - "description":"The transfer format used to retrieve tiles. For layers and overlayLayers this should be a format that allows transparency (e.g: PNG).", - "type":"string" - }, - "projection":{ - "description":"The projection identifier in which the tiles will be transferred. E.g: 'EPSG:4326'.", - "type":"string" - }, - "style":{ - "description":"The style in which the tiles will be retrieved.", - "type":"string" - }, - "timeout":{ - "description":"Sets a time limit in milliseconds, to cancel requests once the response takes more than the timeout value", - "type":"integer" - }, - "version":{ - "description":"Override service version parameter.", - "type":"string", - "default":"1.1.0" - }, - "minZoom":{ - "description":"The minimum map zoom level for this layer. Used for map is maximum over all layers.", - "type":"number", - "default":0 - }, - "maxZoom":{ - "description":"The maximum map zoom level for this layer. Used for map is minimum over all layers.", - "type":"number", - "default":28 - }, - "noAntialiasing":{ - "description":"Disables canvas rendering antialiasing when larger zoom than which source does provide is requested (blurry vs sharp image)", - "type":"boolean", - "default":false - }, - "attribution":{ - "description":"A string to be displayed when the layer is displayed. Can contain HTML for specific formatting.", - "type":"string" - }, - "discardZulu":{ - "description":"When this is set to 'true', the trailing 'Z' (for UTC Zulu) will be discarded for the WM(T)S time parameter.", - "type":"boolean", - "default":false - }, - "useMilliseconds":{ - "description":"Determines whether the granularity of the time parameter includes milliseconds.", - "type":"boolean", - "default":true - }, - "adjustTime":{ - "description":"The time parameter values of WMS/WMTS requests are decreased and increased by the given number of seconds.", - "type":[ + "minimum": 0, + "default": 256 + }, + "format": { + "description": "The transfer format used to retrieve tiles. For layers and overlayLayers this should be a format that allows transparency (e.g: PNG).", + "type": "string" + }, + "projection": { + "description": "The projection identifier in which the tiles will be transferred. E.g: 'EPSG:4326'.", + "type": "string" + }, + "style": { + "description": "The style in which the tiles will be retrieved.", + "type": "string" + }, + "timeout": { + "description": "Sets a time limit in milliseconds, to cancel requests once the response takes more than the timeout value", + "type": "integer" + }, + "version": { + "description": "Override service version parameter.", + "type": "string", + "default": "1.1.0" + }, + "minZoom": { + "description": "The minimum map zoom level for this layer. Used for map is maximum over all layers.", + "type": "number", + "default": 0 + }, + "maxZoom": { + "description": "The maximum map zoom level for this layer. Used for map is minimum over all layers.", + "type": "number", + "default": 28 + }, + "noAntialiasing": { + "description": "Disables canvas rendering antialiasing when larger zoom than which source does provide is requested (blurry vs sharp image)", + "type": "boolean", + "default": false + }, + "attribution": { + "description": "A string to be displayed when the layer is displayed. Can contain HTML for specific formatting.", + "type": "string" + }, + "discardZulu": { + "description": "When this is set to 'true', the trailing 'Z' (for UTC Zulu) will be discarded for the WM(T)S time parameter.", + "type": "boolean", + "default": false + }, + "useMilliseconds": { + "description": "Determines whether the granularity of the time parameter includes milliseconds.", + "type": "boolean", + "default": true + }, + "adjustTime": { + "description": "The time parameter values of WMS/WMTS requests are decreased and increased by the given number of seconds.", + "type": [ "array", "integer" ], - "items":[ - { - "type":"integer" + "items": [{ + "type": "integer" }, { - "type":"integer" + "type": "integer" } ] }, @@ -830,9 +823,9 @@ "description":"The dotted path of the parameter. e.g: 'display.extraParameters.LAYERS'", "type":"string" }, - "value":{ - "description":"The actual value to be set.", - "type":"string" + "value": { + "description": "The actual value to be set.", + "type": "string" } } } @@ -926,151 +919,151 @@ } } }, - "extraDownloadIcon":{ - "description":"If set to true, displays an extra download icon in layer list, triggering full resolution download panel. Can be used when search results panel is not used in the app.", - "type":"boolean", - "default":false + "extraDownloadIcon": { + "description": "If set to true, displays an extra download icon in layer list, triggering full resolution download panel. Can be used when search results panel is not used in the app.", + "type": "boolean", + "default": false } }, - "required":[ + "required": [ "id", "protocol", "format" ] }, - "search":{ - "description":"An object to define how the layer can be searched.", - "type":"object", - "properties":{ - "id":{ - "description":"The identifier used for search requests. Required for EO-WCS only.", - "type":"string" - }, - "protocol":{ - "description":"The protocol used to search for records", - "type":"string", - "enum":[ + "search": { + "description": "An object to define how the layer can be searched.", + "type": "object", + "properties": { + "id": { + "description": "The identifier used for search requests. Required for EO-WCS only.", + "type": "string" + }, + "protocol": { + "description": "The protocol used to search for records", + "type": "string", + "enum": [ "EO-WCS", "OpenSearch" ] }, - "url":{ - "description":"The base-URL to send search requests to.", - "type":"string", - "format":"uri" + "url": { + "description": "The base-URL to send search requests to.", + "type": "string", + "format": "uri" }, - "format":{ - "description":"The format (mime-type) to use for OpenSearch requests.", - "type":"string", - "default":null + "format": { + "description": "The format (mime-type) to use for OpenSearch requests.", + "type": "string", + "default": null }, - "method":{ - "description":"The preferred HTTP method to send requests.", - "type":"string", - "enum":[ + "method": { + "description": "The preferred HTTP method to send requests.", + "type": "string", + "enum": [ "GET", "POST" ], - "default":"GET" - }, - "lightweightBuckets":{ - "description":"Whether or not leightweight buckets shall be used for the timeslider. Lightweight buckets only request the number of records for the given histogram bucket. When the total count is below the given histogramThreshold, then the records will be displayed directly.", - "type":"boolean", - "default":false - }, - "histogramThreshold":{ - "description":"The threshold of number of records in the whole visible interval to display the dataset as a histogram instead of individual records. When not specified, the records are always shown.", - "type":"number", - "default":null - }, - "histogramBinCount":{ - "description":"The number of histogram bins to display in histogram mode.", - "type":"number", - "default":20 - }, - "searchLimit":{ - "description":"This is the limit for how many records will be displayed in the search results panel. A warning will be displayed if more items are matched.", - "type":"number", - "default":150 - }, - "loadMore":{ - "description":"This is the count of elements to be fetched when 'Load more' is clicked.", - "type":"number", - "default":150 - }, - "pageSize":{ - "description":"User defined items per page in catalog requests. Lower of server-defined & user-defined is used in the end.", - "type":"number", - "default":null - }, - "switchMultiPolygonCoordinates":{ - "description":"If catalog sends multipolygon coordinates for this layer in lon,lat instead of lat,lon - this needs to be set to 'true'.", - "type":"boolean", - "default":false - }, - "parameters":{ - "description":"Mapping the parameter type (such as eo:processingCenter) to a settings object.", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "type":{ - "description":"The mandatory parameter type. Use the OpenSeach type, e.g: eo:acquisitionStation.", - "type":"string" + "default": "GET" + }, + "lightweightBuckets": { + "description": "Whether or not leightweight buckets shall be used for the timeslider. Lightweight buckets only request the number of records for the given histogram bucket. When the total count is below the given histogramThreshold, then the records will be displayed directly.", + "type": "boolean", + "default": false + }, + "histogramThreshold": { + "description": "The threshold of number of records in the whole visible interval to display the dataset as a histogram instead of individual records. When not specified, the records are always shown.", + "type": "number", + "default": null + }, + "histogramBinCount": { + "description": "The number of histogram bins to display in histogram mode.", + "type": "number", + "default": 20 + }, + "searchLimit": { + "description": "This is the limit for how many records will be displayed in the search results panel. A warning will be displayed if more items are matched.", + "type": "number", + "default": 150 + }, + "loadMore": { + "description": "This is the count of elements to be fetched when 'Load more' is clicked.", + "type": "number", + "default": 150 + }, + "pageSize": { + "description": "User defined items per page in catalog requests. Lower of server-defined & user-defined is used in the end.", + "type": "number", + "default": null + }, + "switchMultiPolygonCoordinates": { + "description": "If catalog sends multipolygon coordinates for this layer in lon,lat instead of lat,lon - this needs to be set to 'true'.", + "type": "boolean", + "default": false + }, + "parameters": { + "description": "Mapping the parameter type (such as eo:processingCenter) to a settings object.", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "description": "The mandatory parameter type. Use the OpenSearch type, e.g: eo:acquisitionStation.", + "type": "string" }, - "title":{ - "description":"A short description of the parameter, used as a tooltip.", - "type":"string" + "title": { + "description": "A short description of the parameter, used as a tooltip.", + "type": "string" }, - "name":{ - "description":"Parameter name to be displayed. If not set, 'type' is used.", - "type":"string" - }, - "privileged":{ - "description":"Marks the filter as privileged. If the filter is set, other non-privileged filters are not used in the requests. (example usage for UID, where area & time otherwise set will not be part of request).", - "type":"boolean", - "default":false - }, - "options":{ - "description":"Selectable options. Will be rendered as a dropdown.", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "label":{ - "description":"The displayed label of a single option. If not supplied, 'value' is used as label.", - "type":"string" + "name": { + "description": "Parameter name to be displayed. If not set, 'type' is used.", + "type": "string" + }, + "privileged": { + "description": "Marks the filter as privileged. If the filter is set, other non-privileged filters are not used in the requests. (example usage for UID, where area & time otherwise set will not be part of request).", + "type": "boolean", + "default": false + }, + "options": { + "description": "Selectable options. Will be rendered as a dropdown.", + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "description": "The displayed label of a single option. If not supplied, 'value' is used as label.", + "type": "string" }, - "value":{ - "description":"The search value to be sent in requests once selected", - "type":"string" + "value": { + "description": "The search value to be sent in requests once selected", + "type": "string" } }, - "required":[ + "required": [ "value" ] } }, - "range":{ - "description":"Whether this search parameter shall be rendered as a dual-slider.", - "type":"boolean", - "default":false + "range": { + "description": "Whether this search parameter shall be rendered as a dual-slider.", + "type": "boolean", + "default": false }, - "min":{ - "description":"The lower boundary for the range. Mandatory for range parameters.", - "type":"number" + "min": { + "description": "The lower boundary for the range. Mandatory for range parameters.", + "type": "number" }, - "max":{ - "description":"The upper boundary for the range. Mandatory for range parameters.", - "type":"number" + "max": { + "description": "The upper boundary for the range. Mandatory for range parameters.", + "type": "number" }, - "fixed":{ - "description":"The fixed value of that parameter.", - "type":"string" + "fixed": { + "description": "The fixed value of that parameter.", + "type": "string" }, - "default":{ - "description":"The default value of this parameter. The type depends on the parameter type.", - "type":[ + "default": { + "description": "The default value of this parameter. The type depends on the parameter type.", + "type": [ "integer", "string", "array" @@ -1079,259 +1072,400 @@ } } }, - "parametersFilterSettings":{ - "description":"General settings for additional-parameters filter panel.", - "type":"object", - "properties":{ - "collapsed":{ - "description":"If a filter panel starts collapsed.", - "type":"boolean", - "default":true + "parametersFilterSettings": { + "description": "General settings for additional-parameters filter panel.", + "type": "object", + "properties": { + "collapsed": { + "description": "If a filter panel starts collapsed.", + "type": "boolean", + "default": true }, - "hidden":{ - "description":"If set to true, the filter is hidden and not rendered.", - "type":"boolean", - "default":false + "hidden": { + "description": "If set to true, the filter is hidden and not rendered.", + "type": "boolean", + "default": false } } } }, - "maxUrlLength":{ - "description":"The maximum URL length of search requests to be sent. Longer URLs will not be sent, but an error will be raised directly.", - "type":"number", - "default":4000 + "maxUrlLength": { + "description": "The maximum URL length of search requests to be sent. Longer URLs will not be sent, but an error will be raised directly.", + "type": "number", + "default": 4000 }, - "thumbnailUrlTemplate":{ - "description":"The template string to construct a thumbnail URL. Use '{{' and '}}' to select values. e.g: 'http://landsat-pds.s3.amazonaws.com/{{properties.s3Path}}/{{properties.title}}_thumb_small.jpg'.", - "type":"string" + "thumbnailUrlTemplate": { + "description": "The template string to construct a thumbnail URL. Use '{{' and '}}' to select values. e.g: 'http://landsat-pds.s3.amazonaws.com/{{properties.s3Path}}/{{properties.title}}_thumb_small.jpg'.", + "type": "string" }, - "quickLookUrlTemplate":{ - "description":"The template string to construct a quickLook URL. Use '{{' and '}}' to select values. e.g: 'http://landsat-pds.s3.amazonaws.com/{{properties.s3Path}}/{{properties.title}}_thumb_small.jpg'. The URL will be used in case thumbnailUrl is not available.", - "type":"string" + "quickLookUrlTemplate": { + "description": "The template string to construct a quickLook URL. Use '{{' and '}}' to select values. e.g: 'http://landsat-pds.s3.amazonaws.com/{{properties.s3Path}}/{{properties.title}}_thumb_small.jpg'. The URL will be used in case thumbnailUrl is not available.", + "type": "string" }, - "descriptionTemplate":{ - "description":"The template string to construct a record description. Use '{{' and '}}' to select values. For example {{properties.mundi.cloudCover}}", - "type":"string" + "descriptionTemplate": { + "description": "The template string to construct a record description. Use '{{' and '}}' to select values. For example {{properties.mundi.cloudCover}}", + "type": "string" }, - "extraFields":{ - "description":"Extra fields to be parsed. Object keys are the JSON path where the output of the simple XPath shall be stored. Values are simple XPath expressions, always relative to a single Atom entry/RSS item.", - "type":"object" + "extraFields": { + "description": "Extra fields to be parsed. Object keys are the JSON path where the output of the simple XPath shall be stored. Values are simple XPath expressions, always relative to a single Atom entry/RSS item.", + "type": "object" }, - "extraFieldsNamespaces":{ - "description":"Namespace code to URL mapping for namespaces used in 'extraFields'.", - "type":"object" + "extraFieldsNamespaces": { + "description": "Namespace code to URL mapping for namespaces used in 'extraFields'.", + "type": "object" }, - "countZeroRecords":{ - "description":"When this setting is set to true, the requested number of records is zero when only the count is required.", - "type":"boolean" + "countZeroRecords": { + "description": "When this setting is set to true, the requested number of records is zero when only the count is required.", + "type": "boolean" }, - "dropEmptyParameters":{ - "description":"When this setting is set to true, empty parameters (with no value set) will be dropped entirely.", - "type":"boolean" + "dropEmptyParameters": { + "description": "When this setting is set to true, empty parameters (with no value set) will be dropped entirely.", + "type": "boolean" }, - "required":[ + "required": [ "protocol", "url" ] }, - "download":{ - "description":"An object to define how records of the layer can be downloaded.", - "type":"object", - "properties":{ - "protocol":{ - "description":"The protocol used to download records.", - "type":"string", - "enum":[ + "download": { + "description": "An object to define how records of the layer can be downloaded.", + "type": "object", + "properties": { + "protocol": { + "description": "The protocol used to download records.", + "type": "string", + "enum": [ "EO-WCS", "URL", "S3", "QUOTE" ], - "//TODO":"This list will be extended in the future. Currently, this setting is not used with OpenSearch, as the download information is embedded in the search response." + "//TODO": "This list will be extended in the future. Currently, this setting is not used with OpenSearch, as the download information is embedded in the search response." }, - "url":{ - "description":"The base-URL to send download requests to.", - "type":"string", - "format":"uri" + "url": { + "description": "The base-URL to send download requests to.", + "type": "string", + "format": "uri" }, - "method":{ - "description":"The preferred HTTP method to send requests.", - "type":"string", - "enum":[ + "method": { + "description": "The preferred HTTP method to send requests.", + "type": "string", + "enum": [ "GET", "POST" ], - "default":"'GET' for URL based protocols, 'POST' for EO-WCS." + "default": "'GET' for URL based protocols, 'POST' for EO-WCS." }, - "axisNames":{ - "description":"The axis names to include the subset in WCS requests. Example [lon, lat]", - "type":"array", - "items":{ - "type":"string" + "axisNames": { + "description": "The axis names to include the subset in WCS requests. Example [lon, lat]", + "type": "array", + "items": { + "type": "string" }, - "minItems":2, - "maxItems":2 - }, - "rewrite":{ - "description":"Settings object to define URL rewrites.", - "type":"object", - "properties":{ - "from":{ - "description":"The part of the URL that shall be rewritten (replaced). Either Will be interpreted as a regular expression - usage without quotes or a template can be used - '{{ and }}' to use Record properties in regex. For example {{ id }} to select ID of product.", - "type":"string" + "minItems": 2, + "maxItems": 2 + }, + "rewrite": { + "description": "Settings object to define URL rewrites.", + "type": "object", + "properties": { + "from": { + "description": "The part of the URL that shall be rewritten (replaced). Either Will be interpreted as a regular expression - usage without quotes or a template can be used - '{{ and }}' to use Record properties in regex. For example {{ id }} to select ID of product.", + "type": "string" }, - "to":{ - "description":"The value that shall replace the previously selected part of the URL (via 'from').", - "type":"string" + "to": { + "description": "The value that shall replace the previously selected part of the URL (via 'from').", + "type": "string" } }, - "required":[ + "required": [ "from", "to" ] }, - "pathPrefix":{ - "description":"Part of the download path to be considered not part of the bucket and download prefix. Necessary for S3 URLs", - "type":"string" + "pathPrefix": { + "description": "Part of the download path to be considered not part of the bucket and download prefix. Necessary for S3 URLs", + "type": "string" }, - "quoteModalIntro":{ - "description":"HTML content of Get a Quote Modal description in case it needs to be customized in configuration.", - "type":"string" + "quoteModalIntro": { + "description": "HTML content of Get a Quote Modal description in case it needs to be customized in configuration.", + "type": "string" } }, - "required":[ + "required": [ "protocol", "url" ] }, - "fullResolution":{ - "description":"Configuration settings for the full resolution download", - "type":"object", - "properties":{ - "protocol":{ - "description":"The protocol used for full resolution download.", - "type":"string", - "enum":[ + "fullResolution": { + "description": "Configuration settings for the full resolution download", + "type": "object", + "properties": { + "protocol": { + "description": "The protocol used for full resolution download.", + "type": "string", + "enum": [ "EO-WCS" ] }, - "id":{ - "description":"The ID used for the protocol to identify the coverage.", - "type":"string" - }, - "url":{ - "description":"The base-URL to send full resolution download requests to.", - "type":"string", - "format":"uri" - }, - "cqlParameterName":{ - "description":"The name of the CQL parameter name for WCS requests. When set, the CQL filtering is enabled for this layer.", - "type":"string" - }, - "cqlMapping":{ - "description":"The mapping of the search filter name to the attribute names used for CQL.", - "type":"object" - }, - "maxSizeWarning":{ - "description":"A warning is shown when the download is expected to be bigger than the configured number in MB. The estimate is calculated as 'sizeX * sizeY * #bands * 8 / 1024 / 1024'.", - "type":"number", - "default":20 - }, - "maxSizeResolution":{ - "description":"Resolution used to calculate the estimate for 'maxSizeWarning'. Default is around 10m in degrees around equator.", - "type":"number", - "default":0.0000858306884765625 - }, - "maxBboxEdgeSize":{ - "description":"A warning is shown when any edge of bounding box exceeds this value in Map CRS.", - "type":"number", - "default":null - }, - "maxAllowedResolution":{ - "description":"A warning is shown when user input resolution is greater than this value in Map CRS.", - "type":"number", - "default":null - }, - "disableTimeSubsetting":{ - "description":"Disable adding time subsetting to WCS request even if available from TimeSlider.", - "type":"boolean", - "default":false - }, - "axisNames":{ - "description":"The axis names to include the subset in WCS requests. Example [lon, lat]", - "type":"array", - "items":{ - "type":"string" + "id": { + "description": "The ID used for the protocol to identify the coverage.", + "type": "string" + }, + "url": { + "description": "The base-URL to send full resolution download requests to.", + "type": "string", + "format": "uri" + }, + "cqlParameterName": { + "description": "The name of the CQL parameter name for WCS requests. When set, the CQL filtering is enabled for this layer.", + "type": "string" + }, + "cqlMapping": { + "description": "The mapping of the search filter name to the attribute names used for CQL.", + "type": "object" + }, + "maxSizeWarning": { + "description": "A warning is shown when the download is expected to be bigger than the configured number in MB. The estimate is calculated as 'sizeX * sizeY * #bands * 8 / 1024 / 1024'.", + "type": "number", + "default": 20 + }, + "maxSizeResolution": { + "description": "Resolution used to calculate the estimate for 'maxSizeWarning'. Default is around 10m in degrees around equator.", + "type": "number", + "default": 0.0000858306884765625 + }, + "maxBboxEdgeSize": { + "description": "A warning is shown when any edge of bounding box exceeds this value in Map CRS.", + "type": "number", + "default": null + }, + "maxAllowedResolution": { + "description": "A warning is shown when user input resolution is greater than this value in Map CRS.", + "type": "number", + "default": null + }, + "disableTimeSubsetting": { + "description": "Disable adding time subsetting to WCS request even if available from TimeSlider.", + "type": "boolean", + "default": false + }, + "axisNames": { + "description": "The axis names to include the subset in WCS requests. Example [lon, lat]", + "type": "array", + "items": { + "type": "string" }, - "minItems":2, - "maxItems":2 - }, - "fields":{ - "description":"Available fields to select for download.", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "description":"The displayed name of the field. If not set, 'identifier' is used.", - "type":"string" + "minItems": 2, + "maxItems": 2 + }, + "fields": { + "description": "Available fields to select for download.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The displayed name of the field. If not set, 'identifier' is used.", + "type": "string" }, - "identifier":{ - "description":"The identifier of the field to be sent in the download request", - "type":"string" + "identifier": { + "description": "The identifier of the field to be sent in the download request", + "type": "string" } }, - "required":[ + "required": [ "identifier" ] } }, - "interpolations":{ - "description":"Available interpolation methods to choose for download.", - "type":"array", - "items":{ - "type":"object", - "properties":{ - "name":{ - "description":"The displayed name of the interpolation. If not set, 'identifier' is used.", - "type":"string" + "interpolations": { + "description": "Available interpolation methods to choose for download.", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "description": "The displayed name of the interpolation. If not set, 'identifier' is used.", + "type": "string" }, - "identifier":{ - "description":"The identifier of the interpolation to be sent in the download request", - "type":"string" + "identifier": { + "description": "The identifier of the interpolation to be sent in the download request", + "type": "string" } }, - "required":[ + "required": [ "identifier" ] } } } }, - "processing":{ - "description":"Configuration settings for the processing button", - "type":"object", - "properties":{ - "url":{ - "description":"The URL to send processing POST requests to.", - "type":"string", - "format":"uri" - }, - "method":{ - "description":"The method used to send processing requests. 'fetch' sends a POST request with a JSON payload in the current tab, 'form' simulates sending a form in a new tab with JSON as the value of the 'request' field.", - "type":"string", - "enum":[ + "processing": { + "description": "Configuration settings for the processing button", + "type": "object", + "properties": { + "url": { + "description": "The URL to send processing POST requests to.", + "type": "string", + "format": "uri" + }, + "method": { + "description": "The method used to send processing requests. 'fetch' sends a POST request with a JSON payload in the current tab, 'form' simulates sending a form in a new tab with JSON as the value of the 'request' field.", + "type": "string", + "enum": [ "fetch", "form" ] } } }, - "required":[ - "id", - "displayName", - "display" - ] + "wpsProcessing": { + "description": "Configuration for WPS Processing interface", + "type": "object", + "properties": { + "url": { + "description": "The URL to send processing requests to.", + "type": "string", + "format": "uri" + }, + "version": { + "description": "Version of the WPS protocol to use internally. Currently supported versions: 1.0.0.", + "type": "string", + "enum": [ + "1.0.0" + ] + }, + "processes": { + "description": "Array of WPS process configurations.", + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "description": "Name of the process to be displayed to the user. If not set, 'id' is used.", + "type": "string" + }, + "id": { + "description": "Id of the process to pass to the WPS interface. Mandatory.", + "type": "string" + }, + "description": { + "description": "Short description of a process to show to the user.", + "type": "string" + }, + "additionalInputs": { + "description": "Set of additional key:value pairs to be added to the request as LiteralData inputs but not shown to the user.", + "type": "object" + }, + "hasBBox": { + "description": "Determines if the process's inputs includes a bbox, when set to true coverage/product extent would be used as the default bbox.", + "type": "boolean" + }, + "CoverageIdUsage": { + "description": "Determines if the process's inputs includes coverage ID.", + "type": "boolean" + }, + "inputs": { + "description": "Array of input definitions, selectable for the process.", + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "description": "Type of input parameter. Defines how the input will be requested from the user and later encoded to the request.", + "type": "string", + "enum": [ + "bbox", + "line", + "string", + "selection" + ] + }, + "description": { + "description": "Providing information about the parameter - for example adding info about unit of measurement.", + "type": "string" + }, + "title": { + "description": "Input parameter label to be shown to the user. If not supplied, 'id' is used as label.", + "type": "string" + }, + "id": { + "description": "Input parameter id to be passed into the request. Mandatory.", + "type": "string" + }, + "line": { + "description": "Defines if the input is a line ", + "type": "boolean" + }, + "options": { + "description": "Options for 'selection' input type. Will be rendered as a dropdown.", + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "description": "The displayed label of a single option. If not supplied, 'value' is used as label.", + "type": "string" + }, + "value": { + "description": "The value to be passed to the WPS interface once selected.", + "type": "string" + } + }, + "required": [ + "value" + ] + } + } + } + } + }, + "outputs": { + "description": "Array of outputs, selectable for the process. Rendered as a dropdown list.", + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "description": "Output parameter label to be shown to the user. If not supplied, 'id' is used as label.", + "type": "string" + }, + "id": { + "description": "Output parameter id to be passed into the request. Mandatory.", + "type": "string" + }, + "mime_types": { + "description": "Mime types to choose from for the selected output. Will be rendered as a dropdown.", + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "description": "The displayed label of a single option. If not supplied, 'id' is used as label.", + "type": "string" + }, + "id": { + "description": "The id mime type to be added to the selected output.", + "type": "string" + } + }, + "required": [ + "id" + ] + } + } + } + } + } + }, + "required": [ + "id" + ] + } + } + } + } } } } diff --git a/client/src/languages/en.json b/client/src/languages/en.json index 970f83544eae169460f2b1be6c92c470f0f7d357..8a49041c337c3fc425a21b18c427363325077d32 100644 --- a/client/src/languages/en.json +++ b/client/src/languages/en.json @@ -15,7 +15,8 @@ "confirm_quote_1": "To get a quote, you will be forwarded to Mundi helpdesk to give additional information.", "confirm_quote_2": "But first please copy the Quote information to your clipboard using the 'clipboard' Icon and then click 'Get a Quote'.", "confirm_note": "Note, the browser might open multiple confirmation dialogs or issue a warning. Besides, typically browsers have a limit of 6 concurrent connections. If popups are blocked by your browser, please enable them for this site.", - "products_number_warning":"Warning! A limit has been set for downloading up to 10 products in one request. Please select 10 or less products.", + "products_number_warning":"Warning! A limit has been set for downloading up to {{downloadLimitCount}} image files in one request.", + "wps_error": "Unknown Error! Please check your inputs values. You can view the specific error message by opening the 'Developer Tool' and select 'Network tap'. Filter the requests list by searching the expression 'ows' ( or by clicking the 'Bad Request' link in the console) .click the The faulty request (marked in red) and read the response ( by clicking the Response Tap).", "download_size_warning": "The estimated size of the download without compression is {{estimated_size}}MB. This might exceed the capabilities of the service.", "max_bbox_warning": "Maximum size of bounding box: {{max_bbox_size}} was exceeded by: {{max_bbox_exceed}} on axis: {{max_bbox_axis}}.", "max_resolution_warning": "Maximum resolution: {{max_resolution}} was exceeded. Attempt to download might fail with an error.", diff --git a/client/src/lib/wps-js-all.js b/client/src/lib/wps-js-all.js new file mode 100644 index 0000000000000000000000000000000000000000..54a5ba9f7ca18f925c07dac115978e288b9c0b59 --- /dev/null +++ b/client/src/lib/wps-js-all.js @@ -0,0 +1,3976 @@ +/** + * JavaScript simple inheritance + * by Alejandro Gonzalez Sole (base on John Resig's simple inheritance script) + * MIT Licensed. + * https://stackoverflow.com/a/15052240 + **/ +var initializing = false, + fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.* /; + +function Class(){}; + +function inheritClass(superClass){ + var self = this; + function Class(){ + if (!initializing && this.init) + this.init.apply(this, arguments); + } + + Class.prototype = superClass.prototype; + Class.prototype._constructor = superClass; + Class.prototype.constructor = Class; + Class.extend = extendClass; + //currenlty if you inhert multiple classes it breaks + Class.inherit = inheritClass; + return Class; +}; + +function extendClass(prop) { + var self = this; + var _super = self.prototype; + + function Class(){ + if (!initializing && this.init) + this.init.apply(this, arguments); + } + + initializing = true; + var prototype = new self(); + initializing = false; + + for (var name in prop) { + prototype[name] = typeof prop[name] == "function" && + typeof _super[name] == "function" && fnTest.test(prop[name]) ? + (function(name, fn){ + return function() { + var tmp = this._super; + this._super = _super[name]; + var ret = fn.apply(this, arguments); + this._super = tmp; + return ret; + }; + })(name, prop[name]) : prop[name]; + } + + Class.prototype = prototype; + Class.prototype.constructor = Class; + Class.extend = extendClass; + Class.inherit = inheritClass; + + return Class; +}; + +Class.extend = extendClass; +Class.inherit = inheritClass; + + +var WPS_VERSION_1_0_0 = "1.0.0" +var WPS_VERSION_2_0_0 = "2.0.0" + +var GET_CAPABILITIES_TYPE = "GetCapabilities"; +var DESCRIBE_PROCESS_TYPE = "DescribeProcess"; +var EXECUTE_TYPE = "Execute"; +var GET_STATUS_TYPE = "GetStatus"; +var GET_RESULT_TYPE = "GetResult"; + +var OWS_11_NAMESPACE = "http://www.opengis.net/ows/1.1"; +var WPS_100_NAMESPACE = "http://www.opengis.net/wps/1.0.0"; + +var METHOD_POST = "POST"; +var METHOD_GET = "GET"; +var PARAM_WPS_REQUEST_URL = "wpsRequestUrl"; +var PARAM_WPS_REQUEST_TYPE = "wpsRequestType"; + +var USE_PROXY = false; +var PROXY_URL = ""; +var PROXY_TYPE = ""; + +var USER_TEMPLATE_CAPABILITIES_MARKUP = null; +var USER_TEMPLATE_PROCESS_DESCRIPTION_MARKUP = null; +var USER_TEMPLATE_EXECUTE_RESPONSE_MARKUP = null; + +var DATA_TYPE_LITERAL = "LITERAL"; +var DATA_TYPE_COMPLEX = "COMPLEX"; +var DATA_TYPE_BBOX = "BBOX"; + +function wpsResetSetup() { + USE_PROXY = false; + PROXY_URL = ""; + PROXY_TYPE = ""; + + USER_TEMPLATE_CAPABILITIES_MARKUP = null; + USER_TEMPLATE_PROCESS_DESCRIPTION_MARKUP = null; + USER_TEMPLATE_EXECUTE_RESPONSE_MARKUP = null; +} + + +function equalsString(a, b) { + if (!a) { + return false; + } + + if (!b) { + return false; + } + + return jQuery.trim(a).localeCompare(jQuery.trim(b)) == 0; +} + +function stringStartsWith(target, sub) { + return target.indexOf(sub) == 0; +} + +function fillXMLTemplate(template, properties) { + var result = template; + + for (var key in properties) { + if (properties.hasOwnProperty(key)) { + result = result.replace("${"+key+"}", properties[key]); + } + } + + return result; +} + +function isImageMimetype(mimetype) { + + return ($.inArray(mimetype, imageMimetypes) > -1); +} + +function stringify(format){ + + return '{"mimeType" : "' + (format.mimeType ? format.mimeType : "") + '", "schema" : "' + (format.schema ? format.schema : "") + '", "encoding" : "' + (format.encoding ? format.encoding : "") + '"}'; + +} + +function escapeCharactersForSelect(id){ + + var result = id.replace(/\./g,"\\."); + + return result; +} + +var BaseResponse = Class.extend({ + + init : function(responseDocument) { + /* + * represents the raw response document returned by the WPS + */ + this.responseDocument = responseDocument; + }, + + getRawResponseDocument : function() { + return this.responseDocument; + } + +}); + +var CapabilitiesResponse = BaseResponse + .extend({ + + /* + * { + "capabilities":{ + "serviceIdentification":{ + "title":"52°North WPS 3.3.2-SNAPSHOT", + "abstractValue":"Service based on the 52°North implementation of WPS 1.0.0", + "keywords":[ + "WPS", + "geospatial", + "geoprocessing" + ], + "serviceType":"WPS", + "serviceTypeVersions":[ + "ServiceTypeVersion":"1.0.0" + ] + "fees":"NONE", + "accessConstraints":"NONE" + }, + "serviceProvider":{ + "providerName":"52North", + "providerSite":"http://www.52north.org/", + "serviceContact":{ + "individualName":"", + "contactInfo":{ + "address":{ + "deliveryPoint":"", + "city":"", + "administrativeArea":"", + "postalCode":"", + "country":"", + "electronicMailAddress":"" + } + } + } + }, + "operations":[ + { + "DCP":{ + "HTTP":{ + "get":"http://geostatistics.demo.52north.org:80/wps/WebProcessingService?", + "post":"http://geostatistics.demo.52north.org:80/wps/WebProcessingService" + } + }, + "name":"GetCapabilities" + }, + { + "DCP":{ + "HTTP":{ + "get":"http://geostatistics.demo.52north.org:80/wps/WebProcessingService?", + "post":"http://geostatistics.demo.52north.org:80/wps/WebProcessingService" + } + }, + "name":"DescribeProcess" + } + ], + "processes":[ + { + "title":"org.n52.wps.server.algorithm.CSWLoDEnablerStarter", + "identifier":"org.n52.wps.server.algorithm.CSWLoDEnablerStarter", + "processVersion":"1.1.0", + "jobControlOptions":"sync-execute async-execute", + "outputTransmission":"value reference" + }, + { + "title":"org.n52.wps.server.algorithm.JTSConvexHullAlgorithm", + "identifier":"org.n52.wps.server.algorithm.JTSConvexHullAlgorithm", + "processVersion":"1.1.0", + "jobControlOptions":"sync-execute async-execute", + "outputTransmission":"value reference" + } + ], + "service":"WPS", + "version":"2.0.0" + } +} + */ + + init : function(wpsResponse) { + this.responseDocument = wpsResponse; + + /* + * create an empty new instance of capabilities object + */ + + this.capabilities = new Object(); + + /* + * service and version + */ + this.capabilities.service = "WPS"; + this.capabilities.version = ""; + + /* + * service identification + */ + this.capabilities.serviceIdentification = new Object(); + this.capabilities.serviceIdentification.title = ""; + this.capabilities.serviceIdentification.abstractValue = ""; + this.capabilities.serviceIdentification.keywords = new Array; + this.capabilities.serviceIdentification.serviceType = "WPS"; + this.capabilities.serviceIdentification.serviceTypeVersions = new Array; + this.capabilities.serviceIdentification.fees = ""; + this.capabilities.serviceIdentification.accessConstraints = ""; + + /* + * service provider + */ + this.capabilities.serviceProvider = new Object(); + this.capabilities.serviceProvider.providerName = ""; + this.capabilities.serviceProvider.providerSite = ""; + this.capabilities.serviceProvider.serviceContact = new Object(); + this.capabilities.serviceProvider.serviceContact.individualName = ""; + this.capabilities.serviceProvider.serviceContact.contactInfo = new Object(); + this.capabilities.serviceProvider.serviceContact.contactInfo.address = new Object(); + this.capabilities.serviceProvider.serviceContact.contactInfo.address.deliveryPoint = ""; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.city = ""; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.administrativeArea = ""; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.postalCode = ""; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.country = ""; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.electronicMailAddress = ""; + + /* + * operations with one dummy entry + */ + this.capabilities.operations = new Array(1); + this.capabilities.operations[0] = this.createOperation("dummy", + "dummyGet", "dummyPost"); + + /* + * languages + */ + this.capabilities.languages = new Array(); + + /* + * processes and dummy entry + */ + this.capabilities.processes = new Array(1); + this.capabilities.processes[0] = this.createProcess("title", "id", + "procVersion", "jobCOntrolOptions", + "outputTransmission"); + + /* + * now let child classes fill this empty instance with values + */ + this.instantiate(wpsResponse); + + }, + + instantiate : function(wpsResponse) { + // override this method in child classes to properly set the + // values + }, + + createProcess : function(title, identifier, processVersion, jobControlOutputs, + outputTransmission) { + + var process = new Object(); + process.title = title; + process.identifier = identifier; + process.processVersion = processVersion; + process.jobControlOptions = jobControlOutputs; + process.outputTransmission = outputTransmission; + + return process; + }, + + createOperation : function(name, getUrl, postUrl) { + var operation = new Object(); + operation.DCP = new Object(); + operation.DCP.HTTP = new Object(); + operation.DCP.HTTP.name = name; + operation.DCP.HTTP.get = getUrl; + operation.DCP.HTTP.post = postUrl; + + return operation; + }, + + createArrayFromTextValues : function(nodes){ + var array = new Array(); + + for (var int = 0; int < nodes.length; int++) { + var textValue = $(nodes[int]).text(); + + array[int] = textValue; + + } + return array; + } + + }); + + + + +/** + * nearly all values are equal fpr WPS 1.0 and WPS 2.0. Thus most of them are hardcoded here! + * Only some different values have to be set individually + */ +var CapabilitiesResponse_xml = CapabilitiesResponse.extend({ + + /** + * @wpsResponse should be an XML v2.0.0 WPS Capabilities document + */ + instantiate : function(wpsResponse){ + /* + * set values + */ + + var xmlCapabilities = $(wpsResponse).find("wps\\:Capabilities, Capabilities"); + + /* + * version and service + */ + this.capabilities.version = xmlCapabilities.attr("version"); + this.capabilities.service = xmlCapabilities.attr("service"); + + /* + * service identification + */ + var xmlServiceIdentification = xmlCapabilities.find("ows\\:ServiceIdentification, ServiceIdentification"); + this.capabilities.serviceIdentification.title = xmlServiceIdentification.find("ows\\:Title , Title").text(); + this.capabilities.serviceIdentification.abstractValue = xmlServiceIdentification.find("ows\\:Abstract, Abstract").text(); + this.capabilities.serviceIdentification.keywords = this.createArrayFromTextValues(xmlServiceIdentification.find("ows\\:Keyword, Keyword")); + this.capabilities.serviceIdentification.serviceType = xmlServiceIdentification.find("ows\\:ServiceType, ServiceType").text(); + this.capabilities.serviceIdentification.serviceTypeVersions = this.createArrayFromTextValues(xmlServiceIdentification.find("ows\\:ServiceTypeVersion, ServiceTypeVersion")); + this.capabilities.serviceIdentification.fees = xmlServiceIdentification.find("ows\\:Fees, Fees").text(); + this.capabilities.serviceIdentification.accessConstraints = xmlServiceIdentification.find("ows\\:AccessConstraints, AccessConstraints").text(); + + /* + * service provider + */ + var xmlServiceProvider = $(xmlCapabilities).find("ows\\:ServiceProvider, ServiceProvider"); + this.capabilities.serviceProvider.providerName = xmlServiceProvider.find("ows\\:ProviderName, ProviderName").text() || undefined; + var providerSiteNode=xmlServiceProvider.find("ows\\:ProviderSite, ProviderSite") || undefined; + this.capabilities.serviceProvider.providerSite = providerSiteNode.attr("href") || providerSiteNode.attr("xlin\\:href") || providerSiteNode.attr("xlink\\:href") || undefined; + var serviceContact = xmlServiceProvider.find("ows\\:ServiceContact, ServiceContact") || undefined; + this.capabilities.serviceProvider.serviceContact.individualName = serviceContact.find("ows\\:IndividualName, IndividualName").text() || undefined; + var address = serviceContact.find("ows\\:Address, Address"); + this.capabilities.serviceProvider.serviceContact.contactInfo.address.deliveryPoint = address.find("ows\\:DeliveryPoint, DeliveryPoint").text() || undefined; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.city = address.find("ows\\:City, City").text() || undefined; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.administrativeArea = address.find("ows\\:AdministrativeArea, AdministrativeArea").text() || undefined; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.postalCode = address.find("ows\\:PostalCode, PostalCode").text() || undefined; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.country = address.find("ows\\:Country, Country").text() || undefined; + this.capabilities.serviceProvider.serviceContact.contactInfo.address.electronicMailAddress = address.find("ows\\:ElectronicMailAddress, ElectronicMailAddress").text() || undefined; + + /* + * operations + */ + var operationsMetadata = xmlCapabilities.find("ows\\:OperationsMetadata, OperationsMetadata"); + this.capabilities.operations = this.createOperationsArray(operationsMetadata.find("ows\\:Operation, Operation")); + + /* + * languages + */ + var languages = this.extractAllLanguages(xmlCapabilities); + this.capabilities.languages = this.createArrayFromTextValues(languages.find("ows\\:Language, Language")); + + /* + * processes + */ + var processOfferings = this.extractProcessOfferings(xmlCapabilities); + this.capabilities.processes = this.createProcessesArray(this.extractAllProcesses(processOfferings)); + }, + + /** + * extracts all languages. + * + * Differs for each WPS version + */ + extractAllLanguages : function(xmlCapabilities){ + /* + * override in child class + */ + }, + + /** + * extracts process offering xml node. + * + * Differs for each WPS version + */ + extractProcessOfferings : function(xmlCapabilities){ + /* + * override in child class + */ + return xmlCapabilities.find("wps\\:Contents, Contents"); + }, + + /** + * extracts all process xml nodes. + * + * Differs for each WPS version + */ + extractAllProcesses : function(processOfferingsXml){ + /* + * override in child class + */ + }, + + createOperationsArray : function(nodes){ + var array = new Array(nodes.length); + + for (var int = 0; int < nodes.length; int++) { + var xmlOperation = $(nodes[int]); + var name = xmlOperation.attr("name"); + var getUrlNode=xmlOperation.find("ows\\:Get, Get"); + var getUrl = getUrlNode.attr("href") || getUrlNode.attr("xlin\\:href") || getUrlNode.attr("xlink\\:href"); + var PostUrlNode=xmlOperation.find("ows\\:Post, Post"); + var postUrl = PostUrlNode.attr("href") || PostUrlNode.attr("xlin\\:href") || PostUrlNode.attr("xlink\\:href"); + + array[int] = this.createOperation(name, getUrl, postUrl); + } + return array; + }, + + createProcessesArray : function(nodes){ + var array = new Array(nodes.length); + + for (var int = 0; int < nodes.length; int++) { + var xmlProcess = $(nodes[int]); + + var title = xmlProcess.find("ows\\:Title, Title").text(); + var identifier = xmlProcess.find("ows\\:Identifier, Identifier").text(); + var processVersion = xmlProcess.attr("processVersion") || xmlProcess.attr("wps\\:processVersion"); + var jobControlOutputs = this.extractJobControlOptions(xmlProcess); + var outputTransmission = this.extractOutputTransmission(xmlProcess); + + array[int] = this.createProcess(title, identifier, processVersion, jobControlOutputs, outputTransmission); + + } + return array; + }, + + /** + * extracts jobControlOptions parameter. + * + * Differs for each WPS version + */ + extractJobControlOptions : function(xmlProcess){ + /* + * override in child class + */ + }, + + /** + * extracts outputTransmission parameter. + * + * Differs for each WPS version + */ + extractOutputTransmission : function(xmlProcess){ + /* + * override in child class + */ + } + +}); + +var CapabilitiesResponse_v1_xml = CapabilitiesResponse_xml.extend({ + + extractAllLanguages : function(xmlCapabilities){ + return xmlCapabilities.find("wps\\:Languages, Languages").find("wps\\:Supported, Supported"); + }, + + extractProcessOfferings : function(xmlCapabilities){ + /* + * override in child class + */ + return xmlCapabilities.find("wps\\:ProcessOfferings, ProcessOfferings"); + }, + + extractAllProcesses : function(processOfferingsXml){ + return processOfferingsXml.find("wps\\:Process, Process"); + }, + + extractJobControlOptions : function(xmlProcess){ + /* + * override in child class + */ + return "For WPS 1.0 please execute a DescribeProcess request with this process identifier. This parameter will be included in the returned process description!"; + }, + + extractOutputTransmission : function(xmlProcess){ + return "For WPS 1.0 please execute a DescribeProcess request with this process identifier. This parameter will be included in the returned process description!"; + } + +}); + +var CapabilitiesResponse_v2_xml = CapabilitiesResponse_xml.extend({ + + extractAllLanguages : function(xmlCapabilities){ + return xmlCapabilities.find("ows\\:Languages, Languages"); + }, + + extractProcessOfferings : function(xmlCapabilities){ + return xmlCapabilities.find("wps\\:Contents, Contents"); + }, + + extractAllProcesses : function(processOfferingsXml){ + return processOfferingsXml.find("wps\\:ProcessSummary, ProcessSummary"); + }, + + extractJobControlOptions : function(xmlProcess){ + return xmlProcess.attr("jobControlOptions"); + }, + + extractOutputTransmission : function(xmlProcess){ + return xmlProcess.attr("outputTransmission"); + } + +}); + +var DescribeProcessResponse = BaseResponse.extend({ + + init : function(wpsResponse) { + this.responseDocument = wpsResponse; + + /* + * empty process description + */ + this.processOffering = new Object(); + + /* + * service and version + */ + this.processOffering.service = "WPS"; + this.processOffering.version = ""; + + /* + * process + */ + this.processOffering.process = new Object(); + this.processOffering.process.title = ""; + this.processOffering.process.abstractValue = ""; + this.processOffering.process.identifier = ""; + this.processOffering.process.inputs = new Array(); + this.processOffering.process.outputs = new Array(); + + /* + * attributes + */ + this.processOffering.processVersion = ""; + this.processOffering.jobControlOptions = []; + this.processOffering.outputTransmissionModes = []; + + this.instantiate(wpsResponse); + }, + + instantiate: function(wpsResponse){ + /* + * override this method in child classes to instantiate the object + */ + }, + + createLiteralDataInput : function(title, abstractValue, identifier, + minOccurs, maxOccurs, formatArray, literalDataDomainArray) { + var literalDataInput = new Object(); + + this.instantiateCommonInputValues(title, abstractValue, identifier, + minOccurs, maxOccurs, literalDataInput); + + //TODO what about metadata node? + literalDataInput.literalData = new Object(); + literalDataInput.literalData.formats = formatArray; + literalDataInput.literalData.literalDataDomains = literalDataDomainArray; + + return literalDataInput; + }, + + createComplexDataInput : function(title, abstractValue, identifier, + minOccurs, maxOccurs, formatArray) { + var complexDataInput = new Object(); + + this.instantiateCommonInputValues(title, abstractValue, identifier, + minOccurs, maxOccurs, complexDataInput); + + //TODO what about metadata node? + complexDataInput.complexData = new Object(); + complexDataInput.complexData.formats = formatArray; + + return complexDataInput; + + }, + + createBboxInput : function(title, abstractValue, identifier, minOccurs, + maxOccurs, formatArray, crsArray) { + + var bboxInput = new Object(); + + this.instantiateCommonInputValues(title, abstractValue, identifier, + minOccurs, maxOccurs, bboxInput); + + //TODO what about metadata node? + bboxInput.boundingBoxData = new Object(); + bboxInput.boundingBoxData.formats = formatArray; + + bboxInput.boundingBoxData.supportedCRSs = crsArray; + + return bboxInput; + + }, + + createFormat : function(mimeType, encoding, schema) { + var format = new Object(); + format.mimeType = mimeType; + format.encoding = encoding; + format.schema = schema; + + return format; + }, + + instantiateCommonInputValues : function(title, abstractValue, identifier, + minOccurs, maxOccurs, inputObject) { + + inputObject.title = title; + + inputObject.abstractValue = abstractValue; + + inputObject.identifier = identifier; + + inputObject.minOccurs = minOccurs; + + inputObject.maxOccurs = maxOccurs; + }, + + instantiateCommonOutputValues : function(title, abstractValue, identifier, + outputObject){ + outputObject.title = title; + + outputObject.abstractValue = abstractValue; + + outputObject.identifier = identifier; + }, + + createLiteralDataOutput : function(title, abstractValue, identifier, + formatArray, literalDataDomainArray) { + var literalDataOutput = new Object(); + + this.instantiateCommonOutputValues(title, abstractValue, identifier, + literalDataOutput); + + //TODO what about metadata node? + literalDataOutput.literalData = new Object(); + literalDataOutput.literalData.formats = formatArray; + literalDataOutput.literalData.literalDataDomains = literalDataDomainArray; + + return literalDataOutput; + }, + + createComplexDataOutput : function(title, abstractValue, identifier, + formatArray) { + var complexDataOutput = new Object(); + + this.instantiateCommonOutputValues(title, abstractValue, identifier, + complexDataOutput); + + //TODO what about metadata node? + complexDataOutput.complexData = new Object(); + complexDataOutput.complexData.formats = formatArray; + + return complexDataOutput; + + }, + + createBboxOutput : function(title, abstractValue, identifier, + formatArray, crsArray) { + + var bboxOutput = new Object(); + + this.instantiateCommonOutputValues(title, abstractValue, identifier, + bboxOutput); + + //TODO what about metadata node? + bboxOutput.boundingBoxData = new Object(); + bboxOutput.boundingBoxData.formats = formatArray; + + bboxOutput.boundingBoxData.supportedCRSs = crsArray; + + return bboxOutput; + + }, + +}); + + + +/* + * definition of parameter names and values that will be used for + * generating the process description. Values will have standard values + * for WPS 2.0. + * + * In subclasses, these values shall be overridden to alter the values!!!! + */ + +var PROCESS_OFFERING_VERSION = "2.0.0"; + +var PROCESS_OFFERING_XML_TAG_NAME = "wps\\:ProcessOffering, ProcessOffering"; + +var PROCESS_VERSION_ATTR_NAME = "processVersion"; +var PROCESS_VERSION_ATTR_NAME_WITH_NS = "wps\\:processVersion"; + +var JOB_CONTROL_OPTIONS_ATTR_NAME = "jobControlOptions"; +var JOB_CONTROL_OPTIONS_ATTR_NAME_WITH_NS = "wps\\:jobControlOptions"; + +var OUTPUT_TRANSMISSION_ATTR_NAME = "outputTransmission"; +var OUTPUT_TRANSMISSION_ATTR_NAME_WITH_NS = "wps\\:outputTransmission"; + +var PROCESS_TAG_NAME = "wps\\:Process, Process"; +var TITLE_TAG_NAME = "ows\\:Title, Title"; +var ABSTRACT_TAG_NAME = "ows\\:Abstract, Abstract"; +var IDENTIFIER_TAG_NAME = "ows\\:Identifier, Identifier"; + +var PROCESS_INPUT_TAG_NAME = "wps\\:Input, Input"; +var PROCESS_OUTPUT_TAG_NAME = "wps\\:Output, Output"; + +var LITERAL_DATA_TAG_NAME = "wps\\:LiteralData, ns\\:LiteralData, LiteralData"; +var COMPLEX_DATA_TAG_NAME = "wps\\:ComplexData, ns\\:ComplexData, ComplexData"; +var BBOX_DATA_TAG_NAME = "wps\\:BoundingBoxData, ns\\:BoundingBoxData, BoundingBoxData"; + +var LITERAL_DATA_OUTPUT_TAG_NAME = "wps\\:LiteralData, ns\\:LiteralData, LiteralData"; +var COMPLEX_DATA_OUTPUT_TAG_NAME = "wps\\:ComplexData, ns\\:ComplexData, ComplexData"; +var BBOX_DATA_OUTPUT_TAG_NAME = "wps\\:BoundingBoxData, ns\\:BoundingBoxData, BoundingBoxData"; + +var MIN_OCCURS_ATTR_NAME = "minOccurs"; +var MIN_OCCURS_ATTR_NAME_WITH_NS = "wps\\:minOccurs"; + +var MAX_OCCURS_ATTR_NAME = "maxOccurs"; +var MAX_OCCURS_ATTR_NAME_WITH_NS = "wps\\:maxOccurs"; + +var FORMAT_TAG_NAME = "ns\\:Format, wps\\:Format, Format"; +var FORMAT_MIME_TYPE_ATTR_NAME = "mimeType"; +var FORMAT_ENCODING_ATTR_NAME = "encoding"; +var FORMAT_SCHEMA_ATTR_NAME = "schema"; + +var LITERAL_DATA_DOMAIN_TAG_NAME = "wps\\:LiteralDataDomain, LiteralDataDomain"; +var LITERAL_DATA_ANY_VALUE_TAG_NAME = "ows\\:AnyValue, AnyValue"; +var LITERAL_DATA_ALLOWED_VALUES_TAG_NAME = "ows\\:AllowedValues, AllowedValues"; + +var LITERAL_DATA_ALLOWED_VALUES_VALUE_TAG_NAME = "ows\\:Value, Value"; +var LITERAL_DATA_ALLOWED_VALUES_RANGE_TAG_NAME = "ows\\:Range, Range"; +var LITERAL_DATA_ALLOWED_VALUES_RANGE_MINIMUM_VALUE_TAG_NAME = "ows\\:MinimumValue, MinimumValue"; +var LITERAL_DATA_ALLOWED_VALUES_RANGE_MAXIMUM_VALUE_TAG_NAME = "ows\\:MaximumValue, MaximumValue"; + +var LITERAL_DATA_DATA_TYPE_TAG_NAME = "ows\\:DataType, DataType"; +var LITERAL_DATA_VALUES_REFERENCE_TAG_NAME = "ows\\:ValuesReference, ValuesReference"; +var LITERAL_DATA_REFERENCE_ATTR_NAME = "reference"; +var LITERAL_DATA_REFERENCE_ATTR_NAME_WITH_NS = "ows\\:reference"; +var LITERAL_DATA_DEFAULT_VALUE_TAG_NAME = "ows\\:DefaultValue, DefaultValue"; +var LITERAL_DATA_UNIT_OF_MEASURE_TAG_NAME = "ows\\:UOM, UOM"; + +//var SUPPORTED_CRS_TAG_NAME = "SupportedCRS"; +var CRS_TAG_NAME = "ows\\:CRS, wps\\:CRS, CRS"; + + +var DescribeProcessResponse_xml = DescribeProcessResponse.extend({ + + instantiate : function(wpsResponse) { + + /* + * in child classes, this method may change certain values + * of the above listed variables, that are used to extract + * information out of the XML document + */ + this.resetParameterVariables(); + + /* + * version + */ + this.processOffering.version = PROCESS_OFFERING_VERSION; + + var processOfferingXml = $(wpsResponse).find(PROCESS_OFFERING_XML_TAG_NAME); + + /* + processOfferingXml */ + this.processOffering.processVersion = processOfferingXml.attr(PROCESS_VERSION_ATTR_NAME) || processOfferingXml.attr(PROCESS_VERSION_ATTR_NAME_WITH_NS); + this.processOffering.jobControlOptions = this.createJobControlOptions(processOfferingXml); + this.processOffering.outputTransmissionModes = this.createOutputTransmissionModes(processOfferingXml); + + /* + * process + */ +// var processXml = processOfferingXml.find(PROCESS_TAG_NAME); + /* + * .find(selector) will return more instances of title, abstract and identifier + * than just the ones for the process. + * + * Instead it will also include objects for each Input and Output. + * + * Hence we simply take the first returned objects, as those will be the process level. + */ + this.processOffering.process.title = $(processOfferingXml.find(TITLE_TAG_NAME)[0]).text(); + this.processOffering.process.abstractValue = $(processOfferingXml.find(ABSTRACT_TAG_NAME)[0]).text() || undefined; + this.processOffering.process.identifier = $(processOfferingXml.find(IDENTIFIER_TAG_NAME)[0]).text(); + /* + * TODO how to deal with nested input and nested output??? + * + */ + this.processOffering.process.inputs = this.createInputs(processOfferingXml.find(PROCESS_INPUT_TAG_NAME)); + this.processOffering.process.outputs = this.createOutputs(processOfferingXml.find(PROCESS_OUTPUT_TAG_NAME)); + + }, + + /** + * in child classes this method should be overridden in order to reset parameter values + */ + resetParameterVariables : function(){ + /* + * here do noting + */ + }, + + createJobControlOptions : function(processOfferingXml){ + /* + * must be overridden in child classes + * + * it differs fpr various WPS version! + */ + }, + + createOutputTransmissionModes : function(processOfferingXml){ + /* + * must be overridden in child classes + * + * it differs for various WPS version! + */ + }, + + createInputs : function(xmlNodes){ + var array = new Array(xmlNodes.length); + + for (var index = 0; index < xmlNodes.length; index++) { + var inputXml = $(xmlNodes[index]); + + if(inputXml.find(LITERAL_DATA_TAG_NAME).length > 0) + array[index] = this.createLiteralDataInputFromXml(inputXml); + + else if (inputXml.find(COMPLEX_DATA_TAG_NAME).length > 0) + array[index] = this.createComplexDataInputFromXml(inputXml); + + else if (inputXml.find(BBOX_DATA_TAG_NAME).length > 0) + array[index] = this.createBboxDataInputFromXml(inputXml); + + /* + * nested input! + */ + else if(inputXml.find(PROCESS_INPUT_TAG_NAME).length > 0) + array[index] = this.createInputs(inputXml); + + } + + return array; + }, + + createLiteralDataInputFromXml : function(xmlNode) { + var minOccurs = xmlNode.attr(MIN_OCCURS_ATTR_NAME) || xmlNode.attr(MIN_OCCURS_ATTR_NAME_WITH_NS); + var maxOccurs = xmlNode.attr(MAX_OCCURS_ATTR_NAME) || xmlNode.attr(MAX_OCCURS_ATTR_NAME_WITH_NS); + + var title = xmlNode.find(TITLE_TAG_NAME).text(); + var abstractValue = xmlNode.find(ABSTRACT_TAG_NAME).text() || undefined; + var identifier = xmlNode.find(IDENTIFIER_TAG_NAME).text(); + + /* + * literal data input + */ + var formatNodes = this.extractFormatNodes(xmlNode); + + /* + * in WPS 1.0 there is no format for a literal input! + * + * but in WPS 2.0 there is! + * + * Hence, we just add an "|| undefined" + */ + var formatArray = this.createFormatArray(formatNodes) || undefined; + + + var literalDataDomainArray = this.createLiteralDataDomainArray(xmlNode.find(LITERAL_DATA_TAG_NAME)); + +// this.createLiteralDataDomainArray(xmlNode.find(LITERAL_DATA_DOMAIN_TAG_NAME)); + + return this.createLiteralDataInput(title, abstractValue, identifier, minOccurs, + maxOccurs, formatArray, literalDataDomainArray); + }, + + /** + * extracts all Format nodes. Varies for different WPS version + */ + extractFormatNodes : function(xmlNode){ + /* + * override in child classes + */ + }, + + createLiteralDataDomainArray : function(literalDataDomainXml){ + + /* + * for various WPS version, this call produces different results! + */ + return this.createAllLiteralDataDomainObjects(literalDataDomainXml); + }, + + /** + * create all literal data domain object. + * for differnt WPS version, the number of allowed instances varies. In WPS 1.0 + * only one occurence is allowed, whereas in WPS 2.0 a new Tag called "LiteralDataDomain" + * is introduced which may occur multiple times! + * + * Hence we override this method in child classes to provide the correct results! + */ + createAllLiteralDataDomainObjects : function(literalDataXml){ + /* + * override in child methods! + */ + }, + + /** + * regardsles of the WPS version, this method should provide the expected results + * to instantiate an instance of literalDataObject! + */ + createLiteralDataDomainObject : function(literalDataDomain_xml){ + + var literalDataDomainObject = new Object(); + + /* + * on of the three tags for allowed value specification can occur: + * + * 1: AnyValue + * + * 2: AllowedValues + * + * 3: ValuesReference + */ + literalDataDomainObject.anyValue = false; + + if(literalDataDomain_xml.find(LITERAL_DATA_ANY_VALUE_TAG_NAME).length > 0) + literalDataDomainObject.anyValue = true; + + else if(literalDataDomain_xml.find(LITERAL_DATA_ALLOWED_VALUES_TAG_NAME).length > 0) + literalDataDomainObject.allowedValues = this.createAllowedValues(literalDataDomain_xml.find(LITERAL_DATA_ALLOWED_VALUES_TAG_NAME)); + + else + literalDataDomainObject.valuesReference = literalDataDomain_xml.find(LITERAL_DATA_VALUES_REFERENCE_TAG_NAME).text(); + + var dataType_xml = literalDataDomain_xml.find(LITERAL_DATA_DATA_TYPE_TAG_NAME); + + var dataTypeObject = new Object(); + dataTypeObject.type = dataType_xml.text() || undefined; + dataTypeObject.reference = dataType_xml.attr(LITERAL_DATA_REFERENCE_ATTR_NAME) || dataType_xml.attr(LITERAL_DATA_REFERENCE_ATTR_NAME_WITH_NS); + + literalDataDomainObject.dataType = dataTypeObject; + + literalDataDomainObject.defaultValue = literalDataDomain_xml.find(LITERAL_DATA_DEFAULT_VALUE_TAG_NAME).text() || undefined; + /* + * uom = unit of measure + * + * TODO create new extraction method that is overridden in child classes + */ + literalDataDomainObject.unitOfMeasure = this.extractUnitOfMeasure(literalDataDomain_xml); + + return literalDataDomainObject; + }, + + /** + * extracts the unit of measure. + * + * Differs for different WPS versions + */ + extractUnitOfMeasure : function(literalDataXml){ + /* + * override in child classes! + */ + }, + + createAllowedValues : function(allowedValues_xml){ + + /* + * if allowedValues_xml actually exists: + * + * allowedValues_xml might either be an array of "Value"-tags or + * + * have a child node called "Range". + */ + var object = new Object(); + + var values_xml = allowedValues_xml.find(LITERAL_DATA_ALLOWED_VALUES_VALUE_TAG_NAME); + var numberOfValues = values_xml.length; + + /* + * case Value array + */ + if (numberOfValues > 0){ + /* + * return an array with all values + */ + object.values = new Array(numberOfValues); + + for (var i=0; i < numberOfValues; i++){ + object.values[i] = $(values_xml[i]).text(); + } + } + + /* + * case Range child node + */ + else{ + object.range = new Object(); + + var range_xml = allowedValues_xml.find(LITERAL_DATA_ALLOWED_VALUES_RANGE_TAG_NAME); + + object.range.minimumValue = range_xml.find(LITERAL_DATA_ALLOWED_VALUES_RANGE_MINIMUM_VALUE_TAG_NAME).text(); + object.range.maximumValue = range_xml.find(LITERAL_DATA_ALLOWED_VALUES_RANGE_MAXIMUM_VALUE_TAG_NAME).text(); + } + + return object; + }, + + createComplexDataInputFromXml : function(xmlNode) { + var minOccurs = xmlNode.attr(MIN_OCCURS_ATTR_NAME) || xmlNode.attr(MIN_OCCURS_ATTR_NAME_WITH_NS); + var maxOccurs = xmlNode.attr(MAX_OCCURS_ATTR_NAME) || xmlNode.attr(MAX_OCCURS_ATTR_NAME_WITH_NS); + + var title = xmlNode.find(TITLE_TAG_NAME).text(); + var abstractValue = xmlNode.find(ABSTRACT_TAG_NAME).text() || undefined; + var identifier = xmlNode.find(IDENTIFIER_TAG_NAME).text(); + + /* + * complex data input + */ + var formatNodes = this.extractFormatNodes(xmlNode); + + var formatArray = this.createFormatArray(formatNodes); + + return this.createComplexDataInput(title, abstractValue, identifier, minOccurs, maxOccurs, formatArray); + }, + + createBboxDataInputFromXml : function(xmlNode) { + + var minOccurs = xmlNode.attr(MIN_OCCURS_ATTR_NAME) || xmlNode.attr(MIN_OCCURS_ATTR_NAME_WITH_NS); + var maxOccurs = xmlNode.attr(MAX_OCCURS_ATTR_NAME) || xmlNode.attr(MAX_OCCURS_ATTR_NAME_WITH_NS); + + var title = xmlNode.find(TITLE_TAG_NAME).text(); + var abstractValue = xmlNode.find(ABSTRACT_TAG_NAME).text() || undefined; + var identifier = xmlNode.find(IDENTIFIER_TAG_NAME).text(); + + //TODO BBOX + var formatNodes = this.extractFormatNodes(xmlNode); + + /* + * in WPS 1.0 there is no format for a bbox input! + * + * but in WPS 2.0 there is! + * + * Hence, we just add an "|| undefined" + */ + var formatArray = this.createFormatArray(formatNodes) || undefined; + + var supportedCRSs = this.createCrsArray(xmlNode.find(CRS_TAG_NAME)); + + return this.createBboxInput(title, abstractValue, identifier, minOccurs, maxOccurs, formatArray, supportedCRSs); + + }, + + createCrsArray : function(supportedCRSs_xml){ + var supportedCrsArray = new Array(supportedCRSs_xml.length); + + for (var index = 0; index < supportedCRSs_xml.length; index++) { + supportedCrsArray[index] = $(supportedCRSs_xml[index]).text(); + } + return supportedCrsArray; + }, + + createFormatArray : function(formatNodes) { + if(formatNodes.length == 0) + return undefined; + + var formatArray = new Array(); + + for (var index = 0; index < formatNodes.length; index++) { + var formatXml = $(formatNodes[index]); + + var mimeType = this.extractMimeType(formatXml); + var encoding = this.extractEncoding(formatXml); + var schema = this.extractSchema(formatXml); + + formatArray[index] = this.createFormat(mimeType, encoding, schema); + } + return formatArray; + }, + + /** + * override in child method to extract the mime type from the format xml node. + * + * Differs for various WPS versions. + */ + extractMimeType : function(formatXml){ + + }, + + /** + * override in child method to extract the encoding from the format xml node. + * + * Differs for various WPS versions. + */ + extractEncoding : function(formatXml){ + + }, + + /** + * override in child method to extract the schema from the format xml node. + * + * Differs for various WPS versions. + */ + extractSchema : function(formatXml){ + + }, + + createOutputs : function (outputNodes){ + + var array = new Array(outputNodes.length); + + for (var index = 0; index < outputNodes.length; index++) { + var OutputXml = $(outputNodes[index]); + + if(OutputXml.find(LITERAL_DATA_OUTPUT_TAG_NAME).length > 0) + array[index] = this.createLiteralDataOutputFromXml(OutputXml); + + else if (OutputXml.find(COMPLEX_DATA_OUTPUT_TAG_NAME).length > 0) + array[index] = this.createComplexDataOutputFromXml(OutputXml); + + else if (OutputXml.find(BBOX_DATA_OUTPUT_TAG_NAME).length > 0) + array[index] = this.createBboxDataOutputFromXml(OutputXml); + + /* + * nested output! + */ + else if (OutputXml.find(PROCESS_OUTPUT_TAG_NAME).length > 0) + array[index] = this.createOutputs(OutputXml); + + } + + return array; + + }, + + /** + * TODO outputs vary... no format for literal data but multiple UOMs... + */ + + createLiteralDataOutputFromXml : function(outputXml){ + var title = outputXml.find(TITLE_TAG_NAME).text(); + var abstractValue = outputXml.find(ABSTRACT_TAG_NAME).text() || undefined; + var identifier = outputXml.find(IDENTIFIER_TAG_NAME).text(); + + /* + * literal data input + */ + var formatNodes = this.extractFormatNodes(outputXml); + + /* + * in WPS 1.0 there is no format for a literal otput! + * + * but in WPS 2.0 there is! + * + * Hence, we just add an "|| undefined" + */ + var formatArray = this.createFormatArray(formatNodes) ||undefined; + + var literalDataDomainArray = this.createLiteralDataDomainArray(outputXml.find(LITERAL_DATA_TAG_NAME)); + + return this.createLiteralDataOutput(title, abstractValue, identifier, + formatArray, literalDataDomainArray); + }, + + createComplexDataOutputFromXml : function(outputXml) { + + var title = outputXml.find(TITLE_TAG_NAME).text(); + var abstractValue = outputXml.find(ABSTRACT_TAG_NAME).text() || undefined; + var identifier = outputXml.find(IDENTIFIER_TAG_NAME).text(); + + /* + * complex data input + */ + var formatNodes = this.extractFormatNodes(outputXml); + + var formatArray = this.createFormatArray(formatNodes); + + return this.createComplexDataOutput(title, abstractValue, + identifier, formatArray); + }, + + createBboxDataOutputFromXml : function(outputXml) { + + var title = outputXml.find(TITLE_TAG_NAME).text(); + var abstractValue = outputXml.find(ABSTRACT_TAG_NAME).text() || undefined; + var identifier = outputXml.find(IDENTIFIER_TAG_NAME).text(); + + var formatNodes = this.extractFormatNodes(outputXml); + /* + * in WPS 1.0 there is no format for a bbox output! + * + * but in WPS 2.0 there is! + * + * Hence, we just add an "|| undefined" + */ + var formatArray = this.createFormatArray(formatNodes) || undefined; + + var supportedCRSs = this.createCrsArray(outputXml.find(CRS_TAG_NAME)); + + return this.createBboxOutput(title, abstractValue, identifier, + formatArray, supportedCRSs); + } + +}); + +/* + * Override existing variables to match WPS 1.0 documents + */ +var DescribeProcessResponse_v1_xml = DescribeProcessResponse_xml.extend({ + + /* + * possibly, some methods have to be overridden, to parse WPS 1.0 documents + */ + + resetParameterVariables : function(){ + PROCESS_OFFERING_VERSION = "1.0.0"; + + PROCESS_OFFERING_XML_TAG_NAME = "wps\\:ProcessDescription, ProcessDescription"; + + FORMAT_MIME_TYPE_ATTR_NAME = "ows\\:MimeType, MimeType"; + FORMAT_ENCODING_ATTR_NAME = "ows\\:Encoding, Encoding"; + FORMAT_SCHEMA_ATTR_NAME = "ows\\:Schema, Schema"; + + LITERAL_DATA_UNIT_OF_MEASURE_TAG_NAME = "ows\\:UOM, UOM"; + + //SUPPORTED_CRS_TAG_NAME = "SupportedCRS"; + CRS_TAG_NAME = "ows\\:CRS, CRS"; + + LITERAL_DATA_OUTPUT_TAG_NAME = "wps\\:LiteralOutput, LiteralOutput"; + COMPLEX_DATA_OUTPUT_TAG_NAME = "wps\\:ComplexOutput, ComplexOutput"; + BBOX_DATA_OUTPUT_TAG_NAME = "wps\\:BoundingBoxOutput, BoundingBoxOutput"; + }, + + createJobControlOptions : function(processOfferingXml){ + + /* + * TODO for WPS 1.0 this attribut does not exist! + * But we have the attributes "storeSupported" + * if true, then async-execution and stored as reference! + * + * if false, then only sync-execution and return in document is possible. + */ + var storeSupported = processOfferingXml.attr("storeSupported") || false; + if (storeSupported) + return ["sync-execute", "async-execute"]; + + else + return ["sync-execute"]; + }, + + createOutputTransmissionModes : function(processOfferingXml){ + + /* + * TODO for WPS 1.0 this attribut does not exist! + * But we have the attributes "storeSupported" + * if true, then async-execution and stored as reference! + * + * if false, then only sync-execution and return in document is possible. + */ + var storeSupported = processOfferingXml.attr("storeSupported") || false; + if (storeSupported) + return ["value", "reference"]; + + else + return ["value"]; + }, + + /** + * in WPS 1.0 is encoded as Tag + */ + extractMimeType : function(formatXml){ + return formatXml.find(FORMAT_MIME_TYPE_ATTR_NAME).text(); + }, + + /** + * in WPS 1.0 is encoded as Tag + */ + extractEncoding : function(formatXml){ + return formatXml.find(FORMAT_ENCODING_ATTR_NAME).text() || undefined; + }, + + /** + * in WPS 1.0 is encoded as Tag + */ + extractSchema : function(formatXml){ + return formatXml.find(FORMAT_SCHEMA_ATTR_NAME).text() || undefined; + }, + + /** + * extracts the unit of measure. + * + * in WPS 1.0 it is a bit tricky. WPS 1.0 defines a single LiteralData object which has a single UOMs object, + * which is split up into a single Default and a single Supported node. Standard contains a single UOM, + * whereas Supported defines a list of supported UOMs... + * + * However, this conceptually differs from WPS 2.0 where there is a completely new node named LiteralDataDomain, + * which may occur multiple times! Each LiteralDataDomain object contains only ONE UOM node. + * + * This API returns documents closely modeled to the WPS 2.0 standard. Hence, we need one UOM per LiteralDatDomain. + * Thus, we just use the Default UOM of WPS 1.0 and loose all others. + */ + extractUnitOfMeasure : function(literalDataXml){ + return literalDataXml.find("ows\\:UOMs, UOMs").find("ows\\:Default, Default").find(LITERAL_DATA_UNIT_OF_MEASURE_TAG_NAME).text() || undefined; + }, + + extractFormatNodes : function(xmlNode){ + /* + * in WPS 1.0 formats are split up in a Supported and a Default subtag. + * To not have them listed twice, we just extract all Format Nodes from + * the Supported subtag. + */ + return xmlNode.find("ows\\:Supported, Supported").find(FORMAT_TAG_NAME); + }, + + createAllLiteralDataDomainObjects : function(literalDataXml){ + /* + * here, in WPS 1.0, we have no subTag called LiteralDataDomain + * (which in WPS 2.0 may occur multiple times!). + * + * In WPS 1.0 the difference is, that there are multiple UOMs. + * However, since this API encodes the description closely to + * the WPS 2.0 standard, we only take the default UOM from WPS 1.0! + * + * Hence, we just create on single object which holds the information. + * The remaining UOMs are lost! + */ + var literalDataDomainArray = new Array(1); + + literalDataDomainArray[0] = this.createLiteralDataDomainObject($(literalDataXml)); + + return literalDataDomainArray; + } + +}); + +var DescribeProcessResponse_v2_xml = DescribeProcessResponse_xml.extend({ + + /* + * override any method whose implementation differs for various WPS version! + */ + + resetParameterVariables : function(){ + /* + * Override existing variables + */ + PROCESS_OFFERING_VERSION = "2.0.0"; + + PROCESS_OFFERING_XML_TAG_NAME = "wps\\:ProcessOffering, ProcessOffering"; + + JOB_CONTROL_OPTIONS_ATTR_NAME = "jobControlOptions"; + JOB_CONTROL_OPTIONS_ATTR_NAME_WITH_NS = "wps\\:jobControlOptions"; + + OUTPUT_TRANSMISSION_ATTR_NAME = "outputTransmission"; + OUTPUT_TRANSMISSION_ATTR_NAME_WITH_NS = "wps\\:outputTransmission"; + + FORMAT_MIME_TYPE_ATTR_NAME = "mimeType"; + FORMAT_ENCODING_ATTR_NAME = "encoding"; + FORMAT_SCHEMA_ATTR_NAME = "schema"; + + LITERAL_DATA_DOMAIN_TAG_NAME = "wps\\:LiteralDataDomain, LiteralDataDomain"; + LITERAL_DATA_UNIT_OF_MEASURE_TAG_NAME = "ows\\:UOM, UOM"; + + LITERAL_DATA_OUTPUT_TAG_NAME = "wps\\:LiteralData, ns\\:LiteralData, LiteralData"; + COMPLEX_DATA_OUTPUT_TAG_NAME = "wps\\:ComplexData, ns\\:ComplexData, ComplexData"; + BBOX_DATA_OUTPUT_TAG_NAME = "wps\\:BoundingBoxData, ns\\:BoundingBoxData, BoundingBoxData"; + + CRS_TAG_NAME = "ows\\:SupportedCRS, wps\\:SupportedCRS, SupportedCRS"; + }, + + createJobControlOptions : function(processOfferingXml){ + + var jobControlOptionsString = processOfferingXml.attr(JOB_CONTROL_OPTIONS_ATTR_NAME) || processOfferingXml.attr(JOB_CONTROL_OPTIONS_ATTR_NAME_WITH_NS); + + /* + * the string holds job control options separated by whitespace + */ + + return jobControlOptionsString.split(" "); + }, + + createOutputTransmissionModes : function(processOfferingXml){ + + var outputTransmissionString = processOfferingXml.attr(OUTPUT_TRANSMISSION_ATTR_NAME) || processOfferingXml.attr(OUTPUT_TRANSMISSION_ATTR_NAME_WITH_NS); + + /* + * the string holds transmission modes separated by whitespace + */ + + return outputTransmissionString.split(" "); + }, + + /** + * in WPS 2.0 is encoded as attribute + */ + extractMimeType : function(formatXml){ + return formatXml.attr(FORMAT_MIME_TYPE_ATTR_NAME); + }, + + /** + * in WPS 2.0 is encoded as attribute + */ + extractEncoding : function(formatXml){ + return formatXml.attr(FORMAT_ENCODING_ATTR_NAME) || undefined; + }, + + /** + * in WPS 2.0 is encoded as attribute + */ + extractSchema : function(formatXml){ + return formatXml.attr(FORMAT_SCHEMA_ATTR_NAME) || undefined; + }, + + /** + * create all literal data domain object. + * in WPS 2.0 a new Tag called "LiteralDataDomain" + * is introduced which may occur multiple times! + */ + createAllLiteralDataDomainObjects : function(literalDataXml){ + + var literalDataDomain_xmlNodes = literalDataXml.find(LITERAL_DATA_DOMAIN_TAG_NAME); + + var literalDataDomainArray = new Array(literalDataDomain_xmlNodes.length); + + for(var index = 0; index < literalDataDomain_xmlNodes.length; index++){ + literalDataDomainArray[index] = this.createLiteralDataDomainObject($(literalDataDomain_xmlNodes[index])); + } + + return literalDataDomainArray; + }, + + /** + * extracts the unit of measure. + */ + extractUnitOfMeasure : function(literalDataXml){ + return literalDataXml.find(LITERAL_DATA_UNIT_OF_MEASURE_TAG_NAME).text() || undefined; + }, + + extractFormatNodes : function(xmlNode){ + /* + * simply use all occurrences + */ + return xmlNode.find(FORMAT_TAG_NAME); + } + +}); + +var ExecuteResponse = BaseResponse.extend({ + + init : function(wpsResponse) { + this.responseDocument = wpsResponse; + + /* + * executeResponse can be instantiated differentely, depending on the + * WPS version and executionMode + * + * Hence, we specify some common parameters, that indicate how to + * interpret the response + */ + this.executeResponse = { + + /* + * type shall be used to indicate the type of document + */ + type : "", + serviceVersion : "", + /* + * document will have varying properties as it will be instantiated + * differently according to the type + */ + responseDocument : {} + }; + + this.instantiate(wpsResponse); + }, + + instantiate : function(wpsResponse) { + /* + * override this method in child classes to instantiate the object + */ + }, + + /** + * will have different properties, depending on the WPS version! + */ + instantiateResultDocument : function() { + this.executeResponse.resultDocument = { + + }; + }, + + /** + * only relevant for WPS 2.0 + */ + instantiateStatusInfoDocument : function() { + + }, + +}); + +/** + * Inspects XML response of WPS 1.0 execute request + */ +var ExecuteResponse_v1_xml = ExecuteResponse + .extend({ + instantiate : function(wpsResponse) { + + /* + * raw output + */ + this.executeResponse.serviceVersion = "1.0.0"; + this.executeResponse.type = "rawOutput"; + + /* + * check whether response is an XML document. + * In that case return the xmlString, + * else return the response directly + */ + var rawOutput; + if (wpsResponse instanceof Blob){ + + rawOutput = wpsResponse; + } + else + rawOutput = wpsResponse; + + this.executeResponse.responseDocument = rawOutput; + + }, + + instantiateResponseDocument : function(wpsResponse) { + var executeResponse_xmlNode = $(wpsResponse).find( + "wps\\:ExecuteResponse, ExecuteResponse"); + + /* + * service + */ + var service = "WPS"; + var version = "1.0.0"; + var lang = executeResponse_xmlNode.attr("lang") + || executeResponse_xmlNode.attr("xml\\:lang"); + /* + * statusLocation may not exist + */ + var statusLocation = executeResponse_xmlNode + .attr("statusLocation") + || executeResponse_xmlNode.attr("wps\\:statusLocation") + || undefined; + var serviceInstance = executeResponse_xmlNode + .attr("serviceInstance") + || executeResponse_xmlNode.attr("wps\\:serviceInstance"); + + /* + * process + */ + var process_xmlNode = executeResponse_xmlNode.find("wps\\:Process, Process"); + var processId = process_xmlNode.find("ows\\:Identifier, Identifier").text(); + var processTitle = process_xmlNode.find("ows\\:Title, Title").text(); + var process = { + identifier : processId, + title : processTitle + }; + + /* + * status + */ + var status_xmlNode = executeResponse_xmlNode.find("wps\\:Status, Status"); + var statusCreationTime = status_xmlNode.attr("creationTime") + || status_xmlNode.attr("wps\\:creationTime"); + var statusInfo = null; + if (status_xmlNode.find("wps\\:ProcessAccepted, ProcessAccepted").length > 0) + statusInfo = status_xmlNode.find("wps\\:ProcessAccepted, ProcessAccepted").prop( + "tagName"); + else if (status_xmlNode.find("wps\\:ProcessStarted, ProcessStarted").length > 0) + statusInfo = status_xmlNode.find("wps\\:ProcessStarted, ProcessStarted").prop( + "tagName").concat(" - percentCompleted:").concat( + status_xmlNode.find("wps\\:ProcessStarted, ProcessStarted").attr( + "percentCompleted")); + else if (status_xmlNode.find("wps\\:ProcessPaused, ProcessPaused").length > 0) + statusInfo = status_xmlNode.find("wps\\:ProcessPaused, ProcessPaused").prop( + "tagName").concat(" - percentCompleted:").concat( + status_xmlNode.find("wps\\:ProcessPaused, ProcessPaused").attr( + "percentCompleted")); + else if (status_xmlNode.find("wps\\:ProcessSucceeded, ProcessSucceeded").length > 0) + statusInfo = status_xmlNode.find("wps\\:ProcessSucceeded, ProcessSucceeded").prop( + "tagName"); + else + statusInfo = status_xmlNode.find("wps\\:ProcessFailed, ProcessFailed").find( + "wps\\:ExceptionReport, ows\\:ExceptionReport, ExceptionReport").find("wps\\:ExceptionText, ows\\:ExceptionText, ExceptionText").text() + || status_xmlNode.find("wps\\:ProcessFailed, ProcessFailed").find( + "wps\\:ExceptionReport, ows\\:ExceptionReport, ExceptionReport").attr("exceptionCode"); + + var statusInfoTest = status_xmlNode.find("wps\\:ProcessSucceeded, ProcessSucceeded") + .text(); + + var status = { + creationTime : statusCreationTime, + info : statusInfo + }; + + /* + * TODO lineage=true --> include dataInputs and outputs + * definitions? + */ + + /* + * outputs + */ + var processOutputs_xmlNode = executeResponse_xmlNode + .find("wps\\:ProcessOutputs, ProcessOutputs"); + var outputs_xmlNodes = processOutputs_xmlNode.find("wps\\:Output, Output"); + var outputs = this.instantiateOutputs(outputs_xmlNodes); + + /* + * create responseDocument + */ + this.executeResponse.responseDocument = { + service : service, + version : version, + lang : lang, + statusLocation : statusLocation, + serviceInstance : serviceInstance, + process : process, + status : status, + outputs : outputs + }; + + }, + + instantiateOutputs : function(outputs_xmlNodes) { + var outputs = new Array(outputs_xmlNodes.length); + + for (var index = 0; index < outputs_xmlNodes.length; index++) { + var output_xmlNode = $(outputs_xmlNodes[index]); + + var id = output_xmlNode.find("ows\\:Identifier, Identifier").text(); + var title = output_xmlNode.find("ows\\:Title, Title").text(); + var abstractValue = output_xmlNode.find("ows\\:Abstract, Abstract").text() + || undefined; + + /* + * either element "Data" or "Reference" exists + */ + var reference_xmlNode = output_xmlNode.find("wps\\:Reference, Reference"); + var reference = undefined; + if (reference_xmlNode.length > 0) { + reference = { + href : reference_xmlNode.attr("href") + || reference_xmlNode.attr("wps\\:href"), + format : reference_xmlNode.attr("mimeType") + || reference_xmlNode.attr("format") + || undefined, + encoding : reference_xmlNode.attr("encoding") + || undefined, + schema : reference_xmlNode.attr("schema") + || undefined + } + + outputs[index] = { + identifier : id, + title : title, + abstractValue : abstractValue, + reference : reference, + }; + } else { + /* + * Data element + */ + var data_xmlNode = output_xmlNode.find("wps\\:Data, Data"); + + /* + * data can either be a complexData or a LiteralData or + * a BoundingBoxData element + */ + var data; + var complexData_xmlNode = data_xmlNode + .find("wps\\:ComplexData, ComplexData"); + var literalData_xmlNode = data_xmlNode + .find("wps\\:LiteralData, LiteralData"); + var bboxData_xmlNode = data_xmlNode + .find("wps\\:BoundingBoxData, BoundingBoxData"); + if (complexData_xmlNode.length > 0) { + var data = { + complexData : { + mimeType : complexData_xmlNode.attr("mimeType") + || undefined, + schema : complexData_xmlNode.attr("schema") + || undefined, + encoding : complexData_xmlNode.attr("encoding") + || undefined, + value : complexData_xmlNode.html() + } + + } + } else if (bboxData_xmlNode.length > 0) { + + var data = { + boundingBoxData : { + crs : bboxData_xmlNode.attr("crs") || undefined, + dimensions : bboxData_xmlNode + .attr("dimensions") + || undefined, + lowerCorner : bboxData_xmlNode + .attr("lowerCorner") + || bboxData_xmlNode.find("ows\\:LowerCorner, LowerCorner") + .text(), + upperCorner : bboxData_xmlNode + .attr("upperCorner") + || bboxData_xmlNode.find("ows\\:UpperCorner, UpperCorner") + .text() + } + + } + } else { + /* + * literalData + */ + var data = { + literalData : { + dataType : literalData_xmlNode.attr("dataType") + || undefined, + uom : literalData_xmlNode.attr("uom") + || undefined, + value : literalData_xmlNode.text() + } + + } + } + + outputs[index] = { + identifier : id, + title : title, + abstractValue : abstractValue, + data : data, + }; + } + + } // end for + return outputs; + } + }); +/** + * Inspects XML response of WPS 2.0 execute request + */ +var ExecuteResponse_v2_xml = ExecuteResponse.extend({ + + instantiate : function(wpsResponse) { + /* + * TODO WPS 2.0 specifies different response possibilities + * + * raw data + * + * StatusInfo document + * + * Response/Result Document + * + * Hence, we must implement each possibility and return an appropriate + * response + */ + if ($(wpsResponse).find("wps\\:Result, Result").length > 0) { + /* + * response/result document! + * + * set the common response parameters + */ + this.executeResponse.serviceVersion = "2.0.0"; + this.executeResponse.type = "resultDocument" + + this.instantiateResultDocument(wpsResponse); + } else if ($(wpsResponse).find("wps\\:StatusInfo, StatusInfo").length > 0) { + /* + * response/result document! + * + * set the common response parameters + */ + this.executeResponse.serviceVersion = "2.0.0"; + this.executeResponse.type = "statusInfoDocument"; + + this.instantiateStatusInfoDocument(wpsResponse); + } else { + /* + * raw output + */ + this.executeResponse.serviceVersion = "2.0.0"; + this.executeResponse.type = "rawOutput"; + + /* + * check whether response is an XML document. + * In that case return the xmlString, + * else return the response directly + */ + var rawOutput; + if(!(typeof wpsResponse === 'string') && ($(wpsResponse).length > 0)) + rawOutput = (new XMLSerializer()).serializeToString(wpsResponse); + else + rawOutput = wpsResponse; + + this.executeResponse.responseDocument = rawOutput; + } + }, + + instantiateResultDocument : function(wpsResponse) { + + var result_xmlNode = $(wpsResponse).find("wps\\:Result, Result"); + + var jobId = result_xmlNode.find("wps\\:JobID, JobID").text() || undefined; + var expirationDate = result_xmlNode.find("wps\\:ExpirationDate, ExpirationDate").text() + || undefined; + + var outputs = this.instantiateOutputs(result_xmlNode.find("wps\\:Output, Output")); + + this.executeResponse.responseDocument = { + jobId : jobId, + expirationDate : expirationDate, + outputs : outputs + }; + }, + + instantiateOutputs : function(outputs_xmlNodes) { + var outputs = new Array(outputs_xmlNodes.length); + + for (var index = 0; index < outputs_xmlNodes.length; index++) { + var output_xmlNode = $(outputs_xmlNodes[index]); + + /* + * either element "Data" or "Reference" exists + */ + var reference_xmlNode = output_xmlNode.find("wps\\:Reference, Reference"); + var reference = undefined; + if (reference_xmlNode.length > 0) { + reference = { + href : reference_xmlNode.attr("href") + || reference_xmlNode.attr("wps:href") + || reference_xmlNode.attr("xlin:href") + || reference_xmlNode.attr("xlink:href") + || reference_xmlNode.attr("ows:href") + || reference_xmlNode.attr("wps\\:href") + || reference_xmlNode.attr("xlin\\:href"), + format : reference_xmlNode.attr("mimeType") + || reference_xmlNode.attr("format") + || undefined, + encoding : reference_xmlNode.attr("encoding") + || undefined, + schema : reference_xmlNode.attr("schema") + || undefined + } + + outputs[index] = { + identifier : output_xmlNode.attr("id"), + reference : reference + }; + } + else{ + + /* + * Data node; + * + * in WPS 2.0.0 this node may either have a subnode named: + * - "LiteralValue" or + * - "BoundingBox" or + * - directValue for + * complexOutput --> complex output does not have an own subNode!!! + */ + var data_xmlNode = output_xmlNode.find("wps\\:Data, Data"); + + /* + * data can either be a LiteralValue or a + * BoundingBox element + */ + var data; + var literalData_xmlNode = data_xmlNode.find("wps\\:LiteralValue, LiteralValue"); + var bboxData_xmlNode = data_xmlNode.find("ows\\:BoundingBox, BoundingBox"); + if (literalData_xmlNode.length > 0) { + + /* + * literalData + */ + data = { + literalData : { + dataType : literalData_xmlNode.attr("dataType") + || undefined, + uom : literalData_xmlNode.attr("uom") || undefined, + value : literalData_xmlNode.text() + } + + } + + + } else if (bboxData_xmlNode.length > 0) { + + data = { + boundingBoxData : { + crs : bboxData_xmlNode.attr("crs") || undefined, + dimensions : bboxData_xmlNode.attr("dimensions") + || undefined, + lowerCorner : bboxData_xmlNode.attr("lowerCorner") + || bboxData_xmlNode.find("ows\\:LowerCorner, LowerCorner").text(), + upperCorner : bboxData_xmlNode.attr("upperCorner") + || bboxData_xmlNode.find("ows\\:UpperCorner, UpperCorner").text() + } + + } + } else { + /* + * complex data + */ + data = { + complexData : { + mimeType : data_xmlNode.attr("mimeType") + || undefined, + schema : data_xmlNode.attr("schema") + || undefined, + encoding : data_xmlNode.attr("encoding") + || undefined, + value : data_xmlNode.html() + } + + } + } + + /* + * TODO nested Output! + */ + + outputs[index] = { + identifier : output_xmlNode.attr("id"), + data : data + }; + } // end else data or reference + } // end for + + return outputs; + }, + + instantiateStatusInfoDocument : function(wpsResponse) { + var statusInfo_xmlNode = $(wpsResponse).find("wps\\:StatusInfo, StatusInfo"); + + var jobId = statusInfo_xmlNode.find("wps\\:JobID, JobID").text(); + var status = statusInfo_xmlNode.find("wps\\:Status, Status").text(); + var expirationDate = statusInfo_xmlNode.find("wps\\:ExpirationDate, ExpirationDate").text() + || undefined; + var estimatedCompletion = statusInfo_xmlNode + .find("wps\\:EstimatedCompletion, EstimatedCompletion").text() + || undefined; + var nextPoll = statusInfo_xmlNode.find("wps\\:NextPoll, NextPoll").text() || undefined; + var percentCompleted = statusInfo_xmlNode.find("wps\\:PercentCompleted, PercentCompleted") + .text() + || undefined; + + this.executeResponse.responseDocument = { + jobId : jobId, + status : status, + expirationDate : expirationDate, + estimatedCompletion : estimatedCompletion, + nextPoll : nextPoll, + percentCompleted : percentCompleted + }; + } + +}); +var ResponseFactory = Class.extend({ + + init : function(settings) { + this.settings = settings; + }, + + /** + * Since the returned documents of the WPS differ with respect to the + * service version, the matching result document has to be instantiated + * + * @requestObject the request object that created the responseFactory. It is + * used to resolve the response type + */ + resolveResponseHandler : function(wpsResponse, requestObject) { + + /* + * version and requestType will be compared to constant values from Constants.js + */ + var version = requestObject.settings.version; + var requestType = requestObject.settings.requestType; + + if (requestType == GET_CAPABILITIES_TYPE) { + if (version == WPS_VERSION_1_0_0) + return new CapabilitiesResponse_v1_xml(wpsResponse); + else if (version == WPS_VERSION_2_0_0) + return new CapabilitiesResponse_v2_xml(wpsResponse); + else { + return null; + } + } else if (requestType == DESCRIBE_PROCESS_TYPE) { + + if (version == WPS_VERSION_1_0_0) + return new DescribeProcessResponse_v1_xml(wpsResponse); + else if (version == WPS_VERSION_2_0_0) + return new DescribeProcessResponse_v2_xml(wpsResponse); + else { + return null; + } + } else if (requestType == EXECUTE_TYPE) { + + if (version == WPS_VERSION_1_0_0) + return new ExecuteResponse_v1_xml(wpsResponse); + else if (version == WPS_VERSION_2_0_0) + return new ExecuteResponse_v2_xml(wpsResponse); + else { + return null; + } + } else if (requestType == GET_STATUS_TYPE) { + return new ExecuteResponse_v2_xml(wpsResponse); + + } else if (requestType == GET_RESULT_TYPE) { + return new ExecuteResponse_v2_xml(wpsResponse); + + }else { + // TODO + return new ExceptionReportResponse(wpsResponse); + } + + return null; + } + +}); + +var TEMPLATE_EXCEPTION_REPORT_RESPONSE_MARKUP = '\ +
\ +
\ + \ +
\ +
\ +
'; + +var TEMPLATE_EXCEPTION_MARKUP = '\ +
  • \ + ${code} \ +
  • \ +
  • \ + ${text} \ +
  • '; + +var ExceptionReportResponse = BaseResponse + .extend({ + + createMarkup : function() { + var exceptionsFromResponse = this.xmlResponse + .getElementsByTagNameNS(OWS_11_NAMESPACE, "Exception"); + + console.log("Got exception response!"); + exceptions = jQuery(exceptionsFromResponse); + console.log(exceptions); + + var parsedExceptions = []; + for ( var i = 0; i < exceptions.length; i++) { + var exc = jQuery(exceptions[i]); + + var parsedExc = { + "code" : exc.attr("exceptionCode"), + "text" : exc.text().trim() + }; + parsedExceptions.push(parsedExc); + } + + var properties = {}; + var result = jQuery.tmpl( + TEMPLATE_EXCEPTION_REPORT_RESPONSE_MARKUP, properties); + var exceptionList = result.children('#wps-exception-list'); + + // var extensionDiv = result + // .children('#wps-exception-report-response-extension'); + + // TODO FIXME display exceptions + if (parsedExceptions && !jQuery.isEmptyObject(parsedExceptions)) { + jQuery(parsedExceptions) + .each( + function(key, value) { + alert(key + " - " + value.code + ": " + + value.text); + jQuery + .tmpl( + TEMPLATE_EXCEPTION_MARKUP, + value).appendTo( + exceptionList); + }); + } + + return result; + } + + }); + +var BaseRequest = Class.extend({ + init : function(settings) { + this.settings = settings; + + this.addRequestTypeToSettings(); + }, + + addRequestTypeToSettings: function(){ + //override this method to add a request type to the settings object + }, + + getSettings : function() { + return this.settings; + }, + + execute : function(callback) { + /* + * define a callback which gets called after finishing the request + */ + this.callback = callback; + + this.preRequestExecution(); + + this.executeHTTPRequest(this.prepareHTTPRequest()); + + this.postRequestExecution(); + }, + + preRequestExecution : function() { + }, + + postRequestExecution : function() { + + }, + + processResponse : function(xml) { + + }, + + prepareHTTPRequest : function() { + return null; + }, + + executeHTTPRequest : function(requestSettings) { + /* + * we need 'self' as 'this' is different in the anonymous callbacks + */ + var self = this; + + var combinedRequestSettings = jQuery.extend({ + success : function(responseData) { + /* + * create an appropriate response document (which depends on the + * request type) + */ + var respFactory = new ResponseFactory(); + var response = respFactory.resolveResponseHandler(responseData, + self); + + /* + * if a callback function has been defined, then call it with + * the response object + */ + if (self.callback) { + self.callback(response); + } + + return response; + }, + error : function(jqXHR, textStatus, errorThrown) { + /* + * error handling, return textStatus and errorThrown as new + * object + */ + + var errorResponse = { + textStatus : textStatus, + errorThrown : jqXHR.responseText + } + + /* + * if a callback function has been defined, then call it with + * the response object + */ + if (self.callback) { + self.callback(errorResponse); + } + + } + }, requestSettings); + + var targetUrl; + if (USE_PROXY) { + if (PROXY_TYPE == "parameter") { + targetUrl = PROXY_URL + encodeURIComponent(this.settings.url); + } else { + // TODO split URL into host-base + query and create new + targetUrl = this.settings.url; + } + } else { + targetUrl = this.settings.url; + } + jQuery.ajax(targetUrl, combinedRequestSettings); + } +}); + + +var GetRequest = BaseRequest.extend({ + + prepareHTTPRequest : function() { + var targetUrl = this.settings.url; + var targetUrlQuery = this.settings.urlQuery; + + //check for a query part + if (!targetUrlQuery) { + targetUrlQuery = this.createTargetUrlQuery(); + } + + if (targetUrlQuery) { + this.settings.url = this.buildTargetUrl(targetUrl, targetUrlQuery); + } + + return { + type : "GET" + }; + }, + + /* + * overwrite this method to define specific behavior + */ + createTargetUrlQuery : function() { + return null; + }, + + buildTargetUrl : function(targetUrl, targetUrlQuery) { + if (targetUrl.indexOf("?") == -1) { + targetUrl += "?"; + } + + if (targetUrl.indexOf("service=") == -1) { + targetUrl += "service=WPS"; + } + + if (targetUrl.indexOf("version=") == -1) { + targetUrl += "&version=" + this.settings.version; + } + + if (targetUrlQuery) { + targetUrl += "&" + targetUrlQuery; + } + + return encodeURI(targetUrl); + } + +}); + + +var PostRequest = BaseRequest.extend({ + + prepareHTTPRequest : function() { + var payload = this.settings.data; + if (!payload) { + payload = this.createPostPayload(); + } + var postRequest = { + type : "POST", + data : payload, + contentType : "text/xml" + }; + + if (this.settings.mediaType !== "json"){ + postRequest.xhrFields = { + responseType: "blob" + }; + } + + return postRequest; + }, + /* + * overwrite this method to create specific payload + */ + createPostPayload : function() { + return null; + }, + + fillTemplate : function(template, properties) { + return fillXMLTemplate(template, properties); + } + +}); + +/** + * Helper class to construct input objects for execute requests against WPS 1.0 + * and 2.0 + */ +var InputGenerator = Class + .extend({ + /** + * + */ + init : function(settings) { + this.settings = settings; + }, + + /** + * the following parameters are mandatory: identifier and value + * + * the rest might be set to 'undefined'! + * + * @identifier input identifier + * @dataType data type of the input; may be 'undefined' + * @uom unit of measure; may be 'undefined' + * @value the literal value of the input + */ + createLiteralDataInput_wps_1_0_and_2_0 : function(identifier, dataType, + uom, value) { + var input = new Object({ + type : "literal", + identifier : identifier, + dataType : dataType || undefined, + uom : uom || undefined, + value : value + }); + + return input; + }, + + /** + * the following parameters are mandatory: identifier and + * complexPayload + * + * the rest might be set to 'undefined'! + * + * @identifier input identifier + * @mimeType MIME type of the input; may be 'undefined' + * @schema reference to a schema; may be 'undefined' + * @encoding encoding; may be 'undefined' + * @complexPayload the complex payload (XML tags) as String + * @asReference boolean, either "true" or "false", indicating + * whether parameter body contains a URL as reference + * to an external body or the actual POST body + */ + createComplexDataInput_wps_1_0_and_2_0 : function(identifier, + mimeType, schema, encoding, asReference, complexPayload) { + var input = new Object({ + type : "complex", + identifier : identifier, + mimeType : mimeType || undefined, + schema : schema || undefined, + encoding : encoding || undefined, + asReference : asReference || false, + complexPayload : complexPayload + }); + + return input; + }, + + /** + * the following parameters are mandatory: identifier, crs, + * lowerCorner and upperCorner + * + * the rest might be set to 'undefined'! + * + * @identifier input identifier + * @crs coordinate reference system URI + * @dimension number of dimensions in this CRS + * @lowerCorner orderedSequence of double values + * @upperCorner orderedSequence of double values + */ + createBboxDataInput_wps_1_0_and_2_0 : function(identifier, crs, + dimension, lowerCorner, upperCorner) { + var input = new Object({ + type : "bbox", + identifier : identifier, + crs : crs, + dimension : dimension || undefined, + lowerCorner : lowerCorner, + upperCorner : upperCorner + }); + + return input; + }, + + }); +/** + * Helper class to construct output objects for execute requests against WPS 1.0 + * and 2.0 + */ +var OutputGenerator = Class.extend({ + /** + * + */ + init : function(settings) { + this.settings = settings; + }, + + /** + * the following parameters are mandatory: identifier + * + * the rest might be set to 'undefined'! + * + * @identifier output identifier + * @mimeType MIME type of the input; may be 'undefined' + * @schema reference to a schema; may be 'undefined' + * @encoding encoding; may be 'undefined' + * @uom unit of measure; may be 'undefined' + * @asReference boolean, "true" or "false" + * @title new title + * @abstractValue new description as text of the 'Abstract' element + * of the response document + */ + createComplexOutput_WPS_1_0 : function(identifier, mimeType, schema, + encoding, uom, asReference, title, abstractValue) { + var output = new Object({ + type : "complex", + identifier : identifier, + mimeType : mimeType || undefined, + schema : schema || undefined, + encoding : encoding || undefined, + uom : uom || undefined, + asReference : asReference || false, + title : title || undefined, + abstractValue : abstractValue || undefined + }); + + return output; + }, + + /** + * the following parameters are mandatory: identifier + * + * @identifier output identifier + * @asReference boolean, "true" or "false" + */ + createLiteralOutput_WPS_1_0 : function(identifier, asReference) { + var output = new Object({ + type : "literal", + identifier : identifier, + asReference : asReference || false + }); + + return output; + }, + + /** + * the following parameters are mandatory: identifier and transmission + * + * the rest might be set to 'undefined'! + * + * @identifier output identifier + * @mimeType MIME type of the input; may be 'undefined' + * @schema reference to a schema; may be 'undefined' + * @encoding encoding; may be 'undefined' + * @transmission either "value" or "reference" + */ + createComplexOutput_WPS_2_0 : function(identifier, mimeType, schema, + encoding, transmission) { + var output = new Object({ + type : "complex", + identifier : identifier, + mimeType : mimeType || undefined, + schema : schema || undefined, + encoding : encoding || undefined, + transmission : transmission || "value" + }); + + return output; + }, + + /** + * the following parameters are mandatory: identifier and transmission + * + * @identifier output identifier + * @transmission either "value" or "reference" + */ + createLiteralOutput_WPS_2_0 : function(identifier, transmission) { + var output = new Object({ + type : "literal", + identifier : identifier, + transmission : transmission || "value" + }); + + return output; + } + +}); +/* + * the following variables define XML templates that will be instantiated + * during request building! + * + * in child classes they should be overridden to reflect the correct + * WPS version POST request + */ + +var EXECUTE_REQUEST_XML_START = ' \ + ${processIdentifier}\ + \ + ${dataInputs}\ + \ + ${responseForm}\ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_DATA_ALL_INPUT = '\ + ${identifier}\ + \ + \ + ${complexPayload}\ + \ + \ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_DATA_MIME_TYPE_INPUT = '\ + ${identifier}\ + \ + \ + ${complexPayload}\ + \ + \ +'; + +var EXECUTE_REQUEST_XML_COMPLEX_DATA_SCHEMA_INPUT = '\ + ${identifier}\ + \ + \ + ${complexPayload}\ + \ + \ +'; + +var EXECUTE_REQUEST_XML_COMPLEX_DATA_ENCODING_INPUT = '\ + ${identifier}\ + \ + \ + ${complexPayload}\ + \ + \ +'; + +var EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_ALL_INPUT = '\ + ${identifier}\ + \ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_SCHEMA_INPUT = '\ + ${identifier}\ + \ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_ENCODING_INPUT = '\ + ${identifier}\ + \ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_INPUT = '\ + ${identifier}\ + \ + '; + +var EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_TYPE = '\ + ${identifier}\ + \ + ${value}\ + \ + '; + +var EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_ALL = '\ + ${identifier}\ + \ + ${value}\ + \ + '; + +var EXECUTE_REQUEST_XML_LITERAL_DATA_NO_TYPE_INPUT = '\ + ${identifier}\ + \ + ${value}\ + \ + '; + +var EXECUTE_REQUEST_XML_BOUNDING_BOX_INPUT = '\ + ${identifier}\ + \ + \ + ${lowerCorner}\ + ${upperCorner}\ + \ + \ + '; + +var EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_ALL = '\ + \ + ${identifier}\ + \ + '; + +var EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE_ENCODING_UOM = '\ + \ + ${identifier}\ + \ + '; + +var EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE_UOM = '\ + \ + ${identifier}\ + \ + '; + +var EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE = '\ + \ + ${identifier}\ + \ + '; + +var EXECUTE_REQUEST_XML_RESPONSE_FORM_DOCUMENT = '\ + \ + ${outputs}\ + \ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_ALL_OUTPUT = '\ + ${identifier}\ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_OUTPUT = '\ + ${identifier}\ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_MIME_TYPE_OUTPUT = '\ + ${identifier}\ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_SCHEMA_OUTPUT = '\ + ${identifier}\ + '; + +var EXECUTE_REQUEST_XML_COMPLEX_ENCODING_OUTPUT = '\ + ${identifier}\ + '; + +var EXECUTE_REQUEST_XML_LITERAL_OUTPUT = '\ + ${identifier}\ + '; + +var ExecuteRequest = PostRequest.extend({ + + addRequestTypeToSettings : function() { + + // set new requestType parameter to a fixed value from Constants.js + this.settings.requestType = EXECUTE_TYPE; + }, + + createPostPayload : function() { + + /* + * used to reset all templates to reflect differences in different WPS version. + */ + this.overrideTemplates(); + + /* + * used to analyze the given request parameters and, if needed, + * add additional parameters to properly instantiate the templates. + */ + this.addVersionDependentProperties(); + + /** + * instantiate templates + */ + return this.fillTemplates(); + }, + + /** + * will adjust the templates stored in aforementioned variables to reflect + * the WPS version dependent execute request POST body + */ + overrideTemplates : function(){ + /* + * override in child methods + */ + }, + + + /** + * used to analyze the given request parameters and, if needed, + * add additional parameters to properly instantiate the + * templates. + */ + addVersionDependentProperties : function(){ + /* + * override in child methods + */ + + /* + * inspect missing values and instantiate with defaults + */ + if (!this.settings.executionMode) + this.settings.executionMode = "async"; + + if (!this.settings.responseFormat) + this.settings.responseFormat = "document"; + }, + + /** + * add certain parameters, if necessary, to the given object + */ + addVersionDependentPropertiesToFinalExecuteProperties : function(finalExecuteProperties){ + /* + * override in child classes + */ + return finalExecuteProperties; + }, + + /** + * instantiate all templates and concat them to create the POST body + */ + fillTemplates : function(){ + var inputs = this.settings.inputs; + var outputs = this.settings.outputs; + + var dataInputsMarkup = ""; + if (inputs) { + dataInputsMarkup = this.createDataInputsMarkup(inputs); + } + + var responseFormMarkup = ""; + if (outputs) { + responseFormMarkup = this.createResponseFormMarkup(outputs, this.settings.outputStyle); + } + + var finalExecuteProperties = { + processIdentifier: this.settings.processIdentifier, + dataInputs: dataInputsMarkup, + responseForm: responseFormMarkup + }; + + finalExecuteProperties = this.addVersionDependentPropertiesToFinalExecuteProperties(finalExecuteProperties); + + var result = this.fillTemplate(EXECUTE_REQUEST_XML_START, finalExecuteProperties); + + return result; + }, + + createDataInputsMarkup : function(inputs) { + var result = ""; + for (var i = 0; i < inputs.length; i++) { + var markup = ""; + if (equalsString("literal", inputs[i].type)) { + markup = this.createLiteralDataInput(inputs[i]); + } + else if (equalsString("complex", inputs[i].type)) { + markup = this.createComplexDataInput(inputs[i]); + } + else if (equalsString("bbox", inputs[i].type)) { + markup = this.createBoundingBoxDataInput(inputs[i]); + } + result += markup; + } + + return result; + }, + + /* + * example 'input' objects: + * + * { + * identifier: "theInputId", + * value: "10.0", + * dataType: "xs:double" + * } + * + * { + * identifier: "theInputId", + * value: "myStringValue" + * } + * + */ + createLiteralDataInput : function(input) { + var markup; + if (input.dataType) { + if(input.uom) + markup = this.fillTemplate(EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_ALL, input); + else + markup = this.fillTemplate(EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_TYPE, input); + } + else { + markup = this.fillTemplate(EXECUTE_REQUEST_XML_LITERAL_DATA_NO_TYPE_INPUT, input); + } + + return markup; + }, + + /* + * example 'input' objects: + * + * { + * identifier: "theProcessId", + * schema: "http://schema.xsd.url", + * complexPayload: "" + * } + * + * { + * identifier: "theProcessId", + * schema: "http://schema.xsd.url", + * href: "http://the.online.resource", + * method: "GET" + * } + * + */ + createComplexDataInput : function(input) { + var markup; + if (input.asReference) { + if (input.schema && input.encoding) { + markup = this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_ALL_INPUT, input); + } + + else if (input.schema && !input.encoding) { + markup = this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_SCHEMA_INPUT, input); + } + + else if (!input.schema && input.encoding) { + markup = this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_ENCODING_INPUT, input); + } + + else { + markup = this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_INPUT, input); + } + } + else { + if (input.schema && input.encoding) { + markup = this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_DATA_ALL_INPUT, input); + } + + else if (input.schema && !input.encoding) { + markup = this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_DATA_SCHEMA_INPUT, input); + } + + else if (!input.schema && input.encoding) { + markup = this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_DATA_ENCODING_INPUT, input); + } + + else { + markup = this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_DATA_MIME_TYPE_INPUT, input); + } + } + + return markup; + }, + + /* + * example 'input' objects: + * + * { + * identifier: "theInputId", + * crs: "EPSG:4236", + * dimension: 2, + * lowerCorner: "-10.0 40.5", + * upperCorner: "20.4 65.3", + * } + * + * { + * identifier: "theInputId", + * value: "myStringValue" + * } + * + */ + createBoundingBoxDataInput : function(input) { + /* + * set some default values + */ + if (!input.crs) { + input.crs = "EPSG:4326"; + } + + if (!input.dimension) { + input.dimension = 2; + } + + var markup = this.fillTemplate(EXECUTE_REQUEST_XML_BOUNDING_BOX_INPUT, input); + + return markup; + }, + + /* + * example 'outputStyle' objects: + * + * { + * storeExecuteResponse: true, + * lineage: false, + * status: true + * } + * + * example 'outputs' objects: + * + * [ + * { + * identifier: "myComplexOutput1", + * type: "complex", + * asReference:false, + * mimeType: "text/xml", + * schema:"http://schemas.opengis.net/gml/3.1.1/base/gml.xsd", + * encoding: "UTF-8" + * }, + * { + * identifier: "myLiteralOutput1", + * type: "literal" + * } + * ] + * + */ + createResponseFormMarkup : function(outputs, outputStyle) { + var outputString = ""; + var result; + + if(this.settings.responseFormat == "raw" && outputs.length == 1){ + /* + * raw output requested, only one output allowed. So take the first one. + */ + var rawOutput = outputs[0]; + + if (rawOutput.encoding && rawOutput.schema && rawOutput.mimeType && rawOutput.uom){ + result = this.fillTemplate(EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_ALL, rawOutput); + } + else if (rawOutput.encoding && rawOutput.mimeType && rawOutput.uom){ + result = this.fillTemplate(EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE_ENCODING_UOM, rawOutput); + } + else if (rawOutput.mimeType && rawOutput.uom){ + result = this.fillTemplate(EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE_UOM, rawOutput); + } + else { + result = this.fillTemplate(EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE, rawOutput); + } + + } + else{ + /* + * response document with additional attributes and multiple outputs! + */ + for (var i = 0; i < outputs.length; i++) { + if (equalsString("literal", outputs[i].type)) { + outputString += this.fillTemplate(EXECUTE_REQUEST_XML_LITERAL_OUTPUT, outputs[i]); + } + else { + if (outputs[i].encoding && outputs[i].schema && outputs[i].mimeType) { + outputString += this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_ALL_OUTPUT, outputs[i]); + } + + else if (outputs[i].encoding && !outputs[i].schema && outputs[i].mimeType) { + outputString += this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_ENCODING_OUTPUT, outputs[i]); + } + + else if (!outputs[i].encoding && outputs[i].schema && outputs[i].mimeType) { + outputString += this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_SCHEMA_OUTPUT, outputs[i]); + } + + else if (outputs[i].mimeType){ + outputString += this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_MIME_TYPE_OUTPUT, outputs[i]); + } + else{ + outputString += this.fillTemplate(EXECUTE_REQUEST_XML_COMPLEX_OUTPUT, outputs[i]); + } + } + } + + outputStyle.outputs = outputString; + + result = this.fillTemplate(EXECUTE_REQUEST_XML_RESPONSE_FORM_DOCUMENT, outputStyle); + } + + return result; + } + +}); + +/** + * + */ +var ExecuteRequest_v1 = ExecuteRequest + .extend({ + + /** + * will adjust the templates stored in ExecuteRequest.js file to + * reflect the WPS 1.0 request POST body + */ + overrideTemplates : function() { + EXECUTE_REQUEST_XML_START = ' \ + ${processIdentifier}\ + \ + ${dataInputs}\ + \ + ${responseForm}\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_ALL_INPUT = '\ + ${identifier}\ + \ + \ + ${complexPayload}\ + \ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_MIME_TYPE_INPUT = '\ + ${identifier}\ + \ + \ + ${complexPayload}\ + \ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_SCHEMA_INPUT = '\ + ${identifier}\ + \ + \ + ${complexPayload}\ + \ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_ENCODING_INPUT = '\ + ${identifier}\ + \ + \ + ${complexPayload}\ + \ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_ALL_INPUT = '\ + ${identifier}\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_SCHEMA_INPUT = '\ + ${identifier}\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_ENCODING_INPUT = '\ + ${identifier}\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_INPUT = '\ + ${identifier}\ + \ + '; + + EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_TYPE = '\ + ${identifier}\ + \ + ${value}\ + \ + '; + + EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_ALL = '\ + ${identifier}\ + \ + ${value}\ + \ + '; + + EXECUTE_REQUEST_XML_LITERAL_DATA_NO_TYPE_INPUT = '\ + ${identifier}\ + \ + ${value}\ + \ + '; + + EXECUTE_REQUEST_XML_BOUNDING_BOX_INPUT = '\ + ${identifier}\ + \ + \ + ${lowerCorner}\ + ${upperCorner}\ + \ + \ + '; + + EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_ALL = '\ + \ + ${identifier}\ + \ + '; + + EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE_ENCODING_UOM = '\ + \ + ${identifier}\ + \ + '; + + EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE_UOM = '\ + \ + ${identifier}\ + \ + '; + + EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE = '\ + \ + ${identifier}\ + \ + '; + + EXECUTE_REQUEST_XML_RESPONSE_FORM_DOCUMENT = '\ + \ + ${outputs}\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_ALL_OUTPUT = '\ + ${identifier}\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_OUTPUT = '\ + ${identifier}\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_MIME_TYPE_OUTPUT = '\ + ${identifier}\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_SCHEMA_OUTPUT = '\ + ${identifier}\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_ENCODING_OUTPUT = '\ + ${identifier}\ + '; + + EXECUTE_REQUEST_XML_LITERAL_OUTPUT = '\ + ${identifier}\ + '; + }, + + /** + * used to analyze the given request parameters and, if needed, add + * additional parameters to properly instantiate the templates. + */ + addVersionDependentProperties : function() { + + if (!this.settings.executionMode) + this.settings.executionMode = "async"; + + if (!this.settings.responseFormat) + this.settings.responseFormat = "document"; + + /* + * add an explicit outputStyle object + */ + + this.settings.outputStyle = new Object(); + if (this.settings.executionMode == "async") { + /* + * if execution mode is set to async, then we imply that + * response must be stored on the server and that there + * shall be status updates to enable status queries + */ + this.settings.storeExecuteResponse = true; + this.settings.status = true; + } else + this.settings.storeExecuteResponse = false; + + this.settings.outputStyle.lineage = false; + if (this.settings.lineage == true) + this.settings.outputStyle.lineage = true; + + this.settings.outputStyle.storeExecuteResponse = false; + if (this.settings.storeExecuteResponse == true) + this.settings.outputStyle.storeExecuteResponse = true; + + this.settings.outputStyle.status = false; + if (this.settings.status == true) + this.settings.outputStyle.status = true; + + }, + + prepareHTTPRequest : function() { + var payload = this.settings.data; + if (!payload) { + payload = this.createPostPayload(); + } + var postRequest = { + type : "POST", + data : payload, + contentType : "text/xml" + }; + + if (this.settings.mediaType !== "json"){ + postRequest.xhrFields = { + responseType: "blob" + }; + } + + return postRequest; + }, + + /** + * add certain parameters, if necessary, to the given object + */ + addVersionDependentPropertiesToFinalExecuteProperties : function( + finalExecuteProperties) { + /* + * for WPS 1.0 we do not have to add anything! + */ + return finalExecuteProperties; + } + + }); +/** + * + */ +var ExecuteRequest_v2 = ExecuteRequest + .extend({ + + /** + * will adjust the templates stored in ExecuteRequest.js file to + * reflect the WPS 2.0 request POST body + */ + overrideTemplates : function() { + + /* + * TODO ${responseForm} might be changed in WPS 2.0! check that! + */ + EXECUTE_REQUEST_XML_START = ' \ + ${processIdentifier}\ + ${dataInputs}\ + ${responseForm}\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_ALL_INPUT = '\ + \ + ${complexPayload}\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_MIME_TYPE_INPUT = '\ + \ + ${complexPayload}\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_SCHEMA_INPUT = '\ + \ + ${complexPayload}\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_ENCODING_INPUT = '\ + \ + ${complexPayload}\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_ALL_INPUT = '\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_SCHEMA_INPUT = '\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_ENCODING_INPUT = '\ + \ + '; + + EXECUTE_REQUEST_XML_COMPLEX_DATA_BY_REFERENCE_INPUT = '\ + \ + '; + /* + * These are the CORRECT values, currently the 52N WPS is + * implemented wrongly wrt literalValue + * + */ + EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_TYPE = '\ + \ + ${value}\ + \ + '; + + EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_ALL = '\ + \ + ${value}\ + \ + '; + + EXECUTE_REQUEST_XML_LITERAL_DATA_NO_TYPE_INPUT = '\ + \ + ${value}\ + \ + '; + + /* + * The follwing 3 are NOT CORRECT, but work currently with the + * 52°North WPS 2.0, which contains a false implmenetation wrt + * literalValues + */ +/* + EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_TYPE = '\ + \ + ${value}\ + \ + '; + + EXECUTE_REQUEST_XML_LITERAL_DATA_INPUT_ALL = '\ + \ + ${value}\ + \ + '; + + EXECUTE_REQUEST_XML_LITERAL_DATA_NO_TYPE_INPUT = '\ + \ + ${value}\ + \ + '; +*/ + EXECUTE_REQUEST_XML_BOUNDING_BOX_INPUT = '\ + \ + \ + ${lowerCorner}\ + ${upperCorner}\ + \ + \ + '; + + /* + * for WPS 2.0 there is no wrapping element around the outputs! + */ + EXECUTE_REQUEST_XML_RESPONSE_FORM_DOCUMENT = '${outputs}'; + + EXECUTE_REQUEST_XML_COMPLEX_ALL_OUTPUT = '\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_OUTPUT = '\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_MIME_TYPE_OUTPUT = '\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_SCHEMA_OUTPUT = '\ + '; + + EXECUTE_REQUEST_XML_COMPLEX_ENCODING_OUTPUT = '\ + '; + + EXECUTE_REQUEST_XML_LITERAL_OUTPUT = '\ + '; + + /* + * raw output + * + * in WPS 2.0 there is no special wrapping element for raw + * outputs, hence we just use the already specified output + * templates + * + * also in WPS 2.0 there is no specification of UOM anymore. so + * simply ignore uom. + */ + EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_ALL = EXECUTE_REQUEST_XML_COMPLEX_ALL_OUTPUT; + + EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE_ENCODING_UOM = EXECUTE_REQUEST_XML_COMPLEX_ENCODING_OUTPUT; + + EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE_UOM = EXECUTE_REQUEST_XML_COMPLEX_MIME_TYPE_OUTPUT; + + EXECUTE_REQUEST_XML_RESPONSE_FORM_RAW_TYPE = EXECUTE_REQUEST_XML_COMPLEX_MIME_TYPE_OUTPUT; + + }, + + /** + * used to analyze the given request parameters and, if needed, add + * additional parameters to properly instantiate the templates. + */ + addVersionDependentProperties : function() { + + if (!this.settings.executionMode) + this.settings.executionMode = "async"; + + if (!this.settings.responseFormat) + this.settings.responseFormat = "document"; + + /* + * needed object to properly instantiate the outputs + * (responseForm template) + */ + this.settings.outputStyle = new Object(); + + }, + + /** + * add certain parameters, if necessary, to the given object + */ + addVersionDependentPropertiesToFinalExecuteProperties : function( + finalExecuteProperties) { + /* + * override in child classes + */ + + finalExecuteProperties.responseFormat = this.settings.responseFormat; + finalExecuteProperties.executionMode = this.settings.executionMode; + + return finalExecuteProperties; + }, + + }); + +var DescribeProcessGetRequest = GetRequest.extend({ + + addRequestTypeToSettings : function() { + + // set new requestType parameter to a fixed value from Constants.js + this.settings.requestType = DESCRIBE_PROCESS_TYPE; + }, + + createTargetUrlQuery : function() { + var result = "request=DescribeProcess&identifier="+this.settings.processIdentifier; + + return result; + } + +}); + +var GetCapabilitiesGetRequest = GetRequest.extend({ + + addRequestTypeToSettings : function() { + + // set new requestType parameter to a fixed value from Constants.js + this.settings.requestType = GET_CAPABILITIES_TYPE; + }, + + createTargetUrlQuery : function() { + return "request=GetCapabilities"; + } + +}); + + + + +var DescribeProcessPostRequest = PostRequest.extend({ + + addRequestTypeToSettings : function() { + + // set new requestType parameter to a fixed value from Constants.js + this.settings.requestType = DESCRIBE_PROCESS_TYPE; + }, + + createPostPayload : function() { + + var DESCRIBE_PROCESS_POST = ""; + var processIdentifier = this.settings.processIdentifier; + var serviceVersion = this.settings.version; + + if(serviceVersion == WPS_VERSION_1_0_0) + DESCRIBE_PROCESS_POST = '\ + ' + processIdentifier + '\ + '; + + else + DESCRIBE_PROCESS_POST = '\ + ' + processIdentifier + '\ + '; + + return DESCRIBE_PROCESS_POST; + } + +}); + + + +var GetCapabilitiesPostRequest = PostRequest.extend({ + + addRequestTypeToSettings : function() { + + // set new requestType parameter to a fixed value from Constants.js + this.settings.requestType = GET_CAPABILITIES_TYPE; + }, + + createPostPayload : function() { + var GET_CAPABILITIES_POST = ""; + + var serviceVersion = this.settings.version; + + if(serviceVersion == WPS_VERSION_1_0_0) + GET_CAPABILITIES_POST = '\ + \ + ' + serviceVersion + '\ + \ + '; + + else{ + GET_CAPABILITIES_POST = ' \ + '; + } + + return GET_CAPABILITIES_POST; + } + +}); + +/** + * + */ +var GetStatusGetRequest = GetRequest.extend({ + + addRequestTypeToSettings : function() { + + // set new requestType parameter to a fixed value from Constants.js + this.settings.requestType = GET_STATUS_TYPE; + }, + + createTargetUrlQuery : function() { + var result = "request=GetStatus&jobId="+this.settings.jobId; + + return result; + } + +}); +/** + * + */ +var GetResultGetRequest = GetRequest.extend({ + + addRequestTypeToSettings : function() { + + // set new requestType parameter to a fixed value from Constants.js + this.settings.requestType = GET_RESULT_TYPE; + }, + + createTargetUrlQuery : function() { + var result = "request=GetResult&jobId="+this.settings.jobId; + + return result; + } + +}); +// refers to Constant.js +var defaultWpsVersion = WPS_VERSION_1_0_0; + +/** + * requires Constants.js! + */ +var WpsService = Class.extend({ + + /** + * + */ + init : function(settings) { + this.settings = settings; + + if (!this.settings.version || (this.settings.version !== '1.0.0' && this.settings.version !== '2.0.0')) + this.settings.version = defaultWpsVersion; + }, + + /** + * allowed values : "1.0.0" or "2.0.0" + * + * requires Constant.js + */ + setVersion : function(version) { + if (version === WPS_VERSION_1_0_0 || version === WPS_VERSION_2_0_0) + this.settings.version = version; + }, + + /** + * set base URL of target WPS + */ + setUrl : function(url) { + this.settings.url = url; + }, + + setMediaType : function(type) { + this.settings.mediaType = type; + }, + /** + * getCapabilities via HTTP GET + * + * @callbackFunction is triggered on success-event of JQuery.ajax method + */ + getCapabilities_GET : function(callbackFunction) { + var capabilitiesRequest; + + /** + * getCapabilities via HTTP GET + * + * @callbackFunction is triggered on success-event of JQuery.ajax + * method. Takes the response object as argument + */ + capabilitiesRequest = new GetCapabilitiesGetRequest({ + url : this.settings.url, + version : this.settings.version + }); + + capabilitiesRequest.execute(callbackFunction); + }, + + /** + * getCapabilities via HTTP POST + * + * @callbackFunction is triggered on success-event of JQuery.ajax method. + * Takes the response object as argument + */ + getCapabilities_POST : function(callbackFunction) { + var capabilitiesRequest; + + /* + * TODO has to be instantiated depending on the version + */ + capabilitiesRequest = new GetCapabilitiesPostRequest({ + url : this.settings.url, + version : this.settings.version + }); + + capabilitiesRequest.execute(callbackFunction); + }, + + /** + * process description via HTTP GET + * + * @callbackFunction is triggered on success-event of JQuery.ajax method. + * Takes the response object as argument + * @processIdentifier the identifier of the process + */ + describeProcess_GET : function(callbackFunction, processIdentifier) { + var processDescriptionRequest; + + processDescriptionRequest = new DescribeProcessGetRequest({ + url : this.settings.url, + version : this.settings.version, + processIdentifier : processIdentifier + }); + + processDescriptionRequest.execute(callbackFunction); + }, + + /** + * process description via HTTP POST + * + * @callbackFunction is triggered on success-event of JQuery.ajax method. + * Takes the response object as argument + * @processIdentifier the identifier of the process + */ + describeProcess_POST : function(callbackFunction, processIdentifier) { + var processDescriptionRequest; + + processDescriptionRequest = new DescribeProcessPostRequest({ + url : this.settings.url, + version : this.settings.version, + processIdentifier : processIdentifier + }); + + processDescriptionRequest.execute(callbackFunction); + }, + + /** + * WPS execute request via HTTP POST + * + * @callbackFunction is triggered on success-event of JQuery.ajax method. + * Takes the response object as argument + * @processIdentifier the identifier of the process + * @responseFormat either "raw" or "document", default is "document" + * @executionMode either "sync" or "async"; + * @lineage only relevant for WPS 1.0; boolean, if "true" then returned + * response will include original input and output definition + * @inputs an array of needed Input objects, use JS-object InputGenerator to + * create inputs + * @outputs an array of requested Output objects, use JS-object + * OutputGenerator to create inputs + */ + execute : function(callbackFunction, processIdentifier, responseFormat, + executionMode, lineage, inputs, outputs) { + var executeRequest; + + if (this.settings.version === WPS_VERSION_1_0_0) { + executeRequest = new ExecuteRequest_v1({ + url : this.settings.url, + version : this.settings.version, + mediaType: this.settings.mediaType, + processIdentifier : processIdentifier, + responseFormat : responseFormat, + executionMode : executionMode, + lineage : lineage, + inputs : inputs, + outputs : outputs + }); + } + + else { + executeRequest = new ExecuteRequest_v2({ + url : this.settings.url, + version : this.settings.version, + processIdentifier : processIdentifier, + responseFormat : responseFormat, + executionMode : executionMode, + inputs : inputs, + outputs : outputs + }); + } + + executeRequest.execute(callbackFunction); + }, + + /** + * Only important for WPS 1.0 + * + * @callbackFunction a callback function that will be triggered with the + * parsed executeResponse as argument + * @storedExecuteResponseLocation the url, where the execute response + * document is located / can be retrieved + * from + */ + parseStoredExecuteResponse_WPS_1_0 : function(callbackFunction, + storedExecuteResponseLocation) { + /* + * TODO the url stores a ready-to-be-parsed executeResponse. This should + * be parsed as ExecuteResponse_v1_xml object + * + * GET request against that URL + */ + $.ajax({ + url : storedExecuteResponseLocation, + success : function(executeResponseXML) { + /* + * create the executeResponse as JavaScript object + */ + var executeResponse = new ExecuteResponse_v1_xml( + executeResponseXML); + + /* + * call callback function and pass executeResponse-object as + * argument + */ + callbackFunction(executeResponse); + } + }); + }, + + /** + * WPS 2.0 getStatus operation to retrieve the status of an executed job + * + * Not usable with WPS 1.0 + * + * @callbackFunction a callback function that will be triggered with the + * parsed StatusInfo document as argument + * @jobId the ID of the asynchronously executed job + */ + getStatus_WPS_2_0 : function(callbackFunction, jobId) { + if (this.settings.version === WPS_VERSION_2_0_0) { + var getStatusRequest; + + getStatusRequest = new GetStatusGetRequest({ + url : this.settings.url, + version : this.settings.version, + jobId : jobId + }); + + getStatusRequest.execute(callbackFunction); + } + else{ + /* + * not supported for WPS 1.0 + */ + throw "Get Status operation is only supported for WPS 2.0!"; + } + }, + + /** + * WPS 2.0 getStatus operation to retrieve the status of an executed job + * + * Not usable with WPS 1.0 + * + * @callbackFunction a callback function that will be triggered with the + * parsed StatusInfo document as argument + * @jobId the ID of the asynchronously executed job + */ + getResult_WPS_2_0 : function(callbackFunction, jobId) { + if (this.settings.version === WPS_VERSION_2_0_0) { + var getResultRequest; + + getResultRequest = new GetResultGetRequest({ + url : this.settings.url, + version : this.settings.version, + jobId : jobId + }); + + getResultRequest.execute(callbackFunction); + } + else{ + /* + * not supported for WPS 1.0 + */ + throw "Get Result operation is only supported for WPS 2.0!"; + } + }, + + /** + * WPS execute request via HTTP POST + * + * @processIdentifier the identifier of the process + * @responseFormat either "raw" or "document", default is "document" + * @executionMode either "sync" or "async"; + * @lineage only relevant for WPS 1.0; boolean, if "true" then returned + * response will include original input and output definition + * @inputs an array of needed Input objects, use JS-object InputGenerator to + * create inputs + * @outputs an array of requested Output objects, use JS-object + * OutputGenerator to create inputs + */ + getXmlRequestExecuteProcess : function (processIdentifier , responseFormat , executionMode, + lineage , inputs , outputs ) { + var executeRequest; + + if (this.settings.version === WPS_VERSION_1_0_0) { + executeRequest = new ExecuteRequest_v1({ + url: this.settings.url, + version: this.settings.version, + processIdentifier: processIdentifier, + responseFormat: responseFormat, + executionMode: executionMode, + lineage: lineage, + inputs: inputs, + outputs: outputs + }); + } else { + executeRequest = new ExecuteRequest_v2({ + url: this.settings.url, + version: this.settings.version, + processIdentifier: processIdentifier, + responseFormat: responseFormat, + executionMode: executionMode, + inputs: inputs, + outputs: outputs + }); + } + + return executeRequest.createPostPayload(); + } + +}); +// EOX Update +global.WpsService = WpsService; +global.InputGenerator = InputGenerator; +global.OutputGenerator = OutputGenerator; diff --git a/client/src/main.js b/client/src/main.js index 5d1ddd0921e5d746c2dec8dd12ccbcc5bdab3514..2058fa646bdb535a2d20aee87384f9282f707f1d 100644 --- a/client/src/main.js +++ b/client/src/main.js @@ -45,6 +45,9 @@ import SelectFilesModalView from './views/SelectFilesModalView'; import CombinedResultView from './views/combined/CombinedResultView'; import QuoteModalView from './views/combined/QuoteModalView'; import SwitchMapModeView from './views/SwitchMapModeView'; +import WPSModalView from './views/WPSModalView'; +import ErrorModalView from 'eoxc/src/download/views/ErrorModalView'; +import WaitingResponseView from 'eoxc/src/download/views/WaitingResponseView'; import WarningsCollection from './models/WarningsCollection'; @@ -225,7 +228,8 @@ window.Application = Marionette.Application.extend({ downloadFormats: [], downloadProjections: [], downloadInterpolations: [], - enableGetEOCoverageSet: [], + downloadLimitCount: 10, + enableGetEOCoverageSet: false, uploadEnabled: true, downloadEnabled: true, searchEnabled: true, @@ -380,6 +384,7 @@ window.Application = Marionette.Application.extend({ availableProjections: settings.downloadProjections, availableInterpolations: settings.downloadInterpolations, + downloadLimitCount: settings.downloadLimitCount, }), })); }; @@ -388,7 +393,34 @@ window.Application = Marionette.Application.extend({ records, })); }; - + const onErrorModalView = () => { + layout.showChildView('notifications', new ErrorModalView()); + }; + const onWaitingResponse = () => { + layout.showChildView('notifications', new WaitingResponseView()); + }; + const startWPSProcessing = (records) => { + layout.showChildView('modals', new WPSModalView({ + searchCollection: new Backbone.Collection( + searchCollection.filter( + searchModel => searchModel.get('layerModel').get('download.protocol') !== 'S3' + ), + ), + baseLayersCollection, + overlayLayersCollection, + layersCollection, + records, + highlightFillColor: settings.highlightFillColor, + highlightStrokeColor: settings.highlightStrokeColor, + filterFillColor: settings.filterFillColor, + filterStrokeColor: settings.filterStrokeColor, + filterOutsideColor: settings.filterOutsideColor, + onStartDownload: startDownload, + projection: settings.projection, + onError: onErrorModalView, + onWaiting: onWaitingResponse, + })); + }; const showRecordDetails = (records) => { layout.showChildView('modals', new RecordsDetailsModalView({ baseLayersCollection, @@ -425,6 +457,7 @@ window.Application = Marionette.Application.extend({ model: new DownloadOptionsModel({ availableDownloadFormats: settings.downloadFormats, availableProjections: settings.downloadProjections, + downloadLimitCount: settings.downloadLimitCount, }), })); }); @@ -625,6 +658,7 @@ window.Application = Marionette.Application.extend({ collection: searchCollection, onStartDownload: startDownload, onSelectFiles: selectFiles, + onStartWPSProcessing: startWPSProcessing, termsAndConditionsUrl, downloadEnabled: settings.downloadEnabled, fallbackThumbnailUrl, diff --git a/client/src/views/RootLayoutView.hbs b/client/src/views/RootLayoutView.hbs index 6e6012da865b04c7995d970f4204d690eafa7ac9..9d876b3e247409c6f43fe8d13210014ad406c318 100644 --- a/client/src/views/RootLayoutView.hbs +++ b/client/src/views/RootLayoutView.hbs @@ -8,5 +8,6 @@
    +
    diff --git a/client/src/views/RootLayoutView.js b/client/src/views/RootLayoutView.js index 5c081b1fae206d307cc68c75ac7fb2bea16c5799..2004ad8af9c284d70eadb643dba95dc4e180af65 100644 --- a/client/src/views/RootLayoutView.js +++ b/client/src/views/RootLayoutView.js @@ -7,6 +7,7 @@ import template from './RootLayoutView.hbs'; export default Marionette.LayoutView.extend({ template, regions: { + notifications: '#notifications', content: '#content', leftPanel: '#leftPanel', rightPanel: '#rightPanel', diff --git a/client/src/views/WPSModalView.hbs b/client/src/views/WPSModalView.hbs new file mode 100644 index 0000000000000000000000000000000000000000..da1534dbe1351c2a86c02a2a606370553402d85a --- /dev/null +++ b/client/src/views/WPSModalView.hbs @@ -0,0 +1,34 @@ + diff --git a/client/src/views/WPSModalView.js b/client/src/views/WPSModalView.js new file mode 100644 index 0000000000000000000000000000000000000000..2e86650298210dcc2ba4ecfe188507c3e61976b0 --- /dev/null +++ b/client/src/views/WPSModalView.js @@ -0,0 +1,259 @@ +import $ from 'jquery'; +import _ from "underscore"; + +import ModalView from 'eoxc/src/core/views/ModalView'; +import OpenLayersMapView from 'eoxc/src/contrib/OpenLayers/OpenLayersMapView'; + +import FiltersModel from 'eoxc/src/core/models/FiltersModel'; +import HighlightModel from 'eoxc/src/core/models/HighlightModel'; +import MapModel from 'eoxc/src/core/models/MapModel'; +import LayersCollection from 'eoxc/src/core/models/LayersCollection'; +import { isRecordDownloadable } from 'eoxc/src/download'; +import { flattenDownloadSelectionByCoverage } from 'eoxc/src/download/url'; + +import template from './WPSModalView.hbs'; + +import './RecordsDetailsModalView.css'; +import ProcessingPanelView from 'eoxc/src/download/views/ProcessingPanelView' + +import '../lib/wps-js-all'; +import { downloadCustom} from 'eoxc/src/download/' + +const WPSModalView = ModalView.extend({ + template, + + className: 'record-details-modal-view modal fade', + + templateHelpers() { + return { + title: '', + hasNext: this.currentRecordIndex < this.records.length - 1, + hasPrev: this.currentRecordIndex > 0, + hasMore: this.records.length > 1, + }; + }, + + events: { + 'click .records-next': 'onRecordsNextClicked', + 'click .records-prev': 'onRecordsPrevClicked', + 'shown.bs.modal': 'onModalShown', + 'change .is-selected': 'onDownloadSelectionChange', + 'click .processing-button' : 'onStartProcessing', + }, + + regions: { + content: '.modal-body', + 'layer-options': '.layer-options', + }, + + initialize(options) { + this.searchCollection = options.searchCollection; + if (options.records) { + this.records = options.records; + } else { + this.records = this.searchCollection.reduce((acc, searchModel) => ( + acc.concat(searchModel.get('downloadSelection') + .map(recordModel => [recordModel, searchModel])) + ), []); + } + this.records = _.uniq(flattenDownloadSelectionByCoverage(this.records)) + this.currentRecordIndex = 0; + + this.baseLayersCollection = options.baseLayersCollection; + this.overlayLayersCollection = options.overlayLayersCollection; + this.layersCollection = options.layersCollection; + this.highlightFillColor = options.highlightFillColor; + this.highlightStrokeColor = options.highlightStrokeColor; + + this.filterFillColor = options.filterFillColor; + this.filterStrokeColor = options.filterStrokeColor; + this.filterOutsideColor = options.filterOutsideColor; + this.projection = options.projection; + this.onError = options.onError; + this.onLoading = options.onWaiting; + + this.mapModel = new MapModel({ center: [0, 0], zoom: 5, noclick: true, projection: this.projection }); + this.highlightModel = new HighlightModel(); + this.filtersModel = new FiltersModel(); + + this.$el.sizeChanged(() => { + this.updateResultsPanelSize(); + }); + + }, + + onModalShown() { + this.updateRecord(...this.records[this.currentRecordIndex]); + this.updateResultsPanelSize(); + }, + + updateResultsPanelSize() { + // resize results holding div based on variable footer and header sizes + const restHeightCombined = $('.modal-header').outerHeight(true) + $('.modal-footer').outerHeight(true); + $('.modal-body').height(`calc(100% - ${restHeightCombined}px)`); + }, + + updateRecord(recordModel, searchModel) { + let time = recordModel.get('properties').time; + if (time instanceof Date) { + time = [time, time]; + } + const layerModel = searchModel.get('layerModel'); + const displayParams = layerModel.get('detailsDisplay') || layerModel.get('display'); + this.mapModel.set('time', time); + this.mapView = new OpenLayersMapView({ + mapModel: this.mapModel, + filtersModel: this.filtersModel, + highlightModel: this.highlightModel, + baseLayersCollection: this.baseLayersCollection, + overlayLayersCollection: this.overlayLayersCollection, + layersCollection: new LayersCollection([layerModel]), + highlightFillColor: this.highlightFillColor, + highlightStrokeColor: this.highlightStrokeColor, + filterFillColor: this.filterFillColor, + filterStrokeColor: this.filterStrokeColor, + filterOutsideColor: this.filterOutsideColor, + staticHighlight: true, + useDetailsDisplay: true, + }); + + const detailsView = new ProcessingPanelView({ + processingModel:layerModel.get('wpsProcessing'), + model: recordModel, + mapModel: this.mapModel, + mapView: this.mapView, + descriptionTemplate: layerModel.get('search.descriptionTemplate'), + headerText: 'Description of', + }); + this.showChildView('content', detailsView); + + this.filtersModel.set('area', recordModel.attributes.geometry); + + this.mapModel.show(recordModel.attributes); + this.highlightModel.highlight(recordModel.attributes); + + this.$('.modal-title').text(`${layerModel.get('displayName')} - ${time[0].toISOString()}`); + this.$('.records-prev').toggleClass('disabled', !(this.currentRecordIndex > 0)); + this.$('.records-next').toggleClass('disabled', !(this.currentRecordIndex < this.records.length - 1)); + this.$('.current-record').text(this.currentRecordIndex + 1); + this.$('.record-count').text(this.records.length); + + const downloadSelection = searchModel.get('downloadSelection'); + const isSelectedForDownload = downloadSelection.findIndex(model => ( + model.get('id') === recordModel.get('id') + )) !== -1; + this.$('.is-selected').prop('checked', isSelectedForDownload); + this.$('.is-selected').parent().toggle(!!isRecordDownloadable(layerModel, recordModel)); + + this.$('.layer-options-dropdown').children().prop('disabled', true); + + }, + + onRecordsPrevClicked() { + if (this.currentRecordIndex > 0) { + this.currentRecordIndex -= 1; + this.updateRecord(...this.records[this.currentRecordIndex]); + } + }, + + onRecordsNextClicked() { + if (this.currentRecordIndex < this.records.length - 1) { + this.currentRecordIndex += 1; + this.updateRecord(...this.records[this.currentRecordIndex]); + } + }, + + handleJson(response){ + if (typeof(response) === 'string'){ + response = JSON.parse(response) + } + return JSON.stringify(response) + }, + + onStartProcessing(){ + + const [record, recordModel] = this.records[this.currentRecordIndex]; + const identifier = record.get('selectedProcess'); + if (identifier){ + this.onLoading(); + const WPSProcessSettings = recordModel.get('layerModel').get('wpsProcessing') + let WPSInputs = []; + let WPSOutputs = []; + const inputGenerator = new InputGenerator(); + const outputGenerator = new OutputGenerator(); + + const outputLookup = { + "image/jpeg" : "jpg", + "image/png" : "png", + "image/tiff" : "tif", + "text/csv" : "csv", + "application/json": "json" + } + const wpsService = new WpsService({ + url: WPSProcessSettings.url, + version: WPSProcessSettings.version + }); + + // inputs generation + const requestOptions = record.get('requestOptions'); + + Object.keys(requestOptions).filter(key => key !== 'outputs') + .map( option => { + let literalInput = inputGenerator.createLiteralDataInput_wps_1_0_and_2_0(option, null, null, requestOptions[option]); + WPSInputs.push(literalInput) + }); + + + // outputs generation + Object.keys(requestOptions.outputs) + .map( option => { + let WPSComplexOutput = outputGenerator.createComplexOutput_WPS_1_0(option, requestOptions.outputs[option]); + WPSOutputs.push(WPSComplexOutput) + }); + + const mediaType = WPSOutputs[0].mimeType; + let document = this.$el.parent().parent() + if (mediaType === 'application/json') wpsService.setMediaType('json') + const response = ((response) => { + let loading = document.find('.wps-loading') + loading.remove(); + if(response.textStatus ==='error'){ + + this.onError(); + + }else { + const content = mediaType === 'application/json'? this.handleJson(response.responseDocument): response.responseDocument; + downloadCustom('wps_result.' + outputLookup[mediaType], mediaType, content); + } + + }) + + wpsService.execute(response, identifier, "raw", "sync", false, WPSInputs, WPSOutputs); + } + + }, + + removeRecord(){ + this.records = this.records.filter(record => record != this.records[this.currentRecordIndex]) + this.currentRecordIndex -= 1; + if (this.records.length < 1){ + this.close(); + }else{ + this.onRecordsNextClicked(); + } + + + }, + + onDownloadSelectionChange() { + const [recordModel, searchModel] = this.records[this.currentRecordIndex]; + const downloadSelection = searchModel.get('downloadSelection'); + if (this.$('.is-selected').is(':checked')) { + downloadSelection.add(recordModel); + } else { + downloadSelection.remove(recordModel); + } + }, +}); + +export default WPSModalView; diff --git a/config/core09/core09_index-dev.html b/config/core09/core09_index-dev.html index a098da7deb5b71d28cd4bc8c7b09815c19ba89a4..5d1a52857811b8b49327f0f415506576238588d0 100644 --- a/config/core09/core09_index-dev.html +++ b/config/core09/core09_index-dev.html @@ -281,15 +281,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/core09/core09_index-ops.html b/config/core09/core09_index-ops.html index ade57251444dbfe9cfaa39d890751e357a9e74fb..a411ff405877c5e6a87bba6f10a811b8db919e46 100644 --- a/config/core09/core09_index-ops.html +++ b/config/core09/core09_index-ops.html @@ -287,15 +287,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/core12/core12_index-dev.html b/config/core12/core12_index-dev.html index 8bc5dbd00b5267e5a32ca576798ff331dd36a9c1..6aade6b618a1066f8e27f3f8f31cd7a1cfd24cb3 100644 --- a/config/core12/core12_index-dev.html +++ b/config/core12/core12_index-dev.html @@ -281,15 +281,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, { @@ -381,15 +382,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/core12/core12_index-ops.html b/config/core12/core12_index-ops.html index 8f381179a20c3fd3a14f07350d7a35e71b5f4d29..16fa05c802d11c70a0dab6411b6b0c79155238f5 100644 --- a/config/core12/core12_index-ops.html +++ b/config/core12/core12_index-ops.html @@ -287,15 +287,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, { @@ -387,15 +388,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/csea-emg/csea-emg_index-dev.html b/config/csea-emg/csea-emg_index-dev.html index c731b81419f28a053fe7a894a91942ac344b1282..7756ef756c8224036487943b6b079314c3582f27 100644 --- a/config/csea-emg/csea-emg_index-dev.html +++ b/config/csea-emg/csea-emg_index-dev.html @@ -260,15 +260,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/csea-emg/csea-emg_index-ops.html b/config/csea-emg/csea-emg_index-ops.html index e3a55d19db4ec2bab6d13c041a317ab602b766c4..7e2eb32c6860c2fbd1f310e2062ecc0b306b608c 100644 --- a/config/csea-emg/csea-emg_index-ops.html +++ b/config/csea-emg/csea-emg_index-ops.html @@ -266,15 +266,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/dem/dem_index-dev.html b/config/dem/dem_index-dev.html index 1100ce201c1d3950129509f8241814f93b34c6c8..cec8887c686b4b912282111699a276e1f3045f53 100644 --- a/config/dem/dem_index-dev.html +++ b/config/dem/dem_index-dev.html @@ -24,6 +24,335 @@ var today = new Date(); today.setUTCHours(24, 0, 0, 0); var baseUrl = '//127.0.0.1'; + var hillShade = { + "title": "Hillshaded relief", + "id": "DemProcessing", + "description": "Creates a hillshade from a DEM tile.", + "CoverageIdUsage": true, + "hasBBOX": true, + "additionalInputs": { + "identifier": "hillshade" + }, + "inputs": [ + { + "type": "bbox", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + { + "type": "selection", + "description": "Processing algorithm to be performed.", + "id": "algorithm", + "title": "Processing algorithm", + "options": [ + { + "title":"Horn", + "id":"algorithm" + }, + { + "title":"ZevenbergenThorne", + "id":"algorithm" + }, + ] + }, + { + "type": "string", + "description": "Azimuth of the light, in degrees. 0 if it comes from the top of the raster, 90 from the east, 315 is the default value.", + "id": "azimuth", + "title": "Azimuth", + }, + { + "type": "string", + "description": "Altitude of the light, in degrees. 90 if the light comes from above the DEM, 0 if it is raking light.", + "id": "altitude", + "title": "Altitude", + }, + { + "type": "string", + "description": "Optional vertical exaggeration used to pre-multiply the elevations. Default 1", + "id": "z_factor", + "title": "Z factor", + }, + { + "type": "string", + "description": "Optional ratio of vertical units to horizontal. Horizontal unit of the source DEM is in degrees - Lat/Long WGS84 projection, so scale can be set as '111120'. Default 1", + "id": "scale", + "title": "Scale", + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "result", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + } + ] + } + ] + }; + var aspect = { + "title": "Aspect", + "id": "DemProcessing", + "description": "Creates `Aspect` which is the orientation of slope of a DEM tile.", + "CoverageIdUsage": true, + "hasBBOX": true, + "additionalInputs": { + "identifier": "aspect" + }, + "inputs": [ + { + "type": "bbox", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + { + "type": "selection", + "description": "Processing algorithm to be performed.", + "id": "algorithm", + "title": "Processing algorithm", + "options": [ + { + "title":"Horn", + "id":"algorithm" + }, + { + "title":"ZevenbergenThorne", + "id":"algorithm" + }, + ] + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "result", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + } + ] + } + ] + }; + var slope = { + "title": "Slope", + "id": "DemProcessing", + "description": "Creates a `Slope` which is Slope is the steepness or the degree of incline of a DEM tile surface.", + "CoverageIdUsage": true, + "hasBBOX": true, + "additionalInputs": { + "identifier": "slopeshade" + }, + "inputs": [ + { + "type": "bbox", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + { + "type": "string", + "description": "Optional ratio of vertical units to horizontal. Horizontal unit of the source DEM is in degrees - Lat/Long WGS84 projection, so scale can be set as '111120'. Default 1", + "id": "scale", + "title": "Scale", + "options": [ + { + "title":"1", + "id":"scale" + }, + { + "title":"111120", + "id":"scale" + }, + ] + }, + { + "type": "selection", + "description": "Processing algorithm to be performed.", + "id": "algorithm", + "title": "Processing algorithm", + "options": [ + { + "title":"Horn", + "id":"algorithm" + }, + { + "title":"ZevenbergenThorne", + "id":"algorithm" + }, + ] + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "result", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + } + ] + } + ] + }; + var contour = { + "title": "Contour", + "id": "DemProcessing", + "description": "Creates a contour from DEM a tile.", + "CoverageIdUsage": true, + "hasBBOX": true, + "additionalInputs": { + "identifier": "contours" + }, + "inputs": [ + { + "type": "bbox", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + { + "type": "string", + "description": "Elevation interval between contours.", + "title": "Interval", + "id":"interval" + } + + ], + "outputs": [ + { + "title": "Output Format.", + "id": "result", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + }, + { + "title": "Geojson", + "id": "application/json" + } + ] + } + ] + }; + var GetHeightProfile = { + "title": "Height Profile", + "id": "GetHeightProfile", + "description": "Creates a height profile of a line crossing a DEM tile.", + "CoverageIdUsage": true, + "inputs": [ + { + "type": "line", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "line", + "title": "Horizontal line", + "line":true, + }, + { + "type": "selection", + "description": "interpolation method used to generate the profile output.", + "id": "method", + "title": "Interpolation Method", + "options": [ + { + "title":"near", + "id":"method" + }, + { + "title":"average", + "id":"method" + }, + { + "title":"max", + "id":"method" + }, + { + "title":"min", + "id":"method" + }, + { + "title":"med", + "id":"method" + } + ] + }, + { + "type": "string", + "description": "steps Interval ", + "id": "interval", + "title": "Distance interval.", + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "profile", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + }, + { + "title": "CSV", + "id": "text/csv" + } + ] + } + ] + }; + var config = { "settings": { "rightPanelOpen": true, @@ -34,6 +363,7 @@ "selectFilesDownloadEnabled": false, "enable3D": true, "mapMode": '3D', + // "terrainUrl": baseUrl + ":9000/tilesets/terrain-mesh/", "terrainUrl": "", "downloadEnabled": true, "searchEnabled" : true, @@ -292,16 +622,59 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + ":81/ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, { "id": 'DEM_COP-DEM_EEA-10-DGED', @@ -380,16 +753,59 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + ":81/ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM_COP-DEM_EEA-10-DGED", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, { "id": 'DEM_COP-DEM_EEA-10-INSP', @@ -468,16 +884,59 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + ":81/ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM_COP-DEM_EEA-10-INSP", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, { "id": 'DEM_COP-DEM_GLO-30-DTED', @@ -556,16 +1015,59 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + ":81/ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM_COP-DEM_GLO-30-DTED", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, { "id": 'DEM_COP-DEM_GLO-30-DGED', @@ -644,18 +1146,62 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + ":81/ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM_COP-DEM_GLO-30-DGED", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, ], + "overlayLayers": [ { "id": "overlay_base", diff --git a/config/dem/dem_index-ops.html b/config/dem/dem_index-ops.html index 1e3e0fdd2763545e1d5387717e95dae1c9e94894..f71197fe0308e6fc5ab959f13eb8273580a36c44 100644 --- a/config/dem/dem_index-ops.html +++ b/config/dem/dem_index-ops.html @@ -33,6 +33,335 @@ var baseUrlsOws = [ baseUrl + 'ows', ]; + var hillShade = { + "title": "Hillshaded relief", + "id": "DemProcessing", + "description": "Creates a hillshade from a DEM tile.", + "CoverageIdUsage": true, + "hasBBOX": true, + "additionalInputs": { + "identifier": "hillshade" + }, + "inputs": [ + { + "type": "bbox", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + { + "type": "selection", + "description": "Processing algorithm to be performed.", + "id": "algorithm", + "title": "Processing algorithm", + "options": [ + { + "title":"Horn", + "id":"algorithm" + }, + { + "title":"ZevenbergenThorne", + "id":"algorithm" + }, + ] + }, + { + "type": "string", + "description": "Azimuth of the light, in degrees. 0 if it comes from the top of the raster, 90 from the east, 315 is the default value.", + "id": "azimuth", + "title": "Azimuth", + }, + { + "type": "string", + "description": "Altitude of the light, in degrees. 90 if the light comes from above the DEM, 0 if it is raking light.", + "id": "altitude", + "title": "Altitude", + }, + { + "type": "string", + "description": "Optional vertical exaggeration used to pre-multiply the elevations. Default 1", + "id": "z_factor", + "title": "Z factor", + }, + { + "type": "string", + "description": "Optional ratio of vertical units to horizontal. Horizontal unit of the source DEM is in degrees - Lat/Long WGS84 projection, so scale can be set as '111120'. Default 1", + "id": "scale", + "title": "Scale", + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "result", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + } + ] + } + ] + }; + var aspect = { + "title": "Aspect", + "id": "DemProcessing", + "description": "Creates `Aspect` which is the orientation of slope of a DEM tile.", + "CoverageIdUsage": true, + "hasBBOX": true, + "additionalInputs": { + "identifier": "aspect" + }, + "inputs": [ + { + "type": "bbox", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + { + "type": "selection", + "description": "Processing algorithm to be performed.", + "id": "algorithm", + "title": "Processing algorithm", + "options": [ + { + "title":"Horn", + "id":"algorithm" + }, + { + "title":"ZevenbergenThorne", + "id":"algorithm" + }, + ] + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "result", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + } + ] + } + ] + }; + var slope = { + "title": "Slope", + "id": "DemProcessing", + "description": "Creates a `Slope` which is Slope is the steepness or the degree of incline of a DEM tile surface.", + "CoverageIdUsage": true, + "hasBBOX": true, + "additionalInputs": { + "identifier": "slopeshade" + }, + "inputs": [ + { + "type": "bbox", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + { + "type": "string", + "description": "Optional ratio of vertical units to horizontal. Horizontal unit of the source DEM is in degrees - Lat/Long WGS84 projection, so scale can be set as '111120'. Default 1", + "id": "scale", + "title": "Scale", + "options": [ + { + "title":"1", + "id":"scale" + }, + { + "title":"111120", + "id":"scale" + }, + ] + }, + { + "type": "selection", + "description": "Processing algorithm to be performed.", + "id": "algorithm", + "title": "Processing algorithm", + "options": [ + { + "title":"Horn", + "id":"algorithm" + }, + { + "title":"ZevenbergenThorne", + "id":"algorithm" + }, + ] + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "result", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + } + ] + } + ] + }; + var contour = { + "title": "Contour", + "id": "DemProcessing", + "description": "Creates a contour from DEM a tile.", + "CoverageIdUsage": true, + "hasBBOX": true, + "additionalInputs": { + "identifier": "contours" + }, + "inputs": [ + { + "type": "bbox", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + { + "type": "string", + "description": "Elevation interval between contours.", + "title": "Interval", + "id":"interval" + } + + ], + "outputs": [ + { + "title": "Output Format.", + "id": "result", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + }, + { + "title": "Geojson", + "id": "application/json" + } + ] + } + ] + }; + var GetHeightProfile = { + "title": "Height Profile", + "id": "GetHeightProfile", + "description": "Creates a height profile of a line crossing a DEM tile.", + "CoverageIdUsage": true, + "inputs": [ + { + "type": "line", + "description": "Draw a bounding box that intersects the DEM tile. Can be used to crop the output.", + "id": "line", + "title": "Horizontal line", + "line":true, + }, + { + "type": "selection", + "description": "interpolation method used to generate the profile output.", + "id": "method", + "title": "Interpolation Method", + "options": [ + { + "title":"near", + "id":"method" + }, + { + "title":"average", + "id":"method" + }, + { + "title":"max", + "id":"method" + }, + { + "title":"min", + "id":"method" + }, + { + "title":"med", + "id":"method" + } + ] + }, + { + "type": "string", + "description": "steps Interval ", + "id": "interval", + "title": "Distance interval.", + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "profile", + "mime_types": [ + { + "title": "PNG", + "id": "image/png" + }, + { + "title": "JPG", + "id": "image/jpeg" + }, + { + "title": "TIFF", + "id": "image/tiff" + }, + { + "title": "CSV", + "id": "text/csv" + } + ] + } + ] + }; + var config = { "settings": { "rightPanelOpen": true, @@ -299,16 +628,59 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + "ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, { "id": 'DEM_COP-DEM_EEA-10-DGED', @@ -387,16 +759,59 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + "ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM_COP-DEM_EEA-10-DGED", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, { "id": 'DEM_COP-DEM_EEA-10-INSP', @@ -475,16 +890,59 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + "ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM_COP-DEM_EEA-10-INSP", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, { "id": 'DEM_COP-DEM_GLO-30-DTED', @@ -563,16 +1021,59 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + "ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM_COP-DEM_GLO-30-DTED", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, { "id": 'DEM_COP-DEM_GLO-30-DGED', @@ -651,16 +1152,59 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } - } + }, + "wpsProcessing": { + "url": baseUrl + "ows", + "version": "1.0.0", + "processes": [ + hillShade, + aspect, + slope, + contour, + GetHeightProfile, + { + "title": "Get Statistics", + "id": "GetStatistics", + "description": "Get statistics for a coverage/s that intersects with the input bbox", + "CoverageIdUsage": false, + "hasBBOX": true, + "additionalInputs": { + "collection": "DEM_COP-DEM_GLO-30-DGED", + }, + "inputs": [ + { + "type": "bbox", + "description": "bounding box that intersect with the products.", + "id": "bbox", + "title": "Bounding box", + "box": true, + }, + ], + "outputs": [ + { + "title": "Output Format.", + "id": "statistics", + "mime_types": [ + { + "title": "JSON", + "id": "application/json" + } + ] + } + ] + } + ] + }, }, ], "overlayLayers": [ diff --git a/config/demF/demF_index-dev.html b/config/demF/demF_index-dev.html index fc791b771b9e03cd384703abe119b55248728afe..f34bc8b5ac3a31f84f1aaf6860468b1e4f545130 100644 --- a/config/demF/demF_index-dev.html +++ b/config/demF/demF_index-dev.html @@ -59,7 +59,7 @@ "timeSliderControls": true, "maxTooltips": 1, "center": [14.5, 43], - "zoom": 6 + "zoom": 6, "maxZoom": 17, "heightFactor" : 80000000, "footprintFillColor": "rgba(0, 0, 0, 0.1)", @@ -289,15 +289,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, { @@ -376,15 +377,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, { @@ -463,15 +465,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, { @@ -550,15 +553,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, { @@ -637,15 +641,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, ], diff --git a/config/demF/demF_index-ops.html b/config/demF/demF_index-ops.html index 0f42b5a01c956e8c03f8f5f5b0794cf919b7329e..b1b7441bfeb2ee493ebcf0399a76e759f8abca1d 100644 --- a/config/demF/demF_index-ops.html +++ b/config/demF/demF_index-ops.html @@ -295,15 +295,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, { @@ -382,15 +383,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, { @@ -469,15 +471,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, { @@ -556,15 +559,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, { @@ -643,15 +647,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__DEM1__coverage" - } } }, ], diff --git a/config/emg/emg_index-dev.html b/config/emg/emg_index-dev.html index c66a9b998700235a28a16d09170727c1e045f0c6..4ebcb85fbd0adb8990ca9ff7d49f14c3715bfd6f 100644 --- a/config/emg/emg_index-dev.html +++ b/config/emg/emg_index-dev.html @@ -260,15 +260,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/emg/emg_index-ops.html b/config/emg/emg_index-ops.html index 0cb1681332b61f541e5c96003faa5c0b72ff96ef..822b24bb3c65d3bcbfcbf54f686531a6d8ad45ef 100644 --- a/config/emg/emg_index-ops.html +++ b/config/emg/emg_index-ops.html @@ -266,15 +266,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/frtx-emg/frtx-emg_index-dev.html b/config/frtx-emg/frtx-emg_index-dev.html index 6e83414c16cb86a3a0c109a0be074288d88c2ff9..9ffee3e6618794b0c6dd4fad0f5236cded8ca639 100644 --- a/config/frtx-emg/frtx-emg_index-dev.html +++ b/config/frtx-emg/frtx-emg_index-dev.html @@ -260,15 +260,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/frtx-emg/frtx-emg_index-ops.html b/config/frtx-emg/frtx-emg_index-ops.html index 6ba6efea9accfb0630f59980d61b8177d1f3f6b1..da83b00ede230e739e0c74b287c876adf9c1c892 100644 --- a/config/frtx-emg/frtx-emg_index-ops.html +++ b/config/frtx-emg/frtx-emg_index-ops.html @@ -266,15 +266,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/sace-emg/sace-emg_index-dev.html b/config/sace-emg/sace-emg_index-dev.html index 0647e1aca66a13b6d6bae8eed1c281edfde43bd2..e7e1350754bb885c311dd45a63ffed8ab9a0766f 100644 --- a/config/sace-emg/sace-emg_index-dev.html +++ b/config/sace-emg/sace-emg_index-dev.html @@ -260,15 +260,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/sace-emg/sace-emg_index-ops.html b/config/sace-emg/sace-emg_index-ops.html index 4b60c84d085e922211e248ce517d2bba2096d048..8e61d3e7f0e8c78a2f6315d18acb3f8c57b3b694 100644 --- a/config/sace-emg/sace-emg_index-ops.html +++ b/config/sace-emg/sace-emg_index-ops.html @@ -266,15 +266,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/vhr18/vhr18_index-dev.html b/config/vhr18/vhr18_index-dev.html index c03fd50c7c498e204087a981026b1a3fc24cf451..f1ecc2219fece1f171f58e6500d951ea968c19b9 100644 --- a/config/vhr18/vhr18_index-dev.html +++ b/config/vhr18/vhr18_index-dev.html @@ -288,15 +288,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, { @@ -387,15 +388,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + ":81/ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/config/vhr18/vhr18_index-ops.html b/config/vhr18/vhr18_index-ops.html index e95d8a374d9a3ea16353e64c28c666742dc9bec0..83d7f3e5559cf7d7b3f14f504adba817c81c8815 100644 --- a/config/vhr18/vhr18_index-ops.html +++ b/config/vhr18/vhr18_index-ops.html @@ -294,15 +294,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, { @@ -393,15 +394,16 @@ "parametersFilterSettings": { "collapsed": false, }, + "extraFields": { + "properties.coverages": ["eoxs:coverageId/text()", false], + }, + "extraFieldsNamespaces": { + "eoxs": "http://eoxserver.org/eoxs/1.0" + }, }, "download": { "protocol": "EO-WCS", "url": baseUrl + "ows", - "rewrite": { - // add __coverage to the coverageId - "from": "({{id}})", - "to": "$1__coverage" - } } }, ], diff --git a/core/Dockerfile b/core/Dockerfile index ed3a4abae7656610ee97cf761f8c6ef10734eeb9..0e679c496250d690f490822e92ab531bd74053a1 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -25,7 +25,7 @@ # IN THE SOFTWARE. #----------------------------------------------------------------------------- -FROM eoxa/eoxserver:release-1.1.1-dev2 +FROM eoxa/eoxserver:release-1.1.1-dev7 ARG DEBUG="false"