Index: trunk/zoo-project/zoo-kernel/service_internal.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal.c	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal.c	(revision 580)
@@ -641,44 +641,4 @@
   }
   return (char*)"-1";
-}
-
-#endif
-
-#ifdef USE_JS
-
-JSBool
-JSUpdateStatus(JSContext *cx, uintN argc, jsval *argv1)
-{
-  jsval *argv = JS_ARGV(cx,argv1);
-  JS_MaybeGC(cx);
-  int istatus=0;
-  char *status=NULL;
-  maps *conf;
-  if(argc>2){
-#ifdef JS_DEBUG
-    fprintf(stderr,"Number of arguments used to call the function : %i",argc);
-#endif
-    return JS_FALSE;
-  }
-  conf=mapsFromJSObject(cx,argv[0]);
-  if(JS_ValueToInt32(cx,argv[1],&istatus)==JS_TRUE){
-    char tmpStatus[4];
-    sprintf(tmpStatus,"%i",istatus);
-    tmpStatus[3]=0;
-    status=strdup(tmpStatus);
-  }
-  if(getMapFromMaps(conf,"lenv","status")!=NULL){
-    if(status!=NULL){
-      setMapInMaps(conf,"lenv","status",status);
-      free(status);
-    }
-    else
-      setMapInMaps(conf,"lenv","status","15");
-    _updateStatus(conf);
-  }
-  freeMaps(&conf);
-  free(conf);
-  JS_MaybeGC(cx);
-  return JS_TRUE;
 }
 
Index: trunk/zoo-project/zoo-kernel/service_internal.h
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal.h	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal.h	(revision 580)
@@ -168,6 +168,4 @@
 
 #ifdef USE_JS
-  char* JSValToChar(JSContext*,jsval*);
-  JSBool JSUpdateStatus(JSContext*,uintN,jsval *);
 #endif
   
Index: trunk/zoo-project/zoo-kernel/service_internal_java.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_java.c	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal_java.c	(revision 580)
@@ -1,3 +1,3 @@
-/**
+/*
  * Author : Gérald FENOY
  *
@@ -25,4 +25,14 @@
 #include "service_internal_java.h"
 
+/**
+ * Load a JAVA class then run the static public method corresponding to the 
+ * service by passing the conf, inputs and outputs parameters by reference.
+ *
+ * @param main_conf the conf maps containing the main.cfg settings
+ * @param request the map containing the HTTP request
+ * @param s the service structure
+ * @param real_inputs the maps containing the inputs
+ * @param real_outputs the maps containing the outputs
+ */
 int zoo_java_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){
   maps* m=*main_conf;
@@ -249,4 +259,7 @@
 /**
  * Error handling: display stack trace in an ExceptionReport Document
+ *
+ * @param env the JNI environment pointer
+ * @param main_conf the conf maps containing the main.cfg settings
  */
 void displayStack(JNIEnv *env,maps* main_conf){
@@ -287,4 +300,14 @@
 }
 
+/**
+ * Create a string containing the JVM -XX:* option for a given map
+ * Depending on the map' name:
+ *  - in case the value is minus then the reult will be : -XX:-name
+ *  - in case the value is plus then the reult will be : -XX:+name
+ *  - in other cases the reult will be : -XX:name=value
+ *
+ * @param m the map containing the option
+ * @return a char* containing the valide JVM option (-XX:*)
+ */
 char *parseJVMXXOption(map* m){
   char *res=(char*)malloc((strlen(m->name)+strlen(m->value)+5)*sizeof(char));
@@ -298,4 +321,11 @@
 }
 
+/**
+ * Create a string containing the JVM -X*:* option for a given map.
+ * The reult will be in the following format: -Xname:value
+ *
+ * @param m the map containing the option
+ * @return a char* containing the valide JVM option (-XX:*)
+ */
 char *parseJVMXOption(map* m){
   char *res=(char*)malloc((strlen(m->name)+strlen(m->value)+5)*sizeof(char));
@@ -304,4 +334,15 @@
 }
 
+/**
+ * Convert a maps to a JAVA HashMap<String,HashMap<String,String>>
+ *
+ * @param env the JNI environment pointer
+ * @param t the maps to convert
+ * @param scHashMapClass the HashMap class
+ * @param scHashMap_class the HashMap class
+ * @param scHashMap_constructor the pointer to the hashMap constructor method
+ * @return a created JAVA HashMap containing the converted maps
+ * @warning make sure to free ressources returned by this function
+ */
 jobject HashMap_FromMaps(JNIEnv *env,maps* t,jclass scHashMapClass,jclass scHashMap_class,jmethodID scHashMap_constructor){
   jobject scObject,scObject1;
@@ -439,4 +480,13 @@
 }
 
+/**
+ * Convert a JAVA HashMap<String,HashMap<String,String>> to a maps
+ *
+ * @param env the JNI environment pointer
+ * @param t the HashMap 
+ * @param scHashMapClass the hashMap class
+ * @return a created maps containing the converted HashMap
+ * @warning make sure to free ressources returned by this function
+ */
 maps* mapsFromHashMap(JNIEnv *env,jobject t,jclass scHashMapClass){
 #ifdef DEBUG
Index: trunk/zoo-project/zoo-kernel/service_internal_java.h
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_java.h	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal_java.h	(revision 580)
@@ -1,3 +1,3 @@
-/**
+/*
  * Author : Gérald FENOY
  *
Index: trunk/zoo-project/zoo-kernel/service_internal_js.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_js.c	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal_js.c	(revision 580)
@@ -1,3 +1,3 @@
-/**
+/*
  * Author : Gérald FENOY
  *
@@ -31,4 +31,12 @@
 static char dbg[1024];
 
+/**
+ * The function used as alert from the JavaScript environment (ZOO-API)
+ *
+ * @param cx the JavaScript context
+ * @param argc the number of parameters
+ * @param argv1 the parameter values
+ * @return true
+ */
 JSBool
 JSAlert(JSContext *cx, uintN argc, jsval *argv1)
@@ -48,4 +56,12 @@
 }
 
+/**
+ * The function used as importScript from the JavaScript environment (ZOO-API)
+ * 
+ * @param cx the JavaScript context
+ * @param argc the number of parameters
+ * @param argv1 the parameter values
+ * @return true
+ */
 JSBool 
 JSLoadScripts(JSContext *cx, uintN argc, jsval *argv1)
@@ -79,7 +95,18 @@
 }
 
-
-int zoo_js_support(maps** main_conf,map* request,service* s,
-		   maps **inputs,maps **outputs)
+/**
+ * Load a JavaScript file then run the function corresponding to the service by
+ * passing the conf, inputs and outputs parameters by value as JavaScript
+ * Objects.
+ *
+ * @param main_conf the conf maps containing the main.cfg settings
+ * @param request the map containing the HTTP request
+ * @param s the service structure
+ * @param inputs the maps containing the inputs
+ * @param outputs the maps containing the outputs
+ * @return ZOO_SERVICE_SUCCEEDED or ZOO_SERVICE_FAILED if the service run, -1 
+ *  if the service failed to load or throw error at runtime.
+ */
+int zoo_js_support(maps** main_conf,map* request,service* s,maps **inputs,maps **outputs)
 {
   maps* main=*main_conf;
@@ -355,4 +382,12 @@
 }
 
+/**
+ * Load a JavaScript file
+ *
+ * @param cx the JavaScript context
+ * @param globale the global JavaScript object (not used)
+ * @param filename the file name to load
+ * @return a JavaScript Object on success, NULL if an errro occured
+ */
 JSObject * loadZooApiFile(JSContext *cx,JSObject  *global, char* filename){
   struct stat api_status;
@@ -381,6 +416,12 @@
 }
 
+/**
+ * Convert a maps to a JavaScript Object
+ *
+ * @param cx the JavaScript context
+ * @param t the maps to convert
+ * @return a new JavaScript Object
+ */
 JSObject* JSObject_FromMaps(JSContext *cx,maps* t){
-
   JSObject* res=JS_NewObject(cx, NULL, NULL, NULL);
   //JSObject *res = JS_NewArrayObject(cx, 0, NULL);
@@ -402,4 +443,11 @@
 }
 
+/**
+ * Convert a map to a JavaScript Object
+ *
+ * @param cx the JavaScript context
+ * @param t the map to convert
+ * @return a new JavaScript Object
+ */
 JSObject* JSObject_FromMap(JSContext *cx,map* t){
   JSObject* res=JS_NewObject(cx, NULL, NULL, NULL);
@@ -454,4 +502,11 @@
 }
 
+/**
+ * Convert a JavaScript Object to a maps
+ *
+ * @param cx the JavaScript context
+ * @param t the JavaScript Object to convert
+ * @return a new maps containing the JavaScript Object
+ */
 maps* mapsFromJSObject(JSContext *cx,jsval t){
   maps *res=NULL;
@@ -629,4 +684,11 @@
 }
 
+/**
+ * Convert a JavaScript Object to a map
+ *
+ * @param cx the JavaScript context
+ * @param t the JavaScript Object to convert
+ * @return a new map containing the JavaScript Object
+ */
 map* mapFromJSObject(JSContext *cx,jsval t){
   map *res=NULL;
@@ -684,5 +746,11 @@
 }
 
-/* The error reporter callback. */
+/**
+ * Print debug information messages on stderr
+ *
+ * @param cx the JavaScript context
+ * @param message the error message
+ * @param report the JavaScript Error Report
+ */
 void reportError(JSContext *cx, const char *message, JSErrorReport *report)
 {
@@ -697,4 +765,12 @@
 }
 
+/**
+ * Convert a JavaScript value to a char*
+ *
+ * @param context the JavaScript context
+ * @param arg the JavaScript value
+ * @return a new char*
+ * @warning be sure to free the ressources returned by this function
+ */
 char* JSValToChar(JSContext* context, jsval* arg) {
   char *c;
@@ -724,4 +800,12 @@
 }
 
+/**
+ * Set the HTTP header of a request
+ *
+ * @param handle the HINTERNET handle
+ * @param cx the JavaScript context
+ * @param header the JavaScript Array containing the headers to send
+ * @return the HINTERNET handle
+ */
 HINTERNET setHeader(HINTERNET* handle,JSContext *cx,JSObject *header){
   jsuint length=0;
@@ -758,4 +842,14 @@
 }
 
+/**
+ * The function used as ZOOTranslate from the JavaScript environment.
+ * Use the ZOO-Services messages translation function from the Python
+ * environment (ZOO-API)
+ *
+ * @param cx the JavaScript context
+ * @param argc the number of parameters
+ * @param argv1 the parameter values
+ * @return true
+ */
 JSBool
 JSTranslate(JSContext *cx, uintN argc, jsval *argv1)
@@ -769,4 +863,13 @@
 }
 
+/**
+ * The function used as ZOORequest from the JavaScript environment (ZOO-API)
+ *
+ * @param cx the JavaScript context
+ * @param argc the number of parameters
+ * @param argv1 the parameter values
+ * @return true
+ * @see setHeader
+ */
 JSBool
 JSRequest(JSContext *cx, uintN argc, jsval *argv1)
@@ -847,2 +950,49 @@
   return JS_TRUE;
 }
+
+/**
+ * The function used as ZOOUpdateStatus from the JavaScript environment
+ * (ZOO-API).
+ *
+ * @param cx the JavaScript context
+ * @param argc the number of parameters
+ * @param argv1 the parameter values
+ * @return true
+ * @see setHeader
+ */
+JSBool
+JSUpdateStatus(JSContext *cx, uintN argc, jsval *argv1)
+{
+  jsval *argv = JS_ARGV(cx,argv1);
+  JS_MaybeGC(cx);
+  int istatus=0;
+  char *status=NULL;
+  maps *conf;
+  if(argc>2){
+#ifdef JS_DEBUG
+    fprintf(stderr,"Number of arguments used to call the function : %i",argc);
+#endif
+    return JS_FALSE;
+  }
+  conf=mapsFromJSObject(cx,argv[0]);
+  if(JS_ValueToInt32(cx,argv[1],&istatus)==JS_TRUE){
+    char tmpStatus[4];
+    sprintf(tmpStatus,"%i",istatus);
+    tmpStatus[3]=0;
+    status=strdup(tmpStatus);
+  }
+  if(getMapFromMaps(conf,"lenv","status")!=NULL){
+    if(status!=NULL){
+      setMapInMaps(conf,"lenv","status",status);
+      free(status);
+    }
+    else
+      setMapInMaps(conf,"lenv","status","15");
+    _updateStatus(conf);
+  }
+  freeMaps(&conf);
+  free(conf);
+  JS_MaybeGC(cx);
+  return JS_TRUE;
+}
+
Index: trunk/zoo-project/zoo-kernel/service_internal_js.h
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_js.h	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal_js.h	(revision 580)
@@ -1,3 +1,3 @@
-/**
+/*
  * Author : Gérald FENOY
  *
@@ -48,4 +48,5 @@
   JSBool JSTranslate(JSContext*, uintN, jsval*);
   JSBool JSRequest(JSContext*, uintN, jsval*);
+  JSBool JSUpdateStatus(JSContext*,uintN,jsval *);
 
   void reportError(JSContext *cx, const char *message, JSErrorReport *report);
Index: trunk/zoo-project/zoo-kernel/service_internal_otb.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_otb.c	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal_otb.c	(revision 580)
@@ -1,3 +1,3 @@
-/**
+/*
  * Author : Gérald FENOY
  *
@@ -31,7 +31,16 @@
 using namespace otb::Wrapper;
 
+/**
+ * The ZooWatcher list
+ */
 WatcherListType m_WatcherList;
+/**
+ * A pointer to the conf maps containing the main.cfg settings
+ */
 maps* m_Conf;
 
+/**
+ * The command to create a ZooWatcher and add it to the global m_WatcherList
+ */
 class MyCommand : public itk::Command
 {
@@ -40,4 +49,10 @@
  public:
 
+  /**
+   * The method that defines the action to be taken by the command. 
+   *
+   * @param caller an itk::Object pointer
+   * @param event an itk::EventObject pointer
+   */
   void Execute(itk::Object *caller, const itk::EventObject & event)
   {
@@ -45,9 +60,16 @@
   }
  
-  void Execute(const itk::Object * object, const itk::EventObject & event)
+  /**
+   * The method that defines the action to be taken by the command. 
+   * Create a new ZooWatcher instance then add it to the m_WatcherList.
+   *
+   * @param caller a const itk::Object pointer
+   * @param event an itk::EventObject pointer
+   * @see ZooWatcher,ZooWatcher::SetConf
+   */
+  void Execute(const itk::Object *caller, const itk::EventObject & event)
   {
     const AddProcessToWatchEvent* eventToWatch = dynamic_cast< const AddProcessToWatchEvent*> ( &event );
     std::string m_CurrentDescription = eventToWatch->GetProcessDescription();
-    std::cerr << "err_service_zooo start ccalled." << m_CurrentDescription << std::endl;
     ZooWatcher * watch = new ZooWatcher(eventToWatch->GetProcess(),
 					eventToWatch->GetProcessDescription());
@@ -56,9 +78,14 @@
   }
 
-
-
 };
 
-
+/**
+ * Replace all occurence of from by to in a str string
+ *
+ * @param str the string to transform
+ * @param from the string to replace
+ * @param to the string used as replacement
+ * @return the resulting string 
+ */
 std::string ReplaceAll(std::string str, const std::string& from, const std::string& to) {
     size_t start_pos = 0;
@@ -70,4 +97,14 @@
 }
 
+/**
+ * Load and run an OTB Application corresponding to the service by using inputs parameters.
+ * Define the m_Conf 
+ *
+ * @param main_conf the conf maps containing the main.cfg settings
+ * @param request the map containing the HTTP request
+ * @param s the service structure
+ * @param real_inputs the maps containing the inputs
+ * @param real_outputs the maps containing the outputs
+ */
 int zoo_otb_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){
   maps* m=*main_conf;
Index: trunk/zoo-project/zoo-kernel/service_internal_otb.h
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_otb.h	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal_otb.h	(revision 580)
@@ -1,3 +1,3 @@
-/**
+/*
  * Author : Gérald FENOY
  *
@@ -43,5 +43,9 @@
 #include <string>
 
+/**
+ * A vector to store the ZooWatcher
+ */
 typedef std::vector<ZooWatcher *> WatcherListType;
+
 int zoo_otb_support(maps**,map*,service*,maps**,maps**);
 
Index: trunk/zoo-project/zoo-kernel/service_internal_php.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_php.c	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal_php.c	(revision 580)
@@ -1,3 +1,3 @@
-/**
+/*
  * Author : Gérald FENOY
  *
@@ -41,4 +41,14 @@
 map* php_map_from_HasTable(HashTable* t);
 
+/**
+ * Load a PHP script then run the function corresponding to the service by
+ * passing the conf, inputs and outputs parameters by reference.
+ *
+ * @param main_conf the conf maps containing the main.cfg settings
+ * @param request the map containing the HTTP request
+ * @param s the service structure
+ * @param real_inputs the maps containing the inputs
+ * @param real_outputs the maps containing the outputs
+ */
 int zoo_php_support(maps** main_conf,map* request,service* s,maps **real_inputs,maps **real_outputs){	
   maps* m=*main_conf;
@@ -101,4 +111,10 @@
 }
 
+/**
+ * Convert a maps to a php Array
+ *
+ * @param t the maps to convert
+ * @return the php Array
+ */
 zval *php_Array_from_maps(maps* t){
   zval *mapArray;
@@ -115,4 +131,10 @@
 }
 
+/**
+ * Convert a map to a php Array
+ *
+ * @param t the map to convert
+ * @return the php Array
+ */
 zval *php_Array_from_map(map* t){
   zval *mapArray;
@@ -135,4 +157,10 @@
 }
 
+/**
+ * Convert a php Array to a maps
+ *
+ * @param t the php Array to convert
+ * @return the created maps
+ */
 maps* php_maps_from_Array(HashTable *t){
   maps* final_res=NULL;
@@ -201,4 +229,10 @@
 }
 
+/**
+ * Convert a php Array to a map
+ *
+ * @param t the php Array to convert
+ * @return the created map
+ */
 map* php_map_from_HasTable(HashTable* t){
 #ifdef DEBUG
Index: trunk/zoo-project/zoo-kernel/service_internal_php.h
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_php.h	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal_php.h	(revision 580)
@@ -1,3 +1,3 @@
-/**
+/*
  * Author : Gérald FENOY
  *
Index: trunk/zoo-project/zoo-kernel/service_internal_python.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_internal_python.c	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_internal_python.c	(revision 580)
@@ -136,5 +136,5 @@
 
 /**
- * Loading a Python module then run the function corresponding to the service
+ * Load a Python module then run the function corresponding to the service
  * by passing the conf, inputs and outputs parameters by reference. 
  *
@@ -302,5 +302,5 @@
 
 /**
- * Repport Python error which may occur on loading the Python module or at 
+ * Report Python error which may occur on loading the Python module or at 
  * runtime.
  * 
@@ -608,5 +608,5 @@
 
 /**
- * Use the ZOO-Services messages translation function  from the Python
+ * Use the ZOO-Services messages translation function from the Python
  * environment
  *
Index: trunk/zoo-project/zoo-kernel/service_yaml.c
===================================================================
--- trunk/zoo-project/zoo-kernel/service_yaml.c	(revision 579)
+++ trunk/zoo-project/zoo-kernel/service_yaml.c	(revision 580)
@@ -1,3 +1,3 @@
-/**
+/*
  * Author : Gérald FENOY
  *
@@ -31,15 +31,18 @@
 static map* current_content=NULL;
 static elements* current_element=NULL;
-static char* curr_key;
-
-/**
- * getServiceFromFile :
- * set service given as second parameter with informations extracted from the
- * definition file.
- */
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+/**
+ * Read and parse a ZCFG file in YAML format 
+ *
+ * @param conf the conf maps containing the main.cfg settings
+ * @param file the file name to read
+ * @param service the service structure to fill
+ * @param name the service name
+ * @return 1 on success, -1 if error occured
+ */
 int getServiceFromYAML(maps* conf, char* file,service** service,char *name){
   FILE *fh = fopen("test.yml", "r");
