diff --git a/Scripts/Functions/Render/render_getDirTemplate.sh b/Scripts/Functions/Render/render_getDirTemplate.sh index 08e598d..b50e588 100644 --- a/Scripts/Functions/Render/render_getDirTemplate.sh +++ b/Scripts/Functions/Render/render_getDirTemplate.sh @@ -1,7 +1,44 @@ #!/bin/bash # -# render_getDirTemplate.sh -- This function re-defines absolute -# path to artwork's related design templates directory. +# render_getDirTemplate.sh -- This function defines the way renderable +# directories are processed inside the repository. Inside the +# repository, renderable directories are processed either through +# general-purpose rendition or theme-specific rendition. +# +# General-purpose rendition: +# +# The general-purpose rendition takes one XML file from design +# model (`trunk/Identity/Models') directory structure and +# produces one file in `trunk/Identity/Images' directory +# strucutre. In this configuration, the organization used to +# stored the design model is taken as reference to build the +# path required to store the image related to it under +# `trunk/Identity/Images' directory structure. +# +# Theme-specific rendition: +# +# The theme-specific rendition takes one design model from +# `trunk/Identity/Models/Themes' directory structure to produce +# one or more images in +# `trunk/Identity/Motifs/$THEME/$VERSION/$MODEL' directory +# structure. In this configuration we have many different +# artistic motifs that use one unique design model directory +# structure as reference to produce images. +# +# Since theme design models are unified to be reused by more +# than one artistic motif, it is not possible to render artistic +# motifs in a lineal manner (i.e., as we do with general-purpose +# rendition) because we need to establish the relation between +# the artistic motif renderable directory structure and the +# design model first and that relation happens when renderable +# directory structures inside artistic motifs are processed +# individually. +# +# In the first rendition category, we use a design model directory +# structure as reference to produce images one by one. In the second +# rendition category, we can't use the same procedure because one +# design model directory structure is used to produce several +# renderable directory structures, not just one. # # Copyright (C) 2009-2011 Alain Reguera Delgado # @@ -26,8 +63,8 @@ function render_getDirTemplate { - # Initialize design models location using action value as - # reference. + # Initialize design models location used as reference to process + # renderable directory structures. TEMPLATE=$ACTIONVAL # Sanitate design models location. Be sure design models do @@ -37,24 +74,11 @@ function render_getDirTemplate { # structure. TEMPLATE=$(echo "$TEMPLATE" | sed "s!/branches/!/trunk/!") - # Sanitate design models location using or not Tpl/ directory. - if [[ -d $TEMPLATE/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. - TEMPLATE=$TEMPLATE/Tpl - else - # Redefine design model location based on theme model - # (FLAG_THEME_MODEL) 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. - TEMPLATE=$(echo "$TEMPLATE" \ - | sed "s!Motifs/$(cli_getPathComponent "$TEMPLATE" '--theme')!Models/$FLAG_THEME_MODEL!") - fi + # Define absolute path to theme-specific design models. + TEMPLATE=$(echo "$TEMPLATE" \ + | sed -r "s!$(cli_getPathComponent $TEMPLATE '--theme-pattern')!Identity/Themes/Models/${FLAG_THEME_MODEL}/!") + + # Define absolute path to general-purpose design models. + TEMPLATE=$(echo "$TEMPLATE" | sed "s!/Images!/Models!") }