Example #1
0
 public function fetchAll($filter = null, $format = '', $xmldetailed = false)
 {
     if ($format === "xml") {
         $ores = parent::fetchAll(null);
         $ids = array();
         foreach ($ores as $i) {
             $ids[] = $i->void;
         }
         $res = new Default_Model_VOs();
         $res->filter->id->in($ids);
         if ($filter !== null) {
             $res->filter->chain($filter, "AND");
         }
         $res->filter->orderBy("name");
         $res->refresh("xml", $xmldetailed);
         $ret = $res->items;
         for ($ic = 0; $ic < count($ret); $ic++) {
             $i = $ret[$ic];
             $ii = '<e xmlns:vo="' . RestAPIHelper::XMLNS_VO() . "\" xmlns:discipline=\"" . RestAPIHelper::XMLNS_DISCIPLINE() . "\">{$i}</e>";
             $x = new SimpleXMLElement($ii);
             $x = $x->xpath("//vo:vo");
             $x = $x[0];
             $xid = strval($x->attributes()->id);
             foreach ($ores as $j) {
                 if ($j->void == $xid) {
                     $i = str_replace("<vo:vo ", "<vo:vo relation=\"" . strtolower(str_replace("VO ", "", $j->role)) . "\" ", $i);
                     $ret[$ic] = $i;
                     break;
                 }
             }
         }
         return $ret;
     } else {
         return parent::fetchAll($filter, $format, $xmldetailed);
     }
 }
Example #2
0
 public static function namespaces()
 {
     $ns = array();
     $ns[] = 'xmlns:xs="' . RestAPIHelper::XMLNS_XS() . '"';
     $ns[] = 'xmlns:xsi="' . RestAPIHelper::XMLNS_XSI() . '"';
     $ns[] = 'xmlns:appdb="' . RestAPIHelper::XMLNS_APPDB() . '"';
     $ns[] = 'xmlns:application="' . RestAPIHelper::XMLNS_APPLICATION() . '"';
     $ns[] = 'xmlns:discipline="' . RestAPIHelper::XMLNS_DISCIPLINE() . '"';
     $ns[] = 'xmlns:category="' . RestAPIHelper::XMLNS_CATEGORY() . '"';
     $ns[] = 'xmlns:dissemination="' . RestAPIHelper::XMLNS_DISSEMINATION() . '"';
     $ns[] = 'xmlns:filter="' . RestAPIHelper::XMLNS_FILTER() . '"';
     $ns[] = 'xmlns:history="' . RestAPIHelper::XMLNS_HISTORY() . '"';
     $ns[] = 'xmlns:logistics="' . RestAPIHelper::XMLNS_LOGISTICS() . '"';
     $ns[] = 'xmlns:resource="' . RestAPIHelper::XMLNS_RESOURCE() . '"';
     $ns[] = 'xmlns:middleware="' . RestAPIHelper::XMLNS_MIDDLEWARE() . '"';
     $ns[] = 'xmlns:person="' . RestAPIHelper::XMLNS_PERSON() . '"';
     $ns[] = 'xmlns:permission="' . RestAPIHelper::XMLNS_PERMISSION() . '"';
     $ns[] = 'xmlns:privilege="' . RestAPIHelper::XMLNS_PRIVILEGE() . '"';
     $ns[] = 'xmlns:publication="' . RestAPIHelper::XMLNS_PUBLICATION() . '"';
     $ns[] = 'xmlns:rating="' . RestAPIHelper::XMLNS_RATING() . '"';
     $ns[] = 'xmlns:ratingreport="' . RestAPIHelper::XMLNS_RATINGREPORT() . '"';
     $ns[] = 'xmlns:regional="' . RestAPIHelper::XMLNS_REGIONAL() . '"';
     $ns[] = 'xmlns:user="******"';
     $ns[] = 'xmlns:vo="' . RestAPIHelper::XMLNS_VO() . '"';
     $ns[] = 'xmlns:virtualization="' . RestAPIHelper::XMLNS_VIRTUALIZATION() . '"';
     $ns[] = 'xmlns:contextualization="' . RestAPIHelper::XMLNS_CONTEXTUALIZATION() . '"';
     $ns[] = 'xmlns:license="' . RestAPIHelper::XMLNS_LICENSE() . '"';
     $ns[] = 'xmlns:provider="' . RestAPIHelper::XMLNS_PROVIDER() . '"';
     $ns[] = 'xmlns:provider_template="' . RestAPIHelper::XMLNS_PROVIDER_TEMPLATE() . '"';
     $ns[] = 'xmlns:classification="' . RestAPIHelper::XMLNS_CLASSIFICATION() . '"';
     $ns[] = 'xmlns:site="' . RestAPIHelper::XMLNS_SITE() . '"';
     $ns[] = 'xmlns:siteservice="' . RestAPIHelper::XMLNS_SITE() . '"';
     $ns[] = 'xmlns:entity="' . RestAPIHelper::XMLNS_ENTITY() . '"';
     $ns[] = 'xmlns:organization="' . RestAPIHelper::XMLNS_ORGANIZATION() . '"';
     $ns[] = 'xmlns:project="' . RestAPIHelper::XMLNS_PROJECT() . '"';
     $ns[] = 'xmlns:dataset="' . RestAPIHelper::XMLNS_DATASET() . '"';
     return $ns;
 }