Ignore:
Timestamp:
Aug 14, 2020, 1:38:08 PM (4 years ago)
Author:
djay
Message:

Add LCO and DSCO multiple occurence in Ogr2Ogr service. Update ZOO-Kernel messages.po file.

Location:
trunk/zoo-project/zoo-services/ogr/ogr2ogr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-services/ogr/ogr2ogr/cgi-env/Ogr2Ogr.zcfg

    r536 r960  
    4848    </Supported>
    4949   </LiteralData>
     50  [LCO]
     51   Title = Format of the output data
     52   Abstract = Select the output format.
     53   minOccurs = 0
     54   maxOccurs = 1024
     55   <LiteralData>
     56    DataType = string
     57    <Default />
     58   </LiteralData>
     59  [DSCO]
     60   Title = Format of the output data
     61   Abstract = Select the output format.
     62   minOccurs = 0
     63   maxOccurs = 1024
     64   <LiteralData>
     65    DataType = string
     66    <Default />
     67   </LiteralData>
    5068 </DataInputs>
    5169 <DataOutputs>
  • trunk/zoo-project/zoo-services/ogr/ogr2ogr/service.c

    r917 r960  
    171171
    172172    tmpMap=NULL;
    173     tmpMap=getMapFromMaps(inputs,"DSCO","value");
    174     if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){
    175           papszDSCO = CSLAddString(papszDSCO, tmpMap->value );
    176     }
    177 
    178     tmpMap=NULL;
    179     tmpMap=getMapFromMaps(inputs,"LCO","value");
     173    int length=1;
     174    tmpMap=getMapFromMaps(inputs,"DSCO","length");
     175    if(tmpMap!=NULL){
     176            length=atoi(tmpMap->value);
     177    }
     178    maps* tmpMaps=getMaps(inputs,"DSCO");
     179    for(int i=0;i<length;i++){
     180        tmpMap=getMapArray(tmpMaps->content,"value",i);
     181        //tmpMap=getMapFromMaps(inputs,"DSCO","value");
     182        if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){
     183              papszDSCO = CSLAddString(papszDSCO, tmpMap->value );
     184        }
     185    }
     186
     187    tmpMap=NULL;
     188    length=1;
     189    tmpMap=getMapFromMaps(inputs,"LCO","length");
     190    if(tmpMap!=NULL){
     191            length=atoi(tmpMap->value);
     192    }
     193    tmpMaps=getMaps(inputs,"LCO");
     194    for(int i=0;i<length;i++){
     195        tmpMap=getMapArray(tmpMaps->content,"value",i);
     196    //tmpMap=getMapFromMaps(inputs,"LCO","value");
    180197    if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){
    181198          papszLCO = CSLAddString(papszLCO, tmpMap->value );
     199    }
    182200    }
    183201
     
    368386   
    369387    tmpMap=NULL;
     388    tmpMap=getMapFromMaps(inputs,"InputDS","cache_file");
     389    if(tmpMap!=NULL){
     390            pszDataSource=strdup(tmpMap->value);
     391    }else{
    370392    tmpMap=getMapFromMaps(inputs,"InputDSN","value");
    371393    if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){
     
    384406        sprintf((char*)pszDataSource,"%s",tmpMap->value);       
    385407      }
     408    }
    386409    }
    387410
     
    844867          setMapInMaps(conf,"lenv","message","There was an error when running yoru SQL query.");
    845868          if(pszDialect!=NULL)
    846             free(pszDialect);
     869            free((void*)pszDialect);
    847870          return SERVICE_FAILED;
    848871        }
    849872    }
    850873    if(pszDialect!=NULL)
    851       free(pszDialect);
     874      free((void*)pszDialect);
    852875
    853876/* -------------------------------------------------------------------- */
     
    908931
    909932#ifdef ZOO_SERVICE
     933    tmpMap=getMapFromMaps(inputs,"InputDS","cache_file");
     934    if(tmpMap==NULL)
    910935    setMapInMaps(outputs,"OutputedDataSourceName","value",(char*)pszwebDestData);
     936    else{
     937         tmpMap=getMapFromMaps(inputs,"OutputDSN","value");
     938         if(tmpMap!=NULL){
     939                 map* tmpPath=getMapFromMaps(conf,"main","tmpPath");
     940           pszDestDataSource=(char*)malloc(sizeof(char)*(strlen(tmpMap->value)+1));
     941           sprintf((char*)pszDestDataSource,"%s",tmpMap->value/*,ext*/);
     942           pszwebDestData=(char*)malloc(sizeof(char)*(strlen(tmpPath->value)+strlen(tmpMap->value)+4));
     943           sprintf((char*)pszwebDestData,"%s/%s",tmpPath->value,tmpMap->value/*,ext*/);
     944           setMapInMaps(outputs,"OutputedDataSourceName","generated_file",(char*)pszwebDestData);
     945           setMapInMaps(outputs,"OutputedDataSourceName","mimeType","application/json");
     946           setMapInMaps(outputs,"OutputedDataSourceName","value","none");
     947        //setMapInMaps(outputs,"OutputedDataSourceName","storage",(char*)pszwebDestData);
     948         }
     949           
     950    }
     951   
    911952    //outputs->content=createMap("value",(char*)pszwebDestData);
    912953#endif
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