Changeset 65 for trunk/zoo-kernel
- Timestamp:
- Jan 8, 2011, 2:12:24 PM (14 years ago)
- Location:
- trunk/zoo-kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-kernel/service_conf.y
r60 r65 203 203 dumpElements(my_service->inputs); 204 204 dumpService(my_service); 205 #endif 205 #endif 206 206 if(my_service->inputs==NULL){ 207 207 my_service->inputs=dupElements(current_element); … … 238 238 wait_outputs=true; 239 239 current_data=2; 240 previous_data= 1;240 previous_data=2; 241 241 } 242 242 else … … 587 587 else 588 588 if(current_data==2){ 589 if(wait_inputs==true){ 589 wait_outputs=true; 590 if(wait_inputs){ 590 591 if(current_element!=NULL && current_element->name!=NULL){ 591 if(my_service-> inputs==NULL){592 my_service-> inputs=dupElements(current_element);593 my_service-> inputs->next=NULL;592 if(my_service->outputs==NULL){ 593 my_service->outputs=dupElements(current_element); 594 my_service->outputs->next=NULL; 594 595 } 595 596 else{ … … 597 598 fprintf(stderr,"LAST NAME IN %s (current - %s)\n",$1,current_element->name); 598 599 #endif 599 addToElements(&my_service-> inputs,current_element);600 addToElements(&my_service->outputs,current_element); 600 601 } 601 602 #ifdef DEBUG_SERVICE_CONF … … 624 625 #endif 625 626 char *cen=strdup($1); 626 current_element->name=(char*)malloc((strlen(cen)-1)*sizeof(char *));627 current_element->name=(char*)malloc((strlen(cen)-1)*sizeof(char)); 627 628 cen[strlen(cen)-1]=0; 628 629 cen+=1; … … 637 638 current_element->next=NULL; 638 639 } 639 wait_inputs=false; 640 640 641 current_content=NULL; 641 642 } 642 643 else 643 if(current_element->name==NULL){ 644 if(current_element!=NULL && current_element->name!=NULL){ 645 if(my_service->outputs==NULL) 646 my_service->outputs=dupElements(current_element); 647 else 648 addToElements(&my_service->outputs,current_element); 649 fprintf(stderr,"ADD TO OUTPUTS Elements\n"); 650 dupElements(current_element); 651 652 freeElements(¤t_element); 653 free(current_element); 654 current_element=NULL; 655 } 656 else{ 644 657 #ifdef DEBUG_SERVICE_CONF 645 658 fprintf(stderr,"NAME OUT %s\n",$1); … … 663 676 current_element->next=NULL; 664 677 } 678 wait_inputs=false; 665 679 wait_outputs=true; 680 //wait_outputs=true; 666 681 } 667 682 } … … 724 739 int resultatYYParse = srparse() ; 725 740 726 if(wait_outputs ==true&& current_element!=NULL && current_element->name!=NULL){741 if(wait_outputs && current_element!=NULL && current_element->name!=NULL){ 727 742 if(my_service->outputs==NULL){ 728 743 #ifdef DEBUG_SERVICE_CONF -
trunk/zoo-kernel/service_internal.c
r64 r65 1126 1126 int i; 1127 1127 maps* mcursor=inputs; 1128 elements* scursor= serv->inputs;1128 elements* scursor=NULL; 1129 1129 while(mcursor!=NULL /*&& scursor!=NULL*/){ 1130 scursor=getElements(serv->inputs,mcursor->name); 1130 1131 printIOType(doc,nc,ns,ns_ows,scursor,mcursor,"Input"); 1131 1132 mcursor=mcursor->next; 1132 //scursor=scursor->next;1133 1133 } 1134 1134 xmlAddChild(n,nc); … … 1140 1140 nc = xmlNewNode(ns, BAD_CAST "OutputDefinitions"); 1141 1141 mcursor=outputs; 1142 scursor=serv->outputs; 1143 while(mcursor!=NULL /*&& scursor!=NULL*/){ 1142 scursor=NULL; 1143 while(mcursor!=NULL){ 1144 scursor=getElements(serv->outputs,mcursor->name); 1144 1145 printOutputDefinitions1(doc,nc,ns,ns_ows,scursor,mcursor,"Output"); 1145 1146 mcursor=mcursor->next; 1146 //scursor=scursor->next;1147 1147 } 1148 1148 xmlAddChild(n,nc); … … 1160 1160 elements* scursor=serv->outputs; 1161 1161 while(mcursor!=NULL){ 1162 scursor=getElements(serv->outputs,mcursor->name); 1162 1163 printIOType(doc,nc,ns,ns_ows,scursor,mcursor,"Output"); 1163 1164 mcursor=mcursor->next; … … 1264 1265 xmlNodePtr nc1,nc2,nc3; 1265 1266 nc1=xmlNewNode(ns_wps, BAD_CAST type); 1266 map *tmp=e->content; 1267 map *tmp=NULL; 1268 if(e!=NULL) 1269 tmp=e->content; 1270 else 1271 tmp=m->content; 1267 1272 #ifdef DEBUG 1268 1273 dumpMap(tmp); … … 1270 1275 #endif 1271 1276 nc2=xmlNewNode(ns_ows, BAD_CAST "Identifier"); 1272 nc3=xmlNewText(BAD_CAST e->name); 1277 if(e!=NULL) 1278 nc3=xmlNewText(BAD_CAST e->name); 1279 else 1280 nc3=xmlNewText(BAD_CAST m->name); 1273 1281 xmlAddChild(nc2,nc3); 1274 1282 xmlAddChild(nc1,nc2); 1275 1283 xmlAddChild(nc,nc1); 1276 1284 // Extract Title required to be first element in the ZCFG file ! 1277 nc2=xmlNewNode(ns_ows, BAD_CAST tmp->name); 1278 nc3=xmlNewText(BAD_CAST _ss(tmp->value)); 1279 xmlAddChild(nc2,nc3); 1280 xmlAddChild(nc1,nc2); 1281 // Extract Abstract required to be second element in the ZCFG file ! 1282 // For GRASS it can be empty ... 1283 if(tmp->next!=NULL){ 1284 tmp=tmp->next; 1285 bool isTitle=true; 1286 if(e!=NULL) 1287 tmp=getMap(e->content,"Title"); 1288 else 1289 tmp=getMap(m->content,"Title"); 1290 1291 if(tmp!=NULL){ 1292 nc2=xmlNewNode(ns_ows, BAD_CAST tmp->name); 1293 nc3=xmlNewText(BAD_CAST _ss(tmp->value)); 1294 xmlAddChild(nc2,nc3); 1295 xmlAddChild(nc1,nc2); 1296 } 1297 1298 if(e!=NULL) 1299 tmp=getMap(e->content,"Abstract"); 1300 else 1301 tmp=getMap(m->content,"Abstract"); 1302 if(tmp!=NULL){ 1285 1303 nc2=xmlNewNode(ns_ows, BAD_CAST tmp->name); 1286 1304 nc3=xmlNewText(BAD_CAST _ss(tmp->value)); … … 1288 1306 xmlAddChild(nc1,nc2); 1289 1307 xmlAddChild(nc,nc1); 1290 tmp=tmp->next;1291 1308 } 1292 1309 … … 1300 1317 if(tmpMap==NULL){ 1301 1318 nc2=xmlNewNode(ns_wps, BAD_CAST "Data"); 1302 if(strncasecmp(e->format,"LITERALOUTPUT",strlen(e->format))==0) 1303 nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData"); 1304 else 1305 if(strncasecmp(e->format,"COMPLEXOUTPUT",strlen(e->format))==0) 1306 nc3=xmlNewNode(ns_wps, BAD_CAST "ComplexData"); 1319 if(e!=NULL){ 1320 if(strncasecmp(e->format,"LITERALOUTPUT",strlen(e->format))==0) 1321 nc3=xmlNewNode(ns_wps, BAD_CAST "LiteralData"); 1307 1322 else 1308 nc3=xmlNewNode(ns_wps, BAD_CAST e->format); 1323 if(strncasecmp(e->format,"COMPLEXOUTPUT",strlen(e->format))==0) 1324 nc3=xmlNewNode(ns_wps, BAD_CAST "ComplexData"); 1325 else 1326 nc3=xmlNewNode(ns_wps, BAD_CAST e->format); 1327 } 1328 else{ 1329 map* tmpV=getMapFromMaps(m,"format","value"); 1330 if(tmpV!=NULL) 1331 nc3=xmlNewNode(ns_wps, BAD_CAST tmpV->value); 1332 else 1333 nc3=xmlNewNode(ns_wps, BAD_CAST "LitteralData"); 1334 } 1309 1335 tmp=m->content; 1310 1336 while(tmp!=NULL){ … … 1314 1340 strncasecmp(tmp->name,"status",strlen(tmp->name))!=0 && 1315 1341 strncasecmp(tmp->name,"storeExecuteResponse",strlen(tmp->name))!=0 && 1316 strncasecmp(tmp->name,"extension",strlen(tmp->name))!=0) 1342 strncasecmp(tmp->name,"extension",strlen(tmp->name))!=0 && 1343 strncasecmp(tmp->name,"format",strlen(tmp->name))!=0 && 1344 strncasecmp(tmp->name,"Title",strlen(tmp->name))!=0 && 1345 strncasecmp(tmp->name,"Abstract",strlen(tmp->name))!=0 && 1346 strncasecmp(tmp->name,"size",strlen(tmp->name))!=0) 1317 1347 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value); 1318 1348 tmp=tmp->next; 1319 1349 xmlAddChild(nc2,nc3); 1320 1350 } 1321 tmp=getMap(e->defaults->content,"mimeType"); 1351 if(e!=NULL) 1352 tmp=getMap(e->defaults->content,"mimeType"); 1353 else 1354 tmp=NULL; 1322 1355 map* tmp1=getMap(m->content,"encoding"); 1323 1356 map* tmp2=getMap(m->content,"mimeType"); … … 1357 1390 while(tmp!=NULL){ 1358 1391 if(strncasecmp(tmp->name,"value",strlen(tmp->name))!=0 && 1359 strncasecmp(tmp->name,"reference",strlen(tmp->name))!=0 &&1360 1392 strncasecmp(tmp->name,"extension",strlen(tmp->name))!=0 && 1361 strncasecmp(tmp->name,"a bstract",strlen(tmp->name))!=0 &&1393 strncasecmp(tmp->name,"asReference",strlen(tmp->name))!=0 && 1362 1394 strncasecmp(tmp->name,"status",strlen(tmp->name))!=0 && 1363 1395 strncasecmp(tmp->name,"storeExecuteResponse",strlen(tmp->name))!=0 && 1364 strncasecmp(tmp->name,"asReference",strlen(tmp->name))!=0) 1396 strncasecmp(tmp->name,"extension",strlen(tmp->name))!=0 && 1397 strncasecmp(tmp->name,"format",strlen(tmp->name))!=0 && 1398 strncasecmp(tmp->name,"Title",strlen(tmp->name))!=0 && 1399 strncasecmp(tmp->name,"Abstract",strlen(tmp->name))!=0 && 1400 strncasecmp(tmp->name,"size",strlen(tmp->name))!=0) 1365 1401 xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value); 1366 1402 tmp=tmp->next;
Note: See TracChangeset
for help on using the changeset viewer.