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 = '\ +