<resource oid="80d0e843-906a-4bbe-b237-bd3568ec4169"
          xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
          xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
          xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
          xmlns:icfc="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3">
    <name>ldap</name>
    <lifecycleState>active</lifecycleState>
    <connectorRef type="ConnectorType">
        <filter>
            <q:text>connectorType = 'com.evolveum.polygon.connector.csv.CsvConnector'</q:text>
        </filter>
    </connectorRef>
    <connectorConfiguration xmlns:icfi="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.polygon.connector-csv/com.evolveum.polygon.connector.csv.CsvConnector">
        <icfc:configurationProperties>
            <icfi:filePath>~/sim-tutorial/ldap.csv</icfi:filePath>
            <icfi:encoding>utf-8</icfi:encoding>
            <icfi:fieldDelimiter>,</icfi:fieldDelimiter>
            <icfi:multivalueDelimiter>;</icfi:multivalueDelimiter>
            <icfi:uniqueAttribute>dn</icfi:uniqueAttribute>
        </icfc:configurationProperties>
    </connectorConfiguration>
    <schemaHandling>
        <objectType>
            <kind>account</kind>
            <intent>default</intent>
            <default>true</default>
            <delineation>
                <!-- Would be inetOrgPerson on real LDAP -->
                <objectClass>ri:AccountObjectClass</objectClass>
            </delineation>
            <attribute>
                <ref>ri:employeeNumber</ref>
                <inbound>
                    <target>
                        <path>employeeNumber</path>
                    </target>
                    <!-- This is a kind of hack. We want to correlate on this attribute by a simple mapping but do not want
                         to use it to really modify the focus. This may happen for correlation attributes on non-authoritative
                         resources (e.g. target ones, or "auxiliary" source ones). Repeated for other attributes. -->
                    <evaluationPhases>
                        <include>beforeCorrelation</include>
                        <exclude>clockwork</exclude>
                    </evaluationPhases>
                </inbound>
            </attribute>
            <attribute>
                <ref>ri:mail</ref>
                <inbound>
                    <target>
                        <path>emailAddress</path>
                    </target>
                    <evaluationPhases>
                        <include>beforeCorrelation</include>
                        <exclude>clockwork</exclude>
                    </evaluationPhases>
                </inbound>
            </attribute>
            <attribute>
                <ref>ri:givenName</ref>
                <inbound>
                    <target>
                        <path>givenName</path>
                    </target>
                    <evaluationPhases>
                        <include>beforeCorrelation</include>
                        <exclude>clockwork</exclude>
                    </evaluationPhases>
                </inbound>
            </attribute>
            <attribute>
                <ref>ri:sn</ref>
                <inbound>
                    <target>
                        <path>familyName</path>
                    </target>
                    <evaluationPhases>
                        <include>beforeCorrelation</include>
                        <exclude>clockwork</exclude>
                    </evaluationPhases>
                </inbound>
            </attribute>
            <correlation>
                <correlators>
                    <items>
                        <item>
                            <ref>employeeNumber</ref>
                        </item>
                        <composition>
                            <tier>1</tier>
                        </composition>
                    </items>
                    <items>
                        <item>
                            <ref>emailAddress</ref>
                        </item>
                        <composition>
                            <tier>2</tier>
                        </composition>
                    </items>
                    <items>
                        <item>
                            <ref>givenName</ref>
                        </item>
                        <item>
                            <ref>familyName</ref>
                        </item>
                        <composition>
                            <tier>3</tier>
                            <weight>0.8</weight>
                        </composition>
                    </items>
                </correlators>
            </correlation>
            <synchronization>
                <reaction>
                    <situation>linked</situation>
                    <actions>
                        <synchronize/>
                    </actions>
                </reaction>
                <reaction>
                    <situation>unlinked</situation>
                    <actions>
                        <link/>
                    </actions>
                </reaction>
                <reaction>
                    <situation>disputed</situation>
                    <actions>
                        <createCorrelationCase/>
                    </actions>
                </reaction>
                <reaction>
                    <situation>deleted</situation>
                    <actions>
                        <unlink/>
                    </actions>
                </reaction>
                <!-- intentionally no reaction for unmatched -->
            </synchronization>
        </objectType>
    </schemaHandling>
</resource>
