|
ZOO-Project
|
#include "cpl_vsi.h"#include "service.h"#include "service_internal.h"#include "server_internal.h"#include "response_print.h"#include <dlfcn.h>#include "mimetypes.h"#include "service_json.h"Functions | |
| int | ensureFiltered (maps **, const char *) |
| Invoke the execution of the security module in case security is activated. More... | |
| int | printAFile (maps **ppmsConf, char *pcFilePath, zStatStruct zssStatus, void(funcError)(maps **, map *)) |
| Print a file red as binary. More... | |
| void | addPrefix (maps *pmsConf, map *pmLevel, service *psService) |
| Add prefix to the service name. More... | |
| void | printHeaders (maps **ppmsConf) |
| Print the HTTP headers based on a map. More... | |
| void | printLinkInfo (const char *pccUrl, const char *pccRel, const char *pccTitle, const char *pccType, const char *pccFormat) |
| Print link information. More... | |
| void | prepareLinksHeader (maps *pmsConfig, const char *pccEndPoint) |
| Prepare the Links header based on the profile of the endpoint. More... | |
| void | printAssociatedLinks (maps **ppmsConf) |
| Produce the Links header based on the links stored in the headers_links section of the main configuration. More... | |
| void | printSessionHeaders (maps **ppmsConf) |
| Print the Set-Cookie header if necessary (conf["lenv"]["cookie"]) and save the session file. More... | |
| void | addLangAttr (xmlNodePtr n, maps *pmsConf) |
| Add a land attribute to a XML node. More... | |
| char * | zCapitalize1 (char *tmp) |
| Replace the first letter by its upper case version in a new char array. More... | |
| char * | zCapitalize (char *tmp) |
| Replace all letters by their upper case version in a new char array. More... | |
| int | zooXmlSearchForNs (const char *name) |
| Search for an existing XML namespace in usedNS. More... | |
| int | zooXmlAddNs (xmlNodePtr nr, const char *url, const char *name) |
| Add an XML namespace to the usedNS if it was not already used. More... | |
| void | zooXmlCleanupNs () |
| Free allocated memory to store used XML namespace. More... | |
| int | zooXmlAddDoc (const char *value) |
| Add a XML document to the iDocs. More... | |
| void | zooXmlCleanupDocs () |
| Free allocated memort to store XML documents. More... | |
| xmlNodePtr | soapEnvelope (maps *conf, xmlNodePtr n) |
| Generate a SOAP Envelope node when required (if the isSoap key of the [main] section is set to true). More... | |
| xmlNodePtr | printWPSHeader (xmlDocPtr doc, maps *pmsConf, const char *req, const char *rname, const char *version, int reqId) |
| Generate a WPS header. More... | |
| void | addLanguageNodes (maps *conf, xmlNodePtr n, xmlNsPtr ns, xmlNsPtr ns_ows) |
| xmlNodePtr | printGetCapabilitiesHeader (xmlDocPtr doc, maps *pmsConf, const char *version="1.0.0") |
| Generate a Capabilities header. More... | |
| void | printGetCapabilitiesForProcess (registry *reg, maps *pmsConf, void *doc0, void *nc0, service *serv) |
| Generate a wps:Process node for a servie and add it to a given node. More... | |
| void | attachAttributes (xmlNodePtr n, xmlNsPtr ns, map *content, int vid, map *serviceType) |
| Attach attributes to a ProcessDescription or a ProcessOffering node. More... | |
| void | addMetadata (map *meta, xmlDocPtr doc, xmlNodePtr nc, xmlNsPtr ns_ows, xmlNsPtr ns_xlink, int vid) |
| Add a Metadata node to any existing node. More... | |
| void | addAdditionalParameters (map *meta, xmlDocPtr doc, xmlNodePtr nc, xmlNsPtr ns_ows, xmlNsPtr ns_xlink, int fromDb) |
| Add AdditionalParameters nodes to any existing node. More... | |
| void | addInheritedMetadata (xmlNodePtr n, xmlNsPtr ns_ows, xmlNsPtr ns_xlink, registry *reg, maps *main_conf, service *serv) |
| Add the ows:Metadata nodes relative to the profile registry. More... | |
| void | printDescribeProcessForProcess (registry *reg, maps *pmsConf, void *doc0, void *nc0, service *serv) |
| Generate a ProcessDescription node for a servie and add it to a given node. More... | |
| void | printFullDescription (xmlDocPtr doc, int in, elements *elem, const char *type, xmlNsPtr ns, xmlNsPtr ns_ows, xmlNodePtr nc1, int vid, int fromDb, const map *serviceType) |
| Generate the required XML tree for the detailled metadata information of inputs or outputs. More... | |
| void | printProcessResponse (maps **ppmsConf, map *request, int pid, service *serv, const char *service, int status, maps *inputs, maps *outputs) |
| Generate a wps:Execute XML document. More... | |
| void | printDocument (maps **ppmsConf, xmlDocPtr doc, int pid) |
| Print a XML document. More... | |
| void | printOutputDefinitions (xmlDocPtr doc, xmlNodePtr nc, xmlNsPtr ns_wps, xmlNsPtr ns_ows, elements *e, maps *pmsConf, const char *type) |
| Print a XML document. More... | |
| void | printIOType (xmlDocPtr doc, xmlNodePtr nc, xmlNsPtr ns_wps, xmlNsPtr ns_ows, xmlNsPtr ns_xlink, elements *e, maps *pmsConf, const char *type, int vid) |
| Generate XML nodes describing inputs or outputs metadata. More... | |
| void | printDescription (xmlNodePtr root, xmlNsPtr ns_ows, const char *identifier, map *amap, int vid=0) |
| Create XML node with basic ows metadata information (Identifier,Title,Abstract) More... | |
| const char * | produceStatusString (maps *pmConf, map *pmCode) |
| Produce the status string used in HTTP headers. More... | |
| void | _printExceptionReportResponse (maps **ppmsConf, map *s) |
| Print an OWS ExceptionReport Document and HTTP headers (when required) depending on the code. More... | |
| void | printExceptionReportResponse (maps **ppmsConf, map *pmError) |
| Print an OWS ExceptionReport or exception.yaml Document and HTTP headers (when required) depending on the code. More... | |
| xmlNodePtr | createExceptionReportNode (maps *pmsConf, map *s, int use_ns) |
| Create an OWS ExceptionReport Node. More... | |
| void | localPrintException (maps **pmsConf, map *pmError) |
| Invoke the ensureFiltered then printExceptionReportResponseJ functions. More... | |
| int | errorException (maps **pmsConf, const char *message, const char *errorcode, const char *locator) |
| Print an OWS ExceptionReport. More... | |
| char * | produceFileUrl (service *psService, maps *pmsConf, maps *pmsOutputs, const char *pccFormat, int itn) |
| Produce a copy file and the corresponding url in case it is required Please, free the returned ressource while used. More... | |
| void | outputResponse (service *s, maps *request_inputs, maps *request_outputs, map *request_inputs1, int cpid, maps **ppmsConf, int res) |
| Generate the output response (RawDataOutput or ResponseDocument) More... | |
| int | getNumberOfOutputs (maps *conf, maps *outputs) |
| Get the number of outputs provided in the execute request body. More... | |
| void | printRawdataOutputs (maps **ppmsConf, service *s, maps *outputs) |
| Print all outputs as raw. More... | |
| void | printRawdataOutput (maps **ppmsConf, maps *outputs) |
| Print one outputs as raw. More... | |
| void | printBoundingBox (xmlNsPtr ns_ows, xmlNodePtr n, map *boundingbox) |
| Create required XML nodes for boundingbox and update the current XML node. More... | |
| map * | parseBoundingBox (const char *value) |
| Parse a BoundingBox string. More... | |
| void | printBoundingBoxDocument (maps *pmsConf, maps *boundingbox, FILE *file) |
| Print an ows:BoundingBox XML document. More... | |
| void | printStatusInfo (maps *conf, map *statusInfo, char *req) |
| Print a StatusInfo XML document. More... | |
Print an OWS ExceptionReport Document and HTTP headers (when required) depending on the code.
Set hasPrinted value to true in the [lenv] section.
| ppmsConf | the maps containing the settings of the main.cfg file |
| s | the map containing the text,code,locator keys (or a map array of the same keys) |
| void addAdditionalParameters | ( | map * | meta, |
| xmlDocPtr | doc, | ||
| xmlNodePtr | nc, | ||
| xmlNsPtr | ns_ows, | ||
| xmlNsPtr | ns_xlink, | ||
| int | fromDb | ||
| ) |
Add AdditionalParameters nodes to any existing node.
| meta | the map defining the additional parameters |
| doc | the XML document used |
| nb | the node to add the additional parameters |
| ns_ows | the OWS namespace |
| ns_xlink | the xlink namespace |
| fromDb | 1 if the metadata has been extracted from the metadb, 0 otherwise |
| void addInheritedMetadata | ( | xmlNodePtr | n, |
| xmlNsPtr | ns_ows, | ||
| xmlNsPtr | ns_xlink, | ||
| registry * | reg, | ||
| maps * | main_conf, | ||
| service * | serv | ||
| ) |
Add the ows:Metadata nodes relative to the profile registry.
| n | the XML node to add the ows:Metadata |
| ns_ows | the ows XML namespace |
| ns_xlink | the ows xlink namespace |
| reg | the profile registry |
| main_conf | the map containing the main configuration content |
| serv | the service |
| void addLangAttr | ( | xmlNodePtr | n, |
| maps * | pmsConf | ||
| ) |
Add a land attribute to a XML node.
| n | the XML node to add the attribute |
| pmsConf | the map containing the language key to add as xml:lang |
| void addLanguageNodes | ( | maps * | conf, |
| xmlNodePtr | n, | ||
| xmlNsPtr | ns, | ||
| xmlNsPtr | ns_ows | ||
| ) |
| void addMetadata | ( | map * | meta, |
| xmlDocPtr | doc, | ||
| xmlNodePtr | nc, | ||
| xmlNsPtr | ns_ows, | ||
| xmlNsPtr | ns_xlink, | ||
| int | vid | ||
| ) |
Add a Metadata node to any existing node.
| meta | the map defining the additional parameters |
| doc | the XML document used |
| nb | the node to add the additional parameters |
| ns_ows | the OWS namespace |
| ns_xlink | the xlink namespace |
| vid | the version of WPS to use (0 for 1.0.0 and 1 for 2.0) |
Add prefix to the service name.
| pmsConf | the conf maps containing the main.cfg settings |
| pmLevel | the map containing the level information |
| psService | the service structure created from the zcfg file |
Attach attributes to a ProcessDescription or a ProcessOffering node.
| n | the XML node to attach the attributes to |
| ns | the XML namespace to create the attributes |
| content | the servive main content created from the zcfg file |
| vid | the version identifier (0 for 1.0.0 and 1 for 2.0.0) |
| serviceType | string containing the current service type |
Create an OWS ExceptionReport Node.
| m | the conf maps |
| s | the map containing the text,code,locator keys |
| use_ns | (0/1) choose if you want to generate an ExceptionReport or ows:ExceptionReport node respectively |
| int ensureFiltered | ( | maps ** | ppmsConf, |
| const char * | pcType | ||
| ) |
Invoke the execution of the security module in case security is activated.
| ppmsConf | the maps pointing to the main.cfg file content |
| pcType | the string defining the process to execute ('in' or 'out') |
| int errorException | ( | maps ** | pmsConf, |
| const char * | message, | ||
| const char * | errorcode, | ||
| const char * | locator | ||
| ) |
Print an OWS ExceptionReport.
| pmsConf | the conf maps |
| message | the error message |
| errorcode | the error code |
| locator | the potential locator |
Get the number of outputs provided in the execute request body.
| conf | the main configuration |
| outputs | the outputs to count |
Invoke the ensureFiltered then printExceptionReportResponseJ functions.
| pmsConf | the maps containing the settings of the main.cfg file |
| pmError | the map containing the text,code,locator keys (or a map array) |
| void outputResponse | ( | service * | s, |
| maps * | request_inputs, | ||
| maps * | request_outputs, | ||
| map * | request_inputs1, | ||
| int | cpid, | ||
| maps ** | ppmsConf, | ||
| int | res | ||
| ) |
Generate the output response (RawDataOutput or ResponseDocument)
| s | the service structure containing the metadata information |
| request_inputs | the inputs provided to the service for execution |
| request_outputs | the outputs updated by the service execution |
| request_inputs1 | the map containing the HTTP request |
| cpid | the process identifier attached to a service execution |
| pmsConf | the conf maps containing the main.cfg settings |
| res | the value returned by the service execution |
We get the requested output or fallback to the first one if the requested one is not present in the resulting outputs maps.
| map* parseBoundingBox | ( | const char * | value | ) |
Parse a BoundingBox string.
OGC 06-121r3: 10.2 Bounding box
Value is provided as : lowerCorner,upperCorner,crs,dimension Exemple : 189000,834000,285000,962000,urn:ogc:def:crs:OGC:1.3:CRS84
A map to store boundingbox information should contain:
Note : support only 2D bounding box.
| value | the char* containing the KVP bouding box |
| void prepareLinksHeader | ( | maps * | pmsConfig, |
| const char * | pccEndPoint | ||
| ) |
Prepare the Links header based on the profile of the endpoint.
| pmsaConfig | the main configuration map |
| pccEndPoint | the endpoint to check |
| int printAFile | ( | maps ** | ppmsConf, |
| char * | pcFilePath, | ||
| zStatStruct | zssStatus, | ||
| void(funcError)(maps **, map *) | |||
| ) |
Print a file red as binary.
| pmsConf | the maps containing the settings of the main.cfg file |
| pjoRes | the JSON object to populate |
| void printAssociatedLinks | ( | maps ** | ppmsConf | ) |
Produce the Links header based on the links stored in the headers_links section of the main configuration.
| ppmsConf | the main configuration map |
| void printBoundingBox | ( | xmlNsPtr | ns_ows, |
| xmlNodePtr | n, | ||
| map * | boundingbox | ||
| ) |
Create required XML nodes for boundingbox and update the current XML node.
| ns_ows | the ows XML namespace |
| n | the XML node to update |
| boundingbox | the map containing the boundingbox definition |
Print an ows:BoundingBox XML document.
| m | the maps containing the settings of the main.cfg file |
| boundingbox | the maps containing the boundingbox definition |
| file | the file to print the BoundingBox (if NULL then print on stdout) |
| void printDescribeProcessForProcess | ( | registry * | reg, |
| maps * | pmsConf, | ||
| void * | doc0, | ||
| void * | nc0, | ||
| service * | serv | ||
| ) |
Generate a ProcessDescription node for a servie and add it to a given node.
| reg | the profile registry |
| m | the conf maps containing the main.cfg settings |
| nc | the XML node to add the Process node |
| serv | the servive structure created from the zcfg file |
| void printDescription | ( | xmlNodePtr | root, |
| xmlNsPtr | ns_ows, | ||
| const char * | identifier, | ||
| map * | amap, | ||
| int | vid = 0 |
||
| ) |
Create XML node with basic ows metadata information (Identifier,Title,Abstract)
| root | the root XML node to add the description |
| ns_ows | the ows XML namespace |
| identifier | the identifier to use |
| amap | the map containing the ows metadata information |
| void printDocument | ( | maps ** | ppmsConf, |
| xmlDocPtr | doc, | ||
| int | pid | ||
| ) |
Print a XML document.
| ppmsConf | the conf maps containing the main.cfg settings |
| doc | the XML document |
| pid | the process identifier linked to a service |
Print an OWS ExceptionReport or exception.yaml Document and HTTP headers (when required) depending on the code.
| ppmsConf | the maps containing the settings of the main.cfg file |
| pmError | the map containing the text,code,locator keys (or a map array) |
| void printFullDescription | ( | xmlDocPtr | doc, |
| int | in, | ||
| elements * | elem, | ||
| const char * | type, | ||
| xmlNsPtr | ns, | ||
| xmlNsPtr | ns_ows, | ||
| xmlNodePtr | nc1, | ||
| int | vid, | ||
| int | fromDb, | ||
| const map * | serviceType | ||
| ) |
Generate the required XML tree for the detailled metadata information of inputs or outputs.
| in | 1 in case of inputs, 0 for outputs |
| elem | the elements structure containing the metadata information |
| type | the name ("Input" or "Output") of the XML node to create |
| ns_ows | the ows XML namespace |
| ns_ows | the ows XML namespace |
| nc1 | the XML node to use to add the created tree |
| vid | the WPS version id (0 for 1.0.0, 1 for 2.0.0) |
| fromDb | 1 in case the metadata comes from the DB, -1 in other cases |
| serviceType | the serviceType found in the ZCFG file or the DB |
Range: Table 46 OGC Web Services Common Standard
RangeClosure: Table 47 OGC Web Services Common Standard
| void printGetCapabilitiesForProcess | ( | registry * | reg, |
| maps * | pmsConf, | ||
| void * | doc0, | ||
| void * | nc0, | ||
| service * | serv | ||
| ) |
Generate a wps:Process node for a servie and add it to a given node.
| reg | the profiles registry |
| m | the conf maps containing the main.cfg settings |
| registry | the profile registry if any |
| nc | the XML node to add the Process node |
| serv | the service structure created from the zcfg file |
| xmlNodePtr printGetCapabilitiesHeader | ( | xmlDocPtr | doc, |
| maps * | pmsConf, | ||
| const char * | version = "1.0.0" |
||
| ) |
Generate a Capabilities header.
| doc | the document to add the header |
| m | the conf maps containing the main.cfg settings |
| void printHeaders | ( | maps ** | ppmsConf | ) |
Print the HTTP headers based on a map.
| ppmsConf | the map containing the headers information |
| void printIOType | ( | xmlDocPtr | doc, |
| xmlNodePtr | nc, | ||
| xmlNsPtr | ns_wps, | ||
| xmlNsPtr | ns_ows, | ||
| xmlNsPtr | ns_xlink, | ||
| elements * | e, | ||
| maps * | pmsConf, | ||
| const char * | type, | ||
| int | vid | ||
| ) |
Generate XML nodes describing inputs or outputs metadata.
| doc | the XML document |
| nc | the XML node to add the definition |
| ns_wps | the wps namespace |
| ns_ows | the ows namespace |
| ns_xlink | the xlink namespace |
| e | the output elements |
| m | the conf maps containing the main.cfg settings |
| type | the type |
| void printLinkInfo | ( | const char * | pccUrl, |
| const char * | pccRel, | ||
| const char * | pccTitle, | ||
| const char * | pccType, | ||
| const char * | pccFormat | ||
| ) |
Print link information.
| pccUrl | the URL of the link |
| pccRel | the rel attribute |
| pccTitle | the title attribute |
| pccType | the type attribute |
| pccFormat | the format attribute |
| void printOutputDefinitions | ( | xmlDocPtr | doc, |
| xmlNodePtr | nc, | ||
| xmlNsPtr | ns_wps, | ||
| xmlNsPtr | ns_ows, | ||
| elements * | e, | ||
| maps * | pmsConf, | ||
| const char * | type | ||
| ) |
Print a XML document.
| doc | the XML document (unused) |
| nc | the XML node to add the output definition |
| ns_wps | the wps XML namespace |
| ns_ows | the ows XML namespace |
| e | the output elements |
| m | the conf maps containing the main.cfg settings |
| type | the type (unused) |
| void printProcessResponse | ( | maps ** | ppmsConf, |
| map * | request, | ||
| int | pid, | ||
| service * | serv, | ||
| const char * | service, | ||
| int | status, | ||
| maps * | inputs, | ||
| maps * | outputs | ||
| ) |
Generate a wps:Execute XML document.
| ppmsConf | the conf maps containing the main.cfg settings |
| request | the map representing the HTTP request |
| pid | the process identifier linked to a service |
| serv | the serv structure created from the zcfg file |
| service | the service name |
| status | the status returned by the service |
| inputs | the inputs provided |
| outputs | the outputs generated by the service |
Check if the ZOO Service GetStatus is available in the local directory. If yes, then it uses a reference to an URL which the client can access to get information on the status of a running Service (using the percentCompleted attribute). Else fallback to the initial method using the xml file to write in ...
Display the process output only when requested !
In case there was no definition found in the ZCFG file but present in the service code
Print one outputs as raw.
| ppmsConf | the main configuration maps |
| outputs | the output to be print as raw |
Print all outputs as raw.
| pmsConf | the main configuration maps |
| outputs | the output to be print as raw |
| void printSessionHeaders | ( | maps ** | ppmsConf | ) |
Print the Set-Cookie header if necessary (conf["lenv"]["cookie"]) and save the session file.
The session file (sess_<SESSID>_.cfg where <SESSID> is the cookie value) is stored in the conf["main"]["tmpPath"] directory.
| ppmsConf | the main configuration map |
Print a StatusInfo XML document.
a statusInfo map should contain the following keys:
| conf | the maps containing the settings of the main.cfg file |
| statusInfo | the map containing the statusInfo definition |
| req | the WPS requests (GetResult, GetStatus or Dismiss) |
| xmlNodePtr printWPSHeader | ( | xmlDocPtr | doc, |
| maps * | pmsConf, | ||
| const char * | req, | ||
| const char * | rname, | ||
| const char * | version, | ||
| int | reqId | ||
| ) |
Generate a WPS header.
| doc | the document to add the header |
| m | the conf maps containing the main.cfg settings |
| req | the request type (GetCapabilities,DescribeProcess,Execute) |
| rname | the root node name |
| char* produceFileUrl | ( | service * | psService, |
| maps * | pmsConf, | ||
| maps * | pmsOutputs, | ||
| const char * | pccFormat, | ||
| int | itn | ||
| ) |
Produce a copy file and the corresponding url in case it is required Please, free the returned ressource while used.
| pmConf | maps* pointing to the main configuration file |
Produce the status string used in HTTP headers.
| pmConf | the maps containing the settings of the main.cfg file |
| pmCode | the map containing the error code (or a map array of the same keys) |
| xmlNodePtr soapEnvelope | ( | maps * | conf, |
| xmlNodePtr | n | ||
| ) |
Generate a SOAP Envelope node when required (if the isSoap key of the [main] section is set to true).
| conf | the conf maps containing the main.cfg settings |
| n | the node used as children of the generated soap:Envelope |
| char* zCapitalize | ( | char * | tmp | ) |
Replace all letters by their upper case version in a new char array.
| tmp | the char* |
| char* zCapitalize1 | ( | char * | tmp | ) |
Replace the first letter by its upper case version in a new char array.
| tmp | the char* |
| int zooXmlAddDoc | ( | const char * | value | ) |
Add a XML document to the iDocs.
| value | the string containing the XML document |
| int zooXmlAddNs | ( | xmlNodePtr | nr, |
| const char * | url, | ||
| const char * | name | ||
| ) |
Add an XML namespace to the usedNS if it was not already used.
| nr | the xmlNodePtr to attach the XML namspace (can be NULL) |
| url | the url of the XML namespace to add |
| name | the name of the XML namespace to add |
| void zooXmlCleanupDocs | ( | ) |
Free allocated memort to store XML documents.
| void zooXmlCleanupNs | ( | ) |
Free allocated memory to store used XML namespace.
| int zooXmlSearchForNs | ( | const char * | name | ) |
Search for an existing XML namespace in usedNS.
| name | the name of the XML namespace to search |
1.8.17