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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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