<?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.air.plugin.source.fileSystemBasic" name="File System" version="17"/>
    <description>
      The File System plugin automates uploading artifacts from a normal file system.
      </description>
    <tag>Source and Repositories/File System</tag>
    <server:plugin-type>Source</server:plugin-type>
  </header>

    <step-type name="Import Version">
      <description>Creates a new component version and imports artifacts</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="${PLUGIN_HOME}/javawrapper.sh">
        <arg value="-jar"/>
        <arg file="FileSystemSourceConfig.jar"/>
        <arg value="ImportVersion"/>
        <arg file="${PLUGIN_INPUT_PROPS}"/>
        <arg file="${PLUGIN_OUTPUT_PROPS}"/>
      </command>

    </step-type>

    <!-- ==================================== -->
    <!--   Properties                         -->
    <!-- ==================================== -->
    <server:property-group type="Component" name="FileSystemComponentProperties">
      <server:property name="basePath" required="true">
        <server:property-ui type="textBox"
                            label="Base Path"
                            description="Specify the path to the directory that contains the artifacts."
                            placeholder="/home/user/components" />
      </server:property>
      <server:property name="useNamePattern">
        <server:property-ui type="checkBox"
                            label="Always Use Name Pattern"
                            description="If selected, new versions are automatically named according
                            to the pattern in the Version Name Pattern field. If cleared, you must
                            specify a name each time you create a version." />
      </server:property>
      <server:property name="namePattern">
        <server:property-ui type="textBox"
                            label="Version Name Pattern"
                            description="Specify a pattern for each version name. You can use the
                            ${version} variable to include an automatically incremented version number.
                            For example, the mycomp_${version} pattern produces versions such as
                            mycomp_1, mycomp_2, and so on. This parameter is meaningful only if
                            you select the Always Use Name Pattern check box."
                            default-value="${version}"/>
      </server:property>
      <server:property name="nextNumber">
        <server:property-ui type="textBox"
                            label="Next Version Number"
                            description="Specify the version number for the next version. This parameter
                            is meaningful only if you select the Always Use Name Pattern check box."/>
      </server:property>
      <server:property name="extensions">
        <server:property-ui type="textBox"
                            label="Extensions of files to Convert"
                            description="If text-typefiles must be converted into another character set,
                            type the list of file extensions to be converted. Matching file types are
                            converted into the default character set of the system where the agent is
                            located. Separate list items with commas."
                            placeholder=".txt,.log,.properties"/>
      </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-group>

    <server:property-group type="Import" name="FileSystemImportProperties">
      <server:property name="name" required="true">
        <server:property-ui type="textBox"
                            label="Version Name"
                            description="The name for this version." />
      </server:property>
      <server:property name="description">
        <server:property-ui type="textBox"
                            label="Version Description"
                            description="The description for this version." />
      </server:property>
    </server:property-group>
</plugin>
