<!--
  ~ Copyright (c) 2020 Evolveum and contributors
  ~
  ~ Licensed under the EUPL-1.2 or later.
  -->

<archetype oid="00000000-0000-0000-0000-000000000513"
        xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:mext="http://midpoint.evolveum.com/xml/ns/public/model/extension-3">
    <name>Shadow integrity check task</name>
    <archetypeType>auxiliary</archetypeType>
    <archetypePolicy>
        <display>
            <label>
                <orig>Shadow integrity check task</orig>
                <translation>
                    <key>ShadowIntegrityCheckTask.label</key>
                </translation>
            </label>
            <pluralLabel>
                <orig>Shadow integrity check tasks</orig>
                <translation>
                    <key>TaskHandlerSelector.model.shadow.integrity.check.handler</key>
                </translation>
            </pluralLabel>
            <icon>
                <cssClass>fa fa-wrench</cssClass>
                <color>green</color>
            </icon>
        </display>
        <itemConstraint id="1">
            <path>extension</path>
            <visibility>vacant</visibility>
        </itemConstraint>
        <itemConstraint id="2">
            <path>extension/mext:objectType</path>
            <visibility>hidden</visibility>
        </itemConstraint>
        <itemConstraint id="3">
            <path>extension/mext:objectQuery</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="4">
            <path>extension/mext:searchOptions</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="5">
            <path>extension/mext:iterationMethod</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="6">
            <path>extension/mext:useRepositoryDirectly</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="7">
            <path>extension/mext:failedObjectsSelector</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="8">
            <path>extension/mext:workerThreads</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="9">
            <path>extension/mext:dryRun</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="10">
            <path>extension/mext:diagnose</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="11">
            <path>extension/mext:fix</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="12">
            <path>extension/mext:duplicateShadowsResolver</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <itemConstraint id="13">
            <path>extension/mext:checkDuplicatesOnPrimaryIdentifiersOnly</path>
            <visibility>visible</visibility>
        </itemConstraint>
        <adminGuiConfiguration>
            <objectDetails>
                <type>TaskType</type>
                <panel id="14">
                    <identifier>activity</identifier>
                    <panel id="15">
                        <identifier>work</identifier>
                        <container id="16">
                            <identifier>work-shadowIntegrityCheck</identifier>
                            <path>activity/work/shadowIntegrityCheck</path>
                        </container>
                    </panel>
                </panel>
            </objectDetails>
        </adminGuiConfiguration>
    </archetypePolicy>
    <assignment id="17">
        <identifier>holderType</identifier>
        <assignmentRelation id="18">
            <holderType>TaskType</holderType>
        </assignmentRelation>
    </assignment>
    <inducement id="19">
        <identifier>nameMapping</identifier>
        <focusMappings>
            <mapping id="20">
                <strength>weak</strength>
                <expression>
                    <script>
                        <code>
                            return source.name
                        </code>
                    </script>
                </expression>
                <target>
                    <path>name</path>
                </target>
            </mapping>
        </focusMappings>
    </inducement>
    <inducement id="21">
        <identifier>shadowMapping</identifier>
        <focusMappings>
            <mapping id="22">
                <strength>weak</strength>
                <expression>
                    <value>shadow</value>
                </expression>
                <target>
                    <c:path>extension/mext:objectType</c:path>
                </target>
            </mapping>
        </focusMappings>
    </inducement>
</archetype>
