Changeset 269 for branches


Ignore:
Timestamp:
11/08/12 14:33:39 (12 years ago)
Author:
pinsard
Message:

rehab tool for HAL (to be cont.)

Location:
branches/bibliolocean/src
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/bibliolocean/src/genbib.sh

    r257 r269  
    8585# 
    8686# $URL$ 
     87# 
     88# - fplod 20121108T094612Z cratos.locean-ipsl.upmc.fr (Linux) 
     89# 
     90#   * externalisation de hal dans genprehal.sh 
    8791# 
    8892# - fplod 20121015T100652Z cratos.locean-ipsl.upmc.fr (Linux) 
     
    304308cp sorttable.js ${dirwww}/ 
    305309cp sorttable.css ${dirwww}/ 
    306 # 
     310 
    307311# define team for : 
    308312# - search in bibtex file (in loceanteam field) 
     
    761765#++ process html transformation of DocBook file ++ 
    762766 
    763 # is there any reference to be add to HAL 
    764 biblioref_hal=$(grep -c "url = {http://hal.archives-ouvertes.fr/hal" ${biblioref} | grep ":0" | awk -F: '{print $1}') 
    765 if [ "${biblioref_hal}" != " " ] 
    766 then 
    767    #++ more than 30 entries 
    768    cat ${tmpdir}/header_jabref ${biblioref_hal} > ${biblioref}_hal.bib 
    769    # 
    770    # generation one XML file style prehal 
    771  
    772    rm ${biblioref}.1.jabref.xml 2> /dev/null 
    773    java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
    774       -p ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    775       --output ${tmpdir}/${output_title}.1.jabref.xml,prehal \ 
    776       ${biblioref}_hal.bib 
    777 fi 
    778  
    779767#++rm ${biblioref} 2> /dev/null 
    780768#++rm ${biblioref}_hal 2> /dev/null 
  • branches/bibliolocean/src/genprehal.sh

    r260 r269  
    22#+ 
    33# 
    4 # =========== 
    5 # genaeres.sh 
    6 # =========== 
     4# ============ 
     5# genprehal.sh 
     6# ============ 
    77# 
    88# SYNOPSIS 
    99# ======== 
    1010# 
    11 # ``./genaeres.sh`` 
     11# ``./genprehal.sh`` 
    1212# 
    1313# DESCRIPTION 
    1414# =========== 
    1515# 
    16 # aeres 2007-2012 
     16# prehal ++ 
    1717# 
    1818# SEE ALSO 
     
    2121# genbib.sh 
    2222# 
     23# next step : id labo ... tar etc. 
     24# 
    2325# TODO 
    2426# ==== 
    2527# 
     28# make it work : now xml produced by jabref are not ok. 
     29# see prehal*.layout 
     30# 
    2631# integrer dans trunk superbib 
    27 # 
    28 # on ne voit pas les notes des unpublished dans le pdf plain 
    2932# 
    3033# EVOLUTIONS 
     
    3538# $URL$ 
    3639# 
    37 # - fplod 20121019T142841Z cratos.locean-ipsl.upmc.fr (Linux) 
     40# - fplod 20121108T124317Z cratos.locean-ipsl.upmc.fr (Linux) 
    3841# 
    39 #   * fix bug on creation of rtf files for phybiocar team by aeres types when 
    40 #     theme < 3 
    41 # 
    42 # - fplod 20120912T124959Z cratos.locean-ipsl.upmc.fr (Linux) 
    43 # 
    44 #   * homogenize log message with command and LINENO 
    45 #   * get info from aeres subset instead of the whole biblio (ie year limit) 
    46 #   * produce a RTF file by team 
    47 # 
    48 # - fplod 20120706T101813Z cratos (Linux) 
    49 # 
    50 #   * add phybiocar theme (bouzin mais ça marche) 
    51 # 
    52 # - fplod 20120705T101524Z cratos (Linux) 
    53 # 
    54 #   * nouvelle technique de sélection avec bib2bib 
    55 #     donc les unpublished avec des champs year sont maintenant sélectionnés 
    56 #     thanks to http://www.lri.fr/~filliatr/bibtex2html/doc/manual.html#htoc14 
    57 #   * intégration de genaeres_rtf.sh 
    58 # 
    59 # - fplod 20120419T121614Z cratos (Linux) 
    60 # 
    61 #   * add copy of sorttable.js in dirwww 
    62 #   * add copy of sorttable.css in dirwww 
    63 # 
    64 # - fplod 20120406 
    65 # 
    66 #   * creation sans répéter certaines fonctionalités de genbib.sh 
    67 #     comme les vérif. de bases, les tutuelles 
     42# * creation par externalisation de la fonctionnalité (pas fini) dans genbib 
    6843# 
    6944#- 
     
    7348system=$(uname) 
    7449case "${system}" in 
    75    AIX|IRIX64) 
    76       echo "${command} : ${LINENO} : www : no specific posix checking" 
    77    ;; 
    78    *) 
    79       set -o posix 
    80    ;; 
     50    AIX|IRIX64) 
     51       echo "${command} : ${LINENO} : www : no specific posix checking" 
     52    ;; 
     53    *) 
     54       set -o posix 
     55    ;; 
    8156esac 
    8257# 
    83 . define_teams_aeres2007_2012.sh 
    84 . define_phybiocar_theme.sh 
    85 . jabref_rtf.sh 
    8658. jabref_header.sh 
    87 . define_authors.sh 
    8859# 
    8960log_date=$(date -u +"%Y%m%dT%H%M%SZ") 
     
    9162# 
    9263usage=" Usage : ${command}" 
    93 # 
    94 # test if bibtool available 
    95 tool=bibtool 
    96 type ${tool} 1> /dev/null 2>&1 
    97 status=${?} 
    98 if [ ${status} -ne 0 ] 
    99 then 
    100    echo "${command} : ${LINENO} : eee : ${tool} unavailable" >&2 
    101    exit 1 
    102 fi 
    103 unset tool 
    104 unset status 
    10564# 
    10665# test if bib2bib available 
     
    11069if [ ${status} -ne 0 ] 
    11170then 
    112    echo "${command} : ${LINENO} : eee : ${tool} unavailable" >&2 
    113    exit 1 
     71    echo "${command} : ${LINENO} : eee : ${tool} unavailable" >&2 
     72    exit 1 
    11473fi 
    11574unset tool 
     
    11978# n.a. 
    12079# 
    121 tmpdir=${PROJECT_LOG}/gtbiblio/aeres2007_2012/ 
    122 dirwww=${PROJECT_OD}/public_html/gtbiblio/aeres2007_2012/ 
     80tmpdir=${PROJECT_LOG}/gtbiblio/prehal/ 
     81dirwww=${PROJECT_OD}/public_html/gtbiblio/prehal/ 
    12382rm -rf ${tmpdir} 2> /dev/null 
    12483mkdir -p ${tmpdir} 
     
    12685mkdir -p ${dirwww} 
    12786# 
    128 # copy javascript and css for sort table in  output directory 
    129 cp sorttable.js ${dirwww}/ 
    130 cp sorttable.css ${dirwww}/ 
     87# usefull artificial header of jabref file to enforce encoding 
     88jabref_header ${tmpdir}/header_jabref 
    13189# 
    13290# define bibliography reference file 
     
    13492biblioreffull=${tmpdir}/all.bib 
    13593cp ${biblioref_orig} ${biblioreffull} 
    136 biblioref=${tmpdir}/aeres2007_2012.bib 
    137 bibliocite=${tmpdir}/aeres2007_2012_cite.bib 
    13894# 
    139 bib2bib -oc ${bibliocite} -ob ${biblioref} \ 
    140         -c 'year>=2007 and year<=2012' \ 
    141         ${biblioreffull} 
     95fbibmissinghalidfull=${tmpdir}/missinghalidfull.bib 
     96fcitemissinghalidfull=${tmpdir}/missinghalidfull_cite 
     97nlmax=30 
     98bib2bib -c 'not exists hal_id' \ 
     99-ob ${fbibmissinghalidfull} \ 
     100-oc ${fcitemissinghalidfull} \ 
     101${biblioreffull} 
     102if [ ! -s {fcitemissinghalidfull} ] 
     103then 
     104    echo "${LINENO} : eee : some hal_id in ${biblioreffull}" 
     105    echo "see ${fcitemissinghalidfull}" 
     106    # more than ${nlmax} entries ? 
     107    nltot=$(wc -l ${fcitemissinghalidfull} | awk '{print $1}') 
     108    if [ ${nltot} -gt ${nlmax} ] 
     109    then 
     110       echo "${LINENO} : iii : more than ${nlmax} missing hal_id in ${biblioreffull}" 
     111       echo "${LINENO} : iii : need to split" 
     112       dsuffixsplit=$(dirname ${fcitemissinghalidfull}) 
     113       bsuffixsplit=$(basename ${fcitemissinghalidfull} .bib)_s 
     114       split -l ${nlmax} -a 3 ${fcitemissinghalidfull} ${dsuffixsplit}/${bsuffixsplit} 
     115       list_fcitemissinghalid=$(find ${dsuffixsplit} -name "${bsuffixsplit}???") 
     116       list_fbibmissinghalid="" 
     117       for fcitemissinghalid in ${list_fcitemissinghalid} 
     118       do 
     119           # build condition expression  
     120           bib2bibcond=$(sed -e "s/^/-c '\$key : \"/" -e "s/$/\"'/" ${fcitemissinghalid} | paste -s -d ' ' ) 
     121           # extract the references 
     122           fbibmissinghalid=${tmpdir}/$(basename ${fcitemissinghalid}).bib 
     123           bib2bibcmd=$(echo "bib2bib ${bib2bibcond} -ob ${fbibmissinghalid} ${fbibmissinghalidfull}") 
     124           eval ${bib2bibcmd} 
     125           list_fbibmissinghalid="${list_fbibmissinghalid} ${fbibmissinghalid}" 
     126       done 
     127    else 
     128       echo "${LINENO} : iii : less or just ${nlmax} missing hal_id in ${biblioref}" 
     129       echo "${LINENO} : iii : no need to split" 
     130       fbibmissinghalid=${tmpdir}/missinghalid.bib 
     131       list_fbibmissinghalid=${fbibmissinghalid} 
     132       cp ${fbibmissinghalidfull} ${fbibmissinghalid} 
     133    fi 
     134    for fbibmissinghalid in ${list_fbibmissinghalid} 
     135    do 
     136       fbibjmissinghalid=${tmpdir}/$(basename ${fbibmissinghalid} .bib)_jabref.bib 
     137       more ${tmpdir}/header_jabref 
     138       read a 
     139       wc ${fbibmissinghalid} 
     140       cat ${tmpdir}/header_jabref ${fbibmissinghalid} > ${fbibjmissinghalid} 
     141       diff ${fbibmissinghalid} ${fbibjmissinghalid} 
     142       read a 
     143       # 
     144       # generation one XML file style prehal 
     145       fxmlmissinghalid=${tmpdir}/$(basename ${fbibmissinghalid}).xml 
     146       rm ${fxmlmissinghalid} 2> /dev/null 
     147       java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
     148          -p ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
     149          --output ${fxmlmissinghalid},prehal \ 
     150          ${fbibjmissinghalid} 
     151       read a 
     152    done 
     153else 
     154    echo "${LINENO} : iii : no missing hal_id in ${biblioref}" 
     155fi 
    142156# 
    143 # ++ usefull artificial header of jabref file to enforce encoding 
    144 jabref_header ${tmpdir}/header_jabref 
     157#++ clean 
    145158# 
    146 # génération du PDF classique 
    147 list_style="plain" #+++ 
    148 for style in ${list_style} 
    149 do 
    150    rm ${dirwww}/$(basename ${biblioref}.${style}.log .log).* 2> /dev/null 
    151    # generation of latex file 
    152    cat << EOF > ${biblioref}.${style}.tex 
    153 \documentclass[a4paper]{article} 
    154 %++\usepackage[frenchb]{babel} 
    155 \usepackage[latin1]{inputenc} 
    156 \begin{document} 
    157 % force to include all entry of the bibliography 
    158 \nocite{*} 
    159  
    160 % bibliography 
    161 \bibliographystyle{${style}} 
    162  
    163 \bibliography{${biblioref}} 
    164 \end{document} 
    165 EOF 
    166    # 
    167    # processing bibliography with pdflatex (${dirwww}/${biblioref}.${style}.pdf) 
    168    rm ${dirwww}/$(basename ${biblioref}.${style}.log .log).* 2> /dev/null 
    169    pdflatex -output-directory ${dirwww} ${biblioref}.${style}.tex 
    170    bibtex ${dirwww}/$(basename ${biblioref}.${style}) 
    171    #++ warnings 
    172    pdflatex -output-directory ${dirwww} ${biblioref}.${style}.tex 
    173    pdflatex -output-directory ${dirwww} ${biblioref}.${style}.tex 
    174    # 
    175    # remove temporary latex files 
    176    rm ${dirwww}/$(basename ${biblioref}.${style}.bbl) ${dirwww}/$(basename ${biblioref}.${style}.blg) ${dirwww}/$(basename ${biblioref}.${style}.log) ${dirwww}/$(basename ${biblioref}.${style}.aux) 2> /dev/null 
    177    # 
    178    #++rm ${biblioref}.${style}.tex 2> /dev/null 
    179 done 
    180  
    181 echo "fin 1re passe latex" 
    182  
    183 # generation one RTF file style harvard 
    184 output_title=aeres2007_2012 
    185 rm ${biblioref}.harvard.jabref.rtf 2> /dev/null 
    186 java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
    187 -p ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    188 --output ${dirwww}/${output_title}.harvard.jabref.rtf,harvard \ 
    189 ${biblioref} 
    190 echo "fin rtf all" 
    191 # 
    192 # generation of HTML 
    193 list_format="html simplehtml tablerefs locean_tablerefs locean_tablerefsabsbibsort locean_listrefs" 
    194 for format in ${list_format} 
    195 do 
    196    echo "format export jabref ${format}" 
    197    # generation one HTML file style ${format} 
    198    rm ${biblioref}.${format}.jabref.html 2> /dev/null 
    199    java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
    200    -p ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    201    --output ${dirwww}/${output_title}.${format}.jabref.html,${format} \ 
    202    ${biblioref} 
    203    jabref_status=${?} 
    204    if [ ${jabref_status} -ne 0 ] 
    205    then 
    206       echo "${command} : ${LINENO} : eee : pb with jabref export ${format}" 
    207       exit 1 
    208    fi 
    209 done 
    210 # 
    211 # loop on teams and years to build bibliography reference file 
    212 list_fteamyear="" 
    213 iteam=1 
    214 nbteam=${#list_team_bibtool[@]} 
    215 while [ ${iteam} -le ${nbteam} ] 
    216 do 
    217     echo "${command} : ${LINENO} : iii : team = ${list_team_bibtool[${iteam}]}" 
    218     fteam=${tmpdir}/${list_team_title[${iteam}]}.bib 
    219     rm ${fteam} 2> /dev/null 
    220     bibtool_command="bibtool -- 'select={aeresteam \"${list_team_bibtool[${iteam}]}\"}' ${biblioref} -o ${fteam}" 
    221     eval ${bibtool_command} 
    222     unset bibtool_command 
    223     nbatteam=$(grep -c @ ${fteam}) 
    224     if [ ${nbatteam} -ge 2 ] 
    225     then 
    226         echo "${command} : ${LINENO} : iii : $((${nbatteam} - 1)) ref for aeresteam ${list_team_title[${iteam}]}" 
    227         # generation one HTML file style ${format} 
    228         format=locean_tablerefsabsbibsort 
    229         rm ${biblioref}.${format}.jabref.html 2> /dev/null 
    230         java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
    231            -p ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    232            --output ${dirwww}/${output_title}_${list_team_title[iteam]}.${format}.jabref.html,${format} \ 
    233            ${fteam} 
    234         jabref_status=${?} 
    235         if [ ${jabref_status} -ne 0 ] 
    236         then 
    237            echo "${command} : ${LINENO} : eee : pb with jabref export ${format}" 
    238            exit 1 
    239         fi 
    240         # generation one RTF file 
    241         ofteam=${dirwww}/$(basename ${fteam} .bib).rtf 
    242         rm ${ofteam} 2> /dev/null 
    243         jabref_rtf \ 
    244           ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    245           ${fteam} ${ofteam} 
    246         jabref_status=${?} 
    247         if [ ${jabref_status} -ne 0 ] 
    248         then 
    249            echo "${command} : ${LINENO} : eee : pb with jabref rtf team" 
    250            exit 1 
    251         fi 
    252         # loop on years 
    253         list_year=$(seq 2007 2012) 
    254         for iyear in ${list_year} 
    255         do 
    256            echo "${command} : ${LINENO} : iii : year = ${iyear}" 
    257            fteamyear=${tmpdir}/$(basename ${fteam} .bib)_${iyear}.bib 
    258            rm  ${fteamyear} 2> /dev/null 
    259            bibtool_command="bibtool -- 'select={year \"${iyear}\"}' ${fteam} -o ${fteamyear}" 
    260            eval ${bibtool_command} 
    261            unset bibtool_command 
    262            # test if empty 
    263            nbatteamyear=$(grep -c @ ${fteamyear}) 
    264            if [ ${nbatteamyear} -ge 2 ] 
    265            then 
    266                echo "${command} : ${LINENO} : iii : $((${nbatteamyear} - 1)) ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear}" 
    267                list_fteamyear="${list_fteamyear} ${fteamyear}" 
    268            else 
    269                echo "${command} : ${LINENO} : www : no ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear}" 
    270            fi 
    271            unset nbatteamyear 
    272        done # end of year loop 
    273        unset iyear 
    274     else 
    275        echo "${command} : ${LINENO} : www : no ref for aeresteam ${list_team_title[${iteam}]}" 
    276     fi 
    277     unset nbatteam 
    278     unset nbatteamyear 
    279     iteam=$(( ${iteam} + 1 )) 
    280 done # end of team loop 
    281 unset iteam 
    282 unset nbteam 
    283 unset list_year 
    284 unset fteam 
    285 # 
    286 # define jabref header 
    287 # ++ usefull 
    288 jabref_header ${tmpdir}/header_jabref 
    289 # 
    290 # loop on aerestype 
    291 list_aerestype="ACL ACLN ASCL BRE C-INV C-ACTI C-ATCN C-COM C-AFF DO OR OS PV PAT PT AP" 
    292 for aerestype in ${list_aerestype} 
    293 do 
    294    echo "${command} : ${LINENO} : iii : aerestype = ${aerestype}" 
    295    for fteamyear in ${list_fteamyear} 
    296    do 
    297       echo "${command} : ${LINENO} : iii : fteamyear = ${fteamyear}" 
    298       #++ add header 
    299       fteamyeartype=${tmpdir}/$(basename ${fteamyear} .bib)_${aerestype}.bib 
    300       rm ${fteamyeartype} 2> /dev/null 
    301       bibtool_command="bibtool -- 'select={aerestype \"${aerestype}\"}' ${fteamyear} -o ${fteamyeartype}" 
    302       eval ${bibtool_command} 
    303       unset bibtool_command 
    304       # test if empty 
    305       nbatteamyeartype=$(grep -c @ ${fteamyeartype}) 
    306       if [ ${nbatteamyeartype} -ge 2 ] 
    307       then 
    308           echo "${command} : ${LINENO} : iii : $((${nbatteamyeartype} - 1)) ref type ${aerestype} in ${fteamyear}" 
    309           ofteamyeartype=${dirwww}/$(basename ${fteamyeartype} .bib).rtf 
    310           rm ${ofteamyeartype} 2> /dev/null 
    311           jabref_rtf \ 
    312           ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    313           ${fteamyeartype} ${ofteamyeartype} 
    314           # ++ test si ok 
    315       else 
    316           echo "${command} : ${LINENO} : www : no ref type ${aerestype} in ${fteamyear}" 
    317       fi 
    318       unset nbatteamyeartype 
    319    done # end of loop on fteamyear 
    320 done # end of loop on aerestype 
    321 # 
    322 # loop on authors to build bibliography reference file 
    323 iauthor=1 
    324 nbauthor=${#list_author_bibtool[@]} 
    325 #++nbauthor=0 #+++ 
    326 while [ ${iauthor} -le ${nbauthor} ] 
    327 do 
    328    rm ${tmpdir}/tmp1.bib 2> /dev/null 
    329    echo "author title = ${list_author_title[iauthor]}" 
    330    echo "author grep = ${list_author_bibtool[iauthor]}" 
    331    biblioref_author=${tmpdir}/${list_author_file[iauthor]}.bib 
    332    bibtool_command="bibtool -- 'select={author \"${list_author_bibtool[iauthor]}\"}' ${biblioref} -o ${tmpdir}/tmp1.bib" 
    333    eval ${bibtool_command} 
    334    # test if no file found ++ 
    335    cat ${tmpdir}/header_jabref ${tmpdir}/tmp1.bib > ${biblioref_author} 
    336    format=locean_tablerefsabsbibsort 
    337    # generation one HTML file style ${format} 
    338    rm ${biblioref}.${format}.jabref.html 2> /dev/null 
    339    java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
    340       -p ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    341       --output ${dirwww}/${output_title}_${list_author_file[iauthor]}.${format}.jabref.html,${format} \ 
    342       ${biblioref_author} 
    343    jabref_status=${?} 
    344    if [ ${jabref_status} -ne 0 ] 
    345    then 
    346       echo "${command} : ${LINENO} : eee : pb with jabref export ${format}" 
    347       exit 1 
    348    fi 
    349 #++ else 
    350 #++ echo "${command} : ${LINENO} : iii : no reference for author ${team}" 
    351 #++ fi 
    352    iauthor=$(( ${iauthor} + 1 )) 
    353 done 
    354 echo "fin auteurs" 
    355  
    356 # phybiocar = team with theme 
    357 fteam=${tmpdir}/phybiocar.bib 
    358 rm ${fteam} 2> /dev/null 
    359 bibtool_command="bibtool -- 'select={aeresteam \"phybiocar\"}' ${biblioref} -o ${fteam}" 
    360 eval ${bibtool_command} 
    361 unset bibtool_command 
    362 nbatteam=$(grep -c @ ${fteam}) 
    363 if [ ${nbatteam} -ge 2 ] 
    364 then 
    365     echo "${command} : ${LINENO} : iii : $((${nbatteam} - 1)) ref for aeresteam phybiocar in ${biblioref}" 
    366     # generation one HTML file style ${format} 
    367     format=locean_tablerefsabsbibsort 
    368     rm ${biblioref}.${format}.jabref.html 2> /dev/null 
    369         java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
    370        -p ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    371        --output ${dirwww}/${output_title}_phybiocar.${format}.jabref.html,${format} \ 
    372        ${fteam} 
    373     jabref_status=${?} 
    374     if [ ${jabref_status} -ne 0 ] 
    375     then 
    376        echo "${command} : ${LINENO} : eee : pb with jabref export ${format}" 
    377        exit 1 
    378     fi 
    379     # loop on themes 
    380     list_theme="1 2 3" 
    381     list_fteamtheme="" 
    382     list_fteamthemeyear="" 
    383     for theme in ${list_theme} 
    384     do 
    385         echo "${command} : ${LINENO} : iii : theme = ${theme}" 
    386         fteamtheme=${tmpdir}/$(basename ${fteam} .bib)_${theme}.bib 
    387         rm  ${fteamtheme} 2> /dev/null 
    388         bibtool_command="bibtool -- 'select={phybiocartheme \"${theme}\"}' ${fteam} -o ${fteamtheme}" 
    389         eval ${bibtool_command} 
    390         unset bibtool_command 
    391         # test if empty 
    392         nbatteamtheme=$(grep -c @ ${fteamtheme}) 
    393         if [ ${nbatteamtheme} -ge 2 ] 
    394         then 
    395                echo "${command} : ${LINENO} : iii : $((${nbatteamtheme} - 1)) ref for aeresteam phybiocar and theme ${theme} in ${fteam}" 
    396                list_fteamtheme="${list_fteamtheme} ${fteamtheme}" 
    397         else 
    398                echo "${command} : ${LINENO} : www : no ref for aeresteam phybiocar and theme ${theme}" 
    399         fi 
    400         #read a 
    401         unset nbatteamtheme 
    402         # loop on years 
    403         list_year=$(seq 2007 2012) 
    404         for iyear in ${list_year} 
    405         do 
    406            echo "${command} : ${LINENO} : iii : year = ${iyear}" 
    407            fteamthemeyear=${tmpdir}/$(basename ${fteam} .bib)_${theme}_${iyear}.bib 
    408            rm  ${fteamthemeyear} 2> /dev/null 
    409            bibtool_command="bibtool -- 'select={year \"${iyear}\"}' ${fteamtheme} -o ${fteamthemeyear}" 
    410            eval ${bibtool_command} 
    411            unset bibtool_command 
    412            # test if empty 
    413            nbatteamthemeyear=$(grep -c @ ${fteamthemeyear}) 
    414            if [ ${nbatteamthemeyear} -ge 2 ] 
    415            then 
    416                echo "${command} : ${LINENO} : iii : $((${nbatteamthemeyear} - 1)) ref for aeresteam phybiocar and theme ${theme} and year ${iyear}" 
    417                list_fteamthemeyear="${list_fteamthemeyear} ${fteamthemeyear}" 
    418            else 
    419                echo "${command} : ${LINENO} : www : no ref for aeresteam phybiocar and theme ${theme} and year ${iyear}" 
    420            fi 
    421            #read a 
    422            unset nbatteamthemeyear 
    423        done # end of year loop 
    424    done # end of them loop 
    425    unset iyear 
    426 else 
    427    echo "${command} : ${LINENO} : www : no ref for aeresteam phybiocar]" 
    428 fi 
    429 unset list_year 
    430 unset fteam 
    431 # 
    432 # define jabref header 
    433 # ++ usefull 
    434 jabref_header ${tmpdir}/header_jabref 
    435 # 
    436 # loop on aerestype 
    437 list_aerestype="ACL ACLN ASCL BRE C-INV C-ACTI C-ATCN C-COM C-AFF DO OR OS PV PAT PT AP" 
    438 for aerestype in ${list_aerestype} 
    439 do 
    440    echo "${command} : ${LINENO} : iii : aerestype = ${aerestype}" 
    441    for fteamthemeyear in ${list_fteamthemeyear} 
    442    do 
    443       echo "${command} : ${LINENO} : iii : fteamthemeyear = ${fteamthemeyear}" 
    444       #++ add header 
    445       fteamthemeyeartype=${tmpdir}/$(basename ${fteamthemeyear} .bib)_${aerestype}.bib 
    446       rm ${fteamthemeyeartype} 2> /dev/null 
    447       bibtool_command="bibtool -- 'select={aerestype \"${aerestype}\"}' ${fteamthemeyear} -o ${fteamthemeyeartype}" 
    448       eval ${bibtool_command} 
    449       unset bibtool_command 
    450       # test if empty 
    451       nbatteamthemeyeartype=$(grep -c @ ${fteamthemeyeartype}) 
    452       if [ ${nbatteamthemeyeartype} -ge 2 ] 
    453       then 
    454           echo "${command} : ${LINENO} : iii : $((${nbatteamthemeyeartype} - 1)) ref type ${aerestype} in ${fteamthemeyear}" 
    455           ofteamthemeyeartype=${dirwww}/$(basename ${fteamthemeyeartype} .bib).rtf 
    456           rm ${ofteamthemeyeartype} 2> /dev/null 
    457           jabref_rtf \ 
    458           ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    459           ${fteamthemeyeartype} ${ofteamthemeyeartype} 
    460           # ++ test si ok 
    461       else 
    462           echo "${command} : ${LINENO} : www : no ref type ${aerestype} in ${fteamthemeyear}" 
    463       fi 
    464       unset nbatteamthemeyeartype 
    465    done # end of loop on fteamthemeyear 
    466 done # end of loop on aerestype 
    467 # 
    468 #++rm ${biblioref} 2> /dev/null 
    469 #++rm ${tmpdir}/header_jabref 2> /dev/null 
    470  
    471159exit 0 
Note: See TracChangeset for help on using the changeset viewer.