Index: /branches/bibliolocean/src/genaeres.sh
===================================================================
--- /branches/bibliolocean/src/genaeres.sh	(revision 249)
+++ /branches/bibliolocean/src/genaeres.sh	(revision 250)
@@ -34,4 +34,10 @@
 #
 # $URL$
+#
+# - fplod 20120912T124959Z cratos.locean-ipsl.upmc.fr (Linux)
+#
+#   * homogenize log message with command and LINENO
+#   * get info from aeres subset instead of the whole biblio (ie year limit)
+#   * produce a RTF file by team
 #
 # - fplod 20120706T101813Z cratos (Linux)
@@ -63,5 +69,5 @@
 case "${system}" in
    AIX|IRIX64)
-      echo "${command} : www : no specific posix checking"
+      echo "${command} : ${LINENO} : www : no specific posix checking"
    ;;
    *)
@@ -87,5 +93,5 @@
 if [ ${status} -ne 0 ]
 then
-   echo "${command} : eee : ${tool} unavailable" >&2
+   echo "${command} : ${LINENO} : eee : ${tool} unavailable" >&2
    exit 1
 fi
@@ -99,5 +105,5 @@
 if [ ${status} -ne 0 ]
 then
-   echo "${command} : eee : ${tool} unavailable" >&2
+   echo "${command} : ${LINENO} : eee : ${tool} unavailable" >&2
    exit 1
 fi
@@ -193,5 +199,5 @@
    if [ ${jabref_status} -ne 0 ]
    then
-      echo "${command} : eee : pb with jabref export ${format}"
+      echo "${command} : ${LINENO} : eee : pb with jabref export ${format}"
       exit 1
    fi
@@ -204,8 +210,8 @@
 while [ ${iteam} -le ${nbteam} ]
 do
-    echo "${LINENO} : iii: team = ${list_team_bibtool[${iteam}]}"
+    echo "${command} : ${LINENO} : iii : team = ${list_team_bibtool[${iteam}]}"
     fteam=${tmpdir}/${list_team_title[${iteam}]}.bib
     rm ${fteam} 2> /dev/null
-    bibtool_command="bibtool -- 'select={aeresteam \"${list_team_bibtool[${iteam}]}\"}' ${biblioreffull} -o ${fteam}"
+    bibtool_command="bibtool -- 'select={aeresteam \"${list_team_bibtool[${iteam}]}\"}' ${biblioref} -o ${fteam}"
     eval ${bibtool_command}
     unset bibtool_command
@@ -213,5 +219,5 @@
     if [ ${nbatteam} -ge 2 ]
     then
-        echo "iii : $((${nbatteam} - 1)) ref for aeresteam ${list_team_title[${iteam}]}"
+        echo "${command} : ${LINENO} : iii : $((${nbatteam} - 1)) ref for aeresteam ${list_team_title[${iteam}]}"
         # generation one HTML file style ${format}
         format=locean_tablerefsabsbibsort
@@ -224,5 +230,17 @@
         if [ ${jabref_status} -ne 0 ]
         then
-           echo "${command} : eee : pb with jabref export ${format}"
+           echo "${command} : ${LINENO} : eee : pb with jabref export ${format}"
+           exit 1
+        fi
+        # generation one RTF file
+        ofteam=${dirwww}/$(basename ${fteam} .bib).rtf
+        rm ${ofteam} 2> /dev/null
+        jabref_rtf \
+          ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \
+          ${fteam} ${ofteam}
+        jabref_status=${?}
+        if [ ${jabref_status} -ne 0 ]
+        then
+           echo "${command} : ${LINENO} : eee : pb with jabref rtf team"
            exit 1
         fi
@@ -231,5 +249,5 @@
         for iyear in ${list_year}
         do
-           echo "${LINENO} : iii: year = ${iyear}"
+           echo "${command} : ${LINENO} : iii : year = ${iyear}"
            fteamyear=${tmpdir}/$(basename ${fteam} .bib)_${iyear}.bib
            rm  ${fteamyear} 2> /dev/null
@@ -241,8 +259,8 @@
            if [ ${nbatteamyear} -ge 2 ]
            then
-               echo "iii : $((${nbatteamyear} - 1)) ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear}"
+               echo "${command} : ${LINENO} : iii : $((${nbatteamyear} - 1)) ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear}"
                list_fteamyear="${list_fteamyear} ${fteamyear}"
            else
-               echo "www : no ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear}"
+               echo "${command} : ${LINENO} : www : no ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear}"
            fi
            unset nbatteamyear
@@ -250,5 +268,5 @@
        unset iyear
     else
-       echo "www : no ref for aeresteam ${list_team_title[${iteam}]}"
+       echo "${command} : ${LINENO} : www : no ref for aeresteam ${list_team_title[${iteam}]}"
     fi
     unset nbatteam
@@ -269,8 +287,8 @@
 for aerestype in ${list_aerestype}
 do
-   echo "${LINENO} : iii: aerestype = ${aerestype}"
+   echo "${command} : ${LINENO} : iii : aerestype = ${aerestype}"
    for fteamyear in ${list_fteamyear}
    do
-      echo "${LINENO} : iii: fteamyear = ${fteamyear}"
+      echo "${command} : ${LINENO} : iii : fteamyear = ${fteamyear}"
       #++ add header
       fteamyeartype=${tmpdir}/$(basename ${fteamyear} .bib)_${aerestype}.bib
@@ -283,5 +301,5 @@
       if [ ${nbatteamyeartype} -ge 2 ]
       then
-          echo "iii : $((${nbatteamyeartype} - 1)) ref type ${aerestype} in ${fteamyear}"
+          echo "${command} : ${LINENO} : iii : $((${nbatteamyeartype} - 1)) ref type ${aerestype} in ${fteamyear}"
           ofteamyeartype=${dirwww}/$(basename ${fteamyeartype} .bib).rtf
           rm ${ofteamyeartype} 2> /dev/null
@@ -291,5 +309,5 @@
           # ++ test si ok
       else
-          echo "www : no ref type ${aerestype} in ${fteamyear}"
+          echo "${command} : ${LINENO} : www : no ref type ${aerestype} in ${fteamyear}"
       fi
       unset nbatteamyeartype
@@ -321,9 +339,9 @@
    if [ ${jabref_status} -ne 0 ]
    then
-      echo "${command} : eee : pb with jabref export ${format}"
+      echo "${command} : ${LINENO} : eee : pb with jabref export ${format}"
       exit 1
    fi
 #++ else
-#++ echo "${command} : iii : no reference for author ${team}"
+#++ echo "${command} : ${LINENO} : iii : no reference for author ${team}"
 #++ fi
    iauthor=$(( ${iauthor} + 1 ))
@@ -334,5 +352,5 @@
 fteam=${tmpdir}/phybiocar.bib
 rm ${fteam} 2> /dev/null
-bibtool_command="bibtool -- 'select={aeresteam \"phybiocar\"}' ${biblioreffull} -o ${fteam}"
+bibtool_command="bibtool -- 'select={aeresteam \"phybiocar\"}' ${biblioref} -o ${fteam}"
 eval ${bibtool_command}
 unset bibtool_command
@@ -340,5 +358,5 @@
 if [ ${nbatteam} -ge 2 ]
 then
-    echo "iii : $((${nbatteam} - 1)) ref for aeresteam phybiocar}"
+    echo "${command} : ${LINENO} : iii : $((${nbatteam} - 1)) ref for aeresteam phybiocar in ${biblioref}"
     # generation one HTML file style ${format}
     format=locean_tablerefsabsbibsort
@@ -351,5 +369,5 @@
     if [ ${jabref_status} -ne 0 ]
     then
-       echo "${command} : eee : pb with jabref export ${format}"
+       echo "${command} : ${LINENO} : eee : pb with jabref export ${format}"
        exit 1
     fi
@@ -359,5 +377,5 @@
     for theme in ${list_theme}
     do
-        echo "${LINENO} : iii: theme = ${theme}"
+        echo "${command} : ${LINENO} : iii : theme = ${theme}"
         fteamtheme=${tmpdir}/$(basename ${fteam} .bib)_${theme}.bib
         rm  ${fteamtheme} 2> /dev/null
@@ -369,8 +387,8 @@
         if [ ${nbatteamtheme} -ge 2 ]
         then
-               echo "iii : $((${nbatteamtheme} - 1)) ref for aeresteam phybiocar and theme ${theme}"
+               echo "${command} : ${LINENO} : iii : $((${nbatteamtheme} - 1)) ref for aeresteam phybiocar and theme ${theme} in ${fteam}"
                list_fteamtheme="${list_fteamtheme} ${fteamtheme}"
         else
-               echo "www : no ref for aeresteam phybiocar and theme ${theme}"
+               echo "${command} : ${LINENO} : www : no ref for aeresteam phybiocar and theme ${theme}"
         fi
         unset nbatteamtheme
@@ -380,5 +398,5 @@
         for iyear in ${list_year}
         do
-           echo "${LINENO} : iii: year = ${iyear}"
+           echo "${command} : ${LINENO} : iii : year = ${iyear}"
            fteamthemeyear=${tmpdir}/$(basename ${fteam} .bib)_${theme}_${iyear}.bib
            rm  ${fteamthemeyear} 2> /dev/null
@@ -390,10 +408,10 @@
            if [ ${nbatteamthemeyear} -ge 2 ]
            then
-               echo "iii : $((${nbatteamthemeyear} - 1)) ref for aeresteam phybiocar and theme ${theme} and year ${iyear}"
+               echo "${command} : ${LINENO} : iii : $((${nbatteamthemeyear} - 1)) ref for aeresteam phybiocar and theme ${theme} and year ${iyear}"
                list_fteamthemeyear="${list_fteamthemeyear} ${fteamthemeyear}"
            else
-               echo "www : no ref for aeresteam phybiocar and theme ${theme} and year ${iyear}"
+               echo "${command} : ${LINENO} : www : no ref for aeresteam phybiocar and theme ${theme} and year ${iyear}"
            fi
-           read a
+           #read a
            unset nbatteamthemeyear
        done # end of year loop
@@ -401,5 +419,5 @@
    unset iyear
 else
-   echo "www : no ref for aeresteam phybiocar]}"
+   echo "${command} : ${LINENO} : www : no ref for aeresteam phybiocar]"
 fi
 unset list_year
@@ -414,8 +432,8 @@
 for aerestype in ${list_aerestype}
 do
-   echo "${LINENO} : iii: aerestype = ${aerestype}"
+   echo "${command} : ${LINENO} : iii : aerestype = ${aerestype}"
    for fteamthemeyear in ${list_fteamthemeyear}
    do
-      echo "${LINENO} : iii: fteamthemeyear = ${fteamthemeyear}"
+      echo "${command} : ${LINENO} : iii : fteamthemeyear = ${fteamthemeyear}"
       #++ add header
       fteamthemeyeartype=${tmpdir}/$(basename ${fteamthemeyear} .bib)_${aerestype}.bib
@@ -428,5 +446,5 @@
       if [ ${nbatteamthemeyeartype} -ge 2 ]
       then
-          echo "iii : $((${nbatteamthemeyeartype} - 1)) ref type ${aerestype} in ${fteamthemeyear}"
+          echo "${command} : ${LINENO} : iii : $((${nbatteamthemeyeartype} - 1)) ref type ${aerestype} in ${fteamthemeyear}"
           ofteamthemeyeartype=${dirwww}/$(basename ${fteamthemeyeartype} .bib).rtf
           rm ${ofteamthemeyeartype} 2> /dev/null
@@ -436,5 +454,5 @@
           # ++ test si ok
       else
-          echo "www : no ref type ${aerestype} in ${fteamthemeyear}"
+          echo "${command} : ${LINENO} : www : no ref type ${aerestype} in ${fteamthemeyear}"
       fi
       unset nbatteamthemeyeartype
