| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function render_doBaseActions { |
| |
| local -a FILES |
| local FILE='' |
| local OUTPUT='' |
| local TEMPLATE='' |
| local TEMPLATES='' |
| local PARENTDIR='' |
| local TRANSLATION='' |
| local EXTERNALFILE='' |
| local EXTERNALFILES='' |
| local THIS_FILE_DIR='' |
| local NEXT_FILE_DIR='' |
| local RENDER_EXTENSION='' |
| local EXPORTID='' |
| local COUNT=0 |
| |
| |
| cli_checkFiles -e "${TCAR_WORKDIR}/trunk/Identity/Models/Themes/${FLAG_THEME_MODEL}" |
| |
| |
| PARENTDIR=$(basename "${ACTIONVAL}") |
| |
| |
| render_getDirTemplate |
| |
| |
| for RENDER_EXTENSION in ${RENDER_EXTENSIONS};do |
| |
| |
| |
| if [[ $RENDER_EXTENSION =~ '^(svgz|svg)$' ]];then |
| RENDER_FORMAT='svg' |
| elif [[ $RENDER_EXTENSION =~ '^(docbook)$' ]];then |
| RENDER_FORMAT='docbook' |
| else |
| cli_printMessage "`eval_gettext "The \\\"\\\$RENDER_EXTENSION\\\" file extension is not supported yet."`" --as-error-line |
| fi |
| |
| # Redefine specific function export id. |
| EXPORTID="${CLI_FUNCDIRNAM}/$(cli_getRepoName ${RENDER_FORMAT} -d)/$(cli_getRepoName ${RENDER_FORMAT} -f)" |
| |
| # Define the list of files to process. Use an array variable |
| # to store the list of files to process. This make possible to |
| # realize verifications like: is the current base directory |
| # equal to the next one in the list of files to process? |
| # Questions like this 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 render able extension like |
| # .docbook). In these situations we need to avoid such |
| # directories from being interpreted as a render able file. |
| # For this, pass the `--type="f"' option when building the |
| # list of files to process in order to retrieve 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 retrieved from and we need |
| # to avoid using localized content from being interpreted as |
| # design models. In that sake, build the list of files to |
| # process using the files directely stored in the directory |
| # passed as argument to centos-art.sh command-line. Don't go |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| if [[ ${TEMPLATE} =~ "${TCAR_WORKDIR}/trunk/Documentation/(Models|Manuals)/Docbook/.+$" ]];then |
| TEMPLATES=$(cli_getFilesList ${TEMPLATE} \ |
| --maxdepth="1" --mindepth="1" \ |
| --pattern="$(cli_getRepoName ${TEMPLATE} -f)\.${RENDER_EXTENSION}" \ |
| --type="f") |
| else |
| TEMPLATES=$(cli_getFilesList ${TEMPLATE} \ |
| --pattern="${FLAG_FILTER}\.${RENDER_EXTENSION}" \ |
| --type="f") |
| fi |
| for FILE in $TEMPLATES;do |
| FILES[((++${ |
| done |
| |
| |
| |
| if [[ ${ |
| continue |
| fi |
| |
| |
| cli_exportFunctions "${EXPORTID}" |
| |
| |
| |
| 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/(Documentation|Identity)!trunk/Locales/\1!')/${CLI_LANG_LC}/messages.po |
| |
| # Define final location of template file. |
| TEMPLATE=${FILE} |
| |
| # Verify design models file existence. We cannot continue |
| # with out it. |
| if [[ ! -f $TEMPLATE ]];then |
| cli_printMessage "`gettext "The template file doesn't exist."`" --as-error-line |
| fi |
| |
| |
| cli_printMessage "$TEMPLATE" --as-template-line |
| |
| |
| 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_expandTMarkers ${INSTANCE} |
| |
| |
| ${RENDER_FORMAT} |
| |
| |
| if [[ -f $INSTANCE ]];then |
| rm $INSTANCE |
| fi |
| |
| |
| COUNT=$(($COUNT + 1)) |
| |
| done |
| |
| |
| cli_unsetFunctions "${EXPORTID}" |
| |
| done |
| } |