<?xml version="1.0" encoding="UTF-8"?>
<!--
- Licensed Materials - Property of IBM* and/or HCL**
- UrbanCode Deploy
- UrbanCode Build
- UrbanCode Release
- AnthillPro
- (c) Copyright IBM Corporation 2011, 2017. All Rights Reserved.
- (c) Copyright HCL Technologies Ltd. 2018. All Rights Reserved.
-
- U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by
- GSA ADP Schedule Contract with IBM Corp.
-
- * Trademark of International Business Machines
- ** Trademark of HCL Technologies Limited
-->
<plugin xmlns="http://www.urbancode.com/PluginXMLSchema_v1"
    xmlns:server="http://www.urbancode.com/PluginServerXMLSchema_v1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <header>
    <identifier id="com.urbancode.plugin.source.ClearCaseUCM" name="ClearCase" version="8"/>
    <description>
      The ClearCase plugin automates importing version artifacts from ClearCase (Base and UCM).
    </description>
    <tag>Source and Repositories/Clearcase</tag>
    <server:plugin-type>Source</server:plugin-type>
  </header>
  <step-type name="Import Version">
    <description>Import a new version from ClearCase</description>
    <properties>
    </properties>
    <post-processing><![CDATA[
        if (properties.get("exitCode") != 0) {
            properties.put(new java.lang.String("Status"), new java.lang.String("Failure"));
        }
        else {
            properties.put("Status", "Success");
        }
     ]]></post-processing>
    <command program="${JAVA_HOME}/bin/java">
      <arg value="-Dfile.encoding=${DS_SYSTEM_ENCODING}"/>
      <arg value="-Dconsole.encoding=${DS_SYSTEM_ENCODING}"/>
      <arg value="-jar"/>
      <arg file="ClearCaseSourceConfig.jar"/>
      <arg value="ImportVersion"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

    <!-- ==================================== -->
    <!--   Properties                         -->
    <!-- ==================================== -->
    <server:property-group type="Component" name="ClearCaseUCMComponentProperties">
      <server:property name="viewLocation" required="true">
        <server:property-ui type="textBox"
                          label="Path to location inside the View"
                          description="This location is the base directory from which files are imported.
                          In case of a Snapshot View, this is the portion of the Snapshot View that will
                          be updated before importing the files." />
      </server:property>
      <server:property name="includes" required="true">
        <server:property-ui type="textAreaBox"
                          label="Includes"
                          default-value="**/*"
                          description="A list of file patterns to include in the component.
                          Separate each pattern with a carriage return." />
      </server:property>
      <server:property name="excludes">
        <server:property-ui type="textAreaBox"
                          label="Excludes"
                          description="A list of file patterns to exclude from the component.
                          Separate each pattern with a carriage return." />
      </server:property>
      <server:property name="snapshot">
        <server:property-ui type="checkBox"
                          label="Snapshot View"
                          description="Check this box if connecting to a snapshot view."/>
      </server:property>
      <server:property name="path" required="true">
        <server:property-ui type="textBox"
                          label="Clear Tool Path"
                          description="If the cleartool executable is not on the path, type its location."
                          placeholder="/opt/IBM/clearcase/bin/cleartool"/>
      </server:property>
      <server:property name="saveFileExecuteBits">
        <server:property-ui type="checkBox"
                          label="Preserve Execute Permissions"
                          description="For Linux and UNIX operating systems, select this check
                          box to retain the execute permissions for each file."/>
      </server:property>
      <server:property name="extensions">
        <server:property-ui type="textBox"
                            label="Extensions of files to Convert"
                            description="If text-type files must be converted into another
                            character set, type the list of file extensions to be converted.
                            Matching file types are converted into the default or system
                            character set of the system where the agent is located.
                            Separate list items with commas."
                            placeholder=".txt,.log,.properties" />
      </server:property>
    </server:property-group>

    <server:property-group type="Import" name="ClearCaseUCMImportProperties">
      <server:property name="versionName" >
        <server:property-ui type="textBox"
                            label="Name"
                            description="The name to create this version with."/>
      </server:property>
    </server:property-group>
</plugin>
