Index: /trunk/zoo-project/zoo-kernel/Makefile.in
===================================================================
--- /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 672)
+++ /trunk/zoo-project/zoo-kernel/Makefile.in	(revision 673)
@@ -46,5 +46,5 @@
 
 response_print.o: response_print.c response_print.h
-	g++ -fPIC ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c response_print.c
+	g++ -fPIC ${GDAL_CFLAGS} ${XML2CFLAGS} ${CFLAGS} ${JSCFLAGS} ${JS_ENABLED} -c response_print.c
 
 server_internal.o: server_internal.c server_internal.h service.h mimetypes.h
Index: /trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in
===================================================================
--- /trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in	(revision 672)
+++ /trunk/zoo-project/zoo-kernel/ZOOMakefile.opts.in	(revision 673)
@@ -94,4 +94,4 @@
 
 CFLAGS=@RELY_ON_DB@ @DEB_DEF@ -fpic ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
-LDFLAGS=-lzoo_service -lcurl -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS}
+LDFLAGS=-lzoo_service @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS}  ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} -lfcgi -lcrypto -luuid ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS}
 
Index: /trunk/zoo-project/zoo-kernel/configure.ac
===================================================================
--- /trunk/zoo-project/zoo-kernel/configure.ac	(revision 672)
+++ /trunk/zoo-project/zoo-kernel/configure.ac	(revision 673)
@@ -10,9 +10,13 @@
 # Checks for libraries.
 AC_CHECK_LIB([cgic], [cgiMain])
-AC_CHECK_LIB([curl], [curl_easy_init curl_easy_setopt curl_easy_cleanup curl_easy_perform])
-AC_CHECK_LIB([dl], [dlopen dlsym dlerror dlclose])
+AC_CHECK_LIB([curl], [curl_easy_init,curl_easy_setopt,curl_easy_cleanup,curl_easy_perform])
+AC_CHECK_LIB([dl], [dlopen,dlsym,dlerror,dlclose])
 AC_CHECK_LIB([fl], [main])
 AC_CHECK_LIB([pthread], [main])
 AC_CHECK_LIB([ssl], [main])
+
+DEFAULT_LIBS="$LIBS"
+AC_SUBST([DEFAULT_LIBS])
+
 
 # Checks for header files.
Index: /trunk/zoo-project/zoo-kernel/main.cfg
===================================================================
--- /trunk/zoo-project/zoo-kernel/main.cfg	(revision 672)
+++ /trunk/zoo-project/zoo-kernel/main.cfg	(revision 673)
@@ -8,4 +8,5 @@
 dataPath = /tmp/
 cacheDir = /tmp/
+
 
 [identification]
Index: /trunk/zoo-project/zoo-kernel/response_print.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/response_print.c	(revision 672)
+++ /trunk/zoo-project/zoo-kernel/response_print.c	(revision 673)
@@ -451,5 +451,4 @@
 	    xmlAddChild(nc,nc2);
 	    nc2 = xmlNewNode(ns_ows, BAD_CAST "ServiceTypeVersion");
-	    dumpMaps(m);
 	    map* tmpv=getMapFromMaps(m,"main","rversion");
 	    xmlAddChild(nc2,xmlNewText(BAD_CAST tmpv->value));
@@ -1914,9 +1913,18 @@
 	 strcasecmp(tmp->name,"datatype")==0 ||
 	 strcasecmp(tmp->name,"uom")==0) {
-
-	xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value);
-      }
+	
+	if(vid==0)
+	  xmlNewProp(nc3,BAD_CAST tmp->name,BAD_CAST tmp->value);
+	else{
+	  if(strcasecmp(tmp->name,"datatype")==0)
+	    xmlNewProp(nc2,BAD_CAST "mimeType",BAD_CAST "text/plain");
+	  else
+	    if(strcasecmp(tmp->name,"uom")!=0)
+	      xmlNewProp(nc2,BAD_CAST tmp->name,BAD_CAST tmp->value);
+	}
+      }
+      if(vid==0)
+	xmlAddChild(nc2,nc3);
       tmp=tmp->next;
-      xmlAddChild(nc2,nc3);
     }
     if(e!=NULL && e->format!=NULL && strcasecmp(e->format,"BoundingBoxData")==0) {
@@ -1970,12 +1978,12 @@
 	}
 	 
-	xmlAddChild(nc3,xmlNewText(BAD_CAST base64(tmp3->value, atoi(rs->value))));  // base 64 encode in XML
+	xmlAddChild((vid==0?nc3:nc2),xmlNewText(BAD_CAST base64(tmp3->value, atoi(rs->value))));  // base 64 encode in XML
 		
 	if(tmp1==NULL || (tmp1!=NULL && strncmp(tmp1->value,"base64",6)!=0)) {
-	  xmlAttrPtr ap = xmlHasProp(nc3, BAD_CAST "encoding");
+	  xmlAttrPtr ap = xmlHasProp((vid==0?nc3:nc2), BAD_CAST "encoding");
 	  if (ap != NULL) {
 	    xmlRemoveProp(ap);
 	  }			
-	  xmlNewProp(nc3,BAD_CAST "encoding",BAD_CAST "base64");
+	  xmlNewProp((vid==0?nc3:nc2),BAD_CAST "encoding",BAD_CAST "base64");
 	}
 		
@@ -1990,5 +1998,5 @@
 	   strstr(tmp2->value, "ecmascript") != NULL
 	   ) {
-	  xmlAddChild(nc3,xmlNewCDataBlock(doc,BAD_CAST tmp3->value,strlen(tmp3->value)));
+	  xmlAddChild((vid==0?nc3:nc2),xmlNewCDataBlock(doc,BAD_CAST tmp3->value,strlen(tmp3->value)));
 	}   
 	else {                                                     // else
@@ -2002,13 +2010,13 @@
 	    xmlDocPtr doc = iDocs[li];
 	    xmlNodePtr ir = xmlDocGetRootElement(doc);
-	    xmlAddChild(nc3,ir);
+	    xmlAddChild((vid==0?nc3:nc2),ir);
 	  }
 	  else                                                     // else	
-	    xmlAddChild(nc3,xmlNewText(BAD_CAST tmp3->value));    //   add text node
+	    xmlAddChild((vid==0?nc3:nc2),xmlNewText(BAD_CAST tmp3->value));    //   add text node
 	}
 	xmlAddChild(nc2,nc3);
       }
       else {
-	xmlAddChild(nc3,xmlNewText(BAD_CAST tmp3->value));
+	xmlAddChild((vid==0?nc3:nc2),xmlNewText(BAD_CAST tmp3->value));
       }
 	  
Index: /trunk/zoo-project/zoo-kernel/zoo_service_loader.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 672)
+++ /trunk/zoo-project/zoo-kernel/zoo_service_loader.c	(revision 673)
@@ -206,78 +206,71 @@
 createRegistry (maps* m,registry ** r, char *reg_dir, int saved_stdout)
 {
-  struct dirent *dp;
-  int scount = 0;
-
+  char registryKeys[3][15]={
+    "concept",
+    "generic",
+    "implementation"
+  };
+  int scount = 0,i=0;
   if (reg_dir == NULL)
     return 0;
-  DIR *dirp = opendir (reg_dir);
-  if (dirp == NULL)
-    {
-      return -1;
-    }
-  while ((dp = readdir (dirp)) != NULL){
-    if ((dp->d_type == DT_DIR || dp->d_type == DT_LNK) && dp->d_name[0] != '.')
-      {
-
-        char * tmpName =
-          (char *) malloc ((strlen (reg_dir) + strlen (dp->d_name) + 2) *
-                           sizeof (char));
-        sprintf (tmpName, "%s/%s", reg_dir, dp->d_name);
-	
-	DIR *dirp1 = opendir (tmpName);
-	struct dirent *dp1;
-	while ((dp1 = readdir (dirp1)) != NULL){
-	  char* extn = strstr(dp1->d_name, ".zcfg");
-	  if(dp1->d_name[0] != '.' && extn != NULL && strlen(extn) == 5)
+  for(i=0;i<3;i++){
+    char * tmpName =
+      (char *) malloc ((strlen (reg_dir) + strlen (registryKeys[i]) + 2) *
+		       sizeof (char));
+    sprintf (tmpName, "%s/%s", reg_dir, registryKeys[i]);
+    
+    DIR *dirp1 = opendir (tmpName);
+    struct dirent *dp1;
+    while ((dp1 = readdir (dirp1)) != NULL){
+      char* extn = strstr(dp1->d_name, ".zcfg");
+      if(dp1->d_name[0] != '.' && extn != NULL && strlen(extn) == 5)
+	{
+	  int t;
+	  char *tmps1=
+	    (char *) malloc ((strlen (tmpName) + strlen (dp1->d_name) + 2) *
+			     sizeof (char));
+	  sprintf (tmps1, "%s/%s", tmpName, dp1->d_name);
+	  char *tmpsn = zStrdup (dp1->d_name);
+	  tmpsn[strlen (tmpsn) - 5] = 0;
+	  service* s1 = (service *) malloc (SERVICE_SIZE);
+	  if (s1 == NULL)
 	    {
-	      int t;
-	      char *tmps1=
-		(char *) malloc ((strlen (tmpName) + strlen (dp1->d_name) + 2) *
-				 sizeof (char));
-	      sprintf (tmps1, "%s/%s", tmpName, dp1->d_name);
-	      char *tmpsn = zStrdup (dp1->d_name);
-	      tmpsn[strlen (tmpsn) - 5] = 0;
-	      service* s1 = (service *) malloc (SERVICE_SIZE);
-	      if (s1 == NULL)
-		{
-		  dup2 (saved_stdout, fileno (stdout));
-		  errorException (m, _("Unable to allocate memory."),
-				  "InternalError", NULL);
-		  return -1;
-		}
-	      t = readServiceFile (m, tmps1, &s1, tmpsn);
-	      free (tmpsn);
-	      if (t < 0)
-		{
-		  map *tmp00 = getMapFromMaps (m, "lenv", "message");
-		  char tmp01[1024];
-		  if (tmp00 != NULL)
-		    sprintf (tmp01, _("Unable to parse the ZCFG file: %s (%s)"),
-			     dp1->d_name, tmp00->value);
-		  else
-		    sprintf (tmp01, _("Unable to parse the ZCFG file: %s."),
-			     dp1->d_name);
-		  dup2 (saved_stdout, fileno (stdout));
-		  errorException (m, tmp01, "InternalError", NULL);
-		  return -1;
-		}
-#ifdef DEBUG
-	      dumpService (s1);
-	      fflush (stdout);
-	      fflush (stderr);
-#endif
-	      if(strncasecmp(dp->d_name,"implementation",14)==0){
-		inheritance(*r,&s1);
-	      }
-	      addServiceToRegistry(r,dp->d_name,s1);
-	      freeService (&s1);
-	      free (s1);
-	      scount++;
+	      dup2 (saved_stdout, fileno (stdout));
+	      errorException (m, _("Unable to allocate memory."),
+			      "InternalError", NULL);
+	      return -1;
 	    }
+	  t = readServiceFile (m, tmps1, &s1, tmpsn);
+	  free (tmpsn);
+	  if (t < 0)
+	    {
+	      map *tmp00 = getMapFromMaps (m, "lenv", "message");
+	      char tmp01[1024];
+	      if (tmp00 != NULL)
+		sprintf (tmp01, _("Unable to parse the ZCFG file: %s (%s)"),
+			 dp1->d_name, tmp00->value);
+	      else
+		sprintf (tmp01, _("Unable to parse the ZCFG file: %s."),
+			 dp1->d_name);
+	      dup2 (saved_stdout, fileno (stdout));
+	      errorException (m, tmp01, "InternalError", NULL);
+	      return -1;
+	    }
+#ifdef DEBUG
+	  dumpService (s1);
+	  fflush (stdout);
+	  fflush (stderr);
+#endif
+	  if(strncasecmp(registryKeys[i],"implementation",14)==0){
+	    inheritance(*r,&s1);
+	  }
+	  addServiceToRegistry(r,registryKeys[i],s1);
+	  freeService (&s1);
+	  free (s1);
+	  scount++;
 	}
-	(void) closedir (dirp1);
-      }
+    }
+    (void) closedir (dirp1);
   }
-  (void) closedir (dirp);
   return 0;
 }
