Ignore:
Timestamp:
Dec 18, 2020, 2:13:22 PM (3 years ago)
Author:
djay
Message:

Add support for the two inputs / outputs syntaxes discussed in SWG in both the ZOO-Kernel and the HTML basic UI. Update documentation, add a section for the ZOO-API in Python language section. Rename variables in service.c to ease readabiliy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r966 r967  
    419419 
    420420  map* errormap = createMap("text", tmp01);
    421   map* tmpMap=getMapFromMaps(m,"lenv","executionType");
     421  map* tmpMap=getMapFromMaps(m,"main","executionType");
    422422  char* errorCode=(char*)code;
    423423  if(tmpMap!=NULL && strncasecmp(tmpMap->value,"json",4)==0)
     
    18881888  maps *request_input_real_format = NULL;
    18891889
    1890   setMapInMaps(m,"lenv","executionType","xml");
     1890  setMapInMaps(m,"main","executionType","xml");
    18911891  if((strlen(cgiQueryString)>0 && cgiQueryString[0]=='/') /*&& strstr(cgiAccept,"json")!=NULL*/){
    18921892    //
    1893     // OGC API - Processing starts here
     1893    // OGC API - Processes starts here
    18941894    //
    18951895#ifndef USE_JSON
    1896     errorException (m, _("OGC API - Processing is not supported by this ZOO-Kernel."), "InternalError", NULL);
     1896    errorException (m, _("OGC API - Processes is not supported by this ZOO-Kernel, please contact the service provider."), "InternalError", NULL);
    18971897    return 1;
    18981898#else
     
    19081908    signal (SIGABRT, json_sig_handler);
    19091909#endif
     1910    setMapInMaps(m,"main","executionType","json");
    19101911    r_inputs = getMapOrFill (&request_inputs, "metapath", "");
    19111912    char conf_file1[10240];
     
    19201921      }
    19211922    addMapsToMaps(&m,m1);
    1922     setMapInMaps(m,"lenv","executionType","json");
    19231923    map* pmTmp0=getMapFromMaps(m,"openapi","full_html_support");
    1924     dumpMap(pmTmp0);
    19251924    if(strstr(cgiQueryString,".html")==NULL && strstr(cgiAccept,"text/html")!=NULL && pmTmp0!=NULL && strncasecmp(pmTmp0->value,"true",4)==0){
    19261925      map* pmTmpUrl=getMapFromMaps(m,"openapi","rootUrl");
     
    23052304                }else{
    23062305                  char* jobId=zStrdup(strstr(cgiQueryString,"/jobs/")+6);
    2307                   runGetStatus(m,jobId,"GetStatus");
    2308                   map* pmError=getMapFromMaps(m,"lenv","error");
    2309                   if(pmError!=NULL && strncasecmp(pmError->value,"true",4)==0){
    2310                     printExceptionReportResponseJ(m,getMapFromMaps(m,"lenv","code"));
    2311                     return 1;
    2312                   }else{
    2313                     map* pmStatus=getMapFromMaps(m,"lenv","status");
    2314                     setMapInMaps(m,"lenv","gs_location","false");
    2315                     setMapInMaps(m,"lenv","gs_usid",jobId);
    2316                     if(pmStatus!=NULL && strncasecmp(pmStatus->value,"Failed",6)==0)
    2317                       res=createStatus(m,SERVICE_FAILED);
    2318                     else
    2319                       if(pmStatus!=NULL  && strncasecmp(pmStatus->value,"Succeeded",9)==0)
    2320                         res=createStatus(m,SERVICE_SUCCEEDED);
    2321                       else
    2322                         if(pmStatus!=NULL  && strncasecmp(pmStatus->value,"Running",7)==0){
    2323                           map* tmpMap=getMapFromMaps(m,"lenv","Message");
    2324                           if(tmpMap!=NULL)
    2325                             setMapInMaps(m,"lenv","gs_message",tmpMap->value);
    2326                           res=createStatus(m,SERVICE_STARTED);
    2327                         }
    2328                         else
    2329                           res=createStatus(m,SERVICE_FAILED);
    2330                   }
     2306                  res=printJobStatus(m,jobId);
    23312307                  free(jobId);
    23322308                }
     
    25302506                    map* testMap=getMapFromMaps(m,"main","memory");
    25312507                    loadHttpRequests(m,request_input_real_format);
    2532                     dumpMaps(request_input_real_format);
     2508
     2509                    if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,NULL)<0)
     2510                      return -1;
    25332511                    loadServiceAndRun (&m, s1, request_inputs,
    25342512                                       &request_input_real_format,
     
    25482526              }else{
    25492527                loadHttpRequests(m,request_input_real_format);
     2528                if(validateRequest(&m,s1,request_inputs, &request_input_real_format,&request_output_real_format,NULL)<0)
     2529                  return -1;
    25502530                loadServiceAndRun (&m,s1,request_inputs,
    25512531                                   &request_input_real_format,
     
    25602540        }
    25612541    }
    2562     if(res!=NULL){
     2542    map* pmHasPrinted=getMapFromMaps(m,"lenv","hasPrinted");
     2543    if(res!=NULL && (pmHasPrinted==NULL || strncasecmp(pmHasPrinted->value,"false",5)==0)){
    25632544      if(getMapFromMaps(m,"lenv","no-headers")==NULL){
    25642545        printHeaders(m);
     
    25732554#endif
    25742555  }else{
    2575 
    25762556    //
    25772557    // WPS 1.0.0 and 2.0.0 starts here
    25782558    //
     2559    setMapInMaps(m,"main","executionType","xml");
    25792560    //Check for minimum inputs
    25802561    map* version=getMap(request_inputs,"version");
     
    34353416  signal (SIGABRT, donothing);
    34363417#endif
     3418    fprintf(stderr,"%s %d \n",__FILE__,__LINE__);
     3419    fflush(stderr);
    34373420
    34383421  if (((int) zGetpid ()) != cpid || cgiSid != NULL)
    34393422    {
     3423    fprintf(stderr,"%s %d \n",__FILE__,__LINE__);
     3424    fflush(stderr);
    34403425      if (eres == SERVICE_SUCCEEDED)
    34413426#ifdef USE_CALLBACK
     
    34953480      if(cgiSid!=NULL)
    34963481        free(cgiSid);
    3497       map* tMap=getMapFromMaps(m,"lenv","executionType");
     3482      map* tMap=getMapFromMaps(m,"main","executionType");
    34983483      if(tMap!=NULL && strncasecmp(tMap->value,"xml",3)==0)
    34993484        InternetCloseHandle (&hInternet);
     
    35243509  free (REQUEST);
    35253510  free (SERVICE_URL);
     3511
    35263512#ifdef DEBUG
    35273513  fprintf (stderr, "Processed response \n");
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png