Changeset 215


Ignore:
Timestamp:
06/29/12 18:02:17 (12 years ago)
Author:
pinsard
Message:

process all aeres types

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

Legend:

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

    r214 r215  
    1616# =========== 
    1717# 
    18 # aeres 2007-2012 pour inclusion dans document word  
     18# aeres 2007-2012 pour inclusion dans document word 
    1919# 
    2020# EXAMPLES 
     
    3737# log 
    3838# 
     39# phybiocar theme 
     40# 
     41# look for missing values (aerestype and aeresteam) 
     42# 
    3943# EVOLUTIONS 
    4044# ========== 
     45# 
     46# - fplod 20120629T154955Z cratos (Linux) 
     47# 
     48#   * reorganize to deal all aeres type 
    4149# 
    4250# - fplod 20120628T101424Z cratos (Linux) 
     
    8694. define_phybiocar_theme.sh 
    8795. jabref_rtf.sh 
     96. jabref_header.sh 
    8897# 
    8998# define bibliography reference file 
     
    95104# 
    96105# pour V.8.b 3- Articles de vulgarisation  (presse en général 
    97 # loop on teams to build bibliography reference file 
    98 aerestype="PV" 
     106# loop on teams and years to build bibliography reference file 
     107list_fteamyear="" 
    99108iteam=1 
    100109nbteam=${#list_team_bibtool[@]} 
    101110while [ ${iteam} -le ${nbteam} ] 
    102111do 
    103     echo "team grep = ${list_team_bibtool[${iteam}]}" 
    104     biblioref_team=${tmpdir}/${list_team_title[${iteam}]}.bib 
    105     bibtool_command="bibtool -- 'select={aeresteam \"${list_team_bibtool[${iteam}]}\"}' ${biblioreffull} -o ${PROJECT_LOG}/team.bib" 
     112    echo "${LINENO} : iii: team = ${list_team_bibtool[${iteam}]}" 
     113    fteam=${tmpdir}/${list_team_title[${iteam}]}.bib 
     114    rm ${fteam} 2> /dev/null 
     115    bibtool_command="bibtool -- 'select={aeresteam \"${list_team_bibtool[${iteam}]}\"}' ${biblioreffull} -o ${fteam}" 
    106116    eval ${bibtool_command} 
    107     nbatteam=$(grep -c @ ${PROJECT_LOG}/team.bib) 
     117    unset bibtool_command 
     118    nbatteam=$(grep -c @ ${fteam}) 
    108119    if [ ${nbatteam} -ge 2 ] 
    109120    then 
     
    111122        for iyear in ${list_year} 
    112123        do 
    113            # select year 
    114            rm  ${PROJECT_LOG}/teamyear.bib 2> /dev/null 
    115            bibtool_command="bibtool -- 'select={year \"${iyear}\"}' ${PROJECT_LOG}/team.bib -o ${PROJECT_LOG}/teamyear.bib" 
     124           echo "${LINENO} : iii: year = ${iyear}" 
     125           fteamyear=${tmpdir}/$(basename ${fteam} .bib)_${iyear}.bib 
     126           rm  ${fteamyear} 2> /dev/null 
     127           bibtool_command="bibtool -- 'select={year \"${iyear}\"}' ${fteam} -o ${fteamyear}" 
    116128           eval ${bibtool_command} 
     129           unset bibtool_command 
    117130           # test if empty 
    118            nbatteamyear=$(grep -c @ ${PROJECT_LOG}/teamyear.bib) 
     131           nbatteamyear=$(grep -c @ ${fteamyear}) 
    119132           if [ ${nbatteamyear} -ge 2 ] 
    120133           then 
    121134               echo "iii : $((${nbatteamyear} - 1)) ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear}" 
    122                # select aerestype 
    123                rm ${PROJECT_LOG}/teamyearPV.bib 2> /dev/null 
    124                bibtool_command="bibtool -- 'select={aerestype \"${aerestype}\"}' ${PROJECT_LOG}/teamyear.bib -o ${PROJECT_LOG}/teamyeartype.bib" 
    125                eval ${bibtool_command} 
    126                # test if empty 
    127                nbatteamyeartype=$(grep -c @ ${PROJECT_LOG}/teamyeartype.bib) 
    128                if [ ${nbatteamyeartype} -ge 2 ] 
    129                then 
    130                    echo "iii : $((${nbatteamyeartype} - 1)) ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear} and aerestype ${aerestype}" 
    131                    output_title=${list_team_title[${iteam}]}_${iyear}_${aerestype} 
    132                    rm ${dirwww}/${output_title}.rtf 2> /dev/null 
    133                    jabref_rtf ./jabref.preferences.xml ${PROJECT_LOG}/teamyeartype.bib ${dirwww}/${output_title}.rtf 
    134                    # ++ test si ok 
    135                    read a 
    136                else  
    137                    echo "www : no ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear} and aerestype ${aerestype}" 
    138                fi 
    139                unset nbatteamyeartype 
    140            else  
     135               list_fteamyear="${list_fteamyear} ${fteamyear}" 
     136           else 
    141137               echo "www : no ref for aeresteam ${list_team_title[${iteam}]} and year ${iyear}" 
    142138           fi 
    143139           unset nbatteamyear 
    144140       done # end of year loop 
     141       unset iyear 
    145142    else 
    146143       echo "www : no ref for aeresteam ${list_team_title[${iteam}]}" 
    147     fi  
     144    fi 
     145    unset nbatteam 
     146    unset nbatteamyear 
    148147    iteam=$(( ${iteam} + 1 )) 
    149148done # end of team loop 
     149unset iteam 
     150unset nbteam 
     151unset list_year 
     152unset fteam 
    150153# 
    151 # write a bibtex file for each year of the list 
    152 for iyear in ${list_year} 
     154echo "${LINENO}: iii: list_fteamyear = ${list_fteamyear}" 
     155# 
     156# define jabref header 
     157# ++ usefull 
     158jabref_header ${tmpdir}/header_jabref 
     159# 
     160# loop on aerestype 
     161list_aerestype="ACL ACLN ASCL BRE C-INV C-ACTI C-ATCN C-COM C-AFF DO OR OS PV PAT PT AP" 
     162for aerestype in ${list_aerestype} 
    153163do 
    154    # select year 
    155    bibtool_command="bibtool -- 'select={year \"${iyear}\"}' ${biblioreffull} -o ${PROJECT_LOG}/1.bib" 
    156    eval ${bibtool_command} 
    157    wc -l ${PROJECT_LOG}/1.bib 
    158    # remove unpublished reference (some of then will be joined later 
    159    bibtool -- 'select.non={@unpublished}' ${PROJECT_LOG}/1.bib -o ${PROJECT_LOG}/_${iyear}.bib 
    160    wc -l ${PROJECT_LOG}/_${iyear}.bib 
    161    rm ${PROJECT_LOG}/1.bib 
    162 done 
     164   echo "${LINENO} : iii: aerestype = ${aerestype}" 
     165   for fteamyear in ${list_fteamyear} 
     166   do 
     167      echo "${LINENO} : iii: fteamyear = ${fteamyear}" 
     168      #++ add header 
     169      fteamyeartype=${tmpdir}/$(basename ${fteamyear} .bib)_${aerestype}.bib 
     170      rm ${fteamyeartype} 2> /dev/null 
     171      bibtool_command="bibtool -- 'select={aerestype \"${aerestype}\"}' ${fteamyear} -o ${fteamyeartype}" 
     172      eval ${bibtool_command} 
     173      unset bibtool_command 
     174      # test if empty 
     175      nbatteamyeartype=$(grep -c @ ${fteamyeartype}) 
     176      if [ ${nbatteamyeartype} -ge 2 ] 
     177      then 
     178          echo "iii : $((${nbatteamyeartype} - 1)) ref type ${aerestype} in ${fteamyear}" 
     179          ofteamyeartype=${dirwww}/$(basename ${fteamyeartype} .bib).rtf 
     180          rm ${ofteamyeartype} 2> /dev/null 
     181          jabref_rtf \ 
     182          ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
     183          ${fteamyeartype} ${ofteamyeartype} 
     184          # ++ test si ok 
     185      else 
     186          echo "www : no ref type ${aerestype} in ${fteamyear}" 
     187      fi 
     188      unset nbatteamyeartype 
     189   done # end of loop on fteamyear 
     190done # end of loop on aerestype 
    163191# 
    164 # artificial header of jabref file to enforce encoding 
    165 { 
    166 echo "% This file was articifialy created for JabRef ${JABREF_VERSION}." 
    167 echo "% Encoding: ISO8859_1" 
    168 echo " " 
    169 } > ${tmpdir}/header_jabref 
    170 # 
    171 cp ${tmpdir}/header_jabref ${biblioref} 
    172 for iyear in ${list_year} 
    173 do 
    174    cat ${biblioref} ${PROJECT_LOG}/_${iyear}.bib  > ${PROJECT_LOG}/1.bib 
    175    cp ${PROJECT_LOG}/1.bib ${biblioref} 
    176    wc -l ${biblioref} 
    177    rm ${PROJECT_LOG}/1.bib 
    178 done 
    179 cat ${biblioref} ${PROJECT_LOG}/_unpublished.bib > ${PROJECT_LOG}/1.bib 
    180 cp ${PROJECT_LOG}/1.bib ${biblioref} 
    181 wc -l ${biblioref} 
    182 rm ${PROJECT_LOG}/1.bib 
    183  
    184 # 
    185 # 
    186 list_format="html simplehtml tablerefs locean_tablerefs locean_tablerefsabsbibsort locean_listrefs" 
    187 #+++list_format="" #+++ 
    188 for format in ${list_format} 
    189 do 
    190    echo "format export jabref ${format}" 
    191    # generation one HTML file style ${format} 
    192    rm ${biblioref}.${format}.jabref.html 2> /dev/null 
    193    java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
    194    -p ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    195    --output ${dirwww}/${output_title}.${format}.jabref.html,${format} \ 
    196    ${biblioref} 
    197    jabref_status=${?} 
    198    if [ ${jabref_status} -ne 0 ] 
    199    then 
    200       echo "${command} : eee : pb with jabref export ${format}" 
    201       exit 1 
    202    fi 
    203 done 
    204  
    205 # loop on teams to build bibliography reference file 
    206 iteam=1 
    207 nbteam=${#list_team_bibtool[@]} 
    208 #+++nbteam=0 
    209 while [ ${iteam} -le ${nbteam} ] 
    210 do 
    211    echo "team title = ${list_team_title[${iteam}]}" 
    212    echo "team grep = ${list_team_bibtool[${iteam}]}" 
    213    biblioref_team=${tmpdir}/${list_team_title[${iteam}]}.bib 
    214    bibtool_command="bibtool -- 'select={aeresteam \"${list_team_bibtool[${iteam}]}\"}' ${biblioref} -o ${PROJECT_LOG}/1.bib" 
    215    eval ${bibtool_command} 
    216    # test if no file found ++ 
    217    cat ${tmpdir}/header_jabref ${PROJECT_LOG}/1.bib > ${biblioref_team} 
    218    format=locean_tablerefsabsbibsort 
    219    # generation one HTML file style ${format} 
    220    rm ${biblioref}.${format}.jabref.html 2> /dev/null 
    221    java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
    222       -p ./jabref.preferences.xml \ 
    223       --output ${dirwww}/${output_title}_${list_team_title[${iteam}]}.${format}.jabref.html,${format} \ 
    224       ${biblioref_team} 
    225    jabref_status=${?} 
    226    if [ ${jabref_status} -ne 0 ] 
    227    then 
    228       echo "${command} : eee : pb with jabref export ${format}" 
    229       exit 1 
    230    fi 
    231 #++ else 
    232 #++ echo "${command} : iii : no reference for team ${team}" 
    233 #++ fi 
    234    iteam=$(( ${iteam} + 1 )) 
    235 done 
    236  
    237 . define_authors.sh 
    238 # 
    239 # loop on authors to build bibliography reference file 
    240 iauthor=1 
    241 nbauthor=${#list_author_bibtool[@]} 
    242 #++nbauthor=0 #+++ 
    243 while [ ${iauthor} -le ${nbauthor} ] 
    244 do 
    245    rm ${PROJECT_LOG}/1.bib 2> /dev/null 
    246    echo "author title = ${list_author_title[iauthor]}" 
    247    echo "author grep = ${list_author_bibtool[iauthor]}" 
    248    biblioref_author=${tmpdir}/${list_author_file[iauthor]}.bib 
    249    bibtool_command="bibtool -- 'select={author \"${list_author_bibtool[iauthor]}\"}' ${biblioref} -o ${PROJECT_LOG}/1.bib" 
    250    eval ${bibtool_command} 
    251    # test if no file found ++ 
    252    cat ${tmpdir}/header_jabref ${PROJECT_LOG}/1.bib > ${biblioref_author} 
    253    format=locean_tablerefsabsbibsort 
    254    # generation one HTML file style ${format} 
    255    rm ${biblioref}.${format}.jabref.html 2> /dev/null 
    256    java -jar ${JABREF_DIR}/JabRef-${JABREF_VERSION}.jar -n true \ 
    257       -p ${PROJECT}/../branches/bibliolocean/src/jabref.preferences.xml \ 
    258       --output ${dirwww}/${output_title}_${list_author_file[iauthor]}.${format}.jabref.html,${format} \ 
    259       ${biblioref_author} 
    260    jabref_status=${?} 
    261    if [ ${jabref_status} -ne 0 ] 
    262    then 
    263       echo "${command} : eee : pb with jabref export ${format}" 
    264       exit 1 
    265    fi 
    266 #++ else 
    267 #++ echo "${command} : iii : no reference for author ${team}" 
    268 #++ fi 
    269    iauthor=$(( ${iauthor} + 1 )) 
    270 done 
    271 echo "fin auteurs" 
    272  
     192# clean 
    273193#++rm ${biblioref} 2> /dev/null 
    274194#++rm ${tmpdir}/header_jabref 2> /dev/null 
    275  
     195# 
     196# end 
    276197exit 0 
Note: See TracChangeset for help on using the changeset viewer.