require_once 'raws_json/meta_service.php'; require_once 'raws_json/rass_service.php'; try { $rass = new RassService(USER, PWD, RASS_SERVER); $meta = new MetaService(USER, PWD); # upload file to CDN (RASS PUT item) $item1 = $rass->createItem("/test/content/", "myfile_one.mp4", LOCAL_PATH, True); $item2 = $rass->createItem("/test/content/", "myfile_two.mp4", LOCAL_PATH, True); # create content instance for item1 $f = array(); $f[] = new FileObj($item1->entry->content->params->path); $m = array(); $m[] = new MetaObj("Title", "rss", "My first file", "en"); $m[] = new MetaObj("Description", "rss", "Description of my first file", "en"); $content_obj1 = new MetaContent("myfile_one", $f, null, $m); $content = $meta->createContent($content_obj1->to_entry()); $content_obj1->from_entry($content); echo "\nCreated new content instance with name = " . $content_obj1->name . "\n"; # create content instance for item2 $f = array(); $f[] = new FileObj($item2->entry->content->params->path, "video"); $m = array(); $m[] = new MetaObj("Title", "rss", "My second file", "en"); $m[] = new MetaObj("Description", "rss", "Description of my second file", "en"); $content_obj2 = new MetaContent("myfile_two", $f, null, $m); $content = $meta->createContent($content_obj2->to_entry()); $content_obj2->from_entry($content); echo "\nCreated new content instance with name = " . $content_obj2->name . "\n"; echo "\nGetting json list... \n"; $json_list = $meta->getExtJson(); print_r($json_list);
require_once 'raws_json/meta.php'; require_once 'raws_json/json_client.php'; require_once 'raws_json/meta_service.php'; require_once 'raws_json/rass_service.php'; try { $rass = new RassService(USER, PWD, RASS_SERVER); $meta = new MetaService(USER, PWD); # upload file to CDN (RASS PUT item) $item1 = $rass->createItem("/test/content/", "myfile_with_meta.mp4", LOCAL_PATH, True); $item2 = $rass->createItem("/test/content/", "myfile_no_meta.mp4", LOCAL_PATH, True); # create content instance $f = array(); $f[] = new FileObj($path = $item1->entry->content->params->path, $media_type = "video"); $content = new MetaContent($name = "myfile_with_meta", $file_objs = $f); $content->tags = array("een", "twee", "drie"); $content_obj = $meta->createContent($content->to_entry()); $content->from_entry($content_obj); echo "\nCreated new content instance with name = " . $content->name . "\n"; # get contentdir feed echo "\n\nGetting contentdir list..."; $feed = $meta->getContentdirList("/"); foreach ($feed->feed->entry as $e) { if ($e->content->params->name) { echo "\n* retrieved content instance: " . $e->id . " with name = " . $e->content->params->name; } else { echo "\n* retrieved file without metadata, path = " . $e->content->file[0]->path; } } echo "\n... finished retrieving contentdir instances.\n"; # delete content instance (this will not delete the file!) $meta->deleteContent($content->name);