<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../../../../misc/Meta.xsl" ?>
<!--
  == This software is subject to the terms of the Eclipse Public License v1.0
  == Agreement, available at the following URL:
  == http://www.eclipse.org/legal/epl-v10.html.
  == You must accept the terms of that agreement to use this software.
  ==
  == Copyright (C) 2006-2010 Pentaho
  == All Rights Reserved.
  ==
  == This file defines an DataSourcesConfig schema for an XMLA Service Provider.
  -->
<Model
 name="datasourcesconfig"
 dtdName="datasourcesconfig.dtd"
 className="DataSourcesConfig"
 packageName="mondrian.xmla"
 root="DataSources"
 version="1.0">
    <Doc>
This is the XML model for XMLA DataSources Configuration.
    </Doc>

    <!-- DataSources ====================================================== -->
    <Element type="DataSources">
        <Doc>
            <p>The list of data sources supported by XMLA service.</p>
        </Doc>
        <Array name="dataSources" type="DataSource">
            <Doc>
                The list of data sources supported by XMLA service.
            </Doc>
        </Array>
    </Element>

    <!-- DataSource ======================================================= -->
    <Element type="DataSource">
        <Doc>
            Definition of a data source.
        </Doc>
        <Object name="name" type="DataSourceName" required="true">
            <Doc>
                Name.
            </Doc>
        </Object>
        <Object name="description" type="DataSourceDescription" required="true">
            <Doc>
                Description.
            </Doc>
        </Object>
        <Object name="url" type="URL" required="true">
            <Doc>
                URL of Web Services invocation.
            </Doc>
        </Object>
        <Object name="dataSourceInfo" type="DataSourceInfo" required="true">
            <Doc>
                ConnectString of Mondrian (minus the catalog entry).
                Required, but catalog may override.
            </Doc>
        </Object>
        <Object name="providerName" type="ProviderName" required="true">
            <Doc>
                Customized Service Provider Name.
            </Doc>
        </Object>
        <Object name="providerType" type="ProviderType" required="true">
            <Doc>
                Ignored. Only return &quot;MDP&quot; for DISCOVER_DATASOURCES.
            </Doc>
        </Object>
        <Object name="authenticationMode" type="AuthenticationMode" required="true">
            <Doc>
                Ignored. Only return &quot;Unauthenticated&quot; for DISCOVER_DATASOURCES.
            </Doc>
        </Object>
        <Object name="catalogs" type="Catalogs" required="true">
            <Doc>
                One or more Catalogs.
            </Doc>
        </Object>
        <Code><![CDATA[
            public static final String PROVIDER_TYPE_TDP = "TDP";
            public static final String PROVIDER_TYPE_MDP = "MDP";
            public static final String PROVIDER_TYPE_DMP = "DMP";
            public static final String AUTH_MODE_UNAUTHENTICATED = "Unauthenticated";
            public static final String AUTH_MODE_AUTHENTICATED = "Authenticated";
            public static final String AUTH_MODE_INTEGRATED = "Integrated";

            public String getDataSourceName() {
                return name;
            }

            public String getDataSourceDescription() {
                return description;
            }

            public String getURL() {
                return url;
            }

            public String getDataSourceInfo() {
                return dataSourceInfo;
            }

            public String getProviderName() {
                return providerName;
            }

            public String[] getProviderType() {
                return new String[] {PROVIDER_TYPE_MDP};
            }

            public String getAuthenticationMode() {
                return authenticationMode;
            }
            ]]>
        </Code>
    </Element>

    <StringElement type="DataSourceName"/>
    <StringElement type="DataSourceDescription"/>
    <StringElement type="URL"/>
    <StringElement type="DataSourceInfo"/>
    <StringElement type="ProviderName"/>
    <StringElement type="ProviderType"/>
    <StringElement type="AuthenticationMode"/>
    <StringElement type="Definition"/>

    <!-- Catalogs ========================================================= -->
    <Element type="Catalogs">
        <Doc>
            <p>The list of catalogs associated with a data source.</p>
        </Doc>
        <Array name="catalogs" type="Catalog" required="true">
            <Doc>
                The list of catalogs.
            </Doc>
        </Array>
    </Element>

    <!-- Catalog ========================================================== -->
    <Element type="Catalog">
        <Attribute name="name" required="true">
            <Doc>
                Name of the catalog.
            </Doc>
        </Attribute>
        <Object name="dataSourceInfo" type="DataSourceInfo" required="false">
            <Doc>
                ConnectString of Mondrian (minus the catalog entry).
                This entry is optional; if present, it overrides the
                DataSourceInfo within the DataSource.
            </Doc>
        </Object>
        <Object name="definition" type="Definition" required="true">
            <Doc>
                URI of the schema definition file, for example
                "/WEB-INF/schema/Marketing.xml".
            </Doc>
        </Object>
    </Element>
</Model>

<!-- End DataSourcesConfig.xml -->

