Permalink
Browse files

[API]change the JSON structure for true RESTFULL API

  • Loading branch information...
1 parent 503ccc0 commit ca123fc31570152ad6545ead5d8a3c7d414fd660 @isma91 isma91 committed Sep 7, 2016
Showing with 8 additions and 10 deletions.
  1. +8 −10 core/src/plugins/access.ajxp_conf/src/RepositoriesManager.php
@@ -231,14 +231,12 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
if(!isSet($jsonDataCreateWorkspace["id"])) {
$jsonDataCreateWorkspace["id"] = 0;
}
- if(!isSet($jsonDataCreateWorkspace["PARAMETERS"]["CREATE"])) {
- $jsonDataCreateWorkspace["PARAMETERS"]["CREATE"] = true;
+ if(!isSet($jsonDataCreateWorkspace["parameters"]["CREATE"])) {
+ $jsonDataCreateWorkspace["parameters"]["CREATE"] = true;
}
$repo = new Repository($jsonDataCreateWorkspace["id"], $jsonDataCreateWorkspace["display"], $jsonDataCreateWorkspace["accessType"]);
- foreach($jsonDataCreateWorkspace["PARAMETERS"] as $name => $value) {
- if($name !== "META_SOURCES") {
- $repo->addOption($name, $value);
- }
+ foreach($jsonDataCreateWorkspace["parameters"] as $name => $value) {
+ $repo->addOption($name, $value);
}
$pluginService = PluginsService::getInstance($ctx);
$driver = $pluginService->getPluginByTypeName("access", $jsonDataCreateWorkspace["accessType"]);
@@ -273,16 +271,16 @@ public function repositoriesActions(ServerRequestInterface $requestInterface, Re
$metaSourceOptions[$metaID] = $defaultParams;
}
}
- if(isSet($jsonDataCreateWorkspace["PARAMETERS"]["META_SOURCES"])) {
+ if(isSet($jsonDataCreateWorkspace["features"]["META_SOURCES"])) {
foreach($arrayDefaultMetasources as $defaultPluginName) {
- foreach($jsonDataCreateWorkspace["PARAMETERS"]["META_SOURCES"] as $pluginName => $arrayPluginValue) {
+ foreach($jsonDataCreateWorkspace["features"]["META_SOURCES"] as $pluginName => $arrayPluginValue) {
if ($defaultPluginName === $pluginName) {
$arrayPluginToOverWrite[$pluginName] = $arrayPluginValue;
- unset($jsonDataCreateWorkspace["PARAMETERS"]["META_SOURCES"][$pluginName]);
+ unset($jsonDataCreateWorkspace["features"]["META_SOURCES"][$pluginName]);
}
}
}
- $arrayPluginToAdd = $jsonDataCreateWorkspace["PARAMETERS"]["META_SOURCES"];
+ $arrayPluginToAdd = $jsonDataCreateWorkspace["features"]["META_SOURCES"];
foreach($arrayPluginToOverWrite as $pluginName => $arrayPlugin) {
if(!empty($arrayPlugin)) {
foreach($arrayPlugin as $name => $value) {

0 comments on commit ca123fc

Please sign in to comment.