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

Commit

Permalink
Update sdk generator: do not skip already parsed actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Jan 11, 2016
1 parent b41e963 commit 046772e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions core/src/core/classes/class.PydioSdkGenerator.php
Expand Up @@ -27,6 +27,10 @@
* @package Pydio
* @subpackage Core
*/

define("JSON_DIR", AJXP_INSTALL_PATH."/../api");
define("JSON_URL", "https://pydio.com/static-docs/api");

class PydioSdkGenerator
{
public static function analyzeRegistry($versionString)
Expand All @@ -39,7 +43,7 @@ public static function analyzeRegistry($versionString)
$pServ = AJXP_PluginsService::getInstance();
$nodes = $pServ->searchAllManifests('//actions/*/processing/serverCallback[@developerComment]', 'node', false, false, true);
$jsFile = AJXP_DATA_PATH."/public/sdkMethods.js";
$swaggerJsonDir = AJXP_INSTALL_PATH."/core/doc/api";
$swaggerJsonDir = JSON_DIR."/".$versionString;
$swaggerAPIs = array();
$methods = array();
$alreadyParsed = array();
Expand All @@ -53,10 +57,12 @@ public static function analyzeRegistry($versionString)
$methodName = $actionName;
}
$outputType = 'xml';
/*
if(in_array($actionName, $alreadyParsed)){
continue;
}
$alreadyParsed[] = $actionName;
*/
if(!isset($swaggerAPIs[$pluginName])) $swaggerAPIs[$pluginName] = array();

foreach ($callbackNode->childNodes as $child) {
Expand Down Expand Up @@ -125,15 +131,15 @@ public static function analyzeRegistry($versionString)
$swaggerJson = array(
"apiVersion" => $versionString,
"swaggerVersion" => 1.2,
"basePath" => "https://pyd.io/resources/serverapi/$versionString/api",
"basePath" => JSON_URL."/$versionString",
"resourcePath" => "/api",
"produces" => array("application/xml"),
"apis" => $apis
);
file_put_contents($swaggerJsonDir."/".$pluginName, json_encode($swaggerJson, JSON_PRETTY_PRINT));
$p = $pServ->findPluginById($pluginName);
$apidocs["apis"][] = array(
"path" => "https://pyd.io/resources/serverapi/$versionString/api/".$pluginName,
"path" => JSON_URL."/$versionString/".$pluginName,
"description" => substr($p->getManifestDescription(), 0, 40)."..."
);

Expand Down

0 comments on commit 046772e

Please sign in to comment.