Changeset 485 for trunk


Ignore:
Timestamp:
Jun 3, 2014, 4:58:44 PM (10 years ago)
Author:
djay
Message:

Add support of maximumMegabytes keyword for size limitation of ComplexData? inputs

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/services/zcfg-reference.txt

    r469 r485  
    5757
    5858-  a name (between brackets as for the name of the service before)
    59 - various medata properties (``Title``, ``Abstract``, ``minOccurs`` and ``maxOccurs``)
     59- various medata properties (``Title``, ``Abstract``, ``minOccurs``, ``maxOccurs`` and, in case of ComplexData, the optional ``maximumMegabytes``)
    6060- a Type Of Data node (:ref:`description <typeDataNodes>`)
    6161
  • trunk/testing/run.sh

    r484 r485  
    193193done
    194194
    195 kvpRequest "${WPSInstance}?request=DescribeProcess&service=WPS&Identifier=${ServiceName}" "tmp/outputDPb10.xml" "DescribeProcess"
    196 
    197 echo ""
    198195
    199196cat requests/dp.xml | sed "s:ServiceName:${ServiceName}:g" > tmp/dp1.xml
  • trunk/zoo-project/HISTORY.txt

    r465 r485  
    11Version 1.4.0-dev
     2  * Add support of maximumMegabytes keywords for ComplexData Inputs
    23  * Add the optional YAML ZCFG support #4 and the zcfg2yaml converter
    34  * Return error messages that enable the service provider to quickly identify the root cause of errors due to configuration file syntax (ticket #90)
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r483 r485  
    967967      }else
    968968        xmlNewProp(nc2,BAD_CAST "maxOccurs",BAD_CAST "1");
     969      if((tmp1=getMap(e->content,"maximumMegabytes"))!=NULL){
     970        xmlNewProp(nc2,BAD_CAST "maximumMegabytes",BAD_CAST tmp1->value);
     971      }
    969972    }
    970973
     
    25082511          else
    25092512            addToMap(tmpMaps2->content,"maxOccurs",tmpMaxO->value);
     2513        map* tmpMaxMB=getMap(tmpInputs->content,"maximumMegabytes");
     2514        if(tmpMaxMB!=NULL)
     2515          if(tmpMaps2->content==NULL)
     2516            tmpMaps2->content=createMap("maximumMegabytes",tmpMaxMB->value);
     2517          else
     2518            addToMap(tmpMaps2->content,"maximumMegabytes",tmpMaxMB->value);
    25102519      }
    25112520
     
    25582567        if(tmpMaxO!=NULL){
    25592568          if(tmpMaps->content==NULL)
    2560             tmpMaps->content=createMap("maxOccurs",tmpMap1->value);
     2569            tmpMaps->content=createMap("maxOccurs",tmpMaxO->value);
    25612570          else
    2562             addToMap(tmpMaps->content,"maxOccurs",tmpMap1->value);
    2563         }
     2571            addToMap(tmpMaps->content,"maxOccurs",tmpMaxO->value);
     2572        }
     2573        map* tmpMaxMB=getMap(tmpInputs->content,"maximumMegabytes");
     2574        if(tmpMaxMB!=NULL)
     2575          if(tmpMaps->content==NULL)
     2576            tmpMaps->content=createMap("maximumMegabytes",tmpMaxMB->value);
     2577          else
     2578            addToMap(tmpMaps->content,"maximumMegabytes",tmpMaxMB->value);
    25642579        /**
    25652580         * Parsing BoundingBoxData, fill the following map and then add it to
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r483 r485  
    21592159   */
    21602160  char *dfv=addDefaultValues(&request_input_real_format,s1->inputs,m,0);
     2161  maps *ptr=request_input_real_format;
     2162  while(ptr!=NULL){
     2163    dumpMap(ptr->content);
     2164    map *tmp0=getMap(ptr->content,"size");
     2165    map *tmp1=getMap(ptr->content,"maximumMegabytes");
     2166    if(tmp1!=NULL && tmp0!=NULL){
     2167      float i=atof(tmp0->value)/1048576.0;
     2168      if(i>=atoi(tmp1->value)){
     2169        char tmps[1024];
     2170        map* tmpe=createMap("code","FileSizeExceeded");
     2171        snprintf(tmps,1024,_("The <%s> parameter has a limited size (%sMB) defined in ZOO ServicesProvider configuration file but the reference you provided exceed this limitation (%dMB), please correct your query or the ZOO Configuration file."),ptr->name,tmp1->value,i);
     2172        addToMap(tmpe,"locator",ptr->name);
     2173        addToMap(tmpe,"text",tmps);
     2174        printExceptionReportResponse(m,tmpe);
     2175        freeService(&s1);
     2176        free(s1);
     2177        freeMap(&tmpe);
     2178        free(tmpe);
     2179        freeMaps(&m);
     2180        free(m);
     2181        free(REQUEST);
     2182        free(SERVICE_URL);
     2183        freeMaps(&request_input_real_format);
     2184        free(request_input_real_format);
     2185        freeMaps(&request_output_real_format);
     2186        free(request_output_real_format);
     2187        freeMaps(&tmpmaps);
     2188        free(tmpmaps);
     2189        return 1;
     2190      }
     2191    }
     2192    ptr=ptr->next;
     2193  }
     2194
    21612195  char *dfv1=addDefaultValues(&request_output_real_format,s1->outputs,m,1);
    21622196  if(strcmp(dfv1,"")!=0 || strcmp(dfv,"")!=0){
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