Changeset 790 for trunk/zoo-project/zoo-kernel/server_internal.c
- Timestamp:
- Dec 19, 2016, 6:01:06 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/server_internal.c
r789 r790 583 583 map *res=*err; 584 584 elements* tmpInputs=in; 585 elements* tmpInputss=NULL; 585 586 maps* out1=*out; 587 maps* out1s=NULL; 586 588 char *result=NULL; 587 589 int nb=0; 590 int inb=0; 591 loopOnInputs: 588 592 if(type==1){ 589 593 while(out1!=NULL){ … … 597 601 result=out1->name; 598 602 } 603 inb++; 599 604 out1=out1->next; 600 605 } 601 606 if(res!=NULL){ 607 fflush(stderr); 602 608 *err=res; 603 609 return result; 604 610 } 605 out1=*out; 611 if(out1==NULL && inb>=1) 612 out1=*out; 606 613 } 607 614 while(tmpInputs!=NULL){ 608 615 maps *tmpMaps=getMaps(out1,tmpInputs->name); 609 616 if(tmpMaps==NULL){ 610 maps* tmpMaps2=(maps*)malloc(MAPS_SIZE); 611 tmpMaps2->name=strdup(tmpInputs->name); 612 tmpMaps2->content=NULL; 613 tmpMaps2->next=NULL; 614 617 maps* tmpMaps2=createMaps(tmpInputs->name); 615 618 if(type==0){ 616 619 map* tmpMapMinO=getMap(tmpInputs->content,"minOccurs"); … … 651 654 } 652 655 } 653 656 654 657 if(res==NULL){ 655 658 iotype* tmpIoType=tmpInputs->defaults; … … 685 688 } 686 689 else{ 687 iotype* tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name, 688 tmpMaps->content); 689 if(type==0) { 690 /** 691 * In case of an Input maps, then add the minOccurs and maxOccurs to the 692 * content map. 693 */ 694 map* tmpMap1=getMap(tmpInputs->content,"minOccurs"); 695 if(tmpMap1!=NULL){ 696 if(tmpMaps->content==NULL) 697 tmpMaps->content=createMap("minOccurs",tmpMap1->value); 698 else 699 addToMap(tmpMaps->content,"minOccurs",tmpMap1->value); 700 } 701 map* tmpMaxO=getMap(tmpInputs->content,"maxOccurs"); 702 if(tmpMaxO!=NULL){ 703 if(tmpMaps->content==NULL) 704 tmpMaps->content=createMap("maxOccurs",tmpMaxO->value); 705 else 706 addToMap(tmpMaps->content,"maxOccurs",tmpMaxO->value); 707 } 708 map* tmpMaxMB=getMap(tmpInputs->content,"maximumMegabytes"); 709 if(tmpMaxMB!=NULL){ 710 if(tmpMaps->content==NULL) 711 tmpMaps->content=createMap("maximumMegabytes",tmpMaxMB->value); 712 else 713 addToMap(tmpMaps->content,"maximumMegabytes",tmpMaxMB->value); 714 } 715 /** 716 * Parsing BoundingBoxData, fill the following map and then add it to 717 * the content map of the Input maps: 718 * lowerCorner, upperCorner, srs and dimensions 719 * cf. parseBoundingBox 720 */ 721 if(tmpInputs->format!=NULL && strcasecmp(tmpInputs->format,"BoundingBoxData")==0){ 722 maps* tmpI=getMaps(*out,tmpInputs->name); 723 if(tmpI!=NULL){ 724 map* tmpV=getMap(tmpI->content,"value"); 725 if(tmpV!=NULL){ 726 char *tmpVS=strdup(tmpV->value); 727 map* tmp=parseBoundingBox(tmpVS); 728 free(tmpVS); 729 map* tmpC=tmp; 730 while(tmpC!=NULL){ 731 addToMap(tmpMaps->content,tmpC->name,tmpC->value); 732 tmpC=tmpC->next; 690 iotype* tmpIoType=NULL; 691 if(tmpMaps->content!=NULL){ 692 tmpIoType=getIoTypeFromElement(tmpInputs,tmpInputs->name, 693 tmpMaps->content); 694 if(type==0) { 695 /** 696 * In case of an Input maps, then add the minOccurs and maxOccurs to the 697 * content map. 698 */ 699 map* tmpMap1=getMap(tmpInputs->content,"minOccurs"); 700 if(tmpMap1!=NULL){ 701 if(tmpMaps->content==NULL) 702 tmpMaps->content=createMap("minOccurs",tmpMap1->value); 703 else 704 addToMap(tmpMaps->content,"minOccurs",tmpMap1->value); 705 } 706 map* tmpMaxO=getMap(tmpInputs->content,"maxOccurs"); 707 if(tmpMaxO!=NULL){ 708 if(tmpMaps->content==NULL) 709 tmpMaps->content=createMap("maxOccurs",tmpMaxO->value); 710 else 711 addToMap(tmpMaps->content,"maxOccurs",tmpMaxO->value); 712 } 713 map* tmpMaxMB=getMap(tmpInputs->content,"maximumMegabytes"); 714 if(tmpMaxMB!=NULL){ 715 if(tmpMaps->content==NULL) 716 tmpMaps->content=createMap("maximumMegabytes",tmpMaxMB->value); 717 else 718 addToMap(tmpMaps->content,"maximumMegabytes",tmpMaxMB->value); 719 } 720 /** 721 * Parsing BoundingBoxData, fill the following map and then add it to 722 * the content map of the Input maps: 723 * lowerCorner, upperCorner, srs and dimensions 724 * cf. parseBoundingBox 725 */ 726 if(tmpInputs->format!=NULL && strcasecmp(tmpInputs->format,"BoundingBoxData")==0){ 727 maps* tmpI=getMaps(*out,tmpInputs->name); 728 if(tmpI!=NULL){ 729 map* tmpV=getMap(tmpI->content,"value"); 730 if(tmpV!=NULL){ 731 char *tmpVS=strdup(tmpV->value); 732 map* tmp=parseBoundingBox(tmpVS); 733 free(tmpVS); 734 map* tmpC=tmp; 735 while(tmpC!=NULL){ 736 addToMap(tmpMaps->content,tmpC->name,tmpC->value); 737 tmpC=tmpC->next; 738 } 739 freeMap(&tmp); 740 free(tmp); 733 741 } 734 freeMap(&tmp);735 free(tmp);736 742 } 737 743 } 744 } 745 }else{ 746 if(tmpInputs!=NULL){ 747 tmpIoType=tmpInputs->defaults; 738 748 } 739 749 } … … 807 817 else 808 818 addToMap(tmpMaps->content,"inRequest","true"); 809 810 } 811 tmpInputs=tmpInputs->next; 819 elements* tmpElements=getElements(in,tmpMaps->name); 820 if(tmpMaps->child!=NULL and tmpElements!=NULL and tmpElements->child!=NULL){ 821 char *res=addDefaultValues(&tmpMaps->child,tmpElements->child,m,type,err); 822 if(strlen(res)>0){ 823 fprintf(stderr,"%s %d\n",__FILE__,__LINE__); 824 return res; 825 } 826 } 827 } 828 if(tmpInputs->child!=NULL){ 829 tmpInputss=tmpInputs->next; 830 tmpInputs=tmpInputs->child; 831 if(tmpMaps!=NULL){ 832 out1=tmpMaps->child; 833 out1s=tmpMaps; 834 } 835 }else 836 tmpInputs=tmpInputs->next; 837 } 838 if(tmpInputss!=NULL){ 839 out1=out1s; 840 tmpInputs=tmpInputss; 841 tmpInputss=NULL; 842 out1s=NULL; 843 goto loopOnInputs; 812 844 } 813 845 if(res!=NULL){ … … 879 911 maps *res = (maps *) malloc (MAPS_SIZE); 880 912 conf_read (fbkpid, res); 913 res->child=NULL; 881 914 map* status=getMapFromMaps(res,"status","status"); 882 915 addToMap(statusInfo,"Status",status->value);
Note: See TracChangeset
for help on using the changeset viewer.