<?xml version="1.0" encoding="UTF-8"?>
<!--
- Licensed Materials - Property of IBM Corp.
- IBM UrbanCode Build
- IBM UrbanCode Deploy
- IBM UrbanCode Release
- IBM AnthillPro
- (c) Copyright IBM Corporation 2002, 2014. All Rights Reserved.
-
- U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by
- GSA ADP Schedule Contract with IBM Corp.
-->
<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.Subversion" name="Subversion" version="11"/>
    <description>
      The Subversion source configuration plugin automates importing artifacts from a Subversion repository
      </description>
    <tag>Source and Repositories/Subversion</tag>
    <server:plugin-type>Source</server:plugin-type>
  </header>
  <step-type name="Import Version">
    <description>Description</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="SubversionSourceConfig.jar"/>
      <arg value="ImportVersion"/>
      <arg file="${PLUGIN_INPUT_PROPS}"/>
      <arg file="${PLUGIN_OUTPUT_PROPS}"/>
    </command>
  </step-type>

    <!-- ==================================== -->
    <!--   Properties                         -->
    <!-- ==================================== -->
    <server:property-group type="Component" name="SubversionComponentProperties">
      <server:property name="repoUrl" required="true">
        <server:property-ui type="textBox"
                            label="Repository URL"
                            description="The location of the Subversion repository."
                            default-value="${p?:component/svn.repoUrl}" />
      </server:property>
      <server:property name="watchTags">
        <server:property-ui type="checkBox"
                            label="Watch for tags"
                            description="When selected, tags are used as the basis for new component versions." />
      </server:property>
      <server:property name="includes">
        <server:property-ui type="textAreaBox"
                            label="Includes"
                            default-value="**/*"
                            description="The file name patterns used to match files for inclusion.
                            The wildcard ** indicates every directory, and the wildcard * indicates
                            every file. The pattern dist/**/*, for example, retrieves the entire
                            file tree beneath the dist directory. Separate each pattern with a
                            carriage return." />
      </server:property>
      <server:property name="excludes">
        <server:property-ui type="textAreaBox"
                            label="Excludes"
                            description="The file name patterns used to match files for exclusion.
                            The wildcard ** indicates every directory, and the wildcard * indicates
                            every file. Separate each pattern with a carriage return." />
      </server:property>
      <server:property name="user">
        <server:property-ui type="textBox"
                            label="User"
                            description="Username to authenticate with the Subversion repository."
                            default-value="${p?:component/svn.username}" />
      </server:property>
      <server:property name="password">
        <server:property-ui type="secureBox"
                            label="Password"
                            description="Password to authenticate with the Subversion repository."
                            default-value="${p?:component/svn.password}" />
      </server:property>
      <server:property name="svnPath" required="true">
        <server:property-ui type="textBox"
                            label="SVN Path"
                            default-value="svn"
                            description="The path to the svn executable file on the IBM UrbanCode
                            Deploy server. If you added the executable file to the system PATH
                            variable, you can specify the name of the executable file, such as
                            svn. If you have not added the executable file to the system PATH
                            variable, specify the complete path, such as /usr/bin/svn." />
      </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 character set of the system where the agent
                          is located. Separate list items with commas."
                          placeholder=".txt,.log,.properties" />
    </server:property>
    <server:property name="svnProxyHost">
      <server:property-ui type="textBox"
                          label="Proxy Hostname"
                          description="Specify the hostname of the proxy server if connecting to a Subversion
                          repository through a proxy. (e.g. 8.8.8.8)"
                          default-value="${p?:agent/svn.proxyHost}" />
    </server:property>
    <server:property name="svnProxyPort">
      <server:property-ui type="textBox"
                          label="Proxy Port Number"
                          description="Specify the port number being used by the proxy server for client
                          connections. (e.g. 80)"
                          default-value="${p?:agent/svn.proxyPort}" />
    </server:property>
        <server:property name="svnProxyUser">
      <server:property-ui type="textBox"
                          label="Proxy Username"
                          description="Specify the username to authenticate with the proxy server if authentication
                          is required."
                          default-value="${p?:agent/svn.proxyUser}" />
    </server:property>
    <server:property name="svnProxyPass">
      <server:property-ui type="secureBox"
                          label="Proxy Password"
                          description="Specify the password to authenticate with the proxy server if authentication
                          is required."
                          default-value="${p?:agent/svn.proxyPass}" />
    </server:property>
    </server:property-group>

    <server:property-group type="Import" name="SubversionImportProperties">
    <server:property name="versionOrTag">
        <server:property-ui type="textBox"
                            label="Specific version/tag" />
      </server:property>
    </server:property-group>
</plugin>
