ZOO-Project
Functions | Variables
service_json.h File Reference
#include "response_print.h"
#include <stdio.h>
#include <ctype.h>
#include <service.h>
#include <json_object.h>

Go to the source code of this file.

Functions

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 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...
 
int createStatusFile (maps *, int)
 Create the status file. More...
 
json_object * createStatus (maps *, int)
 
char * json_getStatusFilePath (maps *)
 Get the status file path. More...
 
json_object * parseJson (maps *, char *)
 
json_object * json_readFile (maps *, char *)
 
char * getResultPath (maps *, char *)
 
int json_getStatusFile (maps *)
 Create the status file. More...
 
void produceApi (maps *, json_object *)
 Produce the JSON object for /api. More...
 

Variables

static const char * jcapabilities [4]
 Name and corresponding attributes depending on the WPS version. More...
 

Function Documentation

json_object* createStatus ( maps ,
int   
)
int createStatusFile ( maps conf,
int  status 
)

Create the status file.

Parameters
confthe maps containing the settings of the main.cfg file
statusan integer (SERVICE_ACCEPTED,SERVICE_STARTED...)
Returns
an integer (0 in case of success, 1 in case of failure)
char* getResultPath ( maps ,
char *   
)
int json_getStatusFile ( maps conf)

Create the status file.

Parameters
confthe 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
confthe maps containing the settings of the main.cfg file
Returns
a char* containing the full status file path
json_object* json_readFile ( maps ,
char *   
)
json_object* mapsToJson ( maps myMap)

Convert a maps to a json object.

Parameters
myMapthe 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
myMapthe map to be converted into json object
Returns
a json_object pointer to the created json_object
void parseJRequest ( maps conf,
service s,
json_object *  req,
map request_inputs,
maps **  inputs,
maps **  outputs 
)

Parse Json Request.

Parameters
confthe maps containing the settings of the main.cfg file
sthe current service metadata
reqthe JSON object of the request body
inputsthe produced maps
outputsthe produced maps
json_object* parseJson ( maps ,
char *   
)
void printExceptionReportResponseJ ( maps m,
map s 
)

Print an OWS ExceptionReport Document and HTTP headers (when required) depending on the code.

Set hasPrinted value to true in the [lenv] section.

Parameters
mthe maps containing the settings of the main.cfg file
sthe map containing the text,code,locator keys (or a map array of the same keys)
void printGetCapabilitiesForProcessJ ( registry reg,
maps m,
void *  doc0,
void *  nc0,
service serv 
)

Add all the capabilities properties to a json_object.

Parameters
refthe registry pointer
mthe main configuration maps pointer
doc0the void (json_object) pointer to add the property to
nc0the void (json_object) pointer to add the property to
servthe service pointer to extract the metadata from
json_object* printJobList ( maps conf)

Print the jobs list.

Parameters
confthe 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
confthe maps containing the settings of the main.cfg file
Returns
the JSON object pointer to the jobs list
json_object* printJResult ( maps conf,
service s,
maps result,
int  res 
)

Print the result of an execution.

Parameters
confthe maps containing the settings of the main.cfg file
sservice pointer to metadata
resultoutputs of the service
resthe status of execution SERVICE_FAILED/SERVICE_SUCCEEDED
Returns
the JSON object pointer to the result
void produceApi ( maps conf,
json_object *  res 
)

Produce the JSON object for /api.

Parameters
confthe maps containing the settings of the main.cfg file
resthe JSON object to populate
json_object* serviceToJson ( service myService)

Convert an service to a json object.

Parameters
myServicethe service pointer to be converted into a json object
Returns
a json_object pointer to the created json_object

Variable Documentation

const char* jcapabilities[4]
static
Initial value:
={
"jobControlOptions","sync-execute async-execute dismiss",
"outputTransmission","value reference"
}

Name and corresponding attributes depending on the WPS version.