Changeset 268 for branches/branch-1.2


Ignore:
Timestamp:
Jul 16, 2011, 12:58:47 PM (13 years ago)
Author:
djay
Message:

Merge branch-1.2 to current rev. 267. Tag release-1.2.0-rc2.

Location:
branches/branch-1.2
Files:
16 edited
5 copied

Legend:

Unmodified
Added
Removed
  • branches/branch-1.2

  • branches/branch-1.2/zoo-kernel/main.cfg

    r5 r268  
    66tmpPath=/YourFullTmpPathHere/
    77tmpUrl = ../TmpPathRelativeToServerAdress/
     8dataPath = /YouFullDataPathHere/
    89
    910[identification]
     
    2021positionName=Developer
    2122role=Dev
    22 adressDeliveryPoint=1280, avenue des Platanes
     23addressDeliveryPoint=1280, avenue des Platanes
    2324addressCity=Lattes
    2425addressAdministrativeArea=False
  • branches/branch-1.2/zoo-kernel/main_conf_read.y

    r217 r268  
    4747/* le type des lval des jetons et des elements non terminaux bison */
    4848//======================================================
    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;}
    5450//======================================================
    5551
  • branches/branch-1.2/zoo-kernel/nmake.opt

    r217 r268  
    99CPP=cl /TP $(CFLAGS)
    1010
    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_CONF
     11CFLAGS=-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
    1212
    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
     13LDFLAGS=$(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
  • branches/branch-1.2/zoo-kernel/service.h

    r217 r268  
    124124    map* tmp=t;
    125125    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);
    127128      tmp=tmp->next;
    128129    }
     
    138139  }
    139140
    140   static void dumpMapsToFile(maps* m,FILE* file){
     141  static void dumpMapsToFile(maps* m,char* file_path){
     142    FILE* file=fopen(file_path,"w");
    141143    maps* tmp=m;
    142144    if(tmp!=NULL){
    143145      fprintf(file,"[%s]\n",tmp->name);
    144146      dumpMapToFile(tmp->content,file);
    145     }
     147      fflush(file);
     148    }
     149    fclose(file);
    146150  }
    147151
     
    549553        map* tmpV=getMap(res->content,"value");
    550554        free(tmpV->value);
    551         tmpV->value=(char*)malloc(atoi(tmp->value)*sizeof(char));
     555        tmpV->value=(char*)malloc((atoi(tmp->value)+1)*sizeof(char));
    552556        memmove(tmpV->value,tmpSized,atoi(tmp->value)*sizeof(char));
     557        tmpV->value[atoi(tmp->value)]=0;
    553558        free(tmpSized);
    554559      }
  • branches/branch-1.2/zoo-kernel/service_conf.l

    r217 r268  
    4141
    4242attname [a-zA-Z0-9_\-]+
    43 attvalue1       [\^\*\+,;@a-zA-Z0-9_\-::.:" "\"\'/\\\(\)\t\|]+
     43attvalue1       [\^\*\+,;@a-zA-Z0-9_\-::.:" "\"\'/\\\(\)\t\|\$\&>]+
    4444
    4545attvalue                \"[^"]*\"|\'[^']*\'\(\)
  • branches/branch-1.2/zoo-kernel/service_conf.y

    r217 r268  
    356356//======================================================
    357357EmptyElemTag
    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(&current_element->defaults->content,current_content);
     367     freeMap(&current_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 }
    359376 ;
    360377
  • branches/branch-1.2/zoo-kernel/service_internal.c

    r217 r268  
    173173}
    174174#else
     175
    175176void unhandleStatus(maps *conf){
    176177  int shmid,i;
     
    209210    if ((shmid = shmget(key, SHMSZ, IPC_CREAT | 0666)) < 0) {
    210211#ifdef DEBUG
    211       fprintf(stderr,"shmget failed to update value\n");
     212      fprintf(stderr,"shmget failed to create new Shared memory segment\n");
    212213#endif
    213214    }else{
     
    220221        tmpMap=getMapFromMaps(conf,"lenv","status");
    221222        s1=shm;
    222         for(s=tmpMap->value;s!=NULL;s++)
     223        for(s=tmpMap->value;*s!=NULL && *s!=0;s++){
    223224          *s1++=*s;
     225        }
     226        *s1=NULL;
    224227        shmdt((void *)shm);
    225228      }
     
    17221725      else
    17231726        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);
    17271728    }
    17281729  }
  • branches/branch-1.2/zoo-kernel/service_internal.h

    r217 r268  
    5757#include <openssl/bio.h>
    5858#include <openssl/buffer.h>
     59
     60#include "cgic.h"
    5961
    6062extern   int getServiceFromFile(const char*,service**);
  • branches/branch-1.2/zoo-kernel/zoo_service_loader.c

    r217 r268  
    675675#endif
    676676        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){
    678679            memset(buff1,0,1024);
    679680            snprintf(buff1,1024,"%s/%s",conf_dir,dp->d_name);
     
    764765    return 0;
    765766  }
    766   //close(saved_stdout);
     767  close(saved_stdout);
    767768
    768769#ifdef DEBUG
     
    18121813    if(tmpPath==NULL)
    18131814      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
    18151821    maps *tmpSess=(maps*)calloc(1,MAPS_SIZE);
    18161822    struct stat file_status;
    18171823    int istat = stat(session_file_path, &file_status);
    1818     if(istat==0){
     1824    if(istat==0 && file_status.st_size>0){
    18191825      conf_read(session_file_path,tmpSess);
    18201826      dumpMaps(tmpSess);
  • branches/branch-1.2/zoo-services/ogr/base-vect-ops-py/cgi-env/SymDifferencePy.zcfg

    r106 r268  
    6666   Abstract = The symmetric difference between the two geometries.
    6767   <MetaData>
    68     Title = Symmetric Difference 
     68    title = Symmetric Difference 
    6969   </MetaData>   
    7070    <ComplexData>
  • branches/branch-1.2/zoo-services/ogr/base-vect-ops-py/cgi-env/ogr_sp.py

    r107 r268  
     1from osgeo import *
    12import osgeo.ogr
     3import osgeo.gdal
    24import libxml2
    35import os
    46import sys
    57
    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' ]")
     8def createGeometryFromWFS(conf,my_wfs_response):
    109    geometry=[]
    1110    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)]
    1531    except:
    16         print >> sys.stderr,"Error"
     32        print >> sys.stderr,"Unable to load file from mem buffer\n\n\n"
    1733    return geometry
    1834
    19 def extractInputs(obj):
     35def extractInputs(conf,obj):
    2036    if obj["mimeType"]=="application/json":
    2137        return [osgeo.ogr.CreateGeometryFromJson(obj["value"])]
    2238    else:
    2339        try:
    24                 return createGeometryFromWFS(obj["value"])
     40                return createGeometryFromWFS(conf,obj["value"])
    2541        except:
    2642                return [osgeo.ogr.CreateGeometryFromJson(obj["value"])]
     
    3450        extension = [ ".js" ]
    3551    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] )
    3758    lyr = ds.CreateLayer( "Result", None, osgeo.ogr.wkbUnknown )
    3859    field_defn = osgeo.ogr.FieldDefn( "Name", osgeo.ogr.OFTString )
     
    4970        i+=1
    5071    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   
    5587
    5688def BoundaryPy(conf,inputs,outputs):
    57     geometry=extractInputs(inputs["InputPolygon"])
     89    geometry=extractInputs(conf,inputs["InputPolygon"])
    5890    i=0
    5991    rgeometries=[]
     
    6698
    6799def CentroidPy(conf,inputs,outputs):
    68     geometry=extractInputs(inputs["InputPolygon"])
     100    geometry=extractInputs(conf,inputs["InputPolygon"])
    69101    i=0
    70102    rgeometries=[]
     
    79111
    80112def ConvexHullPy(conf,inputs,outputs):
    81     geometry=extractInputs(inputs["InputPolygon"])
     113    geometry=extractInputs(conf,inputs["InputPolygon"])
    82114    i=0
    83115    rgeometries=[]
     
    94126    except:
    95127        bdist=10
    96     geometry=extractInputs(inputs["InputPolygon"])
     128    geometry=extractInputs(conf,inputs["InputPolygon"])
    97129    i=0
    98130    rgeometries=[]
     
    106138
    107139def 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"])
    110142    rgeometries=[]
    111143    i=0
     
    127159
    128160def 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"])
    131163    rgeometries=[]
    132164    i=0
     
    148180
    149181def 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"])
    152184    rgeometries=[]
    153185    i=0
     
    169201
    170202def 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"])
    173205    rgeometries=[]
    174206    i=0
  • branches/branch-1.2/zoo-services/ogr/ogr2ogr/cgi-env/Ogr2Ogr.zcfg

    r48 r268  
    88 serviceProvider = ogr2ogr_service.zo
    99 <MetaData>
    10    Title = My Demo
     10   title = My Demo
    1111 </MetaData>
    1212 <DataInputs>
  • branches/branch-1.2/zoo-services/ogr/ogr2ogr/service.c

    r49 r268  
    9595    const char  *pszSQLStatement = NULL;
    9696    int         eGType = -2;
    97     double       dfMaxSegmentLength = 0;
     97    double      dfMaxSegmentLength = 0;
    9898
    9999    /* Check strict compilation and runtime library version as we use C++ API */
     
    178178    }
    179179
    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   
    186183    tmpMap=NULL;
    187184    tmpMap=getMapFromMaps(inputs,"update","value");
     
    826823   
    827824#ifdef ZOO_SERVICE
    828         outputs=(maps*)malloc(sizeof(maps*));
    829     outputs->name="GeneratedFile";
    830825    outputs->content=createMap("value",(char*)pszwebDestData);
    831     addMapToMap(&outputs->content,createMap("dataType","string"));
    832     outputs->next=NULL;
    833826    return SERVICE_SUCCEEDED;
    834827#else
  • branches/branch-1.2/zoo-services/utils/status/Makefile

    r51 r268  
    1 CFLAGS=-I../../../zoo-kernel/ -I./ `xslt-config --cflags` `xml2-config --cflags` -DLINUX_FREE_ISSUE #-DDEBUG
     1CFLAGS=-I../../../thirds/cgic206/ -I../../../zoo-kernel/ -I./ `xslt-config --cflags` `xml2-config --cflags` -lintl -lfcgi -lcrypto -DLINUX_FREE_ISSUE #-DDEBUG
    22# if JS_ENABLED flag is set to true in your ZOO-Kernel Makefile then you'll have
    33# uncomment the following line
  • branches/branch-1.2/zoo-services/utils/status/service.c

    r217 r268  
    7272      char tmp[128];
    7373      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
    7578        if(strstr(dp->d_name,tmp)!=0){
    7679          sprintf(fileName,"%s/%s",tmpTmap->value,dp->d_name);
    7780          hasFile=1;
    7881        }
     82      }
    7983    }else{
    8084      char tmp[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