ZOO-Project
|
#include "response_print.h"
#include <stdio.h>
#include <ctype.h>
#include <service.h>
#include <json_object.h>
#include "json_c_version.h"
Go to the source code of this file.
Macros | |
#define | JSON_C_TO_STRING_NOSLASHESCAPE (1<<4) |
Functions | |
maps * | jsonToMaps (json_object *) |
Convert a json object to maps. More... | |
map * | jsonToMap (json_object *) |
Convert a json object to map. More... | |
json_object * | mapToJson (map *) |
Convert a map to a json object. More... | |
json_object * | mapsToJson (maps *) |
Convert a maps to a json object. More... | |
json_object * | serviceToJson (service *) |
Convert an service to a json object. More... | |
void | printLiteralValueJ (maps *, map *, map *, json_object *, const char *) |
Add literal property depending on the dataType. More... | |
void | printGetCapabilitiesForProcessJ (registry *, maps *, void *, void *, service *) |
Add all the capabilities properties to a json_object. More... | |
void | printExceptionReportResponseJ (maps **, map *) |
Print an OWS ExceptionReport Document and HTTP headers (when required) depending on the code. More... | |
void | parseJRequest (maps *, service *, json_object *, map *, maps **, maps **) |
Parse Json Request. More... | |
json_object * | printJResult (maps **, service *, maps *, int) |
Print the result of an execution. More... | |
json_object * | printJobStatus (maps **, char *) |
Print the jobs status info cf. More... | |
json_object * | printJobList (maps **) |
Print the jobs list. More... | |
json_object * | printFilteredJobList (maps **, map *) |
Print the filtered jobs list. More... | |
int | createNextLinks (maps *, json_object *) |
Create the next links. More... | |
int | createStatusFile (maps *, int) |
Create the status file. More... | |
void | json_getStatusAttributes (maps *, map *, json_object *, int) |
Fetch the statusFields attributes. More... | |
json_object * | createStatus (maps *, int) |
Create the json object for job status. More... | |
char * | json_getStatusFilePath (maps *) |
Get the status file path. More... | |
json_object * | parseJson (maps *, char *) |
Parse a json string. More... | |
json_object * | json_readFile (maps *, char *) |
Read a json file. More... | |
char * | getResultPath (maps *, char *) |
Get the result path. More... | |
int | json_getStatusFile (maps *) |
Create the status file. More... | |
void | produceApi (maps *, json_object *) |
Produce the JSON object for /api. More... | |
void | produceRoot (maps *, json_object *) |
Produce the JSON response for /. More... | |
void | produceConformances (maps *, json_object *) |
Produce the JSON response for /conformance. More... | |
void | outputSingleJsonComplexRes (maps *, maps *, json_object *, json_object *, char *, long) |
Append required field to Json objects for a complex output. More... | |
bool | jsonIsFalse (json_bool) |
Trivial verification, check if a json_bool is equal to FALSE. More... | |
bool | serviceIsFilter (maps *, char *) |
Verify that a service name correspond to the Deploy or Undeploy service name. More... | |
Variables | |
static const char * | statusFields [6] |
Names of field to output in the status object. More... | |
static const char * | statusFieldsC [6] |
Coreresponding names of field from the data table to fetch informations. More... | |
static const char * | statusSearchFields [2] |
Coreresponding names of field from the data table to fetch informations. More... | |
static const char * | statusSearchFieldsReal [2] |
Coreresponding names of field from the data table to fetch informations. More... | |
static char | oapipStatus [5][11] |
Definitions of acceptable final status. More... | |
static const char * | jcapabilities [] |
Name and corresponding attributes depending on the WPS version. More... | |
static const char * | pccFields [9] |
Possible field names corresponding to pccRFields. More... | |
static const char * | pccRFields [3] |
Corresponding fields available in WPS for pccFields. More... | |
static const char * | rangeCorrespondances [4][2] |
Equivalent range keywords for WPS version 1 and 2. More... | |
#define JSON_C_TO_STRING_NOSLASHESCAPE (1<<4) |
int createNextLinks | ( | maps * | pmsConf, |
json_object * | obj | ||
) |
Create the next links.
pmsConf | 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 |
json_object* createStatus | ( | maps * | pmsConf, |
int | status | ||
) |
Create the json object for job status.
pmsConf | the conf maps containing the main.cfg settings |
status | integer |
int createStatusFile | ( | maps * | pmsConf, |
int | status | ||
) |
Create the status file.
pmsConf | the maps containing the settings of the main.cfg file |
status | an integer (SERVICE_ACCEPTED,SERVICE_STARTED...) |
char* getResultPath | ( | maps * | pmsConf, |
char * | jobId | ||
) |
Get the result path.
pmsConf | the conf maps containing the main.cfg settings |
jobId | the job identifier |
Fetch the statusFields attributes.
pmsConf | the conf maps containing the main.cfg settings |
pmSessId | the map pointer to the session id |
pjoRes | the object to store metadata informations |
iStatus | integer of the current execution status |
int json_getStatusFile | ( | maps * | pmsConf | ) |
Create the status file.
pmsConf | the maps containing the settings of the main.cfg file |
char* json_getStatusFilePath | ( | maps * | pmsConf | ) |
Get the status file path.
pmsConf | the maps containing the settings of the main.cfg file |
json_object* json_readFile | ( | maps * | pmsConf, |
char * | filePath | ||
) |
Read a json file.
pmsConf | the conf maps containing the main.cfg settings @praam filePath the file path to read |
bool jsonIsFalse | ( | json_bool | value | ) |
Trivial verification, check if a json_bool is equal to FALSE.
jbValue | json_bool value to verify if null |
map* jsonToMap | ( | json_object * | pjoObj | ) |
Convert a json object to map.
pjoObj | the json object to convert |
maps* jsonToMaps | ( | json_object * | pjoObj | ) |
Convert a json object to maps.
pjoObj | the json object to convert |
json_object* mapsToJson | ( | maps * | pmMap | ) |
Convert a maps to a json object.
pmMap | the maps to be converted into json object |
json_object* mapToJson | ( | map * | pmMap | ) |
Convert a map to a json object.
pmMap | the map to be converted into json object |
void outputSingleJsonComplexRes | ( | maps * | conf, |
maps * | resu, | ||
json_object * | pjoRes1, | ||
json_object * | pjoRes3, | ||
char * | pcValue, | ||
long | lLen | ||
) |
Append required field to Json objects for a complex output.
conf | maps pointer to the main configuration maps |
resu | maps pointer to the output |
pjoRes1 | json_object pointer to which the value field should be added |
pjoRes3 | json_object pointer to the format object associated with pjoRes1 |
pcValue | char pointer to the value to be allocated |
lLen | length of pcValue |
void parseJRequest | ( | maps * | pmsConf, |
service * | s, | ||
json_object * | pjoRequestBody, | ||
map * | pmRequestInputs, | ||
maps ** | inputs, | ||
maps ** | outputs | ||
) |
Parse Json Request.
pmsConf | the maps containing the settings of the main.cfg file |
s | the current service metadata |
pjoRequestBody | the JSON object of the request body |
pmRequestInputs | the produced maps |
inputs | the produced maps |
outputs | the produced maps |
json_object* parseJson | ( | maps * | pmsConf, |
char * | myString | ||
) |
Parse a json string.
pmsConf | the conf maps containing the main.cfg settings |
myString | the string containing the json content |
Print an OWS ExceptionReport Document and HTTP headers (when required) depending on the code.
Set hasPrinted value to true in the [lenv] section.
pmsConf | 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) |
Print the filtered jobs list.
ppmsConf | the maps containing the settings of the main.cfg file |
void printGetCapabilitiesForProcessJ | ( | registry * | reg, |
maps * | pmsConf, | ||
void * | doc0, | ||
void * | nc0, | ||
service * | serv | ||
) |
Add all the capabilities properties to a json_object.
reg | the registry pointer |
pmsConf | 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 |
json_object* printJobList | ( | maps ** | ppmsConf | ) |
Print the jobs list.
ppmsConf | the maps containing the settings of the main.cfg file |
json_object* printJobStatus | ( | maps ** | ppmsConf, |
char * | pcJobId | ||
) |
Print the jobs status info cf.
pmsConf | the maps containing the settings of the main.cfg file |
pcJobId | the char pointer to the jobid |
Print the result of an execution.
ppmsConf | the maps containing the settings of the main.cfg file |
s | service pointer to metadata |
result | outputs of the service |
iRes | the status of execution SERVICE_FAILED/SERVICE_SUCCEEDED |
void printLiteralValueJ | ( | maps * | pmConf, |
map * | pmType, | ||
map * | pmContent, | ||
json_object * | pjoSchema, | ||
const char * | pccFieldName | ||
) |
Add literal property depending on the dataType.
pmConf | the main configuration maps pointer |
pmType | the dataType map pointer |
pmContent | the iotype content map pointer |
pjoSchema | the json_object pointer to add the value |
pccFieldName | the field name string |
void produceApi | ( | maps * | pmsConf, |
json_object * | pjoRes | ||
) |
Produce the JSON object for /api.
pmsConf | the maps containing the settings of the main.cfg file |
pjoRes | the JSON object to populate |
void produceConformances | ( | maps * | pmsConf, |
json_object * | pjoRes | ||
) |
Produce the JSON response for /conformance.
pmsConf | the maps containing the settings of the main.cfg file |
pjoRes | the JSON object to populate |
void produceRoot | ( | maps * | pmsConf, |
json_object * | pjoRes | ||
) |
Produce the JSON response for /.
pmsConf | the maps containing the settings of the main.cfg file |
pjoRes | the JSON object to populate |
bool serviceIsFilter | ( | maps * | pmsConf, |
char * | pcService | ||
) |
Verify that a service name correspond to the Deploy or Undeploy service name.
pmsConf | the main configuration maps pointer |
pcService | the service name |
json_object* serviceToJson | ( | service * | psService | ) |
Convert an service to a json object.
psService | the service pointer to be converted into a json object |
|
static |
Name and corresponding attributes depending on the WPS version.
|
static |
Definitions of acceptable final status.
|
static |
Possible field names corresponding to pccRFields.
|
static |
Corresponding fields available in WPS for pccFields.
|
static |
Equivalent range keywords for WPS version 1 and 2.
|
static |
Names of field to output in the status object.
|
static |
Coreresponding names of field from the data table to fetch informations.
|
static |
Coreresponding names of field from the data table to fetch informations.
|
static |
Coreresponding names of field from the data table to fetch informations.