Blame Scripts/Functions/Render/render_getDirTemplate.sh

4c79b5
#!/bin/bash
4c79b5
#
f6f5f3
# render_getDirTemplate.sh -- This function defines the way renderable
f6f5f3
# directories are processed inside the repository.  Inside the
f6f5f3
# repository, renderable directories are processed either through
f6f5f3
# general-purpose rendition or theme-specific rendition.
f6f5f3
#
f6f5f3
#   General-purpose rendition:
f6f5f3
#
f6f5f3
#       The general-purpose rendition takes one XML file from design
f6f5f3
#       model (`trunk/Identity/Models') directory structure and
f6f5f3
#       produces one file in `trunk/Identity/Images' directory
f6f5f3
#       strucutre. In this configuration, the organization used to
f6f5f3
#       stored the design model is taken as reference to build the
f6f5f3
#       path required to store the image related to it under
f6f5f3
#       `trunk/Identity/Images' directory structure. 
f6f5f3
#
f6f5f3
#   Theme-specific rendition:
f6f5f3
#
f6f5f3
#       The theme-specific rendition takes one design model from
f6f5f3
#       `trunk/Identity/Models/Themes' directory structure to produce
f6f5f3
#       one or more images in
f6f5f3
#       `trunk/Identity/Motifs/$THEME/$VERSION/$MODEL' directory
f6f5f3
#       structure. In this configuration we have many different
f6f5f3
#       artistic motifs that use one unique design model directory
f6f5f3
#       structure as reference to produce images. 
f6f5f3
#
f6f5f3
#       Since theme design models are unified to be reused by more
f6f5f3
#       than one artistic motif, it is not possible to render artistic
f6f5f3
#       motifs in a lineal manner (i.e., as we do with general-purpose
f6f5f3
#       rendition) because we need to establish the relation between
f6f5f3
#       the artistic motif renderable directory structure and the
f6f5f3
#       design model first and that relation happens when renderable
f6f5f3
#       directory structures inside artistic motifs are processed
f6f5f3
#       individually.
f6f5f3
#
f6f5f3
# In the first rendition category, we use a design model directory
f6f5f3
# structure as reference to produce images one by one. In the second
f6f5f3
# rendition category, we can't use the same procedure because one
f6f5f3
# design model directory structure is used to produce several
f6f5f3
# renderable directory structures, not just one.
4c79b5
#
9f5f2e
# Copyright (C) 2009-2011 Alain Reguera Delgado
4c79b5
# 
7cd8e9
# This program is free software; you can redistribute it and/or
7cd8e9
# modify it under the terms of the GNU General Public License as
7cd8e9
# published by the Free Software Foundation; either version 2 of the
7cd8e9
# License, or (at your option) any later version.
4c79b5
# 
4c79b5
# This program is distributed in the hope that it will be useful, but
4c79b5
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
4c79b5
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
4c79b5
# USA.
4c79b5
# 
4c79b5
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
ab1d67
function render_getDirTemplate {
4c79b5
f6f5f3
    # Initialize design models location used as reference to process
f6f5f3
    # renderable directory structures.
5711b4
    TEMPLATE=$ACTIONVAL
12f1d8
cabeaa
    # Sanitate design models location.  Be sure design models do
cabeaa
    # always point to trunk directory structure. This is useful to let
15b1d2
    # `centos-art.sh' script do rendition under branches directory
cabeaa
    # structure, reusing design models under trunk directory
cabeaa
    # structure.
5711b4
    TEMPLATE=$(echo "$TEMPLATE" | sed "s!/branches/!/trunk/!")
12f1d8
f6f5f3
    # Define absolute path to theme-specific design models.
f6f5f3
    TEMPLATE=$(echo "$TEMPLATE" \
f6f5f3
        | sed -r "s!$(cli_getPathComponent $TEMPLATE '--theme-pattern')!Identity/Themes/Models/${FLAG_THEME_MODEL}/!")
f6f5f3
f6f5f3
    # Define absolute path to general-purpose design models.
f6f5f3
    TEMPLATE=$(echo "$TEMPLATE" | sed "s!/Images!/Models!")
4c79b5
4c79b5
}