Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Filehasher: publish rsync extension support through a plugin exposed …
Browse files Browse the repository at this point in the history
…parameter - document sdk methods for rest access.
  • Loading branch information
cdujeu committed Jun 5, 2014
1 parent a4b9cc5 commit e661790
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
27 changes: 23 additions & 4 deletions core/src/plugins/meta.filehasher/class.FileHasher.php
Expand Up @@ -40,6 +40,25 @@ public static function rsyncEnabled()
return function_exists("rsync_generate_signature");
}

public function getConfigs()
{
$data = parent::getConfigs();
$this->filterData($data);
return $data;
}
public function loadConfigs($data)
{
$this->filterData($data);
parent::loadConfigs($data);

}

private function filterData(&$data)
{
$data["RSYNC_SUPPORTED"] = self::rsyncEnabled();
}


public function parseSpecificContributions(&$contribNode)
{
parent::parseSpecificContributions($contribNode);
Expand All @@ -62,12 +81,12 @@ public function parseSpecificContributions(&$contribNode)
}
}

public function initMeta($accessDriver)
{
$this->accessDriver = $accessDriver;
public function initMeta($accessDriver)
{
$this->accessDriver = $accessDriver;
$store = AJXP_PluginsService::getInstance()->getUniqueActivePluginForType("metastore");
if ($store === false) {
throw new Exception("The 'meta.simple_lock' plugin requires at least one active 'metastore' plugin");
throw new Exception("The 'meta.simple_lock' plugin requires at least one active 'metastore' plugin");
}
$this->metaStore = $store;
$this->metaStore->initMeta($accessDriver);
Expand Down
13 changes: 10 additions & 3 deletions core/src/plugins/meta.filehasher/manifest.xml
Expand Up @@ -4,6 +4,7 @@
<class_definition filename="plugins/meta.filehasher/class.FileHasher.php" classname="FileHasher"/>
<server_settings>
<param name="CACHE_XML_TREE" type="boolean" default="false" label="Cache full tree" description="Cache XML tree and invalidate on node change"/>
<global_param name="RSYNC_SUPPORTED" type="boolean" label="Rsync Support" description="Don't edit, it will be detected by the server" expose="true"/>
</server_settings>
<client_settings>
<resources>
Expand All @@ -15,19 +16,25 @@
<action name="filehasher_signature">
<rightsContext adminOnly="false" noUser="false" read="true" userLogged="true" write="false"/>
<processing>
<serverCallback methodName="switchActions"/>
<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"/>
<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"/>
<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">
Expand Down

0 comments on commit e661790

Please sign in to comment.