1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- require_once('request.php');
- class arkiwiRequestGetListMetadata extends arkiwiRequest
- {
- private $item64 = null;
- public function __construct($request) {
- parent::__construct($request);
- $extra = $this->getRequestExtra();
- $this->item64 = $extra[0];
- }
- public function run() {
- if($this->request['method'] != 'GET') {
- $this->setBodyError(500, "arkiwiRequestPostMetadata: POST method required.");
- return;
- }
- //INIZIO CAZZACCROCCHIO
- //lo rimuoveremo quando H si decide a scrivere la parte che legge metadati anche nell'uploader
- $items = array();
- $metadata = file_get_contents($GLOBALS["conf"]["assetstore_endpoint"]."/item64/".$this->item64."/direct");
- $metadata = simplexml_load_string($metadata)->xpath("/item/*");
- for ($i = 0; $i < count($metadata); $i++) {
- $namespace = $metadata[$i]->getNamespaces();
- if (!$namespace[arav]) {
- $items[] = array("name" => $metadata[$i]->getName(), "value" => $metadata[$i]->__toString());
- }
- }
- json_encode($items);
- //FINE CAZZACCROCCHIO
- $this->setCode(201);
- $this->setBodyJSON($items);
- }
- }
|