<!--
  ~ Copyright (c) 2020 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.
  -->
<report oid="be1bbcad-94bd-450c-89c2-feeac926f839"
        xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
        xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
        xmlns:piracy="http://midpoint.evolveum.com/xml/ns/samples/piracy">
    <name>Import Roles</name>

    <behavior>
        <!--
            Maybe direction could be specified in the task parameter?
            We can have reports that work for both export and import.
         -->
        <direction>import</direction>
        <importOptions> TODO: ImportOptionsType </importOptions>
    </behavior>

    <objectCollection>
        <view>
            <column>
                <name>username</name>
                <path>name</path>
            </column>
            <column>
                <name>first_name</name>
                <path>givenName</path>
            </column>
            <column>
                <name>last_name</name>
                <path>familyName</path>
            </column>
            <column>
                <name>enabled</name>
                <path>activation/administrativeStatus</path>
                <import>
                    <expression>
                        <script>
                            <code>
                                if (input) { return com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType.ENABLED; }
                                else { return com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType.DISABLED; }
                            </code>
                        </script>
                    </expression>
                </import>
            </column>
        </view>
    </objectCollection>

    <fileFormat> <!-- was: <export> -->
        <!-- We can specify more than one format here. The import code may autodetect format. -->
        <csv>
            <header>true</header> <!-- was: <createHeader> -->
        </csv>
        <xls>
            <!-- Excel format, for midPoint 4.3 or later -->
        </xls>
    </fileFormat>
</report>
