diff --git a/Scripts/Bash/Functions/Render/render_doIdentity.sh b/Scripts/Bash/Functions/Render/render_doIdentity.sh index cf83758..0b84ece 100755 --- a/Scripts/Bash/Functions/Render/render_doIdentity.sh +++ b/Scripts/Bash/Functions/Render/render_doIdentity.sh @@ -24,7 +24,7 @@ # USA. # # ---------------------------------------------------------------------- -# $Id$ +# $Id: render_doIdentity.sh 824 2011-01-06 20:54:52Z al $ # ---------------------------------------------------------------------- function render_doIdentity { @@ -113,7 +113,7 @@ function render_doIdentity { # Start rendition as defined in artwork-specific pre-rendition # configuration file. - render_doIdentityBase + render_getIdentityBase # Unset artwork-specific actions so they can be redefined by # artwork-specific pre-rendition configuration scripts. This diff --git a/Scripts/Bash/Functions/Render/render_doIdentityBase.sh b/Scripts/Bash/Functions/Render/render_doIdentityBase.sh deleted file mode 100755 index 7e91944..0000000 --- a/Scripts/Bash/Functions/Render/render_doIdentityBase.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash -# -# render_doIdentityBase.sh -- This function initiates rendition features -# taking BASEACTIONS as reference. -# -# Copyright (C) 2009-2011 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_doIdentityBase { - - # Define variables as local to avoid conflicts outside. - local TRANSLATIONPATH='' - local SVG='' - local IMG='' - local PARENTDIR='' - local LOCATION='' - local EXTENSION='' - local FILTER='' - local FILES='' - - # Redefine absolute path to artwork's related translation entry. - render_getIdentityTranslationDir - - # Redefine absolute path to artwork's related design template - # directory. By default design templates are stored in the Tpl/ - # directory which is stored in the workplace's root. - render_getIdentityTemplateDir - - # Redefine absolute path to artwork's related final output - # directory. - render_getIdentityOutputDir - - # Redefine parent directory for current workplace. - PARENTDIR=$(basename $ACTIONVAL) - - # Redefine directory path used as reference to build the list of - # files that will be rendered. - render_getFilesList - - # Define which type of features does centos-art.sh script is able - # to perform. - for ACTION in "${BASEACTIONS[@]}"; do - - case $ACTION in - - renderText ) - # Provides text rendition feature. - render_doIdentityTexts - ;; - - renderImage ) - # Provides image rendition feature. - render_doIdentityImages - ;; - - esac - - done - -} diff --git a/Scripts/Bash/Functions/Render/render_getIdentityBase.sh b/Scripts/Bash/Functions/Render/render_getIdentityBase.sh new file mode 100755 index 0000000..7ae43fb --- /dev/null +++ b/Scripts/Bash/Functions/Render/render_getIdentityBase.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# +# render_getIdentityBase.sh -- This function initiates rendition features +# taking BASEACTIONS as reference. +# +# Copyright (C) 2009-2011 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_getIdentityBase { + + # Define variables as local to avoid conflicts outside. + local TRANSLATIONPATH='' + local SVG='' + local IMG='' + local PARENTDIR='' + local LOCATION='' + local EXTENSION='' + local FILTER='' + local FILES='' + + # Redefine absolute path to artwork's related translation entry. + render_getIdentityDirTranslation + + # Redefine absolute path to artwork's related design template + # directory. By default design templates are stored in the Tpl/ + # directory which is stored in the workplace's root. + render_getIdentityDirTemplate + + # Redefine absolute path to artwork's related final output + # directory. + render_getIdentityDirOutput + + # Redefine parent directory for current workplace. + PARENTDIR=$(basename $ACTIONVAL) + + # Redefine directory path used as reference to build the list of + # files that will be rendered. + render_getFilesList + + # Define which type of features does centos-art.sh script is able + # to perform. + for ACTION in "${BASEACTIONS[@]}"; do + + case $ACTION in + + renderText ) + # Provides text rendition feature. + render_doIdentityTexts + ;; + + renderImage ) + # Provides image rendition feature. + render_doIdentityImages + ;; + + esac + + done + +} diff --git a/Scripts/Bash/Functions/Render/render_getIdentityDirOutput.sh b/Scripts/Bash/Functions/Render/render_getIdentityDirOutput.sh new file mode 100644 index 0000000..ebb64eb --- /dev/null +++ b/Scripts/Bash/Functions/Render/render_getIdentityDirOutput.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# +# render_getIdentityDirOutput.sh -- This function re-defines final +# output directory used to store rendered identity artworks. +# +# Copyright (C) 2009-2011 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_getIdentityDirOutput { + + # By default rendered identity artworks are stored immediatly + # under identity entry structure. + IMG=$ACTIONVAL + + # But if Img/ or Txt/ directory exists, use it instead. + if [[ -d $ACTIONVAL/Img ]]; then + IMG=$ACTIONVAL/Img + elif [[ -d $ACTIONVAL/Txt ]]; then + IMG=$ACTIONVAL/Txt + fi + +} diff --git a/Scripts/Bash/Functions/Render/render_getIdentityDirTemplate.sh b/Scripts/Bash/Functions/Render/render_getIdentityDirTemplate.sh new file mode 100644 index 0000000..7d568bb --- /dev/null +++ b/Scripts/Bash/Functions/Render/render_getIdentityDirTemplate.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# +# render_getIdentityDirTemplate.sh -- This function re-defines absolute +# path to artwork's related design templates directory. +# +# Copyright (C) 2009-2011 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_getIdentityDirTemplate { + + # Initialize design models location using action value as + # reference. + SVG=$ACTIONVAL + + # Sanitate design models location. Be sure design models do + # always point to trunk directory structure. This is useful to let + # `centos-art.sh' script do rendition under branches directory + # structure, reusing design models under trunk directory + # structure. + SVG=$(echo "$SVG" | sed "s!/branches/!/trunk/!") + + # Sanitate design models location. + if [[ -d $SVG/Tpl ]];then + # Using Tpl/ directory is an obsolete practice that should be + # avoided. The concept of Tpl/ directory per artwork directory + # has been replaced by a common design model directory + # structure where we centralize design models for all + # different artistic motifs. However, there are some cases + # that we may need to use Tpl/ directory still, so we verify + # its existence and use it if present. + SVG=$SVG/Tpl + else + # Redefine design model location based on theme model + # (THEMEMODEL) variable value. The theme model variable is + # defined in the associated pre-rendition configuration script + # and can be used to set which design model to use among a + # list of different design models that we can choose from. + SVG=$(echo "$SVG" | sed "s!Motifs/$(cli_getThemeName)!Models/$THEMEMODEL!") + fi + +} diff --git a/Scripts/Bash/Functions/Render/render_getIdentityDirTranslation.sh b/Scripts/Bash/Functions/Render/render_getIdentityDirTranslation.sh new file mode 100644 index 0000000..e589a50 --- /dev/null +++ b/Scripts/Bash/Functions/Render/render_getIdentityDirTranslation.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# +# render_getIdentityDirTranslation.sh -- This function re-defines the +# absolute path of artwork related translation entries. Be sure there +# is at least one translation file inside it. Otherwise consider +# the artwork translation entry as empty value. +# +# Copyright (C) 2009-2011 Alain Reguera Delgado +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. +# +# ---------------------------------------------------------------------- +# $Id$ +# ---------------------------------------------------------------------- + +function render_getIdentityDirTranslation { + + TRANSLATIONPATH=${FUNCDIR}/${FUNCDIRNAM}/Config/$ARTCOMP + + if [[ "$(find $TRANSLATIONPATH -name '*.png.sh')" == '' ]];then + TRANSLATIONPATH='' + fi + +} diff --git a/Scripts/Bash/Functions/Render/render_getIdentityOutputDir.sh b/Scripts/Bash/Functions/Render/render_getIdentityOutputDir.sh deleted file mode 100644 index 500073e..0000000 --- a/Scripts/Bash/Functions/Render/render_getIdentityOutputDir.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# render_getIdentityOutputDir.sh -- This function re-defines final -# output directory used to store rendered identity artworks. -# -# Copyright (C) 2009-2011 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getIdentityOutputDir { - - # By default rendered identity artworks are stored immediatly - # under identity entry structure. - IMG=$ACTIONVAL - - # But if Img/ or Txt/ directory exists, use it instead. - if [[ -d $ACTIONVAL/Img ]]; then - IMG=$ACTIONVAL/Img - elif [[ -d $ACTIONVAL/Txt ]]; then - IMG=$ACTIONVAL/Txt - fi - -} diff --git a/Scripts/Bash/Functions/Render/render_getIdentityTemplateDir.sh b/Scripts/Bash/Functions/Render/render_getIdentityTemplateDir.sh deleted file mode 100644 index e91056a..0000000 --- a/Scripts/Bash/Functions/Render/render_getIdentityTemplateDir.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# -# render_getIdentityTemplateDir.sh -- This function re-defines absolute -# path to artwork's related design templates directory. -# -# Copyright (C) 2009-2011 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getIdentityTemplateDir { - - # Initialize design models location using action value as - # reference. - SVG=$ACTIONVAL - - # Sanitate design models location. Be sure design models do - # always point to trunk directory structure. This is useful to let - # `centos-art.sh' script do rendition under branches directory - # structure, reusing design models under trunk directory - # structure. - SVG=$(echo "$SVG" | sed "s!/branches/!/trunk/!") - - # Sanitate design models location. - if [[ -d $SVG/Tpl ]];then - # Using Tpl/ directory is an obsolete practice that should be - # avoided. The concept of Tpl/ directory per artwork directory - # has been replaced by a common design model directory - # structure where we centralize design models for all - # different artistic motifs. However, there are some cases - # that we may need to use Tpl/ directory still, so we verify - # its existence and use it if present. - SVG=$SVG/Tpl - else - # Redefine design model location based on theme model - # (THEMEMODEL) variable value. The theme model variable is - # defined in the associated pre-rendition configuration script - # and can be used to set which design model to use among a - # list of different design models that we can choose from. - SVG=$(echo "$SVG" | sed "s!Motifs/$(cli_getThemeName)!Models/$THEMEMODEL!") - fi - -} diff --git a/Scripts/Bash/Functions/Render/render_getIdentityTranslationDir.sh b/Scripts/Bash/Functions/Render/render_getIdentityTranslationDir.sh deleted file mode 100644 index 003e236..0000000 --- a/Scripts/Bash/Functions/Render/render_getIdentityTranslationDir.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# -# render_getIdentityTranslationDir.sh -- This function re-defines the -# absolute path of artwork related translation entries. Be sure there -# is at least one translation file inside it. Otherwise consider -# the artwork translation entry as empty value. -# -# Copyright (C) 2009-2011 Alain Reguera Delgado -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -# USA. -# -# ---------------------------------------------------------------------- -# $Id$ -# ---------------------------------------------------------------------- - -function render_getIdentityTranslationDir { - - TRANSLATIONPATH=${FUNCDIR}/${FUNCDIRNAM}/Config/$ARTCOMP - - if [[ "$(find $TRANSLATIONPATH -name '*.png.sh')" == '' ]];then - TRANSLATIONPATH='' - fi - -}