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
#
fa95b1
# General-purpose rendition:
f6f5f3
#
fa95b1
# The general-purpose rendition takes one XML file from design
fa95b1
# model (`trunk/Identity/Models') directory structure and
fa95b1
# produces one file in `trunk/Identity/Images' directory
fa95b1
# strucutre. In this configuration, the organization used to
fa95b1
# stored the design model is taken as reference to build the
fa95b1
# path required to store the image related to it under
fa95b1
# `trunk/Identity/Images' directory structure. 
f6f5f3
#
fa95b1
# Theme-specific rendition:
f6f5f3
#
fa95b1
# The theme-specific rendition takes one design model from
fa95b1
# `trunk/Identity/Models/Themes' directory structure to produce
fa95b1
# one or more images in
fa95b1
# `trunk/Identity/Motifs/$THEME/$VERSION/$MODEL' directory
fa95b1
# structure. In this configuration we have many different
fa95b1
# artistic motifs that use one unique design model directory
fa95b1
# structure as reference to produce images. 
f6f5f3
#
fa95b1
# Since theme design models are unified to be reused by more
fa95b1
# than one artistic motif, it is not possible to render artistic
fa95b1
# motifs in a lineal manner (i.e., as we do with general-purpose
fa95b1
# rendition) because we need to establish the relation between
fa95b1
# the artistic motif renderable directory structure and the
fa95b1
# design model first and that relation happens when renderable
fa95b1
# directory structures inside artistic motifs are processed
fa95b1
# 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
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
fa95b1
# the Free Software Foundation; either version 2 of the License, or
fa95b1
# (at your option) any later version.
fa95b1
#
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
# ----------------------------------------------------------------------
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.
58e3c8
    if [[ -d ${TEMPLATE}/Tpl ]];then
58e3c8
        TEMPLATE=${TEMPLATE}/Tpl
58e3c8
    else
58e3c8
        TEMPLATE=$(echo "$TEMPLATE" \
58e3c8
            | sed -r "s!$(cli_getPathComponent $TEMPLATE '--theme-pattern')!Identity/Themes/Models/${FLAG_THEME_MODEL}/!")
58e3c8
    fi
58e3c8
f6f5f3
f6f5f3
    # Define absolute path to general-purpose design models.
f6f5f3
    TEMPLATE=$(echo "$TEMPLATE" | sed "s!/Images!/Models!")
4c79b5
4c79b5
}