Ignore:
Timestamp:
Jun 7, 2012, 10:54:31 PM (12 years ago)
Author:
djay
Message:

Add support for multiple inputs values for the same identifier.

File:
1 edited

Legend:

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

    r351 r360  
    22 * Author : Gérald FENOY
    33 *
    4  * Copyright (c) 2009-2011 GeoLabs SARL
     4 * Copyright (c) 2009-2012 GeoLabs SARL
    55 *
    66 * Permission is hereby granted, free of charge, to any person obtaining a copy
     
    21882188        map* tmpContent=tmpIoType->content;
    21892189        map* cval=NULL;
    2190 
     2190        int hasPassed=-1;
    21912191        while(tmpContent!=NULL){
    21922192          if((cval=getMap(tmpMaps->content,tmpContent->name))==NULL){
     
    21982198            else
    21992199              addToMap(tmpMaps->content,tmpContent->name,tmpContent->value);
     2200           
     2201            if(hasPassed<0 && type==0 && getMap(tmpMaps->content,"isArray")!=NULL){
     2202              map* length=getMap(tmpMaps->content,"length");
     2203              int i;
     2204              char *tcn=strdup(tmpContent->name);
     2205              for(i=1;i<atoi(length->value);i++){
     2206                dumpMap(tmpMaps->content);
     2207                fprintf(stderr,"addDefaultValues %s_%d => %s\n",tcn,i,tmpContent->value);
     2208                int len=strlen(tcn);
     2209                char *tmp1=malloc((len+10)*sizeof(char));
     2210                sprintf(tmp1,"%s_%d",tcn,i);
     2211                fprintf(stderr,"addDefaultValues %s => %s\n",tmp1,tmpContent->value);
     2212                addToMap(tmpMaps->content,tmp1,tmpContent->value);
     2213                free(tmp1);
     2214                hasPassed=1;
     2215              }
     2216              free(tcn);
     2217            }
    22002218          }
    22012219          tmpContent=tmpContent->next;
     
    24842502    return errorException(m, _("Unable to download the file."), "InternalError");
    24852503  }
     2504
    24862505  map* tmpMap=getMapOrFill(content,"value","");
     2506   
    24872507  free(tmpMap->value);
    24882508  tmpMap->value=(char*)malloc((fsize+1)*sizeof(char));
    2489   memcpy(tmpMap->value,fcontent,(fsize)*sizeof(char));
     2509  memcpy(tmpMap->value,fcontent,(fsize)*sizeof(char));
     2510
    24902511  char ltmp1[256];
    24912512  sprintf(ltmp1,"%d",fsize);
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