<?xml version="1.0" encoding="UTF-8"?>
<ajxpdriver name="ftp" label="CONF_MESSAGE[FTP Server]" description="CONF_MESSAGE[This driver can access a remote FTP server]" mixins="credentials_consumer,filesystem_commons,slug_provider,template_provider"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
    <client_settings icon="plugins/access.ftp/icon.png" description_template="{FTP_HOST}/{PATH}" iconClass="icon-sitemap">
        <resources>
            <i18n namespace="ftp_access" path="plugins/access.ftp/i18n"/>
            <js className="FSActions" file="plugins/access.fs/res/build/FSActions.js" depends="PydioComponents"/>
        </resources>
    </client_settings>

	<server_settings>
		<param group="CONF_MESSAGE[Connexion]" name="FTP_HOST" type="string" label="CONF_MESSAGE[Host]" description="CONF_MESSAGE[Ftp Host to connect to]" mandatory="true"/>
		<param group="CONF_MESSAGE[Connexion]" name="FTP_PORT" type="string" label="CONF_MESSAGE[Port]" description="CONF_MESSAGE[Ftp Host port]" mandatory="true" default="21"/>
		<param group="CONF_MESSAGE[Connexion]" name="PATH" type="string" label="CONF_MESSAGE[Path]" description="CONF_MESSAGE[Real path to the root folder on the server]" mandatory="true" default="/"/>
		<param group="CONF_MESSAGE[Connexion]" name="FTP_SECURE" type="boolean" label="CONF_MESSAGE[Secure]" description="CONF_MESSAGE[Whether to use ftp or ftps protocol]" mandatory="true" default="false"/>
		<param group="CONF_MESSAGE[Connexion]" name="FTP_DIRECT" type="boolean" label="CONF_MESSAGE[Active]" description="CONF_MESSAGE[Whether to use active or passive]" mandatory="true" default="false"/>
        <param group="CONF_MESSAGE[Connexion]" name="TEST_CONNEXION" type="button" choices="run_plugin_action:access.ftp:testParameters" label="CONF_MESSAGE[Test Connexion]" description="CONF_MESSAGE[Test FTP connexion]" mandatory="false"/>
        <param group="CONF_MESSAGE[FTP Server Tweaks]" name="CREATE" type="boolean" label="CONF_MESSAGE[Create]" description="CONF_MESSAGE[Create folder if it does not exists]" default="false" mandatory="false"/>
        <param group="CONF_MESSAGE[FTP Server Tweaks]" name="UID" type="string" label="CONF_MESSAGE[User Id]" description="CONF_MESSAGE[To fetch the user id you have to run a listing command on your ftp client (ls or dir most of the time) and take the first of the two last numbers as the user id. It can be possible that there is more than one number. If you experience errors using one id try to use another one.]" mandatory="true"/>
        <param group="CONF_MESSAGE[FTP Server Tweaks]" name="FIX_PERMISSIONS" type="select" choices="detect_remote_user_id|Detect remote server user,user|Copy user perms to all,group|Copy group perms to all" label="CONF_MESSAGE[Fix Permissions]" description="CONF_MESSAGE[How to handle remote permissions to be used by PHP as local permissions. See manual.]" mandatory="false" default="detect_remote_user_id"/>
	    <param group="CONF_MESSAGE[FTP Server Tweaks]" name="TMP_UPLOAD" type="string" label="CONF_MESSAGE[Temporary Folder]" description="CONF_MESSAGE[Temporary folder on the local server used for file uploads. For the moment, it must be placed under your ajaxplorer folder and you must create it and set it writeable by Apache.]" default="/tmp" mandatory="true"/>
        <param group="CONF_MESSAGE[Dynamic FTP]" name="DYNAMIC_FTP" type="boolean" label="CONF_MESSAGE[Pass Ftp data through Auth driver]" description="CONF_MESSAGE[In conjunction with a correctly configured auth.ftp driver, this allow to transform ajaxplorer into a simple netFtp client.]" mandatory="false" default="false"/>
        <global_param group="MIXIN_MESSAGE[Metadata and indexation]" name="DEFAULT_METASOURCES" type="string" label="MIXIN_MESSAGE[Default Metasources]" description="MIXIN_MESSAGE[Comma separated list of metastore and meta plugins, that will be automatically applied to all repositories created with this driver]" mandatory="false" default="metastore.serial,meta.filehasher,index.lucene"/>
    </server_settings>
	<registry_contributions>
		<client_configs>
            <template_part ajxpId="search_container" ajxpClass="SearchEngine" ajxpOptions='{"toggleResultsVisibility":"search_results_cont", "openSearchInput":"true", "openSearchStickLeftTo":"topPane", "searchChooserAsResultsHeader":true, "toggleResultsFitTo":"cpane_tabs", "fitMarginBottom":0, "toggleResultsOffsetRight":0, "toggleResultsOffsetTop":0, "detailThumbSize":24}'/>
            <component_config component="FilesList">
				<columns switchGridMode="filelist">
					<column messageId="1" attributeName="ajxp_label"/>
					<column messageId="2" attributeName="filesize"/>
					<column messageId="3" attributeName="mimestring"/>
					<column messageId="4" attributeName="ajxp_modiftime"/>
				</columns>
			</component_config>
			<component_config component="FoldersTree">
				<property name="display" value="d"/>
			</component_config>
		</client_configs>
        <external_file filename="plugins/access.fs/fsTemplatePart.xml" include="client_configs/*" exclude=""/>
		<external_file filename="plugins/access.fs/fsActions.xml" include="actions/*" exclude=""/>
		<external_file filename="plugins/access.fs/fsActions.xml" include="client_configs/*"/>
        <external_file filename="plugins/access.fs/manifest.xml" include="registry_contributions/hooks/*" exclude=""/>
        <actions>
            <action name="next_to_remote">
                <processing><serverCallback methodName="uploadActions"/></processing>
            </action>
        </actions>
	</registry_contributions>
	<class_definition filename="plugins/access.ftp/FtpAccessDriver.php" classname="Pydio\Access\Driver\StreamProvider\FTP\FtpAccessDriver"/>
	<dependencies>
		<pluginClass pluginName="access.fs"/>
	</dependencies>
    <class_stream_wrapper filename="plugins/access.ftp/FtpAccessWrapper.php" classname="Pydio\Access\Driver\StreamProvider\FTP\FtpAccessWrapper" protocol="ajxp.ftp"/>
</ajxpdriver>
