Changeset 986 for trunk/zoo-project/zoo-kernel/service_json.c
- Timestamp:
- Mar 9, 2021, 4:50:02 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_json.c
r985 r986 533 533 json_object *res3=json_object_new_object(); 534 534 map* pmTmp=getMapFromMaps(m,"lenv","requestType"); 535 if(pmTmp!=NULL && strncasecmp(pmTmp->value,"desc",4)==0) 535 if(pmTmp!=NULL && strncasecmp(pmTmp->value,"desc",4)==0){ 536 536 json_object_object_add(res2,"rel",json_object_new_string("process-desc")); 537 } 537 538 else{ 538 539 json_object_object_add(res2,"rel",json_object_new_string("execute")); 539 json_object_object_add(res3,"rel",json_object_new_string("alternate")); 540 json_object_object_add(res3,"type",json_object_new_string("text/html"));541 }540 } 541 json_object_object_add(res3,"rel",json_object_new_string("alternate")); 542 json_object_object_add(res3,"type",json_object_new_string("text/html")); 542 543 json_object_object_add(res2,"type",json_object_new_string("application/json")); 543 json_object_object_add(res2,"title",json_object_new_string("Process Description"));544 544 map* tmpUrl=getMapFromMaps(m,"openapi","rootUrl"); 545 545 char* tmpStr=(char*) malloc((strlen(tmpUrl->value)+strlen(rUrl)+13)*sizeof(char)); 546 sprintf(tmpStr,"%s/processes/%s /",tmpUrl->value,rUrl);547 if( doc==NULL){546 sprintf(tmpStr,"%s/processes/%s",tmpUrl->value,rUrl); 547 if(pmTmp!=NULL && strncasecmp(pmTmp->value,"desc",4)!=0){ 548 548 json_object_object_add(res2,"title",json_object_new_string("Execute End Point")); 549 549 json_object_object_add(res3,"title",json_object_new_string("Execute End Point")); 550 char* tmpStr1=zStrdup(tmpStr);550 /*char* tmpStr1=zStrdup(tmpStr); 551 551 tmpStr=(char*) realloc(tmpStr,(strlen(tmpStr)+6)*sizeof(char)); 552 552 sprintf(tmpStr,"%sjobs",tmpStr1); 553 free(tmpStr1); 554 char* tmpStr3=(char*) malloc((strlen(tmpStr)+6)*sizeof(char)); 555 sprintf(tmpStr3,"%s.html",tmpStr); 556 json_object_object_add(res3,"href",json_object_new_string(tmpStr3)); 557 free(tmpStr3); 558 } 553 free(tmpStr1);*/ 554 }else{ 555 json_object_object_add(res2,"title",json_object_new_string("Process Description")); 556 json_object_object_add(res3,"title",json_object_new_string("Process Description")); 557 } 558 char* tmpStr3=(char*) malloc((strlen(tmpStr)+6)*sizeof(char)); 559 sprintf(tmpStr3,"%s.html",tmpStr); 560 json_object_object_add(res3,"href",json_object_new_string(tmpStr3)); 561 free(tmpStr3); 559 562 json_object_object_add(res2,"href",json_object_new_string(tmpStr)); 560 563 free(tmpStr);
Note: See TracChangeset
for help on using the changeset viewer.