Ignore:
Timestamp:
Aug 7, 2012, 12:28:05 PM (7 years ago)
Author:
djay
Message:

Fix multiple values for the same identifier.

Location:
trunk/zoo-project/zoo-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service.h

    r361 r362  
    645645
    646646  static int addMapsArrayToMaps(maps** mo,maps* mi,char* typ){
    647     maps* tmp=mi;
    648     maps* _cursor=*mo;
    649     maps* tmpMaps=getMaps(_cursor,tmp->name);
    650 
    651     if(tmpMaps==NULL)
     647    maps* tmp=mi;   
     648    maps* _cursor=getMaps(*mo,tmp->name);
     649
     650    if(_cursor==NULL)
    652651      return -1;
    653652
    654     map* tmpLength=getMap(tmpMaps->content,"length");
     653    map* tmpLength=getMap(_cursor->content,"length");
    655654    char tmpLen[10];
    656655    int len=1;
  • trunk/zoo-project/zoo-kernel/service_internal_ms.c

    r361 r362  
    175175      OSRImportFromWkt( hSRS, &pszProjection ) == CE_None ){
    176176    char *proj4Str=NULL;
    177     if(OSRGetAuthorityName(hSRS,NULL)!=NULL && OSRGetAuthorityCode(hSRS,NULL)!=NULL){
     177    if(OSRGetAuthorityName(hSRS,NULL)!=NULL &&
     178       OSRGetAuthorityCode(hSRS,NULL)!=NULL){
    178179      char tmpSrs[20];
    179180      sprintf(tmpSrs,"%s:%s",
     
    236237    }
    237238    if(msSrs!=NULL){
    238       if(output!=NULL){
    239         addToMap(output->content,"crs",msSrs->value);
    240         addToMap(output->content,"crs_isGeographic","true");
    241       }
    242239      msLoadProjectionStringEPSG(&m->projection,msSrs->value);
    243240      msLoadProjectionStringEPSG(&myLayer->projection,msSrs->value);
     
    247244      msInsertHashTable(&(myLayer->metadata),"ows_srs",tmpSrs);
    248245    }else{
    249       if(output!=NULL){
    250         addToMap(output->content,"crs","EPSG:4326");
    251         addToMap(output->content,"crs_isGeographic","true");
    252       }
    253246      msLoadProjectionStringEPSG(&m->projection,"EPSG:4326");
    254247      msLoadProjectionStringEPSG(&myLayer->projection,"EPSG:4326");
    255248      msInsertHashTable(&(m->web.metadata),"ows_srs","EPSG:4326 EPSG:900913");
    256249      msInsertHashTable(&(myLayer->metadata),"ows_srs","EPSG:4326 EPSG:900913");
     250    }
     251    if(output!=NULL){
     252      addToMap(output->content,"crs",msSrs->value);
     253      addToMap(output->content,"crs_isGeographic","true");
    257254    }
    258255  }
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r360 r362  
    9999 */
    100100int appendMapsToMaps(maps* m,maps* mo,maps* mi,elements* elem){
    101 
    102   map* tmap=getMapType(mo->content);
     101  maps* tmpMaps=getMaps(mo,mi->name);
     102  map* tmap=getMapType(tmpMaps->content);
     103  elements* el=getElements(elem,mi->name);
     104  int hasEl=1;
     105  if(el==NULL)
     106    hasEl=-1;
    103107  if(tmap==NULL){
    104     tmap=getMapType(elem->defaults->content);
    105   }
    106 
    107   map* testMap=getMap(elem->content,"maxOccurs");
     108    if(hasEl>0)
     109      tmap=getMapType(el->defaults->content);     
     110  }
     111
     112  map* testMap=NULL;
     113  if(hasEl>0){
     114    testMap=getMap(el->content,"maxOccurs");
     115  }else{
     116    testMap=createMap("maxOccurs","unbounded");
     117  }
     118
    108119  if(testMap!=NULL){
    109120    if(strncasecmp(testMap->value,"unbounded",9)!=0 && atoi(testMap->value)>1){
     
    116127    }else{
    117128      if(strncasecmp(testMap->value,"unbounded",9)==0){
     129        if(hasEl<0){
     130          freeMap(&testMap);
     131          free(testMap);
     132        }
    118133        if(addMapsArrayToMaps(&mo,mi,tmap->name)<0){
    119134          char emsg[1024];
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