<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2010-2017 Evolveum
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->


<!--

This file is an example of Resource definition. It defines an database table
resource. The users are stored as rows in simple database table. The definition
is using MySQL database driver.

See the content of the SQL files in this directory to see the table structure.

-->

<resource xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
    xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
    xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance/ef2bc95b-76e0-48e2-86d6-3d4f02d3eeee"
    xmlns:icfc="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3"
    xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
    xmlns:my="http://myself.me/schemas/whatever">

        <!-- Resource name. It will be displayed in GUI.  -->
    <name>Localhost DBTable</name>

         <!-- Reference to the ICF DatabaseTable connector. OID is "virtual" for now. -->
    <connectorRef type="ConnectorType">
        <filter>
            <q:text>c:connectorType = "org.identityconnectors.databasetable.DatabaseTableConnector"</q:text>
          </filter>
    </connectorRef>

        <!-- Configuration section contains configuration of the connector,
             such as hostnames and passwords -->
    <connectorConfiguration>

        <!-- Configuration specific for the DBTable connector -->
        <icfc:configurationProperties
                xmlns:icscdbtable="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.polygon.connector-databasetable/org.identityconnectors.databasetable.DatabaseTableConnector">
            <icscdbtable:port>3306</icscdbtable:port>
            <icscdbtable:quoting></icscdbtable:quoting>
            <icscdbtable:host>localhost</icscdbtable:host>
            <icscdbtable:user>midpoint_tests</icscdbtable:user>
            <icscdbtable:password><clearValue>secret</clearValue></icscdbtable:password>
            <icscdbtable:database>midpoint_tests</icscdbtable:database>
            <icscdbtable:table>idrepo</icscdbtable:table>
            <icscdbtable:keyColumn>userId</icscdbtable:keyColumn>
            <icscdbtable:passwordColumn>password</icscdbtable:passwordColumn>
            <icscdbtable:jdbcDriver>com.mysql.jdbc.Driver</icscdbtable:jdbcDriver>
            <icscdbtable:jdbcUrlTemplate>jdbc:mysql://%h:%p/%d?useUnicode=true&amp;characterEncoding=utf8&amp;connectionCollation=utf8_bin</icscdbtable:jdbcUrlTemplate>
            <icscdbtable:enableEmptyString>false</icscdbtable:enableEmptyString>
            <icscdbtable:rethrowAllSQLExceptions>true</icscdbtable:rethrowAllSQLExceptions>
            <icscdbtable:nativeTimestamps>false</icscdbtable:nativeTimestamps>
            <icscdbtable:allNative>false</icscdbtable:allNative>
            <icscdbtable:changeLogColumn></icscdbtable:changeLogColumn>
            <icscdbtable:datasource></icscdbtable:datasource>
        </icfc:configurationProperties>

    </connectorConfiguration>

</resource>
