| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function render_doBaseActions { |
| |
| local -a FILES |
| local FILE='' |
| local OUTPUT='' |
| local TEMPLATE='' |
| local PARENTDIR='' |
| local TRANSLATION='' |
| local EXTERNALFILE='' |
| local EXTERNALFILES='' |
| local THIS_FILE_DIR='' |
| local NEXT_FILE_DIR='' |
| local RENDER_EXTENSION='' |
| local COUNT=0 |
| |
| |
| cli_checkFiles "$(cli_getRepoTLDir)/Identity/Models/Themes/${FLAG_THEME_MODEL}" --directory |
| |
| |
| PARENTDIR=$(basename "${ACTIONVAL}") |
| |
| |
| render_getDirTemplate |
| |
| |
| for RENDER_EXTENSION in ${RENDER_EXTENSIONS};do |
| |
| |
| |
| if [[ $RENDER_EXTENSION == 'svg' ]];then |
| RENDER_BACKEND='svg' |
| elif [[ $RENDER_EXTENSION == 'docbook' ]];then |
| RENDER_BACKEND='docbook' |
| else |
| cli_printMessage "`eval_gettext "The \\\"\\\$RENDER_EXTENSION\\\" file extension is not supported yet."`" --as-error-line |
| fi |
| |
| # Define the list of files to process. Use an array variable |
| # to store the list of files to process. This make posible to |
| # realize verifications like: is the current base directory |
| # equal to the next one in the list of files to process? |
| # Questions like this is let us to know when centos-art.sh is |
| # leaving a directory structure and entering another. This |
| # information is required in order for centos-art.sh to know |
| # when to apply last-rendition actions. |
| # |
| # Another issue is that some directories might be named as if |
| # they were files (e.g., using a renderable extension like |
| # .docbook). In these situations we need to avoid such |
| # directories from being interpreted as a renderable file. For |
| # this, pass the `--type="f"' option when building the list of |
| # files to process in order to retrive regular files only. |
| # |
| # Another issue to consider here, is that in some cases both |
| # templates and outputs might be in the same location. In |
| # these cases localized content are stored in the same |
| # location where template files are retrived from and we need |
| # to avoid using localized content from being interpreted as |
| # design models. In that sake, supress language-specific files |
| # from the list of files to process. |
| # |
| # Another issue to consider here, is the way of filtering. We |
| # cannot expand the pattern specified by FLAG_FILTER with a |
| # `.*' here (e.g., "${FLAG_FILTER}.*\.${RENDER_EXTENSION}") |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| for FILE in $(cli_getFilesList ${TEMPLATE} \ |
| --pattern="${FLAG_FILTER}\.${RENDER_EXTENSION}" --type="f" \ |
| | egrep -v '/[[:alpha:]]{2}_[[:alpha:]]{2}/');do |
| FILES[((++${ |
| done |
| |
| |
| |
| if [[ ${ |
| continue |
| fi |
| |
| |
| cli_exportFunctions "${RENDER_BACKEND_DIR}/$(cli_getRepoName \ |
| ${RENDER_BACKEND} -d)" "${RENDER_BACKEND}" |
| |
| |
| |
| while [[ $COUNT -lt ${ |
| |
| |
| FILE=${FILES[$COUNT]} |
| |
| |
| |
| THIS_FILE_DIR=$(dirname ${FILES[$COUNT]}) |
| |
| |
| |
| if [[ $(($COUNT + 1)) -lt ${ |
| NEXT_FILE_DIR=$(dirname ${FILES[$(($COUNT + 1))]}) |
| else |
| NEXT_FILE_DIR='' |
| fi |
| |
| |
| cli_printMessage '-' --as-separator-line |
| |
| |
| TRANSLATION=$(dirname $FILE \ |
| | sed -r 's!trunk/(Manuals|Identity)!trunk/Locales/\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/\.${RENDER_EXTENSION}$//") |
| |
| |
| FILE=${OUTPUT}/$(basename "${FILE}") |
| |
| |
| INSTANCE=$(cli_getTemporalFile ${TEMPLATE}) |
| |
| |
| |
| render_doTranslation |
| |
| |
| cli_replaceTMarkers ${INSTANCE} |
| |
| |
| ${RENDER_BACKEND} |
| |
| |
| ${RENDER_BACKEND}_doPostActions |
| |
| |
| ${RENDER_BACKEND}_doLastActions |
| |
| |
| if [[ -f $INSTANCE ]];then |
| rm $INSTANCE |
| fi |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| |
| cli_unsetFunctions "${RENDER_BACKEND_DIR}/$(cli_getRepoName \ |
| ${RENDER_BACKEND} -d)" "${RENDER_BACKEND}" |
| |
| done |
| } |