ZOO-Project
|
#include "service_json.h"
#include "json.h"
#include <errno.h>
#include "json_tokener.h"
#include "stdlib.h"
#include "mimetypes.h"
#include "server_internal.h"
#include "service_internal.h"
#include <dirent.h>
Functions | |
json_object * | mapToJson (map *myMap) |
Convert a map to a json object. More... | |
json_object * | mapsToJson (maps *myMap) |
Convert a maps to a json object. More... | |
json_object * | elementsToJson (elements *myElements) |
Convert an elements to a json object. More... | |
json_object * | serviceToJson (service *myService) |
Convert an service to a json object. More... | |
void | printAllowedRangesJ (maps *m, iotype *iot, json_object *prop) |
Add Allowed Range properties to a json_object. More... | |
void | printLiteralDataJ (maps *m, elements *in, json_object *input) |
Add literalDataDomains property to a json_object. More... | |
void | printFormatJ (maps *m, iotype *iot, json_object *res, bool isDefault, map *maxSize) |
Add Format properties to a json_object. More... | |
void | printJAdditionalParameters (maps *conf, map *meta, json_object *doc) |
Add additionalParameters property to a json_object. More... | |
void | printJMetadata (maps *conf, map *meta, json_object *doc) |
Add metadata property to a json_object. More... | |
void | printIOTypeJ (maps *m, const char *io, elements *in, json_object *inputs, service *serv) |
Add metadata properties to a json_object. More... | |
void | printGetCapabilitiesForProcessJ (registry *reg, maps *m, void *doc0, void *nc0, service *serv) |
Add all the capabilities properties to a json_object. More... | |
void | printExceptionReportResponseJ (maps *m, map *s) |
Print an OWS ExceptionReport Document and HTTP headers (when required) depending on the code. More... | |
void | parseJLiteral (maps *conf, json_object *req, elements *element, maps *output) |
Parse LiteralData value. More... | |
void | parseJComplex (maps *conf, json_object *req, elements *element, maps *output, const char *name) |
Parse ComplexData value. More... | |
void | parseJBoundingBox (maps *conf, json_object *req, elements *element, maps *output) |
Parse BoundingBox value. More... | |
void | _parseJIOSingle (maps *conf, elements *cio, maps **ioMaps, const char *ioType, const char *key, json_object *val, maps *cMaps) |
Parse a single input / output entity. More... | |
void | parseJIOSingle (maps *conf, elements *ioElements, maps **ioMaps, const char *ioType, const char *key, json_object *val) |
Parse a single input / output entity that can be an array. More... | |
void | parseJIO (maps *conf, json_object *req, elements *ioElements, maps **ioMaps, const char *ioType) |
Parse all the inputs / outputs entities. More... | |
void | parseJRequest (maps *conf, service *s, json_object *req, map *request_inputs, maps **inputs, maps **outputs) |
Parse Json Request. More... | |
json_object * | printJobStatus (maps *pmsConf, char *pcJobId) |
Print the jobs status info cf. More... | |
json_object * | printJobList (maps *conf) |
Print the jobs list. More... | |
json_object * | printJResult (maps *conf, service *s, maps *result, int res) |
Print the result of an execution. More... | |
int | createStatusLinks (maps *conf, int result, json_object *obj) |
Create the status links. More... | |
char * | json_getStatusFilePath (maps *conf) |
Get the status file path. More... | |
char * | getResultPath (maps *conf, char *jobId) |
json_object * | parseJson (maps *conf, char *myString) |
json_object * | json_readFile (maps *conf, char *filePath) |
json_object * | createStatus (maps *conf, int status) |
int | createStatusFile (maps *conf, int status) |
Create the status file. More... | |
int | json_getStatusFile (maps *conf) |
Create the status file. More... | |
void | produceApiInfo (maps *conf, json_object *res, json_object *res5) |
Produce the JSON object for api info object. More... | |
void | addResponse (const map *useContent, json_object *res, const map *pmSchema, const map *pmType, const char *code, const char *msg) |
void | addParameter (maps *conf, const char *oName, const char *fName, const char *in, json_object *res) |
void | produceApiParameters (maps *conf, json_object *res) |
Produce the JSON object for api parameter. More... | |
void | produceApiComponents (maps *conf, json_object *res) |
void | produceApi (maps *conf, json_object *res) |
Produce the JSON object for /api. More... | |
Variables | |
const char * | rangeCorrespondances [4][2] |
Equivalent range keywords for WPS version 1 and 2. More... | |
Function Documentation
void _parseJIOSingle | ( | maps * | conf, |
elements * | cio, | ||
maps ** | ioMaps, | ||
const char * | ioType, | ||
const char * | key, | ||
json_object * | val, | ||
maps * | cMaps | ||
) |
Parse a single input / output entity.
- Parameters
-
conf the maps containing the settings of the main.cfg file ioElements the elements extracted from the zcfg ioMaps the produced maps containing inputs (or outputs) ioType the char* set to inputs or outputs key char* the input/output name val json_object pointing to the input/output cMaps the outputed maps containing input (or output) metedata
void addParameter | ( | maps * | conf, |
const char * | oName, | ||
const char * | fName, | ||
const char * | in, | ||
json_object * | res | ||
) |
void addResponse | ( | const map * | useContent, |
json_object * | res, | ||
const map * | pmSchema, | ||
const map * | pmType, | ||
const char * | code, | ||
const char * | msg | ||
) |
json_object* createStatus | ( | maps * | conf, |
int | status | ||
) |
int createStatusFile | ( | maps * | conf, |
int | status | ||
) |
Create the status file.
- Parameters
-
conf the maps containing the settings of the main.cfg file status an integer (SERVICE_ACCEPTED,SERVICE_STARTED...)
- Returns
- an integer (0 in case of success, 1 in case of failure)
int createStatusLinks | ( | maps * | conf, |
int | result, | ||
json_object * | obj | ||
) |
Create the status links.
- Parameters
-
conf the maps containing the settings of the main.cfg file result an integer (>0 for adding the /result link) obj the JSON object pointer to add the links to
- Returns
- 0
json_object* elementsToJson | ( | elements * | myElements | ) |
Convert an elements to a json object.
- Parameters
-
myElements the elements pointer to be converted into a json object
- Returns
- a json_object pointer to the created json_object
char* getResultPath | ( | maps * | conf, |
char * | jobId | ||
) |
int json_getStatusFile | ( | maps * | conf | ) |
Create the status file.
- Parameters
-
conf the maps containing the settings of the main.cfg file
- Returns
- an integer (0 in case of success, 1 in case of failure)
char* json_getStatusFilePath | ( | maps * | conf | ) |
Get the status file path.
- Parameters
-
conf the maps containing the settings of the main.cfg file
- Returns
- a char* containing the full status file path
json_object* json_readFile | ( | maps * | conf, |
char * | filePath | ||
) |
json_object* mapsToJson | ( | maps * | myMap | ) |
Convert a maps to a json object.
- Parameters
-
myMap the maps to be converted into json object
- Returns
- a json_object pointer to the created json_object
json_object* mapToJson | ( | map * | myMap | ) |
Convert a map to a json object.
- Parameters
-
myMap the map to be converted into json object
- Returns
- a json_object pointer to the created json_object
Parse BoundingBox value.
- Parameters
-
conf the maps containing the settings of the main.cfg file req json_object pointing to the input/output element output the maps to set current json structure
void parseJComplex | ( | maps * | conf, |
json_object * | req, | ||
elements * | element, | ||
maps * | output, | ||
const char * | name | ||
) |
Parse ComplexData value.
- Parameters
-
conf the maps containing the settings of the main.cfg file req json_object pointing to the input/output element output the maps to set current json structure name the name of the request from http_requests
void parseJIO | ( | maps * | conf, |
json_object * | req, | ||
elements * | ioElements, | ||
maps ** | ioMaps, | ||
const char * | ioType | ||
) |
Parse all the inputs / outputs entities.
- Parameters
-
conf the maps containing the settings of the main.cfg file req json_object pointing to the input/output ioElements the elements extracted from the zcfg ioMaps the produced maps containing inputs (or outputs) ioType the char* set to inputs or outputs
void parseJIOSingle | ( | maps * | conf, |
elements * | ioElements, | ||
maps ** | ioMaps, | ||
const char * | ioType, | ||
const char * | key, | ||
json_object * | val | ||
) |
Parse a single input / output entity that can be an array.
- Parameters
-
conf the maps containing the settings of the main.cfg file ioElements the elements extracted from the zcfg ioMaps the produced maps containing inputs (or outputs) ioType the char* set to inputs or outputs key char* the input/output name val json_object pointing to the input/output
Parse LiteralData value.
- Parameters
-
conf the maps containing the settings of the main.cfg file req json_object pointing to the input/output element output the maps to set current json structure
void parseJRequest | ( | maps * | conf, |
service * | s, | ||
json_object * | req, | ||
map * | request_inputs, | ||
maps ** | inputs, | ||
maps ** | outputs | ||
) |
Parse Json Request.
- Parameters
-
conf the maps containing the settings of the main.cfg file s the current service metadata req the JSON object of the request body inputs the produced maps outputs the produced maps
json_object* parseJson | ( | maps * | conf, |
char * | myString | ||
) |
Add Allowed Range properties to a json_object.
- Parameters
-
m the main configuration maps pointer iot the iotype pointer prop the json_object pointer to add the allowed range properties
- Returns
- a json_object pointer to the created json_object
Print an OWS ExceptionReport Document and HTTP headers (when required) depending on the code.
Set hasPrinted value to true in the [lenv] section.
- Parameters
-
m 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)
Add Format properties to a json_object.
- Parameters
-
m the main configuration maps pointer iot the current iotype pointer res the json_object pointer to add the properties to isDefault boolean specifying if the currrent iotype is default maxSize a map pointer to the maximumMegabytes param defined in the zcfg file for this input/output
void printGetCapabilitiesForProcessJ | ( | registry * | reg, |
maps * | m, | ||
void * | doc0, | ||
void * | nc0, | ||
service * | serv | ||
) |
Add all the capabilities properties to a json_object.
- Parameters
-
ref the registry pointer m the main configuration maps pointer doc0 the void (json_object) pointer to add the property to nc0 the void (json_object) pointer to add the property to serv the service pointer to extract the metadata from
void printIOTypeJ | ( | maps * | m, |
const char * | io, | ||
elements * | in, | ||
json_object * | inputs, | ||
service * | serv | ||
) |
Add metadata properties to a json_object.
- Parameters
-
m the main configuration maps pointer io a string in an elements pointer to the current input/output inputs the json_object pointer to add the property to serv the service pointer to extract the metadata from
Add additionalParameters property to a json_object.
- Parameters
-
conf the main configuration maps pointer meta a map pointer to the current metadata informations doc the json_object pointer to add the property to
Add metadata property to a json_object.
- Parameters
-
conf the main configuration maps pointer meta a map pointer to the current metadata informations doc the json_object pointer to add the property to
json_object* printJobList | ( | maps * | conf | ) |
Print the jobs list.
- Parameters
-
conf the maps containing the settings of the main.cfg file
- Returns
- the JSON object pointer to the jobs list
json_object* printJobStatus | ( | maps * | pmsConf, |
char * | pcJobId | ||
) |
Print the jobs status info cf.
- Parameters
-
conf the maps containing the settings of the main.cfg file
- Returns
- the JSON object pointer to the jobs list
Print the result of an execution.
- Parameters
-
conf the maps containing the settings of the main.cfg file s service pointer to metadata result outputs of the service res the status of execution SERVICE_FAILED/SERVICE_SUCCEEDED
- Returns
- the JSON object pointer to the result
Add literalDataDomains property to a json_object.
- Parameters
-
m the main configuration maps pointer in the elements pointer input the json_object pointer to add the literalDataDomains property
- Returns
- a json_object pointer to the created json_object
void produceApi | ( | maps * | conf, |
json_object * | res | ||
) |
Produce the JSON object for /api.
- Parameters
-
conf the maps containing the settings of the main.cfg file res the JSON object to populate
void produceApiComponents | ( | maps * | conf, |
json_object * | res | ||
) |
void produceApiInfo | ( | maps * | conf, |
json_object * | res, | ||
json_object * | res5 | ||
) |
Produce the JSON object for api info object.
- Parameters
-
conf the maps containing the settings of the main.cfg file res the JSON object for the api info
void produceApiParameters | ( | maps * | conf, |
json_object * | res | ||
) |
Produce the JSON object for api parameter.
- Parameters
-
conf the maps containing the settings of the main.cfg file res the JSON object to populate with the parameters
json_object* serviceToJson | ( | service * | myService | ) |
Convert an service to a json object.
- Parameters
-
myService the service pointer to be converted into a json object
- Returns
- a json_object pointer to the created json_object
Variable Documentation
const char* rangeCorrespondances[4][2] |
Equivalent range keywords for WPS version 1 and 2.
Generated on Wed Feb 5 2025 12:00:17 for ZOO-Project by 1.8.9.1