Changeset 297


Ignore:
Timestamp:
Aug 4, 2011, 2:16:11 PM (10 years ago)
Author:
djay
Message:

Initial MapServer? W*S output support integration, pass version number to 1.3.0 in configure.ac.

Location:
trunk/zoo-kernel
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-kernel/Makefile.in

    r284 r297  
    1010JAVA_FILE=@JAVA_FILE@
    1111
    12 CFLAGS=${MACOS_CFLAGS} -I../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
     12MS_CFLAGS=@MS_CFLAGS@
     13MS_LDFLAGS=@MS_LIBS@
     14MS_FILE=@MS_FILE@
     15
     16CFLAGS=${MACOS_CFLAGS} ${MS_CFLAGS} -I../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
     17LDFLAGS=-lcurl -L../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MS_LDFLAGS} ${MACOS_LD_FLAGS}
    1318
    1419PHPCFLAGS=@PHP_CPPFLAGS@
     
    7277        gcc ${JS_ENABLED} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_internal.c
    7378
     79service_internal_ms.o: service_internal_ms.c
     80        gcc ${JS_ENABLED} ${JSCFLAGS} ${XML2CFLAGS} ${CFLAGS} -fPIC -c service_internal_ms.c
     81
    7482service_internal_python.o: service_internal_python.c service.h
    7583        g++ ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c service_internal_python.c
     
    95103        g++ -g -O2 ${XML2CFLAGS} ${CFLAGS} ${PYTHONCFLAGS} ${JAVACFLAGS} ${JSCFLAGS} ${PERLCFLAGS} ${PHPCFLAGS} ${PYTHON_ENABLED} ${JS_ENABLED} ${PHP_ENABLED} ${PERL_ENABLED} ${JAVA_ENABLED} -c zoo_service_loader.c  -fno-common -DPIC -o zoo_service_loader.o
    96104
    97 zoo_loader.cgi: zoo_loader.c zoo_service_loader.o  ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o service_internal.o ${PYTHON_FILE}  ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE}
     105zoo_loader.cgi: zoo_loader.c zoo_service_loader.o  ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o service_internal.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE}
    98106        g++ -g -O2 ${JSCFLAGS} ${PHPCFLAGS}  ${PERLCFLAGS}   ${JAVACFLAGS} ${XML2CFLAGS} ${PYTHONCFLAGS} ${CFLAGS} -c zoo_loader.c  -fno-common -DPIC -o zoo_loader.o
    99         g++  ${JSCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o service_internal.o ${PYTHON_FILE}  ${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi -lcurl -L../thirds/cgic206 -lcgic -lcurl ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto ${MACOS_LD_FLAGS}
     107        g++  ${JSCFLAGS} ${GDAL_CFLAGS} ${XML2CFLAGS} ${PHPCFLAGS} ${PERLCFLAGS} ${JAVACFLAGS} ${PYTHONCFLAGS} ${CFLAGS} zoo_loader.o zoo_service_loader.o service_internal.o ${MS_FILE} ${PYTHON_FILE}  ${PERL_FILE} ${PHP_FILE}  ${JS_FILE} ${JAVA_FILE} ulinet.o lex.cr.o lex.sr.o service_conf.tab.o main_conf_read.tab.o -o zoo_loader.cgi ${LDFLAGS}
    100108
    101109install:
  • trunk/zoo-kernel/configure.ac

    r288 r297  
    1 AC_INIT([ZOO Kernel], [1.2.0], [bugs@zoo-project.org])
     1AC_INIT([ZOO Kernel], [1.3.0], [bugs@zoo-project.org])
    22
    33# Checks for programs.
     
    113113AC_SUBST([XML2_CPPFLAGS])
    114114AC_SUBST([XML2_LDFLAGS])
     115
     116#============================================================================
     117# Detect if mapserver is installed
     118#============================================================================
     119
     120AC_ARG_WITH([mapserver],
     121       [AS_HELP_STRING([--with-mapserver=PATH], [specify the path for MapServer compiled source tree])],
     122       [MS_SRC_PATH="$withval"], [MS_SRC_PATH=""])
     123if test -z $MS_SRC_PATH;
     124then
     125       AC_PATH_PROG([MS_SRC_PATH], [mapserver])
     126       if test "x$MS_SRC_PATH" = "xmacos";
     127       then
     128               AC_MSG_RESULT([Using MacOSX Framework for MapServer])
     129       else
     130               if test -d $MS_SRC_PATH;
     131               then
     132                       AC_MSG_ERROR([could not find the MapServer source tree. You may need to try re-running configure with a --with-mapserver parameter.])
     133               fi
     134       fi     
     135else
     136       if test "x$MS_SRC_PATH" = "xmacos";
     137       then
     138               MS_LDFLAGS="/Library/Frameworks/MapServer.framework//Versions/6.0/MapServer -lintl"
     139               MS_CPPFLAGS="-DUSE_MS `/Library/Frameworks/MapServer.framework/Programs/mapserver-config --includes` -I/Library/Frameworks/MapServer.framework/Versions/Current/Headers/ -I../mapserver "
     140               AC_MSG_WARN([Please make sure that ../mapserver exists and contains MapServer source tree])
     141               AC_MSG_RESULT([Using MacOS X Framework for MapServer])
     142       else
     143               if test -d $MS_SRC_PATH; then
     144                       MS_LDFLAGS="-L$MS_SRC_PATH -lmapserver `$MS_SRC_PATH/mapserver-config --libs`"
     145                       MS_CPPFLAGS="-DUSE_MS `$MS_SRC_PATH/mapserver-config --includes` `$MS_SRC_PATH/mapserver-config --cflags` -I$MS_SRC_PATH "
     146               
     147                       AC_MSG_RESULT([Using user-specified MapServer src path: $MS_SRC_PATH])
     148               else
     149                       AC_MSG_ERROR([the user-specified mapserver-config file $MS_SRC_PATH does not exist])
     150               fi
     151       fi
     152       MS_FILE="service_internal_ms.o"
     153fi
     154
     155MS_CFLAGS="$MS_CPPFLAGS"
     156MS_LIBS="$MS_LDFLAGS"
     157
     158AC_SUBST([MS_CFLAGS])
     159AC_SUBST([MS_LIBS])
     160AC_SUBST([MS_FILE])
    115161
    116162# ===========================================================================
  • trunk/zoo-kernel/service_internal.c

    r296 r297  
    15341534    }
    15351535    tmp=m->content;
     1536#ifdef USE_MS
     1537    map* testMap=getMap(tmp,"requestedMimeType");
     1538#endif
    15361539    while(tmp!=NULL){
    15371540      if(strcasecmp(tmp->name,"mimeType")==0 ||
     
    15401543         strcasecmp(tmp->name,"datatype")==0 ||
    15411544         strcasecmp(tmp->name,"uom")==0)
     1545#ifdef USE_MS
     1546        if(testMap==NULL || (testMap!=NULL && strncasecmp(testMap->value,"text/xml",8)==0))
     1547#endif
    15421548        xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value);
     1549#ifdef USE_MS
     1550      if(strcasecmp(tmp->name,"mimeType")==0)
     1551        if(testMap!=NULL)
     1552          xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST testMap->value);
     1553        else
     1554          xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value);
     1555#endif
    15431556      tmp=tmp->next;
    15441557      xmlAddChild(nc2,nc3);
     
    15571570      else
    15581571        tmp=NULL;
     1572#ifdef USE_MS
     1573      /**
     1574       * In case of OGC WebServices output use, as the data was requested
     1575       * with asReference=false we have to download the resulting OWS request
     1576       * stored in the Reference map value.
     1577       */
     1578      map* testMap=getMap(m->content,"requestedMimeType");
     1579      if(testMap!=NULL){
     1580        HINTERNET hInternet;
     1581        hInternet=InternetOpen(
     1582#ifndef WIN32
     1583                               (LPCTSTR)
     1584#endif
     1585                               "ZooWPSClient\0",
     1586                               INTERNET_OPEN_TYPE_PRECONFIG,
     1587                               NULL,NULL, 0);
     1588        testMap=getMap(m->content,"Reference");
     1589        loadRemoteFile(m,m->content,hInternet,testMap->value);
     1590        InternetCloseHandle(hInternet);
     1591      }
     1592#endif
    15591593      map* tmp1=getMap(m->content,"encoding");
    15601594      map* tmp2=getMap(m->content,"mimeType");
     
    16031637  }
    16041638  else{
     1639    tmpMap=getMap(m->content,"Reference");
    16051640    nc3=nc2=xmlNewNode(ns_wps, BAD_CAST "Reference");
    16061641    if(strcasecmp(type,"Output")==0)
     
    16091644      xmlNewNsProp(nc3,ns_xlink,BAD_CAST "href",BAD_CAST tmpMap->value);
    16101645    tmp=m->content;
     1646#ifdef USE_MS
     1647    map* testMap=getMap(tmp,"requestedMimeType");
     1648#endif
    16111649    while(tmp!=NULL){
    16121650      if(strcasecmp(tmp->name,"mimeType")==0 ||
     
    16151653         strcasecmp(tmp->name,"datatype")==0 ||
    16161654         strcasecmp(tmp->name,"uom")==0)
     1655#ifdef USE_MS
     1656        if(testMap!=NULL  && strncasecmp(testMap->value,"text/xml",8)!=0){
     1657          if(strcasecmp(tmp->name,"mimeType")==0)
     1658            xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST testMap->value);
     1659        }
     1660        else
     1661#endif
    16171662        xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value);
    16181663      tmp=tmp->next;
     
    17841829    maps* tmpI=request_outputs;
    17851830    while(tmpI!=NULL){
     1831#ifdef USE_MS
     1832      map* testMap=getMap(tmpI->content,"useMapserver");
     1833#endif
    17861834      toto=getMap(tmpI->content,"asReference");
     1835#ifdef USE_MS
     1836      if(toto!=NULL && strcasecmp(toto->value,"true")==0 && testMap==NULL){
     1837#else
    17871838      if(toto!=NULL && strcasecmp(toto->value,"true")==0){
     1839#endif
    17881840        elements* in=getElements(s->outputs,tmpI->name);
    17891841        char *format=NULL;
     
    18531905        free(file_url);
    18541906      }
     1907#ifdef USE_MS
     1908      else{
     1909        if(testMap!=NULL){
     1910          setReferenceUrl(m,tmpI);
     1911        }
     1912      }
     1913#endif
    18551914      tmpI=tmpI->next;
    18561915    }
     
    21362195          tmpContent=tmpContent->next;
    21372196        }
     2197#ifdef USE_MS
     2198        /**
     2199         * check for useMapServer presence
     2200         */
     2201        map* tmpCheck=getMap(tmpIoType->content,"useMapServer");
     2202        if(tmpCheck!=NULL){
     2203          // Get the default value
     2204          tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name,NULL);
     2205          tmpCheck=getMap(tmpMaps->content,"mimeType");
     2206          addToMap(tmpMaps->content,"requestedMimeType",tmpCheck->value);
     2207          map* cursor=tmpIoType->content;
     2208          while(cursor!=NULL){
     2209            addToMap(tmpMaps->content,cursor->name,cursor->value);
     2210            cursor=cursor->next;
     2211          }
     2212         
     2213          cursor=tmpInputs->content;
     2214          while(cursor!=NULL){
     2215            if(strcasecmp(cursor->name,"Title")==0 ||
     2216               strcasecmp(cursor->name,"Abstract")==0)
     2217              addToMap(tmpMaps->content,cursor->name,cursor->value);
     2218           cursor=cursor->next;
     2219          }
     2220        }
     2221#endif
    21382222      }
    21392223      if(tmpMaps->content==NULL)
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