Changeset 440 for trunk/zoo-project/zoo-services/utils/status
- Timestamp:
- Aug 17, 2013, 3:08:30 PM (11 years ago)
- Location:
- trunk/zoo-project/zoo-services/utils/status
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-services/utils/status/Makefile
r284 r440 4 4 5 5 cgi-env/wps_status.zo: service.c 6 g++ ${CFLAGS} -shared -fpic -o cgi-env/wps_status.zo ./service.c ../../../zoo-kernel/service_internal.o ${ JS_LDFLAGS} ${JSLDFLAGS} ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} `xslt-config --libs` -lfcgi6 g++ ${CFLAGS} -shared -fpic -o cgi-env/wps_status.zo ./service.c ../../../zoo-kernel/service_internal.o ${ZRPATH}/zoo-kernel/${MS_FILE} ${MS_LDFLAGS} ${JS_LDFLAGS} ${JSLDFLAGS} ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} `xslt-config --libs` -lfcgi 7 7 8 8 clean: -
trunk/zoo-project/zoo-services/utils/status/cgi-env/updateStatus.xsl
r32 r440 7 7 <xsl:output method="xml"/> 8 8 <xsl:param name="value" select="string('-1')"/> 9 <xsl:param name="message" select="string('-1')"/> 9 10 10 11 <xsl:template match="@*|node()"> … … 14 15 </xsl:template> 15 16 16 <xsl:template match="/wps:ExecuteResponse/wps:Status/wps:ProcessStarted/@percentCompleted"> 17 <xsl:attribute name="percentCompleted"> 18 <xsl:value-of select="$value"/> 19 </xsl:attribute> 17 <xsl:template match="/wps:ExecuteResponse/wps:Status/wps:ProcessStarted"> 18 <xsl:copy> 19 <xsl:attribute name="percentCompleted"> 20 <xsl:value-of select="$value"/> 21 </xsl:attribute> 22 <xsl:value-of select="$message" /> 23 </xsl:copy> 20 24 </xsl:template> 21 25 -
trunk/zoo-project/zoo-services/utils/status/service.c
r384 r440 55 55 #endif 56 56 int GetStatus(maps*& conf,maps*& inputs,maps*& outputs){ 57 const char *params[ 2+ 1];57 const char *params[4 + 1]; 58 58 int xmlLoadExtDtdDefaultValue; 59 59 map* tmpMap=NULL,*tmpMmap=NULL, *tmpTmap=NULL; 60 60 61 tmpMap=getMapFromMaps(inputs,"sid","value"); 61 62 tmpTmap=getMapFromMaps(conf,"main","tmpPath"); … … 99 100 doc = xmlParseFile(fileName); 100 101 if(cur!=NULL && doc!=NULL){ 101 params[0]="value"; 102 params[1]=getStatus(atoi(tmpMap->value)); 103 params[2]=NULL; 104 res = xsltApplyStylesheet(cur, doc, params); 105 xmlChar *xmlbuff; 106 int buffersize; 107 xmlDocDumpFormatMemory(res, &xmlbuff, &buffersize, 1); 108 setMapInMaps(outputs,"Result","value",(char*)xmlbuff); 109 xmlFree(xmlbuff); 102 /** 103 * Parse Status to extract Status / Message 104 */ 105 char *tmpStr=getStatus(atoi(tmpMap->value)); 106 if(tmpStr!=NULL && strncmp(tmpStr,"-1",2)!=0){ 107 char *tmpStr1=strdup(tmpStr); 108 char *tmpStr0=strdup(strstr(tmpStr,"|")+1); 109 tmpStr1[strlen(tmpStr1)-strlen(tmpStr0)-1]='\0'; 110 char *tmpStrFinal=(char*)malloc((strlen(tmpStr0)+11)*sizeof(char)); 111 sprintf(tmpStrFinal,"string(\"%s\")",tmpStr0); 112 params[0]="value"; 113 params[1]=tmpStr1; 114 params[2]="message"; 115 params[3]=tmpStrFinal; 116 params[4]=NULL; 117 res = xsltApplyStylesheet(cur, doc, params); 118 xmlChar *xmlbuff; 119 int buffersize; 120 xmlDocDumpFormatMemory(res, &xmlbuff, &buffersize, 1); 121 setMapInMaps(outputs,"Result","value",(char*)xmlbuff); 122 xmlFree(xmlbuff); 123 free(tmpStr1); 124 free(tmpStr0); 125 free(tmpStrFinal); 126 }else{ 127 xmlChar *xmlbuff; 128 int buffersize; 129 xmlDocDumpFormatMemory(doc, &xmlbuff, &buffersize, 1); 130 setMapInMaps(outputs,"Result","value",(char*)xmlbuff); 131 xmlFree(xmlbuff); 132 } 110 133 } 111 134 else{ … … 131 154 while(i<100){ 132 155 char tmp[4]; 156 char message[10]; 133 157 sprintf(tmp,"%i",i); 134 158 map* tmpMap=NULL; … … 136 160 if(tmpMap!=NULL) 137 161 fprintf(stderr,"Status %s %s\n",tmpMap->value,tmp); 162 sprintf(message,"Step %d",i); 138 163 setMapInMaps(conf,"lenv","status",tmp); 164 setMapInMaps(conf,"lenv","message",message); 139 165 updateStatus(conf); 140 166 #ifndef WIN32
Note: See TracChangeset
for help on using the changeset viewer.