ZOO-Project
Functions
service_json.c File Reference
#include "service_json.h"
#include "json.h"
#include "json_c_version.h"
#include <errno.h>
#include "json_tokener.h"
#include "json_object.h"
#include "stdlib.h"
#include "mimetypes.h"
#include "server_internal.h"
#include "service_internal.h"
#include <dirent.h>

Functions

mapsjsonToMaps (json_object *pjoObj)
 Convert a json object to maps. More...
 
mapjsonToMap (json_object *pjoObj)
 Convert a json object to map. More...
 
bool jsonIsFalse (json_bool value)
 Trivial verification, check if a json_bool is equal to FALSE. More...
 
json_object * mapToJson (map *pmMap)
 Convert a map to a json object. More...
 
json_object * mapsToJson (maps *pmMap)
 Convert a maps to a json object. More...
 
json_object * elementsToJson (elements *peElements)
 Convert an elements to a json object. More...
 
json_object * serviceToJson (service *psService)
 Convert an service to a json object. More...
 
void addDescription (map *pmElement, int iIndex, json_object *pjoOutput, json_object *pjoOutput1)
 Add a description to one or two json objects using the abstract_file or abstract value. More...
 
void printAllowedRangesJ (maps *pmsConf, iotype *piotType, json_object *pjoProp)
 Add Allowed Range properties to a json_object. More...
 
void printLiteralValueJ (maps *pmConf, map *pmType, map *pmContent, json_object *pjoSchema, const char *pccFieldName)
 Add literal property depending on the dataType. More...
 
void printLiteralDataJ (maps *pmsConf, elements *peInput, json_object *pjoInput)
 Add literalDataDomains property to a json_object. More...
 
void printComplexHref (maps *pmsConf, elements *peElement, json_object *pjoRes, bool isDefault, map *pmMaxSize)
 Add support in the extended-schema for links object. More...
 
json_object * addArray (maps *m, elements *peElement)
 Add support for type array in extended-schema. More...
 
int getDefinitionFromSchemas (maps *pmsConf, const char *pccName, json_object *pjoInput)
 Get the data format definition from the schemas section, return 1 if found. More...
 
void printBoundingBoxJ (maps *pmsConf, elements *peInput, json_object *pjoInput)
 Add basic schema definition for the BoundingBox type. More...
 
void printFormatJ1 (maps *m, iotype *piotType, json_object *pjoRes, bool isDefault, map *pmMaxSize)
 Add schema property to a json_object (ComplexData) More...
 
void printFormatJ (maps *m, iotype *piotType, json_object *pjoRes, bool isDefault, map *pmMaxSize)
 Add format properties to a json_object. More...
 
void printJAdditionalParameters (maps *pmsConf, map *meta, json_object *doc)
 Add additionalParameters property to a json_object. More...
 
void printJMetadata (maps *pmsConf, map *meta, json_object *doc)
 Add metadata property to a json_object. More...
 
void printIOTypeJ (maps *pmsConf, const char *pccIo, elements *peInput, json_object *pjoInputs, service *psServ)
 Add metadata properties to a json_object. More...
 
void printGetCapabilitiesForProcessJ (registry *reg, maps *pmsConf, void *doc0, void *nc0, service *serv)
 Add all the capabilities properties to a json_object. More...
 
json_object * createExceptionJ (maps *pmsConf, map *s)
 Produce an exception JSON object. More...
 
void printExceptionReportResponseJ (maps **pmsConf, map *s)
 Print an OWS ExceptionReport Document and HTTP headers (when required) depending on the code. More...
 
void parseJLiteral (maps *pmsConf, json_object *req, elements *element, maps *output)
 Parse LiteralData value. More...
 
void checkCorrespondingJFields (maps *pmsConf, json_object *req, maps *output)
 Search field names used in the OGC API - Processes specification and replace them by old names from WPS. More...
 
void addToJRequests (maps **ppmsConf, const char *pccValue, const char *pccName)
 Add a http reques to the queue. More...
 
void parseNestedProcess (maps *pmsConf, json_object *req, elements *element, maps *output, const char *pccName)
 Parse a nested process json object. More...
 
void parseJComplex (maps *pmsConf, json_object *req, elements *element, maps *output, const char *pccName)
 Parse ComplexData value. More...
 
void parseJBoundingBox (maps *pmsConf, json_object *pjoInput, elements *element, maps *output)
 Parse BoundingBox value. More...
 
void returnBadRequestException (maps *pmsConf, elements *peInput)
 Return an exception response with Status: "400 Bad Request" if inputs are not in the proper format. More...
 
void _parseJIOSingle1 (maps *pmsConf, elements *cio, maps **ioMaps, const char *ioType, const char *pccKey, json_object *val, maps *cMaps)
 Parse a single input / output entity. More...
 
void _parseJIOSingle (maps *pmsConf, elements *cio, maps **ioMaps, const char *ioType, const char *pccKey, json_object *val, maps *cMaps)
 Parse a single input / output entity. More...
 
void parseJIOSingle (maps *pmsConf, elements *ioElements, maps **ioMaps, const char *ioType, const char *pccKey, json_object *val)
 Parse a single input / output entity that can be an array. More...
 
void parseJIO (maps *pmsConf, json_object *pjoInput, elements *ioElements, maps **ioMaps, const char *ioType)
 Parse all the inputs / outputs entities. More...
 
void parseJRequest (maps *pmsConf, service *s, json_object *pjoRequestBody, map *pmRequestInputs, maps **inputs, maps **outputs)
 Parse Json Request. More...
 
json_object * printJobStatus (maps **ppmsConf, char *pcJobId)
 Print the jobs status info cf. More...
 
bool isFilteredPid (maps *pmsConf, const char *pccPid)
 Verify if the process identified by pccPid is part of the processID filters, if any. More...
 
bool isFilteredDMM (maps *pmsConf, const char *pccPid)
 Verify if the process identified by pccPid is part of the processID filters, if any. More...
 
json_object * printJobList (maps **ppmsConf)
 Print the jobs list. More...
 
void filterJobByUser (maps *pmsConf, char **pcaClauseFinal, char *pcaClauseDate)
 
json_object * printFilteredJobList (maps **ppmsConf, map *pmRequestInputs)
 Print the filtered jobs list. More...
 
json_object * printJResult (maps **ppmsConf, service *s, maps *result, int iRes)
 Print the result of an execution. More...
 
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. More...
 
json_object * createALink (maps *conf, const char *rel, const char *type, const char *href)
 Create a link object with ref, type and href. More...
 
int createNextLinks (maps *pmsConf, json_object *obj)
 Create the next links. More...
 
mapfetchUsid (maps *pmsConf)
 Fetch the current jobid (can be usid or gs_usid in the lenv section). More...
 
void createStatusLinksFromLogs (maps *pmsConf, json_object *pjoObj)
 Detect if there is a _logs.cfg file associated with the execution. More...
 
int createStatusLinks (maps *pmsConf, int result, json_object *obj)
 Create the status links. More...
 
char * json_getStatusFilePath (maps *pmsConf)
 Get the status file path. More...
 
char * getResultPath (maps *pmsConf, char *jobId)
 Get the result path. More...
 
json_object * parseJson (maps *pmsConf, char *myString)
 Parse a json string. More...
 
json_object * json_readFile (maps *pmsConf, char *filePath)
 Read a json file. More...
 
void json_getStatusAttributes (maps *pmsConf, map *pmSessId, json_object *pjoRes, int iStatus)
 Fetch the statusFields attributes. More...
 
json_object * createStatus (maps *pmsConf, int status)
 Create the json object for job status. More...
 
int createStatusFile (maps *pmsConf, int status)
 Create the status file. More...
 
int json_getStatusFile (maps *pmsConf)
 Create the status file. More...
 
void produceApiInfo (maps *pmsConf, json_object *pjoRes, json_object *pjoRes5)
 Produce the JSON object for api info object. More...
 
void addResponse (const map *useContent, json_object *pjoRes, const map *pmSchema, const map *pmType, const char *code, const char *msg)
 
void addParameter (maps *pmsConf, const char *oName, const char *fName, const char *in, json_object *pjoRes)
 
void produceApiParameters (maps *pmsConf, json_object *pjoRes)
 Produce the JSON object for api parameter. More...
 
void addSecurityScheme (maps *pmsConf, const char *fName, json_object *pjoRes)
 Add a securityScheme to the OpenAPI components/securitySchemes object. More...
 
void produceApiSecuritySchemes (maps *pmsConf, json_object *pjoRes)
 Produce the JSON object for api securitySchemes. More...
 
void produceApiSchemas (maps *pmsConf, json_object *pjoRes)
 Produce the JSON object for api schemas. More...
 
void produceApiComponents (maps *pmsConf, json_object *pjoRes)
 
void produceOperationId (maps *pmsConf, maps *pmsContent, int iIndex, json_object *pjoRes)
 Generate an unique operationId attribute for a given endpoints. More...
 
void produceApi (maps *pmsConf, json_object *pjoRes)
 Produce the JSON object for /api. More...
 
void produceRoot (maps *pmsConf, json_object *pjoRes)
 Produce the JSON response for /. More...
 
void produceConformances (maps *pmsConf, json_object *pjoRes)
 Produce the JSON response for /conformance. More...
 
bool serviceIsFiltered (maps *pmsConf, char *pcService, maps *pmsFilter)
 Verify that a service name correspond to the a given process name. More...
 
bool serviceIsFilter (maps *pmsConf, char *pcService)
 Verify that a service name correspond to the Deploy or Undeploy service name. More...
 

Function Documentation

◆ _parseJIOSingle()

void _parseJIOSingle ( maps pmsConf,
elements cio,
maps **  ioMaps,
const char *  ioType,
const char *  pccKey,
json_object *  val,
maps cMaps 
)

Parse a single input / output entity.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
ioElementsthe elements extracted from the zcfg
ioMapsthe produced maps containing inputs (or outputs)
ioTypethe char* set to inputs or outputs
pccKeychar* the input/output name
valjson_object pointing to the input/output
cMapsthe outputed maps containing input (or output) metedata

◆ _parseJIOSingle1()

void _parseJIOSingle1 ( maps pmsConf,
elements cio,
maps **  ioMaps,
const char *  ioType,
const char *  pccKey,
json_object *  val,
maps cMaps 
)

Parse a single input / output entity.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
ioElementsthe elements extracted from the zcfg
ioMapsthe produced maps containing inputs (or outputs)
ioTypethe char* set to inputs or outputs
pccKeychar* the input/output name
valjson_object pointing to the input/output
cMapsthe outputed maps containing input (or output) metedata

◆ addArray()

json_object* addArray ( maps m,
elements peElement 
)

Add support for type array in extended-schema.

Parameters
mthe main configuration maps pointer
peElementthe elements pointer

◆ addDescription()

void addDescription ( map pmElement,
int  iIndex,
json_object *  pjoOutput,
json_object *  pjoOutput1 
)

Add a description to one or two json objects using the abstract_file or abstract value.

In case an abstract_file is found, then the ZOO-Kernel will try to read the provided file path and use its content as the description value.

Parameters
pmElementthe current map to search for abstract_file/abstract field
iIndexthe index to use to fetch from the map array
pjoOutputthe first json object to add the description
pjoOutput1the second json object to add the description (optional)

◆ addParameter()

void addParameter ( maps pmsConf,
const char *  oName,
const char *  fName,
const char *  in,
json_object *  pjoRes 
)

◆ addResponse()

void addResponse ( const map useContent,
json_object *  pjoRes,
const map pmSchema,
const map pmType,
const char *  code,
const char *  msg 
)

◆ addSecurityScheme()

void addSecurityScheme ( maps pmsConf,
const char *  fName,
json_object *  pjoRes 
)

Add a securityScheme to the OpenAPI components/securitySchemes object.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
fNamethe key to add to the res json object
pjoResthe json object to store the content

◆ addToJRequests()

void addToJRequests ( maps **  ppmsConf,
const char *  pccValue,
const char *  pccName 
)

Add a http reques to the queue.

Parameters
ppmsConfthe maps containing the settings of the main.cfg file
pccValuethe URL to fetch
pccNamethe name of the input

◆ checkCorrespondingJFields()

void checkCorrespondingJFields ( maps pmsConf,
json_object *  req,
maps output 
)

Search field names used in the OGC API - Processes specification and replace them by old names from WPS.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
reqjson_object to fetch attributes from
outputthe maps to store metadata informations as a maps

◆ createALink()

json_object* createALink ( maps conf,
const char *  rel,
const char *  type,
const char *  href 
)

Create a link object with ref, type and href.

Parameters
confmaps pointer to the main configuration maps
relchar pointer defining the rel attribute
typechar pointer defining the type attribute
hrefchar pointer defining the href attribute
Returns
json_object pointer to the link object

◆ createExceptionJ()

json_object* createExceptionJ ( maps pmsConf,
map s 
)

Produce an exception JSON object.

Parameters
pmsConfthe 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)
Returns
the create JSON object (make sure to free memory)

◆ createNextLinks()

int createNextLinks ( maps pmsConf,
json_object *  obj 
)

Create the next links.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
resultan integer (>0 for adding the /result link)
objthe JSON object pointer to add the links to
Returns
0

◆ createStatus()

json_object* createStatus ( maps pmsConf,
int  status 
)

Create the json object for job status.

Parameters
pmsConfthe conf maps containing the main.cfg settings
statusinteger
Returns
the created json_object

◆ createStatusFile()

int createStatusFile ( maps pmsConf,
int  status 
)

Create the status file.

Parameters
pmsConfthe 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)

◆ createStatusLinks()

int createStatusLinks ( maps pmsConf,
int  result,
json_object *  obj 
)

Create the status links.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
resultan integer (>0 for adding the /result link)
objthe JSON object pointer to add the links to
Returns
0

◆ createStatusLinksFromLogs()

void createStatusLinksFromLogs ( maps pmsConf,
json_object *  pjoObj 
)

Detect if there is a _logs.cfg file associated with the execution.

If yes, add the links defined in the section to the standard links associated with a job statusInfo.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoObjthe JSON object pointer to add the links to

◆ elementsToJson()

json_object* elementsToJson ( elements peElements)

Convert an elements to a json object.

Parameters
peElementsthe elements pointer to be converted into a json object
Returns
a json_object pointer to the created json_object

◆ fetchUsid()

map* fetchUsid ( maps pmsConf)

Fetch the current jobid (can be usid or gs_usid in the lenv section).

Parameters
pmsConfthe maps containing the settings of the main.cfg file

◆ filterJobByUser()

void filterJobByUser ( maps pmsConf,
char **  pcaClauseFinal,
char *  pcaClauseDate 
)

◆ getDefinitionFromSchemas()

int getDefinitionFromSchemas ( maps pmsConf,
const char *  pccName,
json_object *  pjoInput 
)

Get the data format definition from the schemas section, return 1 if found.

Parameters
pmsConfthe main configuration maps pointer
pccNamethe name of the data format to search for
Returns
1 if found, 0 otherwise

◆ getResultPath()

char* getResultPath ( maps pmsConf,
char *  jobId 
)

Get the result path.

Parameters
pmsConfthe conf maps containing the main.cfg settings
jobIdthe job identifier
Returns
the full path to the result file

◆ isFilteredDMM()

bool isFilteredDMM ( maps pmsConf,
const char *  pccPid 
)

Verify if the process identified by pccPid is part of the processID filters, if any.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pccPidthe const char pointer to the processID
Returns
true in case the filter is empty or in case the processId pccPid is one of the filtered processID, false in other case.

◆ isFilteredPid()

bool isFilteredPid ( maps pmsConf,
const char *  pccPid 
)

Verify if the process identified by pccPid is part of the processID filters, if any.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pccPidthe const char pointer to the processID
Returns
true in case the filter is empty or in case the processId pccPid is one of the filtered processID, false in other case.

◆ json_getStatusAttributes()

void json_getStatusAttributes ( maps pmsConf,
map pmSessId,
json_object *  pjoRes,
int  iStatus 
)

Fetch the statusFields attributes.

Parameters
pmsConfthe conf maps containing the main.cfg settings
pmSessIdthe map pointer to the session id
pjoResthe object to store metadata informations
iStatusinteger of the current execution status
See also
statusFields,

◆ json_getStatusFile()

int json_getStatusFile ( maps pmsConf)

Create the status file.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
Returns
an integer (0 in case of success, 1 in case of failure)

◆ json_getStatusFilePath()

char* json_getStatusFilePath ( maps pmsConf)

Get the status file path.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
Returns
a char* containing the full status file path

◆ json_readFile()

json_object* json_readFile ( maps pmsConf,
char *  filePath 
)

Read a json file.

Parameters
pmsConfthe conf maps containing the main.cfg settings @praam filePath the file path to read
Returns
a pointer to the created json_object

◆ jsonIsFalse()

bool jsonIsFalse ( json_bool  value)

Trivial verification, check if a json_bool is equal to FALSE.

Parameters
jbValuejson_bool value to verify if null
Returns
bool result of the test (jbValue==FALSE)

◆ jsonToMap()

map* jsonToMap ( json_object *  pjoObj)

Convert a json object to map.

Parameters
pjoObjthe json object to convert
Returns
the allocated map

◆ jsonToMaps()

maps* jsonToMaps ( json_object *  pjoObj)

Convert a json object to maps.

Parameters
pjoObjthe json object to convert
Returns
the allocated maps

◆ mapsToJson()

json_object* mapsToJson ( maps pmMap)

Convert a maps to a json object.

Parameters
pmMapthe maps to be converted into json object
Returns
a json_object pointer to the created json_object

◆ mapToJson()

json_object* mapToJson ( map pmMap)

Convert a map to a json object.

Parameters
pmMapthe map to be converted into json object
Returns
a json_object pointer to the created json_object

◆ outputSingleJsonComplexRes()

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.

Parameters
confmaps pointer to the main configuration maps
resumaps pointer to the output
pjoRes1json_object pointer to which the value field should be added
pjoRes3json_object pointer to the format object associated with pjoRes1
pcValuechar pointer to the value to be allocated
lLenlength of pcValue

◆ parseJBoundingBox()

void parseJBoundingBox ( maps pmsConf,
json_object *  pjoInput,
elements element,
maps output 
)

Parse BoundingBox value.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoInputjson_object pointing to the input/output
elementthe metadata
outputthe maps to set current json structure

◆ parseJComplex()

void parseJComplex ( maps pmsConf,
json_object *  req,
elements element,
maps output,
const char *  pccName 
)

Parse ComplexData value.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
reqjson_object pointing to the input/output
elementthe metadata
outputthe maps to set current json structure
pccNamethe name of the request from http_requests

◆ parseJIO()

void parseJIO ( maps pmsConf,
json_object *  pjoInput,
elements ioElements,
maps **  ioMaps,
const char *  ioType 
)

Parse all the inputs / outputs entities.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoInputjson_object pointing to the input/output
ioElementsthe elements extracted from the zcfg
ioMapsthe produced maps containing inputs (or outputs)
ioTypethe char* set to inputs or outputs

◆ parseJIOSingle()

void parseJIOSingle ( maps pmsConf,
elements ioElements,
maps **  ioMaps,
const char *  ioType,
const char *  pccKey,
json_object *  val 
)

Parse a single input / output entity that can be an array.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
ioElementsthe elements extracted from the zcfg
ioMapsthe produced maps containing inputs (or outputs)
ioTypethe char* set to inputs or outputs
pccKeychar* the input/output name
valjson_object pointing to the input/output

◆ parseJLiteral()

void parseJLiteral ( maps pmsConf,
json_object *  req,
elements element,
maps output 
)

Parse LiteralData value.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
reqjson_object pointing to the input/output
element
outputthe maps to set current json structure

◆ parseJRequest()

void parseJRequest ( maps pmsConf,
service s,
json_object *  pjoRequestBody,
map pmRequestInputs,
maps **  inputs,
maps **  outputs 
)

Parse Json Request.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
sthe current service metadata
pjoRequestBodythe JSON object of the request body
pmRequestInputsthe produced maps
inputsthe produced maps
outputsthe produced maps

◆ parseJson()

json_object* parseJson ( maps pmsConf,
char *  myString 
)

Parse a json string.

Parameters
pmsConfthe conf maps containing the main.cfg settings
myStringthe string containing the json content
Returns
a pointer to the created json_object

◆ parseNestedProcess()

void parseNestedProcess ( maps pmsConf,
json_object *  req,
elements element,
maps output,
const char *  pccName 
)

Parse a nested process json object.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
reqjson_object pointing to the input/output
elementthe metadata for this input
outputthe maps to set current json structure
pccNamethe name of the request from http_requests

◆ printAllowedRangesJ()

void printAllowedRangesJ ( maps pmsConf,
iotype piotType,
json_object *  pjoProp 
)

Add Allowed Range properties to a json_object.

Parameters
pmsConfthe main configuration maps pointer
piotTypethe iotype pointer
pjoPropthe json_object pointer to add the allowed range properties
Returns
a json_object pointer to the created json_object

◆ printBoundingBoxJ()

void printBoundingBoxJ ( maps pmsConf,
elements peInput,
json_object *  pjoInput 
)

Add basic schema definition for the BoundingBox type.

Parameters
pmsConfthe main configuration maps pointer
peInputthe elements pointing to an input/output
pjoInputthe json_object pointer used to store the schema definition

◆ printComplexHref()

void printComplexHref ( maps pmsConf,
elements peElement,
json_object *  pjoRes,
bool  isDefault,
map pmMaxSize 
)

Add support in the extended-schema for links object.

Parameters
pmsConfthe main configuration maps pointer
peElementthe elements pointer
pjoResthe json_object pointer on the array
isDefaultboolean, try if it is the default value
pmMaxSizemap pointer (not used)

◆ printExceptionReportResponseJ()

void printExceptionReportResponseJ ( maps **  pmsConf,
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.

See also
createExceptionJ
Parameters
pmsConfthe 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)

◆ printFilteredJobList()

json_object* printFilteredJobList ( maps **  ppmsConf,
map pmRequestInputs 
)

Print the filtered jobs list.

Parameters
ppmsConfthe maps containing the settings of the main.cfg file
Returns
the JSON object pointer to the jobs list
See also
printJobList

◆ printFormatJ()

void printFormatJ ( maps m,
iotype piotType,
json_object *  pjoRes,
bool  isDefault,
map pmMaxSize 
)

Add format properties to a json_object.

Parameters
mthe main configuration maps pointer
piotTypethe current iotype pointer
pjoResthe json_object pointer to add the properties to
isDefaultboolean specifying if the currrent iotype is default
pmMaxSizea map pointer to the maximumMegabytes param defined in the zcfg file for this input/output

◆ printFormatJ1()

void printFormatJ1 ( maps m,
iotype piotType,
json_object *  pjoRes,
bool  isDefault,
map pmMaxSize 
)

Add schema property to a json_object (ComplexData)

Parameters
mthe main configuration maps pointer
piotTypethe current iotype pointer
pjoResthe json_object pointer to add the properties to
isDefaultboolean specifying if the currrent iotype is default
pmMaxSizea map pointer to the maximumMegabytes param defined in the zcfg file for this input/output

◆ printGetCapabilitiesForProcessJ()

void printGetCapabilitiesForProcessJ ( registry reg,
maps pmsConf,
void *  doc0,
void *  nc0,
service serv 
)

Add all the capabilities properties to a json_object.

Parameters
regthe registry pointer
pmsConfthe 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

◆ printIOTypeJ()

void printIOTypeJ ( maps pmsConf,
const char *  pccIo,
elements peInput,
json_object *  pjoInputs,
service psServ 
)

Add metadata properties to a json_object.

Parameters
pmsConfthe main configuration maps pointer
pccIoa string "input" or "output"
peInputan elements pointer to the current input/output
pjoInputsthe json_object pointer to add the property to
psServthe service pointer to extract the metadata from

◆ printJAdditionalParameters()

void printJAdditionalParameters ( maps pmsConf,
map meta,
json_object *  doc 
)

Add additionalParameters property to a json_object.

Parameters
pmsConfthe main configuration maps pointer
metaa map pointer to the current metadata informations
docthe json_object pointer to add the property to

◆ printJMetadata()

void printJMetadata ( maps pmsConf,
map meta,
json_object *  doc 
)

Add metadata property to a json_object.

Parameters
pmsConfthe main configuration maps pointer
metaa map pointer to the current metadata informations
docthe json_object pointer to add the property to

◆ printJobList()

json_object* printJobList ( maps **  ppmsConf)

Print the jobs list.

Parameters
ppmsConfthe maps containing the settings of the main.cfg file
Returns
the JSON object pointer to the jobs list

◆ printJobStatus()

json_object* printJobStatus ( maps **  ppmsConf,
char *  pcJobId 
)

Print the jobs status info cf.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pcJobIdthe char pointer to the jobid
Returns
the JSON object pointer to the statusInfo

◆ printJResult()

json_object* printJResult ( maps **  ppmsConf,
service s,
maps result,
int  iRes 
)

Print the result of an execution.

Parameters
ppmsConfthe maps containing the settings of the main.cfg file
sservice pointer to metadata
resultoutputs of the service
iResthe status of execution SERVICE_FAILED/SERVICE_SUCCEEDED
Returns
the JSON object pointer to the result

◆ printLiteralDataJ()

void printLiteralDataJ ( maps pmsConf,
elements peInput,
json_object *  pjoInput 
)

Add literalDataDomains property to a json_object.

Parameters
pmsConfthe main configuration maps pointer
peInputthe elements pointer
pjoInputthe json_object pointer to add the literalDataDomains property
Returns
a json_object pointer to the created json_object

◆ printLiteralValueJ()

void printLiteralValueJ ( maps pmConf,
map pmType,
map pmContent,
json_object *  pjoSchema,
const char *  pccFieldName 
)

Add literal property depending on the dataType.

Parameters
pmConfthe main configuration maps pointer
pmTypethe dataType map pointer
pmContentthe iotype content map pointer
pjoSchemathe json_object pointer to add the value
pccFieldNamethe field name string

◆ produceApi()

void produceApi ( maps pmsConf,
json_object *  pjoRes 
)

Produce the JSON object for /api.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoResthe JSON object to populate

◆ produceApiComponents()

void produceApiComponents ( maps pmsConf,
json_object *  pjoRes 
)

◆ produceApiInfo()

void produceApiInfo ( maps pmsConf,
json_object *  pjoRes,
json_object *  pjoRes5 
)

Produce the JSON object for api info object.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoResthe JSON object for the api info

◆ produceApiParameters()

void produceApiParameters ( maps pmsConf,
json_object *  pjoRes 
)

Produce the JSON object for api parameter.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoResthe JSON object to populate with the parameters

◆ produceApiSchemas()

void produceApiSchemas ( maps pmsConf,
json_object *  pjoRes 
)

Produce the JSON object for api schemas.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoResthe JSON object to populate with the parameters

◆ produceApiSecuritySchemes()

void produceApiSecuritySchemes ( maps pmsConf,
json_object *  pjoRes 
)

Produce the JSON object for api securitySchemes.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoResthe JSON object to populate with the parameters

◆ produceConformances()

void produceConformances ( maps pmsConf,
json_object *  pjoRes 
)

Produce the JSON response for /conformance.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoResthe JSON object to populate

◆ produceOperationId()

void produceOperationId ( maps pmsConf,
maps pmsContent,
int  iIndex,
json_object *  pjoRes 
)

Generate an unique operationId attribute for a given endpoints.

Parameters
pmsConfmaps pointing to the main confif maps
pmsContentthe maps containing endpoint's metadata information
iIndexthe index for map array, 0 otherwise
pjoResthe json object to store the operationId attribute

◆ produceRoot()

void produceRoot ( maps pmsConf,
json_object *  pjoRes 
)

Produce the JSON response for /.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
pjoResthe JSON object to populate

◆ returnBadRequestException()

void returnBadRequestException ( maps pmsConf,
elements peInput 
)

Return an exception response with Status: "400 Bad Request" if inputs are not in the proper format.

Parameters
pmsConfthe maps containing the settings of the main.cfg file
peInputthe input causing the issue

◆ serviceIsFilter()

bool serviceIsFilter ( maps pmsConf,
char *  pcService 
)

Verify that a service name correspond to the Deploy or Undeploy service name.

Parameters
pmsConfthe main configuration maps pointer
pcServicethe service name
Returns
true if the process name corresponds to a filter_in or filter_out; false otherwise

◆ serviceIsFiltered()

bool serviceIsFiltered ( maps pmsConf,
char *  pcService,
maps pmsFilter 
)

Verify that a service name correspond to the a given process name.

Parameters
pmsConfthe main configuration maps pointer
pcServicethe service name to verify
pmsFilterthe maps pointer containing the process name
Returns
true if the process name corresponds to tje pmsFilter

◆ serviceToJson()

json_object* serviceToJson ( service psService)

Convert an service to a json object.

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