Ignore:
Timestamp:
Nov 21, 2017, 10:24:14 AM (6 years ago)
Author:
djay
Message:

HPC support update. Add inputs for create options in Gdal_Dem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/response_print.c

    r851 r854  
    743743}
    744744
    745 int addMetadata(map* meta,xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_ows,xmlNsPtr ns_xlink){
     745/**
     746 * Add a Metadata node to any existing node.
     747 * @param meta the map defining the additional parameters
     748 * @param doc the XML document used
     749 * @param nb the node to add the additional parameters
     750 * @param ns_ows the OWS namespace
     751 * @param ns_xlink the xlink namespace
     752 */
     753void addMetadata(map* meta,xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_ows,xmlNsPtr ns_xlink){
    746754    int hasTitle=-1;
    747755    int hasValue=-1;
     
    817825}
    818826
    819 
    820 int addAdditionalParameters(map* meta,xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_ows,xmlNsPtr ns_xlink,int fromDb){
     827/**
     828 * Add AdditionalParameters nodes to any existing node.
     829 * @param meta the map defining the additional parameters
     830 * @param doc the XML document used
     831 * @param nb the node to add the additional parameters
     832 * @param ns_ows the OWS namespace
     833 * @param ns_xlink the xlink namespace
     834 * @param fromDb 1 if the metadata has been extracted from the metadb,
     835 * 0 otherwise
     836 */
     837void addAdditionalParameters(map* meta,xmlDocPtr doc,xmlNodePtr nc,xmlNsPtr ns_ows,xmlNsPtr ns_xlink,int fromDb){
    821838    int hasTitle=-1;
    822839    int hasValue=-1;
     840    int toAddAtEnd=-1;
     841    int cnt=0;
     842    xmlNodePtr* ncr=NULL;
    823843    xmlNodePtr nc1;
    824844    map* oMeta=meta;
    825845    int isAdditionalParameters=-1;
    826     //if(count(oMeta)>=2){
    827846    int level=0;
    828847    map* test=getMap(meta,"title");
     848    map* otitle=getMap(meta,"title");
     849    map* length=getMap(meta,"length");
     850    int len=0;
     851    char *ctitle=NULL;
     852   
    829853    if(test!=NULL)
    830854      level+=1;
     
    837861    if(count(oMeta)>level+1)
    838862      isAdditionalParameters=1;
    839     //}
    840     char *ctitle=NULL;
     863
    841864    while(meta!=NULL){
    842       if(hasTitle<0)
    843         if(hasValue<0)
    844           nc1 = xmlNewNode(ns_ows, BAD_CAST "AdditionalParameters");
     865      if(hasTitle<0 && hasValue<0){
     866        nc1 = xmlNewNode(ns_ows, BAD_CAST "AdditionalParameters");
     867      }
    845868      if(strncasecmp(meta->name,"title",5)==0 ||
    846869         strcasecmp(meta->name,"href")==0 ||
     
    851874          hasTitle=1;
    852875          if(ctitle!=NULL && strcasecmp(meta->value,ctitle)!=0){
    853               xmlAddChild(nc,nc1);
    854               nc1 = xmlNewNode(ns_ows, BAD_CAST "AdditionalParameters");
    855               free(ctitle);
    856               ctitle=NULL;
     876            xmlNodePtr ncTmp = xmlDocCopyNodeList(doc,nc1);
     877            xmlAddChild(nc,ncTmp);
     878            xmlFreeNode(nc1);
     879            toAddAtEnd=1;
     880            cnt++;
     881            nc1 = xmlNewNode(ns_ows, BAD_CAST "AdditionalParameters");
     882            free(ctitle);
     883            ctitle=NULL;
    857884          }
    858885          if(ctitle==NULL){
     
    865892            free(ctitle);
    866893          ctitle=zStrdup(meta->value);
     894        }else{
     895          xmlNewNsProp(nc1,ns_xlink,BAD_CAST meta->name,BAD_CAST meta->value);
    867896        }
    868897      }else{
     
    892921      meta=meta->next;
    893922      if(hasTitle<0){
    894         xmlAddChild(nc,nc1);
     923        //xmlAddChild(nc,nc1);
    895924        hasValue=1;
    896       }else
    897         free(ctitle);
    898     }
    899     if(oMeta!=NULL && hasValue<0 && nc1!=NULL){
     925      }/*else
     926        if(ctitle!=NULL)
     927        free(ctitle);*/
     928    }
     929    if(length!=NULL)
     930      len=atoi(length->value);
     931    if(otitle!=NULL)
     932      len=1;
     933    if(cnt<len){
    900934      xmlAddChild(nc,nc1);
     935      free(ctitle);
    901936    }
    902937}
     
    14061441                  }
    14071442                }
    1408                 else
     1443                else{
    14091444                  xmlFreeNode(nc9);
     1445                }
    14101446                if(strcasecmp(tmp1->name,"uom")==0)
    14111447                  hasUOM1=true;
     
    14281464            if(hasUOM1==false && vid==0){
    14291465              xmlFreeNode(nc5);
    1430               if(datatype==1)
     1466              if(datatype==1){
    14311467                xmlFreeNode(nc4);
     1468              }
    14321469            }
    14331470            else
     
    14401477        if(datatype!=1 && default1<0){
    14411478          xmlFreeNode(nc5);
    1442           if(datatype!=2)
     1479          if(datatype!=2){
    14431480            xmlFreeNode(nc4);
     1481          }
    14441482        }
    14451483
     
    16031641                if(vid==0 || oI!=4)
    16041642                  xmlAddChild(nc5,nc6);
    1605                 else
     1643                else{
    16061644                  xmlFreeNode(nc6);
     1645                }
    16071646              }
    1608               else
     1647              else{
    16091648                xmlFreeNode(nc6);
     1649              }
    16101650            }
    16111651            tmp1=tmp1->next;
     
    16341674            }
    16351675            else{
    1636               xmlFreeNode(nc4);
    16371676              xmlAddChild(nc3,nc5);
    16381677            }
     
    16481687
    16491688      if(hasSupported==0){
    1650         if(datatype==0 && vid!=0)
     1689        if(datatype==0 && vid!=0){
    16511690          xmlFreeNode(nc4);
     1691        }
    16521692        xmlFreeNode(nc5);
    16531693      }
     
    26782718      toto=getMap(tmpI->content,"asReference");
    26792719#ifdef USE_MS
    2680       if(toto!=NULL && strcasecmp(toto->value,"true")==0 && (testMap==NULL || strncasecmp(testMap->value,"true",4)!=0) )
     2720      restartNoMS:
     2721      map* geodatatype=getMap(tmpI->content,"geodatatype");
     2722     
     2723      if(toto!=NULL && strcasecmp(toto->value,"true")==0 &&
     2724         (testMap==NULL ||
     2725          strncasecmp(testMap->value,"true",4)!=0 ||
     2726          (geodatatype!=NULL && strcasecmp(geodatatype->value,"other")==0) ) )
    26812727#else
    26822728      if(toto!=NULL && strcasecmp(toto->value,"true")==0)
     
    26992745          }
    27002746
     2747          char *file_path=NULL;
    27012748          if(gfile==NULL) {
    27022749            map *ext=getMap(tmpI->content,"extension");
    2703             char *file_path;
    27042750            char file_ext[32];
    27052751
     
    27162762              free(file_name);
    27172763            file_name=(char*)malloc((strlen(s->name)+strlen(usid->value)+strlen(file_ext)+strlen(tmpI->name)+45)*sizeof(char));
    2718             sprintf(file_name,"%s_%s_%s_%d.%s",s->name,tmpI->name,usid->value,itn,file_ext);
     2764            sprintf(file_name,"ZOO_DATA_%s_%s_%s_%d.%s",s->name,tmpI->name,usid->value,itn,file_ext);
    27192765            itn++;
    27202766            file_path=(char*)malloc((strlen(tmp1->value)+strlen(file_name)+2)*sizeof(char));
     
    27302776              return;
    27312777            }
    2732             free(file_path);
    27332778
    27342779            toto=getMap(tmpI->content,"value");
     
    27442789            }
    27452790            fclose(ofile);
    2746 
    27472791          }
    27482792
    27492793          map *tmp2=getMapFromMaps(m,"main","tmpUrl");
    27502794          map *tmp3=getMapFromMaps(m,"main","serverAddress");
    2751           char *file_url;
     2795          char *file_url=NULL;
    27522796          if(strncasecmp(tmp2->value,"http://",7)==0 ||
    27532797             strncasecmp(tmp2->value,"https://",8)==0){
     
    27592803          }
    27602804          addToMap(tmpI->content,"Reference",file_url);
    2761           free(file_name);
    2762           free(file_url);
     2805          /*maps* curs=tmpI;
     2806          curs=curs->next;
     2807          map* test=getMap(tmpI->content,"replicateStorageNext");
     2808          if(test!=NULL && strncasecmp(test->value,"true",4)==0)
     2809            while(curs!=NULL){
     2810              addToMap(curs->content,"storage",file_path);
     2811              curs=curs->next;
     2812              }
     2813          if(file_path!=NULL)
     2814          free(file_path);*/
     2815          if(file_name!=NULL)
     2816            free(file_name);
     2817          if(file_url!=NULL)
     2818            free(file_url);
    27632819          file_name=NULL;
    27642820        }
     
    27662822      else{
    27672823        if(testMap!=NULL){
     2824          setMapInMaps(m,"lenv","state","out");
    27682825          setReferenceUrl(m,tmpI);
     2826          geodatatype=getMap(tmpI->content,"geodatatype");
     2827          if(geodatatype!=NULL && strcasecmp(geodatatype->value,"other")==0)
     2828            goto restartNoMS;
    27692829        }
    27702830      }
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