Ambrosia

 view release on metacpan or  search on metacpan

share/Managers/buildConfig.pm  view on Meta::CPAN

        );
        close $fh;
    }

    my $message = <<MESSAGE;

#######################################################################
#
#   Config file "${projectName}.conf" has been created successfully.
#
#   Now you can additionally edit ${projectName}.conf and run:
#   ambrosia -c ${projectName}.conf -a db2xml
#
#######################################################################

MESSAGE
    Context->repository->set( Message => $message );
}

sub proces_template
{
    my $template = shift;
    my %data = @_;

    foreach my $name ( keys %data )
    {
        my $value = $data{$name} || '';
        $template =~ s/##$name##/$value/sg;
    }
    $template =~ s/##(.*?)##//sg;
    return $template;
}

#sub downloadLib
#{
#    my $req = HTTP::Request->new(GET => 'http://download.dojotoolkit.org/release-1.7.2/dojo-release-1.7.2.tar.gz');
#}

1;

__DATA__
use strict;
use warnings;

my $ROOT = '##ROOT##';

return
{
    #Application name
    ID => '##NAME##',
    #Application label (title)
    Label => '##TITLE##',

    #Template charset
    Charset => '##CHARSET##',

    #The path to templates of Ambrosia Builder
    TemplatePath  => '##SHARE_DIR##',

    #Now only so. Don't edit this.
    TemplateStyle => { jsframework => 'dojo', htmltemplate => 'xslt' },
    #You must load Dojo Toolkit 1.7.2 from http://download.dojotoolkit.org/release-1.7.2/dojo-release-1.7.2.tar.gz
    #and extract it into this directory
    DojoToolkitPath => '##DOJO_TOOLKIT_PATH##',

    #parameters for project
    ServerName => '##HTTP_SERVER_NAME##',
    ServerPort => ##HTTP_PORT##,

    #The path to the directory where the project will be deployed
    ProjectPath  => $ROOT . '/##NAME##',

    #The path to additional libraries in Perl
    PerlLibPath   => '##PERL_LIB_PATH##',

    ROOT  => $ROOT,
    DEBUG => 1,

    #The path to logfile.
    logger_path => $ROOT . '/app_log',

################################################################################
    data_source => {
        DBI => [
            {
                engine_name   => '##DB_ENGINE##',
                source_name   => '##NAME##',
                catalog       => undef,#optional
                schema        => '##DB_SCHEMA##',
                host          => '##DB_HOST##',#optional
                ##DB_PORT##
                user          => '##DB_USER##',
                password      => '##DB_PASSWORD##',
                ##DB_ENGINE_PARAMS##
                additional_params => { AutoCommit => 0, RaiseError => 1, LongTruncOk => 1 },
                additional_action => sub { my $dbh = shift; $dbh->do('SET NAMES ##DB_CHARSET##')},
            },
        ]
    },

    data_source_info => {
        DBI => { ##NAME## => {charset => '##DB_CHARSET##'} }
    },
};




( run in 2.051 seconds using v1.01-cache-2.11-cpan-df04353d9ac )