Ambrosia

 view release on metacpan or  search on metacpan

share/Templates/Common/Config.xsl  view on Meta::CPAN


return
{
    ID       => '<xsl:value-of select="$UcAppName"/>',
    LABEL    => '<xsl:value-of select="@Label"/>',
    Charset  => '<xsl:value-of select="@Charset"/>',
    ROOT     => $ROOT,
    DEBUG    => $DEBUG,

    #The root directory that is defined in the main module
    root_path => undef,

    #The path to log file.
    logger_path => $LOG_DIR,

    template_path => $TPL_DIR,

    template_web_path => $SITE_URL . '/Templates_<xsl:value-of select="$UcAppName"/>',


    MANAGERS => {
        #manager that returns the main page
        '*' => {
            manager  => '<xsl:value-of select="@Name"/>::Managers::MainManager',
            template => 'main.xsl',
            access   => $AUTHORIZE_ACCESS
        },
        '/list' => {
            manager => '<xsl:value-of select="@Name"/>::Managers::ListManager',
            template => 'list_json.xsl',
            access   => $OPEN_ACCESS
        },
        <xsl:if test="/atns:Application/@Authorization!='NO'">
        '/authorize' => {
            manager => '<xsl:value-of select="@Name"/>::Managers::AuthorizeManager',
            template => 'authorize.xsl',
            access   => $OPEN_ACCESS
        },
        '/exit' => {
            manager  => '<xsl:value-of select="@Name"/>::Managers::ExitManager',
            #template => 'authorize.xsl',
            access   => $OPEN_ACCESS
        },
        </xsl:if>
<xsl:if test="boolean(./atns:Entitys/atns:Entity[@Type='TREE'])">
        '/tree' => {
            manager => '<xsl:value-of select="@Name"/>::Managers::ListManager',
            template => 'tree_json.xsl',
            access   => $OPEN_ACCESS
        },
</xsl:if>

<xsl:text>
</xsl:text>
    <xsl:for-each select="./atns:Entitys/atns:Entity">
        <xsl:variable name="entityName" select="translate(@Name, $vUppercaseChars_CONST, $vLowercaseChars_CONST)"/>
        <xsl:variable name="typeEntity" select="translate(@Type, $vLowercaseChars_CONST, $vUppercaseChars_CONST)"/>
        <xsl:if test="$typeEntity='TABLE' or $typeEntity='TREE'">
        '/get/<xsl:value-of select="$entityName"/>' => {
            manager  => '<xsl:value-of select="../../@Name"/>::Managers::<xsl:value-of select="@Name"/>EditManager',
            template => '<xsl:value-of select="$entityName"/>_edit_json.xsl',
            access   => $EDIT_<xsl:value-of select="@Name"/>
        },
        '/save/<xsl:value-of select="$entityName"/>' => {
            manager  => '<xsl:value-of select="../../@Name"/>::Managers::<xsl:value-of select="@Name"/>SaveManager',
            access   => $EDIT_<xsl:value-of select="@Name"/>
        },
        </xsl:if>
        <xsl:if test="$typeEntity!='ABSTRACT' and $typeEntity!='BIND' and $typeEntity!='TREE'">
        '/list/<xsl:value-of select="$entityName"/>' => {
            manager => '<xsl:value-of select="../../@Name"/>::Managers::<xsl:value-of select="@Name"/>ListManager',
            access   => $VIEW_<xsl:value-of select="@Name"/>
        },
        </xsl:if>
        <xsl:if test="$typeEntity='TREE'">
        '/list/<xsl:value-of select="$entityName"/>' => {
            manager => '<xsl:value-of select="../../@Name"/>::Managers::<xsl:value-of select="@Name"/>TreeManager',
            access   => $VIEW_<xsl:value-of select="@Name"/>
        },
        </xsl:if>
        <xsl:text>
        </xsl:text>
    </xsl:for-each>
    },

    CommonGatewayInterface => {
        engine_name   => '<xsl:value-of select="/atns:Application/atns:Config/atns:CommonGatewayInterface/@Engine" />',
        engine_params => {
            header_params => {
                <xsl:for-each select="/atns:Application/atns:Config/atns:CommonGatewayInterface/atns:Params/@*">
                    <xsl:value-of select="name()" /> => '<xsl:value-of select="." />',
            </xsl:for-each>},
        },
        proxy         => $PROXY,
    },

    data_source => {
        <xsl:for-each select="/atns:Application/atns:DataSource/atns:Type">
        <xsl:value-of select="@Name" /> => [<xsl:for-each select="atns:Source">{
            source_name   => $DS_NAME_<xsl:value-of select="../@Name"/>_<xsl:value-of select="@Name"/>,
            engine_name   => $DS_ENGINE_<xsl:value-of select="../@Name"/>_<xsl:value-of select="@Name"/>,
            <xsl:if test="boolean(@Catalog)">catalog       => $DS_CATALOG_<xsl:value-of select="../@Name"/>_<xsl:value-of select="@Name"/>,</xsl:if>
            schema        => $DS_SCHEMA_<xsl:value-of select="../@Name"/>_<xsl:value-of select="@Name"/>,
            user          => $DS_USER_<xsl:value-of select="../@Name"/>_<xsl:value-of select="@Name"/>,
            password      => $DS_PASSWORD_<xsl:value-of select="../@Name"/>_<xsl:value-of select="@Name"/>,
            engine_params => $DS_PARAMS_<xsl:value-of select="../@Name"/>_<xsl:value-of select="@Name"/>,
            additional_params => { AutoCommit => 0, RaiseError => 1, LongTruncOk => 1 },
            additional_action => sub { my $dbh = shift; $dbh->do("SET NAMES $DS_CHARSET_<xsl:value-of select="../@Name"/>_<xsl:value-of select="@Name"/>")},
        },</xsl:for-each>],</xsl:for-each>
    },

#delete this block if your application don't use remoute services or change it
    service_conf => {
        'SOAP::Lite' => [
                {
                    name => '<xsl:value-of select="$RealAppName"/>',
                    __proxy => 'uri of calling service',
                    __outputxml => 'false',
                    __readable => 0,
                    __default_ns => 'urn:<xsl:value-of select="$RealAppName"/>/<xsl:value-of select="$RealAppName"/>Services',
                    #__ns => 'urn:<xsl:value-of select="$RealAppName"/>/<xsl:value-of select="$RealAppName"/>Services',



( run in 0.522 second using v1.01-cache-2.11-cpan-5b529ec07f3 )