Index: trunk/zoo-project/zoo-services/ogr/ogr2ogr/cgi-env/Ogr2Ogr.zcfg
===================================================================
--- trunk/zoo-project/zoo-services/ogr/ogr2ogr/cgi-env/Ogr2Ogr.zcfg	(revision 917)
+++ trunk/zoo-project/zoo-services/ogr/ogr2ogr/cgi-env/Ogr2Ogr.zcfg	(revision 960)
@@ -48,4 +48,22 @@
     </Supported>
    </LiteralData>
+  [LCO]
+   Title = Format of the output data
+   Abstract = Select the output format.
+   minOccurs = 0
+   maxOccurs = 1024
+   <LiteralData>
+    DataType = string
+    <Default />
+   </LiteralData>
+  [DSCO]
+   Title = Format of the output data
+   Abstract = Select the output format.
+   minOccurs = 0
+   maxOccurs = 1024
+   <LiteralData>
+    DataType = string
+    <Default />
+   </LiteralData>
  </DataInputs>
  <DataOutputs>
Index: trunk/zoo-project/zoo-services/ogr/ogr2ogr/service.c
===================================================================
--- trunk/zoo-project/zoo-services/ogr/ogr2ogr/service.c	(revision 917)
+++ trunk/zoo-project/zoo-services/ogr/ogr2ogr/service.c	(revision 960)
@@ -171,13 +171,31 @@
 
     tmpMap=NULL;
-    tmpMap=getMapFromMaps(inputs,"DSCO","value");
-    if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){
-	  papszDSCO = CSLAddString(papszDSCO, tmpMap->value );
-    }
-
-    tmpMap=NULL;
-    tmpMap=getMapFromMaps(inputs,"LCO","value");
+    int length=1;
+    tmpMap=getMapFromMaps(inputs,"DSCO","length");
+    if(tmpMap!=NULL){
+	    length=atoi(tmpMap->value);
+    }
+    maps* tmpMaps=getMaps(inputs,"DSCO");
+    for(int i=0;i<length;i++){
+	tmpMap=getMapArray(tmpMaps->content,"value",i);
+    	//tmpMap=getMapFromMaps(inputs,"DSCO","value");
+    	if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){
+	      papszDSCO = CSLAddString(papszDSCO, tmpMap->value );
+    	}
+    }
+
+    tmpMap=NULL;
+    length=1;
+    tmpMap=getMapFromMaps(inputs,"LCO","length");
+    if(tmpMap!=NULL){
+	    length=atoi(tmpMap->value);
+    }
+    tmpMaps=getMaps(inputs,"LCO");
+    for(int i=0;i<length;i++){
+	tmpMap=getMapArray(tmpMaps->content,"value",i);
+    //tmpMap=getMapFromMaps(inputs,"LCO","value");
     if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){
 	  papszLCO = CSLAddString(papszLCO, tmpMap->value );
+    }
     }
 
@@ -368,4 +386,8 @@
    
     tmpMap=NULL;
+    tmpMap=getMapFromMaps(inputs,"InputDS","cache_file");
+    if(tmpMap!=NULL){
+	    pszDataSource=strdup(tmpMap->value);
+    }else{
     tmpMap=getMapFromMaps(inputs,"InputDSN","value");
     if(tmpMap!=NULL && strncasecmp(tmpMap->value,"NULL",4)!=0){
@@ -384,4 +406,5 @@
 	sprintf((char*)pszDataSource,"%s",tmpMap->value);	
       }
+    }
     }
 
@@ -844,10 +867,10 @@
 	  setMapInMaps(conf,"lenv","message","There was an error when running yoru SQL query.");
 	  if(pszDialect!=NULL)
-	    free(pszDialect);
+	    free((void*)pszDialect);
 	  return SERVICE_FAILED;
 	}
     }
     if(pszDialect!=NULL)
-      free(pszDialect);
+      free((void*)pszDialect);
 
 /* -------------------------------------------------------------------- */
@@ -908,5 +931,23 @@
 
 #ifdef ZOO_SERVICE
+    tmpMap=getMapFromMaps(inputs,"InputDS","cache_file");
+    if(tmpMap==NULL)
     setMapInMaps(outputs,"OutputedDataSourceName","value",(char*)pszwebDestData);
+    else{
+	 tmpMap=getMapFromMaps(inputs,"OutputDSN","value");
+	 if(tmpMap!=NULL){ 
+		 map* tmpPath=getMapFromMaps(conf,"main","tmpPath");
+	   pszDestDataSource=(char*)malloc(sizeof(char)*(strlen(tmpMap->value)+1));
+	   sprintf((char*)pszDestDataSource,"%s",tmpMap->value/*,ext*/);
+	   pszwebDestData=(char*)malloc(sizeof(char)*(strlen(tmpPath->value)+strlen(tmpMap->value)+4));
+	   sprintf((char*)pszwebDestData,"%s/%s",tmpPath->value,tmpMap->value/*,ext*/);
+	   setMapInMaps(outputs,"OutputedDataSourceName","generated_file",(char*)pszwebDestData);
+	   setMapInMaps(outputs,"OutputedDataSourceName","mimeType","application/json");
+	   setMapInMaps(outputs,"OutputedDataSourceName","value","none");
+	//setMapInMaps(outputs,"OutputedDataSourceName","storage",(char*)pszwebDestData);
+         }
+	    
+    }
+    
     //outputs->content=createMap("value",(char*)pszwebDestData);
 #endif
