- Timestamp:
- Jul 16, 2011, 12:58:47 PM (13 years ago)
- Location:
- tags/rel-1.2.0-rc2
- Files:
-
- 15 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
tags/rel-1.2.0-rc2
-
tags/rel-1.2.0-rc2/zoo-kernel/main.cfg
r5 r268 6 6 tmpPath=/YourFullTmpPathHere/ 7 7 tmpUrl = ../TmpPathRelativeToServerAdress/ 8 dataPath = /YouFullDataPathHere/ 8 9 9 10 [identification] … … 20 21 positionName=Developer 21 22 role=Dev 22 ad ressDeliveryPoint=1280, avenue des Platanes23 addressDeliveryPoint=1280, avenue des Platanes 23 24 addressCity=Lattes 24 25 addressAdministrativeArea=False -
tags/rel-1.2.0-rc2/zoo-kernel/main_conf_read.y
r217 r268 47 47 /* le type des lval des jetons et des elements non terminaux bison */ 48 48 //====================================================== 49 %union 50 { 51 char * s; 52 } 53 %union { char* chaine; char* key;char* val;} 49 %union { char* s;char* chaine; char* key;char* val;} 54 50 //====================================================== 55 51 -
tags/rel-1.2.0-rc2/zoo-kernel/nmake.opt
r217 r268 9 9 CPP=cl /TP $(CFLAGS) 10 10 11 CFLAGS=-DUSE_PYTHON /EHa /nologo /MT /W3 /EHsc /O2 /D_CRT_SECURE_NO_WARNINGS /DWIN32 $(CJFLAGS) -I./ -I..\thirds\dirent-win32 -I $(PYTHON_CPATH)\include -I$(GEODIR)/include -ILIBINTL_CPATH\include -I$(TPATH)\include -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF11 CFLAGS=-DUSE_PYTHON /EHa /nologo /MT /W3 /EHsc /O2 /D_CRT_SECURE_NO_WARNINGS /DWIN32 $(CJFLAGS) -I./ -I..\thirds\dirent-win32 -I..\thirds\include -I$(PYTHON_CPATH)\include -I$(GEODIR)/include -ILIBINTL_CPATH\include -I$(TPATH)\include -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF 12 12 13 LDFLAGS=$(GEODIR)/lib/libfcgi.lib $(GEODIR)/lib/libcurl_im 14 p.lib $(GEODIR)/apps/Python25/libs/python25.lib $(GEODIR)/lib/libxml2.lib ../thirds/cgic206/libcgic.lib $(GEODIR)/lib/gdal_i.lib $(TOOLS)\..\lib\libeay32.dll.a $(TOOLS)\..\lib\libcrypto.a $(TOOLS)\..\lib\libssl32.dll.a $(TOOLS)\..\lib\libintl.lib /machine:i386 13 LDFLAGS=$(GEODIR)/lib/libfcgi.lib $(GEODIR)/lib/libcurl_imp.lib $(GEODIR)/apps/Python25/libs/python25.lib $(GEODIR)/lib/libxml2.lib ../thirds/cgic206/libcgic.lib $(GEODIR)/lib/gdal_i.lib $(TOOLS)\..\lib\libeay32.dll.a $(TOOLS)\..\lib\libcrypto.a $(TOOLS)\..\lib\libssl32.dll.a $(TOOLS)\..\lib\libintl.lib /machine:i386 -
tags/rel-1.2.0-rc2/zoo-kernel/service.h
r217 r268 124 124 map* tmp=t; 125 125 while(tmp!=NULL){ 126 fprintf(file,"%s = %s\n",t->name,t->value); 126 fprintf(stderr,"%s = %s\n",tmp->name,tmp->value); 127 fprintf(file,"%s = %s\n",tmp->name,tmp->value); 127 128 tmp=tmp->next; 128 129 } … … 138 139 } 139 140 140 static void dumpMapsToFile(maps* m,FILE* file){ 141 static void dumpMapsToFile(maps* m,char* file_path){ 142 FILE* file=fopen(file_path,"w"); 141 143 maps* tmp=m; 142 144 if(tmp!=NULL){ 143 145 fprintf(file,"[%s]\n",tmp->name); 144 146 dumpMapToFile(tmp->content,file); 145 } 147 fflush(file); 148 } 149 fclose(file); 146 150 } 147 151 … … 549 553 map* tmpV=getMap(res->content,"value"); 550 554 free(tmpV->value); 551 tmpV->value=(char*)malloc( atoi(tmp->value)*sizeof(char));555 tmpV->value=(char*)malloc((atoi(tmp->value)+1)*sizeof(char)); 552 556 memmove(tmpV->value,tmpSized,atoi(tmp->value)*sizeof(char)); 557 tmpV->value[atoi(tmp->value)]=0; 553 558 free(tmpSized); 554 559 } -
tags/rel-1.2.0-rc2/zoo-kernel/service_conf.l
r217 r268 41 41 42 42 attname [a-zA-Z0-9_\-]+ 43 attvalue1 [\^\*\+,;@a-zA-Z0-9_\-::.:" "\"\'/\\\(\)\t\| ]+43 attvalue1 [\^\*\+,;@a-zA-Z0-9_\-::.:" "\"\'/\\\(\)\t\|\$\&>]+ 44 44 45 45 attvalue \"[^"]*\"|\'[^']*\'\(\) -
tags/rel-1.2.0-rc2/zoo-kernel/service_conf.y
r217 r268 356 356 //====================================================== 357 357 EmptyElemTag 358 : INFCAR ID Attributeetoile SLASH SUPCAR {} 358 : INFCAR ID Attributeetoile SLASH SUPCAR { 359 if(strncasecmp($2,"Default",7)==0){ 360 wait_defaults=false; 361 current_data=previous_data; 362 if(current_element->defaults==NULL){ 363 current_element->defaults=(iotype*)malloc(IOTYPE_SIZE); 364 current_element->defaults->content=NULL; 365 } 366 addMapToMap(¤t_element->defaults->content,current_content); 367 freeMap(¤t_content); 368 free(current_content); 369 current_element->defaults->next=NULL; 370 wait_defaults=false; 371 current_content=NULL; 372 current_element->supported=NULL; 373 current_element->next=NULL; 374 } 375 } 359 376 ; 360 377 -
tags/rel-1.2.0-rc2/zoo-kernel/service_internal.c
r217 r268 173 173 } 174 174 #else 175 175 176 void unhandleStatus(maps *conf){ 176 177 int shmid,i; … … 209 210 if ((shmid = shmget(key, SHMSZ, IPC_CREAT | 0666)) < 0) { 210 211 #ifdef DEBUG 211 fprintf(stderr,"shmget failed to update value\n");212 fprintf(stderr,"shmget failed to create new Shared memory segment\n"); 212 213 #endif 213 214 }else{ … … 220 221 tmpMap=getMapFromMaps(conf,"lenv","status"); 221 222 s1=shm; 222 for(s=tmpMap->value; s!=NULL;s++)223 for(s=tmpMap->value;*s!=NULL && *s!=0;s++){ 223 224 *s1++=*s; 225 } 226 *s1=NULL; 224 227 shmdt((void *)shm); 225 228 } … … 1722 1725 else 1723 1726 sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,strstr(_tmp->value,"=")+1); 1724 FILE* file=fopen(session_file_path,"w"); 1725 dumpMapsToFile(tmpSess,file); 1726 fclose(file); 1727 dumpMapsToFile(tmpSess,session_file_path); 1727 1728 } 1728 1729 } -
tags/rel-1.2.0-rc2/zoo-kernel/service_internal.h
r217 r268 57 57 #include <openssl/bio.h> 58 58 #include <openssl/buffer.h> 59 60 #include "cgic.h" 59 61 60 62 extern int getServiceFromFile(const char*,service**); -
tags/rel-1.2.0-rc2/zoo-kernel/zoo_service_loader.c
r217 r268 675 675 #endif 676 676 while ((dp = readdir(dirp)) != NULL) 677 if(strcmp(dp->d_name,buff)==0){ 677 if((strcasecmp("all.zcfg",buff)==0 && strstr(dp->d_name,".zcfg")>0) 678 || strcasecmp(dp->d_name,buff)==0){ 678 679 memset(buff1,0,1024); 679 680 snprintf(buff1,1024,"%s/%s",conf_dir,dp->d_name); … … 764 765 return 0; 765 766 } 766 //close(saved_stdout);767 close(saved_stdout); 767 768 768 769 #ifdef DEBUG … … 1812 1813 if(tmpPath==NULL) 1813 1814 tmpPath=getMapFromMaps(m,"main","tmpPath"); 1814 sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,strstr(cgiCookie,"=")+1); 1815 char *tmp1=strtok(cgiCookie,";"); 1816 if(tmp1!=NULL) 1817 sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,strstr(tmp1,"=")+1); 1818 else 1819 sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,strstr(cgiCookie,"=")+1); 1820 1815 1821 maps *tmpSess=(maps*)calloc(1,MAPS_SIZE); 1816 1822 struct stat file_status; 1817 1823 int istat = stat(session_file_path, &file_status); 1818 if(istat==0 ){1824 if(istat==0 && file_status.st_size>0){ 1819 1825 conf_read(session_file_path,tmpSess); 1820 1826 dumpMaps(tmpSess); -
tags/rel-1.2.0-rc2/zoo-services/ogr/base-vect-ops-py/cgi-env/SymDifferencePy.zcfg
r106 r268 66 66 Abstract = The symmetric difference between the two geometries. 67 67 <MetaData> 68 Title = Symmetric Difference68 title = Symmetric Difference 69 69 </MetaData> 70 70 <ComplexData> -
tags/rel-1.2.0-rc2/zoo-services/ogr/base-vect-ops-py/cgi-env/ogr_sp.py
r107 r268 1 from osgeo import * 1 2 import osgeo.ogr 3 import osgeo.gdal 2 4 import libxml2 3 5 import os 4 6 import sys 5 7 6 def createGeometryFromWFS(my_wfs_response): 7 doc=libxml2.parseMemory(my_wfs_response,len(my_wfs_response)) 8 ctxt = doc.xpathNewContext() 9 res=ctxt.xpathEval("/*/*/*/*/*[local-name()='Polygon' or local-name()='MultiPolygon' or local-name()='Point' or local-name()='MultiPoint' or local-name()='MultiLineString' or local-name()='LineString' ]") 8 def createGeometryFromWFS(conf,my_wfs_response): 10 9 geometry=[] 11 10 try: 12 for node in res: 13 geometry_as_string=node.serialize() 14 geometry+=[osgeo.ogr.CreateGeometryFromGML(geometry_as_string)] 11 # Create virtual file or parse XML file depending on the GDAL Version 12 gV=int(osgeo.gdal.VersionInfo()) 13 if gV >= 1800: 14 osgeo.gdal.FileFromMemBuffer('/vsimem//temp', my_wfs_response) 15 ds = osgeo.ogr.Open('/vsimem//temp') 16 lyr = ds.GetLayer(0) 17 feat = lyr.GetNextFeature() 18 while feat is not None: 19 geometry+=[feat.GetGeometryRef().Clone()] 20 feat.Destroy() 21 feat = lyr.GetNextFeature() 22 ds.Destroy() 23 osgeo.gdal.Unlink('/vsimem//temp') 24 else: 25 doc=libxml2.parseMemory(my_wfs_response,len(my_wfs_response)) 26 ctxt = doc.xpathNewContext() 27 res=ctxt.xpathEval("/*/*/*/*/*[local-name()='Polygon' or local-name()='MultiPolygon' or local-name()='Point' or local-name()='MultiPoint' or local-name()='MultiLineString' or local-name()='LineString' ]") 28 for node in res: 29 geometry_as_string=node.serialize() 30 geometry+=[osgeo.ogr.CreateGeometryFromGML(geometry_as_string)] 15 31 except: 16 print >> sys.stderr," Error"32 print >> sys.stderr,"Unable to load file from mem buffer\n\n\n" 17 33 return geometry 18 34 19 def extractInputs( obj):35 def extractInputs(conf,obj): 20 36 if obj["mimeType"]=="application/json": 21 37 return [osgeo.ogr.CreateGeometryFromJson(obj["value"])] 22 38 else: 23 39 try: 24 return createGeometryFromWFS( obj["value"])40 return createGeometryFromWFS(conf,obj["value"]) 25 41 except: 26 42 return [osgeo.ogr.CreateGeometryFromJson(obj["value"])] … … 34 50 extension = [ ".js" ] 35 51 drv = osgeo.ogr.GetDriverByName( driverName ) 36 ds = drv.CreateDataSource( conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0] ) 52 # Create virtual file or real one depending on the GDAL Version 53 gV=int(osgeo.gdal.VersionInfo()) 54 if gV >= 1800: 55 ds = drv.CreateDataSource( "/vsimem/store"+conf["lenv"]["sid"]+extension[0] ) 56 else: 57 ds = drv.CreateDataSource( conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0] ) 37 58 lyr = ds.CreateLayer( "Result", None, osgeo.ogr.wkbUnknown ) 38 59 field_defn = osgeo.ogr.FieldDefn( "Name", osgeo.ogr.OFTString ) … … 49 70 i+=1 50 71 ds.Destroy() 51 obj["value"]=open(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0],"r").read() 52 os.unlink(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0]) 53 if len(extension)>1: 54 os.unlink(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[1]) 72 if gV >= 1800: 73 vsiFile=osgeo.gdal.VSIFOpenL("/vsimem/store"+conf["lenv"]["sid"]+extension[0],"r") 74 i=0 75 while osgeo.gdal.VSIFSeekL(vsiFile,0,os.SEEK_END)>0: 76 i+=1 77 fileSize=osgeo.gdal.VSIFTellL(vsiFile) 78 osgeo.gdal.VSIFSeekL(vsiFile,0,os.SEEK_SET) 79 obj["value"]=osgeo.gdal.VSIFReadL(fileSize,1,vsiFile) 80 osgeo.gdal.Unlink("/vsimem/store"+conf["lenv"]["sid"]+extension[0]) 81 else: 82 obj["value"]=open(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0],"r").read() 83 os.unlink(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[0]) 84 if len(extension)>1: 85 os.unlink(conf["main"]["tmpPath"]+"/store"+conf["lenv"]["sid"]+extension[1]) 86 55 87 56 88 def BoundaryPy(conf,inputs,outputs): 57 geometry=extractInputs( inputs["InputPolygon"])89 geometry=extractInputs(conf,inputs["InputPolygon"]) 58 90 i=0 59 91 rgeometries=[] … … 66 98 67 99 def CentroidPy(conf,inputs,outputs): 68 geometry=extractInputs( inputs["InputPolygon"])100 geometry=extractInputs(conf,inputs["InputPolygon"]) 69 101 i=0 70 102 rgeometries=[] … … 79 111 80 112 def ConvexHullPy(conf,inputs,outputs): 81 geometry=extractInputs( inputs["InputPolygon"])113 geometry=extractInputs(conf,inputs["InputPolygon"]) 82 114 i=0 83 115 rgeometries=[] … … 94 126 except: 95 127 bdist=10 96 geometry=extractInputs( inputs["InputPolygon"])128 geometry=extractInputs(conf,inputs["InputPolygon"]) 97 129 i=0 98 130 rgeometries=[] … … 106 138 107 139 def UnionPy(conf,inputs,outputs): 108 geometry1=extractInputs( inputs["InputEntity1"])109 geometry2=extractInputs( inputs["InputEntity2"])140 geometry1=extractInputs(conf,inputs["InputEntity1"]) 141 geometry2=extractInputs(conf,inputs["InputEntity2"]) 110 142 rgeometries=[] 111 143 i=0 … … 127 159 128 160 def IntersectionPy(conf,inputs,outputs): 129 geometry1=extractInputs( inputs["InputEntity1"])130 geometry2=extractInputs( inputs["InputEntity2"])161 geometry1=extractInputs(conf,inputs["InputEntity1"]) 162 geometry2=extractInputs(conf,inputs["InputEntity2"]) 131 163 rgeometries=[] 132 164 i=0 … … 148 180 149 181 def DifferencePy(conf,inputs,outputs): 150 geometry1=extractInputs( inputs["InputEntity1"])151 geometry2=extractInputs( inputs["InputEntity2"])182 geometry1=extractInputs(conf,inputs["InputEntity1"]) 183 geometry2=extractInputs(conf,inputs["InputEntity2"]) 152 184 rgeometries=[] 153 185 i=0 … … 169 201 170 202 def SymDifferencePy(conf,inputs,outputs): 171 geometry1=extractInputs( inputs["InputEntity1"])172 geometry2=extractInputs( inputs["InputEntity2"])203 geometry1=extractInputs(conf,inputs["InputEntity1"]) 204 geometry2=extractInputs(conf,inputs["InputEntity2"]) 173 205 rgeometries=[] 174 206 i=0 -
tags/rel-1.2.0-rc2/zoo-services/ogr/ogr2ogr/cgi-env/Ogr2Ogr.zcfg
r48 r268 8 8 serviceProvider = ogr2ogr_service.zo 9 9 <MetaData> 10 Title = My Demo10 title = My Demo 11 11 </MetaData> 12 12 <DataInputs> -
tags/rel-1.2.0-rc2/zoo-services/ogr/ogr2ogr/service.c
r49 r268 95 95 const char *pszSQLStatement = NULL; 96 96 int eGType = -2; 97 double 97 double dfMaxSegmentLength = 0; 98 98 99 99 /* Check strict compilation and runtime library version as we use C++ API */ … … 178 178 } 179 179 180 tmpMap=NULL; 181 tmpMap=getMapFromMaps(inputs,"overwrite","value"); 182 if(tmpMap!=NULL){ 183 bOverwrite = TRUE; 184 } 185 180 /* if exist, overwrite the data with the same name */ 181 bOverwrite = TRUE; 182 186 183 tmpMap=NULL; 187 184 tmpMap=getMapFromMaps(inputs,"update","value"); … … 826 823 827 824 #ifdef ZOO_SERVICE 828 outputs=(maps*)malloc(sizeof(maps*));829 outputs->name="GeneratedFile";830 825 outputs->content=createMap("value",(char*)pszwebDestData); 831 addMapToMap(&outputs->content,createMap("dataType","string"));832 outputs->next=NULL;833 826 return SERVICE_SUCCEEDED; 834 827 #else -
tags/rel-1.2.0-rc2/zoo-services/utils/status/Makefile
r51 r268 1 CFLAGS=-I../../../ zoo-kernel/ -I./ `xslt-config --cflags` `xml2-config --cflags`-DLINUX_FREE_ISSUE #-DDEBUG1 CFLAGS=-I../../../thirds/cgic206/ -I../../../zoo-kernel/ -I./ `xslt-config --cflags` `xml2-config --cflags` -lintl -lfcgi -lcrypto -DLINUX_FREE_ISSUE #-DDEBUG 2 2 # if JS_ENABLED flag is set to true in your ZOO-Kernel Makefile then you'll have 3 3 # uncomment the following line -
tags/rel-1.2.0-rc2/zoo-services/utils/status/service.c
r217 r268 72 72 char tmp[128]; 73 73 sprintf(tmp,"_%s.xml",tmpMap->value); 74 while ((dp = readdir(dirp)) != NULL) 74 while ((dp = readdir(dirp)) != NULL){ 75 #ifdef DEBUG 76 fprintf(stderr,"File : %s searched : %s\n",dp->d_name,tmp); 77 #endif 75 78 if(strstr(dp->d_name,tmp)!=0){ 76 79 sprintf(fileName,"%s/%s",tmpTmap->value,dp->d_name); 77 80 hasFile=1; 78 81 } 82 } 79 83 }else{ 80 84 char tmp[1024];
Note: See TracChangeset
for help on using the changeset viewer.