Blame Scripts/Functions/Render/render_svg_checkModelExportId.sh

e75c76
#!/bin/bash
e75c76
#
646538
# render_svg_checkModelExportId.sh -- This function standardizes the export id
e75c76
# used inside svg files and the way of verify them.
e75c76
#
3b0984
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
e75c76
#
e75c76
# This program is free software; you can redistribute it and/or modify
e75c76
# it under the terms of the GNU General Public License as published by
e75c76
# the Free Software Foundation; either version 2 of the License, or (at
e75c76
# your option) any later version.
e75c76
#
e75c76
# This program is distributed in the hope that it will be useful, but
e75c76
# WITHOUT ANY WARRANTY; without even the implied warranty of
e75c76
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
e75c76
# General Public License for more details.
e75c76
#
e75c76
# You should have received a copy of the GNU General Public License
e75c76
# along with this program; if not, write to the Free Software
e75c76
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
e75c76
#
e75c76
# ----------------------------------------------------------------------
e75c76
# $Id$
e75c76
# ----------------------------------------------------------------------
e75c76
646538
function render_svg_checkModelExportId {
4a86d4
4a86d4
    local INSTANCE="$1"
4a86d4
    local EXPORTID="$2"
4a86d4
4a86d4
    # Verify instance.
4a86d4
    cli_checkFiles $INSTANCE
4a86d4
4a86d4
    # Verify export id.
4a86d4
    if [[ $EXPORTID == '' ]];then
4a86d4
        cli_printMessage "`gettext "The export id value cannot be empty."`" --as-error-line
4a86d4
    fi
e75c76
e75c76
    # Check export id inside design templates.
e75c76
    grep "id=\"$EXPORTID\"" $INSTANCE > /dev/null
e75c76
    if [[ $? -gt 0 ]];then
e75c76
        cli_printMessage "`eval_gettext "There is not export id (\\\$EXPORTID) inside \\\"\\\$TEMPLATE\\\"."`" --as-error-line
e75c76
    fi
e75c76
e75c76
}