<?xml version="1.0" encoding="UTF-8"?>
<meta id="meta.filehasher" label="CONF_MESSAGE[File Hasher]" description="CONF_MESSAGE[Compute on-demand a hash of the file content and stores it in the metadata if a metastore is provided]" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="file:../core.ajaxplorer/ajxp_registry.xsd">
    <class_definition filename="plugins/meta.filehasher/class.FileHasher.php" classname="FileHasher"/>
    <server_settings>
        <param name="CACHE_XML_TREE" type="boolean" default="false" label="CONF_MESSAGE[Cache full tree]" description="CONF_MESSAGE[Cache XML tree and invalidate on node change]"/>
        <global_param name="RSYNC_SUPPORTED" type="boolean" label="CONF_MESSAGE[Rsync Support]" description="CONF_MESSAGE[Dont edit, it will be detected by the server]" expose="true"/>
    </server_settings>
   	<client_settings>
   		<resources>
   			<i18n namespace="meta.filehasher" path="plugins/meta.filehasher/i18n" />
   		</resources>
   	</client_settings>
   	<registry_contributions>
           <actions>
               <action name="filehasher_signature">
                   <rightsContext adminOnly="false" noUser="false" read="true" userLogged="true" write="false"/>
                   <processing>
                       <serverCallback methodName="switchActions" restParams="/file+" developerComment="Get the signature of an existing file" sdkMethodName="rdiffSignature">
                           <input_param name="file" type="AJXP_NODE" description="Path to file"/>
                       </serverCallback>
                   </processing>
               </action>
               <action name="filehasher_delta">
                   <rightsContext adminOnly="false" noUser="false" read="true" userLogged="true" write="false"/>
                   <processing>
                       <serverCallback methodName="switchActions" restParams="/file+" developerComment="Compute a delta computed against an existing signature. Signature is posted as attached file (userfile_0)" sdkMethodName="rdiffDelta">
                           <input_param name="file" type="AJXP_NODE" description="Path to file"/>
                       </serverCallback>
                   </processing>
               </action>
               <action name="filehasher_patch">
                   <rightsContext adminOnly="false" noUser="false" read="true" userLogged="true" write="true"/>
                   <processing>
                       <serverCallback methodName="switchActions" restParams="/file+" sdkMethodName="rdiffPath" developerComment="Apply a patch to an existing file. Patch is posted as attached file (userfile_0)">
                           <input_param name="file" type="AJXP_NODE" description="Path to file"/>
                       </serverCallback>
                   </processing>
               </action>
               <action name="stat_hash">
                   <rightsContext adminOnly="false" noUser="false" read="true" userLogged="true" write="false"/>
                   <processing>
                       <serverCallback methodName="switchActions" checkParams="false" restParams="/file+" developerComment="Returns an fstat() structure including the hash of the file">
                           <input_param description="One or more nodes to stat." name="nodes" type="AJXP_NODE[]"/>
                           <output type="json"/>
                       </serverCallback>
                   </processing>
               </action>
               <action name="ls" dirDefault="true">
                   <pre_processing>
                       <serverCallback methodName="checkFullTreeCache" applyCondition="$apply=isSet($httpVars['recursive']);"/>
                   </pre_processing>
                   <post_processing>
                       <serverCallback methodName="cacheFullTree" capture="true" applyCondition="$apply=isSet($httpVars['recursive']);"/>
                   </post_processing>
               </action>
           </actions>
   		<hooks>
   			<serverCallback hookName="node.info" methodName="getFileHash" applyCondition="$apply = isSet($_GET['recursive']);"/>
   			<serverCallback hookName="node.change" methodName="invalidateHash" defer="true"/>
   		</hooks>
    </registry_contributions>
</meta>
