Commit a128b7e8 authored by François Agneray's avatar François Agneray
Browse files

Mise à jour mcd 2

parent 8a907a2b
documentation/mcd/anis_v3_mcd.png

93 KB | W: | H:

documentation/mcd/anis_v3_mcd.png

91.6 KB | W: | H:

documentation/mcd/anis_v3_mcd.png
documentation/mcd/anis_v3_mcd.png
documentation/mcd/anis_v3_mcd.png
documentation/mcd/anis_v3_mcd.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -12,16 +12,16 @@ DF8, 11 output_category, 0N output_family
file: id, label, file_loc, type, display, visible
DF5, ON dataset, 11 file
dataset: name, table_ref, label, description, illustration, display, count, vo, data_path
dataset: name, table_ref, label, description, display, count, vo, data_path
DF4, 0N dataset, 11 attribute
attribute: id, name, table_name, label, form_label, description, output_display, criteria_display, search_flag, search_type, operator, type, min, max, placeholder_min, placeholder_max, uri_action, renderer, display_detail, selected, order_by, order_display, detail, renderer_detail, options, vo_utype, vo_ucd, vo_unit, vo_description, vo_datatype, vo_size
DF9, 0N output_category, 11 attribute
DF9, 0N output_category, 01 attribute
output_category: id, label, display
dataset_privileges, 0N anis_group, 0N dataset: visible
anis_group: id, label
criteria_family: id, label, display
DF3, 0N criteria_family, 11 attribute
DF3, 0N criteria_family, 01 attribute
DF7, 0N anis_group, 11 anis_user
anis_user: email, password, activation_key, activated, adminsi, superuser
\ No newline at end of file
<?php declare(strict_types=1);
/*
* This file is part of ANIS SERVER API.
*
* (c) François Agneray <francois.agneray@lam.fr>
* (c) Chrystel Moreau <chrystel.moreau@lam.fr>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Action\Meta;
use Psr\Log\LoggerInterface;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use App\Utils\ActionTrait;
final class OptionListAction
{
use ActionTrait;
private $logger;
private $em;
public function __construct(LoggerInterface $logger, EntityManagerInterface $em)
{
$this->logger = $logger;
$this->em = $em;
}
public function __invoke(Request $request, Response $response, array $args): Response
{
$this->logger->info('Project action dispatched');
if ($request->isOptions()) {
return $response->withHeader('Access-Control-Allow-Methods', 'GET, OPTIONS');
}
$dataset = $this->em->find('App\Entity\Dataset', $args['name']);
if (is_null($dataset)) {
return $this->dispatchHttpError(
$response,
'Invalid request',
'Dataset with name ' . $args['name'] . ' is not found'
)->withStatus(404);
}
if ($request->isGet()) {
$options = array();
foreach ($dataset->getAttributes() as $attribute) {
$options[] = array(
'id_attribute' => $attribute->getId(),
'options' => $attribute->getOptions()->getValues()
);
}
$newResponse = $response->withJson($options);
}
return $newResponse;
}
}
......@@ -198,7 +198,7 @@ class Attribute implements \JsonSerializable
/**
* @var string
*
*
* @Column(type="json", name="options", nullable=true)
*/
protected $options;
......
......@@ -34,7 +34,7 @@ class CriteriaFamily implements \JsonSerializable
/**
* @var integer
*
*
* @Column(type="integer", nullable=false)
*/
protected $display;
......
......@@ -34,14 +34,14 @@ class OutputCategory implements \JsonSerializable
/**
* @var integer
*
*
* @Column(type="integer", nullable=false)
*/
protected $display;
/**
* @var Anis\Entity\OutputFamily
*
*
* @ManyToOne(targetEntity="OutputFamily", inversedBy="outputCategories")
* @JoinColumn(name="output_family", referencedColumnName="id", nullable=false)
*/
......
......@@ -34,7 +34,7 @@ class OutputFamily implements \JsonSerializable
/**
* @var integer
*
*
* @Column(type="integer", nullable=false)
*/
protected $display;
......
......@@ -38,7 +38,6 @@ $app->map(['OPTIONS', 'GET', 'PUT', 'DELETE'], '/metadata/dataset/{name}', App\A
$app->map(['OPTIONS', 'GET', 'PUT'], '/metadata/dataset/{name}/attribute', App\Action\Meta\AttributeListAction::class);
$app->map(['OPTIONS', 'GET'], '/metadata/dataset/{name}/criteria-family', App\Action\Meta\DatasetCriteriaFamilyListAction::class);
$app->map(['OPTIONS', 'GET'], '/metadata/dataset/{name}/output-family', App\Action\Meta\DatasetOutputFamilyListAction::class);
$app->map(['OPTIONS', 'GET'], '/metadata/dataset/{name}/attribute/option', App\Action\Meta\OptionListAction::class);
$app->map(['OPTIONS', 'GET'], '/metadata/dataset/{name}/get-file/{path}', App\Action\Meta\FileProxyAction::class);
$app->map(['OPTIONS', 'GET', 'POST'], '/metadata/dataset/{name}/file', App\Action\Meta\FileListAction::class);
$app->map(['OPTIONS', 'GET', 'PUT', 'DELETE'], '/metadata/file/{id}', App\Action\Meta\FileAction::class);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment