Changeset 960 for trunk/zoo-project/zoo-services/ogr/ogr2ogr
- Timestamp:
- Aug 14, 2020, 1:38:08 PM (4 years ago)
- 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 48 48 </Supported> 49 49 </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> 50 68 </DataInputs> 51 69 <DataOutputs> -
trunk/zoo-project/zoo-services/ogr/ogr2ogr/service.c
r917 r960 171 171 172 172 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"); 180 197 if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){ 181 198 papszLCO = CSLAddString(papszLCO, tmpMap->value ); 199 } 182 200 } 183 201 … … 368 386 369 387 tmpMap=NULL; 388 tmpMap=getMapFromMaps(inputs,"InputDS","cache_file"); 389 if(tmpMap!=NULL){ 390 pszDataSource=strdup(tmpMap->value); 391 }else{ 370 392 tmpMap=getMapFromMaps(inputs,"InputDSN","value"); 371 393 if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){ … … 384 406 sprintf((char*)pszDataSource,"%s",tmpMap->value); 385 407 } 408 } 386 409 } 387 410 … … 844 867 setMapInMaps(conf,"lenv","message","There was an error when running yoru SQL query."); 845 868 if(pszDialect!=NULL) 846 free( pszDialect);869 free((void*)pszDialect); 847 870 return SERVICE_FAILED; 848 871 } 849 872 } 850 873 if(pszDialect!=NULL) 851 free( pszDialect);874 free((void*)pszDialect); 852 875 853 876 /* -------------------------------------------------------------------- */ … … 908 931 909 932 #ifdef ZOO_SERVICE 933 tmpMap=getMapFromMaps(inputs,"InputDS","cache_file"); 934 if(tmpMap==NULL) 910 935 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 911 952 //outputs->content=createMap("value",(char*)pszwebDestData); 912 953 #endif
Note: See TracChangeset
for help on using the changeset viewer.