| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function render_doBaseActions { |
| |
| local -a FILES |
| local FILE='' |
| local OUTPUT='' |
| local TEMPLATE='' |
| local PARENTDIR='' |
| local EXTENSION='' |
| local TRANSLATION='' |
| local EXTERNALFILE='' |
| local EXTERNALFILES='' |
| local THIS_FILE_DIR='' |
| local NEXT_FILE_DIR='' |
| local COUNT=0 |
| |
| |
| |
| |
| local -a POSTACTIONS |
| |
| |
| |
| |
| |
| |
| local -a LASTACTIONS |
| |
| |
| cli_checkFiles "$(cli_getRepoTLDir)/Identity/Models/Themes/${FLAG_THEME_MODEL}" --directory |
| |
| |
| |
| |
| |
| EXTENSION='(svgz|svg|xhtml|docbook)' |
| |
| |
| PARENTDIR=$(basename "${ACTIONVAL}") |
| |
| |
| render_getDirTemplate |
| |
| |
| |
| |
| |
| |
| |
| |
| for FILE in $(cli_getFilesList ${TEMPLATE} --pattern="${FLAG_FILTER}.*\.${EXTENSION}");do |
| FILES[((++${#FILES[*]}))]=$FILE |
| done |
| |
| |
| cli_printActionPreamble "${FILES[*]}" '' '' |
| |
| |
| |
| while [[ $COUNT -lt ${#FILES[*]} ]];do |
| |
| |
| FILE=${FILES[$COUNT]} |
| |
| |
| |
| THIS_FILE_DIR=$(dirname ${FILES[$COUNT]}) |
| |
| |
| |
| if [[ $(($COUNT + 1)) -lt ${#FILES[*]} ]];then |
| NEXT_FILE_DIR=$(dirname ${FILES[$(($COUNT + 1))]}) |
| else |
| NEXT_FILE_DIR='' |
| fi |
| |
| |
| cli_printMessage '-' --as-separator-line |
| |
| |
| TRANSLATION=$(dirname $FILE \ |
| | sed -r 's!trunk/Identity/(.+)!trunk/Locales/Identity/\1!')/$(cli_getCurrentLocale)/messages.po |
| |
| |
| if [[ ! -f "$TRANSLATION" ]];then |
| cli_printMessage "`gettext "None"`" --as-translation-line |
| else |
| cli_printMessage "$TRANSLATION" --as-translation-line |
| fi |
| |
| |
| TEMPLATE=${FILE} |
| |
| |
| if [[ ! -f "$TEMPLATE" ]];then |
| cli_printMessage "`gettext "None"`" --as-design-line |
| else |
| cli_printMessage "$TEMPLATE" --as-design-line |
| fi |
| |
| |
| render_getDirOutput |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| FILE=$(echo ${FILE} \ |
| | sed -r "s!.*${PARENTDIR}/!!" \ |
| | sed -r "s/\.${EXTENSION}$//") |
| |
| |
| FILE=${OUTPUT}/$(basename "${FILE}") |
| |
| |
| INSTANCE=$(cli_getTemporalFile ${TEMPLATE}) |
| |
| |
| |
| if [[ -f ${TRANSLATION} ]];then |
| |
| |
| /usr/bin/xml2po -a -p ${TRANSLATION} ${TEMPLATE} > ${INSTANCE} |
| |
| |
| if [[ -f ${PWD}/.xml2po.mo ]];then |
| rm ${PWD}/.xml2po.mo |
| fi |
| |
| else |
| |
| /bin/cp ${TEMPLATE} ${INSTANCE} |
| fi |
| |
| |
| cli_replaceTMarkers ${INSTANCE} |
| |
| |
| |
| if [[ $INSTANCE =~ '\.(svgz|svg)$' ]];then |
| |
| |
| render_doSvg |
| |
| |
| render_doSvgPostActions |
| |
| |
| render_doSvgLastActions |
| |
| elif [[ $INSTANCE =~ '\.docbook$' ]];then |
| |
| |
| render_doDocbook |
| |
| |
| |
| |
| |
| |
| |
| elif [[ $INSTANCE =~ '\.xhtml$' ]];then |
| |
| |
| render_doXhtml |
| |
| |
| |
| |
| |
| |
| |
| else |
| cli_printMessage "`gettext "The template file you try to render is not supported yet."`" --as-error-line |
| fi |
| |
| |
| if [[ -f $INSTANCE ]];then |
| rm $INSTANCE |
| fi |
| |
| |
| render_doPostActions |
| |
| |
| render_doLastActions |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| } |