Go to the documentation of this file.
25 #ifndef ZOO_RESPONSE_PRINT_H
26 #define ZOO_RESPONSE_PRINT_H 1
33 #define DEFAULT_SERVICE_URL "http://www.zoo-project.org/"
45 #define _(String) dgettext ("zoo-kernel",String)
49 #define _ss(String) dgettext ("zoo-services",String)
54 #define ZOO_LOCK_CREATE_FAILED -4
58 #define ZOO_LOCK_ACQUIRE_FAILED -5
62 #define ZOO_LOCK_RELEASE_FAILED -6
65 #include <sys/types.h>
87 #include <openssl/sha.h>
88 #include <openssl/md5.h>
89 #include <openssl/hmac.h>
90 #include <openssl/evp.h>
91 #include <openssl/bio.h>
92 #include <openssl/buffer.h>
94 #include <libxml/parser.h>
95 #include <libxml/xpath.h>
103 #define ZOO_NS_MAX 10
107 #define ZOO_DOC_MAX 20
147 {
"1.0.0",
"http://www.opengis.net/ows/1.1",
"http://www.opengis.net/wps/1.0.0",
"http://schemas.opengis.net/wps/1.0.0",
"%s %s/wps%s_response.xsd",
"http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd",
"1.1.0"},
148 {
"2.0.0",
"http://www.opengis.net/ows/2.0",
"http://www.opengis.net/wps/2.0",
"http://schemas.opengis.net/wps/2.0",
"http://www.opengis.net/wps/2.0 http://schemas.opengis.net/wps/2.0/wps.xsd",
"http://schemas.opengis.net/ows/2.0/owsExceptionReport.xsd",
"2.0.2",
"http://www.opengis.net/spec/wps/2.0/def/process-profile/"},
158 {
"GetCapabilities",
"DescribeProcess",
"Execute",NULL},
159 {
"GetCapabilities",
"DescribeProcess",
"Execute",
"GetStatus",
"GetResult",
"Dismiss",NULL},
173 {
"ProcessOfferings",
"ProcessDescriptions",
"ExecuteResponse",NULL},
174 {
"Contents",
"ProcessOfferings",
"Result",NULL}
183 "processVersion",
"1",
184 "storeSupported",
"true",
185 "statusSupported",
"true"
189 "processVersion",
"1.0.0",
190 "jobControlOptions",
"sync-execute async-execute dismiss",
191 "outputTransmission",
"value reference"
200 "500 Not Implemented",
201 "OperationNotSupported",
203 "InvalidQueryParameterValue",
208 "MissingParameterValue",
209 "InvalidParameterValue",
210 "InvalidUpdateSequence",
211 "OptionNotSupported",
212 "VersionNegotiationFailed",
229 "500 Not Implemented",
241 int zooXmlAddNs(xmlNodePtr,
const char*,
const char*);
267 void addMetadata(
map*,xmlDocPtr,xmlNodePtr,xmlNsPtr,xmlNsPtr,
int);
int zooXmlAddNs(xmlNodePtr, const char *, const char *)
Add an XML namespace to the usedNS if it was not already used.
Definition: response_print.c:273
void printRawdataOutput(maps **, maps *)
Print one outputs as raw.
Definition: response_print.c:3218
void printSessionHeaders(maps **)
Print the Set-Cookie header if necessary (conf["lenv"]["cookie"]) and save the session file.
Definition: response_print.c:148
void printDescription(xmlNodePtr, xmlNsPtr, const char *, map *, int)
Create XML node with basic ows metadata information (Identifier,Title,Abstract)
Definition: response_print.c:2561
static char wpsStatus[3][11]
Definitions of acceptable final status.
Definition: response_print.h:138
static char * SERVICE_URL
Global char* to store the serverAddress value of the [main] section.
Definition: response_print.h:112
void printBoundingBoxDocument(maps *, maps *, FILE *)
Print an ows:BoundingBox XML document.
Definition: response_print.c:3408
void printExceptionReportResponse(maps **, map *)
Print an OWS ExceptionReport or exception.yaml Document and HTTP headers (when required) depending on...
Definition: response_print.c:2678
void printOutputDefinitions(xmlDocPtr, xmlNodePtr, xmlNsPtr, xmlNsPtr, elements *, maps *, const char *)
Print a XML document.
Definition: response_print.c:2264
xmlNodePtr soapEnvelope(maps *, xmlNodePtr)
Generate a SOAP Envelope node when required (if the isSoap key of the [main] section is set to true).
Definition: response_print.c:349
void outputResponse(service *, maps *, maps *, map *, int, maps **, int)
Generate the output response (RawDataOutput or ResponseDocument)
Definition: response_print.c:2929
#define ZOO_DOC_MAX
Maximum number of XML docs.
Definition: response_print.h:107
static const char *const aapccStatusCodes[][10]
Correspondance between HTTP status code and exception code.
Definition: response_print.h:198
static int nbReqJob
Definitions requests requiring jobid (only for WPS version 2.0.0)
Definition: response_print.h:168
Metadata information about a full Service.
Definition: service.h:715
Metadata information about input or output.
Definition: service.h:700
void printProcessResponse(maps **, map *, int, service *, const char *, int, maps *, maps *)
Generate a wps:Execute XML document.
Definition: response_print.c:1908
char * produceFileUrl(service *, maps *, maps *, const char *, int)
Produce a copy file and the corresponding url in case it is required Please, free the returned ressou...
Definition: response_print.c:2825
#define ZOO_NS_MAX
Maximum number of XML namespaces.
Definition: response_print.h:103
xmlNodePtr printWPSHeader(xmlDocPtr, maps *, const char *, const char *, const char *, int)
Generate a WPS header.
Definition: response_print.c:383
xmlNodePtr createExceptionReportNode(maps *, map *, int)
Create an OWS ExceptionReport Node.
Definition: response_print.c:2698
void printStatusInfo(maps *, map *, char *)
Print a StatusInfo XML document.
Definition: response_print.c:3472
static const char * root_nodes[2][4]
Definitions of root node for response depending on the request and the WPS version.
Definition: response_print.h:172
xmlNodePtr printGetCapabilitiesHeader(xmlDocPtr, maps *, const char *)
Generate a Capabilities header.
Definition: response_print.c:481
void printHeaders(maps **)
Print the HTTP headers based on a map.
Definition: response_print.c:117
int printAFile(maps **, char *, zStatStruct, void(funcError)(maps **, map *))
Print a file red as binary.
Definition: response_print.c:53
void printDocument(maps **, xmlDocPtr, int)
Print a XML document.
Definition: response_print.c:2228
static xmlNsPtr usedNs[ZOO_NS_MAX]
Array of xmlNsPtr storing all used XML namespace.
Definition: response_print.h:117
linked list of map pointer
Definition: service.h:678
static int nbReqIdentifier
Definitions requests requiring identifier (depending on the WPS version)
Definition: response_print.h:164
static char * nsName[ZOO_NS_MAX]
Array storing names of the used XML namespace.
Definition: response_print.h:121
int zooXmlSearchForNs(const char *)
Search for an existing XML namespace in usedNS.
Definition: response_print.c:254
static int nbDocs
Number of XML docs.
Definition: response_print.h:133
int zooXmlAddDoc(xmlNodePtr, const char *, const char *)
int checkForSoapEnvelope(xmlDocPtr)
void printRawdataOutputs(maps **, service *, maps *)
Print all outputs as raw.
Definition: response_print.c:3123
KVP linked list.
Definition: service.h:657
void printIOType(xmlDocPtr, xmlNodePtr, xmlNsPtr, xmlNsPtr, xmlNsPtr, elements *, maps *, const char *, int)
Generate XML nodes describing inputs or outputs metadata.
Definition: response_print.c:2308
map * parseBoundingBox(const char *)
Parse a BoundingBox string.
Definition: response_print.c:3355
int errorException(maps **, const char *, const char *, const char *)
Print an OWS ExceptionReport.
Definition: response_print.c:2796
static int nbNs
Number of XML namespaces.
Definition: response_print.h:125
void printDescribeProcessForProcess(registry *, maps *, void *, void *, service *)
Generate a ProcessDescription node for a servie and add it to a given node.
Definition: response_print.c:1112
const char * produceStatusString(maps *, map *)
Produce the status string used in HTTP headers.
Definition: response_print.c:2594
void zooXmlCleanupDocs()
Free allocated memort to store XML documents.
Definition: response_print.c:332
void zooXmlCleanupNs()
Free allocated memory to store used XML namespace.
Definition: response_print.c:298
static const char * schemas[2][8]
Definitions of schemas depending on the WPS version.
Definition: response_print.h:146
void printGetCapabilitiesForProcess(registry *, maps *, void *, void *, service *)
Generate a wps:Process node for a servie and add it to a given node.
Definition: response_print.c:746
void addLangAttr(xmlNodePtr, maps *)
Add a land attribute to a XML node.
Definition: response_print.c:210
Profile registry.
Definition: service.h:735
static xmlDocPtr iDocs[ZOO_DOC_MAX]
Array of xmlDocPtr storing XML docs.
Definition: response_print.h:129
void addAdditionalParameters(map *, xmlDocPtr, xmlNodePtr, xmlNsPtr, xmlNsPtr, int)
Add AdditionalParameters nodes to any existing node.
Definition: response_print.c:953
void addMetadata(map *, xmlDocPtr, xmlNodePtr, xmlNsPtr, xmlNsPtr, int)
Add a Metadata node to any existing node.
Definition: response_print.c:864
void printBoundingBox(xmlNsPtr, xmlNodePtr, map *)
Create required XML nodes for boundingbox and update the current XML node.
Definition: response_print.c:3303
static const char * requests[2][7]
Definitions of requests depending on the WPS version.
Definition: response_print.h:157
static int nbSupportedRequests
Definitions of support requests (depending on the WPS version)
Definition: response_print.h:153
static const char * capabilities[2][7]
Name and corresponding attributes depending on the WPS version.
Definition: response_print.h:180
void localPrintException(maps **, map *)
Invoke the ensureFiltered then printExceptionReportResponseJ functions.
Definition: response_print.c:2777
#define zStatStruct
Definition: service.h:155
void printFullDescription(xmlDocPtr, int, elements *, const char *, xmlNsPtr, xmlNsPtr, xmlNodePtr, int, int, const map *)
Generate the required XML tree for the detailled metadata information of inputs or outputs.
Definition: response_print.c:1231