diff --git a/blocks/kalturamediagallery/block_kalturamediagallery.php b/blocks/kalturamediagallery/block_kalturamediagallery.php new file mode 100644 index 0000000000000..c26f293759dbb --- /dev/null +++ b/blocks/kalturamediagallery/block_kalturamediagallery.php @@ -0,0 +1,58 @@ +title = get_string('pluginname', 'local_kalturamediagallery'); + } + + function get_content() { + if(!is_null($this->content)) { + return $this->content; + } + + $this->content = new stdClass(); + $this->content->text = ''; + $this->content->footer = ''; + + if($context = $this->getCourseContext()) { + $this->content->text = $this->getKalturaMediaGalleryLink($context->instanceid); + } + + return $this->content; + } + + function applicable_formats() + { + return array( + 'course-view' => true + ); + } + + private function getKalturaMediaGalleryLink($courseId) { + $mediaGalleryUrl = new moodle_url('/local/kalturamediagallery/index.php', array( + 'courseid' => $courseId + )); + + $link = html_writer::tag('a', get_string('nav_mediagallery', 'local_kalturamediagallery'), array( + 'href' => $mediaGalleryUrl->out(false) + )); + + return $link; + } + + private function getCourseContext() { + // Check the current page context. If the context is not of a course or module then return false. + $context = context::instance_by_id($this->page->context->id); + $isCourseContext = $context instanceof context_course; + if (!$isCourseContext) { + return false; + } + + // If the context if a module then get the parent context. + $courseContext = ($context instanceof context_module) ? $context->get_course_context() : $context; + + return $courseContext; + } +} diff --git a/blocks/kalturamediagallery/classes/privacy/provider.php b/blocks/kalturamediagallery/classes/privacy/provider.php new file mode 100644 index 0000000000000..24bece050f9d0 --- /dev/null +++ b/blocks/kalturamediagallery/classes/privacy/provider.php @@ -0,0 +1,20 @@ +. + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + 'block/kalturamediagallery:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_PROHIBIT + ), + + 'clonepermissionsfrom' => 'moodle/my:manageblocks' + ), + + 'block/kalturamediagallery:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ), + + 'clonepermissionsfrom' => 'moodle/site:manageblocks' + ), +); diff --git a/blocks/kalturamediagallery/lang/en/block_kalturamediagallery.php b/blocks/kalturamediagallery/lang/en/block_kalturamediagallery.php new file mode 100644 index 0000000000000..e935f6c641e3c --- /dev/null +++ b/blocks/kalturamediagallery/lang/en/block_kalturamediagallery.php @@ -0,0 +1,20 @@ +. + +$string['pluginname'] = 'Kaltura Media Gallery'; +$string['kalturamediagallery:addinstance'] = 'Add a new Kaltura Media Gallery block'; +$string['kalturamediagallery:myaddinstance'] = 'Add a new Kaltura Media Gallery block to Dashboard'; +$string['privacy:metadata'] = 'The Kaltura Media Gallery block only displays a link to Kaltura Media Gallery local plugin'; diff --git a/blocks/kalturamediagallery/version.php b/blocks/kalturamediagallery/version.php new file mode 100644 index 0000000000000..5994822e73a2c --- /dev/null +++ b/blocks/kalturamediagallery/version.php @@ -0,0 +1,24 @@ +. + +defined('MOODLE_INTERNAL') || die(); + +$plugin->version = 2024100702; +$plugin->release = 'Kaltura release 4.5.1'; +$plugin->requires = 2024042200; +$plugin->component = 'block_kalturamediagallery'; +$plugin->dependencies = array( + 'local_kaltura' => 2024100702, + 'local_kalturamediagallery' => 2024100702 +); diff --git a/createPackage.sh b/createPackage.sh new file mode 100755 index 0000000000000..85612bb133a63 --- /dev/null +++ b/createPackage.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +BRANCH=`git branch | grep '*' |awk -F _ '{print $2}'` +VER=`cat local/kaltura/version.php |grep '>version' | awk '{print $3}' | awk -F ";" '{print $1}'` + +echo "Generating package for Kaltura_Video_Package_moodle"$BRANCH"_"$VER".zip\n" + +FILENAME="Kaltura_Video_Package_moodle"$BRANCH"_"$VER".zip" + +zip -r $FILENAME lib filter mod local blocks diff --git a/filter/kaltura/classes/privacy/provider.php b/filter/kaltura/classes/privacy/provider.php new file mode 100644 index 0000000000000..c3429e787b2ac --- /dev/null +++ b/filter/kaltura/classes/privacy/provider.php @@ -0,0 +1,20 @@ +. + +namespace filter_kaltura; +use context_system; +use moodle_url; +use html_writer; + +/** + * Kaltura filter script. + * + * @package filter_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote-Learner.net Inc (http://www.remote-learner.net) + */ + +class text_filter extends \core_filters\text_filter { + /** @var object $context The current page context. */ + public static $pagecontext = null; + + /** @var string $kafuri The KAF URI. */ + public static $kafuri = null; + + /** @var string $apiurl The URI used by the previous version (v3) of the plug-ins when embedding anchor tags. */ + public static $apiurl = null; + + /** @var string $module The module used to render part of the final URL. */ + public static $module = null; + + /** @var string $defaultheight The default height for the video. */ + public static $defaultheight = 280; + + /** @var string $defaultwidth The default width for the video. */ + public static $defaultwidth = 400; + + /** + * This function runs once during a single page request and initialzies + * some data. + * @param object $page Moodle page object. + * @param object $context Page context object. + */ + #[\Override] + public function setup($page, $context) { + global $CFG; + require_once($CFG->dirroot.'/local/kaltura/locallib.php'); + $configsettings = local_kaltura_get_config(); + + self::$pagecontext = $this->get_course_context($context); + + $newuri = ''; + + self::$kafuri = $configsettings->kaf_uri; + + if (!empty($configsettings->uri)) { + self::$apiurl = $configsettings->uri; + } + + self::$module = local_kaltura_get_endpoint(KAF_BROWSE_EMBED_MODULE); + } + + /** + * This function returns the course context where possible. + * @param object $context A context object. + * @return object A Moodle context object. + */ + protected function get_course_context($context) { + $coursecontext = null; + + if ($context instanceof context_course) { + $coursecontext = $context; + } else if ($context instanceof context_module) { + $coursecontext = $context->get_course_context(); + } else { + $coursecontext = context_system::instance(); + } + + return $coursecontext; + } + + /** + * Change links to Kaltura into embedded Kaltura videos. + * @param array $link An array of elements matching the regular expression from class filter_kaltura - filter(). + * @return string Kaltura embed video markup. + */ + function filter_kaltura_callback($link) { + $width = self::$defaultwidth; + $height = self::$defaultheight; + $source = ''; + + // Convert KAF URI anchor tags into iframe markup. + $count = count($link); + if ($count > 7) { + // Get the height and width of the iframe. + $properties = explode('||', $link[$count - 1]); + + $width = $properties[2]; + $height = $properties[3]; + + if (4 != count($properties)) { + return $link[0]; + } + + $source = self::$kafuri . '/browseandembed/index/media/entryid/' . $link[$count - 4] . $link[$count - 3]; + } + + // Convert v3 anchor tags into iframe markup. + if (7 == count($link) && $link[1] == self::$apiurl) { + $source = self::$kafuri.'/browseandembed/index/media/entryid/'.$link[4].'/playerSize/'; + $source .= self::$defaultwidth.'x'.self::$defaultheight.'/playerSkin/'.$link[3]; + } + + $params = array( + 'courseid' => self::$pagecontext->instanceid, + 'height' => $height, + 'width' => $width, + 'withblocks' => 0, + 'source' => $source + + ); + + $url = new moodle_url('/filter/kaltura/lti_launch.php', $params); + + $iframe = html_writer::tag('iframe', '', array( + 'width' => $width, + 'height' => $height, + 'class' => 'kaltura-player-iframe', + 'allowfullscreen' => 'true', + 'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;', + 'src' => $url->out(false), + 'frameborder' => '0' + )); + + $iframeContainer = html_writer::tag('div', $iframe, array( + 'class' => 'kaltura-player-container' + )); + + return $iframeContainer; + } + + /** + * This function does the work of converting text that matches a regular expression into + * Kaltura video markup, so that links to Kaltura videos are displayed in the Kaltura + * video player. + * @param string $text Text that is to be displayed on the page. + * @param array $options An array of additional options. + * @return string The same text or modified text is returned. + */ + #[\Override] + public function filter($text, array $options = array()) { + global $CFG; + + // Check if the the filter plug-in is enabled. + if (empty($CFG->filter_kaltura_enable)) { + return $text; + } + + // Check either if the KAF URI or API URI has been set. If neither has been set then return the text with no changes. + if (is_null(self::$kafuri) && is_null(self::$apiurl)) { + return $text; + } + + // Performance shortcut. All regexes bellow end with the tag, if not present nothing can match. + if (false === stripos($text, '')) { + return $text; + } + + // We need to return the original value if regex fails! + $newtext = $text; + + // Search for v3 Kaltura embedded anchor tag format. + $uri = self::$apiurl; + $uri = rtrim($uri, '/'); + $uri = str_replace(array('.', '/', 'https'), array('\.', '\/', 'https?'), $uri); + + $oldsearch = '/]*href="('.$uri.')\/index\.php\/kwidget\/wid\/_([0-9]+)\/uiconf_id\/([0-9]+)\/entry_id\/([\d]+_([a-z0-9]+))\/v\/flash"[^>]*>([^>]*)<\/a>/is'; + $newtext = preg_replace_callback($oldsearch, [$this, 'filter_kaltura_callback'], $newtext); + + // Search for newer versoin of Kaltura embedded anchor tag format. + $kafuri = self::$kafuri; + $kafuri = rtrim($kafuri, '/'); + $kafuri = str_replace(array('http://', 'https://', '.', '/'), array('https?://', 'https?://', '\.', '\/'), $kafuri); + + $search = $search = '/]*href="(((https?:\/\/'.KALTURA_URI_TOKEN.')|('.$kafuri.')))\/browseandembed\/index\/media\/entryid\/([\d]+_[a-z0-9]+)(\/([a-zA-Z0-9]+\/[a-zA-Z0-9]+\/)*)"[^>]*>([^>]*)<\/a>/is'; + + if (!empty($CFG->filter_kaltura_uris)) { + $altkafuriconfig = $CFG->filter_kaltura_uris; + $altkafuris = explode(PHP_EOL, $altkafuriconfig); + + $search = $search = '/]*href="(((https?:\/\/'.KALTURA_URI_TOKEN.')|('.$kafuri.')'; + + foreach ($altkafuris as $altkafuri) { + $altkafuri = rtrim($altkafuri); + if ($altkafuri != '') { + // If a https url is needed for kaf_uri it should be entered into the kaf_uri setting as https://. + if (!preg_match('#^https?://#', $altkafuri)) { + $altkafuri = 'http://' . $altkafuri; + } + + $altkafuri = str_replace(array('http://', 'https://', '.', '/'), array('https?://', 'https?://', '\.', '\/'), $altkafuri); + $search .= '|('.$altkafuri.')'; + } + } + + $search .= '))\/browseandembed\/index\/media\/entryid\/([\d]+_[a-z0-9]+)(\/([a-zA-Z0-9]+\/[a-zA-Z0-9]+\/)*)"[^>]*>([^>]*)<\/a>/is'; + } + + $newtext = preg_replace_callback($search, [$this, 'filter_kaltura_callback'], $newtext); + + if (empty($newtext) || $newtext === $text) { + // Error or not filtered. + unset($newtext); + return $text; + } + + return $newtext; + } +} diff --git a/filter/kaltura/db/install.php b/filter/kaltura/db/install.php new file mode 100644 index 0000000000000..83b7934b6d080 --- /dev/null +++ b/filter/kaltura/db/install.php @@ -0,0 +1,34 @@ +. + +/** + * Filter post install hook + * + * @package filter_kaltura + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +function xmldb_filter_kaltura_install() { + global $CFG; + require_once("$CFG->libdir/filterlib.php"); + + // Do not enable the filter when running unit tests because some core + // tests expect a specific number of filters enabled. + if (!defined('PHPUNIT_TEST') || !PHPUNIT_TEST) { + filter_set_global_state('kaltura', TEXTFILTER_ON); + } + +} diff --git a/filter/kaltura/filtersettings.php b/filter/kaltura/filtersettings.php new file mode 100644 index 0000000000000..482cb33ecc3e4 --- /dev/null +++ b/filter/kaltura/filtersettings.php @@ -0,0 +1,34 @@ +. + +/** + * Kaltura filter settings script. + * + * @package filter_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote-Learner.net Inc (http://www.remote-learner.net) + */ + +defined('MOODLE_INTERNAL') || die; + +if ($ADMIN->fulltree) { + $settings->add(new admin_setting_configcheckbox('filter_kaltura_enable', get_string('enable', 'filter_kaltura'), get_string('enable_help', 'filter_kaltura'), 1)); + + $settings->add(new admin_setting_configtextarea('filter_kaltura_uris', + get_string('uris', 'filter_kaltura'), + get_string('uris_help', 'filter_kaltura'), '')); +} \ No newline at end of file diff --git a/filter/kaltura/lang/en/filter_kaltura.php b/filter/kaltura/lang/en/filter_kaltura.php new file mode 100644 index 0000000000000..83a169e7a4478 --- /dev/null +++ b/filter/kaltura/lang/en/filter_kaltura.php @@ -0,0 +1,32 @@ +. + +/** + * Kaltura filter language file. + * + * @package filter_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote-Learner.net Inc (http://www.remote-learner.net) + */ + +$string['filtername'] = 'Kaltura Media'; +$string['enable'] = 'Embed Kaltura Video Links'; +$string['enable_help'] = 'Convert Kaltura video links to embed code'; +$string['uris'] = 'Alternate KAF URIs'; +$string['uris_help'] = 'Enter alternate KAF URIs to filter, one per line'; +$string['unable'] = 'Unable to convert video at this time'; +$string['privacy:metadata'] = 'The Kaltura Media filter does not store any personal data.'; diff --git a/filter/kaltura/lti_launch.php b/filter/kaltura/lti_launch.php new file mode 100644 index 0000000000000..9df539c9a54ea --- /dev/null +++ b/filter/kaltura/lti_launch.php @@ -0,0 +1,81 @@ +. + +/** + * Kaltura filter plug-in LTI launch page. + * + * @package filter_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); + +global $SITE; + +require_login(); + +$courseid = required_param('courseid', PARAM_INT); +$height = required_param('height', PARAM_INT); +$width = required_param('width', PARAM_INT); +$withblocks = optional_param('withblocks', 0, PARAM_INT); +$source = optional_param('source', '', PARAM_URL); + +// If a course id of zero is passed, then we must be in the system context. +if (0 != $courseid) { + $context = context_course::instance($courseid); +} else { + $context = context_system::instance(); +} + +// Check if we're in a course context. +if ($context instanceof context_course) { + $course = get_course($courseid); + + // Check if the user has the capability to view comments in Moodle. + if (!has_capability('moodle/comment:view', $context)) { + echo get_string('nocapabilitytousethisservice', 'error'); + die(); + } +} else { + $course = $SITE; +} + +$launch = array(); +$launch['id'] = 1; +$launch['cmid'] = 0; +$launch['title'] = 'Kaltura video resource'; +$launch['module'] = KAF_BROWSE_EMBED_MODULE; +$launch['course'] = $course; +$launch['width'] = $width; +$launch['height'] = $height; +$launch['custom_publishdata'] = ''; + +if (false === local_kaltura_url_contains_configured_hostname($source) && !empty($source)) { + echo get_string('invalid_source_parameter', 'mod_kalvidres'); + die; +} else { + $launch['source'] = urldecode($source); +} + +if (local_kaltura_validate_browseembed_required_params($launch)) { + $content = local_kaltura_request_lti_launch($launch, $withblocks); + echo $content; +} else { + echo get_string('invalid_launch_parameters', 'mod_kalvidres'); +} \ No newline at end of file diff --git a/filter/kaltura/version.php b/filter/kaltura/version.php new file mode 100644 index 0000000000000..4c0bb93c9ce56 --- /dev/null +++ b/filter/kaltura/version.php @@ -0,0 +1,34 @@ +. + +/** + * Kaltura version script. + * + * @package filter_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote-Learner.net Inc (http://www.remote-learner.net) + */ +defined('MOODLE_INTERNAL') || die(); + +$plugin->version = 2024100702; //version date YYYYMMDDXX 10 represent 3.0 for future option to moodle use 2 digit version +$plugin->component = 'filter_kaltura'; +$plugin->release = 'Kaltura release 4.5.1'; +$plugin->requires = 2024042200; +$plugin->maturity = MATURITY_STABLE; +$plugin->dependencies = array( + 'local_kaltura' => 2024100702 +); diff --git a/incrementVersion.sh b/incrementVersion.sh new file mode 100755 index 0000000000000..de6855b5fb94f --- /dev/null +++ b/incrementVersion.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +EXPECTED_ARGS=4 + +if [ $# -ne $EXPECTED_ARGS ]; then + echo "Missing arguments!" + printf "Usage: \n \t$0 {existing build number} {new build number} {existing release number} {new release number}\n\n" + printf "IMPORTANT - the version number should follow these rules - YYYYMMDDII\n" + printf "WHERE: YYYMMDD should be the release date of the major Moodle version for the current branch (e.g. for 3.10 it should be 20201109) and the II should be the build number for the plugin for that version\n" + printf "For example, let's assume the next 3.12 release of moodle happens at 2025/12/01 and then we release a plugin compatible with that version, the version number should be set to 2025120100, and the second version of the plugin for 3.12 should have 2025120101\n" + printf "" + printf "\nExample: \n \t$0 2014102807 2015012507 4.0.02 4.0.03\n\n" + exit 1; +fi + + +EXISTING_BUILD_NUMBER=$1 +NEW_BUILD_NUMBER=$2 +EXISTING_RELEASE_NUMBER=$3 +NEW_RELEASE_NUMBER=$4 + +FILES=`grep $EXISTING_BUILD_NUMBER ./* -R -l` + +for filename in $FILES; do + echo $filename + sed -i "" -e "s/$EXISTING_BUILD_NUMBER/$NEW_BUILD_NUMBER/g" $filename + sed -i "" -e "s/$EXISTING_RELEASE_NUMBER/$NEW_RELEASE_NUMBER/g" $filename +done + +git status diff --git a/lib/editor/atto/plugins/kalturamedia/.gitignore b/lib/editor/atto/plugins/kalturamedia/.gitignore new file mode 100644 index 0000000000000..74e5b1d3a9dfc --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/.gitignore @@ -0,0 +1 @@ +!* \ No newline at end of file diff --git a/lib/editor/atto/plugins/kalturamedia/classes/privacy/provider.php b/lib/editor/atto/plugins/kalturamedia/classes/privacy/provider.php new file mode 100644 index 0000000000000..fa00b27821a2c --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/classes/privacy/provider.php @@ -0,0 +1,20 @@ +. + +/** + * Strings for component 'atto_kalturamedia', language 'en'. + * + * @package atto_media + * @copyright 2013 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +$string['pluginname'] = 'Embed Kaltura Media'; +$string['popuptitle'] = 'Select Media'; +$string['embedbuttontext'] = 'Embed'; +$string['browse_and_embed'] = 'Browse and Embed'; +$string['privacy:metadata'] = 'The atto_kalturamedia plugin does not store any personal data.'; diff --git a/lib/editor/atto/plugins/kalturamedia/lib.php b/lib/editor/atto/plugins/kalturamedia/lib.php new file mode 100644 index 0000000000000..b40b177aa3933 --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/lib.php @@ -0,0 +1,47 @@ +. + +/** + * Atto text editor integration version file. + * + * @package atto_media + * @copyright 2013 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * Initialise the js strings required for this plugin + */ +function atto_kalturamedia_strings_for_js() { + global $PAGE; + + $PAGE->requires->strings_for_js(array('popuptitle', 'embedbuttontext', 'browse_and_embed'), 'atto_kalturamedia'); +} + +function atto_kalturamedia_params_for_js($elementid, $options, $fpoptions) { + global $CFG; + require_once($CFG->dirroot.'/local/kaltura/locallib.php'); + + $context = $options['context']; + if (!$context) { + $context = context_system::instance(); + } + + return array( + 'contextid' => $context->id, + 'kafuri' => local_kaltura_get_config()->kaf_uri + ); +} diff --git a/lib/editor/atto/plugins/kalturamedia/ltibrowse.php b/lib/editor/atto/plugins/kalturamedia/ltibrowse.php new file mode 100644 index 0000000000000..12edb80055453 --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/ltibrowse.php @@ -0,0 +1,78 @@ +. + +/** + * Kaltura media LTI launch page. + * + * @package tinymce_kalturamedia + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/config.php'); +require_once($CFG->dirroot.'/local/kaltura/locallib.php'); +//require_once('renderer.php'); + +global $PAGE, $USER; + +require_login(); + +$contextid = required_param('contextid', PARAM_INT); +$height = required_param('height', PARAM_INT); +$width = required_param('width', PARAM_INT); +$withblocks = optional_param('withblocks', 0, PARAM_INT); + +$context = context::instance_by_id($contextid); + +$launch = array(); +$course = 0; + +if ($context instanceof context_course) { + $course = get_course($context->instanceid); + +} else if ($context instanceof context_system || $context instanceof context_coursecat) { + $course = get_course(1); +} else { + // Find parent context + $parentcontexts = $context->get_parent_contexts(false); + + foreach ($parentcontexts as $ctx) { + if ($ctx instanceof context_course) { + $course = get_course($ctx->instanceid); + break; + } else if ($ctx instanceof context_system || $ctx instanceof context_coursecat) { + $course = get_course(1); + break; + } + } +} + +$launch['id'] = 1; +$launch['cmid'] = 0; +$launch['title'] = 'Kaltura media'; +$launch['module'] = KAF_BROWSE_EMBED_MODULE; +$launch['course'] = $course; +$launch['width'] = $width; +$launch['height'] = $height; +$launch['custom_publishdata'] = ''; + +if (local_kaltura_validate_browseembed_required_params($launch)) { + $content = local_kaltura_request_lti_launch($launch, $withblocks, $editor = 'atto'); + echo $content; +} else { + echo get_string('invalid_launch_parameters', 'mod_kalvidres'); +} diff --git a/lib/editor/atto/plugins/kalturamedia/ltibrowse_container.php b/lib/editor/atto/plugins/kalturamedia/ltibrowse_container.php new file mode 100644 index 0000000000000..eede4901a327c --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/ltibrowse_container.php @@ -0,0 +1,21 @@ +set_context(context_system::instance()); + $PAGE->set_pagelayout('embedded'); + echo $OUTPUT->header(); + $requestQueryString = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ""; + parse_str($requestQueryString, $params); + $ltibrowseUrl = new moodle_url('ltibrowse.php', $params); +?> + + + diff --git a/lib/editor/atto/plugins/kalturamedia/pix/icon.png b/lib/editor/atto/plugins/kalturamedia/pix/icon.png new file mode 100644 index 0000000000000..8d5961396d824 Binary files /dev/null and b/lib/editor/atto/plugins/kalturamedia/pix/icon.png differ diff --git a/lib/editor/atto/plugins/kalturamedia/pix/icon.svg b/lib/editor/atto/plugins/kalturamedia/pix/icon.svg new file mode 100644 index 0000000000000..23a9f3a2e2cf5 --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/pix/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/editor/atto/plugins/kalturamedia/version.php b/lib/editor/atto/plugins/kalturamedia/version.php new file mode 100644 index 0000000000000..71813c4f36339 --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/version.php @@ -0,0 +1,33 @@ +. + +/** + * Atto text editor integration version file. + * + * @package atto_media + * @copyright 2013 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$plugin->version = 2024100702; // The current plugin version (Date: YYYYMMDDXX). +$plugin->release = 'Kaltura release 4.5.1'; +$plugin->requires = 2024042200; // Requires this Moodle version. +$plugin->component = 'atto_kalturamedia'; // Full name of the plugin (used for diagnostics). +$plugin->dependencies = array( + 'local_kaltura' => 2024100702 +); diff --git a/lib/editor/atto/plugins/kalturamedia/yui/build/moodle-atto_kalturamedia-button/moodle-atto_kalturamedia-button-debug.js b/lib/editor/atto/plugins/kalturamedia/yui/build/moodle-atto_kalturamedia-button/moodle-atto_kalturamedia-button-debug.js new file mode 100644 index 0000000000000..4c3d0e22c9750 --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/yui/build/moodle-atto_kalturamedia-button/moodle-atto_kalturamedia-button-debug.js @@ -0,0 +1,157 @@ +YUI.add('moodle-atto_kalturamedia-button', function (Y, NAME) { + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/* + * @package atto_kalturamedia + * @copyright 2Kaltura + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/* eslint-disable max-len */ + +/** + * @module moodle-atto_kalturamedia-button + */ + +/** + * Atto text editor kalturamedia plugin. + * + * @namespace M.atto_kalturamedia + * @class button + * @extends M.editor_atto.EditorPlugin + */ + +var COMPONENTNAME = 'atto_kalturamedia', + CSS = { + URLINPUT: 'atto_kalturamedia_urlentry', + NAMEINPUT: 'atto_kalturamedia_nameentry' + }, + SELECTORS = { + URLINPUT: '.' + CSS.URLINPUT, + NAMEINPUT: '.' + CSS.NAMEINPUT + }; + +Y.namespace('M.atto_kalturamedia').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { + _currentSelection: null, + embedWindow: null, + + initializer: function() { + this.addButton({ + icon: 'icon', + iconComponent: COMPONENTNAME, + callback: this._kalturamedia + }); + }, + _kalturamedia: function() { + this._currentSelection = this.get('host').getSelection(); + if (this._currentSelection === false) { + return; + } + + var w = 1200; + var h = 700; + var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; + var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; + + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + + var left = ((width / 2) - (w / 2)) + dualScreenLeft; + var top = ((height / 2) - (h / 2)) + dualScreenTop; + var newWindow = window.open(this._getIframeURL(), M.util.get_string("browse_and_embed", COMPONENTNAME), 'scrollbars=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); + + window.buttonJs = this; + + if (window.focus) { + newWindow.focus(); + } + + this.embedWindow = newWindow; + }, + + _getIframeURL: function() { + + var args = Y.mix({ + elementid: this.get('host').get('elementid'), + contextid: this.get('contextid'), + height: '600px', + width: '1112px' + }, + this.get('area')); + return M.cfg.wwwroot + '/lib/editor/atto/plugins/kalturamedia/ltibrowse_container.php?' + + Y.QueryString.stringify(args); + }, + + _getCourseId: function() { + var courseId; + var bodyClasses = document.getElementsByTagName('body')[0].className; + var classes = bodyClasses.split(' '); + for(i in classes) + { + if(classes[i].indexOf('course-') > -1) + { + var parts = classes[i].split('-'); + courseId = parts[1]; + } + } + + return courseId; + }, + + _removeProtocolFromUrl: function(fullUrl) { + return fullUrl.replace(/^https?:\/\//,''); + }, + + embedItem: function(what, data) { + var sourceUrl = data.url; + var url = this._removeProtocolFromUrl(sourceUrl); + var parser = document.createElement('a'); + parser.href = sourceUrl; + url += parser.search; + + var content = 'tinymce-kalturamedia-embed||'+data.title+'||'+data.width+'||'+data.height+''; + + host = this.get('host'); + host.setSelection(this._currentSelection); + host.insertContentAtFocusPoint(content); + this.markUpdated(); + this.embedWindow.close(); + } + + } , { + ATTRS: { + /** + * The contextid to use when generating this preview. + * + * @attribute contextid + * @type String + */ + contextid: { + value: null + }, + + /** + * The KAF URI, as configured in Kaltura's plugin settings. + */ + kafuri: { + value: null + } + }} +); + + +}, '@VERSION@', {"requires": ["moodle-editor_atto-plugin"]}); diff --git a/lib/editor/atto/plugins/kalturamedia/yui/build/moodle-atto_kalturamedia-button/moodle-atto_kalturamedia-button-min.js b/lib/editor/atto/plugins/kalturamedia/yui/build/moodle-atto_kalturamedia-button/moodle-atto_kalturamedia-button-min.js new file mode 100644 index 0000000000000..d96595ef78a8e --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/yui/build/moodle-atto_kalturamedia-button/moodle-atto_kalturamedia-button-min.js @@ -0,0 +1 @@ +YUI.add("moodle-atto_kalturamedia-button",function(t,e){var n="atto_kalturamedia";t.namespace("M.atto_kalturamedia").Button=t.Base.create("button",t.M.editor_atto.EditorPlugin,[],{_currentSelection:null,embedWindow:null,initializer:function(){this.addButton({icon:"icon",iconComponent:n,callback:this._kalturamedia})},_kalturamedia:function(){var e,t;this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&(e=window.screenLeft!=undefined?window.screenLeft:screen.left,t=window.screenTop!=undefined?window.screenTop:screen.top,e=(window.innerWidth||document.documentElement.clientWidth||screen.width)/2-600+e,t=(window.innerHeight||document.documentElement.clientHeight||screen.height)/2-350+t,t=window.open(this._getIframeURL(),M.util.get_string("browse_and_embed",n),"scrollbars=no, width=1200, height=700, top="+t+", left="+e),window.buttonJs=this,window.focus&&t.focus(),this.embedWindow=t)},_getIframeURL:function(){var e=t.mix({elementid:this.get("host").get("elementid"),contextid:this.get("contextid"),height:"600px",width:"1112px"},this.get("area"));return M.cfg.wwwroot+"/lib/editor/atto/plugins/kalturamedia/ltibrowse_container.php?"+t.QueryString.stringify(e)},_getCourseId:function(){var e,t=document.getElementsByTagName("body")[0].className,n=t.split(" ");for(i in n)-1tinymce-kalturamedia-embed||'+t.title+"||"+t.width+"||"+t.height+"",(host=this.get("host")).setSelection(this._currentSelection),host.insertContentAtFocusPoint(i),this.markUpdated(),this.embedWindow.close()}},{ATTRS:{contextid:{value:null},kafuri:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/kalturamedia/yui/build/moodle-atto_kalturamedia-button/moodle-atto_kalturamedia-button.js b/lib/editor/atto/plugins/kalturamedia/yui/build/moodle-atto_kalturamedia-button/moodle-atto_kalturamedia-button.js new file mode 100644 index 0000000000000..4c3d0e22c9750 --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/yui/build/moodle-atto_kalturamedia-button/moodle-atto_kalturamedia-button.js @@ -0,0 +1,157 @@ +YUI.add('moodle-atto_kalturamedia-button', function (Y, NAME) { + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/* + * @package atto_kalturamedia + * @copyright 2Kaltura + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/* eslint-disable max-len */ + +/** + * @module moodle-atto_kalturamedia-button + */ + +/** + * Atto text editor kalturamedia plugin. + * + * @namespace M.atto_kalturamedia + * @class button + * @extends M.editor_atto.EditorPlugin + */ + +var COMPONENTNAME = 'atto_kalturamedia', + CSS = { + URLINPUT: 'atto_kalturamedia_urlentry', + NAMEINPUT: 'atto_kalturamedia_nameentry' + }, + SELECTORS = { + URLINPUT: '.' + CSS.URLINPUT, + NAMEINPUT: '.' + CSS.NAMEINPUT + }; + +Y.namespace('M.atto_kalturamedia').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { + _currentSelection: null, + embedWindow: null, + + initializer: function() { + this.addButton({ + icon: 'icon', + iconComponent: COMPONENTNAME, + callback: this._kalturamedia + }); + }, + _kalturamedia: function() { + this._currentSelection = this.get('host').getSelection(); + if (this._currentSelection === false) { + return; + } + + var w = 1200; + var h = 700; + var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; + var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; + + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + + var left = ((width / 2) - (w / 2)) + dualScreenLeft; + var top = ((height / 2) - (h / 2)) + dualScreenTop; + var newWindow = window.open(this._getIframeURL(), M.util.get_string("browse_and_embed", COMPONENTNAME), 'scrollbars=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); + + window.buttonJs = this; + + if (window.focus) { + newWindow.focus(); + } + + this.embedWindow = newWindow; + }, + + _getIframeURL: function() { + + var args = Y.mix({ + elementid: this.get('host').get('elementid'), + contextid: this.get('contextid'), + height: '600px', + width: '1112px' + }, + this.get('area')); + return M.cfg.wwwroot + '/lib/editor/atto/plugins/kalturamedia/ltibrowse_container.php?' + + Y.QueryString.stringify(args); + }, + + _getCourseId: function() { + var courseId; + var bodyClasses = document.getElementsByTagName('body')[0].className; + var classes = bodyClasses.split(' '); + for(i in classes) + { + if(classes[i].indexOf('course-') > -1) + { + var parts = classes[i].split('-'); + courseId = parts[1]; + } + } + + return courseId; + }, + + _removeProtocolFromUrl: function(fullUrl) { + return fullUrl.replace(/^https?:\/\//,''); + }, + + embedItem: function(what, data) { + var sourceUrl = data.url; + var url = this._removeProtocolFromUrl(sourceUrl); + var parser = document.createElement('a'); + parser.href = sourceUrl; + url += parser.search; + + var content = 'tinymce-kalturamedia-embed||'+data.title+'||'+data.width+'||'+data.height+''; + + host = this.get('host'); + host.setSelection(this._currentSelection); + host.insertContentAtFocusPoint(content); + this.markUpdated(); + this.embedWindow.close(); + } + + } , { + ATTRS: { + /** + * The contextid to use when generating this preview. + * + * @attribute contextid + * @type String + */ + contextid: { + value: null + }, + + /** + * The KAF URI, as configured in Kaltura's plugin settings. + */ + kafuri: { + value: null + } + }} +); + + +}, '@VERSION@', {"requires": ["moodle-editor_atto-plugin"]}); diff --git a/lib/editor/atto/plugins/kalturamedia/yui/src/button/build.json b/lib/editor/atto/plugins/kalturamedia/yui/src/button/build.json new file mode 100644 index 0000000000000..c49f677801d08 --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/yui/src/button/build.json @@ -0,0 +1,10 @@ +{ + "name": "moodle-atto_kalturamedia-button", + "builds": { + "moodle-atto_kalturamedia-button": { + "jsfiles": [ + "button.js" + ] + } + } +} diff --git a/lib/editor/atto/plugins/kalturamedia/yui/src/button/js/button.js b/lib/editor/atto/plugins/kalturamedia/yui/src/button/js/button.js new file mode 100644 index 0000000000000..799305cc35548 --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/yui/src/button/js/button.js @@ -0,0 +1,152 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/* + * @package atto_kalturamedia + * @copyright 2Kaltura + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/* eslint-disable max-len */ + +/** + * @module moodle-atto_kalturamedia-button + */ + +/** + * Atto text editor kalturamedia plugin. + * + * @namespace M.atto_kalturamedia + * @class button + * @extends M.editor_atto.EditorPlugin + */ + +var COMPONENTNAME = 'atto_kalturamedia', + CSS = { + URLINPUT: 'atto_kalturamedia_urlentry', + NAMEINPUT: 'atto_kalturamedia_nameentry' + }, + SELECTORS = { + URLINPUT: '.' + CSS.URLINPUT, + NAMEINPUT: '.' + CSS.NAMEINPUT + }; + +Y.namespace('M.atto_kalturamedia').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { + _currentSelection: null, + embedWindow: null, + + initializer: function() { + this.addButton({ + icon: 'icon', + iconComponent: COMPONENTNAME, + callback: this._kalturamedia + }); + }, + _kalturamedia: function() { + this._currentSelection = this.get('host').getSelection(); + if (this._currentSelection === false) { + return; + } + + var w = 1200; + var h = 700; + var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; + var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; + + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + + var left = ((width / 2) - (w / 2)) + dualScreenLeft; + var top = ((height / 2) - (h / 2)) + dualScreenTop; + var newWindow = window.open(this._getIframeURL(), M.util.get_string("browse_and_embed", COMPONENTNAME), 'scrollbars=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); + + window.buttonJs = this; + + if (window.focus) { + newWindow.focus(); + } + + this.embedWindow = newWindow; + }, + + _getIframeURL: function() { + + var args = Y.mix({ + elementid: this.get('host').get('elementid'), + contextid: this.get('contextid'), + height: '600px', + width: '1112px' + }, + this.get('area')); + return M.cfg.wwwroot + '/lib/editor/atto/plugins/kalturamedia/ltibrowse_container.php?' + + Y.QueryString.stringify(args); + }, + + _getCourseId: function() { + var courseId; + var bodyClasses = document.getElementsByTagName('body')[0].className; + var classes = bodyClasses.split(' '); + for(i in classes) + { + if(classes[i].indexOf('course-') > -1) + { + var parts = classes[i].split('-'); + courseId = parts[1]; + } + } + + return courseId; + }, + + _removeProtocolFromUrl: function(fullUrl) { + return fullUrl.replace(/^https?:\/\//,''); + }, + + embedItem: function(what, data) { + var sourceUrl = data.url; + var url = this._removeProtocolFromUrl(sourceUrl); + var parser = document.createElement('a'); + parser.href = sourceUrl; + url += parser.search; + + var content = 'tinymce-kalturamedia-embed||'+data.title+'||'+data.width+'||'+data.height+''; + + host = this.get('host'); + host.setSelection(this._currentSelection); + host.insertContentAtFocusPoint(content); + this.markUpdated(); + this.embedWindow.close(); + } + + } , { + ATTRS: { + /** + * The contextid to use when generating this preview. + * + * @attribute contextid + * @type String + */ + contextid: { + value: null + }, + + /** + * The KAF URI, as configured in Kaltura's plugin settings. + */ + kafuri: { + value: null + } + }} +); diff --git a/lib/editor/atto/plugins/kalturamedia/yui/src/button/meta/button.json b/lib/editor/atto/plugins/kalturamedia/yui/src/button/meta/button.json new file mode 100644 index 0000000000000..60494a632d901 --- /dev/null +++ b/lib/editor/atto/plugins/kalturamedia/yui/src/button/meta/button.json @@ -0,0 +1,7 @@ +{ + "moodle-atto_kalturamedia-button": { + "requires": [ + "moodle-editor_atto-plugin" + ] + } +} diff --git a/lib/editor/tiny/.DS_Store b/lib/editor/tiny/.DS_Store new file mode 100644 index 0000000000000..1fbdc8103d132 Binary files /dev/null and b/lib/editor/tiny/.DS_Store differ diff --git a/lib/editor/tiny/plugins/.DS_Store b/lib/editor/tiny/plugins/.DS_Store new file mode 100644 index 0000000000000..2a488c24483d7 Binary files /dev/null and b/lib/editor/tiny/plugins/.DS_Store differ diff --git a/lib/editor/tiny/plugins/kalturamedia/.DS_Store b/lib/editor/tiny/plugins/kalturamedia/.DS_Store new file mode 100644 index 0000000000000..d0dc413c9a066 Binary files /dev/null and b/lib/editor/tiny/plugins/kalturamedia/.DS_Store differ diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/.DS_Store b/lib/editor/tiny/plugins/kalturamedia/amd/.DS_Store new file mode 100644 index 0000000000000..46e6ff0a2811c Binary files /dev/null and b/lib/editor/tiny/plugins/kalturamedia/amd/.DS_Store differ diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/commands.min.js b/lib/editor/tiny/plugins/kalturamedia/amd/build/commands.min.js new file mode 100644 index 0000000000000..1294198f39756 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/commands.min.js @@ -0,0 +1,11 @@ +define("tiny_kalturamedia/commands",["exports","editor_tiny/utils","core/str","./common","./options"],(function(_exports,_utils,_str,_common,_options){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.getSetup=void 0; +/** + * Commands helper for the Moodle tiny_kalturamedia plugin. + * + * @module tiny_kalturmedia/commands + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +const handleAction=(editor,title)=>{editor.windowManager.openUrl({title:title,width:1200,height:700,url:M.cfg.wwwroot+"/lib/editor/tiny/plugins/kalturamedia/ltibrowse.php?lang="+editor.getParam("language")+"&contextid="+(0,_options.getContextId)(editor),buttons:[{type:"cancel",text:"Cancel"}]})};_exports.getSetup=async()=>{const[buttonText,buttonImage]=await Promise.all([(0,_str.get_string)("buttontitle",_common.component),(0,_utils.getButtonImage)("icon",_common.component)]);return editor=>{editor.ui.registry.addIcon(_common.icon,buttonImage.html),editor.ui.registry.addButton(_common.buttonName,{icon:_common.icon,tooltip:buttonText,onAction:()=>handleAction(editor,buttonText)}),editor.ui.registry.addMenuItem(_common.buttonName,{icon:_common.icon,text:buttonText,onAction:()=>handleAction(editor,buttonText)})}}})); + +//# sourceMappingURL=commands.min.js.map \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/commands.min.js.map b/lib/editor/tiny/plugins/kalturamedia/amd/build/commands.min.js.map new file mode 100644 index 0000000000000..1bdd6a1ece44b --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/commands.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"commands.min.js","sources":["../src/commands.js"],"sourcesContent":["// This file is part of Moodle - https://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Commands helper for the Moodle tiny_kalturamedia plugin.\n *\n * @module tiny_kalturmedia/commands\n * @copyright 2023 Roi Levi \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getButtonImage} from 'editor_tiny/utils';\nimport {get_string as getString} from 'core/str';\nimport {\n component,\n buttonName,\n icon,\n} from './common';\nimport {getContextId} from './options';\n\n/**\n * Handle the action for your plugin.\n * @param {TinyMCE.editor} editor The tinyMCE editor instance.\n * @param {string} title The dialog box title\n */\nconst handleAction = (editor, title) => {\n editor.windowManager.openUrl({\n title,\n width: 1200,\n height: 700,\n url: M.cfg.wwwroot + '/lib/editor/tiny/plugins/kalturamedia/ltibrowse.php?lang=' +\n editor.getParam('language') + '&contextid=' + getContextId(editor),\n buttons: [{type: 'cancel', text:'Cancel'}]\n });\n};\n\n/**\n * Get the setup function for the buttons.\n *\n * This is performed in an async function which ultimately returns the registration function as the\n * Tiny.AddOnManager.Add() function does not support async functions.\n *\n * @returns {function} The registration function to call within the Plugin.add function.\n */\nexport const getSetup = async() => {\n const [\n buttonText,\n buttonImage,\n ] = await Promise.all([\n getString('buttontitle', component),\n getButtonImage('icon', component),\n ]);\n\n return (editor) => {\n // Register the Moodle SVG as an icon suitable for use as a TinyMCE toolbar button.\n editor.ui.registry.addIcon(icon, buttonImage.html);\n\n // Register the KalturaMedia Button.\n editor.ui.registry.addButton(buttonName, {\n icon,\n tooltip: buttonText,\n onAction: () => handleAction(editor, buttonText),\n });\n\n // Add the KalturaMedia Menu Item.\n // This allows it to be added to a standard menu, or a context menu.\n editor.ui.registry.addMenuItem(buttonName, {\n icon,\n text: buttonText,\n onAction: () => handleAction(editor, buttonText),\n });\n };\n};\n"],"names":["handleAction","editor","title","windowManager","openUrl","width","height","url","M","cfg","wwwroot","getParam","buttons","type","text","async","buttonText","buttonImage","Promise","all","component","ui","registry","addIcon","icon","html","addButton","buttonName","tooltip","onAction","addMenuItem"],"mappings":";;;;;;;;MAqCMA,aAAe,CAACC,OAAQC,SAC1BD,OAAOE,cAAcC,QAAQ,CACzBF,MAAAA,MACAG,MAAO,KACPC,OAAQ,IACRC,IAAKC,EAAEC,IAAIC,QAAU,4DAChBT,OAAOU,SAAS,YAAc,eAAgB,yBAAaV,QAChEW,QAAS,CAAC,CAACC,KAAM,SAAUC,KAAK,gCAYhBC,gBAEhBC,WACAC,mBACMC,QAAQC,IAAI,EAClB,mBAAU,cAAeC,oBACzB,yBAAe,OAAQA,4BAGnBnB,SAEJA,OAAOoB,GAAGC,SAASC,QAAQC,aAAMP,YAAYQ,MAG7CxB,OAAOoB,GAAGC,SAASI,UAAUC,mBAAY,CACrCH,KAAAA,aACAI,QAASZ,WACTa,SAAU,IAAM7B,aAAaC,OAAQe,cAK3Cf,OAAOoB,GAAGC,SAASQ,YAAYH,mBAAY,CACtCH,KAAAA,aACAV,KAAME,WACNa,SAAU,IAAM7B,aAAaC,OAAQe"} \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/common.min.js b/lib/editor/tiny/plugins/kalturamedia/amd/build/common.min.js new file mode 100644 index 0000000000000..62faf8ef945c0 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/common.min.js @@ -0,0 +1,11 @@ +define("tiny_kalturamedia/common",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0; +/** + * Common values helper for the Moodle tiny_kalturamedia plugin. + * + * @module tiny_kalturamedia/common + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +const component="tiny_kalturamedia";var _default={component:component,pluginName:"".concat(component,"/plugin"),icon:component,buttonName:component};return _exports.default=_default,_exports.default})); + +//# sourceMappingURL=common.min.js.map \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/common.min.js.map b/lib/editor/tiny/plugins/kalturamedia/amd/build/common.min.js.map new file mode 100644 index 0000000000000..a760bb6eb455e --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/common.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common.min.js","sources":["../src/common.js"],"sourcesContent":["// This file is part of Moodle - https://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Common values helper for the Moodle tiny_kalturamedia plugin.\n *\n * @module tiny_kalturamedia/common\n * @copyright 2023 Roi Levi \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nconst component = 'tiny_kalturamedia';\n\nexport default {\n component,\n pluginName: `${component}/plugin`,\n icon: component,\n buttonName: component,\n};\n"],"names":["component","pluginName","icon","buttonName"],"mappings":";;;;;;;;MAuBMA,UAAY,iCAEH,CACXA,UAAAA,UACAC,qBAAeD,qBACfE,KAAMF,UACNG,WAAYH"} \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/configuration.min.js b/lib/editor/tiny/plugins/kalturamedia/amd/build/configuration.min.js new file mode 100644 index 0000000000000..e8d0c7bbd977f --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/configuration.min.js @@ -0,0 +1,3 @@ +define("tiny_kalturamedia/configuration",["exports","./common","editor_tiny/utils"],(function(_exports,_common,_utils){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.configure=void 0;_exports.configure=instanceConfig=>({toolbar:(0,_utils.addToolbarButtons)(instanceConfig.toolbar,"content",[_common.component]),menu:(0,_utils.addMenubarItem)(instanceConfig.menu,"insert",_common.component)})})); + +//# sourceMappingURL=configuration.min.js.map \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/configuration.min.js.map b/lib/editor/tiny/plugins/kalturamedia/amd/build/configuration.min.js.map new file mode 100644 index 0000000000000..634f4c64ae7ae --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/configuration.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"configuration.min.js","sources":["../src/configuration.js"],"sourcesContent":["// This file is part of Moodle - https://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny tiny_kalturamedia for Moodle.\n *\n * @module tiny_kalturamedia/plugin\n * @copyright 2023 Roi Levi \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {\n component as buttonName,\n} from './common';\n\nimport {\n addToolbarButtons,\n addMenubarItem,\n} from 'editor_tiny/utils';\n\nexport const configure = (instanceConfig) => {\n return {\n toolbar: addToolbarButtons(instanceConfig.toolbar , 'content', [buttonName]),\n menu: addMenubarItem(instanceConfig.menu, 'insert', buttonName),\n };\n};\n"],"names":["instanceConfig","toolbar","buttonName","menu"],"mappings":"4NAgC0BA,iBACf,CACHC,SAAS,4BAAkBD,eAAeC,QAAU,UAAW,CAACC,oBAChEC,MAAM,yBAAeH,eAAeG,KAAM,SAAUD"} \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/options.min.js b/lib/editor/tiny/plugins/kalturamedia/amd/build/options.min.js new file mode 100644 index 0000000000000..ef26cae04dc7b --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/options.min.js @@ -0,0 +1,11 @@ +define("tiny_kalturamedia/options",["exports","editor_tiny/options","./common"],(function(_exports,_options,_common){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.register=_exports.getContextId=void 0; +/** + * Options helper for the Moodle tiny_kalturamedia plugin. + * + * @module tiny_kalturamedia/options + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +const contextIdName=(0,_options.getPluginOptionName)(_common.pluginName,"contextid");_exports.register=editor=>{(0,editor.options.register)(contextIdName,{processor:"number"})};_exports.getContextId=editor=>editor.options.get(contextIdName)})); + +//# sourceMappingURL=options.min.js.map \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/options.min.js.map b/lib/editor/tiny/plugins/kalturamedia/amd/build/options.min.js.map new file mode 100644 index 0000000000000..8e8fd63d14e60 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/options.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"options.min.js","sources":["../src/options.js"],"sourcesContent":["// This file is part of Moodle - https://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Options helper for the Moodle tiny_kalturamedia plugin.\n *\n * @module tiny_kalturamedia/options\n * @copyright 2023 Roi Levi \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getPluginOptionName} from 'editor_tiny/options';\nimport {pluginName} from './common';\n\n// Helper variables for the option names.\nconst contextIdName = getPluginOptionName(pluginName, 'contextid');\n\n/**\n * Options registration function.\n *\n * @param {tinyMCE} editor\n */\nexport const register = (editor) => {\n const registerOption = editor.options.register;\n\n // For each option, register it with the editor.\n // Valid type are defined in https://www.tiny.cloud/docs/tinymce/6/apis/tinymce.editoroptions/\n registerOption(contextIdName, {\n processor: 'number',\n });\n};\n\n/**\n * Fetch the contextId value for this editor instance.\n *\n * @param {tinyMCE} editor The editor instance to fetch the value for\n * @returns {object} The value of the myFirstProperty option\n */\nexport const getContextId = (editor) => editor.options.get(contextIdName);\n"],"names":["contextIdName","pluginName","editor","registerOption","options","register","processor","get"],"mappings":";;;;;;;;MAgCMA,eAAgB,gCAAoBC,mBAAY,+BAO7BC,UAKrBC,EAJuBD,OAAOE,QAAQC,UAIvBL,cAAe,CAC1BM,UAAW,kCAUUJ,QAAWA,OAAOE,QAAQG,IAAIP"} \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/plugin.min.js b/lib/editor/tiny/plugins/kalturamedia/amd/build/plugin.min.js new file mode 100644 index 0000000000000..74bfd5356791d --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/plugin.min.js @@ -0,0 +1,10 @@ +define("tiny_kalturamedia/plugin",["exports","editor_tiny/loader","editor_tiny/utils","./common","./options","./commands","./configuration"],(function(_exports,_loader,_utils,_common,_options,_commands,Configuration){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Configuration=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj} +/** + * Tiny tiny_kalturamedia for Moodle. + * + * @module tiny_kalturamedia/plugin + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */(Configuration);var _default=new Promise((async resolve=>{const[tinyMCE,pluginMetadata,setupCommands]=await Promise.all([(0,_loader.getTinyMCE)(),(0,_utils.getPluginMetadata)(_common.component,_common.pluginName),(0,_commands.getSetup)()]);tinyMCE.PluginManager.add(_common.pluginName,(editor=>((0,_options.register)(editor),setupCommands(editor),pluginMetadata))),resolve([_common.pluginName,Configuration])}));return _exports.default=_default,_exports.default})); + +//# sourceMappingURL=plugin.min.js.map \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/build/plugin.min.js.map b/lib/editor/tiny/plugins/kalturamedia/amd/build/plugin.min.js.map new file mode 100644 index 0000000000000..a985bb51742b0 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/build/plugin.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin.min.js","sources":["../src/plugin.js"],"sourcesContent":["// This file is part of Moodle - https://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Tiny tiny_kalturamedia for Moodle.\n *\n * @module tiny_kalturamedia/plugin\n * @copyright 2023 Roi Levi \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport {getTinyMCE} from 'editor_tiny/loader';\nimport {getPluginMetadata} from 'editor_tiny/utils';\n\nimport {component, pluginName} from './common';\nimport {register as registerOptions} from './options';\nimport {getSetup as getCommandSetup} from './commands';\nimport * as Configuration from './configuration';\n\n// Setup the tiny_kalturamedia Plugin.\n// eslint-disable-next-line no-async-promise-executor\nexport default new Promise(async(resolve) => {\n // Note: The PluginManager.add function does not support asynchronous configuration.\n // Perform any asynchronous configuration here, and then call the PluginManager.add function.\n const [\n tinyMCE,\n pluginMetadata,\n setupCommands,\n ] = await Promise.all([\n getTinyMCE(),\n getPluginMetadata(component, pluginName),\n getCommandSetup(),\n ]);\n\n // Reminder: Any asynchronous code must be run before this point.\n tinyMCE.PluginManager.add(pluginName, (editor) => {\n // Register any options that your plugin has\n registerOptions(editor);\n\n // Setup any commands such as buttons, menu items, and so on.\n setupCommands(editor);\n\n // Return the pluginMetadata object. This is used by TinyMCE to display a help link for your plugin.\n return pluginMetadata;\n });\n\n resolve([pluginName, Configuration]);\n});\n"],"names":["Promise","async","tinyMCE","pluginMetadata","setupCommands","all","component","pluginName","PluginManager","add","editor","resolve","Configuration"],"mappings":";;;;;;;kCAiCe,IAAIA,SAAQC,MAAAA,gBAInBC,QACAC,eACAC,qBACMJ,QAAQK,IAAI,EAClB,yBACA,4BAAkBC,kBAAWC,qBAC7B,0BAIJL,QAAQM,cAAcC,IAAIF,oBAAaG,+BAEnBA,QAGhBN,cAAcM,QAGPP,kBAGXQ,QAAQ,CAACJ,mBAAYK"} \ No newline at end of file diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/src/commands.js b/lib/editor/tiny/plugins/kalturamedia/amd/src/commands.js new file mode 100644 index 0000000000000..8daa3c199c379 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/src/commands.js @@ -0,0 +1,85 @@ +// This file is part of Moodle - https://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Commands helper for the Moodle tiny_kalturamedia plugin. + * + * @module tiny_kalturmedia/commands + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +import {getButtonImage} from 'editor_tiny/utils'; +import {get_string as getString} from 'core/str'; +import { + component, + buttonName, + icon, +} from './common'; +import {getContextId} from './options'; + +/** + * Handle the action for your plugin. + * @param {TinyMCE.editor} editor The tinyMCE editor instance. + * @param {string} title The dialog box title + */ +const handleAction = (editor, title) => { + editor.windowManager.openUrl({ + title, + width: 1200, + height: 700, + url: M.cfg.wwwroot + '/lib/editor/tiny/plugins/kalturamedia/ltibrowse.php?lang=' + + editor.getParam('language') + '&contextid=' + getContextId(editor), + buttons: [{type: 'cancel', text:'Cancel'}] + }); +}; + +/** + * Get the setup function for the buttons. + * + * This is performed in an async function which ultimately returns the registration function as the + * Tiny.AddOnManager.Add() function does not support async functions. + * + * @returns {function} The registration function to call within the Plugin.add function. + */ +export const getSetup = async() => { + const [ + buttonText, + buttonImage, + ] = await Promise.all([ + getString('buttontitle', component), + getButtonImage('icon', component), + ]); + + return (editor) => { + // Register the Moodle SVG as an icon suitable for use as a TinyMCE toolbar button. + editor.ui.registry.addIcon(icon, buttonImage.html); + + // Register the KalturaMedia Button. + editor.ui.registry.addButton(buttonName, { + icon, + tooltip: buttonText, + onAction: () => handleAction(editor, buttonText), + }); + + // Add the KalturaMedia Menu Item. + // This allows it to be added to a standard menu, or a context menu. + editor.ui.registry.addMenuItem(buttonName, { + icon, + text: buttonText, + onAction: () => handleAction(editor, buttonText), + }); + }; +}; diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/src/common.js b/lib/editor/tiny/plugins/kalturamedia/amd/src/common.js new file mode 100644 index 0000000000000..ff76278ae0104 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/src/common.js @@ -0,0 +1,31 @@ +// This file is part of Moodle - https://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Common values helper for the Moodle tiny_kalturamedia plugin. + * + * @module tiny_kalturamedia/common + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +const component = 'tiny_kalturamedia'; + +export default { + component, + pluginName: `${component}/plugin`, + icon: component, + buttonName: component, +}; diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/src/configuration.js b/lib/editor/tiny/plugins/kalturamedia/amd/src/configuration.js new file mode 100644 index 0000000000000..e37c826b63298 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/src/configuration.js @@ -0,0 +1,38 @@ +// This file is part of Moodle - https://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Tiny tiny_kalturamedia for Moodle. + * + * @module tiny_kalturamedia/plugin + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +import { + component as buttonName, +} from './common'; + +import { + addToolbarButtons, + addMenubarItem, +} from 'editor_tiny/utils'; + +export const configure = (instanceConfig) => { + return { + toolbar: addToolbarButtons(instanceConfig.toolbar , 'content', [buttonName]), + menu: addMenubarItem(instanceConfig.menu, 'insert', buttonName), + }; +}; diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/src/options.js b/lib/editor/tiny/plugins/kalturamedia/amd/src/options.js new file mode 100644 index 0000000000000..77b3aa2282566 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/src/options.js @@ -0,0 +1,56 @@ +// This file is part of Moodle - https://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Options helper for the Moodle tiny_kalturamedia plugin. + * + * @module tiny_kalturamedia/options + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +import {getPluginOptionName} from 'editor_tiny/options'; +import {pluginName} from './common'; + +// Helper variables for the option names. +const contextIdName = getPluginOptionName(pluginName, 'contextid'); + +/** + * Options registration function. + * + * @param {tinyMCE} editor + */ +export const register = (editor) => { + const registerOption = editor.options.register; + + // For each option, register it with the editor. + // Valid type are defined in https://www.tiny.cloud/docs/tinymce/6/apis/tinymce.editoroptions/ + registerOption(contextIdName, { + processor: 'number', + }); +}; + +/** + * Fetch the contextId value for this editor instance. + * + * @param {tinyMCE} editor The editor instance to fetch the value for + * @returns {object} The value of the myFirstProperty option + */ +export const getContextId = (editor) => editor.options.get(contextIdName); diff --git a/lib/editor/tiny/plugins/kalturamedia/amd/src/plugin.js b/lib/editor/tiny/plugins/kalturamedia/amd/src/plugin.js new file mode 100644 index 0000000000000..adf3c2cc721dd --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/amd/src/plugin.js @@ -0,0 +1,60 @@ +// This file is part of Moodle - https://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Tiny tiny_kalturamedia for Moodle. + * + * @module tiny_kalturamedia/plugin + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +import {getTinyMCE} from 'editor_tiny/loader'; +import {getPluginMetadata} from 'editor_tiny/utils'; + +import {component, pluginName} from './common'; +import {register as registerOptions} from './options'; +import {getSetup as getCommandSetup} from './commands'; +import * as Configuration from './configuration'; + +// Setup the tiny_kalturamedia Plugin. +// eslint-disable-next-line no-async-promise-executor +export default new Promise(async(resolve) => { + // Note: The PluginManager.add function does not support asynchronous configuration. + // Perform any asynchronous configuration here, and then call the PluginManager.add function. + const [ + tinyMCE, + pluginMetadata, + setupCommands, + ] = await Promise.all([ + getTinyMCE(), + getPluginMetadata(component, pluginName), + getCommandSetup(), + ]); + + // Reminder: Any asynchronous code must be run before this point. + tinyMCE.PluginManager.add(pluginName, (editor) => { + // Register any options that your plugin has + registerOptions(editor); + + // Setup any commands such as buttons, menu items, and so on. + setupCommands(editor); + + // Return the pluginMetadata object. This is used by TinyMCE to display a help link for your plugin. + return pluginMetadata; + }); + + resolve([pluginName, Configuration]); +}); diff --git a/lib/editor/tiny/plugins/kalturamedia/classes/plugininfo.php b/lib/editor/tiny/plugins/kalturamedia/classes/plugininfo.php new file mode 100644 index 0000000000000..a51f2696f957a --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/classes/plugininfo.php @@ -0,0 +1,60 @@ +. + +/** + * Tiny Kaltura media plugin for Moodle. + * + * @package tiny_kalturamedia + * @copyright 2023 Roi Levi + * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace tiny_kalturamedia; + +use context; +use editor_tiny\plugin; +use editor_tiny\plugin_with_buttons; +use editor_tiny\plugin_with_menuitems; +use editor_tiny\plugin_with_configuration; + +class plugininfo extends plugin implements plugin_with_configuration, plugin_with_buttons, plugin_with_menuitems { + + public static function get_available_buttons(): array { + return [ + 'tiny_kalturamedia/plugin', + ]; + } + + public static function get_available_menuitems(): array { + return [ + 'tiny_kalturamedia/plugin', + ]; + } + + public static function get_plugin_configuration_for_context( + context $context, + array $options, + array $fpoptions, + ?\editor_tiny\editor $editor = null + ): array { + return [ + // Your values go here. + // These will be mapped to a namespaced EditorOption in Tiny. + // Pass contextId - later appended to ltibrowse url + 'contextid' => $context->id, + ]; + } +} diff --git a/lib/editor/tiny/plugins/kalturamedia/classes/privacy/provider.php b/lib/editor/tiny/plugins/kalturamedia/classes/privacy/provider.php new file mode 100644 index 0000000000000..6bbbc0506114b --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/classes/privacy/provider.php @@ -0,0 +1,37 @@ +. + +namespace tiny_kalturamedia\privacy; + +/** + * Privacy API implementation for the Kaltura media plugin. + * + * @package tiny_kalturamedia + * @category privacy + * @copyright 2023 Roi Levi + * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class provider implements \core_privacy\local\metadata\null_provider { + + /** + * Returns stringid of a text explaining that this plugin stores no personal data. + * + * @return string + */ + public static function get_reason() : string { + return 'privacy:metadata'; + } +} diff --git a/lib/editor/tiny/plugins/kalturamedia/js/ltidialoglib.js b/lib/editor/tiny/plugins/kalturamedia/js/ltidialoglib.js new file mode 100644 index 0000000000000..2bade67f9efe9 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/js/ltidialoglib.js @@ -0,0 +1,52 @@ +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Kaltura media ltidialog javascript file. This code is based off of the work done for tinymce_kalturamedia plugin. + * @see editor/tinymce/plugins/kalturamedia. + * + * @module tiny_kalturamedia/plugin + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +/** + * Insert the selected media into the editor. + */ +function insertMedia() { + var form = document.forms[0]; + var kafuri = form.kafuri.value; + var sourceUrl = form.source.value; + + var url = removeProtocolFromUrl(kafuri); + sourceUrl = removeProtocolFromUrl(sourceUrl); + url = sourceUrl.replace(kafuri, url); + var parser = document.createElement('a'); + parser.href = form.source.value; + url += parser.search; + + var content = 'tinymce-kalturamedia-embed||'+ + form.video_title.value+'||'+form.width.value+'||'+form.height.value+''; + // send post message to insert content into the editor and close the dialog + window.parent.postMessage({ + mceAction: 'insertContent', + content: content + },'*'); + window.parent.postMessage({ + mceAction: 'close', + },'*'); +} + +function removeProtocolFromUrl(fullUrl) { + return fullUrl.replace(/^https?:\/\//,''); +} diff --git a/lib/editor/tiny/plugins/kalturamedia/lang/en/tiny_kalturamedia.php b/lib/editor/tiny/plugins/kalturamedia/lang/en/tiny_kalturamedia.php new file mode 100644 index 0000000000000..6106367f4b216 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/lang/en/tiny_kalturamedia.php @@ -0,0 +1,30 @@ +. + +/** + * Plugin strings are defined here. + * + * @package tiny_kalturamedia + * @category string + * @copyright 2023 Roi Levi + * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$string['pluginname'] = 'Kaltura media plugin'; +$string['privacy:metadata'] = 'Kaltura media plugin does not store any personal data'; +$string['buttontitle'] = 'Embed Kaltura Media'; diff --git a/lib/editor/tiny/plugins/kalturamedia/lti_launch.php b/lib/editor/tiny/plugins/kalturamedia/lti_launch.php new file mode 100644 index 0000000000000..d6f544c0733ab --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/lti_launch.php @@ -0,0 +1,76 @@ +. + +/** + * Kaltura media LTI launch page. + * + * @module tiny_kalturamedia + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require_once(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/config.php'); +require_once(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/local/kaltura/locallib.php'); + +global $USER; + +require_login(); + +$contextid = required_param('contextid', PARAM_INT); +$height = required_param('height', PARAM_INT); +$width = required_param('width', PARAM_INT); +$withblocks = optional_param('withblocks', 0, PARAM_INT); + +$context = context::instance_by_id($contextid); + +$launch = array(); +$course = 0; + +if ($context instanceof context_course) { + $course = get_course($context->instanceid); + +} else if ($context instanceof context_system || $context instanceof context_coursecat) { + $course = get_course(1); +} else { + // Find parent context + $parentcontexts = $context->get_parent_contexts(false); + + foreach ($parentcontexts as $ctx) { + if ($ctx instanceof context_course) { + $course = get_course($ctx->instanceid); + break; + } else if ($ctx instanceof context_system || $ctx instanceof context_coursecat) { + $course = get_course(1); + break; + } + } +} + +$launch['id'] = 1; +$launch['cmid'] = 0; +$launch['title'] = 'Kaltura media'; +$launch['module'] = KAF_BROWSE_EMBED_MODULE; +$launch['course'] = $course; +$launch['width'] = $width; +$launch['height'] = $height; +$launch['custom_publishdata'] = ''; + +if (local_kaltura_validate_browseembed_required_params($launch)) { + $content = local_kaltura_request_lti_launch($launch, $withblocks, 'tiny'); + echo $content; +} else { + echo get_string('invalid_launch_parameters', 'mod_kalvidres'); +} diff --git a/lib/editor/tiny/plugins/kalturamedia/ltibrowse.php b/lib/editor/tiny/plugins/kalturamedia/ltibrowse.php new file mode 100644 index 0000000000000..2fc1659b24965 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/ltibrowse.php @@ -0,0 +1,60 @@ +. + +/** + * Kaltura media LTI launch wrapper page. + * + * @module tiny_kalturamedia + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require_once(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/config.php'); +require_once($CFG->dirroot.'/local/kaltura/locallib.php'); +require_once('renderer.php'); + +global $PAGE; + +require_login(); + +$contextid = required_param('contextid', PARAM_INT); + +$PAGE->set_pagelayout('popup'); +$PAGE->set_url('/editor/tiny/plugins/kalturamedia/lti_launch.php'); +$PAGE->set_context(context_system::instance()); + +echo $OUTPUT->header(); + +echo html_writer::script('', 'js/ltidialoglib.js'); + +echo tiny_kalturamedia_preview_embed_form($contextid); + +$urlparams = array( + 'withblocks' => 0, + 'width' => KALTURA_PANEL_WIDTH, + 'height' => KALTURA_PANEL_HEIGHT +); +$url = new moodle_url('/lib/editor/tiny/plugins/kalturamedia/lti_launch.php', $urlparams); + +$params = array( + 'ltilaunchurl' => $url->out(), + 'objecttagheight' => TINY_KALTURAMEDIA_OBJECT_TAG_HEIGHT, + 'objecttagid' => TINY_KALTURAMEDIA_OBJECT_TAG_ID, + 'previewiframeid' => TINY_KALTURAMEDIA_PREVIEW_IFRAME_TAG_ID +); +$PAGE->requires->yui_module('moodle-local_kaltura-ltitinymcepanel', 'M.local_kaltura.init', array($params), null, true); + +echo $OUTPUT->footer(); diff --git a/lib/editor/tiny/plugins/kalturamedia/pix/icon.svg b/lib/editor/tiny/plugins/kalturamedia/pix/icon.svg new file mode 100644 index 0000000000000..54befa3b91abe --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/pix/icon.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + diff --git a/lib/editor/tiny/plugins/kalturamedia/renderer.php b/lib/editor/tiny/plugins/kalturamedia/renderer.php new file mode 100644 index 0000000000000..6001a3a9ca906 --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/renderer.php @@ -0,0 +1,58 @@ +. + +/** + * LTI preview and selection renderer library. + * + * @module tiny_kalturamedia + * @copyright 2023 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +define('TINY_KALTURAMEDIA_OBJECT_TAG_ID', 'objecttagcontainer'); +define('TINY_KALTURAMEDIA_PREVIEW_IFRAME_TAG_ID', 'video_preview_frame'); +define('TINY_KALTURAMEDIA_OBJECT_TAG_HEIGHT', '500'); + +/** + * Returns HTML markup for a form used to preview and insert the video markup into the page. + * @param string $contextId + * @return string HTML markup. + */ +function tiny_kalturamedia_preview_embed_form($contextId = '') { + // Create hidden elements. + $hiddenelements = html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'entry_id', 'value' => '')); + $hiddenelements .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'source', 'value' => '')); + $hiddenelements .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'kafuri', 'value' => local_kaltura_get_config()->kaf_uri)); + $hiddenelements .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'video_title', 'value' => '')); + $hiddenelements .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'uiconf_id', 'value' => '')); + $hiddenelements .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'widescreen', 'value' => '')); + $hiddenelements .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'height', 'value' => '')); + $hiddenelements .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'width', 'value' => '')); + $hiddenelements .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'lti_launch_context_id', 'value' => $contextId)); + + // Create LTI launch and preview container divs + $ltilaunchcontainer = html_writer::tag('div', '', array('id' => TINY_KALTURAMEDIA_OBJECT_TAG_ID)); + $previewcontainer = html_writer::tag('div', '', array('id' => TINY_KALTURAMEDIA_PREVIEW_IFRAME_TAG_ID)); + + // This element is used so that the ltiservice.js can simulate a 'click' event. This tells the plug-in that the user has choosen a video to embed on the page + // and it will enable the insert button. + $simulateclickdiv = html_writer::tag('input', '', array('id' => 'closeltipanel', 'type' => 'hidden', 'value' => '')); + + $content = $simulateclickdiv.$ltilaunchcontainer.$previewcontainer.$hiddenelements; + + //$content = $ltilaunchcontainer.$previewcontainer.$hiddenelements; + return html_writer::tag('form', $content, array('onsubmit' => 'insertMedia();return false', 'action' => '#')); +} + diff --git a/lib/editor/tiny/plugins/kalturamedia/version.php b/lib/editor/tiny/plugins/kalturamedia/version.php new file mode 100644 index 0000000000000..dcbd9b618309d --- /dev/null +++ b/lib/editor/tiny/plugins/kalturamedia/version.php @@ -0,0 +1,33 @@ +. + +/** + * Plugin version and other meta-data are defined here. + * + * @package tiny_kalturamedia + * @copyright 2023 Roi Levi + * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$plugin->version = 2024100702; +$plugin->release = 'Kaltura release 4.5.1'; +$plugin->requires = 2024042200; +$plugin->component = 'tiny_kalturamedia'; +$plugin->dependencies = array( + 'local_kaltura' => 2024100702 +); diff --git a/local/kaltura/API/KalturaClient.php b/local/kaltura/API/KalturaClient.php new file mode 100644 index 0000000000000..b9bb8cd27d142 --- /dev/null +++ b/local/kaltura/API/KalturaClient.php @@ -0,0 +1,9775 @@ +. +// +// @ignore +// =================================================================================================== + +/** + * @package Kaltura + * @subpackage Client + */ +require_once(dirname(__FILE__) . "/KalturaClientBase.php"); +require_once(dirname(__FILE__) . "/KalturaEnums.php"); +require_once(dirname(__FILE__) . "/KalturaTypes.php"); + + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlProfileService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new access control profile + * + * @param KalturaAccessControlProfile $accessControlProfile + * @return KalturaAccessControlProfile + */ + function add(KalturaAccessControlProfile $accessControlProfile) + { + $kparams = array(); + $this->client->addParam($kparams, "accessControlProfile", $accessControlProfile->toParams()); + $this->client->queueServiceActionCall("accesscontrolprofile", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAccessControlProfile"); + return $resultObject; + } + + /** + * Delete access control profile by id + * + * @param int $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("accesscontrolprofile", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get access control profile by id + * + * @param int $id + * @return KalturaAccessControlProfile + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("accesscontrolprofile", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAccessControlProfile"); + return $resultObject; + } + + /** + * List access control profiles by filter and pager + * + * @param KalturaAccessControlProfileFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaAccessControlProfileListResponse + */ + function listAction(KalturaAccessControlProfileFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("accesscontrolprofile", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAccessControlProfileListResponse"); + return $resultObject; + } + + /** + * Update access control profile by id + * + * @param int $id + * @param KalturaAccessControlProfile $accessControlProfile + * @return KalturaAccessControlProfile + */ + function update($id, KalturaAccessControlProfile $accessControlProfile) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "accessControlProfile", $accessControlProfile->toParams()); + $this->client->queueServiceActionCall("accesscontrolprofile", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAccessControlProfile"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new Access Control Profile + * + * @param KalturaAccessControl $accessControl + * @return KalturaAccessControl + */ + function add(KalturaAccessControl $accessControl) + { + $kparams = array(); + $this->client->addParam($kparams, "accessControl", $accessControl->toParams()); + $this->client->queueServiceActionCall("accesscontrol", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAccessControl"); + return $resultObject; + } + + /** + * Delete Access Control Profile by id + * + * @param int $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("accesscontrol", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get Access Control Profile by id + * + * @param int $id + * @return KalturaAccessControl + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("accesscontrol", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAccessControl"); + return $resultObject; + } + + /** + * List Access Control Profiles by filter and pager + * + * @param KalturaAccessControlFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaAccessControlListResponse + */ + function listAction(KalturaAccessControlFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("accesscontrol", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAccessControlListResponse"); + return $resultObject; + } + + /** + * Update Access Control Profile by id + * + * @param int $id + * @param KalturaAccessControl $accessControl + * @return KalturaAccessControl + */ + function update($id, KalturaAccessControl $accessControl) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "accessControl", $accessControl->toParams()); + $this->client->queueServiceActionCall("accesscontrol", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAccessControl"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAdminUserService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Get an admin session using admin email and password (Used for login to the KMC application) + * + * @param string $email + * @param string $password + * @param int $partnerId + * @return string + */ + function login($email, $password, $partnerId = null) + { + $kparams = array(); + $this->client->addParam($kparams, "email", $email); + $this->client->addParam($kparams, "password", $password); + $this->client->addParam($kparams, "partnerId", $partnerId); + $this->client->queueServiceActionCall("adminuser", "login", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Reset admin user password and send it to the users email address + * + * @param string $email + */ + function resetPassword($email) + { + $kparams = array(); + $this->client->addParam($kparams, "email", $email); + $this->client->queueServiceActionCall("adminuser", "resetPassword", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Set initial users password + * + * @param string $hashKey + * @param string $newPassword New password to set + */ + function setInitialPassword($hashKey, $newPassword) + { + $kparams = array(); + $this->client->addParam($kparams, "hashKey", $hashKey); + $this->client->addParam($kparams, "newPassword", $newPassword); + $this->client->queueServiceActionCall("adminuser", "setInitialPassword", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Update admin user password and email + * + * @param string $email + * @param string $password + * @param string $newEmail Optional, provide only when you want to update the email + * @param string $newPassword + * @return KalturaAdminUser + */ + function updatePassword($email, $password, $newEmail = "", $newPassword = "") + { + $kparams = array(); + $this->client->addParam($kparams, "email", $email); + $this->client->addParam($kparams, "password", $password); + $this->client->addParam($kparams, "newEmail", $newEmail); + $this->client->addParam($kparams, "newPassword", $newPassword); + $this->client->queueServiceActionCall("adminuser", "updatePassword", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAdminUser"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAnalyticsService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Report query action allows to get a analytics data for specific query dimensions, metrics and filters. + * + * @param KalturaAnalyticsFilter $filter The analytics query filter + * @param KalturaFilterPager $pager The analytics query result pager + * @return KalturaReportResponse + */ + function query(KalturaAnalyticsFilter $filter, KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("analytics", "query", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaReportResponse"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAppTokenService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new application authentication token + * + * @param KalturaAppToken $appToken + * @return KalturaAppToken + */ + function add(KalturaAppToken $appToken) + { + $kparams = array(); + $this->client->addParam($kparams, "appToken", $appToken->toParams()); + $this->client->queueServiceActionCall("apptoken", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAppToken"); + return $resultObject; + } + + /** + * Delete application authentication token by id + * + * @param string $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("apptoken", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get application authentication token by id + * + * @param string $id + * @return KalturaAppToken + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("apptoken", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAppToken"); + return $resultObject; + } + + /** + * List application authentication tokens by filter and pager + * + * @param KalturaAppTokenFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaAppTokenListResponse + */ + function listAction(KalturaAppTokenFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("apptoken", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAppTokenListResponse"); + return $resultObject; + } + + /** + * Starts a new KS (kaltura Session) based on application authentication token id + * + * @param string $id Application token id + * @param string $tokenHash Hashed token, built of sha1 on current KS concatenated with the application token + * @param string $userId Session user id, will be ignored if a different user id already defined on the application token + * @param int $type Session type, will be ignored if a different session type already defined on the application token + * @param int $expiry Session expiry (in seconds), could be overwritten by shorter expiry of the application token and the session-expiry that defined on the application token + * @return KalturaSessionInfo + */ + function startSession($id, $tokenHash, $userId = null, $type = null, $expiry = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "tokenHash", $tokenHash); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "type", $type); + $this->client->addParam($kparams, "expiry", $expiry); + $this->client->queueServiceActionCall("apptoken", "startSession", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaSessionInfo"); + return $resultObject; + } + + /** + * Update application authentication token by id + * + * @param string $id + * @param KalturaAppToken $appToken + * @return KalturaAppToken + */ + function update($id, KalturaAppToken $appToken) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "appToken", $appToken->toParams()); + $this->client->queueServiceActionCall("apptoken", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaAppToken"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Generic add entry, should be used when the uploaded entry type is not known. + * + * @param KalturaBaseEntry $entry + * @param string $type + * @return KalturaBaseEntry + */ + function add(KalturaBaseEntry $entry, $type = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entry", $entry->toParams()); + $this->client->addParam($kparams, "type", $type); + $this->client->queueServiceActionCall("baseentry", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Attach content resource to entry in status NO_MEDIA + * + * @param string $entryId + * @param KalturaResource $resource + * @return KalturaBaseEntry + */ + function addContent($entryId, KalturaResource $resource) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "resource", $resource->toParams()); + $this->client->queueServiceActionCall("baseentry", "addContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Generic add entry using an uploaded file, should be used when the uploaded entry type is not known. + * + * @param KalturaBaseEntry $entry + * @param string $uploadTokenId + * @param string $type + * @return KalturaBaseEntry + */ + function addFromUploadedFile(KalturaBaseEntry $entry, $uploadTokenId, $type = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entry", $entry->toParams()); + $this->client->addParam($kparams, "uploadTokenId", $uploadTokenId); + $this->client->addParam($kparams, "type", $type); + $this->client->queueServiceActionCall("baseentry", "addFromUploadedFile", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Anonymously rank an entry, no validation is done on duplicate rankings. + * + * @param string $entryId + * @param int $rank + */ + function anonymousRank($entryId, $rank) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "rank", $rank); + $this->client->queueServiceActionCall("baseentry", "anonymousRank", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Approve the entry and mark the pending flags (if any) as moderated (this will make the entry playable). + * + * @param string $entryId + */ + function approve($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("baseentry", "approve", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Clone an entry with optional attributes to apply to the clone + * + * @param string $entryId Id of entry to clone + * @param array $cloneOptions + * @return KalturaBaseEntry + */ + function cloneAction($entryId, array $cloneOptions = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + if ($cloneOptions !== null) + foreach($cloneOptions as $index => $obj) + { + $this->client->addParam($kparams, "cloneOptions:$index", $obj->toParams()); + } + $this->client->queueServiceActionCall("baseentry", "clone", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Count base entries by filter. + * + * @param KalturaBaseEntryFilter $filter Entry filter + * @return int + */ + function count(KalturaBaseEntryFilter $filter = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + $this->client->queueServiceActionCall("baseentry", "count", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * Delete an entry. + * + * @param string $entryId Entry id to delete + */ + function delete($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("baseentry", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * + * + * @param string $entryId + * @param int $storageProfileId + * @return KalturaBaseEntry + */ + function export($entryId, $storageProfileId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "storageProfileId", $storageProfileId); + $this->client->queueServiceActionCall("baseentry", "export", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Flag inappropriate entry for moderation. + * + * @param KalturaModerationFlag $moderationFlag + */ + function flag(KalturaModerationFlag $moderationFlag) + { + $kparams = array(); + $this->client->addParam($kparams, "moderationFlag", $moderationFlag->toParams()); + $this->client->queueServiceActionCall("baseentry", "flag", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get base entry by ID. + * + * @param string $entryId Entry id + * @param int $version Desired version of the data + * @return KalturaBaseEntry + */ + function get($entryId, $version = -1) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "version", $version); + $this->client->queueServiceActionCall("baseentry", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Get an array of KalturaBaseEntry objects by a comma-separated list of ids. + * + * @param string $entryIds Comma separated string of entry ids + * @return array + */ + function getByIds($entryIds) + { + $kparams = array(); + $this->client->addParam($kparams, "entryIds", $entryIds); + $this->client->queueServiceActionCall("baseentry", "getByIds", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * This action delivers entry-related data, based on the user's context: access control, restriction, playback format and storage information. + * + * @param string $entryId + * @param KalturaEntryContextDataParams $contextDataParams + * @return KalturaEntryContextDataResult + */ + function getContextData($entryId, KalturaEntryContextDataParams $contextDataParams) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "contextDataParams", $contextDataParams->toParams()); + $this->client->queueServiceActionCall("baseentry", "getContextData", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaEntryContextDataResult"); + return $resultObject; + } + + /** + * This action delivers all data relevant for player + * + * @param string $entryId + * @param KalturaPlaybackContextOptions $contextDataParams + * @return KalturaPlaybackContext + */ + function getPlaybackContext($entryId, KalturaPlaybackContextOptions $contextDataParams) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "contextDataParams", $contextDataParams->toParams()); + $this->client->queueServiceActionCall("baseentry", "getPlaybackContext", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPlaybackContext"); + return $resultObject; + } + + /** + * Get remote storage existing paths for the asset. + * + * @param string $entryId + * @return KalturaRemotePathListResponse + */ + function getRemotePaths($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("baseentry", "getRemotePaths", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaRemotePathListResponse"); + return $resultObject; + } + + /** + * Index an entry by id. + * + * @param string $id + * @param bool $shouldUpdate + * @return int + */ + function index($id, $shouldUpdate = true) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "shouldUpdate", $shouldUpdate); + $this->client->queueServiceActionCall("baseentry", "index", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * List base entries by filter with paging support. + * + * @param KalturaBaseEntryFilter $filter Entry filter + * @param KalturaFilterPager $pager Pager + * @return KalturaBaseEntryListResponse + */ + function listAction(KalturaBaseEntryFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("baseentry", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntryListResponse"); + return $resultObject; + } + + /** + * List base entries by filter according to reference id + * + * @param string $refId Entry Reference ID + * @param KalturaFilterPager $pager Pager + * @return KalturaBaseEntryListResponse + */ + function listByReferenceId($refId, KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "refId", $refId); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("baseentry", "listByReferenceId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntryListResponse"); + return $resultObject; + } + + /** + * List all pending flags for the entry. + * + * @param string $entryId + * @param KalturaFilterPager $pager + * @return KalturaModerationFlagListResponse + */ + function listFlags($entryId, KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("baseentry", "listFlags", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaModerationFlagListResponse"); + return $resultObject; + } + + /** + * Reject the entry and mark the pending flags (if any) as moderated (this will make the entry non-playable). + * + * @param string $entryId + */ + function reject($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("baseentry", "reject", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Update base entry. Only the properties that were set will be updated. + * + * @param string $entryId Entry id to update + * @param KalturaBaseEntry $baseEntry Base entry metadata to update + * @return KalturaBaseEntry + */ + function update($entryId, KalturaBaseEntry $baseEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "baseEntry", $baseEntry->toParams()); + $this->client->queueServiceActionCall("baseentry", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Update the content resource associated with the entry. + * + * @param string $entryId Entry id to update + * @param KalturaResource $resource Resource to be used to replace entry content + * @param int $conversionProfileId The conversion profile id to be used on the entry + * @param KalturaEntryReplacementOptions $advancedOptions Additional update content options + * @return KalturaBaseEntry + */ + function updateContent($entryId, KalturaResource $resource, $conversionProfileId = null, KalturaEntryReplacementOptions $advancedOptions = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "resource", $resource->toParams()); + $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); + if ($advancedOptions !== null) + $this->client->addParam($kparams, "advancedOptions", $advancedOptions->toParams()); + $this->client->queueServiceActionCall("baseentry", "updateContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Update entry thumbnail from a different entry by a specified time offset (in seconds). + * + * @param string $entryId Media entry id + * @param string $sourceEntryId Media entry id + * @param int $timeOffset Time offset (in seconds) + * @return KalturaBaseEntry + */ + function updateThumbnailFromSourceEntry($entryId, $sourceEntryId, $timeOffset) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "sourceEntryId", $sourceEntryId); + $this->client->addParam($kparams, "timeOffset", $timeOffset); + $this->client->queueServiceActionCall("baseentry", "updateThumbnailFromSourceEntry", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Update entry thumbnail using url. + * + * @param string $entryId Media entry id + * @param string $url File url + * @return KalturaBaseEntry + */ + function updateThumbnailFromUrl($entryId, $url) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "url", $url); + $this->client->queueServiceActionCall("baseentry", "updateThumbnailFromUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Update entry thumbnail using a raw jpeg file. + * + * @param string $entryId Media entry id + * @param file $fileData Jpeg file data + * @return KalturaBaseEntry + */ + function updateThumbnailJpeg($entryId, $fileData) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + $this->client->queueServiceActionCall("baseentry", "updateThumbnailJpeg", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Upload a file to Kaltura, that can be used to create an entry. + * + * @param file $fileData The file data + * @return string + */ + function upload($fileData) + { + $kparams = array(); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + $this->client->queueServiceActionCall("baseentry", "upload", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Aborts the bulk upload and all its child jobs + * + * @param bigint $id Job id + * @return KalturaBulkUpload + */ + function abort($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("bulkupload", "abort", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBulkUpload"); + return $resultObject; + } + + /** + * Add new bulk upload batch job + Conversion profile id can be specified in the API or in the CSV file, the one in the CSV file will be stronger. + If no conversion profile was specified, partner's default will be used + * + * @param int $conversionProfileId Convertion profile id to use for converting the current bulk (-1 to use partner's default) + * @param file $csvFileData Bulk upload file + * @param string $bulkUploadType + * @param string $uploadedBy + * @param string $fileName Friendly name of the file, used to be recognized later in the logs. + * @return KalturaBulkUpload + */ + function add($conversionProfileId, $csvFileData, $bulkUploadType = null, $uploadedBy = null, $fileName = null) + { + $kparams = array(); + $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); + $kfiles = array(); + $this->client->addParam($kfiles, "csvFileData", $csvFileData); + $this->client->addParam($kparams, "bulkUploadType", $bulkUploadType); + $this->client->addParam($kparams, "uploadedBy", $uploadedBy); + $this->client->addParam($kparams, "fileName", $fileName); + $this->client->queueServiceActionCall("bulkupload", "add", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBulkUpload"); + return $resultObject; + } + + /** + * Get bulk upload batch job by id + * + * @param bigint $id + * @return KalturaBulkUpload + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("bulkupload", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBulkUpload"); + return $resultObject; + } + + /** + * List bulk upload batch jobs + * + * @param KalturaFilterPager $pager + * @return KalturaBulkUploadListResponse + */ + function listAction(KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("bulkupload", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBulkUploadListResponse"); + return $resultObject; + } + + /** + * Serve action returan the original file. + * + * @param bigint $id Job id + * @return file + */ + function serve($id) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("bulkupload", "serve", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * ServeLog action returan the original file. + * + * @param bigint $id Job id + * @return file + */ + function serveLog($id) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("bulkupload", "serveLog", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryEntryService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Activate CategoryEntry when it is pending moderation + * + * @param string $entryId + * @param int $categoryId + */ + function activate($entryId, $categoryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->queueServiceActionCall("categoryentry", "activate", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Add new CategoryEntry + * + * @param KalturaCategoryEntry $categoryEntry + * @return KalturaCategoryEntry + */ + function add(KalturaCategoryEntry $categoryEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "categoryEntry", $categoryEntry->toParams()); + $this->client->queueServiceActionCall("categoryentry", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategoryEntry"); + return $resultObject; + } + + /** + * + * + * @param KalturaBulkServiceData $bulkUploadData + * @param KalturaBulkUploadCategoryEntryData $bulkUploadCategoryEntryData + * @return KalturaBulkUpload + */ + function addFromBulkUpload(KalturaBulkServiceData $bulkUploadData, KalturaBulkUploadCategoryEntryData $bulkUploadCategoryEntryData = null) + { + $kparams = array(); + $this->client->addParam($kparams, "bulkUploadData", $bulkUploadData->toParams()); + if ($bulkUploadCategoryEntryData !== null) + $this->client->addParam($kparams, "bulkUploadCategoryEntryData", $bulkUploadCategoryEntryData->toParams()); + $this->client->queueServiceActionCall("categoryentry", "addFromBulkUpload", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBulkUpload"); + return $resultObject; + } + + /** + * Delete CategoryEntry + * + * @param string $entryId + * @param int $categoryId + */ + function delete($entryId, $categoryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->queueServiceActionCall("categoryentry", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Index CategoryEntry by Id + * + * @param string $entryId + * @param int $categoryId + * @param bool $shouldUpdate + * @return int + */ + function index($entryId, $categoryId, $shouldUpdate = true) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->addParam($kparams, "shouldUpdate", $shouldUpdate); + $this->client->queueServiceActionCall("categoryentry", "index", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * List all categoryEntry + * + * @param KalturaCategoryEntryFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaCategoryEntryListResponse + */ + function listAction(KalturaCategoryEntryFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("categoryentry", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategoryEntryListResponse"); + return $resultObject; + } + + /** + * Activate CategoryEntry when it is pending moderation + * + * @param string $entryId + * @param int $categoryId + */ + function reject($entryId, $categoryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->queueServiceActionCall("categoryentry", "reject", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Update privacy context from the category + * + * @param string $entryId + * @param int $categoryId + */ + function syncPrivacyContext($entryId, $categoryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->queueServiceActionCall("categoryentry", "syncPrivacyContext", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new Category + * + * @param KalturaCategory $category + * @return KalturaCategory + */ + function add(KalturaCategory $category) + { + $kparams = array(); + $this->client->addParam($kparams, "category", $category->toParams()); + $this->client->queueServiceActionCall("category", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategory"); + return $resultObject; + } + + /** + * + * + * @param file $fileData + * @param KalturaBulkUploadJobData $bulkUploadData + * @param KalturaBulkUploadCategoryData $bulkUploadCategoryData + * @return KalturaBulkUpload + */ + function addFromBulkUpload($fileData, KalturaBulkUploadJobData $bulkUploadData = null, KalturaBulkUploadCategoryData $bulkUploadCategoryData = null) + { + $kparams = array(); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + if ($bulkUploadData !== null) + $this->client->addParam($kparams, "bulkUploadData", $bulkUploadData->toParams()); + if ($bulkUploadCategoryData !== null) + $this->client->addParam($kparams, "bulkUploadCategoryData", $bulkUploadCategoryData->toParams()); + $this->client->queueServiceActionCall("category", "addFromBulkUpload", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBulkUpload"); + return $resultObject; + } + + /** + * Delete a Category + * + * @param int $id + * @param int $moveEntriesToParentCategory + */ + function delete($id, $moveEntriesToParentCategory = 1) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "moveEntriesToParentCategory", $moveEntriesToParentCategory); + $this->client->queueServiceActionCall("category", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get Category by id + * + * @param int $id + * @return KalturaCategory + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("category", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategory"); + return $resultObject; + } + + /** + * Index Category by id + * + * @param int $id + * @param bool $shouldUpdate + * @return int + */ + function index($id, $shouldUpdate = true) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "shouldUpdate", $shouldUpdate); + $this->client->queueServiceActionCall("category", "index", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * List all categories + * + * @param KalturaCategoryFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaCategoryListResponse + */ + function listAction(KalturaCategoryFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("category", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategoryListResponse"); + return $resultObject; + } + + /** + * Move categories that belong to the same parent category to a target categroy - enabled only for ks with disable entitlement + * + * @param string $categoryIds + * @param int $targetCategoryParentId + * @return bool + */ + function move($categoryIds, $targetCategoryParentId) + { + $kparams = array(); + $this->client->addParam($kparams, "categoryIds", $categoryIds); + $this->client->addParam($kparams, "targetCategoryParentId", $targetCategoryParentId); + $this->client->queueServiceActionCall("category", "move", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } + + /** + * Unlock categories + * + */ + function unlockCategories() + { + $kparams = array(); + $this->client->queueServiceActionCall("category", "unlockCategories", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Update Category + * + * @param int $id + * @param KalturaCategory $category + * @return KalturaCategory + */ + function update($id, KalturaCategory $category) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "category", $category->toParams()); + $this->client->queueServiceActionCall("category", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategory"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryUserService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Activate CategoryUser + * + * @param int $categoryId + * @param string $userId + * @return KalturaCategoryUser + */ + function activate($categoryId, $userId) + { + $kparams = array(); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->addParam($kparams, "userId", $userId); + $this->client->queueServiceActionCall("categoryuser", "activate", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategoryUser"); + return $resultObject; + } + + /** + * Add new CategoryUser + * + * @param KalturaCategoryUser $categoryUser + * @return KalturaCategoryUser + */ + function add(KalturaCategoryUser $categoryUser) + { + $kparams = array(); + $this->client->addParam($kparams, "categoryUser", $categoryUser->toParams()); + $this->client->queueServiceActionCall("categoryuser", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategoryUser"); + return $resultObject; + } + + /** + * + * + * @param file $fileData + * @param KalturaBulkUploadJobData $bulkUploadData + * @param KalturaBulkUploadCategoryUserData $bulkUploadCategoryUserData + * @return KalturaBulkUpload + */ + function addFromBulkUpload($fileData, KalturaBulkUploadJobData $bulkUploadData = null, KalturaBulkUploadCategoryUserData $bulkUploadCategoryUserData = null) + { + $kparams = array(); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + if ($bulkUploadData !== null) + $this->client->addParam($kparams, "bulkUploadData", $bulkUploadData->toParams()); + if ($bulkUploadCategoryUserData !== null) + $this->client->addParam($kparams, "bulkUploadCategoryUserData", $bulkUploadCategoryUserData->toParams()); + $this->client->queueServiceActionCall("categoryuser", "addFromBulkUpload", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBulkUpload"); + return $resultObject; + } + + /** + * Copy all memeber from parent category + * + * @param int $categoryId + */ + function copyFromCategory($categoryId) + { + $kparams = array(); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->queueServiceActionCall("categoryuser", "copyFromCategory", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Reject CategoryUser + * + * @param int $categoryId + * @param string $userId + * @return KalturaCategoryUser + */ + function deactivate($categoryId, $userId) + { + $kparams = array(); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->addParam($kparams, "userId", $userId); + $this->client->queueServiceActionCall("categoryuser", "deactivate", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategoryUser"); + return $resultObject; + } + + /** + * Delete a CategoryUser + * + * @param int $categoryId + * @param string $userId + */ + function delete($categoryId, $userId) + { + $kparams = array(); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->addParam($kparams, "userId", $userId); + $this->client->queueServiceActionCall("categoryuser", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get CategoryUser by id + * + * @param int $categoryId + * @param string $userId + * @return KalturaCategoryUser + */ + function get($categoryId, $userId) + { + $kparams = array(); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->addParam($kparams, "userId", $userId); + $this->client->queueServiceActionCall("categoryuser", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategoryUser"); + return $resultObject; + } + + /** + * Index CategoryUser by userid and category id + * + * @param string $userId + * @param int $categoryId + * @param bool $shouldUpdate + * @return int + */ + function index($userId, $categoryId, $shouldUpdate = true) + { + $kparams = array(); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->addParam($kparams, "shouldUpdate", $shouldUpdate); + $this->client->queueServiceActionCall("categoryuser", "index", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * List all categories + * + * @param KalturaCategoryUserFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaCategoryUserListResponse + */ + function listAction(KalturaCategoryUserFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("categoryuser", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategoryUserListResponse"); + return $resultObject; + } + + /** + * Update CategoryUser by id + * + * @param int $categoryId + * @param string $userId + * @param KalturaCategoryUser $categoryUser + * @param bool $override - to override manual changes + * @return KalturaCategoryUser + */ + function update($categoryId, $userId, KalturaCategoryUser $categoryUser, $override = false) + { + $kparams = array(); + $this->client->addParam($kparams, "categoryId", $categoryId); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "categoryUser", $categoryUser->toParams()); + $this->client->addParam($kparams, "override", $override); + $this->client->queueServiceActionCall("categoryuser", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCategoryUser"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileAssetParamsService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Lists asset parmas of conversion profile by ID + * + * @param KalturaConversionProfileAssetParamsFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaConversionProfileAssetParamsListResponse + */ + function listAction(KalturaConversionProfileAssetParamsFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("conversionprofileassetparams", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaConversionProfileAssetParamsListResponse"); + return $resultObject; + } + + /** + * Update asset parmas of conversion profile by ID + * + * @param int $conversionProfileId + * @param int $assetParamsId + * @param KalturaConversionProfileAssetParams $conversionProfileAssetParams + * @return KalturaConversionProfileAssetParams + */ + function update($conversionProfileId, $assetParamsId, KalturaConversionProfileAssetParams $conversionProfileAssetParams) + { + $kparams = array(); + $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); + $this->client->addParam($kparams, "assetParamsId", $assetParamsId); + $this->client->addParam($kparams, "conversionProfileAssetParams", $conversionProfileAssetParams->toParams()); + $this->client->queueServiceActionCall("conversionprofileassetparams", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaConversionProfileAssetParams"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new Conversion Profile + * + * @param KalturaConversionProfile $conversionProfile + * @return KalturaConversionProfile + */ + function add(KalturaConversionProfile $conversionProfile) + { + $kparams = array(); + $this->client->addParam($kparams, "conversionProfile", $conversionProfile->toParams()); + $this->client->queueServiceActionCall("conversionprofile", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaConversionProfile"); + return $resultObject; + } + + /** + * Delete Conversion Profile by ID + * + * @param int $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("conversionprofile", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get Conversion Profile by ID + * + * @param int $id + * @return KalturaConversionProfile + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("conversionprofile", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaConversionProfile"); + return $resultObject; + } + + /** + * Get the partner's default conversion profile + * + * @param string $type + * @return KalturaConversionProfile + */ + function getDefault($type = null) + { + $kparams = array(); + $this->client->addParam($kparams, "type", $type); + $this->client->queueServiceActionCall("conversionprofile", "getDefault", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaConversionProfile"); + return $resultObject; + } + + /** + * List Conversion Profiles by filter with paging support + * + * @param KalturaConversionProfileFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaConversionProfileListResponse + */ + function listAction(KalturaConversionProfileFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("conversionprofile", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaConversionProfileListResponse"); + return $resultObject; + } + + /** + * Set Conversion Profile to be the partner default + * + * @param int $id + * @return KalturaConversionProfile + */ + function setAsDefault($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("conversionprofile", "setAsDefault", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaConversionProfile"); + return $resultObject; + } + + /** + * Update Conversion Profile by ID + * + * @param int $id + * @param KalturaConversionProfile $conversionProfile + * @return KalturaConversionProfile + */ + function update($id, KalturaConversionProfile $conversionProfile) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "conversionProfile", $conversionProfile->toParams()); + $this->client->queueServiceActionCall("conversionprofile", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaConversionProfile"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDataService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds a new data entry + * + * @param KalturaDataEntry $dataEntry Data entry + * @return KalturaDataEntry + */ + function add(KalturaDataEntry $dataEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "dataEntry", $dataEntry->toParams()); + $this->client->queueServiceActionCall("data", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaDataEntry"); + return $resultObject; + } + + /** + * Update the dataContent of data entry using a resource + * + * @param string $entryId + * @param KalturaGenericDataCenterContentResource $resource + * @return string + */ + function addContent($entryId, KalturaGenericDataCenterContentResource $resource) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "resource", $resource->toParams()); + $this->client->queueServiceActionCall("data", "addContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Delete a data entry. + * + * @param string $entryId Data entry id to delete + */ + function delete($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("data", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get data entry by ID. + * + * @param string $entryId Data entry id + * @param int $version Desired version of the data + * @return KalturaDataEntry + */ + function get($entryId, $version = -1) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "version", $version); + $this->client->queueServiceActionCall("data", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaDataEntry"); + return $resultObject; + } + + /** + * List data entries by filter with paging support. + * + * @param KalturaDataEntryFilter $filter Document entry filter + * @param KalturaFilterPager $pager Pager + * @return KalturaDataListResponse + */ + function listAction(KalturaDataEntryFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("data", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaDataListResponse"); + return $resultObject; + } + + /** + * Serve action returan the file from dataContent field. + * + * @param string $entryId Data entry id + * @param int $version Desired version of the data + * @param bool $forceProxy Force to get the content without redirect + * @return file + */ + function serve($entryId, $version = -1, $forceProxy = false) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "version", $version); + $this->client->addParam($kparams, "forceProxy", $forceProxy); + $this->client->queueServiceActionCall("data", "serve", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Update data entry. Only the properties that were set will be updated. + * + * @param string $entryId Data entry id to update + * @param KalturaDataEntry $documentEntry Data entry metadata to update + * @return KalturaDataEntry + */ + function update($entryId, KalturaDataEntry $documentEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "documentEntry", $documentEntry->toParams()); + $this->client->queueServiceActionCall("data", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaDataEntry"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new delivery. + * + * @param KalturaDeliveryProfile $delivery + * @return KalturaDeliveryProfile + */ + function add(KalturaDeliveryProfile $delivery) + { + $kparams = array(); + $this->client->addParam($kparams, "delivery", $delivery->toParams()); + $this->client->queueServiceActionCall("deliveryprofile", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaDeliveryProfile"); + return $resultObject; + } + + /** + * Add delivery based on existing delivery. + Must provide valid sourceDeliveryId + * + * @param int $deliveryId + * @return KalturaDeliveryProfile + */ + function cloneAction($deliveryId) + { + $kparams = array(); + $this->client->addParam($kparams, "deliveryId", $deliveryId); + $this->client->queueServiceActionCall("deliveryprofile", "clone", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaDeliveryProfile"); + return $resultObject; + } + + /** + * Get delivery by id + * + * @param string $id + * @return KalturaDeliveryProfile + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("deliveryprofile", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaDeliveryProfile"); + return $resultObject; + } + + /** + * Retrieve a list of available delivery depends on the filter given + * + * @param KalturaDeliveryProfileFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaDeliveryProfileListResponse + */ + function listAction(KalturaDeliveryProfileFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("deliveryprofile", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaDeliveryProfileListResponse"); + return $resultObject; + } + + /** + * Update exisiting delivery + * + * @param string $id + * @param KalturaDeliveryProfile $delivery + * @return KalturaDeliveryProfile + */ + function update($id, KalturaDeliveryProfile $delivery) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "delivery", $delivery->toParams()); + $this->client->queueServiceActionCall("deliveryprofile", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaDeliveryProfile"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEmailIngestionProfileService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * EmailIngestionProfile Add action allows you to add a EmailIngestionProfile to Kaltura DB + * + * @param KalturaEmailIngestionProfile $EmailIP Mandatory input parameter of type KalturaEmailIngestionProfile + * @return KalturaEmailIngestionProfile + */ + function add(KalturaEmailIngestionProfile $EmailIP) + { + $kparams = array(); + $this->client->addParam($kparams, "EmailIP", $EmailIP->toParams()); + $this->client->queueServiceActionCall("emailingestionprofile", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaEmailIngestionProfile"); + return $resultObject; + } + + /** + * Add KalturaMediaEntry from email ingestion + * + * @param KalturaMediaEntry $mediaEntry Media entry metadata + * @param string $uploadTokenId Upload token id + * @param int $emailProfId + * @param string $fromAddress + * @param string $emailMsgId + * @return KalturaMediaEntry + */ + function addMediaEntry(KalturaMediaEntry $mediaEntry, $uploadTokenId, $emailProfId, $fromAddress, $emailMsgId) + { + $kparams = array(); + $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); + $this->client->addParam($kparams, "uploadTokenId", $uploadTokenId); + $this->client->addParam($kparams, "emailProfId", $emailProfId); + $this->client->addParam($kparams, "fromAddress", $fromAddress); + $this->client->addParam($kparams, "emailMsgId", $emailMsgId); + $this->client->queueServiceActionCall("emailingestionprofile", "addMediaEntry", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Delete an existing EmailIngestionProfile + * + * @param int $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("emailingestionprofile", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Retrieve a EmailIngestionProfile by id + * + * @param int $id + * @return KalturaEmailIngestionProfile + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("emailingestionprofile", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaEmailIngestionProfile"); + return $resultObject; + } + + /** + * Retrieve a EmailIngestionProfile by email address + * + * @param string $emailAddress + * @return KalturaEmailIngestionProfile + */ + function getByEmailAddress($emailAddress) + { + $kparams = array(); + $this->client->addParam($kparams, "emailAddress", $emailAddress); + $this->client->queueServiceActionCall("emailingestionprofile", "getByEmailAddress", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaEmailIngestionProfile"); + return $resultObject; + } + + /** + * Update an existing EmailIngestionProfile + * + * @param int $id + * @param KalturaEmailIngestionProfile $EmailIP + * @return KalturaEmailIngestionProfile + */ + function update($id, KalturaEmailIngestionProfile $EmailIP) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "EmailIP", $EmailIP->toParams()); + $this->client->queueServiceActionCall("emailingestionprofile", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaEmailIngestionProfile"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryServerNodeService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * + * + * @param string $id + * @return KalturaEntryServerNode + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("entryservernode", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaEntryServerNode"); + return $resultObject; + } + + /** + * + * + * @param KalturaEntryServerNodeFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaEntryServerNodeListResponse + */ + function listAction(KalturaEntryServerNodeFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("entryservernode", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaEntryServerNodeListResponse"); + return $resultObject; + } + + /** + * + * + * @param int $id + * @param KalturaEntryServerNode $entryServerNode + * @return KalturaEntryServerNode + */ + function update($id, KalturaEntryServerNode $entryServerNode) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "entryServerNode", $entryServerNode->toParams()); + $this->client->queueServiceActionCall("entryservernode", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaEntryServerNode"); + return $resultObject; + } + + /** + * Validates server node still registered on entry + * + * @param int $id Entry server node id + */ + function validateRegisteredEntryServerNode($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("entryservernode", "validateRegisteredEntryServerNode", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileAssetService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new file asset + * + * @param KalturaFileAsset $fileAsset + * @return KalturaFileAsset + */ + function add(KalturaFileAsset $fileAsset) + { + $kparams = array(); + $this->client->addParam($kparams, "fileAsset", $fileAsset->toParams()); + $this->client->queueServiceActionCall("fileasset", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFileAsset"); + return $resultObject; + } + + /** + * Delete file asset by id + * + * @param bigint $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("fileasset", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get file asset by id + * + * @param bigint $id + * @return KalturaFileAsset + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("fileasset", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFileAsset"); + return $resultObject; + } + + /** + * List file assets by filter and pager + * + * @param KalturaFileAssetFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaFileAssetListResponse + */ + function listAction(KalturaFileAssetFilter $filter, KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("fileasset", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFileAssetListResponse"); + return $resultObject; + } + + /** + * Serve file asset by id + * + * @param bigint $id + * @return file + */ + function serve($id) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("fileasset", "serve", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Set content of file asset + * + * @param bigint $id + * @param KalturaContentResource $contentResource + * @return KalturaFileAsset + */ + function setContent($id, KalturaContentResource $contentResource) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "contentResource", $contentResource->toParams()); + $this->client->queueServiceActionCall("fileasset", "setContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFileAsset"); + return $resultObject; + } + + /** + * Update file asset by id + * + * @param bigint $id + * @param KalturaFileAsset $fileAsset + * @return KalturaFileAsset + */ + function update($id, KalturaFileAsset $fileAsset) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "fileAsset", $fileAsset->toParams()); + $this->client->queueServiceActionCall("fileasset", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFileAsset"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorAssetService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add flavor asset + * + * @param string $entryId + * @param KalturaFlavorAsset $flavorAsset + * @return KalturaFlavorAsset + */ + function add($entryId, KalturaFlavorAsset $flavorAsset) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "flavorAsset", $flavorAsset->toParams()); + $this->client->queueServiceActionCall("flavorasset", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorAsset"); + return $resultObject; + } + + /** + * Add and convert new Flavor Asset for Entry with specific Flavor Params + * + * @param string $entryId + * @param int $flavorParamsId + * @param int $priority + */ + function convert($entryId, $flavorParamsId, $priority = 0) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "flavorParamsId", $flavorParamsId); + $this->client->addParam($kparams, "priority", $priority); + $this->client->queueServiceActionCall("flavorasset", "convert", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Delete Flavor Asset by ID + * + * @param string $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("flavorasset", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Delete all local file syncs for this asset + * + * @param string $assetId + */ + function deleteLocalContent($assetId) + { + $kparams = array(); + $this->client->addParam($kparams, "assetId", $assetId); + $this->client->queueServiceActionCall("flavorasset", "deleteLocalContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Manually export an asset + * + * @param string $assetId + * @param int $storageProfileId + * @return KalturaFlavorAsset + */ + function export($assetId, $storageProfileId) + { + $kparams = array(); + $this->client->addParam($kparams, "assetId", $assetId); + $this->client->addParam($kparams, "storageProfileId", $storageProfileId); + $this->client->queueServiceActionCall("flavorasset", "export", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorAsset"); + return $resultObject; + } + + /** + * Get Flavor Asset by ID + * + * @param string $id + * @return KalturaFlavorAsset + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("flavorasset", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorAsset"); + return $resultObject; + } + + /** + * Get Flavor Assets for Entry + * + * @param string $entryId + * @return array + */ + function getByEntryId($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("flavorasset", "getByEntryId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * Get download URL for the Flavor Asset + * + * @param string $id + * @param bool $useCdn + * @return string + */ + function getDownloadUrl($id, $useCdn = false) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "useCdn", $useCdn); + $this->client->queueServiceActionCall("flavorasset", "getDownloadUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Get Flavor Asset with the relevant Flavor Params (Flavor Params can exist without Flavor Asset & vice versa) + * + * @param string $entryId + * @return array + */ + function getFlavorAssetsWithParams($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("flavorasset", "getFlavorAssetsWithParams", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * Get remote storage existing paths for the asset + * + * @param string $id + * @return KalturaRemotePathListResponse + */ + function getRemotePaths($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("flavorasset", "getRemotePaths", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaRemotePathListResponse"); + return $resultObject; + } + + /** + * Get download URL for the asset + * + * @param string $id + * @param int $storageId + * @param bool $forceProxy + * @param KalturaFlavorAssetUrlOptions $options + * @return string + */ + function getUrl($id, $storageId = null, $forceProxy = false, KalturaFlavorAssetUrlOptions $options = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "storageId", $storageId); + $this->client->addParam($kparams, "forceProxy", $forceProxy); + if ($options !== null) + $this->client->addParam($kparams, "options", $options->toParams()); + $this->client->queueServiceActionCall("flavorasset", "getUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Get volume map by entry id + * + * @param string $flavorId Flavor id + * @return file + */ + function getVolumeMap($flavorId) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "flavorId", $flavorId); + $this->client->queueServiceActionCall("flavorasset", "getVolumeMap", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Get web playable Flavor Assets for Entry + * + * @param string $entryId + * @return array + */ + function getWebPlayableByEntryId($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("flavorasset", "getWebPlayableByEntryId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * List Flavor Assets by filter and pager + * + * @param KalturaAssetFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaFlavorAssetListResponse + */ + function listAction(KalturaAssetFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("flavorasset", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorAssetListResponse"); + return $resultObject; + } + + /** + * Reconvert Flavor Asset by ID + * + * @param string $id Flavor Asset ID + */ + function reconvert($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("flavorasset", "reconvert", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Serve cmd line to transcode the ad + * + * @param string $assetId + * @param string $ffprobeJson + * @param string $duration + * @return string + */ + function serveAdStitchCmd($assetId, $ffprobeJson = null, $duration = null) + { + $kparams = array(); + $this->client->addParam($kparams, "assetId", $assetId); + $this->client->addParam($kparams, "ffprobeJson", $ffprobeJson); + $this->client->addParam($kparams, "duration", $duration); + $this->client->queueServiceActionCall("flavorasset", "serveAdStitchCmd", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Set a given flavor as the original flavor + * + * @param string $assetId + */ + function setAsSource($assetId) + { + $kparams = array(); + $this->client->addParam($kparams, "assetId", $assetId); + $this->client->queueServiceActionCall("flavorasset", "setAsSource", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Update content of flavor asset + * + * @param string $id + * @param KalturaContentResource $contentResource + * @return KalturaFlavorAsset + */ + function setContent($id, KalturaContentResource $contentResource) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "contentResource", $contentResource->toParams()); + $this->client->queueServiceActionCall("flavorasset", "setContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorAsset"); + return $resultObject; + } + + /** + * Update flavor asset + * + * @param string $id + * @param KalturaFlavorAsset $flavorAsset + * @return KalturaFlavorAsset + */ + function update($id, KalturaFlavorAsset $flavorAsset) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "flavorAsset", $flavorAsset->toParams()); + $this->client->queueServiceActionCall("flavorasset", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorAsset"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParamsOutputService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Get flavor params output object by ID + * + * @param int $id + * @return KalturaFlavorParamsOutput + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("flavorparamsoutput", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorParamsOutput"); + return $resultObject; + } + + /** + * List flavor params output objects by filter and pager + * + * @param KalturaFlavorParamsOutputFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaFlavorParamsOutputListResponse + */ + function listAction(KalturaFlavorParamsOutputFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("flavorparamsoutput", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorParamsOutputListResponse"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParamsService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new Flavor Params + * + * @param KalturaFlavorParams $flavorParams + * @return KalturaFlavorParams + */ + function add(KalturaFlavorParams $flavorParams) + { + $kparams = array(); + $this->client->addParam($kparams, "flavorParams", $flavorParams->toParams()); + $this->client->queueServiceActionCall("flavorparams", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorParams"); + return $resultObject; + } + + /** + * Delete Flavor Params by ID + * + * @param int $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("flavorparams", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get Flavor Params by ID + * + * @param int $id + * @return KalturaFlavorParams + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("flavorparams", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorParams"); + return $resultObject; + } + + /** + * Get Flavor Params by Conversion Profile ID + * + * @param int $conversionProfileId + * @return array + */ + function getByConversionProfileId($conversionProfileId) + { + $kparams = array(); + $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); + $this->client->queueServiceActionCall("flavorparams", "getByConversionProfileId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * List Flavor Params by filter with paging support (By default - all system default params will be listed too) + * + * @param KalturaFlavorParamsFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaFlavorParamsListResponse + */ + function listAction(KalturaFlavorParamsFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("flavorparams", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorParamsListResponse"); + return $resultObject; + } + + /** + * Update Flavor Params by ID + * + * @param int $id + * @param KalturaFlavorParams $flavorParams + * @return KalturaFlavorParams + */ + function update($id, KalturaFlavorParams $flavorParams) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "flavorParams", $flavorParams->toParams()); + $this->client->queueServiceActionCall("flavorparams", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorParams"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGroupUserService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new GroupUser + * + * @param KalturaGroupUser $groupUser + * @return KalturaGroupUser + */ + function add(KalturaGroupUser $groupUser) + { + $kparams = array(); + $this->client->addParam($kparams, "groupUser", $groupUser->toParams()); + $this->client->queueServiceActionCall("groupuser", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaGroupUser"); + return $resultObject; + } + + /** + * Delete by userId and groupId + * + * @param string $userId + * @param string $groupId + */ + function delete($userId, $groupId) + { + $kparams = array(); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "groupId", $groupId); + $this->client->queueServiceActionCall("groupuser", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * List all GroupUsers + * + * @param KalturaGroupUserFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaGroupUserListResponse + */ + function listAction(KalturaGroupUserFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("groupuser", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaGroupUserListResponse"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelSegmentService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new live channel segment + * + * @param KalturaLiveChannelSegment $liveChannelSegment + * @return KalturaLiveChannelSegment + */ + function add(KalturaLiveChannelSegment $liveChannelSegment) + { + $kparams = array(); + $this->client->addParam($kparams, "liveChannelSegment", $liveChannelSegment->toParams()); + $this->client->queueServiceActionCall("livechannelsegment", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveChannelSegment"); + return $resultObject; + } + + /** + * Delete live channel segment by id + * + * @param bigint $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("livechannelsegment", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get live channel segment by id + * + * @param bigint $id + * @return KalturaLiveChannelSegment + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("livechannelsegment", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveChannelSegment"); + return $resultObject; + } + + /** + * List live channel segments by filter and pager + * + * @param KalturaLiveChannelSegmentFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaLiveChannelSegmentListResponse + */ + function listAction(KalturaLiveChannelSegmentFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("livechannelsegment", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveChannelSegmentListResponse"); + return $resultObject; + } + + /** + * Update live channel segment by id + * + * @param bigint $id + * @param KalturaLiveChannelSegment $liveChannelSegment + * @return KalturaLiveChannelSegment + */ + function update($id, KalturaLiveChannelSegment $liveChannelSegment) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "liveChannelSegment", $liveChannelSegment->toParams()); + $this->client->queueServiceActionCall("livechannelsegment", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveChannelSegment"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds new live channel. + * + * @param KalturaLiveChannel $liveChannel Live channel metadata + * @return KalturaLiveChannel + */ + function add(KalturaLiveChannel $liveChannel) + { + $kparams = array(); + $this->client->addParam($kparams, "liveChannel", $liveChannel->toParams()); + $this->client->queueServiceActionCall("livechannel", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveChannel"); + return $resultObject; + } + + /** + * Append recorded video to live entry + * + * @param string $entryId Live entry id + * @param string $assetId Live asset id + * @param string $mediaServerIndex + * @param KalturaDataCenterContentResource $resource + * @param float $duration In seconds + * @param bool $isLastChunk Is this the last recorded chunk in the current session (i.e. following a stream stop event) + * @return KalturaLiveEntry + */ + function appendRecording($entryId, $assetId, $mediaServerIndex, KalturaDataCenterContentResource $resource, $duration, $isLastChunk = false) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "assetId", $assetId); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->addParam($kparams, "resource", $resource->toParams()); + $this->client->addParam($kparams, "duration", $duration); + $this->client->addParam($kparams, "isLastChunk", $isLastChunk); + $this->client->queueServiceActionCall("livechannel", "appendRecording", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Create recorded entry id if it doesn't exist and make sure it happens on the DC that the live entry was created on. + * + * @param string $entryId Live entry id + * @param string $mediaServerIndex Media server index primary / secondary + * @param int $liveEntryStatus The status KalturaEntryServerNodeStatus::PLAYABLE | KalturaEntryServerNodeStatus::BROADCASTING + * @return KalturaLiveEntry + */ + function createRecordedEntry($entryId, $mediaServerIndex, $liveEntryStatus) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->addParam($kparams, "liveEntryStatus", $liveEntryStatus); + $this->client->queueServiceActionCall("livechannel", "createRecordedEntry", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Delete a live channel. + * + * @param string $id Live channel id to delete + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("livechannel", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get live channel by ID. + * + * @param string $id Live channel id + * @return KalturaLiveChannel + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("livechannel", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveChannel"); + return $resultObject; + } + + /** + * Delivering the status of a live channel (on-air/offline) + * + * @param string $id ID of the live channel + * @return bool + */ + function isLive($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("livechannel", "isLive", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } + + /** + * List live channels by filter with paging support. + * + * @param KalturaLiveChannelFilter $filter Live channel filter + * @param KalturaFilterPager $pager Pager + * @return KalturaLiveChannelListResponse + */ + function listAction(KalturaLiveChannelFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("livechannel", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveChannelListResponse"); + return $resultObject; + } + + /** + * Register media server to live entry + * + * @param string $entryId Live entry id + * @param string $hostname Media server host name + * @param string $mediaServerIndex Media server index primary / secondary + * @param string $applicationName The application to which entry is being broadcast + * @param int $liveEntryStatus The status KalturaEntryServerNodeStatus::PLAYABLE | KalturaEntryServerNodeStatus::BROADCASTING + * @param bool $shouldCreateRecordedEntry + * @return KalturaLiveEntry + */ + function registerMediaServer($entryId, $hostname, $mediaServerIndex, $applicationName = null, $liveEntryStatus = 1, $shouldCreateRecordedEntry = true) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "hostname", $hostname); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->addParam($kparams, "applicationName", $applicationName); + $this->client->addParam($kparams, "liveEntryStatus", $liveEntryStatus); + $this->client->addParam($kparams, "shouldCreateRecordedEntry", $shouldCreateRecordedEntry); + $this->client->queueServiceActionCall("livechannel", "registerMediaServer", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Set recorded video to live entry + * + * @param string $entryId Live entry id + * @param string $mediaServerIndex + * @param KalturaDataCenterContentResource $resource + * @param float $duration In seconds + * @param string $recordedEntryId Recorded entry Id + * @param int $flavorParamsId Recorded entry Id + * @return KalturaLiveEntry + */ + function setRecordedContent($entryId, $mediaServerIndex, KalturaDataCenterContentResource $resource, $duration, $recordedEntryId = null, $flavorParamsId = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->addParam($kparams, "resource", $resource->toParams()); + $this->client->addParam($kparams, "duration", $duration); + $this->client->addParam($kparams, "recordedEntryId", $recordedEntryId); + $this->client->addParam($kparams, "flavorParamsId", $flavorParamsId); + $this->client->queueServiceActionCall("livechannel", "setRecordedContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Unregister media server from live entry + * + * @param string $entryId Live entry id + * @param string $hostname Media server host name + * @param string $mediaServerIndex Media server index primary / secondary + * @return KalturaLiveEntry + */ + function unregisterMediaServer($entryId, $hostname, $mediaServerIndex) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "hostname", $hostname); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->queueServiceActionCall("livechannel", "unregisterMediaServer", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Update live channel. Only the properties that were set will be updated. + * + * @param string $id Live channel id to update + * @param KalturaLiveChannel $liveChannel Live channel metadata to update + * @return KalturaLiveChannel + */ + function update($id, KalturaLiveChannel $liveChannel) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "liveChannel", $liveChannel->toParams()); + $this->client->queueServiceActionCall("livechannel", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveChannel"); + return $resultObject; + } + + /** + * Validates all registered media servers + * + * @param string $entryId Live entry id + */ + function validateRegisteredMediaServers($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("livechannel", "validateRegisteredMediaServers", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveReportsService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * + * + * @param int $reportType + * @param KalturaLiveReportExportParams $params + * @return KalturaLiveReportExportResponse + */ + function exportToCsv($reportType, KalturaLiveReportExportParams $params) + { + $kparams = array(); + $this->client->addParam($kparams, "reportType", $reportType); + $this->client->addParam($kparams, "params", $params->toParams()); + $this->client->queueServiceActionCall("livereports", "exportToCsv", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveReportExportResponse"); + return $resultObject; + } + + /** + * + * + * @param string $reportType + * @param KalturaLiveReportInputFilter $filter + * @param KalturaFilterPager $pager + * @return array + */ + function getEvents($reportType, KalturaLiveReportInputFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "reportType", $reportType); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("livereports", "getEvents", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * + * + * @param string $reportType + * @param KalturaLiveReportInputFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaLiveStatsListResponse + */ + function getReport($reportType, KalturaLiveReportInputFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "reportType", $reportType); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("livereports", "getReport", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStatsListResponse"); + return $resultObject; + } + + /** + * Will serve a requested report + * + * @param string $id - the requested id + * @return string + */ + function serveReport($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("livereports", "serveReport", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStatsService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Will write to the event log a single line representing the event + KalturaStatsEvent $event + * + * @param KalturaLiveStatsEvent $event + * @return bool + */ + function collect(KalturaLiveStatsEvent $event) + { + $kparams = array(); + $this->client->addParam($kparams, "event", $event->toParams()); + $this->client->queueServiceActionCall("livestats", "collect", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds new live stream entry. + The entry will be queued for provision. + * + * @param KalturaLiveStreamEntry $liveStreamEntry Live stream entry metadata + * @param string $sourceType Live stream source type + * @return KalturaLiveStreamEntry + */ + function add(KalturaLiveStreamEntry $liveStreamEntry, $sourceType = null) + { + $kparams = array(); + $this->client->addParam($kparams, "liveStreamEntry", $liveStreamEntry->toParams()); + $this->client->addParam($kparams, "sourceType", $sourceType); + $this->client->queueServiceActionCall("livestream", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStreamEntry"); + return $resultObject; + } + + /** + * Add new pushPublish configuration to entry + * + * @param string $entryId + * @param string $protocol + * @param string $url + * @param KalturaLiveStreamConfiguration $liveStreamConfiguration + * @return KalturaLiveStreamEntry + */ + function addLiveStreamPushPublishConfiguration($entryId, $protocol, $url = null, KalturaLiveStreamConfiguration $liveStreamConfiguration = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "protocol", $protocol); + $this->client->addParam($kparams, "url", $url); + if ($liveStreamConfiguration !== null) + $this->client->addParam($kparams, "liveStreamConfiguration", $liveStreamConfiguration->toParams()); + $this->client->queueServiceActionCall("livestream", "addLiveStreamPushPublishConfiguration", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStreamEntry"); + return $resultObject; + } + + /** + * Allocates a conference room or returns ones that has already been allocated + * + * @param string $entryId + * @return KalturaRoomDetails + */ + function allocateConferenceRoom($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("livestream", "allocateConferenceRoom", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaRoomDetails"); + return $resultObject; + } + + /** + * Append recorded video to live entry + * + * @param string $entryId Live entry id + * @param string $assetId Live asset id + * @param string $mediaServerIndex + * @param KalturaDataCenterContentResource $resource + * @param float $duration In seconds + * @param bool $isLastChunk Is this the last recorded chunk in the current session (i.e. following a stream stop event) + * @return KalturaLiveEntry + */ + function appendRecording($entryId, $assetId, $mediaServerIndex, KalturaDataCenterContentResource $resource, $duration, $isLastChunk = false) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "assetId", $assetId); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->addParam($kparams, "resource", $resource->toParams()); + $this->client->addParam($kparams, "duration", $duration); + $this->client->addParam($kparams, "isLastChunk", $isLastChunk); + $this->client->queueServiceActionCall("livestream", "appendRecording", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Authenticate live-stream entry against stream token and partner limitations + * + * @param string $entryId Live stream entry id + * @param string $token Live stream broadcasting token + * @param string $hostname Media server host name + * @param string $mediaServerIndex Media server index primary / secondary + * @param string $applicationName The application to which entry is being broadcast + * @return KalturaLiveStreamEntry + */ + function authenticate($entryId, $token, $hostname = null, $mediaServerIndex = null, $applicationName = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "token", $token); + $this->client->addParam($kparams, "hostname", $hostname); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->addParam($kparams, "applicationName", $applicationName); + $this->client->queueServiceActionCall("livestream", "authenticate", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStreamEntry"); + return $resultObject; + } + + /** + * Creates perioding metadata sync-point events on a live stream + * + * @param string $entryId Kaltura live-stream entry id + * @param int $interval Events interval in seconds + * @param int $duration Duration in seconds + */ + function createPeriodicSyncPoints($entryId, $interval, $duration) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "interval", $interval); + $this->client->addParam($kparams, "duration", $duration); + $this->client->queueServiceActionCall("livestream", "createPeriodicSyncPoints", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Create recorded entry id if it doesn't exist and make sure it happens on the DC that the live entry was created on. + * + * @param string $entryId Live entry id + * @param string $mediaServerIndex Media server index primary / secondary + * @param int $liveEntryStatus The status KalturaEntryServerNodeStatus::PLAYABLE | KalturaEntryServerNodeStatus::BROADCASTING + * @return KalturaLiveEntry + */ + function createRecordedEntry($entryId, $mediaServerIndex, $liveEntryStatus) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->addParam($kparams, "liveEntryStatus", $liveEntryStatus); + $this->client->queueServiceActionCall("livestream", "createRecordedEntry", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Delete a live stream entry. + * + * @param string $entryId Live stream entry id to delete + */ + function delete($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("livestream", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * When the conf is finished this API should be called. + * + * @param string $entryId + * @return bool + */ + function finishConf($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("livestream", "finishConf", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } + + /** + * Get live stream entry by ID. + * + * @param string $entryId Live stream entry id + * @param int $version Desired version of the data + * @return KalturaLiveStreamEntry + */ + function get($entryId, $version = -1) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "version", $version); + $this->client->queueServiceActionCall("livestream", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStreamEntry"); + return $resultObject; + } + + /** + * Delivering the status of a live stream (on-air/offline) if it is possible + * + * @param string $id ID of the live stream + * @param string $protocol Protocol of the stream to test. + * @return bool + */ + function isLive($id, $protocol) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "protocol", $protocol); + $this->client->queueServiceActionCall("livestream", "isLive", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } + + /** + * List live stream entries by filter with paging support. + * + * @param KalturaLiveStreamEntryFilter $filter Live stream entry filter + * @param KalturaFilterPager $pager Pager + * @return KalturaLiveStreamListResponse + */ + function listAction(KalturaLiveStreamEntryFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("livestream", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStreamListResponse"); + return $resultObject; + } + + /** + * Regenerate new secure token for liveStream + * + * @param string $entryId Live stream entry id to regenerate secure token for + * @return KalturaLiveEntry + */ + function regenerateStreamToken($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("livestream", "regenerateStreamToken", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Mark that the conference has actually started + * + * @param string $entryId + * @return bool + */ + function registerConf($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("livestream", "registerConf", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } + + /** + * Register media server to live entry + * + * @param string $entryId Live entry id + * @param string $hostname Media server host name + * @param string $mediaServerIndex Media server index primary / secondary + * @param string $applicationName The application to which entry is being broadcast + * @param int $liveEntryStatus The status KalturaEntryServerNodeStatus::PLAYABLE | KalturaEntryServerNodeStatus::BROADCASTING + * @param bool $shouldCreateRecordedEntry + * @return KalturaLiveEntry + */ + function registerMediaServer($entryId, $hostname, $mediaServerIndex, $applicationName = null, $liveEntryStatus = 1, $shouldCreateRecordedEntry = true) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "hostname", $hostname); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->addParam($kparams, "applicationName", $applicationName); + $this->client->addParam($kparams, "liveEntryStatus", $liveEntryStatus); + $this->client->addParam($kparams, "shouldCreateRecordedEntry", $shouldCreateRecordedEntry); + $this->client->queueServiceActionCall("livestream", "registerMediaServer", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Remove push publish configuration from entry + * + * @param string $entryId + * @param string $protocol + * @return KalturaLiveStreamEntry + */ + function removeLiveStreamPushPublishConfiguration($entryId, $protocol) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "protocol", $protocol); + $this->client->queueServiceActionCall("livestream", "removeLiveStreamPushPublishConfiguration", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStreamEntry"); + return $resultObject; + } + + /** + * Set recorded video to live entry + * + * @param string $entryId Live entry id + * @param string $mediaServerIndex + * @param KalturaDataCenterContentResource $resource + * @param float $duration In seconds + * @param string $recordedEntryId Recorded entry Id + * @param int $flavorParamsId Recorded entry Id + * @return KalturaLiveEntry + */ + function setRecordedContent($entryId, $mediaServerIndex, KalturaDataCenterContentResource $resource, $duration, $recordedEntryId = null, $flavorParamsId = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->addParam($kparams, "resource", $resource->toParams()); + $this->client->addParam($kparams, "duration", $duration); + $this->client->addParam($kparams, "recordedEntryId", $recordedEntryId); + $this->client->addParam($kparams, "flavorParamsId", $flavorParamsId); + $this->client->queueServiceActionCall("livestream", "setRecordedContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Unregister media server from live entry + * + * @param string $entryId Live entry id + * @param string $hostname Media server host name + * @param string $mediaServerIndex Media server index primary / secondary + * @return KalturaLiveEntry + */ + function unregisterMediaServer($entryId, $hostname, $mediaServerIndex) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "hostname", $hostname); + $this->client->addParam($kparams, "mediaServerIndex", $mediaServerIndex); + $this->client->queueServiceActionCall("livestream", "unregisterMediaServer", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveEntry"); + return $resultObject; + } + + /** + * Update live stream entry. Only the properties that were set will be updated. + * + * @param string $entryId Live stream entry id to update + * @param KalturaLiveStreamEntry $liveStreamEntry Live stream entry metadata to update + * @return KalturaLiveStreamEntry + */ + function update($entryId, KalturaLiveStreamEntry $liveStreamEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "liveStreamEntry", $liveStreamEntry->toParams()); + $this->client->queueServiceActionCall("livestream", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStreamEntry"); + return $resultObject; + } + + /** + * Update entry thumbnail using url + * + * @param string $entryId Live stream entry id + * @param string $url File url + * @return KalturaLiveStreamEntry + */ + function updateOfflineThumbnailFromUrl($entryId, $url) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "url", $url); + $this->client->queueServiceActionCall("livestream", "updateOfflineThumbnailFromUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStreamEntry"); + return $resultObject; + } + + /** + * Update live stream entry thumbnail using a raw jpeg file + * + * @param string $entryId Live stream entry id + * @param file $fileData Jpeg file data + * @return KalturaLiveStreamEntry + */ + function updateOfflineThumbnailJpeg($entryId, $fileData) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + $this->client->queueServiceActionCall("livestream", "updateOfflineThumbnailJpeg", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaLiveStreamEntry"); + return $resultObject; + } + + /** + * Validates all registered media servers + * + * @param string $entryId Live entry id + */ + function validateRegisteredMediaServers($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("livestream", "validateRegisteredMediaServers", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaInfoService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * List media info objects by filter and pager + * + * @param KalturaMediaInfoFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaMediaInfoListResponse + */ + function listAction(KalturaMediaInfoFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("mediainfo", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaInfoListResponse"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add entry + * + * @param KalturaMediaEntry $entry + * @return KalturaMediaEntry + */ + function add(KalturaMediaEntry $entry) + { + $kparams = array(); + $this->client->addParam($kparams, "entry", $entry->toParams()); + $this->client->queueServiceActionCall("media", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Add content to media entry which is not yet associated with content (therefore is in status NO_CONTENT). + If the requirement is to replace the entry's associated content, use action updateContent. + * + * @param string $entryId + * @param KalturaResource $resource + * @return KalturaMediaEntry + */ + function addContent($entryId, KalturaResource $resource = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + if ($resource !== null) + $this->client->addParam($kparams, "resource", $resource->toParams()); + $this->client->queueServiceActionCall("media", "addContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Adds new media entry by importing an HTTP or FTP URL. + The entry will be queued for import and then for conversion. + This action should be exposed only to the batches + * + * @param KalturaMediaEntry $mediaEntry Media entry metadata + * @param string $url An HTTP or FTP URL + * @param int $bulkUploadId The id of the bulk upload job + * @return KalturaMediaEntry + */ + function addFromBulk(KalturaMediaEntry $mediaEntry, $url, $bulkUploadId) + { + $kparams = array(); + $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); + $this->client->addParam($kparams, "url", $url); + $this->client->addParam($kparams, "bulkUploadId", $bulkUploadId); + $this->client->queueServiceActionCall("media", "addFromBulk", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Copy entry into new entry + * + * @param string $sourceEntryId Media entry id to copy from + * @param KalturaMediaEntry $mediaEntry Media entry metadata + * @param int $sourceFlavorParamsId The flavor to be used as the new entry source, source flavor will be used if not specified + * @return KalturaMediaEntry + */ + function addFromEntry($sourceEntryId, KalturaMediaEntry $mediaEntry = null, $sourceFlavorParamsId = null) + { + $kparams = array(); + $this->client->addParam($kparams, "sourceEntryId", $sourceEntryId); + if ($mediaEntry !== null) + $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); + $this->client->addParam($kparams, "sourceFlavorParamsId", $sourceFlavorParamsId); + $this->client->queueServiceActionCall("media", "addFromEntry", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Copy flavor asset into new entry + * + * @param string $sourceFlavorAssetId Flavor asset id to be used as the new entry source + * @param KalturaMediaEntry $mediaEntry Media entry metadata + * @return KalturaMediaEntry + */ + function addFromFlavorAsset($sourceFlavorAssetId, KalturaMediaEntry $mediaEntry = null) + { + $kparams = array(); + $this->client->addParam($kparams, "sourceFlavorAssetId", $sourceFlavorAssetId); + if ($mediaEntry !== null) + $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); + $this->client->queueServiceActionCall("media", "addFromFlavorAsset", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Add new entry after the file was recored on the server and the token id exists + * + * @param KalturaMediaEntry $mediaEntry Media entry metadata + * @param string $webcamTokenId Token id for the recored webcam file + * @return KalturaMediaEntry + */ + function addFromRecordedWebcam(KalturaMediaEntry $mediaEntry, $webcamTokenId) + { + $kparams = array(); + $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); + $this->client->addParam($kparams, "webcamTokenId", $webcamTokenId); + $this->client->queueServiceActionCall("media", "addFromRecordedWebcam", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Adds new media entry by importing the media file from a search provider. + This action should be used with the search service result. + * + * @param KalturaMediaEntry $mediaEntry Media entry metadata + * @param KalturaSearchResult $searchResult Result object from search service + * @return KalturaMediaEntry + */ + function addFromSearchResult(KalturaMediaEntry $mediaEntry = null, KalturaSearchResult $searchResult = null) + { + $kparams = array(); + if ($mediaEntry !== null) + $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); + if ($searchResult !== null) + $this->client->addParam($kparams, "searchResult", $searchResult->toParams()); + $this->client->queueServiceActionCall("media", "addFromSearchResult", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Add new entry after the specific media file was uploaded and the upload token id exists + * + * @param KalturaMediaEntry $mediaEntry Media entry metadata + * @param string $uploadTokenId Upload token id + * @return KalturaMediaEntry + */ + function addFromUploadedFile(KalturaMediaEntry $mediaEntry, $uploadTokenId) + { + $kparams = array(); + $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); + $this->client->addParam($kparams, "uploadTokenId", $uploadTokenId); + $this->client->queueServiceActionCall("media", "addFromUploadedFile", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Adds new media entry by importing an HTTP or FTP URL. + The entry will be queued for import and then for conversion. + * + * @param KalturaMediaEntry $mediaEntry Media entry metadata + * @param string $url An HTTP or FTP URL + * @return KalturaMediaEntry + */ + function addFromUrl(KalturaMediaEntry $mediaEntry, $url) + { + $kparams = array(); + $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); + $this->client->addParam($kparams, "url", $url); + $this->client->queueServiceActionCall("media", "addFromUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Anonymously rank a media entry, no validation is done on duplicate rankings + * + * @param string $entryId + * @param int $rank + */ + function anonymousRank($entryId, $rank) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "rank", $rank); + $this->client->queueServiceActionCall("media", "anonymousRank", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Approve the media entry and mark the pending flags (if any) as moderated (this will make the entry playable) + * + * @param string $entryId + */ + function approve($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("media", "approve", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Approves media replacement + * + * @param string $entryId Media entry id to replace + * @return KalturaMediaEntry + */ + function approveReplace($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("media", "approveReplace", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Add new bulk upload batch job + Conversion profile id can be specified in the API or in the CSV file, the one in the CSV file will be stronger. + If no conversion profile was specified, partner's default will be used + * + * @param file $fileData + * @param KalturaBulkUploadJobData $bulkUploadData + * @param KalturaBulkUploadEntryData $bulkUploadEntryData + * @return KalturaBulkUpload + */ + function bulkUploadAdd($fileData, KalturaBulkUploadJobData $bulkUploadData = null, KalturaBulkUploadEntryData $bulkUploadEntryData = null) + { + $kparams = array(); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + if ($bulkUploadData !== null) + $this->client->addParam($kparams, "bulkUploadData", $bulkUploadData->toParams()); + if ($bulkUploadEntryData !== null) + $this->client->addParam($kparams, "bulkUploadEntryData", $bulkUploadEntryData->toParams()); + $this->client->queueServiceActionCall("media", "bulkUploadAdd", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBulkUpload"); + return $resultObject; + } + + /** + * Cancels media replacement + * + * @param string $entryId Media entry id to cancel + * @return KalturaMediaEntry + */ + function cancelReplace($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("media", "cancelReplace", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Convert entry + * + * @param string $entryId Media entry id + * @param int $conversionProfileId + * @param array $dynamicConversionAttributes + * @return bigint + */ + function convert($entryId, $conversionProfileId = null, array $dynamicConversionAttributes = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); + if ($dynamicConversionAttributes !== null) + foreach($dynamicConversionAttributes as $index => $obj) + { + $this->client->addParam($kparams, "dynamicConversionAttributes:$index", $obj->toParams()); + } + $this->client->queueServiceActionCall("media", "convert", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "double"); + return $resultObject; + } + + /** + * Count media entries by filter. + * + * @param KalturaMediaEntryFilter $filter Media entry filter + * @return int + */ + function count(KalturaMediaEntryFilter $filter = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + $this->client->queueServiceActionCall("media", "count", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * Delete a media entry. + * + * @param string $entryId Media entry id to delete + */ + function delete($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("media", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Flag inappropriate media entry for moderation + * + * @param KalturaModerationFlag $moderationFlag + */ + function flag(KalturaModerationFlag $moderationFlag) + { + $kparams = array(); + $this->client->addParam($kparams, "moderationFlag", $moderationFlag->toParams()); + $this->client->queueServiceActionCall("media", "flag", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get media entry by ID. + * + * @param string $entryId Media entry id + * @param int $version Desired version of the data + * @return KalturaMediaEntry + */ + function get($entryId, $version = -1) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "version", $version); + $this->client->queueServiceActionCall("media", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Get MRSS by entry id + XML will return as an escaped string + * + * @param string $entryId Entry id + * @param array $extendingItemsArray + * @param string $features + * @return string + */ + function getMrss($entryId, array $extendingItemsArray = null, $features = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + if ($extendingItemsArray !== null) + foreach($extendingItemsArray as $index => $obj) + { + $this->client->addParam($kparams, "extendingItemsArray:$index", $obj->toParams()); + } + $this->client->addParam($kparams, "features", $features); + $this->client->queueServiceActionCall("media", "getMrss", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Get volume map by entry id + * + * @param string $entryId Entry id + * @return file + */ + function getVolumeMap($entryId) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("media", "getVolumeMap", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * List media entries by filter with paging support. + * + * @param KalturaMediaEntryFilter $filter Media entry filter + * @param KalturaFilterPager $pager Pager + * @return KalturaMediaListResponse + */ + function listAction(KalturaMediaEntryFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("media", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaListResponse"); + return $resultObject; + } + + /** + * List all pending flags for the media entry + * + * @param string $entryId + * @param KalturaFilterPager $pager + * @return KalturaModerationFlagListResponse + */ + function listFlags($entryId, KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("media", "listFlags", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaModerationFlagListResponse"); + return $resultObject; + } + + /** + * Reject the media entry and mark the pending flags (if any) as moderated (this will make the entry non playable) + * + * @param string $entryId + */ + function reject($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("media", "reject", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Request a new conversion job, this can be used to convert the media entry to a different format + * + * @param string $entryId Media entry id + * @param string $fileFormat Format to convert + * @return int + */ + function requestConversion($entryId, $fileFormat) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "fileFormat", $fileFormat); + $this->client->queueServiceActionCall("media", "requestConversion", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * Update media entry. Only the properties that were set will be updated. + * + * @param string $entryId Media entry id to update + * @param KalturaMediaEntry $mediaEntry Media entry metadata to update + * @return KalturaMediaEntry + */ + function update($entryId, KalturaMediaEntry $mediaEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "mediaEntry", $mediaEntry->toParams()); + $this->client->queueServiceActionCall("media", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Replace content associated with the media entry. + * + * @param string $entryId Media entry id to update + * @param KalturaResource $resource Resource to be used to replace entry media content + * @param int $conversionProfileId The conversion profile id to be used on the entry + * @param KalturaEntryReplacementOptions $advancedOptions Additional update content options + * @return KalturaMediaEntry + */ + function updateContent($entryId, KalturaResource $resource, $conversionProfileId = null, KalturaEntryReplacementOptions $advancedOptions = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "resource", $resource->toParams()); + $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); + if ($advancedOptions !== null) + $this->client->addParam($kparams, "advancedOptions", $advancedOptions->toParams()); + $this->client->queueServiceActionCall("media", "updateContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Update media entry thumbnail by a specified time offset (In seconds) + If flavor params id not specified, source flavor will be used by default + * + * @param string $entryId Media entry id + * @param int $timeOffset Time offset (in seconds) + * @param int $flavorParamsId The flavor params id to be used + * @return KalturaMediaEntry + */ + function updateThumbnail($entryId, $timeOffset, $flavorParamsId = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "timeOffset", $timeOffset); + $this->client->addParam($kparams, "flavorParamsId", $flavorParamsId); + $this->client->queueServiceActionCall("media", "updateThumbnail", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Update media entry thumbnail from a different entry by a specified time offset (In seconds) + If flavor params id not specified, source flavor will be used by default + * + * @param string $entryId Media entry id + * @param string $sourceEntryId Media entry id + * @param int $timeOffset Time offset (in seconds) + * @param int $flavorParamsId The flavor params id to be used + * @return KalturaMediaEntry + */ + function updateThumbnailFromSourceEntry($entryId, $sourceEntryId, $timeOffset, $flavorParamsId = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "sourceEntryId", $sourceEntryId); + $this->client->addParam($kparams, "timeOffset", $timeOffset); + $this->client->addParam($kparams, "flavorParamsId", $flavorParamsId); + $this->client->queueServiceActionCall("media", "updateThumbnailFromSourceEntry", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Update entry thumbnail using url + * + * @param string $entryId Media entry id + * @param string $url File url + * @return KalturaBaseEntry + */ + function updateThumbnailFromUrl($entryId, $url) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "url", $url); + $this->client->queueServiceActionCall("media", "updateThumbnailFromUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseEntry"); + return $resultObject; + } + + /** + * Update media entry thumbnail using a raw jpeg file + * + * @param string $entryId Media entry id + * @param file $fileData Jpeg file data + * @return KalturaMediaEntry + */ + function updateThumbnailJpeg($entryId, $fileData) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + $this->client->queueServiceActionCall("media", "updateThumbnailJpeg", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMediaEntry"); + return $resultObject; + } + + /** + * Upload a media file to Kaltura, then the file can be used to create a media entry. + * + * @param file $fileData The file data + * @return string + */ + function upload($fileData) + { + $kparams = array(); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + $this->client->queueServiceActionCall("media", "upload", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMixingService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds a new mix. + If the dataContent is null, a default timeline will be created. + * + * @param KalturaMixEntry $mixEntry Mix entry metadata + * @return KalturaMixEntry + */ + function add(KalturaMixEntry $mixEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "mixEntry", $mixEntry->toParams()); + $this->client->queueServiceActionCall("mixing", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMixEntry"); + return $resultObject; + } + + /** + * Anonymously rank a mix entry, no validation is done on duplicate rankings + * + * @param string $entryId + * @param int $rank + */ + function anonymousRank($entryId, $rank) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "rank", $rank); + $this->client->queueServiceActionCall("mixing", "anonymousRank", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Appends a media entry to a the end of the mix timeline, this will save the mix timeline as a new version. + * + * @param string $mixEntryId Mix entry to append to its timeline + * @param string $mediaEntryId Media entry to append to the timeline + * @return KalturaMixEntry + */ + function appendMediaEntry($mixEntryId, $mediaEntryId) + { + $kparams = array(); + $this->client->addParam($kparams, "mixEntryId", $mixEntryId); + $this->client->addParam($kparams, "mediaEntryId", $mediaEntryId); + $this->client->queueServiceActionCall("mixing", "appendMediaEntry", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMixEntry"); + return $resultObject; + } + + /** + * Clones an existing mix. + * + * @param string $entryId Mix entry id to clone + * @return KalturaMixEntry + */ + function cloneAction($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("mixing", "clone", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMixEntry"); + return $resultObject; + } + + /** + * Count mix entries by filter. + * + * @param KalturaMediaEntryFilter $filter Media entry filter + * @return int + */ + function count(KalturaMediaEntryFilter $filter = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + $this->client->queueServiceActionCall("mixing", "count", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * Delete a mix entry. + * + * @param string $entryId Mix entry id to delete + */ + function delete($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("mixing", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get mix entry by id. + * + * @param string $entryId Mix entry id + * @param int $version Desired version of the data + * @return KalturaMixEntry + */ + function get($entryId, $version = -1) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "version", $version); + $this->client->queueServiceActionCall("mixing", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMixEntry"); + return $resultObject; + } + + /** + * Get the mixes in which the media entry is included + * + * @param string $mediaEntryId + * @return array + */ + function getMixesByMediaId($mediaEntryId) + { + $kparams = array(); + $this->client->addParam($kparams, "mediaEntryId", $mediaEntryId); + $this->client->queueServiceActionCall("mixing", "getMixesByMediaId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * Get all ready media entries that exist in the given mix id + * + * @param string $mixId + * @param int $version Desired version to get the data from + * @return array + */ + function getReadyMediaEntries($mixId, $version = -1) + { + $kparams = array(); + $this->client->addParam($kparams, "mixId", $mixId); + $this->client->addParam($kparams, "version", $version); + $this->client->queueServiceActionCall("mixing", "getReadyMediaEntries", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * List entries by filter with paging support. + Return parameter is an array of mix entries. + * + * @param KalturaMixEntryFilter $filter Mix entry filter + * @param KalturaFilterPager $pager Pager + * @return KalturaMixListResponse + */ + function listAction(KalturaMixEntryFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("mixing", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMixListResponse"); + return $resultObject; + } + + /** + * Update mix entry. Only the properties that were set will be updated. + * + * @param string $entryId Mix entry id to update + * @param KalturaMixEntry $mixEntry Mix entry metadata to update + * @return KalturaMixEntry + */ + function update($entryId, KalturaMixEntry $mixEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "mixEntry", $mixEntry->toParams()); + $this->client->queueServiceActionCall("mixing", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMixEntry"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaNotificationService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Return the notifications for a specific entry id and type + * + * @param string $entryId + * @param int $type + * @return KalturaClientNotification + */ + function getClientNotification($entryId, $type) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "type", $type); + $this->client->queueServiceActionCall("notification", "getClientNotification", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaClientNotification"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartnerService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Count partner's existing sub-publishers (count includes the partner itself). + * + * @param KalturaPartnerFilter $filter + * @return int + */ + function count(KalturaPartnerFilter $filter = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + $this->client->queueServiceActionCall("partner", "count", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * Retrieve partner object by Id + * + * @param int $id + * @return KalturaPartner + */ + function get($id = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("partner", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPartner"); + return $resultObject; + } + + /** + * Retrieve all info attributed to the partner + This action expects no parameters. It returns information for the current KS partnerId. + * + * @return KalturaPartner + */ + function getInfo() + { + $kparams = array(); + $this->client->queueServiceActionCall("partner", "getInfo", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPartner"); + return $resultObject; + } + + /** + * Retrieve partner secret and admin secret + * + * @param int $partnerId + * @param string $adminEmail + * @param string $cmsPassword + * @return KalturaPartner + */ + function getSecrets($partnerId, $adminEmail, $cmsPassword) + { + $kparams = array(); + $this->client->addParam($kparams, "partnerId", $partnerId); + $this->client->addParam($kparams, "adminEmail", $adminEmail); + $this->client->addParam($kparams, "cmsPassword", $cmsPassword); + $this->client->queueServiceActionCall("partner", "getSecrets", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPartner"); + return $resultObject; + } + + /** + * Get usage statistics for a partner + Calculation is done according to partner's package + * + * @return KalturaPartnerStatistics + */ + function getStatistics() + { + $kparams = array(); + $this->client->queueServiceActionCall("partner", "getStatistics", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPartnerStatistics"); + return $resultObject; + } + + /** + * Get usage statistics for a partner + Calculation is done according to partner's package + Additional data returned is a graph points of streaming usage in a timeframe + The resolution can be "days" or "months" + * + * @param int $year + * @param int $month + * @param string $resolution + * @return KalturaPartnerUsage + */ + function getUsage($year = "", $month = 1, $resolution = null) + { + $kparams = array(); + $this->client->addParam($kparams, "year", $year); + $this->client->addParam($kparams, "month", $month); + $this->client->addParam($kparams, "resolution", $resolution); + $this->client->queueServiceActionCall("partner", "getUsage", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPartnerUsage"); + return $resultObject; + } + + /** + * List partners by filter with paging support + Current implementation will only list the sub partners of the partner initiating the api call (using the current KS). + This action is only partially implemented to support listing sub partners of a VAR partner. + * + * @param KalturaPartnerFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaPartnerListResponse + */ + function listAction(KalturaPartnerFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("partner", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPartnerListResponse"); + return $resultObject; + } + + /** + * List partner's current processes' statuses + * + * @return KalturaFeatureStatusListResponse + */ + function listFeatureStatus() + { + $kparams = array(); + $this->client->queueServiceActionCall("partner", "listFeatureStatus", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFeatureStatusListResponse"); + return $resultObject; + } + + /** + * Retrieve a list of partner objects which the current user is allowed to access. + * + * @param KalturaPartnerFilter $partnerFilter + * @param KalturaFilterPager $pager + * @return KalturaPartnerListResponse + */ + function listPartnersForUser(KalturaPartnerFilter $partnerFilter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($partnerFilter !== null) + $this->client->addParam($kparams, "partnerFilter", $partnerFilter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("partner", "listPartnersForUser", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPartnerListResponse"); + return $resultObject; + } + + /** + * Create a new Partner object + * + * @param KalturaPartner $partner + * @param string $cmsPassword + * @param int $templatePartnerId + * @param bool $silent + * @return KalturaPartner + */ + function register(KalturaPartner $partner, $cmsPassword = "", $templatePartnerId = null, $silent = false) + { + $kparams = array(); + $this->client->addParam($kparams, "partner", $partner->toParams()); + $this->client->addParam($kparams, "cmsPassword", $cmsPassword); + $this->client->addParam($kparams, "templatePartnerId", $templatePartnerId); + $this->client->addParam($kparams, "silent", $silent); + $this->client->queueServiceActionCall("partner", "register", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPartner"); + return $resultObject; + } + + /** + * Update details and settings of an existing partner + * + * @param KalturaPartner $partner + * @param bool $allowEmpty + * @return KalturaPartner + */ + function update(KalturaPartner $partner, $allowEmpty = false) + { + $kparams = array(); + $this->client->addParam($kparams, "partner", $partner->toParams()); + $this->client->addParam($kparams, "allowEmpty", $allowEmpty); + $this->client->queueServiceActionCall("partner", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPartner"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionItemService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds a new permission item object to the account. + This action is available only to Kaltura system administrators. + * + * @param KalturaPermissionItem $permissionItem The new permission item + * @return KalturaPermissionItem + */ + function add(KalturaPermissionItem $permissionItem) + { + $kparams = array(); + $this->client->addParam($kparams, "permissionItem", $permissionItem->toParams()); + $this->client->queueServiceActionCall("permissionitem", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermissionItem"); + return $resultObject; + } + + /** + * Deletes an existing permission item object. + This action is available only to Kaltura system administrators. + * + * @param int $permissionItemId The permission item's unique identifier + * @return KalturaPermissionItem + */ + function delete($permissionItemId) + { + $kparams = array(); + $this->client->addParam($kparams, "permissionItemId", $permissionItemId); + $this->client->queueServiceActionCall("permissionitem", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermissionItem"); + return $resultObject; + } + + /** + * Retrieves a permission item object using its ID. + * + * @param int $permissionItemId The permission item's unique identifier + * @return KalturaPermissionItem + */ + function get($permissionItemId) + { + $kparams = array(); + $this->client->addParam($kparams, "permissionItemId", $permissionItemId); + $this->client->queueServiceActionCall("permissionitem", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermissionItem"); + return $resultObject; + } + + /** + * Lists permission item objects that are associated with an account. + * + * @param KalturaPermissionItemFilter $filter A filter used to exclude specific types of permission items + * @param KalturaFilterPager $pager A limit for the number of records to display on a page + * @return KalturaPermissionItemListResponse + */ + function listAction(KalturaPermissionItemFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("permissionitem", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermissionItemListResponse"); + return $resultObject; + } + + /** + * Updates an existing permission item object. + This action is available only to Kaltura system administrators. + * + * @param int $permissionItemId The permission item's unique identifier + * @param KalturaPermissionItem $permissionItem Id The permission item's unique identifier + * @return KalturaPermissionItem + */ + function update($permissionItemId, KalturaPermissionItem $permissionItem) + { + $kparams = array(); + $this->client->addParam($kparams, "permissionItemId", $permissionItemId); + $this->client->addParam($kparams, "permissionItem", $permissionItem->toParams()); + $this->client->queueServiceActionCall("permissionitem", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermissionItem"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds a new permission object to the account. + * + * @param KalturaPermission $permission The new permission + * @return KalturaPermission + */ + function add(KalturaPermission $permission) + { + $kparams = array(); + $this->client->addParam($kparams, "permission", $permission->toParams()); + $this->client->queueServiceActionCall("permission", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermission"); + return $resultObject; + } + + /** + * Deletes an existing permission object. + * + * @param string $permissionName The name assigned to the permission + * @return KalturaPermission + */ + function delete($permissionName) + { + $kparams = array(); + $this->client->addParam($kparams, "permissionName", $permissionName); + $this->client->queueServiceActionCall("permission", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermission"); + return $resultObject; + } + + /** + * Retrieves a permission object using its ID. + * + * @param string $permissionName The name assigned to the permission + * @return KalturaPermission + */ + function get($permissionName) + { + $kparams = array(); + $this->client->addParam($kparams, "permissionName", $permissionName); + $this->client->queueServiceActionCall("permission", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermission"); + return $resultObject; + } + + /** + * Retrieves a list of permissions that apply to the current KS. + * + * @return string + */ + function getCurrentPermissions() + { + $kparams = array(); + $this->client->queueServiceActionCall("permission", "getCurrentPermissions", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Lists permission objects that are associated with an account. + Blocked permissions are listed unless you use a filter to exclude them. + Blocked permissions are listed unless you use a filter to exclude them. + * + * @param KalturaPermissionFilter $filter A filter used to exclude specific types of permissions + * @param KalturaFilterPager $pager A limit for the number of records to display on a page + * @return KalturaPermissionListResponse + */ + function listAction(KalturaPermissionFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("permission", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermissionListResponse"); + return $resultObject; + } + + /** + * Updates an existing permission object. + * + * @param string $permissionName The name assigned to the permission + * @param KalturaPermission $permission Name The name assigned to the permission + * @return KalturaPermission + */ + function update($permissionName, KalturaPermission $permission) + { + $kparams = array(); + $this->client->addParam($kparams, "permissionName", $permissionName); + $this->client->addParam($kparams, "permission", $permission->toParams()); + $this->client->queueServiceActionCall("permission", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPermission"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylistService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new playlist + Note that all entries used in a playlist will become public and may appear in KalturaNetwork + * + * @param KalturaPlaylist $playlist + * @param bool $updateStats Indicates that the playlist statistics attributes should be updated synchronously now + * @return KalturaPlaylist + */ + function add(KalturaPlaylist $playlist, $updateStats = false) + { + $kparams = array(); + $this->client->addParam($kparams, "playlist", $playlist->toParams()); + $this->client->addParam($kparams, "updateStats", $updateStats); + $this->client->queueServiceActionCall("playlist", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPlaylist"); + return $resultObject; + } + + /** + * Clone an existing playlist + * + * @param string $id Id of the playlist to clone + * @param KalturaPlaylist $newPlaylist Parameters defined here will override the ones in the cloned playlist + * @return KalturaPlaylist + */ + function cloneAction($id, KalturaPlaylist $newPlaylist = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + if ($newPlaylist !== null) + $this->client->addParam($kparams, "newPlaylist", $newPlaylist->toParams()); + $this->client->queueServiceActionCall("playlist", "clone", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPlaylist"); + return $resultObject; + } + + /** + * Delete existing playlist + * + * @param string $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("playlist", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Retrieve playlist for playing purpose + * + * @param string $id + * @param string $detailed + * @param KalturaContext $playlistContext + * @param KalturaMediaEntryFilterForPlaylist $filter + * @param KalturaFilterPager $pager + * @return array + */ + function execute($id, $detailed = "", KalturaContext $playlistContext = null, KalturaMediaEntryFilterForPlaylist $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "detailed", $detailed); + if ($playlistContext !== null) + $this->client->addParam($kparams, "playlistContext", $playlistContext->toParams()); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("playlist", "execute", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * Retrieve playlist for playing purpose, based on content + * + * @param int $playlistType + * @param string $playlistContent + * @param string $detailed + * @param KalturaFilterPager $pager + * @return array + */ + function executeFromContent($playlistType, $playlistContent, $detailed = "", KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "playlistType", $playlistType); + $this->client->addParam($kparams, "playlistContent", $playlistContent); + $this->client->addParam($kparams, "detailed", $detailed); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("playlist", "executeFromContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * Revrieve playlist for playing purpose, based on media entry filters + * + * @param array $filters + * @param int $totalResults + * @param string $detailed + * @param KalturaFilterPager $pager + * @return array + */ + function executeFromFilters(array $filters, $totalResults, $detailed = "1", KalturaFilterPager $pager = null) + { + $kparams = array(); + foreach($filters as $index => $obj) + { + $this->client->addParam($kparams, "filters:$index", $obj->toParams()); + } + $this->client->addParam($kparams, "totalResults", $totalResults); + $this->client->addParam($kparams, "detailed", $detailed); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("playlist", "executeFromFilters", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * Retrieve a playlist + * + * @param string $id + * @param int $version Desired version of the data + * @return KalturaPlaylist + */ + function get($id, $version = -1) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "version", $version); + $this->client->queueServiceActionCall("playlist", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPlaylist"); + return $resultObject; + } + + /** + * Retrieve playlist statistics + * + * @param int $playlistType + * @param string $playlistContent + * @return KalturaPlaylist + */ + function getStatsFromContent($playlistType, $playlistContent) + { + $kparams = array(); + $this->client->addParam($kparams, "playlistType", $playlistType); + $this->client->addParam($kparams, "playlistContent", $playlistContent); + $this->client->queueServiceActionCall("playlist", "getStatsFromContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPlaylist"); + return $resultObject; + } + + /** + * List available playlists + * + * @param KalturaPlaylistFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaPlaylistListResponse + */ + function listAction(KalturaPlaylistFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("playlist", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPlaylistListResponse"); + return $resultObject; + } + + /** + * Update existing playlist + Note - you cannot change playlist type. updated playlist must be of the same type. + * + * @param string $id + * @param KalturaPlaylist $playlist + * @param bool $updateStats + * @return KalturaPlaylist + */ + function update($id, KalturaPlaylist $playlist, $updateStats = false) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "playlist", $playlist->toParams()); + $this->client->addParam($kparams, "updateStats", $updateStats); + $this->client->queueServiceActionCall("playlist", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaPlaylist"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * + * + * @param int $id + * @param array $params + * @return KalturaReportResponse + */ + function execute($id, array $params = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + if ($params !== null) + foreach($params as $index => $obj) + { + $this->client->addParam($kparams, "params:$index", $obj->toParams()); + } + $this->client->queueServiceActionCall("report", "execute", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaReportResponse"); + return $resultObject; + } + + /** + * Report getBaseTotal action allows to get a the total base for storage reports + * + * @param string $reportType + * @param KalturaReportInputFilter $reportInputFilter + * @param string $objectIds - one ID or more (separated by ',') of specific objects to query + * @return array + */ + function getBaseTotal($reportType, KalturaReportInputFilter $reportInputFilter, $objectIds = null) + { + $kparams = array(); + $this->client->addParam($kparams, "reportType", $reportType); + $this->client->addParam($kparams, "reportInputFilter", $reportInputFilter->toParams()); + $this->client->addParam($kparams, "objectIds", $objectIds); + $this->client->queueServiceActionCall("report", "getBaseTotal", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * + * + * @param int $id + * @param array $params + * @return file + */ + function getCsv($id, array $params = null) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + if ($params !== null) + foreach($params as $index => $obj) + { + $this->client->addParam($kparams, "params:$index", $obj->toParams()); + } + $this->client->queueServiceActionCall("report", "getCsv", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Returns report CSV file executed by string params with the following convention: param1=value1;param2=value2 + * + * @param int $id + * @param string $params + * @return file + */ + function getCsvFromStringParams($id, $params = null) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "params", $params); + $this->client->queueServiceActionCall("report", "getCsvFromStringParams", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Report getGraphs action allows to get a graph data for a specific report. + * + * @param string $reportType + * @param KalturaReportInputFilter $reportInputFilter + * @param string $dimension + * @param string $objectIds - one ID or more (separated by ',') of specific objects to query + * @return array + */ + function getGraphs($reportType, KalturaReportInputFilter $reportInputFilter, $dimension = null, $objectIds = null) + { + $kparams = array(); + $this->client->addParam($kparams, "reportType", $reportType); + $this->client->addParam($kparams, "reportInputFilter", $reportInputFilter->toParams()); + $this->client->addParam($kparams, "dimension", $dimension); + $this->client->addParam($kparams, "objectIds", $objectIds); + $this->client->queueServiceActionCall("report", "getGraphs", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * Report getTable action allows to get a graph data for a specific report. + * + * @param string $reportType + * @param KalturaReportInputFilter $reportInputFilter + * @param KalturaFilterPager $pager + * @param string $order + * @param string $objectIds - one ID or more (separated by ',') of specific objects to query + * @return KalturaReportTable + */ + function getTable($reportType, KalturaReportInputFilter $reportInputFilter, KalturaFilterPager $pager, $order = null, $objectIds = null) + { + $kparams = array(); + $this->client->addParam($kparams, "reportType", $reportType); + $this->client->addParam($kparams, "reportInputFilter", $reportInputFilter->toParams()); + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->addParam($kparams, "order", $order); + $this->client->addParam($kparams, "objectIds", $objectIds); + $this->client->queueServiceActionCall("report", "getTable", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaReportTable"); + return $resultObject; + } + + /** + * Report getTotal action allows to get a graph data for a specific report. + * + * @param string $reportType + * @param KalturaReportInputFilter $reportInputFilter + * @param string $objectIds - one ID or more (separated by ',') of specific objects to query + * @return KalturaReportTotal + */ + function getTotal($reportType, KalturaReportInputFilter $reportInputFilter, $objectIds = null) + { + $kparams = array(); + $this->client->addParam($kparams, "reportType", $reportType); + $this->client->addParam($kparams, "reportInputFilter", $reportInputFilter->toParams()); + $this->client->addParam($kparams, "objectIds", $objectIds); + $this->client->queueServiceActionCall("report", "getTotal", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaReportTotal"); + return $resultObject; + } + + /** + * Will create a Csv file for the given report and return the URL to access it + * + * @param string $reportTitle The title of the report to display at top of CSV + * @param string $reportText The text of the filter of the report + * @param string $headers The headers of the columns - a map between the enumerations on the server side and the their display text + * @param string $reportType + * @param KalturaReportInputFilter $reportInputFilter + * @param string $dimension + * @param KalturaFilterPager $pager + * @param string $order + * @param string $objectIds - one ID or more (separated by ',') of specific objects to query + * @return string + */ + function getUrlForReportAsCsv($reportTitle, $reportText, $headers, $reportType, KalturaReportInputFilter $reportInputFilter, $dimension = null, KalturaFilterPager $pager = null, $order = null, $objectIds = null) + { + $kparams = array(); + $this->client->addParam($kparams, "reportTitle", $reportTitle); + $this->client->addParam($kparams, "reportText", $reportText); + $this->client->addParam($kparams, "headers", $headers); + $this->client->addParam($kparams, "reportType", $reportType); + $this->client->addParam($kparams, "reportInputFilter", $reportInputFilter->toParams()); + $this->client->addParam($kparams, "dimension", $dimension); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->addParam($kparams, "order", $order); + $this->client->addParam($kparams, "objectIds", $objectIds); + $this->client->queueServiceActionCall("report", "getUrlForReportAsCsv", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Will serve a requested report + * + * @param string $id - the requested id + * @return string + */ + function serve($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("report", "serve", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new response profile + * + * @param KalturaResponseProfile $addResponseProfile + * @return KalturaResponseProfile + */ + function add(KalturaResponseProfile $addResponseProfile) + { + $kparams = array(); + $this->client->addParam($kparams, "addResponseProfile", $addResponseProfile->toParams()); + $this->client->queueServiceActionCall("responseprofile", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaResponseProfile"); + return $resultObject; + } + + /** + * Clone an existing response profile + * + * @param bigint $id + * @param KalturaResponseProfile $profile + * @return KalturaResponseProfile + */ + function cloneAction($id, KalturaResponseProfile $profile) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "profile", $profile->toParams()); + $this->client->queueServiceActionCall("responseprofile", "clone", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaResponseProfile"); + return $resultObject; + } + + /** + * Delete response profile by id + * + * @param bigint $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("responseprofile", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get response profile by id + * + * @param bigint $id + * @return KalturaResponseProfile + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("responseprofile", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaResponseProfile"); + return $resultObject; + } + + /** + * List response profiles by filter and pager + * + * @param KalturaResponseProfileFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaResponseProfileListResponse + */ + function listAction(KalturaResponseProfileFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("responseprofile", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaResponseProfileListResponse"); + return $resultObject; + } + + /** + * Recalculate response profile cached objects + * + * @param KalturaResponseProfileCacheRecalculateOptions $options + * @return KalturaResponseProfileCacheRecalculateResults + */ + function recalculate(KalturaResponseProfileCacheRecalculateOptions $options) + { + $kparams = array(); + $this->client->addParam($kparams, "options", $options->toParams()); + $this->client->queueServiceActionCall("responseprofile", "recalculate", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaResponseProfileCacheRecalculateResults"); + return $resultObject; + } + + /** + * Update response profile by id + * + * @param bigint $id + * @param KalturaResponseProfile $updateResponseProfile + * @return KalturaResponseProfile + */ + function update($id, KalturaResponseProfile $updateResponseProfile) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "updateResponseProfile", $updateResponseProfile->toParams()); + $this->client->queueServiceActionCall("responseprofile", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaResponseProfile"); + return $resultObject; + } + + /** + * Update response profile status by id + * + * @param bigint $id + * @param int $status + * @return KalturaResponseProfile + */ + function updateStatus($id, $status) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "status", $status); + $this->client->queueServiceActionCall("responseprofile", "updateStatus", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaResponseProfile"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSchemaService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Serves the requested XSD according to the type and name. + * + * @param string $type + * @return file + */ + function serve($type) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "type", $type); + $this->client->queueServiceActionCall("schema", "serve", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * + * + * @param int $searchSource + * @param string $userName + * @param string $password + * @return KalturaSearchAuthData + */ + function externalLogin($searchSource, $userName, $password) + { + $kparams = array(); + $this->client->addParam($kparams, "searchSource", $searchSource); + $this->client->addParam($kparams, "userName", $userName); + $this->client->addParam($kparams, "password", $password); + $this->client->queueServiceActionCall("search", "externalLogin", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaSearchAuthData"); + return $resultObject; + } + + /** + * Retrieve extra information about media found in search action + Some providers return only part of the fields needed to create entry from, use this action to get the rest of the fields. + * + * @param KalturaSearchResult $searchResult KalturaSearchResult object extends KalturaSearch and has all fields required for media:add + * @return KalturaSearchResult + */ + function getMediaInfo(KalturaSearchResult $searchResult) + { + $kparams = array(); + $this->client->addParam($kparams, "searchResult", $searchResult->toParams()); + $this->client->queueServiceActionCall("search", "getMediaInfo", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaSearchResult"); + return $resultObject; + } + + /** + * Search for media in one of the supported media providers + * + * @param KalturaSearch $search A KalturaSearch object contains the search keywords, media provider and media type + * @param KalturaFilterPager $pager + * @return KalturaSearchResultResponse + */ + function search(KalturaSearch $search, KalturaFilterPager $pager = null) + { + $kparams = array(); + $this->client->addParam($kparams, "search", $search->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("search", "search", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaSearchResultResponse"); + return $resultObject; + } + + /** + * Search for media given a specific URL + Kaltura supports a searchURL action on some of the media providers. + This action will return a KalturaSearchResult object based on a given URL (assuming the media provider is supported) + * + * @param int $mediaType + * @param string $url + * @return KalturaSearchResult + */ + function searchUrl($mediaType, $url) + { + $kparams = array(); + $this->client->addParam($kparams, "mediaType", $mediaType); + $this->client->addParam($kparams, "url", $url); + $this->client->queueServiceActionCall("search", "searchUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaSearchResult"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaServerNodeService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds a server node to the Kaltura DB. + * + * @param KalturaServerNode $serverNode + * @return KalturaServerNode + */ + function add(KalturaServerNode $serverNode) + { + $kparams = array(); + $this->client->addParam($kparams, "serverNode", $serverNode->toParams()); + $this->client->queueServiceActionCall("servernode", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaServerNode"); + return $resultObject; + } + + /** + * Delete server node by id + * + * @param string $serverNodeId + */ + function delete($serverNodeId) + { + $kparams = array(); + $this->client->addParam($kparams, "serverNodeId", $serverNodeId); + $this->client->queueServiceActionCall("servernode", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Disable server node by id + * + * @param string $serverNodeId + * @return KalturaServerNode + */ + function disable($serverNodeId) + { + $kparams = array(); + $this->client->addParam($kparams, "serverNodeId", $serverNodeId); + $this->client->queueServiceActionCall("servernode", "disable", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaServerNode"); + return $resultObject; + } + + /** + * Enable server node by id + * + * @param string $serverNodeId + * @return KalturaServerNode + */ + function enable($serverNodeId) + { + $kparams = array(); + $this->client->addParam($kparams, "serverNodeId", $serverNodeId); + $this->client->queueServiceActionCall("servernode", "enable", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaServerNode"); + return $resultObject; + } + + /** + * Get server node by id + * + * @param int $serverNodeId + * @return KalturaServerNode + */ + function get($serverNodeId) + { + $kparams = array(); + $this->client->addParam($kparams, "serverNodeId", $serverNodeId); + $this->client->queueServiceActionCall("servernode", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaServerNode"); + return $resultObject; + } + + /** + * + * + * @param KalturaServerNodeFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaServerNodeListResponse + */ + function listAction(KalturaServerNodeFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("servernode", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaServerNodeListResponse"); + return $resultObject; + } + + /** + * Mark server node offline + * + * @param string $serverNodeId + * @return KalturaServerNode + */ + function markOffline($serverNodeId) + { + $kparams = array(); + $this->client->addParam($kparams, "serverNodeId", $serverNodeId); + $this->client->queueServiceActionCall("servernode", "markOffline", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaServerNode"); + return $resultObject; + } + + /** + * Update server node status + * + * @param string $hostName + * @param KalturaServerNode $serverNode + * @return KalturaServerNode + */ + function reportStatus($hostName, KalturaServerNode $serverNode = null) + { + $kparams = array(); + $this->client->addParam($kparams, "hostName", $hostName); + if ($serverNode !== null) + $this->client->addParam($kparams, "serverNode", $serverNode->toParams()); + $this->client->queueServiceActionCall("servernode", "reportStatus", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaServerNode"); + return $resultObject; + } + + /** + * Update server node by id + * + * @param int $serverNodeId + * @param KalturaServerNode $serverNode Id + * @return KalturaServerNode + */ + function update($serverNodeId, KalturaServerNode $serverNode) + { + $kparams = array(); + $this->client->addParam($kparams, "serverNodeId", $serverNodeId); + $this->client->addParam($kparams, "serverNode", $serverNode->toParams()); + $this->client->queueServiceActionCall("servernode", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaServerNode"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSessionService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * End a session with the Kaltura server, making the current KS invalid. + * + */ + function end() + { + $kparams = array(); + $this->client->queueServiceActionCall("session", "end", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Parse session key and return its info + * + * @param string $session The KS to be parsed, keep it empty to use current session. + * @return KalturaSessionInfo + */ + function get($session = null) + { + $kparams = array(); + $this->client->addParam($kparams, "session", $session); + $this->client->queueServiceActionCall("session", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaSessionInfo"); + return $resultObject; + } + + /** + * Start an impersonated session with Kaltura's server. + The result KS is the session key that you should pass to all services that requires a ticket. + * + * @param string $secret - should be the secret (admin or user) of the original partnerId (not impersonatedPartnerId). + * @param int $impersonatedPartnerId + * @param string $userId - impersonated userId + * @param int $type + * @param int $partnerId + * @param int $expiry KS expiry time in seconds + * @param string $privileges + * @return string + */ + function impersonate($secret, $impersonatedPartnerId, $userId = "", $type = 0, $partnerId = null, $expiry = 86400, $privileges = null) + { + $kparams = array(); + $this->client->addParam($kparams, "secret", $secret); + $this->client->addParam($kparams, "impersonatedPartnerId", $impersonatedPartnerId); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "type", $type); + $this->client->addParam($kparams, "partnerId", $partnerId); + $this->client->addParam($kparams, "expiry", $expiry); + $this->client->addParam($kparams, "privileges", $privileges); + $this->client->queueServiceActionCall("session", "impersonate", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Start an impersonated session with Kaltura's server. + The result KS info contains the session key that you should pass to all services that requires a ticket. + Type, expiry and privileges won't be changed if they're not set + * + * @param string $session The old KS of the impersonated partner + * @param int $type Type of the new KS + * @param int $expiry Expiry time in seconds of the new KS + * @param string $privileges Privileges of the new KS + * @return KalturaSessionInfo + */ + function impersonateByKs($session, $type = null, $expiry = null, $privileges = null) + { + $kparams = array(); + $this->client->addParam($kparams, "session", $session); + $this->client->addParam($kparams, "type", $type); + $this->client->addParam($kparams, "expiry", $expiry); + $this->client->addParam($kparams, "privileges", $privileges); + $this->client->queueServiceActionCall("session", "impersonateByKs", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaSessionInfo"); + return $resultObject; + } + + /** + * Start a session with Kaltura's server. + The result KS is the session key that you should pass to all services that requires a ticket. + * + * @param string $secret Remember to provide the correct secret according to the sessionType you want + * @param string $userId + * @param int $type Regular session or Admin session + * @param int $partnerId + * @param int $expiry KS expiry time in seconds + * @param string $privileges + * @return string + */ + function start($secret, $userId = "", $type = 0, $partnerId = null, $expiry = 86400, $privileges = null) + { + $kparams = array(); + $this->client->addParam($kparams, "secret", $secret); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "type", $type); + $this->client->addParam($kparams, "partnerId", $partnerId); + $this->client->addParam($kparams, "expiry", $expiry); + $this->client->addParam($kparams, "privileges", $privileges); + $this->client->queueServiceActionCall("session", "start", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Start a session for Kaltura's flash widgets + * + * @param string $widgetId + * @param int $expiry + * @return KalturaStartWidgetSessionResponse + */ + function startWidgetSession($widgetId, $expiry = 86400) + { + $kparams = array(); + $this->client->addParam($kparams, "widgetId", $widgetId); + $this->client->addParam($kparams, "expiry", $expiry); + $this->client->queueServiceActionCall("session", "startWidgetSession", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaStartWidgetSessionResponse"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStatsService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Will write to the event log a single line representing the event + client version - will help interprete the line structure. different client versions might have slightly different data/data formats in the line +event_id - number is the row number in yuval's excel +datetime - same format as MySql's datetime - can change and should reflect the time zone +session id - can be some big random number or guid +partner id +entry id +unique viewer +widget id +ui_conf id +uid - the puser id as set by the ppartner +current point - in milliseconds +duration - milliseconds +user ip +process duration - in milliseconds +control id +seek +new point +referrer + + + KalturaStatsEvent $event + * + * @param KalturaStatsEvent $event + * @return bool + */ + function collect(KalturaStatsEvent $event) + { + $kparams = array(); + $this->client->addParam($kparams, "event", $event->toParams()); + $this->client->queueServiceActionCall("stats", "collect", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } + + /** + * Will collect the kmcEvent sent form the KMC client + // this will actually be an empty function because all events will be sent using GET and will anyway be logged in the apache log + * + * @param KalturaStatsKmcEvent $kmcEvent + */ + function kmcCollect(KalturaStatsKmcEvent $kmcEvent) + { + $kparams = array(); + $this->client->addParam($kparams, "kmcEvent", $kmcEvent->toParams()); + $this->client->queueServiceActionCall("stats", "kmcCollect", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Use this action to report device capabilities to the kaltura server. + * + * @param string $data + */ + function reportDeviceCapabilities($data) + { + $kparams = array(); + $this->client->addParam($kparams, "data", $data); + $this->client->queueServiceActionCall("stats", "reportDeviceCapabilities", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Use this action to report errors to the kaltura server. + * + * @param string $errorCode + * @param string $errorMessage + */ + function reportError($errorCode, $errorMessage) + { + $kparams = array(); + $this->client->addParam($kparams, "errorCode", $errorCode); + $this->client->addParam($kparams, "errorMessage", $errorMessage); + $this->client->queueServiceActionCall("stats", "reportError", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * + * + * @param KalturaCEError $kalturaCEError + * @return KalturaCEError + */ + function reportKceError(KalturaCEError $kalturaCEError) + { + $kparams = array(); + $this->client->addParam($kparams, "kalturaCEError", $kalturaCEError->toParams()); + $this->client->queueServiceActionCall("stats", "reportKceError", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaCEError"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageProfileService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds a storage profile to the Kaltura DB. + * + * @param KalturaStorageProfile $storageProfile + * @return KalturaStorageProfile + */ + function add(KalturaStorageProfile $storageProfile) + { + $kparams = array(); + $this->client->addParam($kparams, "storageProfile", $storageProfile->toParams()); + $this->client->queueServiceActionCall("storageprofile", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaStorageProfile"); + return $resultObject; + } + + /** + * Get storage profile by id + * + * @param int $storageProfileId + * @return KalturaStorageProfile + */ + function get($storageProfileId) + { + $kparams = array(); + $this->client->addParam($kparams, "storageProfileId", $storageProfileId); + $this->client->queueServiceActionCall("storageprofile", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaStorageProfile"); + return $resultObject; + } + + /** + * + * + * @param KalturaStorageProfileFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaStorageProfileListResponse + */ + function listAction(KalturaStorageProfileFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("storageprofile", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaStorageProfileListResponse"); + return $resultObject; + } + + /** + * Update storage profile by id + * + * @param int $storageProfileId + * @param KalturaStorageProfile $storageProfile Id + * @return KalturaStorageProfile + */ + function update($storageProfileId, KalturaStorageProfile $storageProfile) + { + $kparams = array(); + $this->client->addParam($kparams, "storageProfileId", $storageProfileId); + $this->client->addParam($kparams, "storageProfile", $storageProfile->toParams()); + $this->client->queueServiceActionCall("storageprofile", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaStorageProfile"); + return $resultObject; + } + + /** + * + * + * @param int $storageId + * @param int $status + */ + function updateStatus($storageId, $status) + { + $kparams = array(); + $this->client->addParam($kparams, "storageId", $storageId); + $this->client->addParam($kparams, "status", $status); + $this->client->queueServiceActionCall("storageprofile", "updateStatus", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSyndicationFeedService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new Syndication Feed + * + * @param KalturaBaseSyndicationFeed $syndicationFeed + * @return KalturaBaseSyndicationFeed + */ + function add(KalturaBaseSyndicationFeed $syndicationFeed) + { + $kparams = array(); + $this->client->addParam($kparams, "syndicationFeed", $syndicationFeed->toParams()); + $this->client->queueServiceActionCall("syndicationfeed", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseSyndicationFeed"); + return $resultObject; + } + + /** + * Delete Syndication Feed by ID + * + * @param string $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("syndicationfeed", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get Syndication Feed by ID + * + * @param string $id + * @return KalturaBaseSyndicationFeed + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("syndicationfeed", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseSyndicationFeed"); + return $resultObject; + } + + /** + * Get entry count for a syndication feed + * + * @param string $feedId + * @return KalturaSyndicationFeedEntryCount + */ + function getEntryCount($feedId) + { + $kparams = array(); + $this->client->addParam($kparams, "feedId", $feedId); + $this->client->queueServiceActionCall("syndicationfeed", "getEntryCount", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaSyndicationFeedEntryCount"); + return $resultObject; + } + + /** + * List Syndication Feeds by filter with paging support + * + * @param KalturaBaseSyndicationFeedFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaBaseSyndicationFeedListResponse + */ + function listAction(KalturaBaseSyndicationFeedFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("syndicationfeed", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseSyndicationFeedListResponse"); + return $resultObject; + } + + /** + * Request conversion for all entries that doesnt have the required flavor param + returns a comma-separated ids of conversion jobs + * + * @param string $feedId + * @return string + */ + function requestConversion($feedId) + { + $kparams = array(); + $this->client->addParam($kparams, "feedId", $feedId); + $this->client->queueServiceActionCall("syndicationfeed", "requestConversion", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Update Syndication Feed by ID + * + * @param string $id + * @param KalturaBaseSyndicationFeed $syndicationFeed + * @return KalturaBaseSyndicationFeed + */ + function update($id, KalturaBaseSyndicationFeed $syndicationFeed) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "syndicationFeed", $syndicationFeed->toParams()); + $this->client->queueServiceActionCall("syndicationfeed", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBaseSyndicationFeed"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSystemService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * + * + * @return int + */ + function getTime() + { + $kparams = array(); + $this->client->queueServiceActionCall("system", "getTime", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * + * + * @return string + */ + function getVersion() + { + $kparams = array(); + $this->client->queueServiceActionCall("system", "getVersion", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * + * + * @return bool + */ + function ping() + { + $kparams = array(); + $this->client->queueServiceActionCall("system", "ping", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } + + /** + * + * + * @return bool + */ + function pingDatabase() + { + $kparams = array(); + $this->client->queueServiceActionCall("system", "pingDatabase", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbAssetService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add thumbnail asset + * + * @param string $entryId + * @param KalturaThumbAsset $thumbAsset + * @return KalturaThumbAsset + */ + function add($entryId, KalturaThumbAsset $thumbAsset) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "thumbAsset", $thumbAsset->toParams()); + $this->client->queueServiceActionCall("thumbasset", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAsset"); + return $resultObject; + } + + /** + * + * + * @param string $entryId + * @param file $fileData + * @return KalturaThumbAsset + */ + function addFromImage($entryId, $fileData) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + $this->client->queueServiceActionCall("thumbasset", "addFromImage", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAsset"); + return $resultObject; + } + + /** + * + * + * @param string $entryId + * @param string $url + * @return KalturaThumbAsset + */ + function addFromUrl($entryId, $url) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "url", $url); + $this->client->queueServiceActionCall("thumbasset", "addFromUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAsset"); + return $resultObject; + } + + /** + * + * + * @param string $thumbAssetId + */ + function delete($thumbAssetId) + { + $kparams = array(); + $this->client->addParam($kparams, "thumbAssetId", $thumbAssetId); + $this->client->queueServiceActionCall("thumbasset", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Manually export an asset + * + * @param string $assetId + * @param int $storageProfileId + * @return KalturaFlavorAsset + */ + function export($assetId, $storageProfileId) + { + $kparams = array(); + $this->client->addParam($kparams, "assetId", $assetId); + $this->client->addParam($kparams, "storageProfileId", $storageProfileId); + $this->client->queueServiceActionCall("thumbasset", "export", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaFlavorAsset"); + return $resultObject; + } + + /** + * + * + * @param string $entryId + * @param KalturaThumbParams $thumbParams + * @param string $sourceAssetId Id of the source asset (flavor or thumbnail) to be used as source for the thumbnail generation + * @return KalturaThumbAsset + */ + function generate($entryId, KalturaThumbParams $thumbParams, $sourceAssetId = null) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "thumbParams", $thumbParams->toParams()); + $this->client->addParam($kparams, "sourceAssetId", $sourceAssetId); + $this->client->queueServiceActionCall("thumbasset", "generate", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAsset"); + return $resultObject; + } + + /** + * + * + * @param string $entryId + * @param int $destThumbParamsId Indicate the id of the ThumbParams to be generate this thumbnail by + * @return KalturaThumbAsset + */ + function generateByEntryId($entryId, $destThumbParamsId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "destThumbParamsId", $destThumbParamsId); + $this->client->queueServiceActionCall("thumbasset", "generateByEntryId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAsset"); + return $resultObject; + } + + /** + * + * + * @param string $thumbAssetId + * @return KalturaThumbAsset + */ + function get($thumbAssetId) + { + $kparams = array(); + $this->client->addParam($kparams, "thumbAssetId", $thumbAssetId); + $this->client->queueServiceActionCall("thumbasset", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAsset"); + return $resultObject; + } + + /** + * + * + * @param string $entryId + * @return array + */ + function getByEntryId($entryId) + { + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->queueServiceActionCall("thumbasset", "getByEntryId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * Get remote storage existing paths for the asset + * + * @param string $id + * @return KalturaRemotePathListResponse + */ + function getRemotePaths($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("thumbasset", "getRemotePaths", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaRemotePathListResponse"); + return $resultObject; + } + + /** + * Get download URL for the asset + * + * @param string $id + * @param int $storageId + * @param KalturaThumbParams $thumbParams + * @return string + */ + function getUrl($id, $storageId = null, KalturaThumbParams $thumbParams = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "storageId", $storageId); + if ($thumbParams !== null) + $this->client->addParam($kparams, "thumbParams", $thumbParams->toParams()); + $this->client->queueServiceActionCall("thumbasset", "getUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * List Thumbnail Assets by filter and pager + * + * @param KalturaAssetFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaThumbAssetListResponse + */ + function listAction(KalturaAssetFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("thumbasset", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAssetListResponse"); + return $resultObject; + } + + /** + * + * + * @param string $thumbAssetId + * @return KalturaThumbAsset + */ + function regenerate($thumbAssetId) + { + $kparams = array(); + $this->client->addParam($kparams, "thumbAssetId", $thumbAssetId); + $this->client->queueServiceActionCall("thumbasset", "regenerate", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAsset"); + return $resultObject; + } + + /** + * Serves thumbnail by its id + * + * @param string $thumbAssetId + * @param int $version + * @param KalturaThumbParams $thumbParams + * @param KalturaThumbnailServeOptions $options + * @return file + */ + function serve($thumbAssetId, $version = null, KalturaThumbParams $thumbParams = null, KalturaThumbnailServeOptions $options = null) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "thumbAssetId", $thumbAssetId); + $this->client->addParam($kparams, "version", $version); + if ($thumbParams !== null) + $this->client->addParam($kparams, "thumbParams", $thumbParams->toParams()); + if ($options !== null) + $this->client->addParam($kparams, "options", $options->toParams()); + $this->client->queueServiceActionCall("thumbasset", "serve", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Serves thumbnail by entry id and thumnail params id + * + * @param string $entryId + * @param int $thumbParamId If not set, default thumbnail will be used. + * @return file + */ + function serveByEntryId($entryId, $thumbParamId = null) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "entryId", $entryId); + $this->client->addParam($kparams, "thumbParamId", $thumbParamId); + $this->client->queueServiceActionCall("thumbasset", "serveByEntryId", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Tags the thumbnail as DEFAULT_THUMB and removes that tag from all other thumbnail assets of the entry. + Create a new file sync link on the entry thumbnail that points to the thumbnail asset file sync. + * + * @param string $thumbAssetId + */ + function setAsDefault($thumbAssetId) + { + $kparams = array(); + $this->client->addParam($kparams, "thumbAssetId", $thumbAssetId); + $this->client->queueServiceActionCall("thumbasset", "setAsDefault", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Update content of thumbnail asset + * + * @param string $id + * @param KalturaContentResource $contentResource + * @return KalturaThumbAsset + */ + function setContent($id, KalturaContentResource $contentResource) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "contentResource", $contentResource->toParams()); + $this->client->queueServiceActionCall("thumbasset", "setContent", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAsset"); + return $resultObject; + } + + /** + * Update thumbnail asset + * + * @param string $id + * @param KalturaThumbAsset $thumbAsset + * @return KalturaThumbAsset + */ + function update($id, KalturaThumbAsset $thumbAsset) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "thumbAsset", $thumbAsset->toParams()); + $this->client->queueServiceActionCall("thumbasset", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbAsset"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParamsOutputService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Get thumb params output object by ID + * + * @param int $id + * @return KalturaThumbParamsOutput + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("thumbparamsoutput", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbParamsOutput"); + return $resultObject; + } + + /** + * List thumb params output objects by filter and pager + * + * @param KalturaThumbParamsOutputFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaThumbParamsOutputListResponse + */ + function listAction(KalturaThumbParamsOutputFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("thumbparamsoutput", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbParamsOutputListResponse"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParamsService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new Thumb Params + * + * @param KalturaThumbParams $thumbParams + * @return KalturaThumbParams + */ + function add(KalturaThumbParams $thumbParams) + { + $kparams = array(); + $this->client->addParam($kparams, "thumbParams", $thumbParams->toParams()); + $this->client->queueServiceActionCall("thumbparams", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbParams"); + return $resultObject; + } + + /** + * Delete Thumb Params by ID + * + * @param int $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("thumbparams", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get Thumb Params by ID + * + * @param int $id + * @return KalturaThumbParams + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("thumbparams", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbParams"); + return $resultObject; + } + + /** + * Get Thumb Params by Conversion Profile ID + * + * @param int $conversionProfileId + * @return array + */ + function getByConversionProfileId($conversionProfileId) + { + $kparams = array(); + $this->client->addParam($kparams, "conversionProfileId", $conversionProfileId); + $this->client->queueServiceActionCall("thumbparams", "getByConversionProfileId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * List Thumb Params by filter with paging support (By default - all system default params will be listed too) + * + * @param KalturaThumbParamsFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaThumbParamsListResponse + */ + function listAction(KalturaThumbParamsFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("thumbparams", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbParamsListResponse"); + return $resultObject; + } + + /** + * Update Thumb Params by ID + * + * @param int $id + * @param KalturaThumbParams $thumbParams + * @return KalturaThumbParams + */ + function update($id, KalturaThumbParams $thumbParams) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "thumbParams", $thumbParams->toParams()); + $this->client->queueServiceActionCall("thumbparams", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaThumbParams"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUiConfService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * UIConf Add action allows you to add a UIConf to Kaltura DB + * + * @param KalturaUiConf $uiConf Mandatory input parameter of type KalturaUiConf + * @return KalturaUiConf + */ + function add(KalturaUiConf $uiConf) + { + $kparams = array(); + $this->client->addParam($kparams, "uiConf", $uiConf->toParams()); + $this->client->queueServiceActionCall("uiconf", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUiConf"); + return $resultObject; + } + + /** + * Clone an existing UIConf + * + * @param int $id + * @return KalturaUiConf + */ + function cloneAction($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("uiconf", "clone", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUiConf"); + return $resultObject; + } + + /** + * Delete an existing UIConf + * + * @param int $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("uiconf", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Retrieve a UIConf by id + * + * @param int $id + * @return KalturaUiConf + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("uiconf", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUiConf"); + return $resultObject; + } + + /** + * Retrieve a list of all available versions by object type + * + * @return array + */ + function getAvailableTypes() + { + $kparams = array(); + $this->client->queueServiceActionCall("uiconf", "getAvailableTypes", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "array"); + return $resultObject; + } + + /** + * Retrieve a list of available UIConfs + * + * @param KalturaUiConfFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaUiConfListResponse + */ + function listAction(KalturaUiConfFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("uiconf", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUiConfListResponse"); + return $resultObject; + } + + /** + * Retrieve a list of available template UIConfs + * + * @param KalturaUiConfFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaUiConfListResponse + */ + function listTemplates(KalturaUiConfFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("uiconf", "listTemplates", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUiConfListResponse"); + return $resultObject; + } + + /** + * Update an existing UIConf + * + * @param int $id + * @param KalturaUiConf $uiConf + * @return KalturaUiConf + */ + function update($id, KalturaUiConf $uiConf) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "uiConf", $uiConf->toParams()); + $this->client->queueServiceActionCall("uiconf", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUiConf"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * + * + * @param string $fileName + * @return KalturaUploadResponse + */ + function getUploadedFileTokenByFileName($fileName) + { + $kparams = array(); + $this->client->addParam($kparams, "fileName", $fileName); + $this->client->queueServiceActionCall("upload", "getUploadedFileTokenByFileName", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUploadResponse"); + return $resultObject; + } + + /** + * + * + * @param file $fileData The file data + * @return string + */ + function upload($fileData) + { + $kparams = array(); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + $this->client->queueServiceActionCall("upload", "upload", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadTokenService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds new upload token to upload a file + * + * @param KalturaUploadToken $uploadToken + * @return KalturaUploadToken + */ + function add(KalturaUploadToken $uploadToken = null) + { + $kparams = array(); + if ($uploadToken !== null) + $this->client->addParam($kparams, "uploadToken", $uploadToken->toParams()); + $this->client->queueServiceActionCall("uploadtoken", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUploadToken"); + return $resultObject; + } + + /** + * Deletes the upload token by upload token id + * + * @param string $uploadTokenId + */ + function delete($uploadTokenId) + { + $kparams = array(); + $this->client->addParam($kparams, "uploadTokenId", $uploadTokenId); + $this->client->queueServiceActionCall("uploadtoken", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Get upload token by id + * + * @param string $uploadTokenId + * @return KalturaUploadToken + */ + function get($uploadTokenId) + { + $kparams = array(); + $this->client->addParam($kparams, "uploadTokenId", $uploadTokenId); + $this->client->queueServiceActionCall("uploadtoken", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUploadToken"); + return $resultObject; + } + + /** + * List upload token by filter with pager support. + When using a user session the service will be restricted to users objects only. + * + * @param KalturaUploadTokenFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaUploadTokenListResponse + */ + function listAction(KalturaUploadTokenFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("uploadtoken", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUploadTokenListResponse"); + return $resultObject; + } + + /** + * Upload a file using the upload token id, returns an error on failure (an exception will be thrown when using one of the Kaltura clients) + Chunks can be uploaded in parallel and they will be appended according to their resumeAt position. + A parallel upload session should have three stages: + 1. A single upload with resume=false and finalChunk=false + 2. Parallel upload requests each with resume=true,finalChunk=false and the expected resumetAt position. + If a chunk fails to upload it can be re-uploaded. + 3. After all of the chunks have been uploaded a final chunk (can be of zero size) should be uploaded + with resume=true, finalChunk=true and the expected resumeAt position. In case an UPLOAD_TOKEN_CANNOT_MATCH_EXPECTED_SIZE exception + has been returned (indicating not all of the chunks were appended yet) the final request can be retried. + * + * @param string $uploadTokenId + * @param file $fileData + * @param bool $resume + * @param bool $finalChunk + * @param float $resumeAt + * @return KalturaUploadToken + */ + function upload($uploadTokenId, $fileData, $resume = false, $finalChunk = true, $resumeAt = -1) + { + $kparams = array(); + $this->client->addParam($kparams, "uploadTokenId", $uploadTokenId); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + $this->client->addParam($kparams, "resume", $resume); + $this->client->addParam($kparams, "finalChunk", $finalChunk); + $this->client->addParam($kparams, "resumeAt", $resumeAt); + $this->client->queueServiceActionCall("uploadtoken", "upload", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUploadToken"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserEntryService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds a user_entry to the Kaltura DB. + * + * @param KalturaUserEntry $userEntry + * @return KalturaUserEntry + */ + function add(KalturaUserEntry $userEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "userEntry", $userEntry->toParams()); + $this->client->queueServiceActionCall("userentry", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserEntry"); + return $resultObject; + } + + /** + * + * + * @param KalturaUserEntryFilter $filter + * @return int + */ + function bulkDelete(KalturaUserEntryFilter $filter) + { + $kparams = array(); + $this->client->addParam($kparams, "filter", $filter->toParams()); + $this->client->queueServiceActionCall("userentry", "bulkDelete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * + * + * @param int $id + * @return KalturaUserEntry + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("userentry", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserEntry"); + return $resultObject; + } + + /** + * + * + * @param string $id + * @return KalturaUserEntry + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("userentry", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserEntry"); + return $resultObject; + } + + /** + * + * + * @param KalturaUserEntryFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaUserEntryListResponse + */ + function listAction(KalturaUserEntryFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("userentry", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserEntryListResponse"); + return $resultObject; + } + + /** + * Submits the quiz so that it's status will be submitted and calculates the score for the quiz + * + * @param int $id + * @return KalturaQuizUserEntry + */ + function submitQuiz($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("userentry", "submitQuiz", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaQuizUserEntry"); + return $resultObject; + } + + /** + * + * + * @param int $id + * @param KalturaUserEntry $userEntry + */ + function update($id, KalturaUserEntry $userEntry) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "userEntry", $userEntry->toParams()); + $this->client->queueServiceActionCall("userentry", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserRoleService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds a new user role object to the account. + * + * @param KalturaUserRole $userRole A new role + * @return KalturaUserRole + */ + function add(KalturaUserRole $userRole) + { + $kparams = array(); + $this->client->addParam($kparams, "userRole", $userRole->toParams()); + $this->client->queueServiceActionCall("userrole", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserRole"); + return $resultObject; + } + + /** + * Creates a new user role object that is a duplicate of an existing role. + * + * @param int $userRoleId The user role's unique identifier + * @return KalturaUserRole + */ + function cloneAction($userRoleId) + { + $kparams = array(); + $this->client->addParam($kparams, "userRoleId", $userRoleId); + $this->client->queueServiceActionCall("userrole", "clone", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserRole"); + return $resultObject; + } + + /** + * Deletes an existing user role object. + * + * @param int $userRoleId The user role's unique identifier + * @return KalturaUserRole + */ + function delete($userRoleId) + { + $kparams = array(); + $this->client->addParam($kparams, "userRoleId", $userRoleId); + $this->client->queueServiceActionCall("userrole", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserRole"); + return $resultObject; + } + + /** + * Retrieves a user role object using its ID. + * + * @param int $userRoleId The user role's unique identifier + * @return KalturaUserRole + */ + function get($userRoleId) + { + $kparams = array(); + $this->client->addParam($kparams, "userRoleId", $userRoleId); + $this->client->queueServiceActionCall("userrole", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserRole"); + return $resultObject; + } + + /** + * Lists user role objects that are associated with an account. + Blocked user roles are listed unless you use a filter to exclude them. + Deleted user roles are not listed unless you use a filter to include them. + * + * @param KalturaUserRoleFilter $filter A filter used to exclude specific types of user roles + * @param KalturaFilterPager $pager A limit for the number of records to display on a page + * @return KalturaUserRoleListResponse + */ + function listAction(KalturaUserRoleFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("userrole", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserRoleListResponse"); + return $resultObject; + } + + /** + * Updates an existing user role object. + * + * @param int $userRoleId The user role's unique identifier + * @param KalturaUserRole $userRole Id The user role's unique identifier + * @return KalturaUserRole + */ + function update($userRoleId, KalturaUserRole $userRole) + { + $kparams = array(); + $this->client->addParam($kparams, "userRoleId", $userRoleId); + $this->client->addParam($kparams, "userRole", $userRole->toParams()); + $this->client->queueServiceActionCall("userrole", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserRole"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Adds a new user to an existing account in the Kaltura database. + Input param $id is the unique identifier in the partner's system. + * + * @param KalturaUser $user The new user + * @return KalturaUser + */ + function add(KalturaUser $user) + { + $kparams = array(); + $this->client->addParam($kparams, "user", $user->toParams()); + $this->client->queueServiceActionCall("user", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUser"); + return $resultObject; + } + + /** + * + * + * @param file $fileData + * @param KalturaBulkUploadJobData $bulkUploadData + * @param KalturaBulkUploadUserData $bulkUploadUserData + * @return KalturaBulkUpload + */ + function addFromBulkUpload($fileData, KalturaBulkUploadJobData $bulkUploadData = null, KalturaBulkUploadUserData $bulkUploadUserData = null) + { + $kparams = array(); + $kfiles = array(); + $this->client->addParam($kfiles, "fileData", $fileData); + if ($bulkUploadData !== null) + $this->client->addParam($kparams, "bulkUploadData", $bulkUploadData->toParams()); + if ($bulkUploadUserData !== null) + $this->client->addParam($kparams, "bulkUploadUserData", $bulkUploadUserData->toParams()); + $this->client->queueServiceActionCall("user", "addFromBulkUpload", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaBulkUpload"); + return $resultObject; + } + + /** + * Action which checks whther user login + * + * @param KalturaUserLoginDataFilter $filter + * @return bool + */ + function checkLoginDataExists(KalturaUserLoginDataFilter $filter) + { + $kparams = array(); + $this->client->addParam($kparams, "filter", $filter->toParams()); + $this->client->queueServiceActionCall("user", "checkLoginDataExists", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $resultObject = (bool) $resultObject; + return $resultObject; + } + + /** + * Deletes a user from a partner account. + * + * @param string $userId The user's unique identifier in the partner's system + * @return KalturaUser + */ + function delete($userId) + { + $kparams = array(); + $this->client->addParam($kparams, "userId", $userId); + $this->client->queueServiceActionCall("user", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUser"); + return $resultObject; + } + + /** + * Disables a user's ability to log into a partner account using an email address and a password. + You may use either a userId or a loginId parameter for this action. + * + * @param string $userId The user's unique identifier in the partner's system + * @param string $loginId The user's email address that identifies the user for login + * @return KalturaUser + */ + function disableLogin($userId = null, $loginId = null) + { + $kparams = array(); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "loginId", $loginId); + $this->client->queueServiceActionCall("user", "disableLogin", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUser"); + return $resultObject; + } + + /** + * Enables a user to log into a partner account using an email address and a password + * + * @param string $userId The user's unique identifier in the partner's system + * @param string $loginId The user's email address that identifies the user for login + * @param string $password The user's password + * @return KalturaUser + */ + function enableLogin($userId, $loginId, $password = null) + { + $kparams = array(); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "loginId", $loginId); + $this->client->addParam($kparams, "password", $password); + $this->client->queueServiceActionCall("user", "enableLogin", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUser"); + return $resultObject; + } + + /** + * Add batch job that sends an email with a link to download an updated CSV that contains list of users + * + * @param KalturaUserFilter $filter A filter used to exclude specific types of users + * @param int $metadataProfileId + * @param array $additionalFields + * @return string + */ + function exportToCsv(KalturaUserFilter $filter = null, $metadataProfileId = null, array $additionalFields = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + $this->client->addParam($kparams, "metadataProfileId", $metadataProfileId); + if ($additionalFields !== null) + foreach($additionalFields as $index => $obj) + { + $this->client->addParam($kparams, "additionalFields:$index", $obj->toParams()); + } + $this->client->queueServiceActionCall("user", "exportToCsv", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Retrieves a user object for a specified user ID. + * + * @param string $userId The user's unique identifier in the partner's system + * @return KalturaUser + */ + function get($userId = null) + { + $kparams = array(); + $this->client->addParam($kparams, "userId", $userId); + $this->client->queueServiceActionCall("user", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUser"); + return $resultObject; + } + + /** + * Retrieves a user object for a user's login ID and partner ID. + A login ID is the email address used by a user to log into the system. + * + * @param string $loginId The user's email address that identifies the user for login + * @return KalturaUser + */ + function getByLoginId($loginId) + { + $kparams = array(); + $this->client->addParam($kparams, "loginId", $loginId); + $this->client->queueServiceActionCall("user", "getByLoginId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUser"); + return $resultObject; + } + + /** + * Index an entry by id. + * + * @param string $id + * @param bool $shouldUpdate + * @return string + */ + function index($id, $shouldUpdate = true) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "shouldUpdate", $shouldUpdate); + $this->client->queueServiceActionCall("user", "index", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Lists user objects that are associated with an account. + Blocked users are listed unless you use a filter to exclude them. + Deleted users are not listed unless you use a filter to include them. + * + * @param KalturaUserFilter $filter A filter used to exclude specific types of users + * @param KalturaFilterPager $pager A limit for the number of records to display on a page + * @return KalturaUserListResponse + */ + function listAction(KalturaUserFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("user", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUserListResponse"); + return $resultObject; + } + + /** + * Logs a user into a partner account with a partner ID, a partner user ID (puser), and a user password. + * + * @param int $partnerId The identifier of the partner account + * @param string $userId The user's unique identifier in the partner's system + * @param string $password The user's password + * @param int $expiry The requested time (in seconds) before the generated KS expires (By default, a KS expires after 24 hours). + * @param string $privileges Special privileges + * @return string + */ + function login($partnerId, $userId, $password, $expiry = 86400, $privileges = "*") + { + $kparams = array(); + $this->client->addParam($kparams, "partnerId", $partnerId); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "password", $password); + $this->client->addParam($kparams, "expiry", $expiry); + $this->client->addParam($kparams, "privileges", $privileges); + $this->client->queueServiceActionCall("user", "login", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Loges a user to the destination account as long the ks user id exists in the desc acount and the loginData id match for both accounts + * + * @param int $requestedPartnerId + * @return KalturaSessionResponse + */ + function loginByKs($requestedPartnerId) + { + $kparams = array(); + $this->client->addParam($kparams, "requestedPartnerId", $requestedPartnerId); + $this->client->queueServiceActionCall("user", "loginByKs", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaSessionResponse"); + return $resultObject; + } + + /** + * Logs a user into a partner account with a user login ID and a user password. + * + * @param string $loginId The user's email address that identifies the user for login + * @param string $password The user's password + * @param int $partnerId The identifier of the partner account + * @param int $expiry The requested time (in seconds) before the generated KS expires (By default, a KS expires after 24 hours). + * @param string $privileges Special privileges + * @param string $otp The user's one-time password + * @return string + */ + function loginByLoginId($loginId, $password, $partnerId = null, $expiry = 86400, $privileges = "*", $otp = null) + { + $kparams = array(); + $this->client->addParam($kparams, "loginId", $loginId); + $this->client->addParam($kparams, "password", $password); + $this->client->addParam($kparams, "partnerId", $partnerId); + $this->client->addParam($kparams, "expiry", $expiry); + $this->client->addParam($kparams, "privileges", $privileges); + $this->client->addParam($kparams, "otp", $otp); + $this->client->queueServiceActionCall("user", "loginByLoginId", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Notifies that a user is banned from an account. + * + * @param string $userId The user's unique identifier in the partner's system + */ + function notifyBan($userId) + { + $kparams = array(); + $this->client->addParam($kparams, "userId", $userId); + $this->client->queueServiceActionCall("user", "notifyBan", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Reset user's password and send the user an email to generate a new one. + * + * @param string $email The user's email address (login email) + */ + function resetPassword($email) + { + $kparams = array(); + $this->client->addParam($kparams, "email", $email); + $this->client->queueServiceActionCall("user", "resetPassword", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Will serve a requested csv + * + * @param string $id - the requested file id + * @return string + */ + function serveCsv($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("user", "serveCsv", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "string"); + return $resultObject; + } + + /** + * Set initial users password + * + * @param string $hashKey The hash key used to identify the user (retrieved by email) + * @param string $newPassword The new password to set for the user + */ + function setInitialPassword($hashKey, $newPassword) + { + $kparams = array(); + $this->client->addParam($kparams, "hashKey", $hashKey); + $this->client->addParam($kparams, "newPassword", $newPassword); + $this->client->queueServiceActionCall("user", "setInitialPassword", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Updates an existing user object. + You can also use this action to update the userId. + * + * @param string $userId The user's unique identifier in the partner's system + * @param KalturaUser $user Id The user's unique identifier in the partner's system + * @return KalturaUser + */ + function update($userId, KalturaUser $user) + { + $kparams = array(); + $this->client->addParam($kparams, "userId", $userId); + $this->client->addParam($kparams, "user", $user->toParams()); + $this->client->queueServiceActionCall("user", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaUser"); + return $resultObject; + } + + /** + * Updates a user's login data: email, password, name. + * + * @param string $oldLoginId The user's current email address that identified the user for login + * @param string $password The user's current email address that identified the user for login + * @param string $newLoginId Optional, The user's email address that will identify the user for login + * @param string $newPassword Optional, The user's new password + * @param string $newFirstName Optional, The user's new first name + * @param string $newLastName Optional, The user's new last name + */ + function updateLoginData($oldLoginId, $password, $newLoginId = "", $newPassword = "", $newFirstName = null, $newLastName = null) + { + $kparams = array(); + $this->client->addParam($kparams, "oldLoginId", $oldLoginId); + $this->client->addParam($kparams, "password", $password); + $this->client->addParam($kparams, "newLoginId", $newLoginId); + $this->client->addParam($kparams, "newPassword", $newPassword); + $this->client->addParam($kparams, "newFirstName", $newFirstName); + $this->client->addParam($kparams, "newLastName", $newLastName); + $this->client->queueServiceActionCall("user", "updateLoginData", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaWidgetService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Add new widget, can be attached to entry or kshow + SourceWidget is ignored. + * + * @param KalturaWidget $widget + * @return KalturaWidget + */ + function add(KalturaWidget $widget) + { + $kparams = array(); + $this->client->addParam($kparams, "widget", $widget->toParams()); + $this->client->queueServiceActionCall("widget", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaWidget"); + return $resultObject; + } + + /** + * Add widget based on existing widget. + Must provide valid sourceWidgetId + * + * @param KalturaWidget $widget + * @return KalturaWidget + */ + function cloneAction(KalturaWidget $widget) + { + $kparams = array(); + $this->client->addParam($kparams, "widget", $widget->toParams()); + $this->client->queueServiceActionCall("widget", "clone", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaWidget"); + return $resultObject; + } + + /** + * Get widget by id + * + * @param string $id + * @return KalturaWidget + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("widget", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaWidget"); + return $resultObject; + } + + /** + * Retrieve a list of available widget depends on the filter given + * + * @param KalturaWidgetFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaWidgetListResponse + */ + function listAction(KalturaWidgetFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("widget", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaWidgetListResponse"); + return $resultObject; + } + + /** + * Update exisiting widget + * + * @param string $id + * @param KalturaWidget $widget + * @return KalturaWidget + */ + function update($id, KalturaWidget $widget) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "widget", $widget->toParams()); + $this->client->queueServiceActionCall("widget", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaWidget"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaClient extends KalturaClientBase +{ + /** + * Manage access control profiles + * @var KalturaAccessControlProfileService + */ + public $accessControlProfile = null; + + /** + * Add & Manage Access Controls + * @var KalturaAccessControlService + */ + public $accessControl = null; + + /** + * Manage details for the administrative user + * @var KalturaAdminUserService + */ + public $adminUser = null; + + /** + * Api for getting analytics data + * @var KalturaAnalyticsService + */ + public $analytics = null; + + /** + * Manage application authentication tokens + * @var KalturaAppTokenService + */ + public $appToken = null; + + /** + * Base Entry Service + * @var KalturaBaseEntryService + */ + public $baseEntry = null; + + /** + * Bulk upload service is used to upload & manage bulk uploads using CSV files. + * This service manages only entry bulk uploads. + * @var KalturaBulkUploadService + */ + public $bulkUpload = null; + + /** + * Add & Manage CategoryEntry - assign entry to category + * @var KalturaCategoryEntryService + */ + public $categoryEntry = null; + + /** + * Add & Manage Categories + * @var KalturaCategoryService + */ + public $category = null; + + /** + * Add & Manage CategoryUser - membership of a user in a category + * @var KalturaCategoryUserService + */ + public $categoryUser = null; + + /** + * Manage the connection between Conversion Profiles and Asset Params + * @var KalturaConversionProfileAssetParamsService + */ + public $conversionProfileAssetParams = null; + + /** + * Add & Manage Conversion Profiles + * @var KalturaConversionProfileService + */ + public $conversionProfile = null; + + /** + * Data service lets you manage data content (textual content) + * @var KalturaDataService + */ + public $data = null; + + /** + * Delivery service is used to control delivery objects + * @var KalturaDeliveryProfileService + */ + public $deliveryProfile = null; + + /** + * EmailIngestionProfile service lets you manage email ingestion profile records + * @var KalturaEmailIngestionProfileService + */ + public $EmailIngestionProfile = null; + + /** + * Base class for entry server node + * @var KalturaEntryServerNodeService + */ + public $entryServerNode = null; + + /** + * Manage file assets + * @var KalturaFileAssetService + */ + public $fileAsset = null; + + /** + * Retrieve information and invoke actions on Flavor Asset + * @var KalturaFlavorAssetService + */ + public $flavorAsset = null; + + /** + * Flavor Params Output service + * @var KalturaFlavorParamsOutputService + */ + public $flavorParamsOutput = null; + + /** + * Add & Manage Flavor Params + * @var KalturaFlavorParamsService + */ + public $flavorParams = null; + + /** + * Add & Manage GroupUser + * @var KalturaGroupUserService + */ + public $groupUser = null; + + /** + * Manage live channel segments + * @var KalturaLiveChannelSegmentService + */ + public $liveChannelSegment = null; + + /** + * Live Channel service lets you manage live channels + * @var KalturaLiveChannelService + */ + public $liveChannel = null; + + /** + * + * @var KalturaLiveReportsService + */ + public $liveReports = null; + + /** + * Stats Service + * @var KalturaLiveStatsService + */ + public $liveStats = null; + + /** + * Live Stream service lets you manage live stream entries + * @var KalturaLiveStreamService + */ + public $liveStream = null; + + /** + * Media Info service + * @var KalturaMediaInfoService + */ + public $mediaInfo = null; + + /** + * Media service lets you upload and manage media files (images / videos & audio) + * @var KalturaMediaService + */ + public $media = null; + + /** + * A Mix is an XML unique format invented by Kaltura, it allows the user to create a mix of videos and images, in and out points, transitions, text overlays, soundtrack, effects and much more... + * Mixing service lets you create a new mix, manage its metadata and make basic manipulations. + * @var KalturaMixingService + */ + public $mixing = null; + + /** + * Notification Service + * @var KalturaNotificationService + */ + public $notification = null; + + /** + * Partner service allows you to change/manage your partner personal details and settings as well + * @var KalturaPartnerService + */ + public $partner = null; + + /** + * PermissionItem service lets you create and manage permission items + * @var KalturaPermissionItemService + */ + public $permissionItem = null; + + /** + * Permission service lets you create and manage user permissions + * @var KalturaPermissionService + */ + public $permission = null; + + /** + * Playlist service lets you create,manage and play your playlists + * Playlists could be static (containing a fixed list of entries) or dynamic (baseed on a filter) + * @var KalturaPlaylistService + */ + public $playlist = null; + + /** + * Api for getting reports data by the report type and some inputFilter + * @var KalturaReportService + */ + public $report = null; + + /** + * Manage response profiles + * @var KalturaResponseProfileService + */ + public $responseProfile = null; + + /** + * Expose the schema definitions for syndication MRSS, bulk upload XML and other schema types. + * @var KalturaSchemaService + */ + public $schema = null; + + /** + * Search service allows you to search for media in various media providers + * This service is being used mostly by the CW component + * @var KalturaSearchService + */ + public $search = null; + + /** + * Server Node service + * @var KalturaServerNodeService + */ + public $serverNode = null; + + /** + * Session service + * @var KalturaSessionService + */ + public $session = null; + + /** + * Stats Service + * @var KalturaStatsService + */ + public $stats = null; + + /** + * Storage Profiles service + * @var KalturaStorageProfileService + */ + public $storageProfile = null; + + /** + * Add & Manage Syndication Feeds + * @var KalturaSyndicationFeedService + */ + public $syndicationFeed = null; + + /** + * System service is used for internal system helpers & to retrieve system level information + * @var KalturaSystemService + */ + public $system = null; + + /** + * Retrieve information and invoke actions on Thumb Asset + * @var KalturaThumbAssetService + */ + public $thumbAsset = null; + + /** + * Thumbnail Params Output service + * @var KalturaThumbParamsOutputService + */ + public $thumbParamsOutput = null; + + /** + * Add & Manage Thumb Params + * @var KalturaThumbParamsService + */ + public $thumbParams = null; + + /** + * UiConf service lets you create and manage your UIConfs for the various flash components + * This service is used by the KMC-ApplicationStudio + * @var KalturaUiConfService + */ + public $uiConf = null; + + /** + * + * @var KalturaUploadService + */ + public $upload = null; + + /** + * + * @var KalturaUploadTokenService + */ + public $uploadToken = null; + + /** + * + * @var KalturaUserEntryService + */ + public $userEntry = null; + + /** + * UserRole service lets you create and manage user roles + * @var KalturaUserRoleService + */ + public $userRole = null; + + /** + * Manage partner users on Kaltura's side + * The userId in kaltura is the unique Id in the partner's system, and the [partnerId,Id] couple are unique key in kaltura's DB + * @var KalturaUserService + */ + public $user = null; + + /** + * Widget service for full widget management + * @var KalturaWidgetService + */ + public $widget = null; + + /** + * Kaltura client constructor + * + * @param KalturaConfiguration $config + */ + public function __construct(KalturaConfiguration $config) + { + parent::__construct($config); + + $this->setClientTag('php5:18-04-26'); + $this->setApiVersion('3.3.0'); + + $this->accessControlProfile = new KalturaAccessControlProfileService($this); + $this->accessControl = new KalturaAccessControlService($this); + $this->adminUser = new KalturaAdminUserService($this); + $this->analytics = new KalturaAnalyticsService($this); + $this->appToken = new KalturaAppTokenService($this); + $this->baseEntry = new KalturaBaseEntryService($this); + $this->bulkUpload = new KalturaBulkUploadService($this); + $this->categoryEntry = new KalturaCategoryEntryService($this); + $this->category = new KalturaCategoryService($this); + $this->categoryUser = new KalturaCategoryUserService($this); + $this->conversionProfileAssetParams = new KalturaConversionProfileAssetParamsService($this); + $this->conversionProfile = new KalturaConversionProfileService($this); + $this->data = new KalturaDataService($this); + $this->deliveryProfile = new KalturaDeliveryProfileService($this); + $this->EmailIngestionProfile = new KalturaEmailIngestionProfileService($this); + $this->entryServerNode = new KalturaEntryServerNodeService($this); + $this->fileAsset = new KalturaFileAssetService($this); + $this->flavorAsset = new KalturaFlavorAssetService($this); + $this->flavorParamsOutput = new KalturaFlavorParamsOutputService($this); + $this->flavorParams = new KalturaFlavorParamsService($this); + $this->groupUser = new KalturaGroupUserService($this); + $this->liveChannelSegment = new KalturaLiveChannelSegmentService($this); + $this->liveChannel = new KalturaLiveChannelService($this); + $this->liveReports = new KalturaLiveReportsService($this); + $this->liveStats = new KalturaLiveStatsService($this); + $this->liveStream = new KalturaLiveStreamService($this); + $this->mediaInfo = new KalturaMediaInfoService($this); + $this->media = new KalturaMediaService($this); + $this->mixing = new KalturaMixingService($this); + $this->notification = new KalturaNotificationService($this); + $this->partner = new KalturaPartnerService($this); + $this->permissionItem = new KalturaPermissionItemService($this); + $this->permission = new KalturaPermissionService($this); + $this->playlist = new KalturaPlaylistService($this); + $this->report = new KalturaReportService($this); + $this->responseProfile = new KalturaResponseProfileService($this); + $this->schema = new KalturaSchemaService($this); + $this->search = new KalturaSearchService($this); + $this->serverNode = new KalturaServerNodeService($this); + $this->session = new KalturaSessionService($this); + $this->stats = new KalturaStatsService($this); + $this->storageProfile = new KalturaStorageProfileService($this); + $this->syndicationFeed = new KalturaSyndicationFeedService($this); + $this->system = new KalturaSystemService($this); + $this->thumbAsset = new KalturaThumbAssetService($this); + $this->thumbParamsOutput = new KalturaThumbParamsOutputService($this); + $this->thumbParams = new KalturaThumbParamsService($this); + $this->uiConf = new KalturaUiConfService($this); + $this->upload = new KalturaUploadService($this); + $this->uploadToken = new KalturaUploadTokenService($this); + $this->userEntry = new KalturaUserEntryService($this); + $this->userRole = new KalturaUserRoleService($this); + $this->user = new KalturaUserService($this); + $this->widget = new KalturaWidgetService($this); + } + + /** + * @param string $clientTag + */ + public function setClientTag($clientTag) + { + $this->clientConfiguration['clientTag'] = $clientTag; + } + + /** + * @return string + */ + public function getClientTag() + { + if(isset($this->clientConfiguration['clientTag'])) + { + return $this->clientConfiguration['clientTag']; + } + + return null; + } + + /** + * @param string $apiVersion + */ + public function setApiVersion($apiVersion) + { + $this->clientConfiguration['apiVersion'] = $apiVersion; + } + + /** + * @return string + */ + public function getApiVersion() + { + if(isset($this->clientConfiguration['apiVersion'])) + { + return $this->clientConfiguration['apiVersion']; + } + + return null; + } + + /** + * Impersonated partner id + * + * @param int $partnerId + */ + public function setPartnerId($partnerId) + { + $this->requestConfiguration['partnerId'] = $partnerId; + } + + /** + * Impersonated partner id + * + * @return int + */ + public function getPartnerId() + { + if(isset($this->requestConfiguration['partnerId'])) + { + return $this->requestConfiguration['partnerId']; + } + + return null; + } + + /** + * Kaltura API session + * + * @param string $ks + */ + public function setKs($ks) + { + $this->requestConfiguration['ks'] = $ks; + } + + /** + * Kaltura API session + * + * @return string + */ + public function getKs() + { + if(isset($this->requestConfiguration['ks'])) + { + return $this->requestConfiguration['ks']; + } + + return null; + } + + /** + * Kaltura API session + * + * @param string $sessionId + */ + public function setSessionId($sessionId) + { + $this->requestConfiguration['ks'] = $sessionId; + } + + /** + * Kaltura API session + * + * @return string + */ + public function getSessionId() + { + if(isset($this->requestConfiguration['ks'])) + { + return $this->requestConfiguration['ks']; + } + + return null; + } + + /** + * Response profile - this attribute will be automatically unset after every API call. + * + * @param KalturaBaseResponseProfile $responseProfile + */ + public function setResponseProfile(KalturaBaseResponseProfile $responseProfile) + { + $this->requestConfiguration['responseProfile'] = $responseProfile; + } + + /** + * Response profile - this attribute will be automatically unset after every API call. + * + * @return KalturaBaseResponseProfile + */ + public function getResponseProfile() + { + if(isset($this->requestConfiguration['responseProfile'])) + { + return $this->requestConfiguration['responseProfile']; + } + + return null; + } + + /** + * Clear all volatile configuration parameters + */ + protected function resetRequest() + { + parent::resetRequest(); + unset($this->requestConfiguration['responseProfile']); + } +} + diff --git a/local/kaltura/API/KalturaClientBase.php b/local/kaltura/API/KalturaClientBase.php new file mode 100644 index 0000000000000..3f8fd89263392 --- /dev/null +++ b/local/kaltura/API/KalturaClientBase.php @@ -0,0 +1,1455 @@ +. +// +// @ignore +// =================================================================================================== + +/** + * @package Kaltura + * @subpackage Client + */ +class MultiRequestSubResult implements ArrayAccess +{ + function __construct($value) + { + $this->value = $value; + } + + function __toString() + { + return '{' . $this->value . '}'; + } + + function __get($name) + { + return new MultiRequestSubResult($this->value . ':' . $name); + } + + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + return true; + } + + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return new MultiRequestSubResult($this->value . ':' . $offset); + } + + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + } + + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaNull +{ + private static $instance; + + private function __construct() + { + + } + + public static function getInstance() + { + if (!isset(self::$instance)) { + $c = __CLASS__; + self::$instance = new $c(); + } + return self::$instance; + } + + function __toString() + { + return ''; + } + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaClientBase +{ + const KALTURA_SERVICE_FORMAT_JSON = 1; + const KALTURA_SERVICE_FORMAT_XML = 2; + const KALTURA_SERVICE_FORMAT_PHP = 3; + + // KS V2 constants + const RANDOM_SIZE = 16; + + const FIELD_EXPIRY = '_e'; + const FIELD_TYPE = '_t'; + const FIELD_USER = '_u'; + + const METHOD_POST = 'POST'; + const METHOD_GET = 'GET'; + + /** + * @var KalturaConfiguration + */ + protected $config; + + /** + * @var array + */ + protected $clientConfiguration = array(); + + /** + * @var array + */ + protected $requestConfiguration = array(); + + /** + * @var boolean + */ + private $shouldLog = false; + + /** + * @var bool + */ + private $isMultiRequest = false; + + /** + * @var unknown_type + */ + private $callsQueue = array(); + + /** + * Array of all plugin services + * + * @var array + */ + protected $pluginServices = array(); + + /** + * @var Array of response headers + */ + private $responseHeaders = array(); + + /** + * path to save served results + * @var string + */ + protected $destinationPath = null; + + /** + * return served results without unserializing them + * @var boolean + */ + protected $returnServedResult = null; + + public function __get($serviceName) + { + if(isset($this->pluginServices[$serviceName])) + return $this->pluginServices[$serviceName]; + + return null; + } + + /** + * Kaltura client constructor + * + * @param KalturaConfiguration $config + */ + public function __construct(KalturaConfiguration $config) + { + $this->config = $config; + + $logger = $this->config->getLogger(); + if ($logger) + { + $this->shouldLog = true; + } + + // load all plugins + $pluginsFolder = realpath(dirname(__FILE__)) . '/KalturaPlugins'; + if(is_dir($pluginsFolder)) + { + $dir = dir($pluginsFolder); + while (false !== $fileName = $dir->read()) + { + $matches = null; + if(preg_match('/^([^.]+).php$/', $fileName, $matches)) + { + require_once("$pluginsFolder/$fileName"); + + $pluginClass = $matches[1]; + if(!class_exists($pluginClass) || !in_array('IKalturaClientPlugin', class_implements($pluginClass))) + continue; + + $plugin = call_user_func(array($pluginClass, 'get'), $this); + if(!($plugin instanceof IKalturaClientPlugin)) + continue; + + $pluginName = $plugin->getName(); + $services = $plugin->getServices(); + foreach($services as $serviceName => $service) + { + $service->setClient($this); + $this->pluginServices[$serviceName] = $service; + } + } + } + } + } + + /* Store response headers into array */ + public function readHeader($ch, $string) + { + array_push($this->responseHeaders, $string); + return strlen($string); + } + + /* Retrive response headers */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + public function getServeUrl() + { + if (count($this->callsQueue) != 1) + return null; + + $params = array(); + $files = array(); + $this->log("service url: [" . $this->config->serviceUrl . "]"); + + // append the basic params + $this->addParam($params, "format", $this->config->format); + + foreach($this->clientConfiguration as $param => $value) + { + $this->addParam($params, $param, $value); + } + + $call = $this->callsQueue[0]; + $this->resetRequest(); + + $params = array_merge($params, $call->params); + $signature = $this->signature($params); + $this->addParam($params, "kalsig", $signature); + + $url = $this->config->serviceUrl . "/api_v3/service/{$call->service}/action/{$call->action}"; + $url .= '?' . http_build_query($params); + $this->log("Returned url [$url]"); + return $url; + } + + public function queueServiceActionCall($service, $action, $params = array(), $files = array()) + { + foreach($this->requestConfiguration as $param => $value) + { + $this->addParam($params, $param, $value); + } + + $call = new KalturaServiceActionCall($service, $action, $params, $files); + $this->callsQueue[] = $call; + } + + protected function resetRequest() + { + $this->destinationPath = null; + $this->returnServedResult = false; + $this->isMultiRequest = false; + $this->callsQueue = array(); + } + + /** + * Call all API service that are in queue + * + * @return unknown + */ + public function doQueue() + { + if($this->isMultiRequest && ($this->destinationPath || $this->returnServedResult)) + { + $this->resetRequest(); + throw new KalturaClientException("Downloading files is not supported as part of multi-request.", KalturaClientException::ERROR_DOWNLOAD_IN_MULTIREQUEST); + } + + if (count($this->callsQueue) == 0) + { + $this->resetRequest(); + return null; + } + + $startTime = microtime(true); + + $params = array(); + $files = array(); + $this->log("service url: [" . $this->config->serviceUrl . "]"); + + // append the basic params + $this->addParam($params, "format", $this->config->format); + $this->addParam($params, "ignoreNull", true); + + foreach($this->clientConfiguration as $param => $value) + { + $this->addParam($params, $param, $value); + } + + $url = $this->config->serviceUrl."/api_v3/service"; + if ($this->isMultiRequest) + { + $url .= "/multirequest"; + $i = 0; + foreach ($this->callsQueue as $call) + { + $callParams = $call->getParamsForMultiRequest($i); + $callFiles = $call->getFilesForMultiRequest($i); + $params = array_merge($params, $callParams); + $files = array_merge($files, $callFiles); + $i++; + } + } + else + { + $call = $this->callsQueue[0]; + $url .= "/{$call->service}/action/{$call->action}"; + $params = array_merge($params, $call->params); + $files = $call->files; + } + + $signature = $this->signature($params); + $this->addParam($params, "kalsig", $signature); + + try + { + list($postResult, $error) = $this->doHttpRequest($url, $params, $files); + } + catch(Exception $e) + { + $this->resetRequest(); + throw $e; + } + + if ($error) + { + $this->resetRequest(); + throw new KalturaClientException($error, KalturaClientException::ERROR_GENERIC); + } + else + { + // print server debug info to log + $serverName = null; + $serverSession = null; + foreach ($this->responseHeaders as $curHeader) + { + $splittedHeader = explode(':', $curHeader, 2); + if ($splittedHeader[0] == 'X-Me') + $serverName = trim($splittedHeader[1]); + else if ($splittedHeader[0] == 'X-Kaltura-Session') + $serverSession = trim($splittedHeader[1]); + } + if (!is_null($serverName) || !is_null($serverSession)) + $this->log("server: [{$serverName}], session: [{$serverSession}]"); + + $this->log("result (serialized): " . $postResult); + + if($this->returnServedResult) + { + $result = $postResult; + } + elseif($this->destinationPath) + { + if(!$postResult) + { + $this->resetRequest(); + throw new KalturaClientException("failed to download file", KalturaClientException::ERROR_READ_FAILED); + } + } + elseif ($this->config->format == self::KALTURA_SERVICE_FORMAT_PHP) + { + $result = @unserialize($postResult); + + if ($result === false && serialize(false) !== $postResult) + { + $this->resetRequest(); + throw new KalturaClientException("failed to unserialize server result\n$postResult", KalturaClientException::ERROR_UNSERIALIZE_FAILED); + } + $dump = print_r($result, true); + $this->log("result (object dump): " . $dump); + } + elseif ($this->config->format == self::KALTURA_SERVICE_FORMAT_JSON) + { + $result = json_decode($postResult); + if(is_null($result) && strtolower($postResult) !== 'null') + { + $this->resetRequest(); + throw new KalturaClientException("failed to unserialize server result\n$postResult", KalturaClientException::ERROR_UNSERIALIZE_FAILED); + } + $result = $this->jsObjectToClientObject($result); + $dump = print_r($result, true); + $this->log("result (object dump): " . $dump); + } + else + { + $this->resetRequest(); + throw new KalturaClientException("unsupported format: $postResult", KalturaClientException::ERROR_FORMAT_NOT_SUPPORTED); + } + } + $this->resetRequest(); + + $endTime = microtime (true); + + $this->log("execution time for [".$url."]: [" . ($endTime - $startTime) . "]"); + + return $result; + } + + /** + * Sorts array recursively + * + * @param array $params + * @param int $flags + * @return boolean + */ + protected function ksortRecursive(&$array, $flags = null) + { + ksort($array, $flags); + foreach($array as &$arr) { + if(is_array($arr)) + $this->ksortRecursive($arr, $flags); + } + return true; + } + + /** + * Sign array of parameters + * + * @param array $params + * @return string + */ + private function signature($params) + { + $this->ksortRecursive($params); + return md5($this->jsonEncode($params)); + } + + /** + * Send http request by using curl (if available) or php stream_context + * + * @param string $url + * @param parameters $params + * @return array of result and error + */ + protected function doHttpRequest($url, $params = array(), $files = array()) + { + if (function_exists('curl_init')) + return $this->doCurl($url, $params, $files); + + if($this->destinationPath || $this->returnServedResult) + throw new KalturaClientException("Downloading files is not supported with stream context http request, please use curl.", KalturaClientException::ERROR_DOWNLOAD_NOT_SUPPORTED); + + return $this->doPostRequest($url, $params, $files); + } + + /** + * Curl HTTP POST Request + * + * @param string $url + * @param array $params + * @param array $files + * @return array of result and error + */ + private function doCurl($url, $params = array(), $files = array()) + { + $requestHeaders = $this->config->requestHeaders; + + $params = $this->jsonEncode($params); + $this->log("curl: $url"); + $this->log("post: $params"); + if($this->config->format == self::KALTURA_SERVICE_FORMAT_JSON) + { + $requestHeaders[] = 'Accept: application/json'; + } + + $this->responseHeaders = array(); + $cookies = array(); + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + if($this->config->method == self::METHOD_POST) { + curl_setopt($ch, CURLOPT_POST, 1); + if (count($files) > 0) + { + $params = array('json' => $params); + foreach ($files as $key => $file) { + // The usage of the @filename API for file uploading is + // deprecated since PHP 5.5. CURLFile must be used instead. + if (PHP_VERSION_ID >= 50500) { + $params[$key] = new \CURLFile($file); + } else { + $params[$key] = "@" . $file; // let curl know its a file + } + } + curl_setopt($ch, CURLOPT_POSTFIELDS, $params); + } + else + { + $requestHeaders[] = 'Content-Type: application/json'; + curl_setopt($ch, CURLOPT_POSTFIELDS, $params); + } + } + curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); + curl_setopt($ch, CURLOPT_USERAGENT, $this->config->userAgent); + if (count($files) > 0) + curl_setopt($ch, CURLOPT_TIMEOUT, 0); + else + curl_setopt($ch, CURLOPT_TIMEOUT, $this->config->curlTimeout); + + if ($this->config->startZendDebuggerSession === true) + { + $zendDebuggerParams = $this->getZendDebuggerParams($url); + $cookies = array_merge($cookies, $zendDebuggerParams); + } + + if (count($cookies) > 0) + { + $cookiesStr = http_build_query($cookies, null, '; '); + curl_setopt($ch, CURLOPT_COOKIE, $cookiesStr); + } + + if (isset($this->config->proxyHost)) { + curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true); + curl_setopt($ch, CURLOPT_PROXY, $this->config->proxyHost); + if (isset($this->config->proxyPort)) { + curl_setopt($ch, CURLOPT_PROXYPORT, $this->config->proxyPort); + } + if (isset($this->config->proxyUser)) { + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->config->proxyUser.':'.$this->config->proxyPassword); + } + if (isset($this->config->proxyType) && $this->config->proxyType === 'SOCKS5') { + curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); + } + } + + // Set SSL verification + if(!$this->getConfig()->verifySSL) + { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + } + elseif($this->getConfig()->sslCertificatePath) + { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_CAINFO, $this->getConfig()->sslCertificatePath); + } + + // Set custom headers + curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders); + + // Save response headers + curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 'readHeader') ); + + $destinationResource = null; + if($this->destinationPath) + { + $destinationResource = fopen($this->destinationPath, "wb"); + curl_setopt($ch, CURLOPT_FILE, $destinationResource); + } + else + { + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + } + + $result = curl_exec($ch); + + if($destinationResource) + fclose($destinationResource); + + $curlError = curl_error($ch); + curl_close($ch); + return array($result, $curlError); + } + + /** + * HTTP stream context request + * + * @param string $url + * @param array $params + * @return array of result and error + */ + private function doPostRequest($url, $params = array(), $files = array()) + { + if (count($files) > 0) + throw new KalturaClientException("Uploading files is not supported with stream context http request, please use curl.", KalturaClientException::ERROR_UPLOAD_NOT_SUPPORTED); + + $formattedData = http_build_query($params , "", "&"); + $this->log("post: $url?$formattedData"); + + $params = array('http' => array( + "method" => "POST", + "User-Agent: " . $this->config->userAgent . "\r\n". + "Accept-language: en\r\n". + "Content-type: application/x-www-form-urlencoded\r\n", + "content" => $formattedData + )); + + if (isset($this->config->proxyType) && $this->config->proxyType === 'SOCKS5') { + throw new KalturaClientException("Cannot use SOCKS5 without curl installed.", KalturaClientException::ERROR_CONNECTION_FAILED); + } + if (isset($this->config->proxyHost)) { + $proxyhost = 'tcp://' . $this->config->proxyHost; + if (isset($this->config->proxyPort)) { + $proxyhost = $proxyhost . ":" . $this->config->proxyPort; + } + $params['http']['proxy'] = $proxyhost; + $params['http']['request_fulluri'] = true; + if (isset($this->config->proxyUser)) { + $auth = base64_encode($this->config->proxyUser.':'.$this->config->proxyPassword); + $params['http']['header'] = 'Proxy-Authorization: Basic ' . $auth; + } + } + + $ctx = stream_context_create($params); + $fp = @fopen($url, 'rb', false, $ctx); + if (!$fp) { + $phpErrorMsg = ""; + throw new KalturaClientException("Problem with $url, $phpErrorMsg", KalturaClientException::ERROR_CONNECTION_FAILED); + } + $response = @stream_get_contents($fp); + if ($response === false) { + throw new KalturaClientException("Problem reading data from $url, $phpErrorMsg", KalturaClientException::ERROR_READ_FAILED); + } + return array($response, ''); + } + + /** + * @param boolean $returnServedResult + */ + public function setReturnServedResult($returnServedResult) + { + $this->returnServedResult = $returnServedResult; + } + + /** + * @return boolean + */ + public function getReturnServedResult() + { + return $this->returnServedResult; + } + + /** + * @param string $destinationPath + */ + public function setDestinationPath($destinationPath) + { + $this->destinationPath = $destinationPath; + } + + /** + * @return string + */ + public function getDestinationPath() + { + return $this->destinationPath; + } + + /** + * @return KalturaConfiguration + */ + public function getConfig() + { + return $this->config; + } + + /** + * @param KalturaConfiguration $config + */ + public function setConfig(KalturaConfiguration $config) + { + $this->config = $config; + + $logger = $this->config->getLogger(); + if ($logger instanceof IKalturaLogger) + { + $this->shouldLog = true; + } + } + + public function setClientConfiguration(KalturaClientConfiguration $configuration) + { + $params = get_class_vars('KalturaClientConfiguration'); + foreach($params as $param => $value) + { + if(is_null($configuration->$param)) + { + if(isset($this->clientConfiguration[$param])) + { + unset($this->clientConfiguration[$param]); + } + } + else + { + $this->clientConfiguration[$param] = $configuration->$param; + } + } + } + + public function setRequestConfiguration(KalturaRequestConfiguration $configuration) + { + $params = get_class_vars('KalturaRequestConfiguration'); + foreach($params as $param => $value) + { + if(is_null($configuration->$param)) + { + if(isset($this->requestConfiguration[$param])) + { + unset($this->requestConfiguration[$param]); + } + } + else + { + $this->requestConfiguration[$param] = $configuration->$param; + } + } + } + + /** + * Add parameter to array of parameters that is passed by reference + * + * @param array $params + * @param string $paramName + * @param string $paramValue + */ + public function addParam(array &$params, $paramName, $paramValue) + { + if ($paramValue === null) + return; + + if ($paramValue instanceof KalturaNull) { + $params[$paramName . '__null'] = ''; + return; + } + + if(is_object($paramValue) && $paramValue instanceof KalturaObjectBase) + { + $params[$paramName] = array( + 'objectType' => get_class($paramValue) + ); + + foreach($paramValue as $prop => $val) + $this->addParam($params[$paramName], $prop, $val); + + return; + } + + if(is_bool($paramValue)) + { + $params[$paramName] = $paramValue; + return; + } + + if(!is_array($paramValue)) + { + $params[$paramName] = (string)$paramValue; + return; + } + + $params[$paramName] = array(); + if ($paramValue) + { + foreach($paramValue as $subParamName => $subParamValue) + $this->addParam($params[$paramName], $subParamName, $subParamValue); + } + else + { + $params[$paramName]['-'] = ''; + } + } + + /** + * @param mixed $value + * @return mixed + */ + public function jsObjectToClientObject($value) + { + if(is_array($value)) + { + foreach($value as &$item) + { + $item = $this->jsObjectToClientObject($item); + } + } + + if(is_object($value)) + { + if(isset($value->message) && isset($value->code)) + { + if($this->isMultiRequest) + { + if(isset($value->args)) + { + $value->args = (array) $value->args; + } + return (array) $value; + } + throw new KalturaException($value->message, $value->code, $value->args); + } + + if(!isset($value->objectType)) + { + throw new KalturaClientException("Response format not supported - objectType is required for all objects", KalturaClientException::ERROR_FORMAT_NOT_SUPPORTED); + } + + $objectType = $value->objectType; + $object = new $objectType(); + $attributes = get_object_vars($value); + foreach($attributes as $attribute => $attributeValue) + { + if($attribute === 'objectType') + { + continue; + } + + $object->$attribute = $this->jsObjectToClientObject($attributeValue); + } + + $value = $object; + } + + return $value; + } + + /** + * Encodes objects + * @param mixed $value + * @return string + */ + public function jsonEncode($value) + { + return json_encode($this->unsetNull($value)); + } + + protected function unsetNull($object) + { + if(!is_array($object) && !is_object($object)) + return $object; + + if(is_object($object) && $object instanceof MultiRequestSubResult) + return "$object"; + + $array = (array) $object; + foreach($array as $key => $value) + { + if(is_null($value)) + { + unset($array[$key]); + } + else + { + $array[$key] = $this->unsetNull($value); + } + } + + if(is_object($object)) + $array['objectType'] = get_class($object); + + return $array; + } + + /** + * Validate the result object and throw exception if its an error + * + * @param object $resultObject + */ + public function throwExceptionIfError($resultObject) + { + if ($this->isError($resultObject)) + { + throw new KalturaException($resultObject["message"], $resultObject["code"], $resultObject["args"]); + } + } + + /** + * Checks whether the result object is an error + * + * @param object $resultObject + */ + public function isError($resultObject) + { + return (is_array($resultObject) && isset($resultObject["message"]) && isset($resultObject["code"])); + } + + /** + * Validate that the passed object type is of the expected type + * + * @param any $resultObject + * @param string $objectType + */ + public function validateObjectType($resultObject, $objectType) + { + $knownNativeTypes = array("boolean", "integer", "double", "string"); + if (is_null($resultObject) || + ( in_array(gettype($resultObject) ,$knownNativeTypes) && + in_array($objectType, $knownNativeTypes) ) ) + { + return;// we do not check native simple types + } + else if ( is_object($resultObject) ) + { + if (!($resultObject instanceof $objectType)) + { + throw new KalturaClientException("Invalid object type - not instance of $objectType", KalturaClientException::ERROR_INVALID_OBJECT_TYPE); + } + } + else if(class_exists($objectType) && is_subclass_of($objectType, 'KalturaEnumBase')) + { + $enum = new ReflectionClass($objectType); + $values = array_map('strval', $enum->getConstants()); + if(!in_array($resultObject, $values)) + { + throw new KalturaClientException("Invalid enum value", KalturaClientException::ERROR_INVALID_ENUM_VALUE); + } + } + else if(gettype($resultObject) !== $objectType) + { + throw new KalturaClientException("Invalid object type", KalturaClientException::ERROR_INVALID_OBJECT_TYPE); + } + } + + + public function startMultiRequest() + { + $this->isMultiRequest = true; + } + + public function doMultiRequest() + { + return $this->doQueue(); + } + + public function isMultiRequest() + { + return $this->isMultiRequest; + } + + public function getMultiRequestQueueSize() + { + return count($this->callsQueue); + } + + public function getMultiRequestResult() + { + return new MultiRequestSubResult($this->getMultiRequestQueueSize() . ':result'); + } + + /** + * @param string $msg + */ + protected function log($msg) + { + if ($this->shouldLog) + $this->config->getLogger()->log($msg); + } + + /** + * Return a list of parameter used to a new start debug on the destination server api + * @link http://kb.zend.com/index.php?View=entry&EntryID=434 + * @param $url + */ + protected function getZendDebuggerParams($url) + { + $params = array(); + $passThruParams = array('debug_host', + 'debug_fastfile', + 'debug_port', + 'start_debug', + 'send_debug_header', + 'send_sess_end', + 'debug_jit', + 'debug_stop', + 'use_remote'); + + foreach($passThruParams as $param) + { + if (isset($_COOKIE[$param])) + $params[$param] = $_COOKIE[$param]; + } + + $params['original_url'] = $url; + $params['debug_session_id'] = microtime(true); // to create a new debug session + + return $params; + } + + public function generateSession($adminSecretForSigning, $userId, $type, $partnerId, $expiry = 86400, $privileges = '') + { + $rand = rand(0, 32000); + $expiry = time()+$expiry; + $fields = array ( + $partnerId , + $partnerId , + $expiry , + $type, + $rand , + $userId , + $privileges + ); + $info = implode ( ";" , $fields ); + + $signature = $this->hash ( $adminSecretForSigning , $info ); + $strToHash = $signature . "|" . $info ; + $encoded_str = base64_encode( $strToHash ); + + return $encoded_str; + } + + public static function generateSessionV2($adminSecretForSigning, $userId, $type, $partnerId, $expiry, $privileges) + { + // build fields array + $fields = array(); + foreach (explode(',', $privileges) as $privilege) + { + $privilege = trim($privilege); + if (!$privilege) + continue; + if ($privilege == '*') + $privilege = 'all:*'; + $splittedPrivilege = explode(':', $privilege, 2); + if (count($splittedPrivilege) > 1) + $fields[$splittedPrivilege[0]] = $splittedPrivilege[1]; + else + $fields[$splittedPrivilege[0]] = ''; + } + $fields[self::FIELD_EXPIRY] = time() + $expiry; + $fields[self::FIELD_TYPE] = $type; + $fields[self::FIELD_USER] = $userId; + + // build fields string + $fieldsStr = http_build_query($fields, '', '&'); + $rand = ''; + for ($i = 0; $i < self::RANDOM_SIZE; $i++) + $rand .= chr(rand(0, 0xff)); + $fieldsStr = $rand . $fieldsStr; + $fieldsStr = sha1($fieldsStr, true) . $fieldsStr; + + // encrypt and encode + $encryptedFields = self::aesEncrypt($adminSecretForSigning, $fieldsStr); + $decodedKs = "v2|{$partnerId}|" . $encryptedFields; + return str_replace(array('+', '/'), array('-', '_'), base64_encode($decodedKs)); + } + + protected static function aesEncrypt($key, $message) + { + $iv = str_repeat("\0", 16); // no need for an IV since we add a random string to the message anyway + $key = substr(sha1($key, true), 0, 16); + if (function_exists('mcrypt_encrypt')) { + return mcrypt_encrypt( + MCRYPT_RIJNDAEL_128, + $key, + $message, + MCRYPT_MODE_CBC, + $iv + ); + }else { + // Pad with null byte to be compatible with mcrypt PKCS#5 padding + // See http://thefsb.tumblr.com/post/110749271235/using-opensslendecrypt-in-php-instead-of as reference + $blockSize = 16; + if (strlen($message) % $blockSize) { + $padLength = $blockSize - strlen($message) % $blockSize; + $message .= str_repeat("\0", $padLength); + } + return openssl_encrypt( + $message, + 'AES-128-CBC', + $key, + OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, + $iv + ); + } + } + + private function hash ( $salt , $str ) + { + return sha1($salt.$str); + } + + /** + * @return KalturaNull + */ + public static function getKalturaNullValue() + { + + return KalturaNull::getInstance(); + } + +} + +/** + * @package Kaltura + * @subpackage Client + */ +interface IKalturaClientPlugin +{ + /** + * @return KalturaClientPlugin + */ + public static function get(KalturaClient $client); + + /** + * @return array + */ + public function getServices(); + + /** + * @return string + */ + public function getName(); +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaClientPlugin implements IKalturaClientPlugin +{ + protected function __construct(KalturaClient $client) + { + + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaServiceActionCall +{ + /** + * @var string + */ + public $service; + + /** + * @var string + */ + public $action; + + + /** + * @var array + */ + public $params; + + /** + * @var array + */ + public $files; + + /** + * Contruct new Kaltura service action call, if params array contain sub arrays (for objects), it will be flattened + * + * @param string $service + * @param string $action + * @param array $params + * @param array $files + */ + public function __construct($service, $action, $params = array(), $files = array()) + { + $this->service = $service; + $this->action = $action; + $this->params = $this->parseParams($params); + $this->files = $files; + } + + /** + * Parse params array and sub arrays (for objects) + * + * @param array $params + */ + public function parseParams(array $params) + { + $newParams = array(); + foreach($params as $key => $val) + { + if (is_array($val)) + { + $newParams[$key] = $this->parseParams($val); + } + else + { + $newParams[$key] = $val; + } + } + return $newParams; + } + + /** + * Return the parameters for a multi request + * + * @param int $multiRequestIndex + */ + public function getParamsForMultiRequest($multiRequestIndex) + { + $multiRequestParams = array(); + $multiRequestParams[$multiRequestIndex]['service'] = $this->service; + $multiRequestParams[$multiRequestIndex]['action'] = $this->action; + foreach($this->params as $key => $val) + { + $multiRequestParams[$multiRequestIndex][$key] = $val; + } + return $multiRequestParams; + } + + /** + * Return the parameters for a multi request + * + * @param int $multiRequestIndex + */ + public function getFilesForMultiRequest($multiRequestIndex) + { + $multiRequestParams = array(); + foreach($this->files as $key => $val) + { + $multiRequestParams["$multiRequestIndex:$key"] = $val; + } + return $multiRequestParams; + } +} + +/** + * Abstract base class for all client services + * + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaServiceBase +{ + /** + * @var KalturaClient + */ + protected $client; + + /** + * Initialize the service keeping reference to the KalturaClient + * + * @param KalturaClient $client + */ + public function __construct(KalturaClient $client = null) + { + $this->client = $client; + } + + /** + * @param KalturaClient $client + */ + public function setClient(KalturaClient $client) + { + $this->client = $client; + } +} + +/** + * Abstract base class for all client enums + * + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaEnumBase +{ +} + +/** + * Abstract base class for all client objects + * + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaObjectBase +{ + /** + * @var array + */ + public $relatedObjects; + + public function __construct($params = array()) + { + foreach ($params as $key => $value) + { + if (!property_exists($this, $key)) + throw new KalturaClientException("property [{$key}] does not exist on object [".get_class($this)."]", KalturaClientException::ERROR_INVALID_OBJECT_FIELD); + $this->$key = $value; + } + } + + protected function addIfNotNull(&$params, $paramName, $paramValue) + { + if ($paramValue !== null) + { + if($paramValue instanceof KalturaObjectBase) + { + $params[$paramName] = $paramValue->toParams(); + } + else + { + $params[$paramName] = $paramValue; + } + } + } + + public function toParams() + { + $params = array(); + $params["objectType"] = get_class($this); + foreach($this as $prop => $val) + { + $this->addIfNotNull($params, $prop, $val); + } + return $params; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaException extends Exception +{ + private $arguments; + + public function __construct($message, $code, $arguments) + { + $this->code = $code; + $this->arguments = $arguments; + + parent::__construct($message); + } + + /** + * @return array + */ + public function getArguments() + { + return $this->arguments; + } + + /** + * @return string + */ + public function getArgument($argument) + { + if($this->arguments && isset($this->arguments[$argument])) + { + return $this->arguments[$argument]; + } + + return null; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaClientException extends Exception +{ + const ERROR_GENERIC = -1; + const ERROR_UNSERIALIZE_FAILED = -2; + const ERROR_FORMAT_NOT_SUPPORTED = -3; + const ERROR_UPLOAD_NOT_SUPPORTED = -4; + const ERROR_CONNECTION_FAILED = -5; + const ERROR_READ_FAILED = -6; + const ERROR_INVALID_PARTNER_ID = -7; + const ERROR_INVALID_OBJECT_TYPE = -8; + const ERROR_INVALID_OBJECT_FIELD = -9; + const ERROR_DOWNLOAD_NOT_SUPPORTED = -10; + const ERROR_DOWNLOAD_IN_MULTIREQUEST = -11; + const ERROR_ACTION_IN_MULTIREQUEST = -12; + const ERROR_INVALID_ENUM_VALUE = -13; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConfiguration +{ + private $logger; + + public $serviceUrl = "http://www.kaltura.com/"; + public $format = KalturaClientBase::KALTURA_SERVICE_FORMAT_PHP; + public $curlTimeout = 120; + public $userAgent = ''; + public $startZendDebuggerSession = false; + public $proxyHost = null; + public $proxyPort = null; + public $proxyType = 'HTTP'; + public $proxyUser = null; + public $proxyPassword = ''; + public $verifySSL = true; + public $sslCertificatePath = null; + public $requestHeaders = array(); + public $method = KalturaClientBase::METHOD_POST; + + /** + * Set logger to get kaltura client debug logs + * + * @param IKalturaLogger $log + */ + public function setLogger(IKalturaLogger $log) + { + $this->logger = $log; + } + + /** + * Gets the logger (Internal client use) + * + * @return IKalturaLogger + */ + public function getLogger() + { + return $this->logger; + } +} + +/** + * Implement to get Kaltura Client logs + * + * @package Kaltura + * @subpackage Client + */ +interface IKalturaLogger +{ + function log($msg); +} + + diff --git a/local/kaltura/API/KalturaEnums.php b/local/kaltura/API/KalturaEnums.php new file mode 100644 index 0000000000000..7de659618c3e8 --- /dev/null +++ b/local/kaltura/API/KalturaEnums.php @@ -0,0 +1,4966 @@ +. +// +// @ignore +// =================================================================================================== + +/** + * @package Kaltura + * @subpackage Client + */ +require_once(dirname(__FILE__) . "/KalturaClientBase.php"); + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAppTokenStatus extends KalturaEnumBase +{ + const DISABLED = 1; + const ACTIVE = 2; + const DELETED = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAppearInListType extends KalturaEnumBase +{ + const PARTNER_ONLY = 1; + const CATEGORY_MEMBERS_ONLY = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetParamsDeletePolicy extends KalturaEnumBase +{ + const KEEP = 0; + const DELETE = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetParamsOrigin extends KalturaEnumBase +{ + const CONVERT = 0; + const INGEST = 1; + const CONVERT_WHEN_MISSING = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchJobErrorTypes extends KalturaEnumBase +{ + const APP = 0; + const RUNTIME = 1; + const HTTP = 2; + const CURL = 3; + const KALTURA_API = 4; + const KALTURA_CLIENT = 5; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchJobStatus extends KalturaEnumBase +{ + const PENDING = 0; + const QUEUED = 1; + const PROCESSING = 2; + const PROCESSED = 3; + const MOVEFILE = 4; + const FINISHED = 5; + const FAILED = 6; + const ABORTED = 7; + const ALMOST_DONE = 8; + const RETRY = 9; + const FATAL = 10; + const DONT_PROCESS = 11; + const FINISHED_PARTIALLY = 12; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBitRateMode extends KalturaEnumBase +{ + const CBR = 1; + const VBR = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryEntryStatus extends KalturaEnumBase +{ + const PENDING = 1; + const ACTIVE = 2; + const DELETED = 3; + const REJECTED = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryStatus extends KalturaEnumBase +{ + const UPDATING = 1; + const ACTIVE = 2; + const DELETED = 3; + const PURGED = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryUserPermissionLevel extends KalturaEnumBase +{ + const MANAGER = 0; + const MODERATOR = 1; + const CONTRIBUTOR = 2; + const MEMBER = 3; + const NONE = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryUserStatus extends KalturaEnumBase +{ + const ACTIVE = 1; + const PENDING = 2; + const NOT_ACTIVE = 3; + const DELETED = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaChinaCacheAlgorithmType extends KalturaEnumBase +{ + const SHA1 = 1; + const SHA256 = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCommercialUseType extends KalturaEnumBase +{ + const NON_COMMERCIAL_USE = 0; + const COMMERCIAL_USE = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaContributionPolicyType extends KalturaEnumBase +{ + const ALL = 1; + const MEMBERS_WITH_CONTRIBUTION_PERMISSION = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaControlPanelCommandStatus extends KalturaEnumBase +{ + const PENDING = 1; + const HANDLED = 2; + const DONE = 3; + const FAILED = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaControlPanelCommandTargetType extends KalturaEnumBase +{ + const DATA_CENTER = 1; + const SCHEDULER = 2; + const JOB_TYPE = 3; + const JOB = 4; + const BATCH = 5; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaControlPanelCommandType extends KalturaEnumBase +{ + const KILL = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCountryRestrictionType extends KalturaEnumBase +{ + const RESTRICT_COUNTRY_LIST = 0; + const ALLOW_COUNTRY_LIST = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDVRStatus extends KalturaEnumBase +{ + const DISABLED = 0; + const ENABLED = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryStatus extends KalturaEnumBase +{ + const ACTIVE = 0; + const DELETED = 1; + const STAGING_IN = 2; + const STAGING_OUT = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDirectoryRestrictionType extends KalturaEnumBase +{ + const DONT_DISPLAY = 0; + const DISPLAY_WITH_LINK = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEditorType extends KalturaEnumBase +{ + const SIMPLE = 1; + const ADVANCED = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEmailIngestionProfileStatus extends KalturaEnumBase +{ + const INACTIVE = 0; + const ACTIVE = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryDisplayInSearchType extends KalturaEnumBase +{ + const SYSTEM = -1; + const NONE = 0; + const PARTNER_ONLY = 1; + const KALTURA_NETWORK = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryModerationStatus extends KalturaEnumBase +{ + const PENDING_MODERATION = 1; + const APPROVED = 2; + const REJECTED = 3; + const DELETED = 4; + const FLAGGED_FOR_REVIEW = 5; + const AUTO_APPROVED = 6; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryServerNodeRecordingStatus extends KalturaEnumBase +{ + const STOPPED = 0; + const ON_GOING = 1; + const DONE = 2; + const DISMISSED = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryServerNodeStatus extends KalturaEnumBase +{ + const STOPPED = 0; + const PLAYABLE = 1; + const BROADCASTING = 2; + const AUTHENTICATED = 3; + const MARKED_FOR_DELETION = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFeatureStatusType extends KalturaEnumBase +{ + const LOCK_CATEGORY = 1; + const CATEGORY = 2; + const CATEGORY_ENTRY = 3; + const ENTRY = 4; + const CATEGORY_USER = 5; + const USER = 6; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorAssetStatus extends KalturaEnumBase +{ + const ERROR = -1; + const QUEUED = 0; + const CONVERTING = 1; + const READY = 2; + const DELETED = 3; + const NOT_APPLICABLE = 4; + const TEMP = 5; + const WAIT_FOR_CONVERT = 6; + const IMPORTING = 7; + const VALIDATING = 8; + const EXPORTING = 9; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorReadyBehaviorType extends KalturaEnumBase +{ + const NO_IMPACT = 0; + const INHERIT_FLAVOR_PARAMS = 0; + const REQUIRED = 1; + const OPTIONAL = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGender extends KalturaEnumBase +{ + const UNKNOWN = 0; + const MALE = 1; + const FEMALE = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGroupUserStatus extends KalturaEnumBase +{ + const ACTIVE = 0; + const DELETED = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaInheritanceType extends KalturaEnumBase +{ + const INHERIT = 1; + const MANUAL = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaIpAddressRestrictionType extends KalturaEnumBase +{ + const RESTRICT_LIST = 0; + const ALLOW_LIST = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLicenseType extends KalturaEnumBase +{ + const UNKNOWN = -1; + const NONE = 0; + const COPYRIGHTED = 1; + const PUBLIC_DOMAIN = 2; + const CREATIVECOMMONS_ATTRIBUTION = 3; + const CREATIVECOMMONS_ATTRIBUTION_SHARE_ALIKE = 4; + const CREATIVECOMMONS_ATTRIBUTION_NO_DERIVATIVES = 5; + const CREATIVECOMMONS_ATTRIBUTION_NON_COMMERCIAL = 6; + const CREATIVECOMMONS_ATTRIBUTION_NON_COMMERCIAL_SHARE_ALIKE = 7; + const CREATIVECOMMONS_ATTRIBUTION_NON_COMMERCIAL_NO_DERIVATIVES = 8; + const GFDL = 9; + const GPL = 10; + const AFFERO_GPL = 11; + const LGPL = 12; + const BSD = 13; + const APACHE = 14; + const MOZILLA = 15; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLimitFlavorsRestrictionType extends KalturaEnumBase +{ + const RESTRICT_LIST = 0; + const ALLOW_LIST = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLivePublishStatus extends KalturaEnumBase +{ + const DISABLED = 0; + const ENABLED = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveReportExportType extends KalturaEnumBase +{ + const PARTNER_TOTAL_ALL = 1; + const PARTNER_TOTAL_LIVE = 2; + const ENTRY_TIME_LINE_ALL = 11; + const ENTRY_TIME_LINE_LIVE = 12; + const LOCATION_ALL = 21; + const LOCATION_LIVE = 22; + const SYNDICATION_ALL = 31; + const SYNDICATION_LIVE = 32; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStatsEventType extends KalturaEnumBase +{ + const LIVE = 1; + const DVR = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMailJobStatus extends KalturaEnumBase +{ + const PENDING = 1; + const SENT = 2; + const ERROR = 3; + const QUEUED = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaType extends KalturaEnumBase +{ + const VIDEO = 1; + const IMAGE = 2; + const AUDIO = 5; + const LIVE_STREAM_FLASH = 201; + const LIVE_STREAM_WINDOWS_MEDIA = 202; + const LIVE_STREAM_REAL_MEDIA = 203; + const LIVE_STREAM_QUICKTIME = 204; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaModerationFlagType extends KalturaEnumBase +{ + const SEXUAL_CONTENT = 1; + const VIOLENT_REPULSIVE = 2; + const HARMFUL_DANGEROUS = 3; + const SPAM_COMMERCIALS = 4; + const COPYRIGHT = 5; + const TERMS_OF_USE_VIOLATION = 6; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMrssExtensionMode extends KalturaEnumBase +{ + const APPEND = 1; + const REPLACE = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaNotificationObjectType extends KalturaEnumBase +{ + const ENTRY = 1; + const KSHOW = 2; + const USER = 3; + const BATCH_JOB = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaNotificationStatus extends KalturaEnumBase +{ + const PENDING = 1; + const SENT = 2; + const ERROR = 3; + const SHOULD_RESEND = 4; + const ERROR_RESENDING = 5; + const SENT_SYNCH = 6; + const QUEUED = 7; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaNotificationType extends KalturaEnumBase +{ + const ENTRY_ADD = 1; + const ENTR_UPDATE_PERMISSIONS = 2; + const ENTRY_DELETE = 3; + const ENTRY_BLOCK = 4; + const ENTRY_UPDATE = 5; + const ENTRY_UPDATE_THUMBNAIL = 6; + const ENTRY_UPDATE_MODERATION = 7; + const USER_ADD = 21; + const USER_BANNED = 26; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaNullableBoolean extends KalturaEnumBase +{ + const NULL_VALUE = -1; + const FALSE_VALUE = 0; + const TRUE_VALUE = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartnerGroupType extends KalturaEnumBase +{ + const PUBLISHER = 1; + const VAR_GROUP = 2; + const GROUP = 3; + const TEMPLATE = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartnerStatus extends KalturaEnumBase +{ + const DELETED = 0; + const ACTIVE = 1; + const BLOCKED = 2; + const FULL_BLOCK = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartnerType extends KalturaEnumBase +{ + const KMC = 1; + const WIKI = 100; + const WORDPRESS = 101; + const DRUPAL = 102; + const DEKIWIKI = 103; + const MOODLE = 104; + const COMMUNITY_EDITION = 105; + const JOOMLA = 106; + const BLACKBOARD = 107; + const SAKAI = 108; + const ADMIN_CONSOLE = 109; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionStatus extends KalturaEnumBase +{ + const ACTIVE = 1; + const BLOCKED = 2; + const DELETED = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionType extends KalturaEnumBase +{ + const NORMAL = 1; + const SPECIAL_FEATURE = 2; + const PLUGIN = 3; + const PARTNER_GROUP = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylistType extends KalturaEnumBase +{ + const STATIC_LIST = 3; + const DYNAMIC = 10; + const EXTERNAL = 101; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPrivacyType extends KalturaEnumBase +{ + const ALL = 1; + const AUTHENTICATED_USERS = 2; + const MEMBERS_ONLY = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRecordStatus extends KalturaEnumBase +{ + const DISABLED = 0; + const APPENDED = 1; + const PER_SESSION = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRecordingStatus extends KalturaEnumBase +{ + const STOPPED = 0; + const PAUSED = 1; + const ACTIVE = 2; + const DISABLED = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileStatus extends KalturaEnumBase +{ + const DISABLED = 1; + const ENABLED = 2; + const DELETED = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileType extends KalturaEnumBase +{ + const INCLUDE_FIELDS = 1; + const EXCLUDE_FIELDS = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseType extends KalturaEnumBase +{ + const RESPONSE_TYPE_JSON = 1; + const RESPONSE_TYPE_XML = 2; + const RESPONSE_TYPE_PHP = 3; + const RESPONSE_TYPE_PHP_ARRAY = 4; + const RESPONSE_TYPE_HTML = 7; + const RESPONSE_TYPE_MRSS = 8; + const RESPONSE_TYPE_JSONP = 9; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSchedulerStatusType extends KalturaEnumBase +{ + const RUNNING_BATCHES_COUNT = 1; + const RUNNING_BATCHES_CPU = 2; + const RUNNING_BATCHES_MEMORY = 3; + const RUNNING_BATCHES_NETWORK = 4; + const RUNNING_BATCHES_DISC_IO = 5; + const RUNNING_BATCHES_DISC_SPACE = 6; + const RUNNING_BATCHES_IS_RUNNING = 7; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchOperatorType extends KalturaEnumBase +{ + const SEARCH_AND = 1; + const SEARCH_OR = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchProviderType extends KalturaEnumBase +{ + const FLICKR = 3; + const YOUTUBE = 4; + const MYSPACE = 7; + const PHOTOBUCKET = 8; + const JAMENDO = 9; + const CCMIXTER = 10; + const NYPL = 11; + const CURRENT = 12; + const MEDIA_COMMONS = 13; + const KALTURA = 20; + const KALTURA_USER_CLIPS = 21; + const ARCHIVE_ORG = 22; + const KALTURA_PARTNER = 23; + const METACAFE = 24; + const SEARCH_PROXY = 28; + const PARTNER_SPECIFIC = 100; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaServerNodeStatus extends KalturaEnumBase +{ + const ACTIVE = 1; + const DISABLED = 2; + const DELETED = 3; + const NOT_REGISTERED = 4; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSessionType extends KalturaEnumBase +{ + const USER = 0; + const ADMIN = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSiteRestrictionType extends KalturaEnumBase +{ + const RESTRICT_SITE_LIST = 0; + const ALLOW_SITE_LIST = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStatsEventType extends KalturaEnumBase +{ + const WIDGET_LOADED = 1; + const MEDIA_LOADED = 2; + const PLAY = 3; + const PLAY_REACHED_25 = 4; + const PLAY_REACHED_50 = 5; + const PLAY_REACHED_75 = 6; + const PLAY_REACHED_100 = 7; + const OPEN_EDIT = 8; + const OPEN_VIRAL = 9; + const OPEN_DOWNLOAD = 10; + const OPEN_REPORT = 11; + const BUFFER_START = 12; + const BUFFER_END = 13; + const OPEN_FULL_SCREEN = 14; + const CLOSE_FULL_SCREEN = 15; + const REPLAY = 16; + const SEEK = 17; + const OPEN_UPLOAD = 18; + const SAVE_PUBLISH = 19; + const CLOSE_EDITOR = 20; + const PRE_BUMPER_PLAYED = 21; + const POST_BUMPER_PLAYED = 22; + const BUMPER_CLICKED = 23; + const PREROLL_STARTED = 24; + const MIDROLL_STARTED = 25; + const POSTROLL_STARTED = 26; + const OVERLAY_STARTED = 27; + const PREROLL_CLICKED = 28; + const MIDROLL_CLICKED = 29; + const POSTROLL_CLICKED = 30; + const OVERLAY_CLICKED = 31; + const PREROLL_25 = 32; + const PREROLL_50 = 33; + const PREROLL_75 = 34; + const MIDROLL_25 = 35; + const MIDROLL_50 = 36; + const MIDROLL_75 = 37; + const POSTROLL_25 = 38; + const POSTROLL_50 = 39; + const POSTROLL_75 = 40; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStatsFeatureType extends KalturaEnumBase +{ + const NONE = 0; + const RELATED = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStatsKmcEventType extends KalturaEnumBase +{ + const CONTENT_PAGE_VIEW = 1001; + const CONTENT_ADD_PLAYLIST = 1010; + const CONTENT_EDIT_PLAYLIST = 1011; + const CONTENT_DELETE_PLAYLIST = 1012; + const CONTENT_EDIT_ENTRY = 1013; + const CONTENT_CHANGE_THUMBNAIL = 1014; + const CONTENT_ADD_TAGS = 1015; + const CONTENT_REMOVE_TAGS = 1016; + const CONTENT_ADD_ADMIN_TAGS = 1017; + const CONTENT_REMOVE_ADMIN_TAGS = 1018; + const CONTENT_DOWNLOAD = 1019; + const CONTENT_APPROVE_MODERATION = 1020; + const CONTENT_REJECT_MODERATION = 1021; + const CONTENT_BULK_UPLOAD = 1022; + const CONTENT_ADMIN_KCW_UPLOAD = 1023; + const ACCOUNT_CHANGE_PARTNER_INFO = 1030; + const ACCOUNT_CHANGE_LOGIN_INFO = 1031; + const ACCOUNT_CONTACT_US_USAGE = 1032; + const ACCOUNT_UPDATE_SERVER_SETTINGS = 1033; + const ACCOUNT_ACCOUNT_OVERVIEW = 1034; + const ACCOUNT_ACCESS_CONTROL = 1035; + const ACCOUNT_TRANSCODING_SETTINGS = 1036; + const ACCOUNT_ACCOUNT_UPGRADE = 1037; + const ACCOUNT_SAVE_SERVER_SETTINGS = 1038; + const ACCOUNT_ACCESS_CONTROL_DELETE = 1039; + const ACCOUNT_SAVE_TRANSCODING_SETTINGS = 1040; + const LOGIN = 1041; + const DASHBOARD_IMPORT_CONTENT = 1042; + const DASHBOARD_UPDATE_CONTENT = 1043; + const DASHBOARD_ACCOUNT_CONTACT_US = 1044; + const DASHBOARD_VIEW_REPORTS = 1045; + const DASHBOARD_EMBED_PLAYER = 1046; + const DASHBOARD_EMBED_PLAYLIST = 1047; + const DASHBOARD_CUSTOMIZE_PLAYERS = 1048; + const APP_STUDIO_NEW_PLAYER_SINGLE_VIDEO = 1050; + const APP_STUDIO_NEW_PLAYER_PLAYLIST = 1051; + const APP_STUDIO_NEW_PLAYER_MULTI_TAB_PLAYLIST = 1052; + const APP_STUDIO_EDIT_PLAYER_SINGLE_VIDEO = 1053; + const APP_STUDIO_EDIT_PLAYER_PLAYLIST = 1054; + const APP_STUDIO_EDIT_PLAYER_MULTI_TAB_PLAYLIST = 1055; + const APP_STUDIO_DUPLICATE_PLAYER = 1056; + const CONTENT_CONTENT_GO_TO_PAGE = 1057; + const CONTENT_DELETE_ITEM = 1058; + const CONTENT_DELETE_MIX = 1059; + const REPORTS_AND_ANALYTICS_BANDWIDTH_USAGE_TAB = 1070; + const REPORTS_AND_ANALYTICS_CONTENT_REPORTS_TAB = 1071; + const REPORTS_AND_ANALYTICS_USERS_AND_COMMUNITY_REPORTS_TAB = 1072; + const REPORTS_AND_ANALYTICS_TOP_CONTRIBUTORS = 1073; + const REPORTS_AND_ANALYTICS_MAP_OVERLAYS = 1074; + const REPORTS_AND_ANALYTICS_TOP_SYNDICATIONS = 1075; + const REPORTS_AND_ANALYTICS_TOP_CONTENT = 1076; + const REPORTS_AND_ANALYTICS_CONTENT_DROPOFF = 1077; + const REPORTS_AND_ANALYTICS_CONTENT_INTERACTIONS = 1078; + const REPORTS_AND_ANALYTICS_CONTENT_CONTRIBUTIONS = 1079; + const REPORTS_AND_ANALYTICS_VIDEO_DRILL_DOWN = 1080; + const REPORTS_AND_ANALYTICS_CONTENT_DRILL_DOWN_INTERACTION = 1081; + const REPORTS_AND_ANALYTICS_CONTENT_CONTRIBUTIONS_DRILLDOWN = 1082; + const REPORTS_AND_ANALYTICS_VIDEO_DRILL_DOWN_DROPOFF = 1083; + const REPORTS_AND_ANALYTICS_MAP_OVERLAYS_DRILLDOWN = 1084; + const REPORTS_AND_ANALYTICS_TOP_SYNDICATIONS_DRILL_DOWN = 1085; + const REPORTS_AND_ANALYTICS_BANDWIDTH_USAGE_VIEW_MONTHLY = 1086; + const REPORTS_AND_ANALYTICS_BANDWIDTH_USAGE_VIEW_YEARLY = 1087; + const CONTENT_ENTRY_DRILLDOWN = 1088; + const CONTENT_OPEN_PREVIEW_AND_EMBED = 1089; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageProfileDeliveryStatus extends KalturaEnumBase +{ + const ACTIVE = 1; + const BLOCKED = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageProfileReadyBehavior extends KalturaEnumBase +{ + const NO_IMPACT = 0; + const REQUIRED = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageProfileStatus extends KalturaEnumBase +{ + const DISABLED = 1; + const AUTOMATIC = 2; + const MANUAL = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSyndicationFeedStatus extends KalturaEnumBase +{ + const DELETED = -1; + const ACTIVE = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSyndicationFeedType extends KalturaEnumBase +{ + const GOOGLE_VIDEO = 1; + const YAHOO = 2; + const ITUNES = 3; + const TUBE_MOGUL = 4; + const KALTURA = 5; + const KALTURA_XSLT = 6; + const ROKU_DIRECT_PUBLISHER = 7; + const OPERA_TV_SNAP = 8; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbAssetStatus extends KalturaEnumBase +{ + const ERROR = -1; + const QUEUED = 0; + const CAPTURING = 1; + const READY = 2; + const DELETED = 3; + const IMPORTING = 7; + const EXPORTING = 9; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbCropType extends KalturaEnumBase +{ + const RESIZE = 1; + const RESIZE_WITH_PADDING = 2; + const CROP = 3; + const CROP_FROM_TOP = 4; + const RESIZE_WITH_FORCE = 5; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUiConfCreationMode extends KalturaEnumBase +{ + const WIZARD = 2; + const ADVANCED = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUiConfObjType extends KalturaEnumBase +{ + const PLAYER = 1; + const CONTRIBUTION_WIZARD = 2; + const SIMPLE_EDITOR = 3; + const ADVANCED_EDITOR = 4; + const PLAYLIST = 5; + const APP_STUDIO = 6; + const KRECORD = 7; + const PLAYER_V3 = 8; + const KMC_ACCOUNT = 9; + const KMC_ANALYTICS = 10; + const KMC_CONTENT = 11; + const KMC_DASHBOARD = 12; + const KMC_LOGIN = 13; + const PLAYER_SL = 14; + const CLIENTSIDE_ENCODER = 15; + const KMC_GENERAL = 16; + const KMC_ROLES_AND_PERMISSIONS = 17; + const CLIPPER = 18; + const KSR = 19; + const KUPLOAD = 20; + const WEBCASTING = 21; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUpdateMethodType extends KalturaEnumBase +{ + const MANUAL = 0; + const AUTOMATIC = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadErrorCode extends KalturaEnumBase +{ + const NO_ERROR = 0; + const GENERAL_ERROR = 1; + const PARTIAL_UPLOAD = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadTokenStatus extends KalturaEnumBase +{ + const PENDING = 0; + const PARTIAL_UPLOAD = 1; + const FULL_UPLOAD = 2; + const CLOSED = 3; + const TIMED_OUT = 4; + const DELETED = 5; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserAgentRestrictionType extends KalturaEnumBase +{ + const RESTRICT_LIST = 0; + const ALLOW_LIST = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserJoinPolicyType extends KalturaEnumBase +{ + const AUTO_JOIN = 1; + const REQUEST_TO_JOIN = 2; + const NOT_ALLOWED = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserRoleStatus extends KalturaEnumBase +{ + const ACTIVE = 1; + const BLOCKED = 2; + const DELETED = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserStatus extends KalturaEnumBase +{ + const BLOCKED = 0; + const ACTIVE = 1; + const DELETED = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserType extends KalturaEnumBase +{ + const USER = 0; + const GROUP = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaViewMode extends KalturaEnumBase +{ + const PREVIEW = 0; + const ALLOW_ALL = 1; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaWidgetSecurityType extends KalturaEnumBase +{ + const NONE = 1; + const TIMEHASH = 2; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const CREATED_AT_DESC = "-createdAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlProfileOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAdminUserOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const ID_ASC = "+id"; + const CREATED_AT_DESC = "-createdAt"; + const ID_DESC = "-id"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAkamaiUniversalStreamType extends KalturaEnumBase +{ + const HD_IPHONE_IPAD_LIVE = "HD iPhone/iPad Live"; + const UNIVERSAL_STREAMING_LIVE = "Universal Streaming Live"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAmazonS3StorageProfileFilesPermissionLevel extends KalturaEnumBase +{ + const ACL_AUTHENTICATED_READ = "authenticated-read"; + const ACL_PRIVATE = "private"; + const ACL_PUBLIC_READ = "public-read"; + const ACL_PUBLIC_READ_WRITE = "public-read-write"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAmazonS3StorageProfileOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaApiActionPermissionItemOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const ID_ASC = "+id"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const ID_DESC = "-id"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaApiParameterPermissionItemAction extends KalturaEnumBase +{ + const USAGE = "all"; + const INSERT = "insert"; + const READ = "read"; + const UPDATE = "update"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaApiParameterPermissionItemOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const ID_ASC = "+id"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const ID_DESC = "-id"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAppTokenHashType extends KalturaEnumBase +{ + const MD5 = "MD5"; + const SHA1 = "SHA1"; + const SHA256 = "SHA256"; + const SHA512 = "SHA512"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAppTokenOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DELETED_AT_ASC = "+deletedAt"; + const SIZE_ASC = "+size"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const DELETED_AT_DESC = "-deletedAt"; + const SIZE_DESC = "-size"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetParamsOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetParamsOutputOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetType extends KalturaEnumBase +{ + const ATTACHMENT = "attachment.Attachment"; + const CAPTION = "caption.Caption"; + const DOCUMENT = "document.Document"; + const IMAGE = "document.Image"; + const PDF = "document.PDF"; + const SWF = "document.SWF"; + const TIMED_THUMB_ASSET = "thumbCuePoint.timedThumb"; + const TRANSCRIPT = "transcript.Transcript"; + const WIDEVINE_FLAVOR = "widevine.WidevineFlavor"; + const FLAVOR = "1"; + const THUMBNAIL = "2"; + const LIVE = "3"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAudioCodec extends KalturaEnumBase +{ + const NONE = ""; + const AAC = "aac"; + const AACHE = "aache"; + const AC3 = "ac3"; + const AMRNB = "amrnb"; + const COPY = "copy"; + const EAC3 = "eac3"; + const MP3 = "mp3"; + const MPEG2 = "mpeg2"; + const PCM = "pcm"; + const VORBIS = "vorbis"; + const WMA = "wma"; + const WMAPRO = "wmapro"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryCloneOptions extends KalturaEnumBase +{ + const AD_CUE_POINTS = "adCuePoint.AD_CUE_POINTS"; + const ANNOTATION_CUE_POINTS = "annotation.ANNOTATION_CUE_POINTS"; + const CODE_CUE_POINTS = "codeCuePoint.CODE_CUE_POINTS"; + const THUMB_CUE_POINTS = "thumbCuePoint.THUMB_CUE_POINTS"; + const USERS = "1"; + const CATEGORIES = "2"; + const CHILD_ENTRIES = "3"; + const ACCESS_CONTROL = "4"; + const METADATA = "5"; + const FLAVORS = "6"; + const CAPTIONS = "7"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const END_DATE_ASC = "+endDate"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const END_DATE_DESC = "-endDate"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseSyndicationFeedOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const NAME_ASC = "+name"; + const PLAYLIST_ID_ASC = "+playlistId"; + const TYPE_ASC = "+type"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const NAME_DESC = "-name"; + const PLAYLIST_ID_DESC = "-playlistId"; + const TYPE_DESC = "-type"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchJobObjectType extends KalturaEnumBase +{ + const ENTRY_DISTRIBUTION = "contentDistribution.EntryDistribution"; + const DROP_FOLDER_FILE = "dropFolderXmlBulkUpload.DropFolderFile"; + const METADATA = "metadata.Metadata"; + const METADATA_PROFILE = "metadata.MetadataProfile"; + const SCHEDULED_TASK_PROFILE = "scheduledTask.ScheduledTaskProfile"; + const ENTRY = "1"; + const CATEGORY = "2"; + const FILE_SYNC = "3"; + const ASSET = "4"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchJobOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const ESTIMATED_EFFORT_ASC = "+estimatedEffort"; + const EXECUTION_ATTEMPTS_ASC = "+executionAttempts"; + const FINISH_TIME_ASC = "+finishTime"; + const LOCK_VERSION_ASC = "+lockVersion"; + const PRIORITY_ASC = "+priority"; + const QUEUE_TIME_ASC = "+queueTime"; + const STATUS_ASC = "+status"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const ESTIMATED_EFFORT_DESC = "-estimatedEffort"; + const EXECUTION_ATTEMPTS_DESC = "-executionAttempts"; + const FINISH_TIME_DESC = "-finishTime"; + const LOCK_VERSION_DESC = "-lockVersion"; + const PRIORITY_DESC = "-priority"; + const QUEUE_TIME_DESC = "-queueTime"; + const STATUS_DESC = "-status"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchJobType extends KalturaEnumBase +{ + const PARSE_MULTI_LANGUAGE_CAPTION_ASSET = "caption.parsemultilanguagecaptionasset"; + const CONVERT = "0"; + const PARSE_CAPTION_ASSET = "captionSearch.parseCaptionAsset"; + const DISTRIBUTION_DELETE = "contentDistribution.DistributionDelete"; + const DISTRIBUTION_DISABLE = "contentDistribution.DistributionDisable"; + const DISTRIBUTION_ENABLE = "contentDistribution.DistributionEnable"; + const DISTRIBUTION_FETCH_REPORT = "contentDistribution.DistributionFetchReport"; + const DISTRIBUTION_SUBMIT = "contentDistribution.DistributionSubmit"; + const DISTRIBUTION_SYNC = "contentDistribution.DistributionSync"; + const DISTRIBUTION_UPDATE = "contentDistribution.DistributionUpdate"; + const DROP_FOLDER_CONTENT_PROCESSOR = "dropFolder.DropFolderContentProcessor"; + const DROP_FOLDER_WATCHER = "dropFolder.DropFolderWatcher"; + const EVENT_NOTIFICATION_HANDLER = "eventNotification.EventNotificationHandler"; + const INTEGRATION = "integration.Integration"; + const SCHEDULED_TASK = "scheduledTask.ScheduledTask"; + const INDEX_TAGS = "tagSearch.IndexTagsByPrivacyContext"; + const TAG_RESOLVE = "tagSearch.TagResolve"; + const VIRUS_SCAN = "virusScan.VirusScan"; + const WIDEVINE_REPOSITORY_SYNC = "widevine.WidevineRepositorySync"; + const IMPORT = "1"; + const DELETE = "2"; + const FLATTEN = "3"; + const BULKUPLOAD = "4"; + const DVDCREATOR = "5"; + const DOWNLOAD = "6"; + const OOCONVERT = "7"; + const CONVERT_PROFILE = "10"; + const POSTCONVERT = "11"; + const EXTRACT_MEDIA = "14"; + const MAIL = "15"; + const NOTIFICATION = "16"; + const CLEANUP = "17"; + const SCHEDULER_HELPER = "18"; + const BULKDOWNLOAD = "19"; + const DB_CLEANUP = "20"; + const PROVISION_PROVIDE = "21"; + const CONVERT_COLLECTION = "22"; + const STORAGE_EXPORT = "23"; + const PROVISION_DELETE = "24"; + const STORAGE_DELETE = "25"; + const EMAIL_INGESTION = "26"; + const METADATA_IMPORT = "27"; + const METADATA_TRANSFORM = "28"; + const FILESYNC_IMPORT = "29"; + const CAPTURE_THUMB = "30"; + const DELETE_FILE = "31"; + const INDEX = "32"; + const MOVE_CATEGORY_ENTRIES = "33"; + const COPY = "34"; + const CONCAT = "35"; + const CONVERT_LIVE_SEGMENT = "36"; + const COPY_PARTNER = "37"; + const VALIDATE_LIVE_MEDIA_SERVERS = "38"; + const SYNC_CATEGORY_PRIVACY_CONTEXT = "39"; + const LIVE_REPORT_EXPORT = "40"; + const RECALCULATE_CACHE = "41"; + const LIVE_TO_VOD = "42"; + const COPY_CAPTIONS = "43"; + const CHUNKED_ENCODE_JOB_SCHEDULER = "44"; + const SERVER_NODE_MONITOR = "45"; + const USERS_CSV = "46"; + const CLIP_CONCAT = "47"; + const COPY_CUE_POINTS = "48"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadAction extends KalturaEnumBase +{ + const CANCEL = "scheduleBulkUpload.CANCEL"; + const ADD = "1"; + const UPDATE = "2"; + const DELETE = "3"; + const REPLACE = "4"; + const TRANSFORM_XSLT = "5"; + const ADD_OR_UPDATE = "6"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadObjectType extends KalturaEnumBase +{ + const SCHEDULE_EVENT = "scheduleBulkUpload.SCHEDULE_EVENT"; + const SCHEDULE_RESOURCE = "scheduleBulkUpload.SCHEDULE_RESOURCE"; + const ENTRY = "1"; + const CATEGORY = "2"; + const USER = "3"; + const CATEGORY_USER = "4"; + const CATEGORY_ENTRY = "5"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadResultStatus extends KalturaEnumBase +{ + const ERROR = "1"; + const OK = "2"; + const IN_PROGRESS = "3"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadType extends KalturaEnumBase +{ + const CSV = "bulkUploadCsv.CSV"; + const FILTER = "bulkUploadFilter.FILTER"; + const XML = "bulkUploadXml.XML"; + const DROP_FOLDER_XML = "dropFolderXmlBulkUpload.DROP_FOLDER_XML"; + const ICAL = "scheduleBulkUpload.ICAL"; + const DROP_FOLDER_ICAL = "scheduleDropFolder.DROP_FOLDER_ICAL"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryEntryAdvancedOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const CREATED_AT_DESC = "-createdAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const CREATED_AT_DESC = "-createdAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryIdentifierField extends KalturaEnumBase +{ + const FULL_NAME = "fullName"; + const ID = "id"; + const REFERENCE_ID = "referenceId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DEPTH_ASC = "+depth"; + const DIRECT_ENTRIES_COUNT_ASC = "+directEntriesCount"; + const DIRECT_SUB_CATEGORIES_COUNT_ASC = "+directSubCategoriesCount"; + const ENTRIES_COUNT_ASC = "+entriesCount"; + const FULL_NAME_ASC = "+fullName"; + const MEMBERS_COUNT_ASC = "+membersCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const DEPTH_DESC = "-depth"; + const DIRECT_ENTRIES_COUNT_DESC = "-directEntriesCount"; + const DIRECT_SUB_CATEGORIES_COUNT_DESC = "-directSubCategoriesCount"; + const ENTRIES_COUNT_DESC = "-entriesCount"; + const FULL_NAME_DESC = "-fullName"; + const MEMBERS_COUNT_DESC = "-membersCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryUserOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCloneComponentSelectorType extends KalturaEnumBase +{ + const INCLUDE_COMPONENT = "0"; + const EXCLUDE_COMPONENT = "1"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConditionType extends KalturaEnumBase +{ + const ABC_WATERMARK = "abcScreenersWatermarkAccessControl.abcWatermark"; + const EVENT_NOTIFICATION_FIELD = "eventNotification.BooleanField"; + const EVENT_NOTIFICATION_OBJECT_CHANGED = "eventNotification.ObjectChanged"; + const METADATA_FIELD_CHANGED = "metadata.FieldChanged"; + const METADATA_FIELD_COMPARE = "metadata.FieldCompare"; + const METADATA_FIELD_MATCH = "metadata.FieldMatch"; + const AUTHENTICATED = "1"; + const COUNTRY = "2"; + const IP_ADDRESS = "3"; + const SITE = "4"; + const USER_AGENT = "5"; + const FIELD_MATCH = "6"; + const FIELD_COMPARE = "7"; + const ASSET_PROPERTIES_COMPARE = "8"; + const USER_ROLE = "9"; + const GEO_DISTANCE = "10"; + const OR_OPERATOR = "11"; + const HASH = "12"; + const DELIVERY_PROFILE = "13"; + const ACTIVE_EDGE_VALIDATE = "14"; + const ANONYMOUS_IP = "15"; + const ASSET_TYPE = "16"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaContainerFormat extends KalturaEnumBase +{ + const _3GP = "3gp"; + const APPLEHTTP = "applehttp"; + const AVI = "avi"; + const BMP = "bmp"; + const COPY = "copy"; + const FLV = "flv"; + const HLS = "hls"; + const ISMA = "isma"; + const ISMV = "ismv"; + const JPG = "jpg"; + const M2TS = "m2ts"; + const M4V = "m4v"; + const MKV = "mkv"; + const MOV = "mov"; + const MP3 = "mp3"; + const MP4 = "mp4"; + const MPEG = "mpeg"; + const MPEGTS = "mpegts"; + const MXF = "mxf"; + const OGG = "ogg"; + const OGV = "ogv"; + const PDF = "pdf"; + const PNG = "png"; + const SWF = "swf"; + const WAV = "wav"; + const WEBM = "webm"; + const WMA = "wma"; + const WMV = "wmv"; + const WVM = "wvm"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaContextType extends KalturaEnumBase +{ + const PLAY = "1"; + const DOWNLOAD = "2"; + const THUMBNAIL = "3"; + const METADATA = "4"; + const EXPORT = "5"; + const SERVE = "6"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaControlPanelCommandOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileAssetParamsOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const CREATED_AT_DESC = "-createdAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileStatus extends KalturaEnumBase +{ + const DISABLED = "1"; + const ENABLED = "2"; + const DELETED = "3"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileType extends KalturaEnumBase +{ + const MEDIA = "1"; + const LIVE_STREAM = "2"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDataEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDataEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDataEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const END_DATE_ASC = "+endDate"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const END_DATE_DESC = "-endDate"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileAkamaiAppleHttpManifestOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileAkamaiHdsOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileAkamaiHttpOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericAppleHttpOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericHdsOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericHttpOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericRtmpOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericSilverLightOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileLiveAppleHttpOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileRtmpOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileType extends KalturaEnumBase +{ + const EDGE_CAST_HTTP = "edgeCast.EDGE_CAST_HTTP"; + const EDGE_CAST_RTMP = "edgeCast.EDGE_CAST_RTMP"; + const FORENSIC_WATERMARK_APPLE_HTTP = "forensicWatermark.FORENSIC_WATERMARK_APPLE_HTTP"; + const FORENSIC_WATERMARK_DASH = "forensicWatermark.FORENSIC_WATERMARK_DASH"; + const KONTIKI_HTTP = "kontiki.KONTIKI_HTTP"; + const UPLYNK_HTTP = "uplynk.UPLYNK_HTTP"; + const UPLYNK_RTMP = "uplynk.UPLYNK_RTMP"; + const VELOCIX_HDS = "velocix.VELOCIX_HDS"; + const VELOCIX_HLS = "velocix.VELOCIX_HLS"; + const APPLE_HTTP = "1"; + const HDS = "3"; + const HTTP = "4"; + const RTMP = "5"; + const RTSP = "6"; + const SILVER_LIGHT = "7"; + const AKAMAI_HLS_DIRECT = "10"; + const AKAMAI_HLS_MANIFEST = "11"; + const AKAMAI_HD = "12"; + const AKAMAI_HDS = "13"; + const AKAMAI_HTTP = "14"; + const AKAMAI_RTMP = "15"; + const AKAMAI_RTSP = "16"; + const AKAMAI_SS = "17"; + const GENERIC_HLS = "21"; + const GENERIC_HDS = "23"; + const GENERIC_HTTP = "24"; + const GENERIC_HLS_MANIFEST = "25"; + const GENERIC_HDS_MANIFEST = "26"; + const GENERIC_SS = "27"; + const GENERIC_RTMP = "28"; + const LEVEL3_HLS = "31"; + const LEVEL3_HTTP = "34"; + const LEVEL3_RTMP = "35"; + const LIMELIGHT_HTTP = "44"; + const LIMELIGHT_RTMP = "45"; + const LOCAL_PATH_APPLE_HTTP = "51"; + const LOCAL_PATH_HDS = "53"; + const LOCAL_PATH_HTTP = "54"; + const LOCAL_PATH_RTMP = "55"; + const VOD_PACKAGER_HLS = "61"; + const VOD_PACKAGER_HDS = "63"; + const VOD_PACKAGER_MSS = "67"; + const VOD_PACKAGER_DASH = "68"; + const VOD_PACKAGER_HLS_MANIFEST = "69"; + const LIVE_HLS = "1001"; + const LIVE_HDS = "1002"; + const LIVE_DASH = "1003"; + const LIVE_RTMP = "1005"; + const LIVE_HLS_TO_MULTICAST = "1006"; + const LIVE_PACKAGER_HLS = "1007"; + const LIVE_PACKAGER_HDS = "1008"; + const LIVE_PACKAGER_DASH = "1009"; + const LIVE_PACKAGER_MSS = "1010"; + const LIVE_AKAMAI_HDS = "1013"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryServerNodeOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const HEARTBEAT_TIME_ASC = "+heartbeatTime"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const HEARTBEAT_TIME_DESC = "-heartbeatTime"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDocumentEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDocumentEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDrmSchemeName extends KalturaEnumBase +{ + const PLAYREADY_CENC = "drm.PLAYREADY_CENC"; + const WIDEVINE_CENC = "drm.WIDEVINE_CENC"; + const FAIRPLAY = "fairplay.FAIRPLAY"; + const PLAYREADY = "playReady.PLAYREADY"; + const WIDEVINE = "widevine.WIDEVINE"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDurationType extends KalturaEnumBase +{ + const LONG = "long"; + const MEDIUM = "medium"; + const NOT_AVAILABLE = "notavailable"; + const SHORT = "short"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaESearchLanguage extends KalturaEnumBase +{ + const ARABIC = "Arabic"; + const BASQUE = "Basque"; + const BRAZILIAN = "Brazilian"; + const BULGARIAN = "Bulgarian"; + const CATALAN = "Catalan"; + const CHINESE = "Chinese"; + const CZECH = "Czech"; + const DANISH = "Danish"; + const DUTCH = "Dutch"; + const ENGLISH = "English"; + const FINNISH = "Finnish"; + const FRENCH = "French"; + const GALICIAN = "Galician"; + const GERMAN = "German"; + const GREEK = "Greek"; + const HINDI = "Hindi"; + const HUNGRIAN = "Hungarian"; + const INDONESIAN = "Indonesian"; + const ITALIAN = "Italian"; + const JAPANESE = "Japanese"; + const KOREAN = "Korean"; + const LATVIAN = "Latvian"; + const LITHUANIAN = "Lithuanian"; + const NORWEGIAN = "Norwegian"; + const PERSIAN = "Persian"; + const PORTUGUESE = "Prtuguese"; + const ROMANIAN = "Romanian"; + const RUSSIAN = "Russian"; + const SORANI = "Sorani"; + const SPANISH = "Spanish"; + const SWEDISH = "Swedish"; + const THAI = "Thai"; + const TURKISH = "Turkish"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEdgeServerNodeOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const HEARTBEAT_TIME_ASC = "+heartbeatTime"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const HEARTBEAT_TIME_DESC = "-heartbeatTime"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryIdentifierField extends KalturaEnumBase +{ + const ID = "id"; + const REFERENCE_ID = "referenceId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryReplacementStatus extends KalturaEnumBase +{ + const NONE = "0"; + const APPROVED_BUT_NOT_READY = "1"; + const READY_BUT_NOT_APPROVED = "2"; + const NOT_READY_AND_NOT_APPROVED = "3"; + const FAILED = "4"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryServerNodeOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryServerNodeType extends KalturaEnumBase +{ + const LIVE_PRIMARY = "0"; + const LIVE_BACKUP = "1"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryStatus extends KalturaEnumBase +{ + const ERROR_IMPORTING = "-2"; + const ERROR_CONVERTING = "-1"; + const SCAN_FAILURE = "virusScan.ScanFailure"; + const IMPORT = "0"; + const INFECTED = "virusScan.Infected"; + const PRECONVERT = "1"; + const READY = "2"; + const DELETED = "3"; + const PENDING = "4"; + const MODERATE = "5"; + const BLOCKED = "6"; + const NO_CONTENT = "7"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryType extends KalturaEnumBase +{ + const AUTOMATIC = "-1"; + const CONFERENCE_ENTRY_SERVER = "conference.CONFERENCE_ENTRY_SERVER"; + const EXTERNAL_MEDIA = "externalMedia.externalMedia"; + const MEDIA_CLIP = "1"; + const MIX = "2"; + const PLAYLIST = "5"; + const DATA = "6"; + const LIVE_STREAM = "7"; + const LIVE_CHANNEL = "8"; + const DOCUMENT = "10"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaExternalMediaEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const LAST_PLAYED_AT = "lastPlayedAt"; + const MEDIA_DATE = "mediaDate"; + const MEDIA_TYPE = "mediaType"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const MS_DURATION = "msDuration"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const PLAYS = "plays"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; + const VIEWS = "views"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaExternalMediaEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const DURATION_TYPE = "durationType"; + const FLAVOR_PARAMS_IDS = "flavorParamsIds"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileAssetObjectType extends KalturaEnumBase +{ + const UI_CONF = "2"; + const ENTRY = "3"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileAssetOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileAssetStatus extends KalturaEnumBase +{ + const PENDING = "0"; + const UPLOADING = "1"; + const READY = "2"; + const DELETED = "3"; + const ERROR = "4"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileSyncObjectType extends KalturaEnumBase +{ + const DISTRIBUTION_PROFILE = "contentDistribution.DistributionProfile"; + const ENTRY_DISTRIBUTION = "contentDistribution.EntryDistribution"; + const GENERIC_DISTRIBUTION_ACTION = "contentDistribution.GenericDistributionAction"; + const EMAIL_NOTIFICATION_TEMPLATE = "emailNotification.EmailNotificationTemplate"; + const HTTP_NOTIFICATION_TEMPLATE = "httpNotification.HttpNotificationTemplate"; + const ENTRY = "1"; + const UICONF = "2"; + const BATCHJOB = "3"; + const ASSET = "4"; + const FLAVOR_ASSET = "4"; + const METADATA = "5"; + const METADATA_PROFILE = "6"; + const SYNDICATION_FEED = "7"; + const CONVERSION_PROFILE = "8"; + const FILE_ASSET = "9"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorAssetOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DELETED_AT_ASC = "+deletedAt"; + const SIZE_ASC = "+size"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const DELETED_AT_DESC = "-deletedAt"; + const SIZE_DESC = "-size"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParamsOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParamsOutputOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGenericSyndicationFeedOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const NAME_ASC = "+name"; + const PLAYLIST_ID_ASC = "+playlistId"; + const TYPE_ASC = "+type"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const NAME_DESC = "-name"; + const PLAYLIST_ID_DESC = "-playlistId"; + const TYPE_DESC = "-type"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGenericXsltSyndicationFeedOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const NAME_ASC = "+name"; + const PLAYLIST_ID_ASC = "+playlistId"; + const TYPE_ASC = "+type"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const NAME_DESC = "-name"; + const PLAYLIST_ID_DESC = "-playlistId"; + const TYPE_DESC = "-type"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGeoCoderType extends KalturaEnumBase +{ + const KALTURA = "1"; + const MAX_MIND = "2"; + const DIGITAL_ELEMENT = "3"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGoogleSyndicationFeedAdultValues extends KalturaEnumBase +{ + const NO = "No"; + const YES = "Yes"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGoogleVideoSyndicationFeedOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const NAME_ASC = "+name"; + const PLAYLIST_ID_ASC = "+playlistId"; + const TYPE_ASC = "+type"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const NAME_DESC = "-name"; + const PLAYLIST_ID_DESC = "-playlistId"; + const TYPE_DESC = "-type"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGroupUserOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaITunesSyndicationFeedAdultValues extends KalturaEnumBase +{ + const CLEAN = "clean"; + const NO = "no"; + const YES = "yes"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaITunesSyndicationFeedCategories extends KalturaEnumBase +{ + const ARTS = "Arts"; + const ARTS_DESIGN = "Arts/Design"; + const ARTS_FASHION_BEAUTY = "Arts/Fashion & Beauty"; + const ARTS_FOOD = "Arts/Food"; + const ARTS_LITERATURE = "Arts/Literature"; + const ARTS_PERFORMING_ARTS = "Arts/Performing Arts"; + const ARTS_VISUAL_ARTS = "Arts/Visual Arts"; + const BUSINESS = "Business"; + const BUSINESS_BUSINESS_NEWS = "Business/Business News"; + const BUSINESS_CAREERS = "Business/Careers"; + const BUSINESS_INVESTING = "Business/Investing"; + const BUSINESS_MANAGEMENT_MARKETING = "Business/Management & Marketing"; + const BUSINESS_SHOPPING = "Business/Shopping"; + const COMEDY = "Comedy"; + const EDUCATION = "Education"; + const EDUCATION_TECHNOLOGY = "Education/Education Technology"; + const EDUCATION_HIGHER_EDUCATION = "Education/Higher Education"; + const EDUCATION_K_12 = "Education/K-12"; + const EDUCATION_LANGUAGE_COURSES = "Education/Language Courses"; + const EDUCATION_TRAINING = "Education/Training"; + const GAMES_HOBBIES = "Games & Hobbies"; + const GAMES_HOBBIES_AUTOMOTIVE = "Games & Hobbies/Automotive"; + const GAMES_HOBBIES_AVIATION = "Games & Hobbies/Aviation"; + const GAMES_HOBBIES_HOBBIES = "Games & Hobbies/Hobbies"; + const GAMES_HOBBIES_OTHER_GAMES = "Games & Hobbies/Other Games"; + const GAMES_HOBBIES_VIDEO_GAMES = "Games & Hobbies/Video Games"; + const GOVERNMENT_ORGANIZATIONS = "Government & Organizations"; + const GOVERNMENT_ORGANIZATIONS_LOCAL = "Government & Organizations/Local"; + const GOVERNMENT_ORGANIZATIONS_NATIONAL = "Government & Organizations/National"; + const GOVERNMENT_ORGANIZATIONS_NON_PROFIT = "Government & Organizations/Non-Profit"; + const GOVERNMENT_ORGANIZATIONS_REGIONAL = "Government & Organizations/Regional"; + const HEALTH = "Health"; + const HEALTH_ALTERNATIVE_HEALTH = "Health/Alternative Health"; + const HEALTH_FITNESS_NUTRITION = "Health/Fitness & Nutrition"; + const HEALTH_SELF_HELP = "Health/Self-Help"; + const HEALTH_SEXUALITY = "Health/Sexuality"; + const KIDS_FAMILY = "Kids & Family"; + const MUSIC = "Music"; + const NEWS_POLITICS = "News & Politics"; + const RELIGION_SPIRITUALITY = "Religion & Spirituality"; + const RELIGION_SPIRITUALITY_BUDDHISM = "Religion & Spirituality/Buddhism"; + const RELIGION_SPIRITUALITY_CHRISTIANITY = "Religion & Spirituality/Christianity"; + const RELIGION_SPIRITUALITY_HINDUISM = "Religion & Spirituality/Hinduism"; + const RELIGION_SPIRITUALITY_ISLAM = "Religion & Spirituality/Islam"; + const RELIGION_SPIRITUALITY_JUDAISM = "Religion & Spirituality/Judaism"; + const RELIGION_SPIRITUALITY_OTHER = "Religion & Spirituality/Other"; + const RELIGION_SPIRITUALITY_SPIRITUALITY = "Religion & Spirituality/Spirituality"; + const SCIENCE_MEDICINE = "Science & Medicine"; + const SCIENCE_MEDICINE_MEDICINE = "Science & Medicine/Medicine"; + const SCIENCE_MEDICINE_NATURAL_SCIENCES = "Science & Medicine/Natural Sciences"; + const SCIENCE_MEDICINE_SOCIAL_SCIENCES = "Science & Medicine/Social Sciences"; + const SOCIETY_CULTURE = "Society & Culture"; + const SOCIETY_CULTURE_HISTORY = "Society & Culture/History"; + const SOCIETY_CULTURE_PERSONAL_JOURNALS = "Society & Culture/Personal Journals"; + const SOCIETY_CULTURE_PHILOSOPHY = "Society & Culture/Philosophy"; + const SOCIETY_CULTURE_PLACES_TRAVEL = "Society & Culture/Places & Travel"; + const SPORTS_RECREATION = "Sports & Recreation"; + const SPORTS_RECREATION_AMATEUR = "Sports & Recreation/Amateur"; + const SPORTS_RECREATION_COLLEGE_HIGH_SCHOOL = "Sports & Recreation/College & High School"; + const SPORTS_RECREATION_OUTDOOR = "Sports & Recreation/Outdoor"; + const SPORTS_RECREATION_PROFESSIONAL = "Sports & Recreation/Professional"; + const TV_FILM = "TV & Film"; + const TECHNOLOGY = "Technology"; + const TECHNOLOGY_GADGETS = "Technology/Gadgets"; + const TECHNOLOGY_PODCASTING = "Technology/Podcasting"; + const TECHNOLOGY_SOFTWARE_HOW_TO = "Technology/Software How-To"; + const TECHNOLOGY_TECH_NEWS = "Technology/Tech News"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaITunesSyndicationFeedOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const NAME_ASC = "+name"; + const PLAYLIST_ID_ASC = "+playlistId"; + const TYPE_ASC = "+type"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const NAME_DESC = "-name"; + const PLAYLIST_ID_DESC = "-playlistId"; + const TYPE_DESC = "-type"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLanguage extends KalturaEnumBase +{ + const ABQ = "Abaza"; + const AB = "Abkhazian"; + const ABE = "Abnaki Western"; + const ABU = "Abure"; + const ACN = "Achang"; + const ACE = "Achinese"; + const ACT = "Achterhooks"; + const ACV = "Achumawi"; + const ADJ = "Adioukrou"; + const ADY = "Adyghe; Adygei"; + const ADT = "Adynyamathanha"; + const AAL = "Afade"; + const AA = "Afar"; + const AF = "Afrikaans"; + const AGQ = "Aghem"; + const AGX = "Aghul"; + const AGU = "Aguacateco"; + const AGR = "Aguaruna"; + const AIN = "Ainu (Japan)"; + const AKK = "Akkadian"; + const AKL = "Aklanon"; + const AKU = "Akum"; + const AKZ = "Alabama"; + const SQ = "Albanian"; + const ALN = "Albanian (Gheg)"; + const ALS = "Albanian (Tosk)"; + const ALE = "Aleut"; + const ALQ = "Algonquin"; + const ALT = "Altai (Southern)"; + const AM = "Amharic"; + const RME = "Angloromani"; + const APJ = "Apache (Jicarilla)"; + const APW = "Apache (Western)"; + const AR = "Arabic"; + const ARB = "Arabic (standard)"; + const B_T = "Arabic Tunisian Spoken"; + const ARC = "Aramaic"; + const SAM = "Aramaic Samaritan"; + const ARP = "Arapaho"; + const ARN = "Araucanian"; + const ARI = "Arikara"; + const HY = "Armenian"; + const RUP = "Aromanian"; + const AS_ = "Assamese"; + const ASB = "Assiniboine"; + const AII = "Assyrian Neo-Aramaic"; + const AST = "Asturian"; + const ATJ = "Atikamekw"; + const AWA = "Awadhi"; + const AY = "Aymara"; + const AZ = "Azerbaijani"; + const BCR = "Babine"; + const BFQ = "Badaga"; + const BDJ = "Bai"; + const BAN = "Balinese"; + const BCC = "Balochi Southern"; + const BFT = "Balti"; + const BAL = "Baluchi"; + const BAS = "Basa (Cameroon)"; + const BA = "Bashkir"; + const EU = "Basque"; + const BAR = "Bavarian"; + const BEA = "Beaver"; + const BEJ = "Beja"; + const BEM = "Bemba (Zambia)"; + const BN = "Bengali (Bangla)"; + const BEW = "Betawi"; + const KAP = "Bezhta"; + const BHB = "Bhili"; + const BHO = "Bhojpuri"; + const DZ = "Bhutani"; + const BH = "Bihari"; + const BIK = "Bikol"; + const BIN = "Bini"; + const BPY = "Bishnupriya Manipuri"; + const BI = "Bislama"; + const BR = "Breton"; + const BUG = "Buginese"; + const BG = "Bulgarian"; + const BUA = "Buriat"; + const MY = "Burmese"; + const BE = "Byelorussian (Belarusian)"; + const CAD = "Caddo"; + const KM = "Cambodian"; + const YUE = "Cantonese"; + const CRX = "Carrier"; + const CAF = "Carrier Southern"; + const CA = "Catalan"; + const CHC = "Catawba"; + const CAY = "Cayuga"; + const CEB = "Cebuano"; + const CHG = "Chagatai"; + const CLD = "Chaldean Neo-Aramaic"; + const CHR = "Cherokee"; + const CHY = "Cheyenne"; + const CIC = "Chickasaw"; + const CLC = "Chilcotin"; + const ZH = "Chinese"; + const CHN = "Chinook jargon"; + const CHP = "Chipewyan"; + const CIW = "Chippewa"; + const CHO = "Choctaw"; + const CAA = "Chor"; + const CKT = "Chukot"; + const CIM = "Cimbrian"; + const CLM = "Clallam Klallam"; + const COJ = "Cochimi"; + const COC = "Cocopa"; + const KSH = "Colognian"; + const COM = "Comanche"; + const SWB = "Comorian"; + const COO = "Comox"; + const COP = "Coptic"; + const CO = "Corsican"; + const MUS = "Creek"; + const CRH = "Crimean Tatar"; + const HR = "Croatian"; + const CUP = "Cupeo"; + const CS = "Czech"; + const DAK = "Dakota"; + const DA = "Danish"; + const DAR = "Dargwa"; + const PRD = "Dari (Persian)"; + const GBZ = "Dari Zoroastrian"; + const DHV = "Dehu"; + const DEL = "Delaware"; + const DIN = "Dinka"; + const DOI = "Dogri (generic)"; + const DGR = "Dogrib"; + const DLG = "Dolgan"; + const DOH = "Dong"; + const DUA = "Duala"; + const DNG = "Dungan"; + const NL = "Dutch"; + const DYU = "Dyula"; + const EEE = "E"; + const EGL = "Emilian"; + const EN = "English"; + const EN_US = "English (American)"; + const EN_GB = "English (British)"; + const ENM = "English Middle (1100-1500)"; + const MYV = "Erzya"; + const EO = "Esperanto"; + const ET = "Estonian"; + const EVE = "Even"; + const EVN = "Evenki"; + const FO = "Faeroese"; + const FAX = "Fala"; + const FAN = "Fang (Equatorial Guinea)"; + const FA = "Farsi"; + const FJ = "Fiji"; + const FIL = "Filipino"; + const FI = "Finnish"; + const FIT = "Finnish (Tornedalen)"; + const FON = "Fon"; + const FRP = "Franco-Prove"; + const FRK = "Frankish"; + const FR = "French"; + const FY = "Frisian"; + const FRR = "Frisian Northern"; + const FUR = "Friulian"; + const FVR = "Fur"; + const GAA = "Ga"; + const GV = "Gaelic (Manx)"; + const GD = "Gaelic (Scottish)"; + const GAG = "Gagauz"; + const GL = "Galician"; + const GAN = "Gan"; + const GEZ = "Geez"; + const KA = "Georgian"; + const DE = "German"; + const GEH = "German Hutterite"; + const PDC = "German Pennsylvania"; + const GIL = "Gilbertese"; + const NIV = "Gilyak Nivkh"; + const GIT = "Gitxsan"; + const EL = "Greek"; + const GRC = "Greek Ancient (to 1453)"; + const KL = "Greenlandic"; + const GN = "Guarani"; + const GU = "Gujarati"; + const GWI = "Gwichin"; + const HAI = "Haida"; + const HNN = "Hainanese"; + const HAS = "Haisla"; + const HAK = "Hakka"; + const HUR = "Halkomelem"; + const HAA = "Han"; + const HNI = "Hani"; + const HA = "Hausa"; + const HAW = "Hawaiian"; + const HE = "Hebrew"; + const IW = "Hebrew"; + const HEI = "Heiltsuk"; + const HID = "Hidatsa"; + const HIL = "Hiligaynon"; + const HI = "Hindi"; + const HMN = "Hmong"; + const HKK = "Hokkien"; + const HOP = "Hopi"; + const CZH = "Huizhou Chinese"; + const HU = "Hungarian"; + const IS = "Icelandic"; + const KPO = "Ikposo"; + const ILO = "Iloko"; + const SMN = "Inari Sami"; + const IN = "Indonesian"; + const ID = "Indonesian"; + const IZH = "Ingrian"; + const INH = "Ingush"; + const IA = "Interlingua"; + const IE = "Interlingue"; + const IU = "Inuktitut"; + const IK = "Inupiak"; + const GA = "Irish"; + const IT = "Italian"; + const ITL = "Itelmen"; + const JA = "Japanese"; + const JV = "Javanese"; + const CJY = "Jinyu Chinese"; + const KAJ = "Jju"; + const JCT = "Judeo-Crimean Tatar"; + const JGE = "Judeo-Georgian"; + const JUT = "Jutish"; + const KBD = "Kabardian"; + const KEA = "Kabuverdianu"; + const KAB = "Kabyle"; + const KFR = "Kachchi"; + const KJV = "Kaikavian literary language (Kajkavian)"; + const XAL = "Kalmyk Oirat"; + const KN = "Kannada"; + const KSK = "Kansa"; + const KRC = "Karachay-Balkar"; + const KIM = "Karagas"; + const KDR = "Karaim"; + const KAA = "Karakalpak"; + const KRL = "Karelian"; + const KS = "Kashmiri"; + const CSB = "Kashubian"; + const KKZ = "Kaska"; + const KAW = "Kawi"; + const KK = "Kazakh"; + const KJH = "Khakas"; + const KLJ = "Khalaj Turkic"; + const KCA = "Khanty"; + const KHA = "Khasi"; + const KXM = "Khmer Northern"; + const KIC = "Kickapoo"; + const RW = "Kinyarwanda (Ruanda)"; + const KIO = "Kiowa"; + const KY = "Kirghiz"; + const RN = "Kirundi (Rundi)"; + const TLH = "Klingon tlhIngan-Hol"; + const KFA = "Kodava"; + const KOI = "Komi-Permyak"; + const KOK = "Konkani (generic)"; + const KNN = "Konkani (specific)"; + const GOM = "Konkani Goan"; + const KO = "Korean"; + const KPY = "Koryak"; + const KOS = "Kosraean"; + const AVK = "Kotava"; + const KPE = "Kpelle"; + const DIH = "Kumiai"; + const KUM = "Kumyk"; + const KU = "Kurdish"; + const KUT = "Kutenai"; + const KWK = "Kwakiutl"; + const GDM = "Laal"; + const LLD = "Ladin"; + const LAD = "Ladino"; + const LAH = "Lahnda"; + const LHU = "Lahu"; + const LBE = "Lak"; + const LKI = "Laki"; + const LKT = "Lakota"; + const LO = "Laothian"; + const LA = "Latin"; + const LV = "Latvian (Lettish)"; + const LZZ = "Laz"; + const LEZ = "Lezghian"; + const LIJ = "Ligurian"; + const LIL = "Lillooet"; + const LIF = "Limbu"; + const LI = "Limburgish ( Limburger)"; + const LN = "Lingala"; + const LT = "Lithuanian"; + const JBO = "Lojban"; + const LOM = "Loma (Liberia)"; + const LMO = "Lombard"; + const NDS = "Low German Low Saxon"; + const LOZ = "Lozi"; + const LUA = "Luba-Lulua"; + const LUQ = "Lucumi"; + const LUD = "Ludian"; + const SMJ = "Lule Sami"; + const LUN = "Lunda"; + const LUO = "Luo (Kenya and Tanzania)"; + const LUT = "Lushootseed"; + const MK = "Macedonian"; + const MAD = "Madurese"; + const MAG = "Magahi"; + const MAI = "Maithili"; + const MG = "Malagasy"; + const MS = "Malay"; + const ML = "Malayalam"; + const PQM = "Malecite-Passamaquoddy"; + const MT = "Maltese"; + const MNC = "Manchu"; + const MID = "Mandaic"; + const MHQ = "Mandan"; + const CMN = "Mandarin Chinese"; + const MNS = "Mansi"; + const MI = "Maori"; + const MRW = "Maranao"; + const MR = "Marathi"; + const CHM = "Mari (Russia)"; + const MWR = "Marwari"; + const MAS = "Masai"; + const MFY = "Mayo"; + const MNI = "Meitei"; + const MEN = "Mende (Sierra Leone)"; + const MEZ = "Menominee"; + const MIC = "Micmac"; + const MNP = "Min Bei Chinese"; + const CDO = "Min Dong Chinese"; + const MIN = "Minangkabau"; + const XMF = "Mingrelian"; + const MWL = "Mirandese"; + const MOH = "Mohawk"; + const MDF = "Moksha"; + const MO = "Moldavian"; + const MNW = "Mon"; + const MN = "Mongolian"; + const MFE = "Morisyen"; + const MOS = "Mossi"; + const MXI = "Mozarabic"; + const MU = "Multilingual"; + const MTQ = "Muong"; + const NAQ = "Nama (Namibia)"; + const GLD = "Nanai"; + const NSK = "Naskapi"; + const NA = "Nauru"; + const NAP = "Neapolitan"; + const NE = "Nepali"; + const NEW_ = "Newari Nepal Bhasa"; + const NIO = "Nganasan"; + const NCG = "Nisgaa"; + const NIU = "Niuean"; + const NOG = "Nogai"; + const NON = "Norse Old"; + const NSO = "Northern Sotho Pedi Sepedi"; + const NO = "Norwegian"; + const NOV = "Novial"; + const NYM = "Nyamwezi"; + const NYO = "Nyoro"; + const NYS = "Nyungah"; + const OC = "Occitan"; + const OJC = "Ojibwa Central"; + const OJG = "Ojibwa Eastern"; + const OJB = "Ojibwa Northwestern"; + const OJS = "Ojibwa Severn"; + const OJW = "Ojibwa Western"; + const RYU = "Okinawan Central"; + const ANG = "Old English"; + const ONE = "Oneida"; + const ONO = "Onondaga"; + const OR_ = "Oriya"; + const OM = "Oromo (Afan, Galla)"; + const OTW = "Ottawa"; + const PPI = "Paipai"; + const PAU = "Palauan"; + const PAM = "Pampanga"; + const PAG = "Pangasinan"; + const PAP = "Papiamento"; + const PS = "Pashto (Pushto)"; + const PRP = "Persian"; + const PRS = "Persian (Dari)"; + const PFL = "Pfaelzisch"; + const PCD = "Picard"; + const PMS = "Piedmontese"; + const MYP = "Pirah"; + const PIH = "Pitcairn-Norfolk"; + const PDT = "Plautdietsch"; + const PL = "Polish"; + const PNT = "Pontic"; + const PT = "Portuguese"; + const POT = "Potawatomi"; + const PRG = "Prussian"; + const FUC = "Pulaar"; + const PA = "Punjabi"; + const QXQ = "Qashqai"; + const ALC = "Qawasqar"; + const QU = "Quechua"; + const QUC = "Quich Central"; + const RAP = "Rapanui"; + const RAR = "Rarotongan"; + const QTZ = "Reserved for local use."; + const RM = "Rhaeto-Romance"; + const RGN = "Romagnol"; + const RMF = "Romani Kalo Finnish"; + const RMO = "Romani Sinte"; + const RO = "Romanian"; + const RUO = "Romanian Istro"; + const RUQ = "Romanian Megleno"; + const ROM = "Romany"; + const RCF = "Runion Creole French"; + const RU = "Russian"; + const RUE = "Rusyn"; + const ACF = "Saint Lucian Creole French"; + const SAH = "Sakha"; + const SLR = "Salar"; + const STR = "Salish Straits"; + const SJD = "Sami Kildin"; + const SM = "Samoan"; + const SG = "Sangro"; + const SA = "Sanskrit"; + const SAT = "Santali"; + const SRM = "Saramaccan"; + const SDC = "Sardinian Sassarese"; + const STQ = "Saterland Frisian"; + const SXU = "Saxon Upper"; + const SCO = "Scots"; + const SEC = "Sechelt"; + const TRV = "Seediq"; + const SEK = "Sekani"; + const SEL = "Selkup"; + const SEE = "Seneca"; + const SR = "Serbian"; + const SH = "Serbo-Croatian"; + const SEI = "Seri"; + const ST = "Sesotho"; + const TN = "Setswana"; + const SJW = "Shawnee"; + const SN = "Shona"; + const CJS = "Shor"; + const SHH = "Shoshoni"; + const SHS = "Shuswap"; + const SCN = "Sicilian"; + const SID = "Sidamo"; + const SZL = "Silesian"; + const SD = "Sindhi"; + const SI = "Sinhalese"; + const SS = "Siswati"; + const SMS = "Skolt Sami"; + const SCS = "Slavey North"; + const XSL = "Slavey South"; + const SK = "Slovak"; + const SL = "Slovenian"; + const SO = "Somali"; + const SNK = "Soninke"; + const DSB = "Sorbian Lower"; + const HSB = "Sorbian Upper"; + const SMA = "Southern Sami"; + const ES = "Spanish"; + const SRN = "Sranan"; + const STO = "Stoney"; + const XSV = "Sudovian"; + const SUX = "Sumerian"; + const SU = "Sundanese"; + const SVA = "Svan"; + const SWG = "Swabian"; + const SW = "Swahili (Kiswahili)"; + const SV = "Swedish"; + const SWL = "Swedish Sign Language"; + const GSW = "Swiss German Alemannic Alsatian"; + const SYR = "Syriac"; + const TAB = "Tabassaran"; + const SHY = "Tachawit"; + const SHI = "Tachelhit"; + const TL = "Tagalog"; + const TBW = "Tagbanwa"; + const TGX = "Tagish"; + const THT = "Tahltan"; + const TDD = "Tai Na"; + const TG = "Tajik"; + const TLY = "Talysh"; + const TTQ = "Tamajaq Tawallammat"; + const TAQ = "Tamasheq"; + const TZM = "Tamazight Central Atlas"; + const TA = "Tamil"; + const TAR = "Tarahumara Central"; + const TTT = "Tat Muslim"; + const TT = "Tatar"; + const TE = "Telugu"; + const TEO = "Teo Chew"; + const TET = "Tetum"; + const TH = "Thai"; + const NOD = "Thai (Northern)"; + const TTS = "Thai Northeastern"; + const THP = "Thompson"; + const BO = "Tibetan"; + const TIG = "Tigre"; + const TI = "Tigrinya"; + const TLI = "Tlingit"; + const TCX = "Toda"; + const OOD = "Tohono Oodham"; + const TPI = "Tok Pisin"; + const TO = "Tonga"; + const TOG = "Tonga (Nyasa)"; + const DDO = "Tsez"; + const TSI = "Tsimshian"; + const TS = "Tsonga"; + const TCY = "Tulu"; + const TUM = "Tumbuka"; + const MZB = "Tumzabt"; + const TPN = "Tupinamb"; + const TUV = "Turkana"; + const TR = "Turkish"; + const OTA = "Turkish Ottoman"; + const TK = "Turkmen"; + const TUS = "Tuscarora"; + const TVL = "Tuvalu"; + const TYV = "Tuvinian"; + const TW = "Twi"; + const UBY = "Ubykh"; + const UDI = "Udi"; + const UDM = "Udmurt"; + const UG = "Uighur"; + const UK = "Ukrainian"; + const UN = "Undefined"; + const UR = "Urdu"; + const UUM = "Urum"; + const UZ = "Uzbek"; + const VEC = "Venetian"; + const VEP = "Veps"; + const VI = "Vietnamese"; + const VO = "Volapuk"; + const VOR = "Voro"; + const VOT = "Votic"; + const VRO = "Vro"; + const AUC = "Waorani"; + const WAR = "Waray (Philippines)"; + const CY = "Welsh"; + const PES = "Western Farsi"; + const AMW = "Western Neo-Aramaic"; + const WIY = "Wiyot"; + const WO = "Wolof"; + const WUU = "Wu Chinese"; + const WYM = "Wymysorys"; + const XH = "Xhosa"; + const AME = "Yanesha"; + const YI = "Yiddish"; + const JI = "Yiddish"; + const YO = "Yoruba"; + const ZAI = "Zapotec Isthmus"; + const DJE = "Zarma"; + const ZU = "Zulu"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLanguageCode extends KalturaEnumBase +{ + const AA = "aa"; + const AB = "ab"; + const AF = "af"; + const AM = "am"; + const AR = "ar"; + const AS_ = "as"; + const AY = "ay"; + const AZ = "az"; + const BA = "ba"; + const BE = "be"; + const BG = "bg"; + const BH = "bh"; + const BI = "bi"; + const BN = "bn"; + const BO = "bo"; + const BR = "br"; + const CA = "ca"; + const CO = "co"; + const CS = "cs"; + const CY = "cy"; + const DA = "da"; + const DE = "de"; + const DZ = "dz"; + const EL = "el"; + const EN = "en"; + const EN_GB = "en_gb"; + const EN_US = "en_us"; + const EO = "eo"; + const ES = "es"; + const ET = "et"; + const EU = "eu"; + const FA = "fa"; + const FI = "fi"; + const FJ = "fj"; + const FO = "fo"; + const FR = "fr"; + const FY = "fy"; + const GA = "ga"; + const GD = "gd"; + const GL = "gl"; + const GN = "gn"; + const GU = "gu"; + const GV = "gv"; + const HA = "ha"; + const HE = "he"; + const HI = "hi"; + const HR = "hr"; + const HU = "hu"; + const HY = "hy"; + const IA = "ia"; + const ID = "id"; + const IE = "ie"; + const IK = "ik"; + const IN = "in"; + const IS = "is"; + const IT = "it"; + const IU = "iu"; + const IW = "iw"; + const JA = "ja"; + const JI = "ji"; + const JV = "jv"; + const KA = "ka"; + const KK = "kk"; + const KL = "kl"; + const KM = "km"; + const KN = "kn"; + const KO = "ko"; + const KS = "ks"; + const KU = "ku"; + const KY = "ky"; + const LA = "la"; + const LI = "li"; + const LN = "ln"; + const LO = "lo"; + const LT = "lt"; + const LV = "lv"; + const MG = "mg"; + const MI = "mi"; + const MK = "mk"; + const ML = "ml"; + const MN = "mn"; + const MO = "mo"; + const MR = "mr"; + const MS = "ms"; + const MT = "mt"; + const MU = "multilingual"; + const MY = "my"; + const NA = "na"; + const NE = "ne"; + const NL = "nl"; + const NO = "no"; + const OC = "oc"; + const OM = "om"; + const OR_ = "or"; + const PA = "pa"; + const PL = "pl"; + const PS = "ps"; + const PT = "pt"; + const QU = "qu"; + const RM = "rm"; + const RN = "rn"; + const RO = "ro"; + const RU = "ru"; + const RW = "rw"; + const SA = "sa"; + const SD = "sd"; + const SG = "sg"; + const SH = "sh"; + const SI = "si"; + const SK = "sk"; + const SL = "sl"; + const SM = "sm"; + const SN = "sn"; + const SO = "so"; + const SQ = "sq"; + const SR = "sr"; + const SS = "ss"; + const ST = "st"; + const SU = "su"; + const SV = "sv"; + const SW = "sw"; + const TA = "ta"; + const TE = "te"; + const TG = "tg"; + const TH = "th"; + const TI = "ti"; + const TK = "tk"; + const TL = "tl"; + const TN = "tn"; + const TO = "to"; + const TR = "tr"; + const TS = "ts"; + const TT = "tt"; + const TW = "tw"; + const UG = "ug"; + const UK = "uk"; + const UR = "ur"; + const UZ = "uz"; + const VI = "vi"; + const VO = "vo"; + const WO = "wo"; + const XH = "xh"; + const YI = "yi"; + const YO = "yo"; + const ZH = "zh"; + const ZU = "zu"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveAssetOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DELETED_AT_ASC = "+deletedAt"; + const SIZE_ASC = "+size"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const DELETED_AT_DESC = "-deletedAt"; + const SIZE_DESC = "-size"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const LAST_PLAYED_AT = "lastPlayedAt"; + const MEDIA_DATE = "mediaDate"; + const MEDIA_TYPE = "mediaType"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const MS_DURATION = "msDuration"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const PLAYS = "plays"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; + const VIEWS = "views"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const DURATION_TYPE = "durationType"; + const FLAVOR_PARAMS_IDS = "flavorParamsIds"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DURATION_ASC = "+duration"; + const END_DATE_ASC = "+endDate"; + const FIRST_BROADCAST_ASC = "+firstBroadcast"; + const LAST_BROADCAST_ASC = "+lastBroadcast"; + const LAST_PLAYED_AT_ASC = "+lastPlayedAt"; + const MEDIA_TYPE_ASC = "+mediaType"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const PLAYS_ASC = "+plays"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const VIEWS_ASC = "+views"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const DURATION_DESC = "-duration"; + const END_DATE_DESC = "-endDate"; + const FIRST_BROADCAST_DESC = "-firstBroadcast"; + const LAST_BROADCAST_DESC = "-lastBroadcast"; + const LAST_PLAYED_AT_DESC = "-lastPlayedAt"; + const MEDIA_TYPE_DESC = "-mediaType"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const PLAYS_DESC = "-plays"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const VIEWS_DESC = "-views"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelSegmentOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const START_TIME_ASC = "+startTime"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const START_TIME_DESC = "-startTime"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelSegmentStatus extends KalturaEnumBase +{ + const ACTIVE = "2"; + const DELETED = "3"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelSegmentTriggerType extends KalturaEnumBase +{ + const CHANNEL_RELATIVE = "1"; + const ABSOLUTE_TIME = "2"; + const SEGMENT_START_RELATIVE = "3"; + const SEGMENT_END_RELATIVE = "4"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelSegmentType extends KalturaEnumBase +{ + const VIDEO_AND_AUDIO = "1"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const LAST_PLAYED_AT = "lastPlayedAt"; + const MEDIA_DATE = "mediaDate"; + const MEDIA_TYPE = "mediaType"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const MS_DURATION = "msDuration"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const PLAYS = "plays"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; + const VIEWS = "views"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const DURATION_TYPE = "durationType"; + const FLAVOR_PARAMS_IDS = "flavorParamsIds"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DURATION_ASC = "+duration"; + const END_DATE_ASC = "+endDate"; + const FIRST_BROADCAST_ASC = "+firstBroadcast"; + const LAST_BROADCAST_ASC = "+lastBroadcast"; + const LAST_PLAYED_AT_ASC = "+lastPlayedAt"; + const MEDIA_TYPE_ASC = "+mediaType"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const PLAYS_ASC = "+plays"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const VIEWS_ASC = "+views"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const DURATION_DESC = "-duration"; + const END_DATE_DESC = "-endDate"; + const FIRST_BROADCAST_DESC = "-firstBroadcast"; + const LAST_BROADCAST_DESC = "-lastBroadcast"; + const LAST_PLAYED_AT_DESC = "-lastPlayedAt"; + const MEDIA_TYPE_DESC = "-mediaType"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const PLAYS_DESC = "-plays"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const VIEWS_DESC = "-views"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryServerNodeOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveParamsOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveReportOrderBy extends KalturaEnumBase +{ + const NAME_ASC = "+name"; + const AUDIENCE_DESC = "-audience"; + const EVENT_TIME_DESC = "-eventTime"; + const PLAYS_DESC = "-plays"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveReportType extends KalturaEnumBase +{ + const ENTRY_GEO_TIME_LINE = "ENTRY_GEO_TIME_LINE"; + const ENTRY_SYNDICATION_TOTAL = "ENTRY_SYNDICATION_TOTAL"; + const ENTRY_TIME_LINE = "ENTRY_TIME_LINE"; + const ENTRY_TOTAL = "ENTRY_TOTAL"; + const PARTNER_TOTAL = "PARTNER_TOTAL"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamAdminEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const LAST_PLAYED_AT = "lastPlayedAt"; + const MEDIA_DATE = "mediaDate"; + const MEDIA_TYPE = "mediaType"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const MS_DURATION = "msDuration"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const PLAYS = "plays"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; + const VIEWS = "views"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamAdminEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const DURATION_TYPE = "durationType"; + const FLAVOR_PARAMS_IDS = "flavorParamsIds"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamAdminEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DURATION_ASC = "+duration"; + const END_DATE_ASC = "+endDate"; + const FIRST_BROADCAST_ASC = "+firstBroadcast"; + const LAST_BROADCAST_ASC = "+lastBroadcast"; + const LAST_PLAYED_AT_ASC = "+lastPlayedAt"; + const MEDIA_TYPE_ASC = "+mediaType"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const PLAYS_ASC = "+plays"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const VIEWS_ASC = "+views"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const DURATION_DESC = "-duration"; + const END_DATE_DESC = "-endDate"; + const FIRST_BROADCAST_DESC = "-firstBroadcast"; + const LAST_BROADCAST_DESC = "-lastBroadcast"; + const LAST_PLAYED_AT_DESC = "-lastPlayedAt"; + const MEDIA_TYPE_DESC = "-mediaType"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const PLAYS_DESC = "-plays"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const VIEWS_DESC = "-views"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const LAST_PLAYED_AT = "lastPlayedAt"; + const MEDIA_DATE = "mediaDate"; + const MEDIA_TYPE = "mediaType"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const MS_DURATION = "msDuration"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const PLAYS = "plays"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; + const VIEWS = "views"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const DURATION_TYPE = "durationType"; + const FLAVOR_PARAMS_IDS = "flavorParamsIds"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DURATION_ASC = "+duration"; + const END_DATE_ASC = "+endDate"; + const FIRST_BROADCAST_ASC = "+firstBroadcast"; + const LAST_BROADCAST_ASC = "+lastBroadcast"; + const LAST_PLAYED_AT_ASC = "+lastPlayedAt"; + const MEDIA_TYPE_ASC = "+mediaType"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const PLAYS_ASC = "+plays"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const VIEWS_ASC = "+views"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const DURATION_DESC = "-duration"; + const END_DATE_DESC = "-endDate"; + const FIRST_BROADCAST_DESC = "-firstBroadcast"; + const LAST_BROADCAST_DESC = "-lastBroadcast"; + const LAST_PLAYED_AT_DESC = "-lastPlayedAt"; + const MEDIA_TYPE_DESC = "-mediaType"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const PLAYS_DESC = "-plays"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const VIEWS_DESC = "-views"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMailType extends KalturaEnumBase +{ + const MAIL_TYPE_KALTURA_NEWSLETTER = "10"; + const MAIL_TYPE_ADDED_TO_FAVORITES = "11"; + const MAIL_TYPE_ADDED_TO_CLIP_FAVORITES = "12"; + const MAIL_TYPE_NEW_COMMENT_IN_PROFILE = "13"; + const MAIL_TYPE_CLIP_ADDED_YOUR_KALTURA = "20"; + const MAIL_TYPE_VIDEO_ADDED = "21"; + const MAIL_TYPE_ROUGHCUT_CREATED = "22"; + const MAIL_TYPE_ADDED_KALTURA_TO_YOUR_FAVORITES = "23"; + const MAIL_TYPE_NEW_COMMENT_IN_KALTURA = "24"; + const MAIL_TYPE_CLIP_ADDED = "30"; + const MAIL_TYPE_VIDEO_CREATED = "31"; + const MAIL_TYPE_ADDED_KALTURA_TO_HIS_FAVORITES = "32"; + const MAIL_TYPE_NEW_COMMENT_IN_KALTURA_YOU_CONTRIBUTED = "33"; + const MAIL_TYPE_CLIP_CONTRIBUTED = "40"; + const MAIL_TYPE_ROUGHCUT_CREATED_SUBSCRIBED = "41"; + const MAIL_TYPE_ADDED_KALTURA_TO_HIS_FAVORITES_SUBSCRIBED = "42"; + const MAIL_TYPE_NEW_COMMENT_IN_KALTURA_YOU_SUBSCRIBED = "43"; + const MAIL_TYPE_REGISTER_CONFIRM = "50"; + const MAIL_TYPE_PASSWORD_RESET = "51"; + const MAIL_TYPE_LOGIN_MAIL_RESET = "52"; + const MAIL_TYPE_REGISTER_CONFIRM_VIDEO_SERVICE = "54"; + const MAIL_TYPE_VIDEO_READY = "60"; + const MAIL_TYPE_VIDEO_IS_READY = "62"; + const MAIL_TYPE_BULK_DOWNLOAD_READY = "63"; + const MAIL_TYPE_BULKUPLOAD_FINISHED = "64"; + const MAIL_TYPE_BULKUPLOAD_FAILED = "65"; + const MAIL_TYPE_BULKUPLOAD_ABORTED = "66"; + const MAIL_TYPE_NOTIFY_ERR = "70"; + const MAIL_TYPE_ACCOUNT_UPGRADE_CONFIRM = "80"; + const MAIL_TYPE_VIDEO_SERVICE_NOTICE = "81"; + const MAIL_TYPE_VIDEO_SERVICE_NOTICE_LIMIT_REACHED = "82"; + const MAIL_TYPE_VIDEO_SERVICE_NOTICE_ACCOUNT_LOCKED = "83"; + const MAIL_TYPE_VIDEO_SERVICE_NOTICE_ACCOUNT_DELETED = "84"; + const MAIL_TYPE_VIDEO_SERVICE_NOTICE_UPGRADE_OFFER = "85"; + const MAIL_TYPE_ACCOUNT_REACTIVE_CONFIRM = "86"; + const MAIL_TYPE_SYSTEM_USER_RESET_PASSWORD = "110"; + const MAIL_TYPE_SYSTEM_USER_RESET_PASSWORD_SUCCESS = "111"; + const MAIL_TYPE_SYSTEM_USER_NEW_PASSWORD = "112"; + const MAIL_TYPE_SYSTEM_USER_CREDENTIALS_SAVED = "113"; + const MAIL_TYPE_LIVE_REPORT_EXPORT_SUCCESS = "130"; + const MAIL_TYPE_LIVE_REPORT_EXPORT_FAILURE = "131"; + const MAIL_TYPE_LIVE_REPORT_EXPORT_ABORT = "132"; + const MAIL_TYPE_USERS_CSV = "133"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMatchConditionType extends KalturaEnumBase +{ + const MATCH_ANY = "1"; + const MATCH_ALL = "2"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const LAST_PLAYED_AT = "lastPlayedAt"; + const MEDIA_DATE = "mediaDate"; + const MEDIA_TYPE = "mediaType"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const MS_DURATION = "msDuration"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const PLAYS = "plays"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; + const VIEWS = "views"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const DURATION_TYPE = "durationType"; + const FLAVOR_PARAMS_IDS = "flavorParamsIds"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DURATION_ASC = "+duration"; + const END_DATE_ASC = "+endDate"; + const LAST_PLAYED_AT_ASC = "+lastPlayedAt"; + const MEDIA_TYPE_ASC = "+mediaType"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const PLAYS_ASC = "+plays"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const VIEWS_ASC = "+views"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const DURATION_DESC = "-duration"; + const END_DATE_DESC = "-endDate"; + const LAST_PLAYED_AT_DESC = "-lastPlayedAt"; + const MEDIA_TYPE_DESC = "-mediaType"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const PLAYS_DESC = "-plays"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const VIEWS_DESC = "-views"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaFlavorParamsOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaFlavorParamsOutputOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaInfoOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaParserType extends KalturaEnumBase +{ + const MEDIAINFO = "0"; + const REMOTE_MEDIAINFO = "remoteMediaInfo.RemoteMediaInfo"; + const FFMPEG = "1"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaServerNodeOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const HEARTBEAT_TIME_ASC = "+heartbeatTime"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const HEARTBEAT_TIME_DESC = "-heartbeatTime"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMixEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const LAST_PLAYED_AT = "lastPlayedAt"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const MS_DURATION = "msDuration"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const PLAYS = "plays"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; + const VIEWS = "views"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMixEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const DURATION_TYPE = "durationType"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMixEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DURATION_ASC = "+duration"; + const END_DATE_ASC = "+endDate"; + const LAST_PLAYED_AT_ASC = "+lastPlayedAt"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const PLAYS_ASC = "+plays"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const VIEWS_ASC = "+views"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const DURATION_DESC = "-duration"; + const END_DATE_DESC = "-endDate"; + const LAST_PLAYED_AT_DESC = "-lastPlayedAt"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const PLAYS_DESC = "-plays"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const VIEWS_DESC = "-views"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaModerationFlagStatus extends KalturaEnumBase +{ + const PENDING = "1"; + const MODERATED = "2"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaModerationObjectType extends KalturaEnumBase +{ + const ENTRY = "2"; + const USER = "3"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartnerOrderBy extends KalturaEnumBase +{ + const ADMIN_EMAIL_ASC = "+adminEmail"; + const ADMIN_NAME_ASC = "+adminName"; + const CREATED_AT_ASC = "+createdAt"; + const ID_ASC = "+id"; + const NAME_ASC = "+name"; + const STATUS_ASC = "+status"; + const WEBSITE_ASC = "+website"; + const ADMIN_EMAIL_DESC = "-adminEmail"; + const ADMIN_NAME_DESC = "-adminName"; + const CREATED_AT_DESC = "-createdAt"; + const ID_DESC = "-id"; + const NAME_DESC = "-name"; + const STATUS_DESC = "-status"; + const WEBSITE_DESC = "-website"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionItemOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const ID_ASC = "+id"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const ID_DESC = "-id"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionItemType extends KalturaEnumBase +{ + const API_ACTION_ITEM = "kApiActionPermissionItem"; + const API_PARAMETER_ITEM = "kApiParameterPermissionItem"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const ID_ASC = "+id"; + const NAME_ASC = "+name"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const ID_DESC = "-id"; + const NAME_DESC = "-name"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlayableEntryCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const LAST_PLAYED_AT = "lastPlayedAt"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const MS_DURATION = "msDuration"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const PLAYS = "plays"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; + const VIEWS = "views"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlayableEntryMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const DURATION_TYPE = "durationType"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlayableEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DURATION_ASC = "+duration"; + const END_DATE_ASC = "+endDate"; + const LAST_PLAYED_AT_ASC = "+lastPlayedAt"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const PLAYS_ASC = "+plays"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const VIEWS_ASC = "+views"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const DURATION_DESC = "-duration"; + const END_DATE_DESC = "-endDate"; + const LAST_PLAYED_AT_DESC = "-lastPlayedAt"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const PLAYS_DESC = "-plays"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const VIEWS_DESC = "-views"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaybackProtocol extends KalturaEnumBase +{ + const APPLE_HTTP = "applehttp"; + const APPLE_HTTP_TO_MC = "applehttp_to_mc"; + const AUTO = "auto"; + const AKAMAI_HD = "hdnetwork"; + const AKAMAI_HDS = "hdnetworkmanifest"; + const HDS = "hds"; + const HLS = "hls"; + const HTTP = "http"; + const MPEG_DASH = "mpegdash"; + const MULTICAST_SL = "multicast_silverlight"; + const RTMP = "rtmp"; + const RTSP = "rtsp"; + const SILVER_LIGHT = "sl"; + const URL = "url"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylistCompareAttribute extends KalturaEnumBase +{ + const ACCESS_CONTROL_ID = "accessControlId"; + const CREATED_AT = "createdAt"; + const END_DATE = "endDate"; + const MODERATION_COUNT = "moderationCount"; + const MODERATION_STATUS = "moderationStatus"; + const PARTNER_ID = "partnerId"; + const PARTNER_SORT_VALUE = "partnerSortValue"; + const RANK = "rank"; + const REPLACEMENT_STATUS = "replacementStatus"; + const START_DATE = "startDate"; + const STATUS = "status"; + const TOTAL_RANK = "totalRank"; + const TYPE = "type"; + const UPDATED_AT = "updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylistMatchAttribute extends KalturaEnumBase +{ + const ADMIN_TAGS = "adminTags"; + const CATEGORIES_IDS = "categoriesIds"; + const CREATOR_ID = "creatorId"; + const DESCRIPTION = "description"; + const GROUP_ID = "groupId"; + const ID = "id"; + const NAME = "name"; + const REFERENCE_ID = "referenceId"; + const REPLACED_ENTRY_ID = "replacedEntryId"; + const REPLACING_ENTRY_ID = "replacingEntryId"; + const SEARCH_TEXT = "searchText"; + const TAGS = "tags"; + const USER_ID = "userId"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylistOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const END_DATE_ASC = "+endDate"; + const MODERATION_COUNT_ASC = "+moderationCount"; + const NAME_ASC = "+name"; + const PARTNER_SORT_VALUE_ASC = "+partnerSortValue"; + const RANK_ASC = "+rank"; + const RECENT_ASC = "+recent"; + const START_DATE_ASC = "+startDate"; + const TOTAL_RANK_ASC = "+totalRank"; + const UPDATED_AT_ASC = "+updatedAt"; + const WEIGHT_ASC = "+weight"; + const CREATED_AT_DESC = "-createdAt"; + const END_DATE_DESC = "-endDate"; + const MODERATION_COUNT_DESC = "-moderationCount"; + const NAME_DESC = "-name"; + const PARTNER_SORT_VALUE_DESC = "-partnerSortValue"; + const RANK_DESC = "-rank"; + const RECENT_DESC = "-recent"; + const START_DATE_DESC = "-startDate"; + const TOTAL_RANK_DESC = "-totalRank"; + const UPDATED_AT_DESC = "-updatedAt"; + const WEIGHT_DESC = "-weight"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaQuizUserEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportInterval extends KalturaEnumBase +{ + const DAYS = "days"; + const MONTHS = "months"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const CREATED_AT_DESC = "-createdAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportType extends KalturaEnumBase +{ + const QUIZ = "quiz.QUIZ"; + const QUIZ_AGGREGATE_BY_QUESTION = "quiz.QUIZ_AGGREGATE_BY_QUESTION"; + const QUIZ_USER_AGGREGATE_BY_QUESTION = "quiz.QUIZ_USER_AGGREGATE_BY_QUESTION"; + const QUIZ_USER_PERCENTAGE = "quiz.QUIZ_USER_PERCENTAGE"; + const TOP_CONTENT = "1"; + const CONTENT_DROPOFF = "2"; + const CONTENT_INTERACTIONS = "3"; + const MAP_OVERLAY = "4"; + const TOP_CONTRIBUTORS = "5"; + const TOP_SYNDICATION = "6"; + const CONTENT_CONTRIBUTIONS = "7"; + const USER_ENGAGEMENT = "11"; + const SPECIFIC_USER_ENGAGEMENT = "12"; + const USER_TOP_CONTENT = "13"; + const USER_CONTENT_DROPOFF = "14"; + const USER_CONTENT_INTERACTIONS = "15"; + const APPLICATIONS = "16"; + const USER_USAGE = "17"; + const SPECIFIC_USER_USAGE = "18"; + const VAR_USAGE = "19"; + const TOP_CREATORS = "20"; + const PLATFORMS = "21"; + const OPERATING_SYSTEM = "22"; + const BROWSERS = "23"; + const LIVE = "24"; + const TOP_PLAYBACK_CONTEXT = "25"; + const VPAAS_USAGE = "26"; + const ENTRY_USAGE = "27"; + const PARTNER_USAGE = "201"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRuleActionType extends KalturaEnumBase +{ + const DRM_POLICY = "drm.DRM_POLICY"; + const BLOCK = "1"; + const PREVIEW = "2"; + const LIMIT_FLAVORS = "3"; + const ADD_TO_STORAGE = "4"; + const LIMIT_DELIVERY_PROFILES = "5"; + const SERVE_FROM_REMOTE_SERVER = "6"; + const REQUEST_HOST_REGEX = "7"; + const LIMIT_THUMBNAIL_CAPTURE = "8"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSchemaType extends KalturaEnumBase +{ + const BULK_UPLOAD_RESULT_XML = "bulkUploadXml.bulkUploadResultXML"; + const BULK_UPLOAD_XML = "bulkUploadXml.bulkUploadXML"; + const INGEST_API = "cuePoint.ingestAPI"; + const SERVE_API = "cuePoint.serveAPI"; + const DROP_FOLDER_XML = "dropFolderXmlBulkUpload.dropFolderXml"; + const SYNDICATION = "syndication"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchConditionComparison extends KalturaEnumBase +{ + const EQUAL = "1"; + const GREATER_THAN = "2"; + const GREATER_THAN_OR_EQUAL = "3"; + const LESS_THAN = "4"; + const LESS_THAN_OR_EQUAL = "5"; + const NOT_EQUAL = "6"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaServerNodeOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const HEARTBEAT_TIME_ASC = "+heartbeatTime"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const HEARTBEAT_TIME_DESC = "-heartbeatTime"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaServerNodeType extends KalturaEnumBase +{ + const CONFERENCE_SERVER = "conference.CONFERENCE_SERVER"; + const WOWZA_MEDIA_SERVER = "wowza.WOWZA_MEDIA_SERVER"; + const EDGE = "1"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSourceType extends KalturaEnumBase +{ + const LIMELIGHT_LIVE = "limeLight.LIVE_STREAM"; + const VELOCIX_LIVE = "velocix.VELOCIX_LIVE"; + const FILE = "1"; + const WEBCAM = "2"; + const URL = "5"; + const SEARCH_PROVIDER = "6"; + const AKAMAI_LIVE = "29"; + const MANUAL_LIVE_STREAM = "30"; + const AKAMAI_UNIVERSAL_LIVE = "31"; + const LIVE_STREAM = "32"; + const LIVE_CHANNEL = "33"; + const RECORDED_LIVE = "34"; + const CLIP = "35"; + const KALTURA_RECORDED_LIVE = "36"; + const LECTURE_CAPTURE = "37"; + const LIVE_STREAM_ONTEXTDATA_CAPTIONS = "42"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageProfileOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageProfileProtocol extends KalturaEnumBase +{ + const KONTIKI = "kontiki.KONTIKI"; + const KALTURA_DC = "0"; + const FTP = "1"; + const SCP = "2"; + const SFTP = "3"; + const S3 = "6"; + const LOCAL = "7"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSyndicationFeedEntriesOrderBy extends KalturaEnumBase +{ + const CREATED_AT_DESC = "-createdAt"; + const RECENT = "recent"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaTaggedObjectType extends KalturaEnumBase +{ + const ENTRY = "1"; + const CATEGORY = "2"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbAssetOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const DELETED_AT_ASC = "+deletedAt"; + const SIZE_ASC = "+size"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const DELETED_AT_DESC = "-deletedAt"; + const SIZE_DESC = "-size"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParamsOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParamsOutputOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaTubeMogulSyndicationFeedCategories extends KalturaEnumBase +{ + const ANIMALS_AND_PETS = "Animals & Pets"; + const ARTS_AND_ANIMATION = "Arts & Animation"; + const AUTOS = "Autos"; + const COMEDY = "Comedy"; + const COMMERCIALS_PROMOTIONAL = "Commercials/Promotional"; + const ENTERTAINMENT = "Entertainment"; + const FAMILY_AND_KIDS = "Family & Kids"; + const HOW_TO_INSTRUCTIONAL_DIY = "How To/Instructional/DIY"; + const MUSIC = "Music"; + const NEWS_AND_BLOGS = "News & Blogs"; + const SCIENCE_AND_TECHNOLOGY = "Science & Technology"; + const SPORTS = "Sports"; + const TRAVEL_AND_PLACES = "Travel & Places"; + const VIDEO_GAMES = "Video Games"; + const VLOGS_PEOPLE = "Vlogs & People"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaTubeMogulSyndicationFeedOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const NAME_ASC = "+name"; + const PLAYLIST_ID_ASC = "+playlistId"; + const TYPE_ASC = "+type"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const NAME_DESC = "-name"; + const PLAYLIST_ID_DESC = "-playlistId"; + const TYPE_DESC = "-type"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUiConfOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadTokenOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const CREATED_AT_DESC = "-createdAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserEntryExtendedStatus extends KalturaEnumBase +{ + const PLAYBACK_COMPLETE = "viewHistory.PLAYBACK_COMPLETE"; + const PLAYBACK_STARTED = "viewHistory.PLAYBACK_STARTED"; + const VIEWED = "viewHistory.VIEWED"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserEntryOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserEntryStatus extends KalturaEnumBase +{ + const QUIZ_SUBMITTED = "quiz.3"; + const ACTIVE = "1"; + const DELETED = "2"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserEntryType extends KalturaEnumBase +{ + const QUIZ = "quiz.QUIZ"; + const VIEW_HISTORY = "viewHistory.VIEW_HISTORY"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserLoginDataOrderBy extends KalturaEnumBase +{ +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const ID_ASC = "+id"; + const CREATED_AT_DESC = "-createdAt"; + const ID_DESC = "-id"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserRoleOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const ID_ASC = "+id"; + const NAME_ASC = "+name"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const ID_DESC = "-id"; + const NAME_DESC = "-name"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaVideoCodec extends KalturaEnumBase +{ + const NONE = ""; + const APCH = "apch"; + const APCN = "apcn"; + const APCO = "apco"; + const APCS = "apcs"; + const COPY = "copy"; + const DNXHD = "dnxhd"; + const DV = "dv"; + const FLV = "flv"; + const H263 = "h263"; + const H264 = "h264"; + const H264B = "h264b"; + const H264H = "h264h"; + const H264M = "h264m"; + const H265 = "h265"; + const MPEG2 = "mpeg2"; + const MPEG4 = "mpeg4"; + const THEORA = "theora"; + const VP6 = "vp6"; + const VP8 = "vp8"; + const VP9 = "vp9"; + const WMV2 = "wmv2"; + const WMV3 = "wmv3"; + const WVC1A = "wvc1a"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaWidgetOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const CREATED_AT_DESC = "-createdAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaYahooSyndicationFeedAdultValues extends KalturaEnumBase +{ + const ADULT = "adult"; + const NON_ADULT = "nonadult"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaYahooSyndicationFeedCategories extends KalturaEnumBase +{ + const ACTION = "Action"; + const ANIMALS = "Animals"; + const ART_AND_ANIMATION = "Art & Animation"; + const COMMERCIALS = "Commercials"; + const ENTERTAINMENT_AND_TV = "Entertainment & TV"; + const FAMILY = "Family"; + const FOOD = "Food"; + const FUNNY_VIDEOS = "Funny Videos"; + const GAMES = "Games"; + const HEALTH_AND_BEAUTY = "Health & Beauty"; + const HOW_TO = "How-To"; + const MOVIES_AND_SHORTS = "Movies & Shorts"; + const MUSIC = "Music"; + const NEWS_AND_POLITICS = "News & Politics"; + const PEOPLE_AND_VLOGS = "People & Vlogs"; + const PRODUCTS_AND_TECH = "Products & Tech."; + const SCIENCE_AND_ENVIRONMENT = "Science & Environment"; + const SPORTS = "Sports"; + const TRANSPORTATION = "Transportation"; + const TRAVEL = "Travel"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaYahooSyndicationFeedOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const NAME_ASC = "+name"; + const PLAYLIST_ID_ASC = "+playlistId"; + const TYPE_ASC = "+type"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const NAME_DESC = "-name"; + const PLAYLIST_ID_DESC = "-playlistId"; + const TYPE_DESC = "-type"; + const UPDATED_AT_DESC = "-updatedAt"; +} + diff --git a/local/kaltura/API/KalturaPlugins/KalturaMetadataClientPlugin.php b/local/kaltura/API/KalturaPlugins/KalturaMetadataClientPlugin.php new file mode 100644 index 0000000000000..8e3e58dbcddbb --- /dev/null +++ b/local/kaltura/API/KalturaPlugins/KalturaMetadataClientPlugin.php @@ -0,0 +1,1640 @@ +. +// +// @ignore +// =================================================================================================== + +/** + * @package Kaltura + * @subpackage Client + */ +require_once(dirname(__FILE__) . "/../KalturaClientBase.php"); +require_once(dirname(__FILE__) . "/../KalturaEnums.php"); +require_once(dirname(__FILE__) . "/../KalturaTypes.php"); + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataProfileCreateMode extends KalturaEnumBase +{ + const API = 1; + const KMC = 2; + const APP = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataProfileStatus extends KalturaEnumBase +{ + const ACTIVE = 1; + const DEPRECATED = 2; + const TRANSFORMING = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataStatus extends KalturaEnumBase +{ + const VALID = 1; + const INVALID = 2; + const DELETED = 3; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataObjectType extends KalturaEnumBase +{ + const AD_CUE_POINT = "adCuePointMetadata.AdCuePoint"; + const ANNOTATION = "annotationMetadata.Annotation"; + const CODE_CUE_POINT = "codeCuePointMetadata.CodeCuePoint"; + const ANSWER_CUE_POINT = "quiz.AnswerCuePoint"; + const QUESTION_CUE_POINT = "quiz.QuestionCuePoint"; + const THUMB_CUE_POINT = "thumbCuePointMetadata.thumbCuePoint"; + const ENTRY = "1"; + const CATEGORY = "2"; + const USER = "3"; + const PARTNER = "4"; + const DYNAMIC_OBJECT = "5"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const METADATA_PROFILE_VERSION_ASC = "+metadataProfileVersion"; + const UPDATED_AT_ASC = "+updatedAt"; + const VERSION_ASC = "+version"; + const CREATED_AT_DESC = "-createdAt"; + const METADATA_PROFILE_VERSION_DESC = "-metadataProfileVersion"; + const UPDATED_AT_DESC = "-updatedAt"; + const VERSION_DESC = "-version"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataProfileOrderBy extends KalturaEnumBase +{ + const CREATED_AT_ASC = "+createdAt"; + const UPDATED_AT_ASC = "+updatedAt"; + const CREATED_AT_DESC = "-createdAt"; + const UPDATED_AT_DESC = "-updatedAt"; +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadata extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var int + * @readonly + */ + public $metadataProfileId = null; + + /** + * + * + * @var int + * @readonly + */ + public $metadataProfileVersion = null; + + /** + * + * + * @var KalturaMetadataObjectType + * @readonly + */ + public $metadataObjectType = null; + + /** + * + * + * @var string + * @readonly + */ + public $objectId = null; + + /** + * + * + * @var int + * @readonly + */ + public $version = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var KalturaMetadataStatus + * @readonly + */ + public $status = null; + + /** + * + * + * @var string + * @readonly + */ + public $xml = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataProfile extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var KalturaMetadataObjectType + */ + public $metadataObjectType = null; + + /** + * + * + * @var int + * @readonly + */ + public $version = null; + + /** + * + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $systemName = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var KalturaMetadataProfileStatus + * @readonly + */ + public $status = null; + + /** + * + * + * @var string + * @readonly + */ + public $xsd = null; + + /** + * + * + * @var string + * @readonly + */ + public $views = null; + + /** + * + * + * @var string + * @readonly + */ + public $xslt = null; + + /** + * + * + * @var KalturaMetadataProfileCreateMode + */ + public $createMode = null; + + /** + * + * + * @var bool + */ + public $disableReIndexing = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataProfileField extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var string + * @readonly + */ + public $xPath = null; + + /** + * + * + * @var string + * @readonly + */ + public $key = null; + + /** + * + * + * @var string + * @readonly + */ + public $label = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaImportMetadataJobData extends KalturaJobData +{ + /** + * + * + * @var string + */ + public $srcFileUrl = null; + + /** + * + * + * @var string + */ + public $destFileLocalPath = null; + + /** + * + * + * @var int + */ + public $metadataId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaMetadata + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMetadataProfileBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var KalturaMetadataObjectType + */ + public $metadataObjectTypeEqual = null; + + /** + * + * + * @var string + */ + public $metadataObjectTypeIn = null; + + /** + * + * + * @var int + */ + public $versionEqual = null; + + /** + * + * + * @var string + */ + public $nameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaMetadataProfileStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var KalturaMetadataProfileCreateMode + */ + public $createModeEqual = null; + + /** + * + * + * @var KalturaMetadataProfileCreateMode + */ + public $createModeNotEqual = null; + + /** + * + * + * @var string + */ + public $createModeIn = null; + + /** + * + * + * @var string + */ + public $createModeNotIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataProfileFieldListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaMetadataProfileField + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataProfileListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaMetadataProfile + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataReplacementOptionsItem extends KalturaPluginReplacementOptionsItem +{ + /** + * If true custom-metadata transferred to temp entry on entry replacement + * + * @var bool + */ + public $shouldCopyMetadata = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataResponseProfileMapping extends KalturaResponseProfileMapping +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaTransformMetadataJobData extends KalturaJobData +{ + /** + * + * + * @var KalturaFileContainer + */ + public $srcXsl; + + /** + * + * + * @var int + */ + public $srcVersion = null; + + /** + * + * + * @var int + */ + public $destVersion = null; + + /** + * + * + * @var KalturaFileContainer + */ + public $destXsd; + + /** + * + * + * @var int + */ + public $metadataProfileId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCompareMetadataCondition extends KalturaCompareCondition +{ + /** + * May contain the full xpath to the field in three formats + * 1. Slashed xPath, e.g. /metadata/myElementName + * 2. Using local-name function, e.g. /[local-name()='metadata']/[local-name()='myElementName'] + * 3. Using only the field name, e.g. myElementName, it will be searched as //myElementName + * + * @var string + */ + public $xPath = null; + + /** + * Metadata profile id + * + * @var int + */ + public $profileId = null; + + /** + * Metadata profile system name + * + * @var string + */ + public $profileSystemName = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDynamicObjectSearchItem extends KalturaSearchOperator +{ + /** + * + * + * @var string + */ + public $field = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMatchMetadataCondition extends KalturaMatchCondition +{ + /** + * May contain the full xpath to the field in three formats + * 1. Slashed xPath, e.g. /metadata/myElementName + * 2. Using local-name function, e.g. /[local-name()='metadata']/[local-name()='myElementName'] + * 3. Using only the field name, e.g. myElementName, it will be searched as //myElementName + * + * @var string + */ + public $xPath = null; + + /** + * Metadata profile id + * + * @var int + */ + public $profileId = null; + + /** + * Metadata profile system name + * + * @var string + */ + public $profileSystemName = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMetadataBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var int + */ + public $metadataProfileIdEqual = null; + + /** + * + * + * @var string + */ + public $metadataProfileIdIn = null; + + /** + * + * + * @var int + */ + public $metadataProfileVersionEqual = null; + + /** + * + * + * @var int + */ + public $metadataProfileVersionGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $metadataProfileVersionLessThanOrEqual = null; + + /** + * When null, default is KalturaMetadataObjectType::ENTRY + * + * @var KalturaMetadataObjectType + */ + public $metadataObjectTypeEqual = null; + + /** + * + * + * @var string + */ + public $objectIdEqual = null; + + /** + * + * + * @var string + */ + public $objectIdIn = null; + + /** + * + * + * @var int + */ + public $versionEqual = null; + + /** + * + * + * @var int + */ + public $versionGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $versionLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaMetadataStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataFieldChangedCondition extends KalturaMatchCondition +{ + /** + * May contain the full xpath to the field in three formats + * 1. Slashed xPath, e.g. /metadata/myElementName + * 2. Using local-name function, e.g. /[local-name()='metadata']/[local-name()='myElementName'] + * 3. Using only the field name, e.g. myElementName, it will be searched as //myElementName + * + * @var string + */ + public $xPath = null; + + /** + * Metadata profile id + * + * @var int + */ + public $profileId = null; + + /** + * Metadata profile system name + * + * @var string + */ + public $profileSystemName = null; + + /** + * + * + * @var string + */ + public $versionA = null; + + /** + * + * + * @var string + */ + public $versionB = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataProfileFilter extends KalturaMetadataProfileBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataSearchItem extends KalturaSearchOperator +{ + /** + * + * + * @var int + */ + public $metadataProfileId = null; + + /** + * + * + * @var string + */ + public $orderBy = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataField extends KalturaStringField +{ + /** + * May contain the full xpath to the field in three formats + * 1. Slashed xPath, e.g. /metadata/myElementName + * 2. Using local-name function, e.g. /[local-name()='metadata']/[local-name()='myElementName'] + * 3. Using only the field name, e.g. myElementName, it will be searched as //myElementName + * + * @var string + */ + public $xPath = null; + + /** + * Metadata profile id + * + * @var int + */ + public $profileId = null; + + /** + * Metadata profile system name + * + * @var string + */ + public $profileSystemName = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataFilter extends KalturaMetadataBaseFilter +{ + +} + + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Allows you to add a metadata object and metadata content associated with Kaltura object + * + * @param int $metadataProfileId + * @param string $objectType + * @param string $objectId + * @param string $xmlData XML metadata + * @return KalturaMetadata + */ + function add($metadataProfileId, $objectType, $objectId, $xmlData) + { + $kparams = array(); + $this->client->addParam($kparams, "metadataProfileId", $metadataProfileId); + $this->client->addParam($kparams, "objectType", $objectType); + $this->client->addParam($kparams, "objectId", $objectId); + $this->client->addParam($kparams, "xmlData", $xmlData); + $this->client->queueServiceActionCall("metadata_metadata", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadata"); + return $resultObject; + } + + /** + * Allows you to add a metadata xml data from remote URL. + Enables different permissions than addFromUrl action. + * + * @param int $metadataProfileId + * @param string $objectType + * @param string $objectId + * @param string $url XML metadata remote url + * @return KalturaMetadata + */ + function addFromBulk($metadataProfileId, $objectType, $objectId, $url) + { + $kparams = array(); + $this->client->addParam($kparams, "metadataProfileId", $metadataProfileId); + $this->client->addParam($kparams, "objectType", $objectType); + $this->client->addParam($kparams, "objectId", $objectId); + $this->client->addParam($kparams, "url", $url); + $this->client->queueServiceActionCall("metadata_metadata", "addFromBulk", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadata"); + return $resultObject; + } + + /** + * Allows you to add a metadata object and metadata file associated with Kaltura object + * + * @param int $metadataProfileId + * @param string $objectType + * @param string $objectId + * @param file $xmlFile XML metadata + * @return KalturaMetadata + */ + function addFromFile($metadataProfileId, $objectType, $objectId, $xmlFile) + { + $kparams = array(); + $this->client->addParam($kparams, "metadataProfileId", $metadataProfileId); + $this->client->addParam($kparams, "objectType", $objectType); + $this->client->addParam($kparams, "objectId", $objectId); + $kfiles = array(); + $this->client->addParam($kfiles, "xmlFile", $xmlFile); + $this->client->queueServiceActionCall("metadata_metadata", "addFromFile", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadata"); + return $resultObject; + } + + /** + * Allows you to add a metadata xml data from remote URL + * + * @param int $metadataProfileId + * @param string $objectType + * @param string $objectId + * @param string $url XML metadata remote url + * @return KalturaMetadata + */ + function addFromUrl($metadataProfileId, $objectType, $objectId, $url) + { + $kparams = array(); + $this->client->addParam($kparams, "metadataProfileId", $metadataProfileId); + $this->client->addParam($kparams, "objectType", $objectType); + $this->client->addParam($kparams, "objectId", $objectId); + $this->client->addParam($kparams, "url", $url); + $this->client->queueServiceActionCall("metadata_metadata", "addFromUrl", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadata"); + return $resultObject; + } + + /** + * Delete an existing metadata + * + * @param int $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("metadata_metadata", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Retrieve a metadata object by id + * + * @param int $id + * @return KalturaMetadata + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("metadata_metadata", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadata"); + return $resultObject; + } + + /** + * Index metadata by id, will also index the related object + * + * @param string $id + * @param bool $shouldUpdate + * @return int + */ + function index($id, $shouldUpdate) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "shouldUpdate", $shouldUpdate); + $this->client->queueServiceActionCall("metadata_metadata", "index", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "integer"); + return $resultObject; + } + + /** + * Mark existing metadata as invalid + Used by batch metadata transform + * + * @param int $id + * @param int $version Enable update only if the metadata object version did not change by other process + */ + function invalidate($id, $version = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "version", $version); + $this->client->queueServiceActionCall("metadata_metadata", "invalidate", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * List metadata objects by filter and pager + * + * @param KalturaMetadataFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaMetadataListResponse + */ + function listAction(KalturaMetadataFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("metadata_metadata", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataListResponse"); + return $resultObject; + } + + /** + * Serves metadata XML file + * + * @param int $id + * @return file + */ + function serve($id) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("metadata_metadata", "serve", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Update an existing metadata object with new XML content + * + * @param int $id + * @param string $xmlData XML metadata + * @param int $version Enable update only if the metadata object version did not change by other process + * @return KalturaMetadata + */ + function update($id, $xmlData = null, $version = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "xmlData", $xmlData); + $this->client->addParam($kparams, "version", $version); + $this->client->queueServiceActionCall("metadata_metadata", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadata"); + return $resultObject; + } + + /** + * Update an existing metadata object with new XML file + * + * @param int $id + * @param file $xmlFile XML metadata + * @return KalturaMetadata + */ + function updateFromFile($id, $xmlFile = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $kfiles = array(); + $this->client->addParam($kfiles, "xmlFile", $xmlFile); + $this->client->queueServiceActionCall("metadata_metadata", "updateFromFile", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadata"); + return $resultObject; + } + + /** + * Action transforms current metadata object XML using a provided XSL. + * + * @param int $id + * @param file $xslFile + * @return KalturaMetadata + */ + function updateFromXSL($id, $xslFile) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $kfiles = array(); + $this->client->addParam($kfiles, "xslFile", $xslFile); + $this->client->queueServiceActionCall("metadata_metadata", "updateFromXSL", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadata"); + return $resultObject; + } +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataProfileService extends KalturaServiceBase +{ + function __construct(KalturaClient $client = null) + { + parent::__construct($client); + } + + /** + * Allows you to add a metadata profile object and metadata profile content associated with Kaltura object type + * + * @param KalturaMetadataProfile $metadataProfile + * @param string $xsdData XSD metadata definition + * @param string $viewsData UI views definition + * @return KalturaMetadataProfile + */ + function add(KalturaMetadataProfile $metadataProfile, $xsdData, $viewsData = null) + { + $kparams = array(); + $this->client->addParam($kparams, "metadataProfile", $metadataProfile->toParams()); + $this->client->addParam($kparams, "xsdData", $xsdData); + $this->client->addParam($kparams, "viewsData", $viewsData); + $this->client->queueServiceActionCall("metadata_metadataprofile", "add", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfile"); + return $resultObject; + } + + /** + * Allows you to add a metadata profile object and metadata profile file associated with Kaltura object type + * + * @param KalturaMetadataProfile $metadataProfile + * @param file $xsdFile XSD metadata definition + * @param file $viewsFile UI views definition + * @return KalturaMetadataProfile + */ + function addFromFile(KalturaMetadataProfile $metadataProfile, $xsdFile, $viewsFile = null) + { + $kparams = array(); + $this->client->addParam($kparams, "metadataProfile", $metadataProfile->toParams()); + $kfiles = array(); + $this->client->addParam($kfiles, "xsdFile", $xsdFile); + $this->client->addParam($kfiles, "viewsFile", $viewsFile); + $this->client->queueServiceActionCall("metadata_metadataprofile", "addFromFile", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfile"); + return $resultObject; + } + + /** + * Delete an existing metadata profile + * + * @param int $id + */ + function delete($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("metadata_metadataprofile", "delete", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "null"); + } + + /** + * Retrieve a metadata profile object by id + * + * @param int $id + * @return KalturaMetadataProfile + */ + function get($id) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("metadata_metadataprofile", "get", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfile"); + return $resultObject; + } + + /** + * List metadata profile objects by filter and pager + * + * @param KalturaMetadataProfileFilter $filter + * @param KalturaFilterPager $pager + * @return KalturaMetadataProfileListResponse + */ + function listAction(KalturaMetadataProfileFilter $filter = null, KalturaFilterPager $pager = null) + { + $kparams = array(); + if ($filter !== null) + $this->client->addParam($kparams, "filter", $filter->toParams()); + if ($pager !== null) + $this->client->addParam($kparams, "pager", $pager->toParams()); + $this->client->queueServiceActionCall("metadata_metadataprofile", "list", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfileListResponse"); + return $resultObject; + } + + /** + * List metadata profile fields by metadata profile id + * + * @param int $metadataProfileId + * @return KalturaMetadataProfileFieldListResponse + */ + function listFields($metadataProfileId) + { + $kparams = array(); + $this->client->addParam($kparams, "metadataProfileId", $metadataProfileId); + $this->client->queueServiceActionCall("metadata_metadataprofile", "listFields", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfileFieldListResponse"); + return $resultObject; + } + + /** + * Update an existing metadata object definition file + * + * @param int $id + * @param int $toVersion + * @return KalturaMetadataProfile + */ + function revert($id, $toVersion) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "toVersion", $toVersion); + $this->client->queueServiceActionCall("metadata_metadataprofile", "revert", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfile"); + return $resultObject; + } + + /** + * Serves metadata profile XSD file + * + * @param int $id + * @return file + */ + function serve($id) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("metadata_metadataprofile", "serve", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Serves metadata profile view file + * + * @param int $id + * @return file + */ + function serveView($id) + { + if ($this->client->isMultiRequest()) + throw new KalturaClientException("Action is not supported as part of multi-request.", KalturaClientException::ERROR_ACTION_IN_MULTIREQUEST); + + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->queueServiceActionCall("metadata_metadataprofile", "serveView", $kparams); + if(!$this->client->getDestinationPath() && !$this->client->getReturnServedResult()) + return $this->client->getServeUrl(); + return $this->client->doQueue(); + } + + /** + * Update an existing metadata object + * + * @param int $id + * @param KalturaMetadataProfile $metadataProfile + * @param string $xsdData XSD metadata definition + * @param string $viewsData UI views definition + * @return KalturaMetadataProfile + */ + function update($id, KalturaMetadataProfile $metadataProfile, $xsdData = null, $viewsData = null) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $this->client->addParam($kparams, "metadataProfile", $metadataProfile->toParams()); + $this->client->addParam($kparams, "xsdData", $xsdData); + $this->client->addParam($kparams, "viewsData", $viewsData); + $this->client->queueServiceActionCall("metadata_metadataprofile", "update", $kparams); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfile"); + return $resultObject; + } + + /** + * Update an existing metadata object definition file + * + * @param int $id + * @param file $xsdFile XSD metadata definition + * @return KalturaMetadataProfile + */ + function updateDefinitionFromFile($id, $xsdFile) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $kfiles = array(); + $this->client->addParam($kfiles, "xsdFile", $xsdFile); + $this->client->queueServiceActionCall("metadata_metadataprofile", "updateDefinitionFromFile", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfile"); + return $resultObject; + } + + /** + * Update an existing metadata object xslt file + * + * @param int $id + * @param file $xsltFile XSLT file, will be executed on every metadata add/update + * @return KalturaMetadataProfile + */ + function updateTransformationFromFile($id, $xsltFile) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $kfiles = array(); + $this->client->addParam($kfiles, "xsltFile", $xsltFile); + $this->client->queueServiceActionCall("metadata_metadataprofile", "updateTransformationFromFile", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfile"); + return $resultObject; + } + + /** + * Update an existing metadata object views file + * + * @param int $id + * @param file $viewsFile UI views file + * @return KalturaMetadataProfile + */ + function updateViewsFromFile($id, $viewsFile) + { + $kparams = array(); + $this->client->addParam($kparams, "id", $id); + $kfiles = array(); + $this->client->addParam($kfiles, "viewsFile", $viewsFile); + $this->client->queueServiceActionCall("metadata_metadataprofile", "updateViewsFromFile", $kparams, $kfiles); + if ($this->client->isMultiRequest()) + return $this->client->getMultiRequestResult(); + $resultObject = $this->client->doQueue(); + $this->client->throwExceptionIfError($resultObject); + $this->client->validateObjectType($resultObject, "KalturaMetadataProfile"); + return $resultObject; + } +} +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMetadataClientPlugin extends KalturaClientPlugin +{ + /** + * @var KalturaMetadataService + */ + public $metadata = null; + + /** + * @var KalturaMetadataProfileService + */ + public $metadataProfile = null; + + protected function __construct(KalturaClient $client) + { + parent::__construct($client); + $this->metadata = new KalturaMetadataService($client); + $this->metadataProfile = new KalturaMetadataProfileService($client); + } + + /** + * @return KalturaMetadataClientPlugin + */ + public static function get(KalturaClient $client) + { + return new KalturaMetadataClientPlugin($client); + } + + /** + * @return array + */ + public function getServices() + { + $services = array( + 'metadata' => $this->metadata, + 'metadataProfile' => $this->metadataProfile, + ); + return $services; + } + + /** + * @return string + */ + public function getName() + { + return 'metadata'; + } +} + diff --git a/local/kaltura/API/KalturaTypes.php b/local/kaltura/API/KalturaTypes.php new file mode 100644 index 0000000000000..83d9a156c508a --- /dev/null +++ b/local/kaltura/API/KalturaTypes.php @@ -0,0 +1,22682 @@ +. +// +// @ignore +// =================================================================================================== + +/** + * @package Kaltura + * @subpackage Client + */ +require_once(dirname(__FILE__) . "/KalturaClientBase.php"); + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaListResponse extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $totalCount = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBaseRestriction extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControl extends KalturaObjectBase +{ + /** + * The id of the Access Control Profile + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * The name of the Access Control Profile + * + * @var string + */ + public $name = null; + + /** + * System name of the Access Control Profile + * + * @var string + */ + public $systemName = null; + + /** + * The description of the Access Control Profile + * + * @var string + */ + public $description = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * True if this Conversion Profile is the default + * + * @var KalturaNullableBoolean + */ + public $isDefault = null; + + /** + * Array of Access Control Restrictions + * + * @var array of KalturaBaseRestriction + */ + public $restrictions; + + /** + * Indicates that the access control profile is new and should be handled using KalturaAccessControlProfile object and accessControlProfile service + * + * @var bool + * @readonly + */ + public $containsUnsuportedRestrictions = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaContextTypeHolder extends KalturaObjectBase +{ + /** + * The type of the condition context + * + * @var KalturaContextType + */ + public $type = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlContextTypeHolder extends KalturaContextTypeHolder +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlMessage extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $message = null; + + /** + * + * + * @var string + */ + public $code = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaRuleAction extends KalturaObjectBase +{ + /** + * The type of the action + * + * @var KalturaRuleActionType + * @readonly + */ + public $type = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaCondition extends KalturaObjectBase +{ + /** + * The type of the access control condition + * + * @var KalturaConditionType + * @readonly + */ + public $type = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var bool + */ + public $not = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRule extends KalturaObjectBase +{ + /** + * Short Rule Description + * + * @var string + */ + public $description = null; + + /** + * Rule Custom Data to allow saving rule specific information + * + * @var string + */ + public $ruleData = null; + + /** + * Message to be thrown to the player in case the rule is fulfilled + * + * @var string + */ + public $message = null; + + /** + * Code to be thrown to the player in case the rule is fulfilled + * + * @var string + */ + public $code = null; + + /** + * Actions to be performed by the player in case the rule is fulfilled + * + * @var array of KalturaRuleAction + */ + public $actions; + + /** + * Conditions to validate the rule + * + * @var array of KalturaCondition + */ + public $conditions; + + /** + * Indicates what contexts should be tested by this rule + * + * @var array of KalturaContextTypeHolder + */ + public $contexts; + + /** + * Indicates that this rule is enough and no need to continue checking the rest of the rules + * + * @var bool + */ + public $stopProcessing = null; + + /** + * Indicates if we should force ks validation for admin ks users as well + * + * @var KalturaNullableBoolean + */ + public $forceAdminValidation = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlProfile extends KalturaObjectBase +{ + /** + * The id of the Access Control Profile + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * The name of the Access Control Profile + * + * @var string + */ + public $name = null; + + /** + * System name of the Access Control Profile + * + * @var string + */ + public $systemName = null; + + /** + * The description of the Access Control Profile + * + * @var string + */ + public $description = null; + + /** + * Creation time as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Update time as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * True if this access control profile is the partner default + * + * @var KalturaNullableBoolean + */ + public $isDefault = null; + + /** + * Array of access control rules + * + * @var array of KalturaRule + */ + public $rules; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaKeyValue extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $key = null; + + /** + * + * + * @var string + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlScope extends KalturaObjectBase +{ + /** + * URL to be used to test domain conditions. + * + * @var string + */ + public $referrer = null; + + /** + * IP to be used to test geographic location conditions. + * + * @var string + */ + public $ip = null; + + /** + * Kaltura session to be used to test session and user conditions. + * + * @var string + */ + public $ks = null; + + /** + * Browser or client application to be used to test agent conditions. + * + * @var string + */ + public $userAgent = null; + + /** + * Unix timestamp (In seconds) to be used to test entry scheduling, keep null to use now. + * + * @var int + */ + public $time = null; + + /** + * Indicates what contexts should be tested. No contexts means any context. + * + * @var array of KalturaAccessControlContextTypeHolder + */ + public $contexts; + + /** + * Array of hashes to pass to the access control profile scope + * + * @var array of KalturaKeyValue + */ + public $hashes; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportFilter extends KalturaObjectBase +{ + /** + * The dimension whose values should be filtered + * + * @var string + */ + public $dimension = null; + + /** + * The (comma separated) values to include in the filter + * + * @var string + */ + public $values = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAnalyticsFilter extends KalturaObjectBase +{ + /** + * Query start time (in local time) MM/dd/yyyy HH:mi + * + * @var string + */ + public $from_time = null; + + /** + * Query end time (in local time) MM/dd/yyyy HH:mi + * + * @var string + */ + public $to_time = null; + + /** + * Comma separated metrics list + * + * @var string + */ + public $metrics = null; + + /** + * Timezone offset from UTC (in minutes) + * + * @var float + */ + public $utcOffset = null; + + /** + * Comma separated dimensions list + * + * @var string + */ + public $dimensions = null; + + /** + * Array of filters + * + * @var array of KalturaReportFilter + */ + public $filters; + + /** + * Query order by metric/dimension + * + * @var string + */ + public $orderBy = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaApiExceptionArg extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAppToken extends KalturaObjectBase +{ + /** + * The id of the application token + * + * @var string + * @readonly + */ + public $id = null; + + /** + * The application token + * + * @var string + * @readonly + */ + public $token = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * Creation time as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Update time as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * Application token status + * + * @var KalturaAppTokenStatus + * @readonly + */ + public $status = null; + + /** + * Expiry time of current token (unix timestamp in seconds) + * + * @var int + */ + public $expiry = null; + + /** + * Type of KS (Kaltura Session) that created using the current token + * + * @var KalturaSessionType + */ + public $sessionType = null; + + /** + * User id of KS (Kaltura Session) that created using the current token + * + * @var string + */ + public $sessionUserId = null; + + /** + * Expiry duration of KS (Kaltura Session) that created using the current token (in seconds) + * + * @var int + */ + public $sessionDuration = null; + + /** + * Comma separated privileges to be applied on KS (Kaltura Session) that created using the current token + * + * @var string + */ + public $sessionPrivileges = null; + + /** + * + * + * @var KalturaAppTokenHashType + */ + public $hashType = null; + + /** + * + * + * @var string + */ + public $description = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAsset extends KalturaObjectBase +{ + /** + * The ID of the Flavor Asset + * + * @var string + * @readonly + */ + public $id = null; + + /** + * The entry ID of the Flavor Asset + * + * @var string + * @readonly + */ + public $entryId = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * The version of the Flavor Asset + * + * @var int + * @readonly + */ + public $version = null; + + /** + * The size (in KBytes) of the Flavor Asset + * + * @var int + * @readonly + */ + public $size = null; + + /** + * Tags used to identify the Flavor Asset in various scenarios + * + * @var string + */ + public $tags = null; + + /** + * The file extension + * + * @var string + * @insertonly + */ + public $fileExt = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $deletedAt = null; + + /** + * System description, error message, warnings and failure cause. + * + * @var string + * @readonly + */ + public $description = null; + + /** + * Partner private data + * + * @var string + */ + public $partnerData = null; + + /** + * Partner friendly description + * + * @var string + */ + public $partnerDescription = null; + + /** + * Comma separated list of source flavor params ids + * + * @var string + */ + public $actualSourceAssetParamsIds = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaString extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetParams extends KalturaObjectBase +{ + /** + * The id of the Flavor Params + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + */ + public $partnerId = null; + + /** + * The name of the Flavor Params + * + * @var string + */ + public $name = null; + + /** + * System name of the Flavor Params + * + * @var string + */ + public $systemName = null; + + /** + * The description of the Flavor Params + * + * @var string + */ + public $description = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * True if those Flavor Params are part of system defaults + * + * @var KalturaNullableBoolean + * @readonly + */ + public $isSystemDefault = null; + + /** + * The Flavor Params tags are used to identify the flavor for different usage (e.g. web, hd, mobile) + * + * @var string + */ + public $tags = null; + + /** + * Array of partner permisison names that required for using this asset params + * + * @var array of KalturaString + */ + public $requiredPermissions; + + /** + * Id of remote storage profile that used to get the source, zero indicates Kaltura data center + * + * @var int + */ + public $sourceRemoteStorageProfileId = null; + + /** + * Comma seperated ids of remote storage profiles that the flavor distributed to, the distribution done by the conversion engine + * + * @var int + */ + public $remoteStorageProfileIds = null; + + /** + * Media parser type to be used for post-conversion validation + * + * @var KalturaMediaParserType + */ + public $mediaParserType = null; + + /** + * Comma seperated ids of source flavor params this flavor is created from + * + * @var string + */ + public $sourceAssetParamsIds = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaResource extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaContentResource extends KalturaResource +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetParamsResourceContainer extends KalturaResource +{ + /** + * The content resource to associate with asset params + * + * @var KalturaContentResource + */ + public $resource; + + /** + * The asset params to associate with the reaource + * + * @var int + */ + public $assetParamsId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetServeOptions extends KalturaObjectBase +{ + /** + * + * + * @var bool + */ + public $download = null; + + /** + * + * + * @var string + */ + public $referrer = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaOperationAttributes extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntry extends KalturaObjectBase +{ + /** + * Auto generated 10 characters alphanumeric string + * + * @var string + * @readonly + */ + public $id = null; + + /** + * Entry name (Min 1 chars) + * + * @var string + */ + public $name = null; + + /** + * Entry description + * + * @var string + */ + public $description = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * The ID of the user who is the owner of this entry + * + * @var string + */ + public $userId = null; + + /** + * The ID of the user who created this entry + * + * @var string + * @insertonly + */ + public $creatorId = null; + + /** + * Entry tags + * + * @var string + */ + public $tags = null; + + /** + * Entry admin tags can be updated only by administrators + * + * @var string + */ + public $adminTags = null; + + /** + * Comma separated list of full names of categories to which this entry belongs. Only categories that don't have entitlement (privacy context) are listed, to retrieve the full list of categories, use the categoryEntry.list action. + * + * @var string + */ + public $categories = null; + + /** + * Comma separated list of ids of categories to which this entry belongs. Only categories that don't have entitlement (privacy context) are listed, to retrieve the full list of categories, use the categoryEntry.list action. + * + * @var string + */ + public $categoriesIds = null; + + /** + * + * + * @var KalturaEntryStatus + * @readonly + */ + public $status = null; + + /** + * Entry moderation status + * + * @var KalturaEntryModerationStatus + * @readonly + */ + public $moderationStatus = null; + + /** + * Number of moderation requests waiting for this entry + * + * @var int + * @readonly + */ + public $moderationCount = null; + + /** + * The type of the entry, this is auto filled by the derived entry object + * + * @var KalturaEntryType + */ + public $type = null; + + /** + * Entry creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Entry update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * The calculated average rank. rank = totalRank / votes + * + * @var float + * @readonly + */ + public $rank = null; + + /** + * The sum of all rank values submitted to the baseEntry.anonymousRank action + * + * @var int + * @readonly + */ + public $totalRank = null; + + /** + * A count of all requests made to the baseEntry.anonymousRank action + * + * @var int + * @readonly + */ + public $votes = null; + + /** + * + * + * @var int + */ + public $groupId = null; + + /** + * Can be used to store various partner related data as a string + * + * @var string + */ + public $partnerData = null; + + /** + * Download URL for the entry + * + * @var string + * @readonly + */ + public $downloadUrl = null; + + /** + * Indexed search text for full text search + * + * @var string + * @readonly + */ + public $searchText = null; + + /** + * License type used for this entry + * + * @var KalturaLicenseType + */ + public $licenseType = null; + + /** + * Version of the entry data + * + * @var int + * @readonly + */ + public $version = null; + + /** + * Thumbnail URL + * + * @var string + * @readonly + */ + public $thumbnailUrl = null; + + /** + * The Access Control ID assigned to this entry (null when not set, send -1 to remove) + * + * @var int + */ + public $accessControlId = null; + + /** + * Entry scheduling start date (null when not set, send -1 to remove) + * + * @var int + */ + public $startDate = null; + + /** + * Entry scheduling end date (null when not set, send -1 to remove) + * + * @var int + */ + public $endDate = null; + + /** + * Entry external reference id + * + * @var string + */ + public $referenceId = null; + + /** + * ID of temporary entry that will replace this entry when it's approved and ready for replacement + * + * @var string + * @readonly + */ + public $replacingEntryId = null; + + /** + * ID of the entry that will be replaced when the replacement approved and this entry is ready + * + * @var string + * @readonly + */ + public $replacedEntryId = null; + + /** + * Status of the replacement readiness and approval + * + * @var KalturaEntryReplacementStatus + * @readonly + */ + public $replacementStatus = null; + + /** + * Can be used to store various partner related data as a numeric value + * + * @var int + */ + public $partnerSortValue = null; + + /** + * Override the default ingestion profile + * + * @var int + */ + public $conversionProfileId = null; + + /** + * IF not empty, points to an entry ID the should replace this current entry's id. + * + * @var string + */ + public $redirectEntryId = null; + + /** + * ID of source root entry, used for clipped, skipped and cropped entries that created from another entry + * + * @var string + * @readonly + */ + public $rootEntryId = null; + + /** + * ID of source root entry, used for defining entires association + * + * @var string + */ + public $parentEntryId = null; + + /** + * clipping, skipping and cropping attributes that used to create this entry + * + * @var array of KalturaOperationAttributes + */ + public $operationAttributes; + + /** + * list of user ids that are entitled to edit the entry (no server enforcement) The difference between entitledUsersEdit, entitledUsersPublish and entitledUsersView is applicative only + * + * @var string + */ + public $entitledUsersEdit = null; + + /** + * list of user ids that are entitled to publish the entry (no server enforcement) The difference between entitledUsersEdit, entitledUsersPublish and entitledUsersView is applicative only + * + * @var string + */ + public $entitledUsersPublish = null; + + /** + * list of user ids that are entitled to view the entry (no server enforcement) The difference between entitledUsersEdit, entitledUsersPublish and entitledUsersView is applicative only + * + * @var string + */ + public $entitledUsersView = null; + + /** + * Comma seperated string of the capabilities of the entry. Any capability needed can be added to this list. + * + * @var string + * @readonly + */ + public $capabilities = null; + + /** + * Template entry id + * + * @var string + * @insertonly + */ + public $templateEntryId = null; + + /** + * should we display this entry in search + * + * @var KalturaEntryDisplayInSearchType + */ + public $displayInSearch = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBaseEntryCloneOptionItem extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBaseResponseProfile extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBaseSyndicationFeed extends KalturaObjectBase +{ + /** + * + * + * @var string + * @readonly + */ + public $id = null; + + /** + * + * + * @var string + * @readonly + */ + public $feedUrl = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * link a playlist that will set what content the feed will include + * if empty, all content will be included in feed + * + * @var string + */ + public $playlistId = null; + + /** + * feed name + * + * @var string + */ + public $name = null; + + /** + * feed status + * + * @var KalturaSyndicationFeedStatus + * @readonly + */ + public $status = null; + + /** + * feed type + * + * @var KalturaSyndicationFeedType + * @insertonly + */ + public $type = null; + + /** + * Base URL for each video, on the partners site + * This is required by all syndication types. + * + * @var string + */ + public $landingPage = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * allow_embed tells google OR yahoo weather to allow embedding the video on google OR yahoo video results + * or just to provide a link to the landing page. + * it is applied on the video-player_loc property in the XML (google) + * and addes media-player tag (yahoo) + * + * @var bool + */ + public $allowEmbed = null; + + /** + * Select a uiconf ID as player skin to include in the kwidget url + * + * @var int + */ + public $playerUiconfId = null; + + /** + * + * + * @var int + */ + public $flavorParamId = null; + + /** + * + * + * @var bool + */ + public $transcodeExistingContent = null; + + /** + * + * + * @var bool + */ + public $addToDefaultConversionProfile = null; + + /** + * + * + * @var string + */ + public $categories = null; + + /** + * + * + * @var int + */ + public $storageId = null; + + /** + * + * + * @var KalturaSyndicationFeedEntriesOrderBy + */ + public $entriesOrderBy = null; + + /** + * Should enforce entitlement on feed entries + * + * @var bool + */ + public $enforceEntitlement = null; + + /** + * Set privacy context for search entries that assiged to private and public categories within a category privacy context. + * + * @var string + */ + public $privacyContext = null; + + /** + * Update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var bool + */ + public $useCategoryEntries = null; + + /** + * Feed content-type header value + * + * @var string + */ + public $feedContentTypeHeader = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaJobData extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchHistoryData extends KalturaObjectBase +{ + /** + * + * + * @var int + */ + public $schedulerId = null; + + /** + * + * + * @var int + */ + public $workerId = null; + + /** + * + * + * @var int + */ + public $batchIndex = null; + + /** + * + * + * @var int + */ + public $timeStamp = null; + + /** + * + * + * @var string + */ + public $message = null; + + /** + * + * + * @var int + */ + public $errType = null; + + /** + * + * + * @var int + */ + public $errNumber = null; + + /** + * + * + * @var string + */ + public $hostName = null; + + /** + * + * + * @var string + */ + public $sessionId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchJob extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $deletedAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $lockExpiration = null; + + /** + * + * + * @var int + * @readonly + */ + public $executionAttempts = null; + + /** + * + * + * @var int + * @readonly + */ + public $lockVersion = null; + + /** + * + * + * @var string + */ + public $entryId = null; + + /** + * + * + * @var string + */ + public $entryName = null; + + /** + * + * + * @var KalturaBatchJobType + * @readonly + */ + public $jobType = null; + + /** + * + * + * @var int + */ + public $jobSubType = null; + + /** + * + * + * @var KalturaJobData + */ + public $data; + + /** + * + * + * @var KalturaBatchJobStatus + */ + public $status = null; + + /** + * + * + * @var int + */ + public $abort = null; + + /** + * + * + * @var int + */ + public $checkAgainTimeout = null; + + /** + * + * + * @var string + */ + public $message = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var int + */ + public $priority = null; + + /** + * + * + * @var array of KalturaBatchHistoryData + */ + public $history; + + /** + * The id of the bulk upload job that initiated this job + * + * @var int + */ + public $bulkJobId = null; + + /** + * + * + * @var int + */ + public $batchVersion = null; + + /** + * When one job creates another - the parent should set this parentJobId to be its own id. + * + * @var int + */ + public $parentJobId = null; + + /** + * The id of the root parent job + * + * @var int + */ + public $rootJobId = null; + + /** + * The time that the job was pulled from the queue + * + * @var int + */ + public $queueTime = null; + + /** + * The time that the job was finished or closed as failed + * + * @var int + */ + public $finishTime = null; + + /** + * + * + * @var KalturaBatchJobErrorTypes + */ + public $errType = null; + + /** + * + * + * @var int + */ + public $errNumber = null; + + /** + * + * + * @var int + */ + public $estimatedEffort = null; + + /** + * + * + * @var int + */ + public $urgency = null; + + /** + * + * + * @var int + */ + public $schedulerId = null; + + /** + * + * + * @var int + */ + public $workerId = null; + + /** + * + * + * @var int + */ + public $batchIndex = null; + + /** + * + * + * @var int + */ + public $lastSchedulerId = null; + + /** + * + * + * @var int + */ + public $lastWorkerId = null; + + /** + * + * + * @var int + */ + public $dc = null; + + /** + * + * + * @var string + */ + public $jobObjectId = null; + + /** + * + * + * @var int + */ + public $jobObjectType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlayerDeliveryType extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $id = null; + + /** + * + * + * @var string + */ + public $label = null; + + /** + * + * + * @var array of KalturaKeyValue + */ + public $flashvars; + + /** + * + * + * @var string + */ + public $minVersion = null; + + /** + * + * + * @var bool + */ + public $enabledByDefault = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlayerEmbedCodeType extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $id = null; + + /** + * + * + * @var string + */ + public $label = null; + + /** + * + * + * @var bool + */ + public $entryOnly = null; + + /** + * + * + * @var string + */ + public $minVersion = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaESearchLanguageItem extends KalturaObjectBase +{ + /** + * + * + * @var KalturaESearchLanguage + */ + public $eSerachLanguage = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartner extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $website = null; + + /** + * + * + * @var string + */ + public $notificationUrl = null; + + /** + * + * + * @var int + */ + public $appearInSearch = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * deprecated - lastName and firstName replaces this field + * + * @var string + */ + public $adminName = null; + + /** + * + * + * @var string + */ + public $adminEmail = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var KalturaCommercialUseType + */ + public $commercialUse = null; + + /** + * + * + * @var string + */ + public $landingPage = null; + + /** + * + * + * @var string + */ + public $userLandingPage = null; + + /** + * + * + * @var string + */ + public $contentCategories = null; + + /** + * + * + * @var KalturaPartnerType + */ + public $type = null; + + /** + * + * + * @var string + */ + public $phone = null; + + /** + * + * + * @var string + */ + public $describeYourself = null; + + /** + * + * + * @var bool + */ + public $adultContent = null; + + /** + * + * + * @var string + */ + public $defConversionProfileType = null; + + /** + * + * + * @var int + */ + public $notify = null; + + /** + * + * + * @var KalturaPartnerStatus + * @readonly + */ + public $status = null; + + /** + * + * + * @var int + */ + public $allowQuickEdit = null; + + /** + * + * + * @var int + */ + public $mergeEntryLists = null; + + /** + * + * + * @var string + */ + public $notificationsConfig = null; + + /** + * + * + * @var int + */ + public $maxUploadSize = null; + + /** + * + * + * @var int + */ + public $partnerPackage = null; + + /** + * + * + * @var string + * @readonly + */ + public $secret = null; + + /** + * + * + * @var string + * @readonly + */ + public $adminSecret = null; + + /** + * + * + * @var string + * @readonly + */ + public $cmsPassword = null; + + /** + * + * + * @var int + */ + public $allowMultiNotification = null; + + /** + * + * + * @var int + * @readonly + */ + public $adminLoginUsersQuota = null; + + /** + * + * + * @var string + */ + public $adminUserId = null; + + /** + * firstName and lastName replace the old (deprecated) adminName + * + * @var string + */ + public $firstName = null; + + /** + * lastName and firstName replace the old (deprecated) adminName + * + * @var string + */ + public $lastName = null; + + /** + * country code (2char) - this field is optional + * + * @var string + */ + public $country = null; + + /** + * state code (2char) - this field is optional + * + * @var string + */ + public $state = null; + + /** + * + * + * @var array of KalturaKeyValue + * @insertonly + */ + public $additionalParams; + + /** + * + * + * @var int + * @readonly + */ + public $publishersQuota = null; + + /** + * + * + * @var KalturaPartnerGroupType + * @readonly + */ + public $partnerGroupType = null; + + /** + * + * + * @var bool + * @readonly + */ + public $defaultEntitlementEnforcement = null; + + /** + * + * + * @var string + * @readonly + */ + public $defaultDeliveryType = null; + + /** + * + * + * @var string + * @readonly + */ + public $defaultEmbedCodeType = null; + + /** + * + * + * @var array of KalturaPlayerDeliveryType + * @readonly + */ + public $deliveryTypes; + + /** + * + * + * @var array of KalturaPlayerEmbedCodeType + * @readonly + */ + public $embedCodeTypes; + + /** + * + * + * @var int + * @readonly + */ + public $templatePartnerId = null; + + /** + * + * + * @var bool + * @readonly + */ + public $ignoreSeoLinks = null; + + /** + * + * + * @var string + * @readonly + */ + public $host = null; + + /** + * + * + * @var string + * @readonly + */ + public $cdnHost = null; + + /** + * + * + * @var bool + * @readonly + */ + public $isFirstLogin = null; + + /** + * + * + * @var string + * @readonly + */ + public $logoutUrl = null; + + /** + * + * + * @var int + */ + public $partnerParentId = null; + + /** + * + * + * @var string + * @readonly + */ + public $crmId = null; + + /** + * + * + * @var string + */ + public $referenceId = null; + + /** + * + * + * @var bool + * @readonly + */ + public $timeAlignedRenditions = null; + + /** + * + * + * @var array of KalturaESearchLanguageItem + */ + public $eSearchLanguages; + + /** + * + * + * @var int + * @readonly + */ + public $publisherEnvironmentType = null; + + /** + * + * + * @var string + * @readonly + */ + public $ovpEnvironmentUrl = null; + + /** + * + * + * @var string + * @readonly + */ + public $ottEnvironmentUrl = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaValue extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $description = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBooleanValue extends KalturaValue +{ + /** + * + * + * @var bool + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadPluginData extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $field = null; + + /** + * + * + * @var string + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadResult extends KalturaObjectBase +{ + /** + * The id of the result + * + * @var int + * @readonly + */ + public $id = null; + + /** + * The id of the parent job + * + * @var int + */ + public $bulkUploadJobId = null; + + /** + * The index of the line in the CSV + * + * @var int + */ + public $lineIndex = null; + + /** + * + * + * @var int + */ + public $partnerId = null; + + /** + * + * + * @var KalturaBulkUploadResultStatus + */ + public $status = null; + + /** + * + * + * @var KalturaBulkUploadAction + */ + public $action = null; + + /** + * + * + * @var string + */ + public $objectId = null; + + /** + * + * + * @var int + */ + public $objectStatus = null; + + /** + * + * + * @var KalturaBulkUploadObjectType + */ + public $bulkUploadResultObjectType = null; + + /** + * The data as recieved in the csv + * + * @var string + */ + public $rowData = null; + + /** + * + * + * @var string + */ + public $partnerData = null; + + /** + * + * + * @var string + */ + public $objectErrorDescription = null; + + /** + * + * + * @var array of KalturaBulkUploadPluginData + */ + public $pluginsData; + + /** + * + * + * @var string + */ + public $errorDescription = null; + + /** + * + * + * @var string + */ + public $errorCode = null; + + /** + * + * + * @var int + */ + public $errorType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUpload extends KalturaObjectBase +{ + /** + * + * + * @var int + */ + public $id = null; + + /** + * + * + * @var string + */ + public $uploadedBy = null; + + /** + * + * + * @var string + */ + public $uploadedByUserId = null; + + /** + * + * + * @var int + */ + public $uploadedOn = null; + + /** + * + * + * @var int + */ + public $numOfEntries = null; + + /** + * + * + * @var KalturaBatchJobStatus + */ + public $status = null; + + /** + * + * + * @var string + */ + public $logFileUrl = null; + + /** + * + * + * @var string + */ + public $csvFileUrl = null; + + /** + * + * + * @var string + */ + public $bulkFileUrl = null; + + /** + * + * + * @var KalturaBulkUploadType + */ + public $bulkUploadType = null; + + /** + * + * + * @var array of KalturaBulkUploadResult + */ + public $results; + + /** + * + * + * @var string + */ + public $error = null; + + /** + * + * + * @var KalturaBatchJobErrorTypes + */ + public $errorType = null; + + /** + * + * + * @var int + */ + public $errorNumber = null; + + /** + * + * + * @var string + */ + public $fileName = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var int + */ + public $numOfObjects = null; + + /** + * + * + * @var KalturaBulkUploadObjectType + */ + public $bulkUploadObjectType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBulkUploadObjectData extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCEError extends KalturaObjectBase +{ + /** + * + * + * @var string + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + */ + public $partnerId = null; + + /** + * + * + * @var string + */ + public $browser = null; + + /** + * + * + * @var string + */ + public $serverIp = null; + + /** + * + * + * @var string + */ + public $serverOs = null; + + /** + * + * + * @var string + */ + public $phpVersion = null; + + /** + * + * + * @var string + */ + public $ceAdminEmail = null; + + /** + * + * + * @var string + */ + public $type = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var string + */ + public $data = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategory extends KalturaObjectBase +{ + /** + * The id of the Category + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + */ + public $parentId = null; + + /** + * + * + * @var int + * @readonly + */ + public $depth = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * The name of the Category. + * The following characters are not allowed: '<', '>', ',' + * + * @var string + */ + public $name = null; + + /** + * The full name of the Category + * + * @var string + * @readonly + */ + public $fullName = null; + + /** + * The full ids of the Category + * + * @var string + * @readonly + */ + public $fullIds = null; + + /** + * Number of entries in this Category (including child categories) + * + * @var int + * @readonly + */ + public $entriesCount = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * Category description + * + * @var string + */ + public $description = null; + + /** + * Category tags + * + * @var string + */ + public $tags = null; + + /** + * If category will be returned for list action. + * + * @var KalturaAppearInListType + */ + public $appearInList = null; + + /** + * defines the privacy of the entries that assigned to this category + * + * @var KalturaPrivacyType + */ + public $privacy = null; + + /** + * If Category members are inherited from parent category or set manualy. + * + * @var KalturaInheritanceType + */ + public $inheritanceType = null; + + /** + * Who can ask to join this category + * + * @var KalturaUserJoinPolicyType + * @readonly + */ + public $userJoinPolicy = null; + + /** + * Default permissionLevel for new users + * + * @var KalturaCategoryUserPermissionLevel + */ + public $defaultPermissionLevel = null; + + /** + * Category Owner (User id) + * + * @var string + */ + public $owner = null; + + /** + * Number of entries that belong to this category directly + * + * @var int + * @readonly + */ + public $directEntriesCount = null; + + /** + * Category external id, controlled and managed by the partner. + * + * @var string + */ + public $referenceId = null; + + /** + * who can assign entries to this category + * + * @var KalturaContributionPolicyType + */ + public $contributionPolicy = null; + + /** + * Number of active members for this category + * + * @var int + * @readonly + */ + public $membersCount = null; + + /** + * Number of pending members for this category + * + * @var int + * @readonly + */ + public $pendingMembersCount = null; + + /** + * Set privacy context for search entries that assiged to private and public categories. the entries will be private if the search context is set with those categories. + * + * @var string + */ + public $privacyContext = null; + + /** + * comma separated parents that defines a privacyContext for search + * + * @var string + * @readonly + */ + public $privacyContexts = null; + + /** + * Status + * + * @var KalturaCategoryStatus + * @readonly + */ + public $status = null; + + /** + * The category id that this category inherit its members and members permission (for contribution and join) + * + * @var int + * @readonly + */ + public $inheritedParentId = null; + + /** + * Can be used to store various partner related data as a numeric value + * + * @var int + */ + public $partnerSortValue = null; + + /** + * Can be used to store various partner related data as a string + * + * @var string + */ + public $partnerData = null; + + /** + * Enable client side applications to define how to sort the category child categories + * + * @var KalturaCategoryOrderBy + */ + public $defaultOrderBy = null; + + /** + * Number of direct children categories + * + * @var int + * @readonly + */ + public $directSubCategoriesCount = null; + + /** + * Moderation to add entries to this category by users that are not of permission level Manager or Moderator. + * + * @var KalturaNullableBoolean + */ + public $moderation = null; + + /** + * Nunber of pending moderation entries + * + * @var int + * @readonly + */ + public $pendingEntriesCount = null; + + /** + * Flag indicating that the category is an aggregation category + * + * @var KalturaNullableBoolean + */ + public $isAggregationCategory = null; + + /** + * List of aggregation channels the category belongs to + * + * @var string + */ + public $aggregationCategories = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryEntry extends KalturaObjectBase +{ + /** + * + * + * @var int + */ + public $categoryId = null; + + /** + * entry id + * + * @var string + */ + public $entryId = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * The full ids of the Category + * + * @var string + * @readonly + */ + public $categoryFullIds = null; + + /** + * CategroyEntry status + * + * @var KalturaCategoryEntryStatus + * @readonly + */ + public $status = null; + + /** + * CategroyEntry creator puser ID + * + * @var string + * @readonly + */ + public $creatorUserId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryUser extends KalturaObjectBase +{ + /** + * + * + * @var int + * @insertonly + */ + public $categoryId = null; + + /** + * User id + * + * @var string + * @insertonly + */ + public $userId = null; + + /** + * Partner id + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * Permission level + * + * @var KalturaCategoryUserPermissionLevel + */ + public $permissionLevel = null; + + /** + * Status + * + * @var KalturaCategoryUserStatus + * @readonly + */ + public $status = null; + + /** + * CategoryUser creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * CategoryUser update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * Update method can be either manual or automatic to distinguish between manual operations (for example in KMC) on automatic - using bulk upload + * + * @var KalturaUpdateMethodType + */ + public $updateMethod = null; + + /** + * The full ids of the Category + * + * @var string + * @readonly + */ + public $categoryFullIds = null; + + /** + * Set of category-related permissions for the current category user. + * + * @var string + */ + public $permissionNames = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaClientConfiguration extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $clientTag = null; + + /** + * + * + * @var string + */ + public $apiVersion = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaClientNotification extends KalturaObjectBase +{ + /** + * The URL where the notification should be sent to + * + * @var string + */ + public $url = null; + + /** + * The serialized notification data to send + * + * @var string + */ + public $data = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaClipDescription extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $sourceEntryId = null; + + /** + * + * + * @var int + */ + public $startTime = null; + + /** + * + * + * @var int + */ + public $duration = null; + + /** + * + * + * @var int + */ + public $offsetInDestination = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaContext extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaContextDataResult extends KalturaObjectBase +{ + /** + * Array of messages as received from the rules that invalidated + * + * @var array of KalturaString + */ + public $messages; + + /** + * Array of actions as received from the rules that invalidated + * + * @var array of KalturaRuleAction + */ + public $actions; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaControlPanelCommand extends KalturaObjectBase +{ + /** + * The id of the Category + * + * @var int + * @readonly + */ + public $id = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Creator name + * + * @var string + */ + public $createdBy = null; + + /** + * Update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * Updater name + * + * @var string + */ + public $updatedBy = null; + + /** + * Creator id + * + * @var int + */ + public $createdById = null; + + /** + * The id of the scheduler that the command refers to + * + * @var int + */ + public $schedulerId = null; + + /** + * The id of the scheduler worker that the command refers to + * + * @var int + */ + public $workerId = null; + + /** + * The id of the scheduler worker as configured in the ini file + * + * @var int + */ + public $workerConfiguredId = null; + + /** + * The name of the scheduler worker that the command refers to + * + * @var int + */ + public $workerName = null; + + /** + * The index of the batch process that the command refers to + * + * @var int + */ + public $batchIndex = null; + + /** + * The command type - stop / start / config + * + * @var KalturaControlPanelCommandType + */ + public $type = null; + + /** + * The command target type - data center / scheduler / job / job type + * + * @var KalturaControlPanelCommandTargetType + */ + public $targetType = null; + + /** + * The command status + * + * @var KalturaControlPanelCommandStatus + */ + public $status = null; + + /** + * The reason for the command + * + * @var string + */ + public $cause = null; + + /** + * Command description + * + * @var string + */ + public $description = null; + + /** + * Error description + * + * @var string + */ + public $errorDescription = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionAttribute extends KalturaObjectBase +{ + /** + * The id of the flavor params, set to null for source flavor + * + * @var int + */ + public $flavorParamsId = null; + + /** + * Attribute name + * + * @var string + */ + public $name = null; + + /** + * Attribute value + * + * @var string + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCropDimensions extends KalturaObjectBase +{ + /** + * Crop left point + * + * @var int + */ + public $left = null; + + /** + * Crop top point + * + * @var int + */ + public $top = null; + + /** + * Crop width + * + * @var int + */ + public $width = null; + + /** + * Crop height + * + * @var int + */ + public $height = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaPluginReplacementOptionsItem extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryReplacementOptions extends KalturaObjectBase +{ + /** + * If true manually created thumbnails will not be deleted on entry replacement + * + * @var int + */ + public $keepManualThumbnails = null; + + /** + * Array of plugin replacement options + * + * @var array of KalturaPluginReplacementOptionsItem + */ + public $pluginOptionItems; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfile extends KalturaObjectBase +{ + /** + * The id of the Conversion Profile + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var KalturaConversionProfileStatus + */ + public $status = null; + + /** + * + * + * @var KalturaConversionProfileType + * @insertonly + */ + public $type = null; + + /** + * The name of the Conversion Profile + * + * @var string + */ + public $name = null; + + /** + * System name of the Conversion Profile + * + * @var string + */ + public $systemName = null; + + /** + * Comma separated tags + * + * @var string + */ + public $tags = null; + + /** + * The description of the Conversion Profile + * + * @var string + */ + public $description = null; + + /** + * ID of the default entry to be used for template data + * + * @var string + */ + public $defaultEntryId = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * List of included flavor ids (comma separated) + * + * @var string + */ + public $flavorParamsIds = null; + + /** + * Indicates that this conversion profile is system default + * + * @var KalturaNullableBoolean + */ + public $isDefault = null; + + /** + * Indicates that this conversion profile is partner default + * + * @var bool + * @readonly + */ + public $isPartnerDefault = null; + + /** + * Cropping dimensions + * + * @var KalturaCropDimensions + */ + public $cropDimensions; + + /** + * Clipping start position (in miliseconds) + * + * @var int + */ + public $clipStart = null; + + /** + * Clipping duration (in miliseconds) + * + * @var int + */ + public $clipDuration = null; + + /** + * XSL to transform ingestion MRSS XML + * + * @var string + */ + public $xslTransformation = null; + + /** + * ID of default storage profile to be used for linked net-storage file syncs + * + * @var int + */ + public $storageProfileId = null; + + /** + * Media parser type to be used for extract media + * + * @var KalturaMediaParserType + */ + public $mediaParserType = null; + + /** + * Should calculate file conversion complexity + * + * @var KalturaNullableBoolean + */ + public $calculateComplexity = null; + + /** + * Defines the tags that should be used to define 'collective'/group/multi-flavor processing, + * like 'mbr' or 'ism' + * + * @var string + */ + public $collectionTags = null; + + /** + * JSON string with array of "condition,profile-id" pairs. + * + * @var string + */ + public $conditionalProfiles = null; + + /** + * When set, the ExtractMedia job should detect the source file GOP using this value as the max calculated period + * + * @var int + */ + public $detectGOP = null; + + /** + * XSL to transform ingestion Media Info XML + * + * @var string + */ + public $mediaInfoXslTransformation = null; + + /** + * Default replacement options to be applied to entries + * + * @var KalturaEntryReplacementOptions + */ + public $defaultReplacementOptions; + + /** + * + * + * @var KalturaLanguage + */ + public $defaultAudioLang = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileAssetParams extends KalturaObjectBase +{ + /** + * The id of the conversion profile + * + * @var int + * @readonly + */ + public $conversionProfileId = null; + + /** + * The id of the asset params + * + * @var int + * @readonly + */ + public $assetParamsId = null; + + /** + * The ingestion origin of the asset params + * + * @var KalturaFlavorReadyBehaviorType + */ + public $readyBehavior = null; + + /** + * The ingestion origin of the asset params + * + * @var KalturaAssetParamsOrigin + */ + public $origin = null; + + /** + * Asset params system name + * + * @var string + */ + public $systemName = null; + + /** + * Starts conversion even if the decision layer reduced the configuration to comply with the source + * + * @var KalturaNullableBoolean + */ + public $forceNoneComplied = null; + + /** + * Specifies how to treat the flavor after conversion is finished + * + * @var KalturaAssetParamsDeletePolicy + */ + public $deletePolicy = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $isEncrypted = null; + + /** + * + * + * @var float + */ + public $contentAwareness = null; + + /** + * + * + * @var int + */ + public $chunkedEncodeMode = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $twoPass = null; + + /** + * + * + * @var string + */ + public $tags = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConvertCollectionFlavorData extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $flavorAssetId = null; + + /** + * + * + * @var int + */ + public $flavorParamsOutputId = null; + + /** + * + * + * @var int + */ + public $readyBehavior = null; + + /** + * + * + * @var int + */ + public $videoBitrate = null; + + /** + * + * + * @var int + */ + public $audioBitrate = null; + + /** + * + * + * @var string + */ + public $destFileSyncLocalPath = null; + + /** + * + * + * @var string + */ + public $destFileSyncRemoteUrl = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCoordinate extends KalturaObjectBase +{ + /** + * + * + * @var float + */ + public $latitude = null; + + /** + * + * + * @var float + */ + public $longitude = null; + + /** + * + * + * @var string + */ + public $name = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCsvAdditionalFieldInfo extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $fieldName = null; + + /** + * + * + * @var string + */ + public $xpath = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDataEntry extends KalturaBaseEntry +{ + /** + * The data of the entry + * + * @var string + */ + public $dataContent = null; + + /** + * indicator whether to return the object for get action with the dataContent field. + * + * @var bool + * @insertonly + */ + public $retrieveDataContentByGet = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlRecognizer extends KalturaObjectBase +{ + /** + * The hosts that are recognized + * + * @var string + */ + public $hosts = null; + + /** + * The URI prefix we use for security + * + * @var string + */ + public $uriPrefix = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizer extends KalturaObjectBase +{ + /** + * Window + * + * @var int + */ + public $window = null; + + /** + * key + * + * @var string + */ + public $key = null; + + /** + * + * + * @var bool + */ + public $limitIpAddress = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaSearchItem extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaFilter extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $orderBy = null; + + /** + * + * + * @var KalturaSearchItem + */ + public $advancedSearch; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaRelatedFilter extends KalturaFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaAssetBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var string + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $entryIdEqual = null; + + /** + * + * + * @var string + */ + public $entryIdIn = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $partnerIdIn = null; + + /** + * + * + * @var int + */ + public $sizeGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $sizeLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $tagsLike = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $deletedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $deletedAtLessThanOrEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetFilter extends KalturaAssetBaseFilter +{ + /** + * + * + * @var string + */ + public $typeIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfile extends KalturaObjectBase +{ + /** + * The id of the Delivery + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * The name of the Delivery + * + * @var string + */ + public $name = null; + + /** + * Delivery type + * + * @var KalturaDeliveryProfileType + */ + public $type = null; + + /** + * System name of the delivery + * + * @var string + */ + public $systemName = null; + + /** + * The description of the Delivery + * + * @var string + */ + public $description = null; + + /** + * Creation time as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Update time as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var KalturaPlaybackProtocol + */ + public $streamerType = null; + + /** + * + * + * @var string + */ + public $url = null; + + /** + * the host part of the url + * + * @var string + * @readonly + */ + public $hostName = null; + + /** + * + * + * @var KalturaDeliveryStatus + */ + public $status = null; + + /** + * + * + * @var KalturaUrlRecognizer + */ + public $recognizer; + + /** + * + * + * @var KalturaUrlTokenizer + */ + public $tokenizer; + + /** + * True if this is the systemwide default for the protocol + * + * @var KalturaNullableBoolean + * @readonly + */ + public $isDefault = null; + + /** + * the object from which this object was cloned (or 0) + * + * @var int + * @readonly + */ + public $parentId = null; + + /** + * Comma separated list of supported media protocols. f.i. rtmpe + * + * @var string + */ + public $mediaProtocols = null; + + /** + * priority used for ordering similar delivery profiles + * + * @var int + */ + public $priority = null; + + /** + * Extra query string parameters that should be added to the url + * + * @var string + */ + public $extraParams = null; + + /** + * A filter that can be used to include additional assets in the URL (e.g. captions) + * + * @var KalturaAssetFilter + */ + public $supplementaryAssetsFilter; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileSyncDescriptor extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $fileSyncLocalPath = null; + + /** + * + * + * @var string + */ + public $fileEncryptionKey = null; + + /** + * The translated path as used by the scheduler + * + * @var string + */ + public $fileSyncRemoteUrl = null; + + /** + * + * + * @var int + */ + public $fileSyncObjectSubType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDestFileSyncDescriptor extends KalturaFileSyncDescriptor +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPager extends KalturaObjectBase +{ + /** + * The number of objects to retrieve. (Default is 30, maximum page size is 500). + * + * @var int + */ + public $pageSize = null; + + /** + * The page number for which {pageSize} of objects should be retrieved (Default is 1). + * + * @var int + */ + public $pageIndex = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFilterPager extends KalturaPager +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileMapping extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $parentProperty = null; + + /** + * + * + * @var string + */ + public $filterProperty = null; + + /** + * + * + * @var bool + */ + public $allowNull = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDetachedResponseProfile extends KalturaBaseResponseProfile +{ + /** + * Friendly name + * + * @var string + */ + public $name = null; + + /** + * + * + * @var KalturaResponseProfileType + */ + public $type = null; + + /** + * Comma separated fields list to be included or excluded + * + * @var string + */ + public $fields = null; + + /** + * + * + * @var KalturaRelatedFilter + */ + public $filter; + + /** + * + * + * @var KalturaFilterPager + */ + public $pager; + + /** + * + * + * @var array of KalturaDetachedResponseProfile + */ + public $relatedProfiles; + + /** + * + * + * @var array of KalturaResponseProfileMapping + */ + public $mappings; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPluginData extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDrmPlaybackPluginData extends KalturaPluginData +{ + /** + * + * + * @var KalturaDrmSchemeName + */ + public $scheme = null; + + /** + * + * + * @var string + */ + public $licenseURL = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEmailIngestionProfile extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var string + */ + public $emailAddress = null; + + /** + * + * + * @var string + */ + public $mailboxId = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var int + */ + public $conversionProfile2Id = null; + + /** + * + * + * @var KalturaEntryModerationStatus + */ + public $moderationStatus = null; + + /** + * + * + * @var KalturaEmailIngestionProfileStatus + * @readonly + */ + public $status = null; + + /** + * + * + * @var string + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var string + */ + public $defaultCategory = null; + + /** + * + * + * @var string + */ + public $defaultUserId = null; + + /** + * + * + * @var string + */ + public $defaultTags = null; + + /** + * + * + * @var string + */ + public $defaultAdminTags = null; + + /** + * + * + * @var int + */ + public $maxAttachmentSizeKbytes = null; + + /** + * + * + * @var int + */ + public $maxAttachmentsPerMail = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStringValue extends KalturaValue +{ + /** + * + * + * @var string + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaEntryServerNode extends KalturaObjectBase +{ + /** + * unique auto-generated identifier + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var string + * @readonly + */ + public $entryId = null; + + /** + * + * + * @var int + * @readonly + */ + public $serverNodeId = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var KalturaEntryServerNodeStatus + * @readonly + */ + public $status = null; + + /** + * + * + * @var KalturaEntryServerNodeType + * @readonly + */ + public $serverType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaObjectIdentifier extends KalturaObjectBase +{ + /** + * Comma separated string of enum values denoting which features of the item need to be included in the MRSS + * + * @var string + */ + public $extendedFeatures = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaExtendingItemMrssParameter extends KalturaObjectBase +{ + /** + * XPath for the extending item + * + * @var string + */ + public $xpath = null; + + /** + * Object identifier + * + * @var KalturaObjectIdentifier + */ + public $identifier; + + /** + * Mode of extension - append to MRSS or replace the xpath content. + * + * @var KalturaMrssExtensionMode + */ + public $extensionMode = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlayableEntry extends KalturaBaseEntry +{ + /** + * Number of plays + * + * @var int + * @readonly + */ + public $plays = null; + + /** + * Number of views + * + * @var int + * @readonly + */ + public $views = null; + + /** + * The last time the entry was played + * + * @var int + * @readonly + */ + public $lastPlayedAt = null; + + /** + * The width in pixels + * + * @var int + * @readonly + */ + public $width = null; + + /** + * The height in pixels + * + * @var int + * @readonly + */ + public $height = null; + + /** + * The duration in seconds + * + * @var int + * @readonly + */ + public $duration = null; + + /** + * The duration in miliseconds + * + * @var int + */ + public $msDuration = null; + + /** + * The duration type (short for 0-4 mins, medium for 4-20 mins, long for 20+ mins) + * + * @var KalturaDurationType + * @readonly + */ + public $durationType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStreamContainer extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $type = null; + + /** + * + * + * @var int + */ + public $trackIndex = null; + + /** + * + * + * @var string + */ + public $language = null; + + /** + * + * + * @var int + */ + public $channelIndex = null; + + /** + * + * + * @var string + */ + public $label = null; + + /** + * + * + * @var string + */ + public $channelLayout = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaEntry extends KalturaPlayableEntry +{ + /** + * The media type of the entry + * + * @var KalturaMediaType + * @insertonly + */ + public $mediaType = null; + + /** + * Override the default conversion quality + * + * @var string + * @insertonly + */ + public $conversionQuality = null; + + /** + * The source type of the entry + * + * @var KalturaSourceType + * @insertonly + */ + public $sourceType = null; + + /** + * The search provider type used to import this entry + * + * @var KalturaSearchProviderType + * @insertonly + */ + public $searchProviderType = null; + + /** + * The ID of the media in the importing site + * + * @var string + * @insertonly + */ + public $searchProviderId = null; + + /** + * The user name used for credits + * + * @var string + */ + public $creditUserName = null; + + /** + * The URL for credits + * + * @var string + */ + public $creditUrl = null; + + /** + * The media date extracted from EXIF data (For images) as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $mediaDate = null; + + /** + * The URL used for playback. This is not the download URL. + * + * @var string + * @readonly + */ + public $dataUrl = null; + + /** + * Comma separated flavor params ids that exists for this media entry + * + * @var string + * @readonly + */ + public $flavorParamsIds = null; + + /** + * True if trim action is disabled for this entry + * + * @var KalturaNullableBoolean + * @readonly + */ + public $isTrimDisabled = null; + + /** + * Array of streams that exists on the entry + * + * @var array of KalturaStreamContainer + */ + public $streams; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFeatureStatus extends KalturaObjectBase +{ + /** + * + * + * @var KalturaFeatureStatusType + */ + public $type = null; + + /** + * + * + * @var int + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileAsset extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var KalturaFileAssetObjectType + * @insertonly + */ + public $fileAssetObjectType = null; + + /** + * + * + * @var string + * @insertonly + */ + public $objectId = null; + + /** + * + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $systemName = null; + + /** + * + * + * @var string + */ + public $fileExt = null; + + /** + * + * + * @var int + * @readonly + */ + public $version = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var KalturaFileAssetStatus + * @readonly + */ + public $status = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileContainer extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $filePath = null; + + /** + * + * + * @var string + */ + public $encryptionKey = null; + + /** + * + * + * @var int + */ + public $fileSize = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorAsset extends KalturaAsset +{ + /** + * The Flavor Params used to create this Flavor Asset + * + * @var int + * @insertonly + */ + public $flavorParamsId = null; + + /** + * The width of the Flavor Asset + * + * @var int + * @readonly + */ + public $width = null; + + /** + * The height of the Flavor Asset + * + * @var int + * @readonly + */ + public $height = null; + + /** + * The overall bitrate (in KBits) of the Flavor Asset + * + * @var int + * @readonly + */ + public $bitrate = null; + + /** + * The frame rate (in FPS) of the Flavor Asset + * + * @var float + * @readonly + */ + public $frameRate = null; + + /** + * True if this Flavor Asset is the original source + * + * @var bool + * @readonly + */ + public $isOriginal = null; + + /** + * True if this Flavor Asset is playable in KDP + * + * @var bool + * @readonly + */ + public $isWeb = null; + + /** + * The container format + * + * @var string + * @readonly + */ + public $containerFormat = null; + + /** + * The video codec + * + * @var string + * @readonly + */ + public $videoCodecId = null; + + /** + * The status of the Flavor Asset + * + * @var KalturaFlavorAssetStatus + * @readonly + */ + public $status = null; + + /** + * The language of the flavor asset + * + * @var KalturaLanguage + */ + public $language = null; + + /** + * The label of the flavor asset + * + * @var string + */ + public $label = null; + + /** + * Is default flavor asset of the entry (This field will be taken into account selectign which audio flavor will be selected as default) + * + * @var KalturaNullableBoolean + */ + public $isDefault = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorAssetUrlOptions extends KalturaObjectBase +{ + /** + * The name of the downloaded file + * + * @var string + */ + public $fileName = null; + + /** + * + * + * @var string + */ + public $referrer = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParams extends KalturaAssetParams +{ + /** + * The video codec of the Flavor Params + * + * @var KalturaVideoCodec + */ + public $videoCodec = null; + + /** + * The video bitrate (in KBits) of the Flavor Params + * + * @var int + */ + public $videoBitrate = null; + + /** + * The audio codec of the Flavor Params + * + * @var KalturaAudioCodec + */ + public $audioCodec = null; + + /** + * The audio bitrate (in KBits) of the Flavor Params + * + * @var int + */ + public $audioBitrate = null; + + /** + * The number of audio channels for "downmixing" + * + * @var int + */ + public $audioChannels = null; + + /** + * The audio sample rate of the Flavor Params + * + * @var int + */ + public $audioSampleRate = null; + + /** + * The desired width of the Flavor Params + * + * @var int + */ + public $width = null; + + /** + * The desired height of the Flavor Params + * + * @var int + */ + public $height = null; + + /** + * The frame rate of the Flavor Params + * + * @var float + */ + public $frameRate = null; + + /** + * The gop size of the Flavor Params + * + * @var int + */ + public $gopSize = null; + + /** + * The list of conversion engines (comma separated) + * + * @var string + */ + public $conversionEngines = null; + + /** + * The list of conversion engines extra params (separated with "|") + * + * @var string + */ + public $conversionEnginesExtraParams = null; + + /** + * + * + * @var bool + */ + public $twoPass = null; + + /** + * + * + * @var int + */ + public $deinterlice = null; + + /** + * + * + * @var int + */ + public $rotate = null; + + /** + * + * + * @var string + */ + public $operators = null; + + /** + * + * + * @var int + */ + public $engineVersion = null; + + /** + * The container format of the Flavor Params + * + * @var KalturaContainerFormat + */ + public $format = null; + + /** + * + * + * @var int + */ + public $aspectRatioProcessingMode = null; + + /** + * + * + * @var int + */ + public $forceFrameToMultiplication16 = null; + + /** + * + * + * @var int + */ + public $isGopInSec = null; + + /** + * + * + * @var int + */ + public $isAvoidVideoShrinkFramesizeToSource = null; + + /** + * + * + * @var int + */ + public $isAvoidVideoShrinkBitrateToSource = null; + + /** + * + * + * @var int + */ + public $isVideoFrameRateForLowBrAppleHls = null; + + /** + * + * + * @var string + */ + public $multiStream = null; + + /** + * + * + * @var float + */ + public $anamorphicPixels = null; + + /** + * + * + * @var int + */ + public $isAvoidForcedKeyFrames = null; + + /** + * + * + * @var int + */ + public $forcedKeyFramesMode = null; + + /** + * + * + * @var int + */ + public $isCropIMX = null; + + /** + * + * + * @var int + */ + public $optimizationPolicy = null; + + /** + * + * + * @var int + */ + public $maxFrameRate = null; + + /** + * + * + * @var int + */ + public $videoConstantBitrate = null; + + /** + * + * + * @var int + */ + public $videoBitrateTolerance = null; + + /** + * + * + * @var string + */ + public $watermarkData = null; + + /** + * + * + * @var string + */ + public $subtitlesData = null; + + /** + * + * + * @var int + */ + public $isEncrypted = null; + + /** + * + * + * @var float + */ + public $contentAwareness = null; + + /** + * + * + * @var int + */ + public $chunkedEncodeMode = null; + + /** + * + * + * @var int + */ + public $clipOffset = null; + + /** + * + * + * @var int + */ + public $clipDuration = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorAssetWithParams extends KalturaObjectBase +{ + /** + * The Flavor Asset (Can be null when there are params without asset) + * + * @var KalturaFlavorAsset + */ + public $flavorAsset; + + /** + * The Flavor Params + * + * @var KalturaFlavorParams + */ + public $flavorParams; + + /** + * The entry id + * + * @var string + */ + public $entryId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParamsOutput extends KalturaFlavorParams +{ + /** + * + * + * @var int + */ + public $flavorParamsId = null; + + /** + * + * + * @var string + */ + public $commandLinesStr = null; + + /** + * + * + * @var string + */ + public $flavorParamsVersion = null; + + /** + * + * + * @var string + */ + public $flavorAssetId = null; + + /** + * + * + * @var string + */ + public $flavorAssetVersion = null; + + /** + * + * + * @var int + */ + public $readyBehavior = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSchedulerStatus extends KalturaObjectBase +{ + /** + * The id of the Category + * + * @var int + * @readonly + */ + public $id = null; + + /** + * The configured id of the scheduler + * + * @var int + */ + public $schedulerConfiguredId = null; + + /** + * The configured id of the job worker + * + * @var int + */ + public $workerConfiguredId = null; + + /** + * The type of the job worker. + * + * @var KalturaBatchJobType + */ + public $workerType = null; + + /** + * The status type + * + * @var KalturaSchedulerStatusType + */ + public $type = null; + + /** + * The status value + * + * @var int + */ + public $value = null; + + /** + * The id of the scheduler + * + * @var int + * @readonly + */ + public $schedulerId = null; + + /** + * The id of the worker + * + * @var int + * @readonly + */ + public $workerId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSchedulerConfig extends KalturaObjectBase +{ + /** + * The id of the Category + * + * @var int + * @readonly + */ + public $id = null; + + /** + * Creator name + * + * @var string + */ + public $createdBy = null; + + /** + * Updater name + * + * @var string + */ + public $updatedBy = null; + + /** + * Id of the control panel command that created this config item + * + * @var string + */ + public $commandId = null; + + /** + * The status of the control panel command + * + * @var string + */ + public $commandStatus = null; + + /** + * The id of the scheduler + * + * @var int + */ + public $schedulerId = null; + + /** + * The configured id of the scheduler + * + * @var int + */ + public $schedulerConfiguredId = null; + + /** + * The name of the scheduler + * + * @var string + */ + public $schedulerName = null; + + /** + * The id of the job worker + * + * @var int + */ + public $workerId = null; + + /** + * The configured id of the job worker + * + * @var int + */ + public $workerConfiguredId = null; + + /** + * The name of the job worker + * + * @var string + */ + public $workerName = null; + + /** + * The name of the variable + * + * @var string + */ + public $variable = null; + + /** + * The part of the variable + * + * @var string + */ + public $variablePart = null; + + /** + * The value of the variable + * + * @var string + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSchedulerWorker extends KalturaObjectBase +{ + /** + * The id of the Worker + * + * @var int + * @readonly + */ + public $id = null; + + /** + * The id as configured in the batch config + * + * @var int + */ + public $configuredId = null; + + /** + * The id of the Scheduler + * + * @var int + */ + public $schedulerId = null; + + /** + * The id of the scheduler as configured in the batch config + * + * @var int + */ + public $schedulerConfiguredId = null; + + /** + * The worker type + * + * @var KalturaBatchJobType + */ + public $type = null; + + /** + * The friendly name of the type + * + * @var string + */ + public $typeName = null; + + /** + * The scheduler name + * + * @var string + */ + public $name = null; + + /** + * Array of the last statuses + * + * @var array of KalturaSchedulerStatus + */ + public $statuses; + + /** + * Array of the last configs + * + * @var array of KalturaSchedulerConfig + */ + public $configs; + + /** + * Array of jobs that locked to this worker + * + * @var array of KalturaBatchJob + */ + public $lockedJobs; + + /** + * Avarage time between creation and queue time + * + * @var int + */ + public $avgWait = null; + + /** + * Avarage time between queue time end finish time + * + * @var int + */ + public $avgWork = null; + + /** + * last status time + * + * @var int + */ + public $lastStatus = null; + + /** + * last status formated + * + * @var string + */ + public $lastStatusStr = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaScheduler extends KalturaObjectBase +{ + /** + * The id of the Scheduler + * + * @var int + * @readonly + */ + public $id = null; + + /** + * The id as configured in the batch config + * + * @var int + */ + public $configuredId = null; + + /** + * The scheduler name + * + * @var string + */ + public $name = null; + + /** + * The host name + * + * @var string + */ + public $host = null; + + /** + * Array of the last statuses + * + * @var array of KalturaSchedulerStatus + * @readonly + */ + public $statuses; + + /** + * Array of the last configs + * + * @var array of KalturaSchedulerConfig + * @readonly + */ + public $configs; + + /** + * Array of the workers + * + * @var array of KalturaSchedulerWorker + * @readonly + */ + public $workers; + + /** + * creation time + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * last status time + * + * @var int + * @readonly + */ + public $lastStatus = null; + + /** + * last status formated + * + * @var string + * @readonly + */ + public $lastStatusStr = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGroupUser extends KalturaObjectBase +{ + /** + * + * + * @var string + * @insertonly + */ + public $userId = null; + + /** + * + * + * @var string + * @insertonly + */ + public $groupId = null; + + /** + * + * + * @var KalturaGroupUserStatus + * @readonly + */ + public $status = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Last update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaObject extends KalturaObjectBase +{ + /** + * + * + * @var map + * @readonly + */ + public $relatedObjects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaIntegerValue extends KalturaValue +{ + /** + * + * + * @var int + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamConfiguration extends KalturaObjectBase +{ + /** + * + * + * @var KalturaPlaybackProtocol + */ + public $protocol = null; + + /** + * + * + * @var string + */ + public $url = null; + + /** + * + * + * @var string + */ + public $publishUrl = null; + + /** + * + * + * @var string + */ + public $backupUrl = null; + + /** + * + * + * @var string + */ + public $streamName = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamPushPublishConfiguration extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $publishUrl = null; + + /** + * + * + * @var string + */ + public $backupPublishUrl = null; + + /** + * + * + * @var string + */ + public $port = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryRecordingOptions extends KalturaObjectBase +{ + /** + * + * + * @var KalturaNullableBoolean + */ + public $shouldCopyEntitlement = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $shouldCopyScheduling = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $shouldCopyThumbnail = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $shouldMakeHidden = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaLiveEntry extends KalturaMediaEntry +{ + /** + * The message to be presented when the stream is offline + * + * @var string + */ + public $offlineMessage = null; + + /** + * Recording Status Enabled/Disabled + * + * @var KalturaRecordStatus + */ + public $recordStatus = null; + + /** + * DVR Status Enabled/Disabled + * + * @var KalturaDVRStatus + */ + public $dvrStatus = null; + + /** + * Window of time which the DVR allows for backwards scrubbing (in minutes) + * + * @var int + */ + public $dvrWindow = null; + + /** + * Elapsed recording time (in msec) up to the point where the live stream was last stopped (unpublished). + * + * @var int + */ + public $lastElapsedRecordingTime = null; + + /** + * Array of key value protocol->live stream url objects + * + * @var array of KalturaLiveStreamConfiguration + */ + public $liveStreamConfigurations; + + /** + * Recorded entry id + * + * @var string + */ + public $recordedEntryId = null; + + /** + * Flag denoting whether entry should be published by the media server + * + * @var KalturaLivePublishStatus + */ + public $pushPublishEnabled = null; + + /** + * Array of publish configurations + * + * @var array of KalturaLiveStreamPushPublishConfiguration + */ + public $publishConfigurations; + + /** + * The first time in which the entry was broadcast + * + * @var int + * @readonly + */ + public $firstBroadcast = null; + + /** + * The Last time in which the entry was broadcast + * + * @var int + * @readonly + */ + public $lastBroadcast = null; + + /** + * The time (unix timestamp in milliseconds) in which the entry broadcast started or 0 when the entry is off the air + * + * @var float + */ + public $currentBroadcastStartTime = null; + + /** + * + * + * @var KalturaLiveEntryRecordingOptions + */ + public $recordingOptions; + + /** + * the status of the entry of type EntryServerNodeStatus + * + * @var KalturaEntryServerNodeStatus + * @readonly + */ + public $liveStatus = null; + + /** + * The chunk duration value in milliseconds + * + * @var int + */ + public $segmentDuration = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $explicitLive = null; + + /** + * + * + * @var KalturaViewMode + */ + public $viewMode = null; + + /** + * + * + * @var KalturaRecordingStatus + */ + public $recordingStatus = null; + + /** + * The time the last broadcast finished. + * + * @var int + * @readonly + */ + public $lastBroadcastEndTime = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannel extends KalturaLiveEntry +{ + /** + * Playlist id to be played + * + * @var string + */ + public $playlistId = null; + + /** + * Indicates that the segments should be repeated for ever + * + * @var KalturaNullableBoolean + */ + public $repeat = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelSegment extends KalturaObjectBase +{ + /** + * Unique identifier + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * Segment creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Segment update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * Segment name + * + * @var string + */ + public $name = null; + + /** + * Segment description + * + * @var string + */ + public $description = null; + + /** + * Segment tags + * + * @var string + */ + public $tags = null; + + /** + * Segment could be associated with the main stream, as additional stream or as overlay + * + * @var KalturaLiveChannelSegmentType + */ + public $type = null; + + /** + * + * + * @var KalturaLiveChannelSegmentStatus + * @readonly + */ + public $status = null; + + /** + * Live channel id + * + * @var string + */ + public $channelId = null; + + /** + * Entry id to be played + * + * @var string + */ + public $entryId = null; + + /** + * Segment start time trigger type + * + * @var KalturaLiveChannelSegmentTriggerType + */ + public $triggerType = null; + + /** + * Live channel segment that the trigger relates to + * + * @var int + */ + public $triggerSegmentId = null; + + /** + * Segment play start time, in mili-seconds, according to trigger type + * + * @var float + */ + public $startTime = null; + + /** + * Segment play duration time, in mili-seconds + * + * @var float + */ + public $duration = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryServerNodeRecordingInfo extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $recordedEntryId = null; + + /** + * + * + * @var int + */ + public $duration = null; + + /** + * + * + * @var KalturaEntryServerNodeRecordingStatus + */ + public $recordingStatus = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveReportExportParams extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $entryIds = null; + + /** + * + * + * @var string + */ + public $recpientEmail = null; + + /** + * Time zone offset in minutes (between client to UTC) + * + * @var int + */ + public $timeZoneOffset = null; + + /** + * Optional argument that allows controlling the prefix of the exported csv url + * + * @var string + */ + public $applicationUrlTemplate = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveReportExportResponse extends KalturaObjectBase +{ + /** + * + * + * @var int + */ + public $referenceJobId = null; + + /** + * + * + * @var string + */ + public $reportEmail = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveReportInputFilter extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $entryIds = null; + + /** + * + * + * @var int + */ + public $fromTime = null; + + /** + * + * + * @var int + */ + public $toTime = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $live = null; + + /** + * + * + * @var KalturaLiveReportOrderBy + */ + public $orderBy = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStats extends KalturaObjectBase +{ + /** + * + * + * @var int + */ + public $audience = null; + + /** + * + * + * @var int + */ + public $dvrAudience = null; + + /** + * + * + * @var float + */ + public $avgBitrate = null; + + /** + * + * + * @var int + */ + public $bufferTime = null; + + /** + * + * + * @var int + */ + public $plays = null; + + /** + * + * + * @var int + */ + public $secondsViewed = null; + + /** + * + * + * @var int + */ + public $startEvent = null; + + /** + * + * + * @var int + */ + public $timestamp = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStatsEvent extends KalturaObjectBase +{ + /** + * + * + * @var int + */ + public $partnerId = null; + + /** + * + * + * @var string + */ + public $entryId = null; + + /** + * an integer representing the type of event being sent from the player + * + * @var KalturaLiveStatsEventType + */ + public $eventType = null; + + /** + * a unique string generated by the client that will represent the client-side session: the primary component will pass it on to other components that sprout from it + * + * @var string + */ + public $sessionId = null; + + /** + * incremental sequence of the event + * + * @var int + */ + public $eventIndex = null; + + /** + * buffer time in seconds from the last 10 seconds + * + * @var int + */ + public $bufferTime = null; + + /** + * bitrate used in the last 10 seconds + * + * @var int + */ + public $bitrate = null; + + /** + * the referrer of the client + * + * @var string + */ + public $referrer = null; + + /** + * + * + * @var bool + */ + public $isLive = null; + + /** + * the event start time as string + * + * @var string + */ + public $startTime = null; + + /** + * delivery type used for this stream + * + * @var KalturaPlaybackProtocol + */ + public $deliveryType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamBitrate extends KalturaObjectBase +{ + /** + * + * + * @var int + */ + public $bitrate = null; + + /** + * + * + * @var int + */ + public $width = null; + + /** + * + * + * @var int + */ + public $height = null; + + /** + * + * + * @var string + */ + public $tags = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamEntry extends KalturaLiveEntry +{ + /** + * The stream id as provided by the provider + * + * @var string + * @readonly + */ + public $streamRemoteId = null; + + /** + * The backup stream id as provided by the provider + * + * @var string + * @readonly + */ + public $streamRemoteBackupId = null; + + /** + * Array of supported bitrates + * + * @var array of KalturaLiveStreamBitrate + */ + public $bitrates; + + /** + * + * + * @var string + */ + public $primaryBroadcastingUrl = null; + + /** + * + * + * @var string + */ + public $secondaryBroadcastingUrl = null; + + /** + * + * + * @var string + */ + public $primaryRtspBroadcastingUrl = null; + + /** + * + * + * @var string + */ + public $secondaryRtspBroadcastingUrl = null; + + /** + * + * + * @var string + */ + public $streamName = null; + + /** + * The stream url + * + * @var string + */ + public $streamUrl = null; + + /** + * HLS URL - URL for live stream playback on mobile device + * + * @var string + */ + public $hlsStreamUrl = null; + + /** + * URL Manager to handle the live stream URL (for instance, add token) + * + * @var string + */ + public $urlManager = null; + + /** + * The broadcast primary ip + * + * @var string + */ + public $encodingIP1 = null; + + /** + * The broadcast secondary ip + * + * @var string + */ + public $encodingIP2 = null; + + /** + * The broadcast password + * + * @var string + */ + public $streamPassword = null; + + /** + * The broadcast username + * + * @var string + * @readonly + */ + public $streamUsername = null; + + /** + * The Streams primary server node id + * + * @var int + * @readonly + */ + public $primaryServerNodeId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamParams extends KalturaObjectBase +{ + /** + * Bit rate of the stream. (i.e. 900) + * + * @var int + */ + public $bitrate = null; + + /** + * flavor asset id + * + * @var string + */ + public $flavorId = null; + + /** + * Stream's width + * + * @var int + */ + public $width = null; + + /** + * Stream's height + * + * @var int + */ + public $height = null; + + /** + * Live stream's codec + * + * @var string + */ + public $codec = null; + + /** + * Live stream's farme rate + * + * @var int + */ + public $frameRate = null; + + /** + * Live stream's key frame interval + * + * @var float + */ + public $keyFrameInterval = null; + + /** + * Live stream's language + * + * @var string + */ + public $language = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBaseEntryBaseFilter extends KalturaRelatedFilter +{ + /** + * This filter should be in use for retrieving only a specific entry (identified by its entryId). + * + * @var string + */ + public $idEqual = null; + + /** + * This filter should be in use for retrieving few specific entries (string should include comma separated list of entryId strings). + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $idNotIn = null; + + /** + * This filter should be in use for retrieving specific entries. It should include only one string to search for in entry names (no wildcards, spaces are treated as part of the string). + * + * @var string + */ + public $nameLike = null; + + /** + * This filter should be in use for retrieving specific entries. It could include few (comma separated) strings for searching in entry names, while applying an OR logic to retrieve entries that contain at least one input string (no wildcards, spaces are treated as part of the string). + * + * @var string + */ + public $nameMultiLikeOr = null; + + /** + * This filter should be in use for retrieving specific entries. It could include few (comma separated) strings for searching in entry names, while applying an AND logic to retrieve entries that contain all input strings (no wildcards, spaces are treated as part of the string). + * + * @var string + */ + public $nameMultiLikeAnd = null; + + /** + * This filter should be in use for retrieving entries with a specific name. + * + * @var string + */ + public $nameEqual = null; + + /** + * This filter should be in use for retrieving only entries which were uploaded by/assigned to users of a specific Kaltura Partner (identified by Partner ID). + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * This filter should be in use for retrieving only entries within Kaltura network which were uploaded by/assigned to users of few Kaltura Partners (string should include comma separated list of PartnerIDs) + * + * @var string + */ + public $partnerIdIn = null; + + /** + * This filter parameter should be in use for retrieving only entries, uploaded by/assigned to a specific user (identified by user Id). + * + * @var string + */ + public $userIdEqual = null; + + /** + * + * + * @var string + */ + public $userIdIn = null; + + /** + * + * + * @var string + */ + public $userIdNotIn = null; + + /** + * + * + * @var string + */ + public $creatorIdEqual = null; + + /** + * This filter should be in use for retrieving specific entries. It should include only one string to search for in entry tags (no wildcards, spaces are treated as part of the string). + * + * @var string + */ + public $tagsLike = null; + + /** + * This filter should be in use for retrieving specific entries. It could include few (comma separated) strings for searching in entry tags, while applying an OR logic to retrieve entries that contain at least one input string (no wildcards, spaces are treated as part of the string). + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * This filter should be in use for retrieving specific entries. It could include few (comma separated) strings for searching in entry tags, while applying an AND logic to retrieve entries that contain all input strings (no wildcards, spaces are treated as part of the string). + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * This filter should be in use for retrieving specific entries. It should include only one string to search for in entry tags set by an ADMIN user (no wildcards, spaces are treated as part of the string). + * + * @var string + */ + public $adminTagsLike = null; + + /** + * This filter should be in use for retrieving specific entries. It could include few (comma separated) strings for searching in entry tags, set by an ADMIN user, while applying an OR logic to retrieve entries that contain at least one input string (no wildcards, spaces are treated as part of the string). + * + * @var string + */ + public $adminTagsMultiLikeOr = null; + + /** + * This filter should be in use for retrieving specific entries. It could include few (comma separated) strings for searching in entry tags, set by an ADMIN user, while applying an AND logic to retrieve entries that contain all input strings (no wildcards, spaces are treated as part of the string). + * + * @var string + */ + public $adminTagsMultiLikeAnd = null; + + /** + * + * + * @var string + */ + public $categoriesMatchAnd = null; + + /** + * All entries within these categories or their child categories. + * + * @var string + */ + public $categoriesMatchOr = null; + + /** + * + * + * @var string + */ + public $categoriesNotContains = null; + + /** + * + * + * @var string + */ + public $categoriesIdsMatchAnd = null; + + /** + * All entries of the categories, excluding their child categories. + * To include entries of the child categories, use categoryAncestorIdIn, or categoriesMatchOr. + * + * @var string + */ + public $categoriesIdsMatchOr = null; + + /** + * + * + * @var string + */ + public $categoriesIdsNotContains = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $categoriesIdsEmpty = null; + + /** + * This filter should be in use for retrieving only entries, at a specific { + * + * @var KalturaEntryStatus + */ + public $statusEqual = null; + + /** + * This filter should be in use for retrieving only entries, not at a specific { + * + * @var KalturaEntryStatus + */ + public $statusNotEqual = null; + + /** + * This filter should be in use for retrieving only entries, at few specific { + * + * @var string + */ + public $statusIn = null; + + /** + * This filter should be in use for retrieving only entries, not at few specific { + * + * @var string + */ + public $statusNotIn = null; + + /** + * + * + * @var KalturaEntryModerationStatus + */ + public $moderationStatusEqual = null; + + /** + * + * + * @var KalturaEntryModerationStatus + */ + public $moderationStatusNotEqual = null; + + /** + * + * + * @var string + */ + public $moderationStatusIn = null; + + /** + * + * + * @var string + */ + public $moderationStatusNotIn = null; + + /** + * + * + * @var KalturaEntryType + */ + public $typeEqual = null; + + /** + * This filter should be in use for retrieving entries of few { + * + * @var string + */ + public $typeIn = null; + + /** + * This filter parameter should be in use for retrieving only entries which were created at Kaltura system after a specific time/date (standard timestamp format). + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * This filter parameter should be in use for retrieving only entries which were created at Kaltura system before a specific time/date (standard timestamp format). + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $totalRankLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $totalRankGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $groupIdEqual = null; + + /** + * This filter should be in use for retrieving specific entries while search match the input string within all of the following metadata attributes: name, description, tags, adminTags. + * + * @var string + */ + public $searchTextMatchAnd = null; + + /** + * This filter should be in use for retrieving specific entries while search match the input string within at least one of the following metadata attributes: name, description, tags, adminTags. + * + * @var string + */ + public $searchTextMatchOr = null; + + /** + * + * + * @var int + */ + public $accessControlIdEqual = null; + + /** + * + * + * @var string + */ + public $accessControlIdIn = null; + + /** + * + * + * @var int + */ + public $startDateGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $startDateLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $startDateGreaterThanOrEqualOrNull = null; + + /** + * + * + * @var int + */ + public $startDateLessThanOrEqualOrNull = null; + + /** + * + * + * @var int + */ + public $endDateGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $endDateLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $endDateGreaterThanOrEqualOrNull = null; + + /** + * + * + * @var int + */ + public $endDateLessThanOrEqualOrNull = null; + + /** + * + * + * @var string + */ + public $referenceIdEqual = null; + + /** + * + * + * @var string + */ + public $referenceIdIn = null; + + /** + * + * + * @var string + */ + public $replacingEntryIdEqual = null; + + /** + * + * + * @var string + */ + public $replacingEntryIdIn = null; + + /** + * + * + * @var string + */ + public $replacedEntryIdEqual = null; + + /** + * + * + * @var string + */ + public $replacedEntryIdIn = null; + + /** + * + * + * @var KalturaEntryReplacementStatus + */ + public $replacementStatusEqual = null; + + /** + * + * + * @var string + */ + public $replacementStatusIn = null; + + /** + * + * + * @var int + */ + public $partnerSortValueGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $partnerSortValueLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $rootEntryIdEqual = null; + + /** + * + * + * @var string + */ + public $rootEntryIdIn = null; + + /** + * + * + * @var string + */ + public $parentEntryIdEqual = null; + + /** + * + * + * @var string + */ + public $entitledUsersEditMatchAnd = null; + + /** + * + * + * @var string + */ + public $entitledUsersEditMatchOr = null; + + /** + * + * + * @var string + */ + public $entitledUsersPublishMatchAnd = null; + + /** + * + * + * @var string + */ + public $entitledUsersPublishMatchOr = null; + + /** + * + * + * @var string + */ + public $entitledUsersViewMatchAnd = null; + + /** + * + * + * @var string + */ + public $entitledUsersViewMatchOr = null; + + /** + * + * + * @var string + */ + public $tagsNameMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsAdminTagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsAdminTagsNameMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsNameMultiLikeAnd = null; + + /** + * + * + * @var string + */ + public $tagsAdminTagsMultiLikeAnd = null; + + /** + * + * + * @var string + */ + public $tagsAdminTagsNameMultiLikeAnd = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryFilter extends KalturaBaseEntryBaseFilter +{ + /** + * + * + * @var string + */ + public $freeText = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $isRoot = null; + + /** + * + * + * @var string + */ + public $categoriesFullNameIn = null; + + /** + * All entries within this categoy or in child categories + * + * @var string + */ + public $categoryAncestorIdIn = null; + + /** + * The id of the original entry + * + * @var string + */ + public $redirectFromEntryId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaPlayableEntryBaseFilter extends KalturaBaseEntryFilter +{ + /** + * + * + * @var int + */ + public $lastPlayedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $lastPlayedAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $durationLessThan = null; + + /** + * + * + * @var int + */ + public $durationGreaterThan = null; + + /** + * + * + * @var int + */ + public $durationLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $durationGreaterThanOrEqual = null; + + /** + * + * + * @var string + */ + public $durationTypeMatchOr = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlayableEntryFilter extends KalturaPlayableEntryBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMediaEntryBaseFilter extends KalturaPlayableEntryFilter +{ + /** + * + * + * @var KalturaMediaType + */ + public $mediaTypeEqual = null; + + /** + * + * + * @var string + */ + public $mediaTypeIn = null; + + /** + * + * + * @var KalturaSourceType + */ + public $sourceTypeEqual = null; + + /** + * + * + * @var KalturaSourceType + */ + public $sourceTypeNotEqual = null; + + /** + * + * + * @var string + */ + public $sourceTypeIn = null; + + /** + * + * + * @var string + */ + public $sourceTypeNotIn = null; + + /** + * + * + * @var int + */ + public $mediaDateGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $mediaDateLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $flavorParamsIdsMatchOr = null; + + /** + * + * + * @var string + */ + public $flavorParamsIdsMatchAnd = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaEntryFilter extends KalturaMediaEntryBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaEntryFilterForPlaylist extends KalturaMediaEntryFilter +{ + /** + * + * + * @var int + */ + public $limit = null; + + /** + * + * + * @var string + */ + public $name = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaInfo extends KalturaObjectBase +{ + /** + * The id of the media info + * + * @var int + * @readonly + */ + public $id = null; + + /** + * The id of the related flavor asset + * + * @var string + */ + public $flavorAssetId = null; + + /** + * The file size + * + * @var int + */ + public $fileSize = null; + + /** + * The container format + * + * @var string + */ + public $containerFormat = null; + + /** + * The container id + * + * @var string + */ + public $containerId = null; + + /** + * The container profile + * + * @var string + */ + public $containerProfile = null; + + /** + * The container duration + * + * @var int + */ + public $containerDuration = null; + + /** + * The container bit rate + * + * @var int + */ + public $containerBitRate = null; + + /** + * The video format + * + * @var string + */ + public $videoFormat = null; + + /** + * The video codec id + * + * @var string + */ + public $videoCodecId = null; + + /** + * The video duration + * + * @var int + */ + public $videoDuration = null; + + /** + * The video bit rate + * + * @var int + */ + public $videoBitRate = null; + + /** + * The video bit rate mode + * + * @var KalturaBitRateMode + */ + public $videoBitRateMode = null; + + /** + * The video width + * + * @var int + */ + public $videoWidth = null; + + /** + * The video height + * + * @var int + */ + public $videoHeight = null; + + /** + * The video frame rate + * + * @var float + */ + public $videoFrameRate = null; + + /** + * The video display aspect ratio (dar) + * + * @var float + */ + public $videoDar = null; + + /** + * + * + * @var int + */ + public $videoRotation = null; + + /** + * The audio format + * + * @var string + */ + public $audioFormat = null; + + /** + * The audio codec id + * + * @var string + */ + public $audioCodecId = null; + + /** + * The audio duration + * + * @var int + */ + public $audioDuration = null; + + /** + * The audio bit rate + * + * @var int + */ + public $audioBitRate = null; + + /** + * The audio bit rate mode + * + * @var KalturaBitRateMode + */ + public $audioBitRateMode = null; + + /** + * The number of audio channels + * + * @var int + */ + public $audioChannels = null; + + /** + * The audio sampling rate + * + * @var int + */ + public $audioSamplingRate = null; + + /** + * The audio resolution + * + * @var int + */ + public $audioResolution = null; + + /** + * The writing library + * + * @var string + */ + public $writingLib = null; + + /** + * The data as returned by the mediainfo command line + * + * @var string + */ + public $rawData = null; + + /** + * + * + * @var string + */ + public $multiStreamInfo = null; + + /** + * + * + * @var int + */ + public $scanType = null; + + /** + * + * + * @var string + */ + public $multiStream = null; + + /** + * + * + * @var int + */ + public $isFastStart = null; + + /** + * + * + * @var string + */ + public $contentStreams = null; + + /** + * + * + * @var int + */ + public $complexityValue = null; + + /** + * + * + * @var float + */ + public $maxGOP = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMixEntry extends KalturaPlayableEntry +{ + /** + * Indicates whether the user has submited a real thumbnail to the mix (Not the one that was generated automaticaly) + * + * @var bool + * @readonly + */ + public $hasRealThumbnail = null; + + /** + * The editor type used to edit the metadata + * + * @var KalturaEditorType + */ + public $editorType = null; + + /** + * The xml data of the mix + * + * @var string + */ + public $dataContent = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaModerationFlag extends KalturaObjectBase +{ + /** + * Moderation flag id + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * The user id that added the moderation flag + * + * @var string + * @readonly + */ + public $userId = null; + + /** + * The type of the moderation flag (entry or user) + * + * @var KalturaModerationObjectType + * @readonly + */ + public $moderationObjectType = null; + + /** + * If moderation flag is set for entry, this is the flagged entry id + * + * @var string + */ + public $flaggedEntryId = null; + + /** + * If moderation flag is set for user, this is the flagged user id + * + * @var string + */ + public $flaggedUserId = null; + + /** + * The moderation flag status + * + * @var KalturaModerationFlagStatus + * @readonly + */ + public $status = null; + + /** + * The comment that was added to the flag + * + * @var string + */ + public $comments = null; + + /** + * + * + * @var KalturaModerationFlagType + */ + public $flagType = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartnerStatistics extends KalturaObjectBase +{ + /** + * Package total allowed bandwidth and storage + * + * @var int + * @readonly + */ + public $packageBandwidthAndStorage = null; + + /** + * Partner total hosting in GB on the disk + * + * @var float + * @readonly + */ + public $hosting = null; + + /** + * Partner total bandwidth in GB + * + * @var float + * @readonly + */ + public $bandwidth = null; + + /** + * total usage in GB - including bandwidth and storage + * + * @var int + * @readonly + */ + public $usage = null; + + /** + * Percent of usage out of partner's package. if usage is 5GB and package is 10GB, this value will be 50 + * + * @var float + * @readonly + */ + public $usagePercent = null; + + /** + * date when partner reached the limit of his package (timestamp) + * + * @var int + * @readonly + */ + public $reachedLimitDate = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartnerUsage extends KalturaObjectBase +{ + /** + * Partner total hosting in GB on the disk + * + * @var float + * @readonly + */ + public $hostingGB = null; + + /** + * percent of usage out of partner's package. if usageGB is 5 and package is 10GB, this value will be 50 + * + * @var float + * @readonly + */ + public $Percent = null; + + /** + * package total BW - actually this is usage, which represents BW+storage + * + * @var int + * @readonly + */ + public $packageBW = null; + + /** + * total usage in GB - including bandwidth and storage + * + * @var float + * @readonly + */ + public $usageGB = null; + + /** + * date when partner reached the limit of his package (timestamp) + * + * @var int + * @readonly + */ + public $reachedLimitDate = null; + + /** + * a semi-colon separated list of comma-separated key-values to represent a usage graph. + * keys could be 1-12 for a year view (1,1.2;2,1.1;3,0.9;...;12,1.4;) + * keys could be 1-[28,29,30,31] depending on the requested month, for a daily view in a given month (1,0.4;2,0.2;...;31,0.1;) + * + * @var string + * @readonly + */ + public $usageGraph = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermission extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var KalturaPermissionType + * @readonly + */ + public $type = null; + + /** + * + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $friendlyName = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var KalturaPermissionStatus + */ + public $status = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var string + */ + public $dependsOnPermissionNames = null; + + /** + * + * + * @var string + */ + public $tags = null; + + /** + * + * + * @var string + */ + public $permissionItemsIds = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var string + */ + public $partnerGroup = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaPermissionItem extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var KalturaPermissionItemType + * @readonly + */ + public $type = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var string + */ + public $tags = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaybackSource extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $deliveryProfileId = null; + + /** + * source format according to delivery profile streamer type (applehttp, mpegdash etc.) + * + * @var string + */ + public $format = null; + + /** + * comma separated string according to deliveryProfile media protocols ('http,https' etc.) + * + * @var string + */ + public $protocols = null; + + /** + * comma separated string of flavor ids + * + * @var string + */ + public $flavorIds = null; + + /** + * + * + * @var string + */ + public $url = null; + + /** + * drm data object containing relevant license url ,scheme name and certificate + * + * @var array of KalturaDrmPlaybackPluginData + */ + public $drm; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaybackContext extends KalturaObjectBase +{ + /** + * + * + * @var array of KalturaPlaybackSource + */ + public $sources; + + /** + * + * + * @var array of KalturaFlavorAsset + */ + public $flavorAssets; + + /** + * Array of actions as received from the rules that invalidated + * + * @var array of KalturaRuleAction + */ + public $actions; + + /** + * Array of actions as received from the rules that invalidated + * + * @var array of KalturaAccessControlMessage + */ + public $messages; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylist extends KalturaBaseEntry +{ + /** + * Content of the playlist - + * XML if the playlistType is dynamic + * text if the playlistType is static + * url if the playlistType is mRss + * + * @var string + */ + public $playlistContent = null; + + /** + * + * + * @var array of KalturaMediaEntryFilterForPlaylist + */ + public $filters; + + /** + * Maximum count of results to be returned in playlist execution + * + * @var int + */ + public $totalResults = null; + + /** + * Type of playlist + * + * @var KalturaPlaylistType + */ + public $playlistType = null; + + /** + * Number of plays + * + * @var int + * @readonly + */ + public $plays = null; + + /** + * Number of views + * + * @var int + * @readonly + */ + public $views = null; + + /** + * The duration in seconds + * + * @var int + * @readonly + */ + public $duration = null; + + /** + * The url for this playlist + * + * @var string + * @readonly + */ + public $executeUrl = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRemotePath extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $storageProfileId = null; + + /** + * + * + * @var string + * @readonly + */ + public $uri = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlResource extends KalturaContentResource +{ + /** + * Remote URL, FTP, HTTP or HTTPS + * + * @var string + */ + public $url = null; + + /** + * Force Import Job + * + * @var bool + */ + public $forceAsyncDownload = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRemoteStorageResource extends KalturaUrlResource +{ + /** + * ID of storage profile to be associated with the created file sync, used for file serving URL composing. + * + * @var int + */ + public $storageProfileId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReport extends KalturaObjectBase +{ + /** + * Report id + * + * @var int + * @readonly + */ + public $id = null; + + /** + * Partner id associated with the report + * + * @var int + */ + public $partnerId = null; + + /** + * Report name + * + * @var string + */ + public $name = null; + + /** + * Used to identify system reports in a friendly way + * + * @var string + */ + public $systemName = null; + + /** + * Report description + * + * @var string + */ + public $description = null; + + /** + * Report query + * + * @var string + */ + public $query = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Last update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportBaseTotal extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $id = null; + + /** + * + * + * @var string + */ + public $data = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportGraph extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $id = null; + + /** + * + * + * @var string + */ + public $data = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportInputBaseFilter extends KalturaObjectBase +{ + /** + * Start date as Unix timestamp (In seconds) + * + * @var int + */ + public $fromDate = null; + + /** + * End date as Unix timestamp (In seconds) + * + * @var int + */ + public $toDate = null; + + /** + * Start day as string (YYYYMMDD) + * + * @var string + */ + public $fromDay = null; + + /** + * End date as string (YYYYMMDD) + * + * @var string + */ + public $toDay = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportResponse extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $columns = null; + + /** + * + * + * @var array of KalturaString + */ + public $results; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportTable extends KalturaObjectBase +{ + /** + * + * + * @var string + * @readonly + */ + public $header = null; + + /** + * + * + * @var string + * @readonly + */ + public $data = null; + + /** + * + * + * @var int + * @readonly + */ + public $totalCount = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportTotal extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $header = null; + + /** + * + * + * @var string + */ + public $data = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRequestConfiguration extends KalturaObjectBase +{ + /** + * Impersonated partner id + * + * @var int + */ + public $partnerId = null; + + /** + * Kaltura API session + * + * @var string + */ + public $ks = null; + + /** + * Response profile - this attribute will be automatically unset after every API call. + * + * @var KalturaBaseResponseProfile + */ + public $responseProfile; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfile extends KalturaDetachedResponseProfile +{ + /** + * Auto generated numeric identifier + * + * @var int + * @readonly + */ + public $id = null; + + /** + * Unique system name + * + * @var string + */ + public $systemName = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * Creation time as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Update time as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var KalturaResponseProfileStatus + * @readonly + */ + public $status = null; + + /** + * + * + * @var int + * @readonly + */ + public $version = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileCacheRecalculateOptions extends KalturaObjectBase +{ + /** + * Maximum number of keys to recalculate + * + * @var int + */ + public $limit = null; + + /** + * Class name + * + * @var string + */ + public $cachedObjectType = null; + + /** + * + * + * @var string + */ + public $objectId = null; + + /** + * + * + * @var string + */ + public $startObjectKey = null; + + /** + * + * + * @var string + */ + public $endObjectKey = null; + + /** + * + * + * @var int + */ + public $jobCreatedAt = null; + + /** + * + * + * @var bool + */ + public $isFirstLoop = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileCacheRecalculateResults extends KalturaObjectBase +{ + /** + * Last recalculated id + * + * @var string + */ + public $lastObjectKey = null; + + /** + * Number of recalculated keys + * + * @var int + */ + public $recalculated = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaScope extends KalturaObjectBase +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearch extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $keyWords = null; + + /** + * + * + * @var KalturaSearchProviderType + */ + public $searchSource = null; + + /** + * + * + * @var KalturaMediaType + */ + public $mediaType = null; + + /** + * Use this field to pass dynamic data for searching + * For example - if you set this field to "mymovies_$partner_id" + * The $partner_id will be automatically replcaed with your real partner Id + * + * @var string + */ + public $extraData = null; + + /** + * + * + * @var string + */ + public $authData = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchAuthData extends KalturaObjectBase +{ + /** + * The authentication data that further should be used for search + * + * @var string + */ + public $authData = null; + + /** + * Login URL when user need to sign-in and authorize the search + * + * @var string + */ + public $loginUrl = null; + + /** + * Information when there was an error + * + * @var string + */ + public $message = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchResult extends KalturaSearch +{ + /** + * + * + * @var string + */ + public $id = null; + + /** + * + * + * @var string + */ + public $title = null; + + /** + * + * + * @var string + */ + public $thumbUrl = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var string + */ + public $tags = null; + + /** + * + * + * @var string + */ + public $url = null; + + /** + * + * + * @var string + */ + public $sourceLink = null; + + /** + * + * + * @var string + */ + public $credit = null; + + /** + * + * + * @var KalturaLicenseType + */ + public $licenseType = null; + + /** + * + * + * @var string + */ + public $flashPlaybackType = null; + + /** + * + * + * @var string + */ + public $fileExt = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchResultResponse extends KalturaObjectBase +{ + /** + * + * + * @var array of KalturaSearchResult + * @readonly + */ + public $objects; + + /** + * + * + * @var bool + * @readonly + */ + public $needMediaInfo = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaServerNode extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $heartbeatTime = null; + + /** + * serverNode name + * + * @var string + */ + public $name = null; + + /** + * serverNode uniqe system name + * + * @var string + */ + public $systemName = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * serverNode hostName + * + * @var string + */ + public $hostName = null; + + /** + * + * + * @var KalturaServerNodeStatus + * @readonly + */ + public $status = null; + + /** + * + * + * @var KalturaServerNodeType + * @readonly + */ + public $type = null; + + /** + * serverNode tags + * + * @var string + */ + public $tags = null; + + /** + * DC where the serverNode is located + * + * @var int + * @readonly + */ + public $dc = null; + + /** + * Id of the parent serverNode + * + * @var string + */ + public $parentId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSessionInfo extends KalturaObjectBase +{ + /** + * + * + * @var string + * @readonly + */ + public $ks = null; + + /** + * + * + * @var KalturaSessionType + * @readonly + */ + public $sessionType = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var string + * @readonly + */ + public $userId = null; + + /** + * + * + * @var int + * @readonly + */ + public $expiry = null; + + /** + * + * + * @var string + * @readonly + */ + public $privileges = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSourceFileSyncDescriptor extends KalturaFileSyncDescriptor +{ + /** + * The translated path as used by the scheduler + * + * @var string + */ + public $actualFileSyncLocalPath = null; + + /** + * + * + * @var string + */ + public $assetId = null; + + /** + * + * + * @var int + */ + public $assetParamsId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStartWidgetSessionResponse extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var string + * @readonly + */ + public $ks = null; + + /** + * + * + * @var string + * @readonly + */ + public $userId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStatsEvent extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $clientVer = null; + + /** + * + * + * @var KalturaStatsEventType + */ + public $eventType = null; + + /** + * the client's timestamp of this event + * + * @var float + */ + public $eventTimestamp = null; + + /** + * a unique string generated by the client that will represent the client-side session: the primary component will pass it on to other components that sprout from it + * + * @var string + */ + public $sessionId = null; + + /** + * + * + * @var int + */ + public $partnerId = null; + + /** + * + * + * @var string + */ + public $entryId = null; + + /** + * the UV cookie - creates in the operational system and should be passed on ofr every event + * + * @var string + */ + public $uniqueViewer = null; + + /** + * + * + * @var string + */ + public $widgetId = null; + + /** + * + * + * @var int + */ + public $uiconfId = null; + + /** + * the partner's user id + * + * @var string + */ + public $userId = null; + + /** + * the timestamp along the video when the event happend + * + * @var int + */ + public $currentPoint = null; + + /** + * the duration of the video in milliseconds - will make it much faster than quering the db for each entry + * + * @var int + */ + public $duration = null; + + /** + * will be retrieved from the request of the user + * + * @var string + * @readonly + */ + public $userIp = null; + + /** + * the time in milliseconds the event took + * + * @var int + */ + public $processDuration = null; + + /** + * the id of the GUI control - will be used in the future to better understand what the user clicked + * + * @var string + */ + public $controlId = null; + + /** + * true if the user ever used seek in this session + * + * @var bool + */ + public $seek = null; + + /** + * timestamp of the new point on the timeline of the video after the user seeks + * + * @var int + */ + public $newPoint = null; + + /** + * the referrer of the client + * + * @var string + */ + public $referrer = null; + + /** + * will indicate if the event is thrown for the first video in the session + * + * @var bool + */ + public $isFirstInSession = null; + + /** + * kaltura application name + * + * @var string + */ + public $applicationId = null; + + /** + * + * + * @var int + */ + public $contextId = null; + + /** + * + * + * @var KalturaStatsFeatureType + */ + public $featureType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStatsKmcEvent extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $clientVer = null; + + /** + * + * + * @var string + */ + public $kmcEventActionPath = null; + + /** + * + * + * @var KalturaStatsKmcEventType + */ + public $kmcEventType = null; + + /** + * the client's timestamp of this event + * + * @var float + */ + public $eventTimestamp = null; + + /** + * a unique string generated by the client that will represent the client-side session: the primary component will pass it on to other components that sprout from it + * + * @var string + */ + public $sessionId = null; + + /** + * + * + * @var int + */ + public $partnerId = null; + + /** + * + * + * @var string + */ + public $entryId = null; + + /** + * + * + * @var string + */ + public $widgetId = null; + + /** + * + * + * @var int + */ + public $uiconfId = null; + + /** + * the partner's user id + * + * @var string + */ + public $userId = null; + + /** + * will be retrieved from the request of the user + * + * @var string + * @readonly + */ + public $userIp = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageProfile extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $systemName = null; + + /** + * + * + * @var string + */ + public $desciption = null; + + /** + * + * + * @var KalturaStorageProfileStatus + */ + public $status = null; + + /** + * + * + * @var KalturaStorageProfileProtocol + */ + public $protocol = null; + + /** + * + * + * @var string + */ + public $storageUrl = null; + + /** + * + * + * @var string + */ + public $storageBaseDir = null; + + /** + * + * + * @var string + */ + public $storageUsername = null; + + /** + * + * + * @var string + */ + public $storagePassword = null; + + /** + * + * + * @var bool + */ + public $storageFtpPassiveMode = null; + + /** + * + * + * @var int + */ + public $minFileSize = null; + + /** + * + * + * @var int + */ + public $maxFileSize = null; + + /** + * + * + * @var string + */ + public $flavorParamsIds = null; + + /** + * + * + * @var int + */ + public $maxConcurrentConnections = null; + + /** + * + * + * @var string + */ + public $pathManagerClass = null; + + /** + * + * + * @var array of KalturaKeyValue + */ + public $pathManagerParams; + + /** + * No need to create enum for temp field + * + * @var int + */ + public $trigger = null; + + /** + * Delivery Priority + * + * @var int + */ + public $deliveryPriority = null; + + /** + * + * + * @var KalturaStorageProfileDeliveryStatus + */ + public $deliveryStatus = null; + + /** + * + * + * @var KalturaStorageProfileReadyBehavior + */ + public $readyBehavior = null; + + /** + * Flag sugnifying that the storage exported content should be deleted when soure entry is deleted + * + * @var int + */ + public $allowAutoDelete = null; + + /** + * Indicates to the local file transfer manager to create a link to the file instead of copying it + * + * @var bool + */ + public $createFileLink = null; + + /** + * Holds storage profile export rules + * + * @var array of KalturaRule + */ + public $rules; + + /** + * Delivery profile ids + * + * @var array of KalturaKeyValue + */ + public $deliveryProfileIds; + + /** + * + * + * @var string + */ + public $privateKey = null; + + /** + * + * + * @var string + */ + public $publicKey = null; + + /** + * + * + * @var string + */ + public $passPhrase = null; + + /** + * + * + * @var bool + */ + public $shouldExportThumbs = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSyndicationFeedEntryCount extends KalturaObjectBase +{ + /** + * the total count of entries that should appear in the feed without flavor filtering + * + * @var int + */ + public $totalEntryCount = null; + + /** + * count of entries that will appear in the feed (including all relevant filters) + * + * @var int + */ + public $actualEntryCount = null; + + /** + * count of entries that requires transcoding in order to be included in feed + * + * @var int + */ + public $requireTranscodingCount = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbAsset extends KalturaAsset +{ + /** + * The Flavor Params used to create this Flavor Asset + * + * @var int + * @insertonly + */ + public $thumbParamsId = null; + + /** + * The width of the Flavor Asset + * + * @var int + * @readonly + */ + public $width = null; + + /** + * The height of the Flavor Asset + * + * @var int + * @readonly + */ + public $height = null; + + /** + * The status of the asset + * + * @var KalturaThumbAssetStatus + * @readonly + */ + public $status = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParams extends KalturaAssetParams +{ + /** + * + * + * @var KalturaThumbCropType + */ + public $cropType = null; + + /** + * + * + * @var int + */ + public $quality = null; + + /** + * + * + * @var int + */ + public $cropX = null; + + /** + * + * + * @var int + */ + public $cropY = null; + + /** + * + * + * @var int + */ + public $cropWidth = null; + + /** + * + * + * @var int + */ + public $cropHeight = null; + + /** + * + * + * @var float + */ + public $videoOffset = null; + + /** + * + * + * @var int + */ + public $width = null; + + /** + * + * + * @var int + */ + public $height = null; + + /** + * + * + * @var float + */ + public $scaleWidth = null; + + /** + * + * + * @var float + */ + public $scaleHeight = null; + + /** + * Hexadecimal value + * + * @var string + */ + public $backgroundColor = null; + + /** + * Id of the flavor params or the thumbnail params to be used as source for the thumbnail creation + * + * @var int + */ + public $sourceParamsId = null; + + /** + * The container format of the Flavor Params + * + * @var KalturaContainerFormat + */ + public $format = null; + + /** + * The image density (dpi) for example: 72 or 96 + * + * @var int + */ + public $density = null; + + /** + * Strip profiles and comments + * + * @var bool + */ + public $stripProfiles = null; + + /** + * Create thumbnail from the videoLengthpercentage second + * + * @var int + */ + public $videoOffsetInPercentage = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParamsOutput extends KalturaThumbParams +{ + /** + * + * + * @var int + */ + public $thumbParamsId = null; + + /** + * + * + * @var string + */ + public $thumbParamsVersion = null; + + /** + * + * + * @var string + */ + public $thumbAssetId = null; + + /** + * + * + * @var string + */ + public $thumbAssetVersion = null; + + /** + * + * + * @var int + */ + public $rotate = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUiConf extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * Name of the uiConf, this is not a primary key + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var KalturaUiConfObjType + */ + public $objType = null; + + /** + * + * + * @var string + * @readonly + */ + public $objTypeAsString = null; + + /** + * + * + * @var int + */ + public $width = null; + + /** + * + * + * @var int + */ + public $height = null; + + /** + * + * + * @var string + */ + public $htmlParams = null; + + /** + * + * + * @var string + */ + public $swfUrl = null; + + /** + * + * + * @var string + * @readonly + */ + public $confFilePath = null; + + /** + * + * + * @var string + */ + public $confFile = null; + + /** + * + * + * @var string + */ + public $confFileFeatures = null; + + /** + * + * + * @var string + */ + public $config = null; + + /** + * + * + * @var string + */ + public $confVars = null; + + /** + * + * + * @var bool + */ + public $useCdn = null; + + /** + * + * + * @var string + */ + public $tags = null; + + /** + * + * + * @var string + */ + public $swfUrlVersion = null; + + /** + * Entry creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Entry creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var KalturaUiConfCreationMode + */ + public $creationMode = null; + + /** + * + * + * @var string + */ + public $html5Url = null; + + /** + * UiConf version + * + * @var string + * @readonly + */ + public $version = null; + + /** + * + * + * @var string + */ + public $partnerTags = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUiConfTypeInfo extends KalturaObjectBase +{ + /** + * UiConf Type + * + * @var KalturaUiConfObjType + */ + public $type = null; + + /** + * Available versions + * + * @var array of KalturaString + */ + public $versions; + + /** + * The direcotry this type is saved at + * + * @var string + */ + public $directory = null; + + /** + * Filename for this UiConf type + * + * @var string + */ + public $filename = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadResponse extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $uploadTokenId = null; + + /** + * + * + * @var int + */ + public $fileSize = null; + + /** + * + * + * @var KalturaUploadErrorCode + */ + public $errorCode = null; + + /** + * + * + * @var string + */ + public $errorDescription = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadToken extends KalturaObjectBase +{ + /** + * Upload token unique ID + * + * @var string + * @readonly + */ + public $id = null; + + /** + * Partner ID of the upload token + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * User id for the upload token + * + * @var string + * @readonly + */ + public $userId = null; + + /** + * Status of the upload token + * + * @var KalturaUploadTokenStatus + * @readonly + */ + public $status = null; + + /** + * Name of the file for the upload token, can be empty when the upload token is created and will be updated internally after the file is uploaded + * + * @var string + * @insertonly + */ + public $fileName = null; + + /** + * File size in bytes, can be empty when the upload token is created and will be updated internally after the file is uploaded + * + * @var float + * @insertonly + */ + public $fileSize = null; + + /** + * Uploaded file size in bytes, can be used to identify how many bytes were uploaded before resuming + * + * @var float + * @readonly + */ + public $uploadedFileSize = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Last update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * Upload url - to explicitly determine to which domain to adress the uploadToken->upload call + * + * @var string + * @readonly + */ + public $uploadUrl = null; + + /** + * autoFinalize - Should the upload be finalized once the file size on disk matches the file size reproted when adding the upload token. + * + * @var KalturaNullableBoolean + * @insertonly + */ + public $autoFinalize = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUser extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $id = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var KalturaUserType + */ + public $type = null; + + /** + * + * + * @var string + */ + public $screenName = null; + + /** + * + * + * @var string + */ + public $fullName = null; + + /** + * + * + * @var string + */ + public $email = null; + + /** + * + * + * @var int + */ + public $dateOfBirth = null; + + /** + * + * + * @var string + */ + public $country = null; + + /** + * + * + * @var string + */ + public $state = null; + + /** + * + * + * @var string + */ + public $city = null; + + /** + * + * + * @var string + */ + public $zip = null; + + /** + * + * + * @var string + */ + public $thumbnailUrl = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var string + */ + public $tags = null; + + /** + * Admin tags can be updated only by using an admin session + * + * @var string + */ + public $adminTags = null; + + /** + * + * + * @var KalturaGender + */ + public $gender = null; + + /** + * + * + * @var KalturaUserStatus + */ + public $status = null; + + /** + * Creation date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * Last update date as Unix timestamp (In seconds) + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * Can be used to store various partner related data as a string + * + * @var string + */ + public $partnerData = null; + + /** + * + * + * @var int + */ + public $indexedPartnerDataInt = null; + + /** + * + * + * @var string + */ + public $indexedPartnerDataString = null; + + /** + * + * + * @var int + * @readonly + */ + public $storageSize = null; + + /** + * + * + * @var string + * @insertonly + */ + public $password = null; + + /** + * + * + * @var string + */ + public $firstName = null; + + /** + * + * + * @var string + */ + public $lastName = null; + + /** + * + * + * @var bool + */ + public $isAdmin = null; + + /** + * + * + * @var KalturaLanguageCode + */ + public $language = null; + + /** + * + * + * @var int + * @readonly + */ + public $lastLoginTime = null; + + /** + * + * + * @var int + * @readonly + */ + public $statusUpdatedAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $deletedAt = null; + + /** + * + * + * @var bool + * @insertonly + */ + public $loginEnabled = null; + + /** + * + * + * @var string + */ + public $roleIds = null; + + /** + * + * + * @var string + * @readonly + */ + public $roleNames = null; + + /** + * + * + * @var bool + * @insertonly + */ + public $isAccountOwner = null; + + /** + * + * + * @var string + */ + public $allowedPartnerIds = null; + + /** + * + * + * @var string + */ + public $allowedPartnerPackages = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaUserEntry extends KalturaObjectBase +{ + /** + * unique auto-generated identifier + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var string + * @insertonly + */ + public $entryId = null; + + /** + * + * + * @var string + * @insertonly + */ + public $userId = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var KalturaUserEntryStatus + * @readonly + */ + public $status = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * + * + * @var KalturaUserEntryType + * @readonly + */ + public $type = null; + + /** + * + * + * @var KalturaUserEntryExtendedStatus + */ + public $extendedStatus = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserLoginData extends KalturaObjectBase +{ + /** + * + * + * @var string + */ + public $id = null; + + /** + * + * + * @var string + */ + public $loginEmail = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserRole extends KalturaObjectBase +{ + /** + * + * + * @var int + * @readonly + */ + public $id = null; + + /** + * + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $systemName = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var KalturaUserRoleStatus + */ + public $status = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var string + */ + public $permissionNames = null; + + /** + * + * + * @var string + */ + public $tags = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaWidget extends KalturaObjectBase +{ + /** + * + * + * @var string + * @readonly + */ + public $id = null; + + /** + * + * + * @var string + */ + public $sourceWidgetId = null; + + /** + * + * + * @var string + * @readonly + */ + public $rootWidgetId = null; + + /** + * + * + * @var int + * @readonly + */ + public $partnerId = null; + + /** + * + * + * @var string + */ + public $entryId = null; + + /** + * + * + * @var int + */ + public $uiConfId = null; + + /** + * + * + * @var KalturaWidgetSecurityType + */ + public $securityType = null; + + /** + * + * + * @var int + */ + public $securityPolicy = null; + + /** + * + * + * @var int + * @readonly + */ + public $createdAt = null; + + /** + * + * + * @var int + * @readonly + */ + public $updatedAt = null; + + /** + * Can be used to store various partner related data as a string + * + * @var string + */ + public $partnerData = null; + + /** + * + * + * @var string + * @readonly + */ + public $widgetHTML = null; + + /** + * Should enforce entitlement on feed entries + * + * @var bool + */ + public $enforceEntitlement = null; + + /** + * Set privacy context for search entries that assiged to private and public categories within a category privacy context. + * + * @var string + */ + public $privacyContext = null; + + /** + * Addes the HTML5 script line to the widget's embed code + * + * @var bool + */ + public $addEmbedHtml5Support = null; + + /** + * + * + * @var string + */ + public $roles = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBatchJobBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var int + */ + public $idGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $partnerIdIn = null; + + /** + * + * + * @var string + */ + public $partnerIdNotIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $executionAttemptsGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $executionAttemptsLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $lockVersionGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $lockVersionLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $entryIdEqual = null; + + /** + * + * + * @var KalturaBatchJobType + */ + public $jobTypeEqual = null; + + /** + * + * + * @var string + */ + public $jobTypeIn = null; + + /** + * + * + * @var string + */ + public $jobTypeNotIn = null; + + /** + * + * + * @var int + */ + public $jobSubTypeEqual = null; + + /** + * + * + * @var string + */ + public $jobSubTypeIn = null; + + /** + * + * + * @var string + */ + public $jobSubTypeNotIn = null; + + /** + * + * + * @var KalturaBatchJobStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var string + */ + public $statusNotIn = null; + + /** + * + * + * @var int + */ + public $priorityGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $priorityLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $priorityEqual = null; + + /** + * + * + * @var string + */ + public $priorityIn = null; + + /** + * + * + * @var string + */ + public $priorityNotIn = null; + + /** + * + * + * @var int + */ + public $batchVersionGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $batchVersionLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $batchVersionEqual = null; + + /** + * + * + * @var int + */ + public $queueTimeGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $queueTimeLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $finishTimeGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $finishTimeLessThanOrEqual = null; + + /** + * + * + * @var KalturaBatchJobErrorTypes + */ + public $errTypeEqual = null; + + /** + * + * + * @var string + */ + public $errTypeIn = null; + + /** + * + * + * @var string + */ + public $errTypeNotIn = null; + + /** + * + * + * @var int + */ + public $errNumberEqual = null; + + /** + * + * + * @var string + */ + public $errNumberIn = null; + + /** + * + * + * @var string + */ + public $errNumberNotIn = null; + + /** + * + * + * @var int + */ + public $estimatedEffortLessThan = null; + + /** + * + * + * @var int + */ + public $estimatedEffortGreaterThan = null; + + /** + * + * + * @var int + */ + public $urgencyLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $urgencyGreaterThanOrEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchJobFilter extends KalturaBatchJobBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlBlockAction extends KalturaRuleAction +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlLimitDeliveryProfilesAction extends KalturaRuleAction +{ + /** + * Comma separated list of delivery profile ids + * + * @var string + */ + public $deliveryProfileIds = null; + + /** + * + * + * @var bool + */ + public $isBlockedList = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlLimitFlavorsAction extends KalturaRuleAction +{ + /** + * Comma separated list of flavor ids + * + * @var string + */ + public $flavorParamsIds = null; + + /** + * + * + * @var bool + */ + public $isBlockedList = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlLimitThumbnailCaptureAction extends KalturaRuleAction +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaAccessControl + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlModifyRequestHostRegexAction extends KalturaRuleAction +{ + /** + * Request host regex pattern + * + * @var string + */ + public $pattern = null; + + /** + * Request host regex replacment + * + * @var string + */ + public $replacement = null; + + /** + * serverNodeId to generate replacment host from + * + * @var int + */ + public $replacmenServerNodeId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlPreviewAction extends KalturaRuleAction +{ + /** + * + * + * @var int + */ + public $limit = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlProfileListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaAccessControlProfile + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlServeRemoteEdgeServerAction extends KalturaRuleAction +{ + /** + * Comma separated list of edge servers playBack should be done from + * + * @var string + */ + public $edgeServerIds = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAdminUser extends KalturaUser +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAmazonS3StorageProfile extends KalturaStorageProfile +{ + /** + * + * + * @var KalturaAmazonS3StorageProfileFilesPermissionLevel + */ + public $filesPermissionInS3 = null; + + /** + * + * + * @var string + */ + public $s3Region = null; + + /** + * + * + * @var string + */ + public $sseType = null; + + /** + * + * + * @var string + */ + public $sseKmsKeyId = null; + + /** + * + * + * @var string + */ + public $signatureType = null; + + /** + * + * + * @var string + */ + public $endPoint = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaApiActionPermissionItem extends KalturaPermissionItem +{ + /** + * + * + * @var string + */ + public $service = null; + + /** + * + * + * @var string + */ + public $action = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaApiParameterPermissionItem extends KalturaPermissionItem +{ + /** + * + * + * @var string + */ + public $object = null; + + /** + * + * + * @var string + */ + public $parameter = null; + + /** + * + * + * @var KalturaApiParameterPermissionItemAction + */ + public $action = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaAppTokenBaseFilter extends KalturaFilter +{ + /** + * + * + * @var string + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaAppTokenStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var string + */ + public $sessionUserIdEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAppTokenListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaAppToken + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetParamsOutput extends KalturaAssetParams +{ + /** + * + * + * @var int + */ + public $assetParamsId = null; + + /** + * + * + * @var string + */ + public $assetParamsVersion = null; + + /** + * + * + * @var string + */ + public $assetId = null; + + /** + * + * + * @var string + */ + public $assetVersion = null; + + /** + * + * + * @var int + */ + public $readyBehavior = null; + + /** + * The container format of the Flavor Params + * + * @var KalturaContainerFormat + */ + public $format = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetPropertiesCompareCondition extends KalturaCondition +{ + /** + * Array of key/value objects that holds the property and the value to find and compare on an asset object + * + * @var array of KalturaKeyValue + */ + public $properties; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetTypeCondition extends KalturaCondition +{ + /** + * + * + * @var string + */ + public $assetTypes = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetsParamsResourceContainers extends KalturaResource +{ + /** + * Array of resources associated with asset params ids + * + * @var array of KalturaAssetParamsResourceContainer + */ + public $resources; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaAttributeCondition extends KalturaSearchItem +{ + /** + * + * + * @var string + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAuthenticatedCondition extends KalturaCondition +{ + /** + * The privelege needed to remove the restriction + * + * @var array of KalturaStringValue + */ + public $privileges; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryCloneOptionComponent extends KalturaBaseEntryCloneOptionItem +{ + /** + * + * + * @var KalturaBaseEntryCloneOptions + */ + public $itemType = null; + + /** + * condition rule (include/exclude) + * + * @var KalturaCloneComponentSelectorType + */ + public $rule = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaBaseEntry + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBaseSyndicationFeedBaseFilter extends KalturaFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseSyndicationFeedListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaBaseSyndicationFeed + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchJobListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaBatchJob + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkDownloadJobData extends KalturaJobData +{ + /** + * Comma separated list of entry ids + * + * @var string + */ + public $entryIds = null; + + /** + * Flavor params id to use for conversion + * + * @var int + */ + public $flavorParamsId = null; + + /** + * The id of the requesting user + * + * @var string + */ + public $puserId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBulkUploadBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $uploadedOnGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $uploadedOnLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $uploadedOnEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var KalturaBatchJobStatus + */ + public $statusEqual = null; + + /** + * + * + * @var KalturaBulkUploadObjectType + */ + public $bulkUploadObjectTypeEqual = null; + + /** + * + * + * @var string + */ + public $bulkUploadObjectTypeIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadCategoryData extends KalturaBulkUploadObjectData +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadCategoryEntryData extends KalturaBulkUploadObjectData +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadCategoryUserData extends KalturaBulkUploadObjectData +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadEntryData extends KalturaBulkUploadObjectData +{ + /** + * Selected profile id for all bulk entries + * + * @var int + */ + public $conversionProfileId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadJobData extends KalturaJobData +{ + /** + * + * + * @var string + * @readonly + */ + public $userId = null; + + /** + * The screen name of the user + * + * @var string + * @readonly + */ + public $uploadedBy = null; + + /** + * Selected profile id for all bulk entries + * + * @var int + * @readonly + */ + public $conversionProfileId = null; + + /** + * Created by the API + * + * @var string + * @readonly + */ + public $resultsFileLocalPath = null; + + /** + * Created by the API + * + * @var string + * @readonly + */ + public $resultsFileUrl = null; + + /** + * Number of created entries + * + * @var int + * @readonly + */ + public $numOfEntries = null; + + /** + * Number of created objects + * + * @var int + * @readonly + */ + public $numOfObjects = null; + + /** + * The bulk upload file path + * + * @var string + * @readonly + */ + public $filePath = null; + + /** + * Type of object for bulk upload + * + * @var KalturaBulkUploadObjectType + * @readonly + */ + public $bulkUploadObjectType = null; + + /** + * Friendly name of the file, used to be recognized later in the logs. + * + * @var string + */ + public $fileName = null; + + /** + * Data pertaining to the objects being uploaded + * + * @var KalturaBulkUploadObjectData + * @readonly + */ + public $objectData; + + /** + * Type of bulk upload + * + * @var KalturaBulkUploadType + * @readonly + */ + public $type = null; + + /** + * Recipients of the email for bulk upload success/failure + * + * @var string + */ + public $emailRecipients = null; + + /** + * Number of objects that finished on error status + * + * @var int + */ + public $numOfErrorObjects = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaBulkUpload + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadResultCategory extends KalturaBulkUploadResult +{ + /** + * + * + * @var string + */ + public $relativePath = null; + + /** + * + * + * @var string + */ + public $name = null; + + /** + * + * + * @var string + */ + public $referenceId = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var string + */ + public $tags = null; + + /** + * + * + * @var int + */ + public $appearInList = null; + + /** + * + * + * @var int + */ + public $privacy = null; + + /** + * + * + * @var int + */ + public $inheritanceType = null; + + /** + * + * + * @var int + */ + public $userJoinPolicy = null; + + /** + * + * + * @var int + */ + public $defaultPermissionLevel = null; + + /** + * + * + * @var string + */ + public $owner = null; + + /** + * + * + * @var int + */ + public $contributionPolicy = null; + + /** + * + * + * @var int + */ + public $partnerSortValue = null; + + /** + * + * + * @var bool + */ + public $moderation = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadResultCategoryEntry extends KalturaBulkUploadResult +{ + /** + * + * + * @var int + */ + public $categoryId = null; + + /** + * + * + * @var string + */ + public $entryId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadResultCategoryUser extends KalturaBulkUploadResult +{ + /** + * + * + * @var int + */ + public $categoryId = null; + + /** + * + * + * @var string + */ + public $categoryReferenceId = null; + + /** + * + * + * @var string + */ + public $userId = null; + + /** + * + * + * @var int + */ + public $permissionLevel = null; + + /** + * + * + * @var int + */ + public $updateMethod = null; + + /** + * + * + * @var int + */ + public $requiredObjectStatus = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadResultEntry extends KalturaBulkUploadResult +{ + /** + * + * + * @var string + */ + public $entryId = null; + + /** + * + * + * @var string + */ + public $title = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var string + */ + public $tags = null; + + /** + * + * + * @var string + */ + public $url = null; + + /** + * + * + * @var string + */ + public $contentType = null; + + /** + * + * + * @var int + */ + public $conversionProfileId = null; + + /** + * + * + * @var int + */ + public $accessControlProfileId = null; + + /** + * + * + * @var string + */ + public $category = null; + + /** + * + * + * @var int + */ + public $scheduleStartDate = null; + + /** + * + * + * @var int + */ + public $scheduleEndDate = null; + + /** + * + * + * @var int + */ + public $entryStatus = null; + + /** + * + * + * @var string + */ + public $thumbnailUrl = null; + + /** + * + * + * @var bool + */ + public $thumbnailSaved = null; + + /** + * + * + * @var string + */ + public $sshPrivateKey = null; + + /** + * + * + * @var string + */ + public $sshPublicKey = null; + + /** + * + * + * @var string + */ + public $sshKeyPassphrase = null; + + /** + * + * + * @var string + */ + public $creatorId = null; + + /** + * + * + * @var string + */ + public $entitledUsersEdit = null; + + /** + * + * + * @var string + */ + public $entitledUsersPublish = null; + + /** + * + * + * @var string + */ + public $ownerId = null; + + /** + * + * + * @var string + */ + public $referenceId = null; + + /** + * + * + * @var string + */ + public $templateEntryId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadResultUser extends KalturaBulkUploadResult +{ + /** + * + * + * @var string + */ + public $userId = null; + + /** + * + * + * @var string + */ + public $screenName = null; + + /** + * + * + * @var string + */ + public $email = null; + + /** + * + * + * @var string + */ + public $description = null; + + /** + * + * + * @var string + */ + public $tags = null; + + /** + * + * + * @var int + */ + public $dateOfBirth = null; + + /** + * + * + * @var string + */ + public $country = null; + + /** + * + * + * @var string + */ + public $state = null; + + /** + * + * + * @var string + */ + public $city = null; + + /** + * + * + * @var string + */ + public $zip = null; + + /** + * + * + * @var int + */ + public $gender = null; + + /** + * + * + * @var string + */ + public $firstName = null; + + /** + * + * + * @var string + */ + public $lastName = null; + + /** + * + * + * @var string + */ + public $group = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadUserData extends KalturaBulkUploadObjectData +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCaptureThumbJobData extends KalturaJobData +{ + /** + * + * + * @var KalturaFileContainer + */ + public $fileContainer; + + /** + * The translated path as used by the scheduler + * + * @var string + */ + public $actualSrcFileSyncLocalPath = null; + + /** + * + * + * @var string + */ + public $srcFileSyncRemoteUrl = null; + + /** + * + * + * @var int + */ + public $thumbParamsOutputId = null; + + /** + * + * + * @var string + */ + public $thumbAssetId = null; + + /** + * + * + * @var string + */ + public $srcAssetId = null; + + /** + * + * + * @var KalturaAssetType + */ + public $srcAssetType = null; + + /** + * + * + * @var string + */ + public $thumbPath = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryEntryAdvancedFilter extends KalturaSearchItem +{ + /** + * + * + * @var string + */ + public $categoriesMatchOr = null; + + /** + * + * + * @var string + */ + public $categoryEntryStatusIn = null; + + /** + * + * + * @var KalturaCategoryEntryAdvancedOrderBy + */ + public $orderBy = null; + + /** + * + * + * @var int + */ + public $categoryIdEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryEntryListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaCategoryEntry + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryIdentifier extends KalturaObjectIdentifier +{ + /** + * Identifier of the object + * + * @var KalturaCategoryIdentifierField + */ + public $identifier = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaCategory + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryUserAdvancedFilter extends KalturaSearchItem +{ + /** + * + * + * @var string + */ + public $memberIdEq = null; + + /** + * + * + * @var string + */ + public $memberIdIn = null; + + /** + * + * + * @var string + */ + public $memberPermissionsMatchOr = null; + + /** + * + * + * @var string + */ + public $memberPermissionsMatchAnd = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryUserListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaCategoryUser + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaClipAttributes extends KalturaOperationAttributes +{ + /** + * Offset in milliseconds + * + * @var int + */ + public $offset = null; + + /** + * Duration in milliseconds + * + * @var int + */ + public $duration = null; + + /** + * global Offset In Destination in milliseconds + * + * @var int + */ + public $globalOffsetInDestination = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaClipConcatJobData extends KalturaJobData +{ + /** + * $partnerId + * + * @var int + */ + public $partnerId = null; + + /** + * $priority + * + * @var int + */ + public $priority = null; + + /** + * clip operations + * + * @var array of KalturaObject + */ + public $operationAttributes; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaCompareCondition extends KalturaCondition +{ + /** + * Value to evaluate against the field and operator + * + * @var KalturaIntegerValue + */ + public $value; + + /** + * Comparing operator + * + * @var KalturaSearchConditionComparison + */ + public $comparison = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDataCenterContentResource extends KalturaContentResource +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConcatAttributes extends KalturaOperationAttributes +{ + /** + * The resource to be concatenated + * + * @var KalturaDataCenterContentResource + */ + public $resource; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConcatJobData extends KalturaJobData +{ + /** + * Source files to be concatenated + * + * @var array of KalturaString + */ + public $srcFiles; + + /** + * Output file + * + * @var string + */ + public $destFilePath = null; + + /** + * Flavor asset to be ingested with the output + * + * @var string + */ + public $flavorAssetId = null; + + /** + * Clipping offset in seconds + * + * @var float + */ + public $offset = null; + + /** + * Clipping duration in seconds + * + * @var float + */ + public $duration = null; + + /** + * duration of the concated video + * + * @var float + */ + public $concatenatedDuration = null; + + /** + * Should Sort the clip parts + * + * @var bool + */ + public $shouldSort = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaControlPanelCommandBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdByIdEqual = null; + + /** + * + * + * @var KalturaControlPanelCommandType + */ + public $typeEqual = null; + + /** + * + * + * @var string + */ + public $typeIn = null; + + /** + * + * + * @var KalturaControlPanelCommandTargetType + */ + public $targetTypeEqual = null; + + /** + * + * + * @var string + */ + public $targetTypeIn = null; + + /** + * + * + * @var KalturaControlPanelCommandStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaControlPanelCommandListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaControlPanelCommand + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConvartableJobData extends KalturaJobData +{ + /** + * + * + * @var string + */ + public $srcFileSyncLocalPath = null; + + /** + * The translated path as used by the scheduler + * + * @var string + */ + public $actualSrcFileSyncLocalPath = null; + + /** + * + * + * @var string + */ + public $srcFileSyncRemoteUrl = null; + + /** + * + * + * @var array of KalturaSourceFileSyncDescriptor + */ + public $srcFileSyncs; + + /** + * + * + * @var int + */ + public $engineVersion = null; + + /** + * + * + * @var int + */ + public $flavorParamsOutputId = null; + + /** + * + * + * @var KalturaFlavorParamsOutput + */ + public $flavorParamsOutput; + + /** + * + * + * @var int + */ + public $mediaInfoId = null; + + /** + * + * + * @var int + */ + public $currentOperationSet = null; + + /** + * + * + * @var int + */ + public $currentOperationIndex = null; + + /** + * + * + * @var array of KalturaKeyValue + */ + public $pluginData; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileAssetParamsListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaConversionProfileAssetParams + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaConversionProfile + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConvertLiveSegmentJobData extends KalturaJobData +{ + /** + * Live stream entry id + * + * @var string + */ + public $entryId = null; + + /** + * + * + * @var string + */ + public $assetId = null; + + /** + * Primary or secondary media server + * + * @var KalturaEntryServerNodeType + */ + public $mediaServerIndex = null; + + /** + * The index of the file within the entry + * + * @var int + */ + public $fileIndex = null; + + /** + * The recorded live media + * + * @var string + */ + public $srcFilePath = null; + + /** + * The output file + * + * @var string + */ + public $destFilePath = null; + + /** + * Duration of the live entry including all recorded segments including the current + * + * @var float + */ + public $endTime = null; + + /** + * The data output file + * + * @var string + */ + public $destDataFilePath = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConvertProfileJobData extends KalturaJobData +{ + /** + * + * + * @var string + */ + public $inputFileSyncLocalPath = null; + + /** + * The height of last created thumbnail, will be used to comapare if this thumbnail is the best we can have + * + * @var int + */ + public $thumbHeight = null; + + /** + * The bit rate of last created thumbnail, will be used to comapare if this thumbnail is the best we can have + * + * @var int + */ + public $thumbBitrate = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCopyPartnerJobData extends KalturaJobData +{ + /** + * Id of the partner to copy from + * + * @var int + */ + public $fromPartnerId = null; + + /** + * Id of the partner to copy to + * + * @var int + */ + public $toPartnerId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCountryRestriction extends KalturaBaseRestriction +{ + /** + * Country restriction type (Allow or deny) + * + * @var KalturaCountryRestrictionType + */ + public $countryRestrictionType = null; + + /** + * Comma separated list of country codes to allow to deny + * + * @var string + */ + public $countryList = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDataListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaDataEntry + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeleteFileJobData extends KalturaJobData +{ + /** + * + * + * @var string + */ + public $localFileSyncPath = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeleteJobData extends KalturaJobData +{ + /** + * The filter should return the list of objects that need to be deleted. + * + * @var KalturaFilter + */ + public $filter; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileAkamaiAppleHttpManifest extends KalturaDeliveryProfile +{ + /** + * Should we use timing parameters - clipTo / seekFrom + * + * @var bool + */ + public $supportClipping = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileAkamaiHds extends KalturaDeliveryProfile +{ + /** + * Should we use timing parameters - clipTo / seekFrom + * + * @var bool + */ + public $supportClipping = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileAkamaiHttp extends KalturaDeliveryProfile +{ + /** + * Should we use intelliseek + * + * @var bool + */ + public $useIntelliseek = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $partnerIdIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaPlaybackProtocol + */ + public $streamerTypeEqual = null; + + /** + * + * + * @var KalturaDeliveryStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileCondition extends KalturaCondition +{ + /** + * The delivery ids that are accepted by this condition + * + * @var array of KalturaIntegerValue + */ + public $deliveryProfileIds; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericAppleHttp extends KalturaDeliveryProfile +{ + /** + * + * + * @var string + */ + public $pattern = null; + + /** + * rendererClass + * + * @var string + */ + public $rendererClass = null; + + /** + * Enable to make playManifest redirect to the domain of the delivery profile + * + * @var KalturaNullableBoolean + */ + public $manifestRedirect = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericHds extends KalturaDeliveryProfile +{ + /** + * + * + * @var string + */ + public $pattern = null; + + /** + * rendererClass + * + * @var string + */ + public $rendererClass = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericHttp extends KalturaDeliveryProfile +{ + /** + * + * + * @var string + */ + public $pattern = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericSilverLight extends KalturaDeliveryProfile +{ + /** + * + * + * @var string + */ + public $pattern = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaDeliveryProfile + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileLiveAppleHttp extends KalturaDeliveryProfile +{ + /** + * + * + * @var bool + */ + public $disableExtraAttributes = null; + + /** + * + * + * @var bool + */ + public $forceProxy = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileRtmp extends KalturaDeliveryProfile +{ + /** + * enforceRtmpe + * + * @var bool + */ + public $enforceRtmpe = null; + + /** + * a prefix that is added to all stream urls (replaces storageProfile::rtmpPrefix) + * + * @var string + */ + public $prefix = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileVodPackagerPlayServer extends KalturaDeliveryProfile +{ + /** + * + * + * @var bool + */ + public $adStitchingEnabled = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryServerNode extends KalturaServerNode +{ + /** + * Delivery profile ids + * + * @var array of KalturaKeyValue + */ + public $deliveryProfileIds; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDirectoryRestriction extends KalturaBaseRestriction +{ + /** + * Kaltura directory restriction type + * + * @var KalturaDirectoryRestrictionType + */ + public $directoryRestrictionType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDrmEntryContextPluginData extends KalturaPluginData +{ + /** + * For the uDRM we give the drm context data which is a json encoding of an array containing the uDRM data + * for each flavor that is required from this getContextData request. + * + * @var string + */ + public $flavorData = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaCategoryUserBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $categoryIdEqual = null; + + /** + * + * + * @var string + */ + public $categoryIdIn = null; + + /** + * + * + * @var string + */ + public $userIdEqual = null; + + /** + * + * + * @var string + */ + public $userIdIn = null; + + /** + * + * + * @var KalturaCategoryUserPermissionLevel + */ + public $permissionLevelEqual = null; + + /** + * + * + * @var string + */ + public $permissionLevelIn = null; + + /** + * + * + * @var KalturaCategoryUserStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaUpdateMethodType + */ + public $updateMethodEqual = null; + + /** + * + * + * @var string + */ + public $updateMethodIn = null; + + /** + * + * + * @var string + */ + public $categoryFullIdsStartsWith = null; + + /** + * + * + * @var string + */ + public $categoryFullIdsEqual = null; + + /** + * + * + * @var string + */ + public $permissionNamesMatchAnd = null; + + /** + * + * + * @var string + */ + public $permissionNamesMatchOr = null; + + /** + * + * + * @var string + */ + public $permissionNamesNotContains = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryUserFilter extends KalturaCategoryUserBaseFilter +{ + /** + * Return the list of categoryUser that are not inherited from parent category - only the direct categoryUsers. + * + * @var bool + */ + public $categoryDirectMembers = null; + + /** + * Free text search on user id or screen name + * + * @var string + */ + public $freeText = null; + + /** + * Return a list of categoryUser that related to the userId in this field by groups + * + * @var string + */ + public $relatedGroupsByUserId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaUserBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var KalturaUserType + */ + public $typeEqual = null; + + /** + * + * + * @var string + */ + public $typeIn = null; + + /** + * + * + * @var string + */ + public $screenNameLike = null; + + /** + * + * + * @var string + */ + public $screenNameStartsWith = null; + + /** + * + * + * @var string + */ + public $emailLike = null; + + /** + * + * + * @var string + */ + public $emailStartsWith = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * + * + * @var KalturaUserStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $firstNameStartsWith = null; + + /** + * + * + * @var string + */ + public $lastNameStartsWith = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $isAdminEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserFilter extends KalturaUserBaseFilter +{ + /** + * + * + * @var string + */ + public $idOrScreenNameStartsWith = null; + + /** + * + * + * @var string + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $loginEnabledEqual = null; + + /** + * + * + * @var string + */ + public $roleIdEqual = null; + + /** + * + * + * @var string + */ + public $roleIdsEqual = null; + + /** + * + * + * @var string + */ + public $roleIdsIn = null; + + /** + * + * + * @var string + */ + public $firstNameOrLastNameStartsWith = null; + + /** + * Permission names filter expression + * + * @var string + */ + public $permissionNamesMultiLikeOr = null; + + /** + * Permission names filter expression + * + * @var string + */ + public $permissionNamesMultiLikeAnd = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryContext extends KalturaContext +{ + /** + * The entry ID in the context of which the playlist should be built + * + * @var string + */ + public $entryId = null; + + /** + * Is this a redirected entry followup? + * + * @var KalturaNullableBoolean + */ + public $followEntryRedirect = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryContextDataParams extends KalturaAccessControlScope +{ + /** + * Id of the current flavor. + * + * @var string + */ + public $flavorAssetId = null; + + /** + * The tags of the flavors that should be used for playback. + * + * @var string + */ + public $flavorTags = null; + + /** + * Playback streamer type: RTMP, HTTP, appleHttps, rtsp, sl. + * + * @var string + */ + public $streamerType = null; + + /** + * Protocol of the specific media object. + * + * @var string + */ + public $mediaProtocol = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryContextDataResult extends KalturaContextDataResult +{ + /** + * + * + * @var bool + */ + public $isSiteRestricted = null; + + /** + * + * + * @var bool + */ + public $isCountryRestricted = null; + + /** + * + * + * @var bool + */ + public $isSessionRestricted = null; + + /** + * + * + * @var bool + */ + public $isIpAddressRestricted = null; + + /** + * + * + * @var bool + */ + public $isUserAgentRestricted = null; + + /** + * + * + * @var int + */ + public $previewLength = null; + + /** + * + * + * @var bool + */ + public $isScheduledNow = null; + + /** + * + * + * @var bool + */ + public $isAdmin = null; + + /** + * http/rtmp/hdnetwork + * + * @var string + */ + public $streamerType = null; + + /** + * http/https, rtmp/rtmpe + * + * @var string + */ + public $mediaProtocol = null; + + /** + * + * + * @var string + */ + public $storageProfilesXML = null; + + /** + * Array of messages as received from the access control rules that invalidated + * + * @var array of KalturaString + */ + public $accessControlMessages; + + /** + * Array of actions as received from the access control rules that invalidated + * + * @var array of KalturaRuleAction + */ + public $accessControlActions; + + /** + * Array of allowed flavor assets according to access control limitations and requested tags + * + * @var array of KalturaFlavorAsset + */ + public $flavorAssets; + + /** + * The duration of the entry in milliseconds + * + * @var int + */ + public $msDuration = null; + + /** + * Array of allowed flavor assets according to access control limitations and requested tags + * + * @var map + */ + public $pluginData; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryCuePointSearchFilter extends KalturaSearchItem +{ + /** + * + * + * @var string + */ + public $cuePointsFreeText = null; + + /** + * + * + * @var string + */ + public $cuePointTypeIn = null; + + /** + * + * + * @var int + */ + public $cuePointSubTypeEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryIdentifier extends KalturaObjectIdentifier +{ + /** + * Identifier of the object + * + * @var KalturaEntryIdentifierField + */ + public $identifier = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryLiveStats extends KalturaLiveStats +{ + /** + * + * + * @var string + */ + public $entryId = null; + + /** + * + * + * @var int + */ + public $peakAudience = null; + + /** + * + * + * @var int + */ + public $peakDvrAudience = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaEntryServerNodeBaseFilter extends KalturaFilter +{ + /** + * + * + * @var string + */ + public $entryIdEqual = null; + + /** + * + * + * @var string + */ + public $entryIdIn = null; + + /** + * + * + * @var int + */ + public $serverNodeIdEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaEntryServerNodeStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var KalturaEntryServerNodeType + */ + public $serverTypeEqual = null; + + /** + * + * + * @var string + */ + public $serverTypeIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryServerNodeListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaEntryServerNode + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaBooleanField extends KalturaBooleanValue +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFeatureStatusListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaFeatureStatus + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileAssetListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaFileAsset + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlattenJobData extends KalturaJobData +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorAssetListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaFlavorAsset + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParamsListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaFlavorParams + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParamsOutputListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaFlavorParamsOutput + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGenericSyndicationFeed extends KalturaBaseSyndicationFeed +{ + /** + * feed description + * + * @var string + */ + public $feedDescription = null; + + /** + * feed landing page (i.e publisher website) + * + * @var string + */ + public $feedLandingPage = null; + + /** + * entry filter + * + * @var KalturaBaseEntryFilter + */ + public $entryFilter; + + /** + * page size + * + * @var int + */ + public $pageSize = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGoogleVideoSyndicationFeed extends KalturaBaseSyndicationFeed +{ + /** + * + * + * @var KalturaGoogleSyndicationFeedAdultValues + */ + public $adultContent = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGroupUserListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaGroupUser + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaHashCondition extends KalturaCondition +{ + /** + * hash name + * + * @var string + */ + public $hashName = null; + + /** + * hash secret + * + * @var string + */ + public $hashSecret = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaITunesSyndicationFeed extends KalturaBaseSyndicationFeed +{ + /** + * feed description + * + * @var string + */ + public $feedDescription = null; + + /** + * feed language + * + * @var string + */ + public $language = null; + + /** + * feed landing page (i.e publisher website) + * + * @var string + */ + public $feedLandingPage = null; + + /** + * author/publisher name + * + * @var string + */ + public $ownerName = null; + + /** + * publisher email + * + * @var string + */ + public $ownerEmail = null; + + /** + * podcast thumbnail + * + * @var string + */ + public $feedImageUrl = null; + + /** + * + * + * @var KalturaITunesSyndicationFeedCategories + * @readonly + */ + public $category = null; + + /** + * + * + * @var KalturaITunesSyndicationFeedAdultValues + */ + public $adultContent = null; + + /** + * + * + * @var string + */ + public $feedAuthor = null; + + /** + * + * + * @var bool + */ + public $enforceFeedAuthor = null; + + /** + * true in case you want to enfore the palylist order on the + * + * @var KalturaNullableBoolean + */ + public $enforceOrder = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaImportJobData extends KalturaJobData +{ + /** + * + * + * @var string + */ + public $srcFileUrl = null; + + /** + * + * + * @var string + */ + public $destFileLocalPath = null; + + /** + * + * + * @var string + */ + public $flavorAssetId = null; + + /** + * + * + * @var int + */ + public $fileSize = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaIndexAdvancedFilter extends KalturaSearchItem +{ + /** + * + * + * @var int + */ + public $indexIdGreaterThan = null; + + /** + * + * + * @var int + */ + public $depthGreaterThanEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaIndexJobData extends KalturaJobData +{ + /** + * The filter should return the list of objects that need to be reindexed. + * + * @var KalturaFilter + */ + public $filter; + + /** + * Indicates the last id that reindexed, used when the batch crached, to re-run from the last crash point. + * + * @var int + */ + public $lastIndexId = null; + + /** + * Indicates the last depth that reindexed, used when the batch crached, to re-run from the last crash point. + * + * @var int + */ + public $lastIndexDepth = null; + + /** + * Indicates that the object columns and attributes values should be recalculated before reindexed. + * + * @var bool + */ + public $shouldUpdate = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaIpAddressRestriction extends KalturaBaseRestriction +{ + /** + * Ip address restriction type (Allow or deny) + * + * @var KalturaIpAddressRestrictionType + */ + public $ipAddressRestrictionType = null; + + /** + * Comma separated list of ip address to allow to deny + * + * @var string + */ + public $ipAddressList = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLimitFlavorsRestriction extends KalturaBaseRestriction +{ + /** + * Limit flavors restriction type (Allow or deny) + * + * @var KalturaLimitFlavorsRestrictionType + */ + public $limitFlavorsRestrictionType = null; + + /** + * Comma separated list of flavor params ids to allow to deny + * + * @var string + */ + public $flavorParamsIds = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaLiveChannel + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelSegmentListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaLiveChannelSegment + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryServerNode extends KalturaEntryServerNode +{ + /** + * parameters of the stream we got + * + * @var array of KalturaLiveStreamParams + */ + public $streams; + + /** + * + * + * @var array of KalturaLiveEntryServerNodeRecordingInfo + */ + public $recordingInfo; + + /** + * + * + * @var bool + */ + public $isPlayableUser = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveReportExportJobData extends KalturaJobData +{ + /** + * + * + * @var int + */ + public $timeReference = null; + + /** + * + * + * @var int + */ + public $timeZoneOffset = null; + + /** + * + * + * @var string + */ + public $entryIds = null; + + /** + * + * + * @var string + */ + public $outputPath = null; + + /** + * + * + * @var string + */ + public $recipientEmail = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStatsListResponse extends KalturaListResponse +{ + /** + * + * + * @var KalturaLiveStats + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaLiveStreamEntry + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamPushPublishRTMPConfiguration extends KalturaLiveStreamPushPublishConfiguration +{ + /** + * + * + * @var string + */ + public $userId = null; + + /** + * + * + * @var string + */ + public $password = null; + + /** + * + * + * @var string + */ + public $streamName = null; + + /** + * + * + * @var string + */ + public $applicationName = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveToVodJobData extends KalturaJobData +{ + /** + * $vod Entry Id + * + * @var string + */ + public $vodEntryId = null; + + /** + * live Entry Id + * + * @var string + */ + public $liveEntryId = null; + + /** + * total VOD Duration + * + * @var float + */ + public $totalVodDuration = null; + + /** + * last Segment Duration + * + * @var float + */ + public $lastSegmentDuration = null; + + /** + * amf Array File Path + * + * @var string + */ + public $amfArray = null; + + /** + * last live to vod sync time + * + * @var int + */ + public $lastCuePointSyncTime = null; + + /** + * last segment drift + * + * @var int + */ + public $lastSegmentDrift = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMailJobData extends KalturaJobData +{ + /** + * + * + * @var KalturaMailType + */ + public $mailType = null; + + /** + * + * + * @var int + */ + public $mailPriority = null; + + /** + * + * + * @var KalturaMailJobStatus + */ + public $status = null; + + /** + * + * + * @var string + */ + public $recipientName = null; + + /** + * + * + * @var string + */ + public $recipientEmail = null; + + /** + * kuserId + * + * @var int + */ + public $recipientId = null; + + /** + * + * + * @var string + */ + public $fromName = null; + + /** + * + * + * @var string + */ + public $fromEmail = null; + + /** + * + * + * @var string + */ + public $bodyParams = null; + + /** + * + * + * @var string + */ + public $subjectParams = null; + + /** + * + * + * @var string + */ + public $templatePath = null; + + /** + * + * + * @var KalturaLanguageCode + */ + public $language = null; + + /** + * + * + * @var int + */ + public $campaignId = null; + + /** + * + * + * @var int + */ + public $minSendDate = null; + + /** + * + * + * @var bool + */ + public $isHtml = null; + + /** + * + * + * @var string + */ + public $separator = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMatchCondition extends KalturaCondition +{ + /** + * + * + * @var array of KalturaStringValue + */ + public $values; + + /** + * + * + * @var KalturaMatchConditionType + */ + public $matchType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMediaInfoBaseFilter extends KalturaFilter +{ + /** + * + * + * @var string + */ + public $flavorAssetIdEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaInfoListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaMediaInfo + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaMediaEntry + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMixListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaMixEntry + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaModerationFlagListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaModerationFlag + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMoveCategoryEntriesJobData extends KalturaJobData +{ + /** + * Source category id + * + * @var int + */ + public $srcCategoryId = null; + + /** + * Destination category id + * + * @var int + */ + public $destCategoryId = null; + + /** + * Saves the last category id that its entries moved completely + * In case of crash the batch will restart from that point + * + * @var int + */ + public $lastMovedCategoryId = null; + + /** + * Saves the last page index of the child categories filter pager + * In case of crash the batch will restart from that point + * + * @var int + */ + public $lastMovedCategoryPageIndex = null; + + /** + * Saves the last page index of the category entries filter pager + * In case of crash the batch will restart from that point + * + * @var int + */ + public $lastMovedCategoryEntryPageIndex = null; + + /** + * All entries from all child categories will be moved as well + * + * @var bool + */ + public $moveFromChildren = null; + + /** + * Destination categories fallback ids + * + * @var string + */ + public $destCategoryFullIds = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaNotificationJobData extends KalturaJobData +{ + /** + * + * + * @var string + */ + public $userId = null; + + /** + * + * + * @var KalturaNotificationType + */ + public $type = null; + + /** + * + * + * @var string + */ + public $typeAsString = null; + + /** + * + * + * @var string + */ + public $objectId = null; + + /** + * + * + * @var KalturaNotificationStatus + */ + public $status = null; + + /** + * + * + * @var string + */ + public $data = null; + + /** + * + * + * @var int + */ + public $numberOfAttempts = null; + + /** + * + * + * @var string + */ + public $notificationResult = null; + + /** + * + * + * @var KalturaNotificationObjectType + */ + public $objType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaObjectListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaObject + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaOrCondition extends KalturaCondition +{ + /** + * + * + * @var array of KalturaCondition + */ + public $conditions; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaPartnerBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $idNotIn = null; + + /** + * + * + * @var string + */ + public $nameLike = null; + + /** + * + * + * @var string + */ + public $nameMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $nameMultiLikeAnd = null; + + /** + * + * + * @var string + */ + public $nameEqual = null; + + /** + * + * + * @var KalturaPartnerStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var int + */ + public $partnerPackageEqual = null; + + /** + * + * + * @var int + */ + public $partnerPackageGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $partnerPackageLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $partnerPackageIn = null; + + /** + * + * + * @var KalturaPartnerGroupType + */ + public $partnerGroupTypeEqual = null; + + /** + * + * + * @var string + */ + public $partnerNameDescriptionWebsiteAdminNameAdminEmailLike = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartnerListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaPartner + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionItemListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaPermissionItem + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaPermission + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylistListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaPlaylist + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaProvisionJobData extends KalturaJobData +{ + /** + * + * + * @var string + */ + public $streamID = null; + + /** + * + * + * @var string + */ + public $backupStreamID = null; + + /** + * + * + * @var string + */ + public $rtmp = null; + + /** + * + * + * @var string + */ + public $encoderIP = null; + + /** + * + * + * @var string + */ + public $backupEncoderIP = null; + + /** + * + * + * @var string + */ + public $encoderPassword = null; + + /** + * + * + * @var string + */ + public $encoderUsername = null; + + /** + * + * + * @var int + */ + public $endDate = null; + + /** + * + * + * @var string + */ + public $returnVal = null; + + /** + * + * + * @var int + */ + public $mediaType = null; + + /** + * + * + * @var string + */ + public $primaryBroadcastingUrl = null; + + /** + * + * + * @var string + */ + public $secondaryBroadcastingUrl = null; + + /** + * + * + * @var string + */ + public $streamName = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaQuizUserEntry extends KalturaUserEntry +{ + /** + * + * + * @var float + * @readonly + */ + public $score = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaRecalculateCacheJobData extends KalturaJobData +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRemotePathListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaRemotePath + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaReportBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $partnerIdIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportInputFilter extends KalturaReportInputBaseFilter +{ + /** + * Search keywords to filter objects + * + * @var string + */ + public $keywords = null; + + /** + * Search keywords in onjects tags + * + * @var bool + */ + public $searchInTags = null; + + /** + * Search keywords in onjects admin tags + * + * @var bool + */ + public $searchInAdminTags = null; + + /** + * Search onjects in specified categories + * + * @var string + */ + public $categories = null; + + /** + * Time zone offset in minutes + * + * @var int + */ + public $timeZoneOffset = null; + + /** + * Aggregated results according to interval + * + * @var KalturaReportInterval + */ + public $interval = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaReportListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaReport + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaResponseProfileBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaResponseProfileStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileHolder extends KalturaBaseResponseProfile +{ + /** + * Auto generated numeric identifier + * + * @var int + */ + public $id = null; + + /** + * Unique system name + * + * @var string + */ + public $systemName = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaResponseProfile + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSchedulerListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaScheduler + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSchedulerWorkerListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaSchedulerWorker + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchCondition extends KalturaSearchItem +{ + /** + * + * + * @var string + */ + public $field = null; + + /** + * + * + * @var string + */ + public $value = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchOperator extends KalturaSearchItem +{ + /** + * + * + * @var KalturaSearchOperatorType + */ + public $type = null; + + /** + * + * + * @var array of KalturaSearchItem + */ + public $items; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaServerNodeBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $heartbeatTimeGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $heartbeatTimeLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $nameEqual = null; + + /** + * + * + * @var string + */ + public $nameIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var string + */ + public $hostNameLike = null; + + /** + * + * + * @var string + */ + public $hostNameMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $hostNameMultiLikeAnd = null; + + /** + * + * + * @var KalturaServerNodeStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var KalturaServerNodeType + */ + public $typeEqual = null; + + /** + * + * + * @var string + */ + public $typeIn = null; + + /** + * + * + * @var string + */ + public $tagsLike = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * + * + * @var int + */ + public $dcEqual = null; + + /** + * + * + * @var string + */ + public $dcIn = null; + + /** + * + * + * @var string + */ + public $parentIdLike = null; + + /** + * + * + * @var string + */ + public $parentIdMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $parentIdMultiLikeAnd = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaServerNodeListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaServerNode + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSessionResponse extends KalturaStartWidgetSessionResponse +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSessionRestriction extends KalturaBaseRestriction +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSiteRestriction extends KalturaBaseRestriction +{ + /** + * The site restriction type (allow or deny) + * + * @var KalturaSiteRestrictionType + */ + public $siteRestrictionType = null; + + /** + * Comma separated list of sites (domains) to allow or deny + * + * @var string + */ + public $siteList = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageAddAction extends KalturaRuleAction +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageJobData extends KalturaJobData +{ + /** + * + * + * @var string + */ + public $serverUrl = null; + + /** + * + * + * @var string + */ + public $serverUsername = null; + + /** + * + * + * @var string + */ + public $serverPassword = null; + + /** + * + * + * @var string + */ + public $serverPrivateKey = null; + + /** + * + * + * @var string + */ + public $serverPublicKey = null; + + /** + * + * + * @var string + */ + public $serverPassPhrase = null; + + /** + * + * + * @var bool + */ + public $ftpPassiveMode = null; + + /** + * + * + * @var string + */ + public $srcFileSyncLocalPath = null; + + /** + * + * + * @var string + */ + public $srcFileEncryptionKey = null; + + /** + * + * + * @var string + */ + public $srcFileSyncId = null; + + /** + * + * + * @var string + */ + public $destFileSyncStoredPath = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaStorageProfileBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $partnerIdIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var KalturaStorageProfileStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var KalturaStorageProfileProtocol + */ + public $protocolEqual = null; + + /** + * + * + * @var string + */ + public $protocolIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageProfileListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaStorageProfile + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSyncCategoryPrivacyContextJobData extends KalturaJobData +{ + /** + * category id + * + * @var int + */ + public $categoryId = null; + + /** + * Saves the last category entry creation date that was updated + * In case of crash the batch will restart from that point + * + * @var int + */ + public $lastUpdatedCategoryEntryCreatedAt = null; + + /** + * Saves the last sub category creation date that was updated + * In case of crash the batch will restart from that point + * + * @var int + */ + public $lastUpdatedCategoryCreatedAt = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbAssetListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaThumbAsset + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParamsListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaThumbParams + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParamsOutputListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaThumbParamsOutput + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbnailServeOptions extends KalturaAssetServeOptions +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaTubeMogulSyndicationFeed extends KalturaBaseSyndicationFeed +{ + /** + * + * + * @var KalturaTubeMogulSyndicationFeedCategories + * @readonly + */ + public $category = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaUiConfBaseFilter extends KalturaFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $nameLike = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $partnerIdIn = null; + + /** + * + * + * @var KalturaUiConfObjType + */ + public $objTypeEqual = null; + + /** + * + * + * @var string + */ + public $objTypeIn = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaUiConfCreationMode + */ + public $creationModeEqual = null; + + /** + * + * + * @var string + */ + public $creationModeIn = null; + + /** + * + * + * @var string + */ + public $versionEqual = null; + + /** + * + * + * @var string + */ + public $versionMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $versionMultiLikeAnd = null; + + /** + * + * + * @var string + */ + public $partnerTagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $partnerTagsMultiLikeAnd = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUiConfListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaUiConf + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaUploadTokenBaseFilter extends KalturaFilter +{ + /** + * + * + * @var string + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $userIdEqual = null; + + /** + * + * + * @var KalturaUploadTokenStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var string + */ + public $fileNameEqual = null; + + /** + * + * + * @var float + */ + public $fileSizeEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadTokenListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaUploadToken + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlRecognizerAkamaiG2O extends KalturaUrlRecognizer +{ + /** + * headerData + * + * @var string + */ + public $headerData = null; + + /** + * headerSign + * + * @var string + */ + public $headerSign = null; + + /** + * timeout + * + * @var int + */ + public $timeout = null; + + /** + * salt + * + * @var string + */ + public $salt = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerAkamaiHttp extends KalturaUrlTokenizer +{ + /** + * param + * + * @var string + */ + public $paramName = null; + + /** + * + * + * @var string + */ + public $rootDir = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerAkamaiRtmp extends KalturaUrlTokenizer +{ + /** + * profile + * + * @var string + */ + public $profile = null; + + /** + * Type + * + * @var string + */ + public $type = null; + + /** + * + * + * @var string + */ + public $aifp = null; + + /** + * + * + * @var bool + */ + public $usePrefix = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerAkamaiRtsp extends KalturaUrlTokenizer +{ + /** + * host + * + * @var string + */ + public $host = null; + + /** + * Cp-Code + * + * @var int + */ + public $cpcode = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerAkamaiSecureHd extends KalturaUrlTokenizer +{ + /** + * + * + * @var string + */ + public $paramName = null; + + /** + * + * + * @var string + */ + public $aclPostfix = null; + + /** + * + * + * @var string + */ + public $customPostfixes = null; + + /** + * + * + * @var string + */ + public $useCookieHosts = null; + + /** + * + * + * @var string + */ + public $rootDir = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerBitGravity extends KalturaUrlTokenizer +{ + /** + * hashPatternRegex + * + * @var string + */ + public $hashPatternRegex = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerChinaCache extends KalturaUrlTokenizer +{ + /** + * + * + * @var KalturaChinaCacheAlgorithmType + */ + public $algorithmId = null; + + /** + * + * + * @var int + */ + public $keyId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerCht extends KalturaUrlTokenizer +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerCloudFront extends KalturaUrlTokenizer +{ + /** + * + * + * @var string + */ + public $keyPairId = null; + + /** + * + * + * @var string + */ + public $rootDir = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerKs extends KalturaUrlTokenizer +{ + /** + * + * + * @var bool + */ + public $usePath = null; + + /** + * + * + * @var string + */ + public $additionalUris = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerLevel3 extends KalturaUrlTokenizer +{ + /** + * paramName + * + * @var string + */ + public $paramName = null; + + /** + * expiryName + * + * @var string + */ + public $expiryName = null; + + /** + * gen + * + * @var string + */ + public $gen = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerLimeLight extends KalturaUrlTokenizer +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerUplynk extends KalturaUrlTokenizer +{ + /** + * accountId + * + * @var string + */ + public $accountId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerVelocix extends KalturaUrlTokenizer +{ + /** + * hdsPaths + * + * @var string + */ + public $hdsPaths = null; + + /** + * tokenParamName + * + * @var string + */ + public $paramName = null; + + /** + * secure URL prefix + * + * @var string + */ + public $authPrefix = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUrlTokenizerVnpt extends KalturaUrlTokenizer +{ + /** + * + * + * @var int + */ + public $tokenizationFormat = null; + + /** + * + * + * @var bool + */ + public $shouldIncludeClientIp = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserAgentRestriction extends KalturaBaseRestriction +{ + /** + * User agent restriction type (Allow or deny) + * + * @var KalturaUserAgentRestrictionType + */ + public $userAgentRestrictionType = null; + + /** + * A comma seperated list of user agent regular expressions + * + * @var string + */ + public $userAgentRegexList = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserEntryListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaUserEntry + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaUser + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserLoginDataListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaUserLoginData + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserRoleCondition extends KalturaCondition +{ + /** + * Comma separated list of role ids + * + * @var string + */ + public $roleIds = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserRoleListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaUserRole + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUsersCsvJobData extends KalturaJobData +{ + /** + * The filter should return the list of users that need to be specified in the csv. + * + * @var KalturaUserFilter + */ + public $filter; + + /** + * The metadata profile we should look the xpath in + * + * @var int + */ + public $metadataProfileId = null; + + /** + * The xpath to look in the metadataProfileId and the wanted csv field name + * + * @var array of KalturaCsvAdditionalFieldInfo + */ + public $additionalFields; + + /** + * The users name + * + * @var string + */ + public $userName = null; + + /** + * The users email + * + * @var string + */ + public $userMail = null; + + /** + * The file location + * + * @var string + */ + public $outputPath = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaValidateActiveEdgeCondition extends KalturaCondition +{ + /** + * Comma separated list of edge servers to validate are active + * + * @var string + */ + public $edgeServerIds = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaWidgetBaseFilter extends KalturaFilter +{ + /** + * + * + * @var string + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $sourceWidgetIdEqual = null; + + /** + * + * + * @var string + */ + public $rootWidgetIdEqual = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $entryIdEqual = null; + + /** + * + * + * @var int + */ + public $uiConfIdEqual = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $partnerDataLike = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaWidgetListResponse extends KalturaListResponse +{ + /** + * + * + * @var array of KalturaWidget + * @readonly + */ + public $objects; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaYahooSyndicationFeed extends KalturaBaseSyndicationFeed +{ + /** + * + * + * @var KalturaYahooSyndicationFeedCategories + * @readonly + */ + public $category = null; + + /** + * + * + * @var KalturaYahooSyndicationFeedAdultValues + */ + public $adultContent = null; + + /** + * feed description + * + * @var string + */ + public $feedDescription = null; + + /** + * feed landing page (i.e publisher website) + * + * @var string + */ + public $feedLandingPage = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaAccessControlBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaAccessControlProfileBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAkamaiProvisionJobData extends KalturaProvisionJobData +{ + /** + * + * + * @var string + */ + public $wsdlUsername = null; + + /** + * + * + * @var string + */ + public $wsdlPassword = null; + + /** + * + * + * @var string + */ + public $cpcode = null; + + /** + * + * + * @var string + */ + public $emailId = null; + + /** + * + * + * @var string + */ + public $primaryContact = null; + + /** + * + * + * @var string + */ + public $secondaryContact = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAkamaiUniversalProvisionJobData extends KalturaProvisionJobData +{ + /** + * + * + * @var int + */ + public $streamId = null; + + /** + * + * + * @var string + */ + public $systemUserName = null; + + /** + * + * + * @var string + */ + public $systemPassword = null; + + /** + * + * + * @var string + */ + public $domainName = null; + + /** + * + * + * @var KalturaDVRStatus + */ + public $dvrEnabled = null; + + /** + * + * + * @var int + */ + public $dvrWindow = null; + + /** + * + * + * @var string + */ + public $primaryContact = null; + + /** + * + * + * @var string + */ + public $secondaryContact = null; + + /** + * + * + * @var KalturaAkamaiUniversalStreamType + */ + public $streamType = null; + + /** + * + * + * @var string + */ + public $notificationEmail = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAnonymousIPCondition extends KalturaMatchCondition +{ + /** + * The ip geo coder engine to be used + * + * @var KalturaGeoCoderType + */ + public $geoCoderType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAppTokenFilter extends KalturaAppTokenBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaAssetParamsBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $isSystemDefaultEqual = null; + + /** + * + * + * @var string + */ + public $tagsEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetResource extends KalturaContentResource +{ + /** + * ID of the source asset + * + * @var string + */ + public $assetId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseSyndicationFeedFilter extends KalturaBaseSyndicationFeedBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBulkUploadFilter extends KalturaBulkUploadBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaCategoryBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $idNotIn = null; + + /** + * + * + * @var int + */ + public $parentIdEqual = null; + + /** + * + * + * @var string + */ + public $parentIdIn = null; + + /** + * + * + * @var int + */ + public $depthEqual = null; + + /** + * + * + * @var string + */ + public $fullNameEqual = null; + + /** + * + * + * @var string + */ + public $fullNameStartsWith = null; + + /** + * + * + * @var string + */ + public $fullNameIn = null; + + /** + * + * + * @var string + */ + public $fullIdsEqual = null; + + /** + * + * + * @var string + */ + public $fullIdsStartsWith = null; + + /** + * + * + * @var string + */ + public $fullIdsMatchOr = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $tagsLike = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * + * + * @var KalturaAppearInListType + */ + public $appearInListEqual = null; + + /** + * + * + * @var KalturaPrivacyType + */ + public $privacyEqual = null; + + /** + * + * + * @var string + */ + public $privacyIn = null; + + /** + * + * + * @var KalturaInheritanceType + */ + public $inheritanceTypeEqual = null; + + /** + * + * + * @var string + */ + public $inheritanceTypeIn = null; + + /** + * + * + * @var string + */ + public $referenceIdEqual = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $referenceIdEmpty = null; + + /** + * + * + * @var KalturaContributionPolicyType + */ + public $contributionPolicyEqual = null; + + /** + * + * + * @var int + */ + public $membersCountGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $membersCountLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $pendingMembersCountGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $pendingMembersCountLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $privacyContextEqual = null; + + /** + * + * + * @var KalturaCategoryStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var int + */ + public $inheritedParentIdEqual = null; + + /** + * + * + * @var string + */ + public $inheritedParentIdIn = null; + + /** + * + * + * @var int + */ + public $partnerSortValueGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $partnerSortValueLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $aggregationCategoriesMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $aggregationCategoriesMultiLikeAnd = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaCategoryEntryBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $categoryIdEqual = null; + + /** + * + * + * @var string + */ + public $categoryIdIn = null; + + /** + * + * + * @var string + */ + public $entryIdEqual = null; + + /** + * + * + * @var string + */ + public $entryIdIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var string + */ + public $categoryFullIdsStartsWith = null; + + /** + * + * + * @var KalturaCategoryEntryStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var string + */ + public $creatorUserIdEqual = null; + + /** + * + * + * @var string + */ + public $creatorUserIdIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaControlPanelCommandFilter extends KalturaControlPanelCommandBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaConversionProfileAssetParamsBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $conversionProfileIdEqual = null; + + /** + * + * + * @var string + */ + public $conversionProfileIdIn = null; + + /** + * + * + * @var int + */ + public $assetParamsIdEqual = null; + + /** + * + * + * @var string + */ + public $assetParamsIdIn = null; + + /** + * + * + * @var KalturaFlavorReadyBehaviorType + */ + public $readyBehaviorEqual = null; + + /** + * + * + * @var string + */ + public $readyBehaviorIn = null; + + /** + * + * + * @var KalturaAssetParamsOrigin + */ + public $originEqual = null; + + /** + * + * + * @var string + */ + public $originIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaConversionProfileBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var KalturaConversionProfileStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var KalturaConversionProfileType + */ + public $typeEqual = null; + + /** + * + * + * @var string + */ + public $typeIn = null; + + /** + * + * + * @var string + */ + public $nameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * + * + * @var string + */ + public $defaultEntryIdEqual = null; + + /** + * + * + * @var string + */ + public $defaultEntryIdIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConvertCollectionJobData extends KalturaConvartableJobData +{ + /** + * + * + * @var string + */ + public $destDirLocalPath = null; + + /** + * + * + * @var string + */ + public $destDirRemoteUrl = null; + + /** + * + * + * @var string + */ + public $destFileName = null; + + /** + * + * + * @var string + */ + public $inputXmlLocalPath = null; + + /** + * + * + * @var string + */ + public $inputXmlRemoteUrl = null; + + /** + * + * + * @var string + */ + public $commandLinesStr = null; + + /** + * + * + * @var array of KalturaConvertCollectionFlavorData + */ + public $flavors; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConvertJobData extends KalturaConvartableJobData +{ + /** + * + * + * @var string + */ + public $destFileSyncLocalPath = null; + + /** + * + * + * @var string + */ + public $destFileSyncRemoteUrl = null; + + /** + * + * + * @var string + */ + public $logFileSyncLocalPath = null; + + /** + * + * + * @var string + */ + public $logFileSyncRemoteUrl = null; + + /** + * + * + * @var string + */ + public $flavorAssetId = null; + + /** + * + * + * @var string + */ + public $remoteMediaId = null; + + /** + * + * + * @var string + */ + public $customData = null; + + /** + * + * + * @var array of KalturaDestFileSyncDescriptor + */ + public $extraDestFileSyncs; + + /** + * + * + * @var string + */ + public $engineMessage = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCountryCondition extends KalturaMatchCondition +{ + /** + * The ip geo coder engine to be used + * + * @var KalturaGeoCoderType + */ + public $geoCoderType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileFilter extends KalturaDeliveryProfileBaseFilter +{ + /** + * + * + * @var KalturaNullableBoolean + */ + public $isLive = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericRtmp extends KalturaDeliveryProfileRtmp +{ + /** + * + * + * @var string + */ + public $pattern = null; + + /** + * rendererClass + * + * @var string + */ + public $rendererClass = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileVodPackagerHls extends KalturaDeliveryProfileVodPackagerPlayServer +{ + /** + * + * + * @var bool + */ + public $allowFairplayOffline = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEdgeServerNode extends KalturaDeliveryServerNode +{ + /** + * Delivery server playback Domain + * + * @var string + */ + public $playbackDomain = null; + + /** + * Overdie edge server default configuration - json format + * + * @var string + */ + public $config = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEndUserReportInputFilter extends KalturaReportInputFilter +{ + /** + * + * + * @var string + */ + public $application = null; + + /** + * + * + * @var string + */ + public $userIds = null; + + /** + * + * + * @var string + */ + public $playbackContext = null; + + /** + * + * + * @var string + */ + public $ancestorPlaybackContext = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryIndexAdvancedFilter extends KalturaIndexAdvancedFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryReferrerLiveStats extends KalturaEntryLiveStats +{ + /** + * + * + * @var string + */ + public $referrer = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryResource extends KalturaContentResource +{ + /** + * ID of the source entry + * + * @var string + */ + public $entryId = null; + + /** + * ID of the source flavor params, set to null to use the source flavor + * + * @var int + */ + public $flavorParamsId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEntryServerNodeFilter extends KalturaEntryServerNodeBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaExtractMediaJobData extends KalturaConvartableJobData +{ + /** + * + * + * @var string + */ + public $flavorAssetId = null; + + /** + * + * + * @var bool + */ + public $calculateComplexity = null; + + /** + * + * + * @var bool + */ + public $extractId3Tags = null; + + /** + * The data output file + * + * @var string + */ + public $destDataFilePath = null; + + /** + * + * + * @var int + */ + public $detectGOP = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFairPlayPlaybackPluginData extends KalturaDrmPlaybackPluginData +{ + /** + * + * + * @var string + */ + public $certificate = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaIntegerField extends KalturaIntegerValue +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFieldCompareCondition extends KalturaCompareCondition +{ + /** + * Field to evaluate + * + * @var KalturaIntegerField + */ + public $field; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaStringField extends KalturaStringValue +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFieldMatchCondition extends KalturaMatchCondition +{ + /** + * Field to evaluate + * + * @var KalturaStringField + */ + public $field; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaFileAssetBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var KalturaFileAssetObjectType + */ + public $fileAssetObjectTypeEqual = null; + + /** + * + * + * @var string + */ + public $objectIdEqual = null; + + /** + * + * + * @var string + */ + public $objectIdIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaFileAssetStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileSyncResource extends KalturaContentResource +{ + /** + * The object type of the file sync object + * + * @var int + */ + public $fileSyncObjectType = null; + + /** + * The object sub-type of the file sync object + * + * @var int + */ + public $objectSubType = null; + + /** + * The object id of the file sync object + * + * @var string + */ + public $objectId = null; + + /** + * The version of the file sync object + * + * @var string + */ + public $version = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGenericXsltSyndicationFeed extends KalturaGenericSyndicationFeed +{ + /** + * + * + * @var string + */ + public $xslt = null; + + /** + * + * + * @var array of KalturaExtendingItemMrssParameter + */ + public $itemXpathsToExtend; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGeoDistanceCondition extends KalturaMatchCondition +{ + /** + * The ip geo coder engine to be used + * + * @var KalturaGeoCoderType + */ + public $geoCoderType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGeoTimeLiveStats extends KalturaEntryLiveStats +{ + /** + * + * + * @var KalturaCoordinate + */ + public $city; + + /** + * + * + * @var KalturaCoordinate + */ + public $country; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaGroupUserBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var string + */ + public $userIdEqual = null; + + /** + * + * + * @var string + */ + public $userIdIn = null; + + /** + * + * + * @var string + */ + public $groupIdEqual = null; + + /** + * + * + * @var string + */ + public $groupIdIn = null; + + /** + * + * + * @var KalturaGroupUserStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaIpAddressCondition extends KalturaMatchCondition +{ + /** + * allow internal ips + * + * @var bool + */ + public $acceptInternalIps = null; + + /** + * http header name for extracting the ip + * + * @var string + */ + public $httpHeader = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveAsset extends KalturaFlavorAsset +{ + /** + * + * + * @var string + */ + public $multicastIP = null; + + /** + * + * + * @var int + */ + public $multicastPort = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaLiveChannelSegmentBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var KalturaLiveChannelSegmentStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var string + */ + public $channelIdEqual = null; + + /** + * + * + * @var string + */ + public $channelIdIn = null; + + /** + * + * + * @var float + */ + public $startTimeGreaterThanOrEqual = null; + + /** + * + * + * @var float + */ + public $startTimeLessThanOrEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveParams extends KalturaFlavorParams +{ + /** + * Suffix to be added to the stream name after the entry id {entry_id}_{stream_suffix}, e.g. for entry id 0_kjdu5jr6 and suffix 1, the stream name will be 0_kjdu5jr6_1 + * + * @var string + */ + public $streamSuffix = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaFlavorParams extends KalturaFlavorParams +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaInfoFilter extends KalturaMediaInfoBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMediaServerNode extends KalturaDeliveryServerNode +{ + /** + * Media server application name + * + * @var string + */ + public $applicationName = null; + + /** + * Media server playback port configuration by protocol and format + * + * @var array of KalturaKeyValue + */ + public $mediaServerPortConfig; + + /** + * Media server playback Domain configuration by protocol and format + * + * @var array of KalturaKeyValue + */ + public $mediaServerPlaybackDomainConfig; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaOperationResource extends KalturaContentResource +{ + /** + * Only KalturaEntryResource and KalturaAssetResource are supported + * + * @var KalturaContentResource + */ + public $resource; + + /** + * + * + * @var array of KalturaOperationAttributes + */ + public $operationAttributes; + + /** + * ID of alternative asset params to be used instead of the system default flavor params + * + * @var int + */ + public $assetParamsId = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPartnerFilter extends KalturaPartnerBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaPermissionBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var KalturaPermissionType + */ + public $typeEqual = null; + + /** + * + * + * @var string + */ + public $typeIn = null; + + /** + * + * + * @var string + */ + public $nameEqual = null; + + /** + * + * + * @var string + */ + public $nameIn = null; + + /** + * + * + * @var string + */ + public $friendlyNameLike = null; + + /** + * + * + * @var string + */ + public $descriptionLike = null; + + /** + * + * + * @var KalturaPermissionStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $partnerIdIn = null; + + /** + * + * + * @var string + */ + public $dependsOnPermissionNamesMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $dependsOnPermissionNamesMultiLikeAnd = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaPermissionItemBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var KalturaPermissionItemType + */ + public $typeEqual = null; + + /** + * + * + * @var string + */ + public $typeIn = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $partnerIdIn = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaybackContextOptions extends KalturaEntryContextDataParams +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPostConvertJobData extends KalturaConvartableJobData +{ + /** + * + * + * @var string + */ + public $flavorAssetId = null; + + /** + * Indicates if a thumbnail should be created + * + * @var bool + */ + public $createThumb = null; + + /** + * The path of the created thumbnail + * + * @var string + */ + public $thumbPath = null; + + /** + * The position of the thumbnail in the media file + * + * @var int + */ + public $thumbOffset = null; + + /** + * The height of the movie, will be used to comapare if this thumbnail is the best we can have + * + * @var int + */ + public $thumbHeight = null; + + /** + * The bit rate of the movie, will be used to comapare if this thumbnail is the best we can have + * + * @var int + */ + public $thumbBitrate = null; + + /** + * + * + * @var string + */ + public $customData = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPreviewRestriction extends KalturaSessionRestriction +{ + /** + * The preview restriction length + * + * @var int + */ + public $previewLength = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRecalculateResponseProfileCacheJobData extends KalturaRecalculateCacheJobData +{ + /** + * http / https + * + * @var string + */ + public $protocol = null; + + /** + * + * + * @var KalturaSessionType + */ + public $ksType = null; + + /** + * + * + * @var array of KalturaIntegerValue + */ + public $userRoles; + + /** + * Class name + * + * @var string + */ + public $cachedObjectType = null; + + /** + * + * + * @var string + */ + public $objectId = null; + + /** + * + * + * @var string + */ + public $startObjectKey = null; + + /** + * + * + * @var string + */ + public $endObjectKey = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaRegexCondition extends KalturaMatchCondition +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRemoteStorageResources extends KalturaContentResource +{ + /** + * Array of remote stoage resources + * + * @var array of KalturaRemoteStorageResource + */ + public $resources; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaResponseProfileFilter extends KalturaResponseProfileBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaSearchComparableAttributeCondition extends KalturaAttributeCondition +{ + /** + * + * + * @var KalturaSearchConditionComparison + */ + public $comparison = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchComparableCondition extends KalturaSearchCondition +{ + /** + * + * + * @var KalturaSearchConditionComparison + */ + public $comparison = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaSearchMatchAttributeCondition extends KalturaAttributeCondition +{ + /** + * + * + * @var bool + */ + public $not = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSearchMatchCondition extends KalturaSearchCondition +{ + /** + * + * + * @var bool + */ + public $not = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaServerNodeFilter extends KalturaServerNodeBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSiteCondition extends KalturaMatchCondition +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSshImportJobData extends KalturaImportJobData +{ + /** + * + * + * @var string + */ + public $privateKey = null; + + /** + * + * + * @var string + */ + public $publicKey = null; + + /** + * + * + * @var string + */ + public $passPhrase = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageDeleteJobData extends KalturaStorageJobData +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageExportJobData extends KalturaStorageJobData +{ + /** + * + * + * @var bool + */ + public $force = null; + + /** + * + * + * @var bool + */ + public $createLink = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStorageProfileFilter extends KalturaStorageProfileBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaStringResource extends KalturaContentResource +{ + /** + * Textual content + * + * @var string + */ + public $content = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUiConfFilter extends KalturaUiConfBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadTokenFilter extends KalturaUploadTokenBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaUserEntryBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $idNotIn = null; + + /** + * + * + * @var string + */ + public $entryIdEqual = null; + + /** + * + * + * @var string + */ + public $entryIdIn = null; + + /** + * + * + * @var string + */ + public $entryIdNotIn = null; + + /** + * + * + * @var string + */ + public $userIdEqual = null; + + /** + * + * + * @var string + */ + public $userIdIn = null; + + /** + * + * + * @var string + */ + public $userIdNotIn = null; + + /** + * + * + * @var KalturaUserEntryStatus + */ + public $statusEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var KalturaUserEntryType + */ + public $typeEqual = null; + + /** + * + * + * @var KalturaUserEntryExtendedStatus + */ + public $extendedStatusEqual = null; + + /** + * + * + * @var string + */ + public $extendedStatusIn = null; + + /** + * + * + * @var string + */ + public $extendedStatusNotIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaUserLoginDataBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var string + */ + public $loginEmailEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaUserRoleBaseFilter extends KalturaRelatedFilter +{ + /** + * + * + * @var int + */ + public $idEqual = null; + + /** + * + * + * @var string + */ + public $idIn = null; + + /** + * + * + * @var string + */ + public $nameEqual = null; + + /** + * + * + * @var string + */ + public $nameIn = null; + + /** + * + * + * @var string + */ + public $systemNameEqual = null; + + /** + * + * + * @var string + */ + public $systemNameIn = null; + + /** + * + * + * @var string + */ + public $descriptionLike = null; + + /** + * + * + * @var KalturaUserRoleStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var int + */ + public $partnerIdEqual = null; + + /** + * + * + * @var string + */ + public $partnerIdIn = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $tagsMultiLikeAnd = null; + + /** + * + * + * @var int + */ + public $createdAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $createdAtLessThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtGreaterThanOrEqual = null; + + /** + * + * + * @var int + */ + public $updatedAtLessThanOrEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaWidgetFilter extends KalturaWidgetBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlFilter extends KalturaAccessControlBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAccessControlProfileFilter extends KalturaAccessControlProfileBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAmazonS3StorageExportJobData extends KalturaStorageExportJobData +{ + /** + * + * + * @var KalturaAmazonS3StorageProfileFilesPermissionLevel + */ + public $filesPermissionInS3 = null; + + /** + * + * + * @var string + */ + public $s3Region = null; + + /** + * + * + * @var string + */ + public $sseType = null; + + /** + * + * + * @var string + */ + public $sseKmsKeyId = null; + + /** + * + * + * @var string + */ + public $signatureType = null; + + /** + * + * + * @var string + */ + public $endPoint = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaAmazonS3StorageProfileBaseFilter extends KalturaStorageProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAnonymousIPContextField extends KalturaStringField +{ + /** + * The ip geo coder engine to be used + * + * @var KalturaGeoCoderType + */ + public $geoCoderType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetParamsFilter extends KalturaAssetParamsBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaBaseEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBaseEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaBaseEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaBatchJobFilterExt extends KalturaBatchJobFilter +{ + /** + * + * + * @var string + */ + public $jobTypeAndSubTypeIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryEntryFilter extends KalturaCategoryEntryBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCategoryFilter extends KalturaCategoryBaseFilter +{ + /** + * + * + * @var string + */ + public $freeText = null; + + /** + * + * + * @var string + */ + public $membersIn = null; + + /** + * + * + * @var string + */ + public $nameOrReferenceIdStartsWith = null; + + /** + * + * + * @var string + */ + public $managerEqual = null; + + /** + * + * + * @var string + */ + public $memberEqual = null; + + /** + * + * + * @var string + */ + public $fullNameStartsWithIn = null; + + /** + * not includes the category itself (only sub categories) + * + * @var string + */ + public $ancestorIdIn = null; + + /** + * + * + * @var string + */ + public $idOrInheritedParentIdIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaConstantXsltSyndicationFeed extends KalturaGenericXsltSyndicationFeed +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileFilter extends KalturaConversionProfileBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaConversionProfileAssetParamsFilter extends KalturaConversionProfileAssetParamsBaseFilter +{ + /** + * + * + * @var KalturaConversionProfileFilter + */ + public $conversionProfileIdFilter; + + /** + * + * + * @var KalturaAssetParamsFilter + */ + public $assetParamsIdFilter; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCoordinatesContextField extends KalturaStringField +{ + /** + * The ip geo coder engine to be used + * + * @var KalturaGeoCoderType + */ + public $geoCoderType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaCountryContextField extends KalturaStringField +{ + /** + * The ip geo coder engine to be used + * + * @var KalturaGeoCoderType + */ + public $geoCoderType = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDataEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaDataEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDataEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaDataEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileAkamaiAppleHttpManifestBaseFilter extends KalturaDeliveryProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileAkamaiHdsBaseFilter extends KalturaDeliveryProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileAkamaiHttpBaseFilter extends KalturaDeliveryProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileGenericAppleHttpBaseFilter extends KalturaDeliveryProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileGenericHdsBaseFilter extends KalturaDeliveryProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileGenericHttpBaseFilter extends KalturaDeliveryProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileGenericSilverLightBaseFilter extends KalturaDeliveryProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileLiveAppleHttpBaseFilter extends KalturaDeliveryProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileRtmpBaseFilter extends KalturaDeliveryProfileFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryServerNodeBaseFilter extends KalturaServerNodeFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDocumentEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaDocumentEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDocumentEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaDocumentEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEvalBooleanField extends KalturaBooleanField +{ + /** + * PHP code + * + * @var string + */ + public $code = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEvalStringField extends KalturaStringField +{ + /** + * PHP code + * + * @var string + */ + public $code = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaExternalMediaEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaExternalMediaEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaExternalMediaEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaExternalMediaEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFileAssetFilter extends KalturaFileAssetBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaGenericDataCenterContentResource extends KalturaDataCenterContentResource +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaGenericSyndicationFeedBaseFilter extends KalturaBaseSyndicationFeedFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaGoogleVideoSyndicationFeedBaseFilter extends KalturaBaseSyndicationFeedFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGroupUserFilter extends KalturaGroupUserBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaITunesSyndicationFeedBaseFilter extends KalturaBaseSyndicationFeedFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaIpAddressContextField extends KalturaStringField +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaLiveChannelCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaLiveChannelMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelSegmentFilter extends KalturaLiveChannelSegmentBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaLiveEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaLiveEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryServerNodeBaseFilter extends KalturaEntryServerNodeFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamAdminEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaLiveStreamAdminEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamAdminEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaLiveStreamAdminEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaLiveStreamEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaLiveStreamEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaMediaEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaMediaEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaFlavorParamsOutput extends KalturaFlavorParamsOutput +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMixEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaMixEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMixEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaMixEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaObjectIdField extends KalturaStringField +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionFilter extends KalturaPermissionBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPermissionItemFilter extends KalturaPermissionItemBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlayableEntryCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaPlayableEntryCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlayableEntryMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaPlayableEntryMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylistCompareAttributeCondition extends KalturaSearchComparableAttributeCondition +{ + /** + * + * + * @var KalturaPlaylistCompareAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylistMatchAttributeCondition extends KalturaSearchMatchAttributeCondition +{ + /** + * + * + * @var KalturaPlaylistMatchAttribute + */ + public $attribute = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaSshUrlResource extends KalturaUrlResource +{ + /** + * SSH private key + * + * @var string + */ + public $privateKey = null; + + /** + * SSH public key + * + * @var string + */ + public $publicKey = null; + + /** + * Passphrase for SSH keys + * + * @var string + */ + public $keyPassphrase = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaTimeContextField extends KalturaIntegerField +{ + /** + * Time offset in seconds since current time + * + * @var int + */ + public $offset = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaTubeMogulSyndicationFeedBaseFilter extends KalturaBaseSyndicationFeedFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserAgentCondition extends KalturaRegexCondition +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserAgentContextField extends KalturaStringField +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserEmailContextField extends KalturaStringField +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserEntryFilter extends KalturaUserEntryBaseFilter +{ + /** + * + * + * @var KalturaNullableBoolean + */ + public $userIdEqualCurrent = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $isAnonymous = null; + + /** + * + * + * @var string + */ + public $privacyContextEqual = null; + + /** + * + * + * @var string + */ + public $privacyContextIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserLoginDataFilter extends KalturaUserLoginDataBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUserRoleFilter extends KalturaUserRoleBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaWebcamTokenResource extends KalturaDataCenterContentResource +{ + /** + * Token that returned from media server such as FMS or red5. + * + * @var string + */ + public $token = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaYahooSyndicationFeedBaseFilter extends KalturaBaseSyndicationFeedFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaAdminUserBaseFilter extends KalturaUserFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAmazonS3StorageProfileFilter extends KalturaAmazonS3StorageProfileBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaApiActionPermissionItemBaseFilter extends KalturaPermissionItemFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaApiParameterPermissionItemBaseFilter extends KalturaPermissionItemFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaAssetParamsOutputBaseFilter extends KalturaAssetParamsFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDataEntryBaseFilter extends KalturaBaseEntryFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileAkamaiAppleHttpManifestFilter extends KalturaDeliveryProfileAkamaiAppleHttpManifestBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileAkamaiHdsFilter extends KalturaDeliveryProfileAkamaiHdsBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileAkamaiHttpFilter extends KalturaDeliveryProfileAkamaiHttpBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericAppleHttpFilter extends KalturaDeliveryProfileGenericAppleHttpBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericHdsFilter extends KalturaDeliveryProfileGenericHdsBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericHttpFilter extends KalturaDeliveryProfileGenericHttpBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericSilverLightFilter extends KalturaDeliveryProfileGenericSilverLightBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileLiveAppleHttpFilter extends KalturaDeliveryProfileLiveAppleHttpBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileRtmpFilter extends KalturaDeliveryProfileRtmpBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryServerNodeFilter extends KalturaDeliveryServerNodeBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaFlavorAssetBaseFilter extends KalturaAssetFilter +{ + /** + * + * + * @var int + */ + public $flavorParamsIdEqual = null; + + /** + * + * + * @var string + */ + public $flavorParamsIdIn = null; + + /** + * + * + * @var KalturaFlavorAssetStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var string + */ + public $statusNotIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaFlavorParamsBaseFilter extends KalturaAssetParamsFilter +{ + /** + * + * + * @var KalturaContainerFormat + */ + public $formatEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGenericSyndicationFeedFilter extends KalturaGenericSyndicationFeedBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGoogleVideoSyndicationFeedFilter extends KalturaGoogleVideoSyndicationFeedBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaITunesSyndicationFeedFilter extends KalturaITunesSyndicationFeedBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryServerNodeFilter extends KalturaLiveEntryServerNodeBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaOperaSyndicationFeed extends KalturaConstantXsltSyndicationFeed +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaPlaylistBaseFilter extends KalturaBaseEntryFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaQuizUserEntryBaseFilter extends KalturaUserEntryFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaRokuSyndicationFeed extends KalturaConstantXsltSyndicationFeed +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaServerFileResource extends KalturaGenericDataCenterContentResource +{ + /** + * Full path to the local file + * + * @var string + */ + public $localFilePath = null; + + /** + * Should keep original file (false = mv, true = cp) + * + * @var bool + */ + public $keepOriginalFile = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaThumbAssetBaseFilter extends KalturaAssetFilter +{ + /** + * + * + * @var int + */ + public $thumbParamsIdEqual = null; + + /** + * + * + * @var string + */ + public $thumbParamsIdIn = null; + + /** + * + * + * @var KalturaThumbAssetStatus + */ + public $statusEqual = null; + + /** + * + * + * @var string + */ + public $statusIn = null; + + /** + * + * + * @var string + */ + public $statusNotIn = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaThumbParamsBaseFilter extends KalturaAssetParamsFilter +{ + /** + * + * + * @var KalturaContainerFormat + */ + public $formatEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaTubeMogulSyndicationFeedFilter extends KalturaTubeMogulSyndicationFeedBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaUploadedFileTokenResource extends KalturaGenericDataCenterContentResource +{ + /** + * Token that returned from upload.upload action or uploadToken.add action. + * + * @var string + */ + public $token = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaYahooSyndicationFeedFilter extends KalturaYahooSyndicationFeedBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAdminUserFilter extends KalturaAdminUserBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaApiActionPermissionItemFilter extends KalturaApiActionPermissionItemBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaApiParameterPermissionItemFilter extends KalturaApiParameterPermissionItemBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaAssetParamsOutputFilter extends KalturaAssetParamsOutputBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDataEntryFilter extends KalturaDataEntryBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaDeliveryProfileGenericRtmpBaseFilter extends KalturaDeliveryProfileRtmpFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaEdgeServerNodeBaseFilter extends KalturaDeliveryServerNodeFilter +{ + /** + * + * + * @var string + */ + public $playbackDomainLike = null; + + /** + * + * + * @var string + */ + public $playbackDomainMultiLikeOr = null; + + /** + * + * + * @var string + */ + public $playbackDomainMultiLikeAnd = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorAssetFilter extends KalturaFlavorAssetBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParamsFilter extends KalturaFlavorParamsBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaGenericXsltSyndicationFeedBaseFilter extends KalturaGenericSyndicationFeedFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamAdminEntry extends KalturaLiveStreamEntry +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMediaServerNodeBaseFilter extends KalturaDeliveryServerNodeFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaPlaylistFilter extends KalturaPlaylistBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbAssetFilter extends KalturaThumbAssetBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParamsFilter extends KalturaThumbParamsBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaDeliveryProfileGenericRtmpFilter extends KalturaDeliveryProfileGenericRtmpBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaEdgeServerNodeFilter extends KalturaEdgeServerNodeBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaFlavorParamsOutputBaseFilter extends KalturaFlavorParamsFilter +{ + /** + * + * + * @var int + */ + public $flavorParamsIdEqual = null; + + /** + * + * + * @var string + */ + public $flavorParamsVersionEqual = null; + + /** + * + * + * @var string + */ + public $flavorAssetIdEqual = null; + + /** + * + * + * @var string + */ + public $flavorAssetVersionEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaGenericXsltSyndicationFeedFilter extends KalturaGenericXsltSyndicationFeedBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaLiveAssetBaseFilter extends KalturaFlavorAssetFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaLiveParamsBaseFilter extends KalturaFlavorParamsFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMediaFlavorParamsBaseFilter extends KalturaFlavorParamsFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaServerNodeFilter extends KalturaMediaServerNodeBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMixEntryBaseFilter extends KalturaPlayableEntryFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaThumbParamsOutputBaseFilter extends KalturaThumbParamsFilter +{ + /** + * + * + * @var int + */ + public $thumbParamsIdEqual = null; + + /** + * + * + * @var string + */ + public $thumbParamsVersionEqual = null; + + /** + * + * + * @var string + */ + public $thumbAssetIdEqual = null; + + /** + * + * + * @var string + */ + public $thumbAssetVersionEqual = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaFlavorParamsOutputFilter extends KalturaFlavorParamsOutputBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveAssetFilter extends KalturaLiveAssetBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveParamsFilter extends KalturaLiveParamsBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaFlavorParamsFilter extends KalturaMediaFlavorParamsBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMixEntryFilter extends KalturaMixEntryBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaThumbParamsOutputFilter extends KalturaThumbParamsOutputBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaLiveEntryBaseFilter extends KalturaMediaEntryFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaMediaFlavorParamsOutputBaseFilter extends KalturaFlavorParamsOutputFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveEntryFilter extends KalturaLiveEntryBaseFilter +{ + /** + * + * + * @var KalturaNullableBoolean + */ + public $isLive = null; + + /** + * + * + * @var KalturaNullableBoolean + */ + public $isRecordedEntryIdEmpty = null; + + /** + * + * + * @var string + */ + public $hasMediaServerHostname = null; + + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaMediaFlavorParamsOutputFilter extends KalturaMediaFlavorParamsOutputBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaLiveChannelBaseFilter extends KalturaLiveEntryFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaLiveStreamEntryBaseFilter extends KalturaLiveEntryFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveChannelFilter extends KalturaLiveChannelBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamEntryFilter extends KalturaLiveStreamEntryBaseFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +abstract class KalturaLiveStreamAdminEntryBaseFilter extends KalturaLiveStreamEntryFilter +{ + +} + +/** + * @package Kaltura + * @subpackage Client + */ +class KalturaLiveStreamAdminEntryFilter extends KalturaLiveStreamAdminEntryBaseFilter +{ + +} + diff --git a/local/kaltura/attoembed.php b/local/kaltura/attoembed.php new file mode 100644 index 0000000000000..223b4082eae68 --- /dev/null +++ b/local/kaltura/attoembed.php @@ -0,0 +1,38 @@ +. + +/** + * Kaltura LTI service script used receive data sent from the Kaltura content provider. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$PAGE->set_pagelayout('embedded'); +echo $OUTPUT->header(); +$playurl = urldecode($url); +?> + diff --git a/local/kaltura/auth.php b/local/kaltura/auth.php new file mode 100644 index 0000000000000..e6c5bc47b67fc --- /dev/null +++ b/local/kaltura/auth.php @@ -0,0 +1,163 @@ +. + +/** + * This file is a re-write of the mod/lti/auth.php file, which uses too many references to the Moodle LTI external tool objects. + * The re-write serves as the initiation of the LTI 1.3 handshake between the Kaltura Moodle Plugin and the customer's KAF instance. + * + * @package local_kaltura + */ + +require_once(__DIR__ . '/../../config.php'); +require_once($CFG->dirroot . '/mod/lti/locallib.php'); +require_once($CFG->dirroot . '/local/kaltura/locallib.php'); +global $_POST, $_SERVER; + +if (!isloggedin() && empty($_POST['repost'])) { + header_remove("Set-Cookie"); + $PAGE->set_pagelayout('popup'); + $PAGE->set_context(context_system::instance()); + $output = $PAGE->get_renderer('mod_lti'); + $page = new \mod_lti\output\repost_crosssite_page($_SERVER['REQUEST_URI'], $_POST); + echo $output->header(); + echo $output->render($page); + echo $output->footer(); + return; +} + +$scope = optional_param('scope', '', PARAM_TEXT); +$responsetype = optional_param('response_type', '', PARAM_TEXT); +$clientid = optional_param('client_id', '', PARAM_TEXT); +$redirecturi = optional_param('redirect_uri', '', PARAM_URL); +$loginhint = optional_param('login_hint', '', PARAM_TEXT); +$ltimessagehintenc = optional_param('lti_message_hint', 0, PARAM_TEXT); +$state = optional_param('state', '', PARAM_TEXT); +$responsemode = optional_param('response_mode', '', PARAM_TEXT); +$nonce = optional_param('nonce', '', PARAM_TEXT); +$prompt = optional_param('prompt', '', PARAM_TEXT); + +$ok = !empty($scope) && !empty($responsetype) && !empty($clientid) && + !empty($redirecturi) && !empty($loginhint) && + !empty($nonce); + +if (!$ok) { + $error = 'invalid_request'; +} + +$ltimessagehint = json_decode($ltimessagehintenc); +$ok = $ok && isset($ltimessagehint->launchid); +if (!$ok) { + $error = 'invalid_request'; + $desc = 'No launch id in LTI hint'; +} +if ($ok && ($scope !== 'openid')) { + $ok = false; + $error = 'invalid_scope'; +} +if ($ok && ($responsetype !== 'id_token')) { + $ok = false; + $error = 'unsupported_response_type'; +} +if ($ok) { + $launchid = $ltimessagehint->launchid; + list($courseid, $typeid, $id, $messagetype, $foruserid, $titleb64, $textb64) = explode(',', $SESSION->$launchid, 7); + unset($SESSION->$launchid); + + $module = array(); + $module['id'] = 1; + $module['cmid'] = 0; + $module['module'] = $ltimessagehint->cmid; + $module['title'] = $titleb64 ? base64_decode($titleb64) : ''; + + $configsettings = local_kaltura_get_config(); + $config = local_kaltura_lti_get_type_type_config($module, $configsettings); + $ok = ($clientid === $config->lti_clientid); + if (!$ok) { + $error = 'unauthorized_client'; + } +} +if ($ok && ($loginhint !== $USER->id)) { + $ok = false; + $error = 'access_denied'; +} + +// If we're unable to load up config; we cannot trust the redirect uri for POSTing to. +if (empty($config)) { + throw new moodle_exception('invalidrequest', 'error'); +} else { + $uris = array_map("trim", explode("\n", $config->lti_redirectionuris)); + if (!in_array($redirecturi, $uris)) { + throw new moodle_exception('invalidrequest', 'error'); + } +} +if ($ok) { + if (isset($responsemode)) { + $ok = ($responsemode === 'form_post'); + if (!$ok) { + $error = 'invalid_request'; + $desc = 'Invalid response_mode'; + } + } else { + $ok = false; + $error = 'invalid_request'; + $desc = 'Missing response_mode'; + } +} +if ($ok && !empty($prompt) && ($prompt !== 'none')) { + $ok = false; + $error = 'invalid_request'; + $desc = 'Invalid prompt'; +} + +if ($ok) { + $course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); + if ($id && $course) { + $module["course"] = $course; + $editor = $SESSION->editor; + list($endpoint, $params) = local_kaltura_lti1p3_get_launch_data($module, null, $editor, $nonce); + } else { + $ok = false; + $error = 'course_not_found'; + $desc = 'Course Not Found'; + } +} + +if (!$ok) { + $params['error'] = $error; + if (!empty($desc)) { + $params['error_description'] = $desc; + } +} +if (isset($state)) { + $params['state'] = $state; +} + +$r = '
\n"; +if (!empty($params)) { + foreach ($params as $key => $value) { + $key = htmlspecialchars($key); + $value = htmlspecialchars($value); + $r .= " \n"; + } +} +$r .= "
\n"; +$r .= "\n"; +echo $r; diff --git a/local/kaltura/bsepreview_ltilaunch.php b/local/kaltura/bsepreview_ltilaunch.php new file mode 100644 index 0000000000000..1456031265638 --- /dev/null +++ b/local/kaltura/bsepreview_ltilaunch.php @@ -0,0 +1,23 @@ +dirroot.'/local/kaltura/locallib.php'); + +require_login(); + +global $PAGE; + +$playurl = required_param('playurl', PARAM_URL); + +$launch = array(); +$launch['id'] = 1; +$launch['cmid'] = 0; +$launch['title'] = 'Browse and Embed - Preview Entry'; +$launch['module'] = KAF_BROWSE_EMBED_MODULE; +$launch['course'] = $PAGE->course; +$launch['width'] = '300'; +$launch['height'] = '300'; +$launch['custom_publishdata'] = ''; +$launch['source'] = $playurl; +echo local_kaltura_request_lti_launch($launch, false); + +?> \ No newline at end of file diff --git a/local/kaltura/classes/privacy/provider.php b/local/kaltura/classes/privacy/provider.php new file mode 100644 index 0000000000000..5902937281c91 --- /dev/null +++ b/local/kaltura/classes/privacy/provider.php @@ -0,0 +1,94 @@ +add_external_location_link( + 'lti_client', + [ + 'userid' => 'privacy:metadata:userid', + 'username' => 'privacy:metadata:username', + 'useridnumber' => 'privacy:metadata:useridnumber', + 'firstname' => 'privacy:metadata:firstname', + 'lastname' => 'privacy:metadata:lastname', + 'fullname' => 'privacy:metadata:fullname', + 'email' => 'privacy:metadata:email', + 'role' => 'privacy:metadata:role', + 'courseid' => 'privacy:metadata:courseid', + 'courseidnumber' => 'privacy:metadata:courseidnumber', + 'courseshortname' => 'privacy:metadata:courseshortname', + 'coursefullname' => 'privacy:metadata:coursefullname', + 'custompublishdata' => 'privacy:metadata:custompublishdata', + 'editor' => 'privacy:metadata:editor', + 'module' => 'privacy:metadata:module', + 'source' => 'privacy:metadata:source', + ], + 'privacy:metadata:externalpurpose' + ); + + return $collection; + } + + /** + * Get the list of contexts that contain user information for the specified user. + * + * @param int $userid The user to search. + * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. + */ + public static function get_contexts_for_userid(int $userid) : contextlist { + return new contextlist(); + } + + /** + * Get the list of users who have data within a context. + * + * @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination. + */ + public static function get_users_in_context(userlist $userlist) { + } + + /** + * Export all user data for the specified user, in the specified contexts. + * + * @param approved_contextlist $contextlist The approved contexts to export information for. + */ + public static function export_user_data(approved_contextlist $contextlist) { + } + + /** + * Delete all data for all users in the specified context. + * + * @param context $context The specific context to delete data for. + */ + public static function delete_data_for_all_users_in_context(\context $context) { + } + + /** + * Delete all user data for the specified user, in the specified contexts. + * + * @param approved_contextlist $contextlist The approved contexts and user information to delete information for. + */ + public static function delete_data_for_user(approved_contextlist $contextlist) { + } + + /** + * Delete multiple users within a single context. + * + * @param approved_userlist $userlist The approved context and user information to delete information for. + */ + public static function delete_data_for_users(approved_userlist $userlist) { + } +} diff --git a/local/kaltura/db/access.php b/local/kaltura/db/access.php new file mode 100644 index 0000000000000..e1b21b000602b --- /dev/null +++ b/local/kaltura/db/access.php @@ -0,0 +1,39 @@ +. + +/** + * Kaltura local plug-in access.php + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$capabilities = array( + 'local/kaltura:download_trace_logs' => array( + 'captype' => 'read', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'manager' => CAP_ALLOW, + ) + ), + 'local/kaltura:migrate_data' => array( + 'captype' => 'read', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'manager' => CAP_ALLOW, + ) + ), +); \ No newline at end of file diff --git a/local/kaltura/db/install.xml b/local/kaltura/db/install.xml new file mode 100755 index 0000000000000..66c822945f5a6 --- /dev/null +++ b/local/kaltura/db/install.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + +
+
+
\ No newline at end of file diff --git a/local/kaltura/db/upgrade.php b/local/kaltura/db/upgrade.php new file mode 100644 index 0000000000000..45c16d6347ad0 --- /dev/null +++ b/local/kaltura/db/upgrade.php @@ -0,0 +1,78 @@ +. + +/** + * Upgrade code containing changes to the plugin data table. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ +function xmldb_local_kaltura_upgrade($oldversion) { + global $CFG, $DB; + + $savePointDone = false; + require_once($CFG->dirroot.'/local/kaltura/locallib.php'); + + $dbman = $DB->get_manager(); + + // plugin in any version below this is 3.x and requires migration + if ($oldversion < 2014023000) { + // Because the plug-in is being upgraded we need to set the migration flag to true. + set_config('migration_yes', 1, KALTURA_PLUGIN_NAME); + + // Define table local_kaltura_log to be created. + $table = new xmldb_table('local_kaltura_log'); + + // Adding fields to table local_kaltura_log. + $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); + $table->add_field('module', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, null); + $table->add_field('type', XMLDB_TYPE_CHAR, '3', null, XMLDB_NOTNULL, null, null); + $table->add_field('endpoint', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null); + $table->add_field('data', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null); + $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '20', null, XMLDB_NOTNULL, null, '0'); + + // Adding keys to table local_kaltura_log. + $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); + + // Adding indexes to table local_kaltura_log. + $table->add_index('module_idx', XMLDB_INDEX_NOTUNIQUE, array('module')); + $table->add_index('timecreated_idx', XMLDB_INDEX_NOTUNIQUE, array('timecreated')); + + // Conditionally launch create table for local_kaltura_log. + if (!$dbman->table_exists($table)) { + $dbman->create_table($table); + } + + // Kaltura savepoint reached. + upgrade_plugin_savepoint(true, 2016120130, 'local', 'kaltura'); + $savePointDone = true; + } + + if (!$savePointDone && $oldversion < 2016120130) { + if($dbman->table_exists('local_kaltura_log') && $dbman->field_exists('local_kaltura_log', 'endpoint')) { + $table = new xmldb_table('local_kaltura_log'); + $updatedFieldSchema = new xmldb_field('endpoint', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null, null); + $dbman->change_field_type($table, $updatedFieldSchema); + } + + // Kaltura savepoint reached. + upgrade_plugin_savepoint(true, 2016120130, 'local', 'kaltura'); + } + + return true; +} \ No newline at end of file diff --git a/local/kaltura/download_log.php b/local/kaltura/download_log.php new file mode 100644 index 0000000000000..338a598279662 --- /dev/null +++ b/local/kaltura/download_log.php @@ -0,0 +1,103 @@ +. + +/** + * Download Kaltura logs page. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once('../../config.php'); +require_once($CFG->dirroot.'/local/kaltura/download_log_form.php'); + +global $DB; + +$url = new moodle_url('/mod/lti/instructor_edit_tool_type.php'); +$context = context_system::instance(); +$heading = get_string('download_logs_title', 'local_kaltura'); +$site = get_site(); + +$PAGE->navbar->add(get_string('administrationsite')); +$PAGE->navbar->add(get_string('plugins', 'admin')); +$PAGE->navbar->add(get_string('localplugins')); +$PAGE->navbar->add(get_string('pluginname', 'local_kaltura'), new moodle_url('/admin/settings.php', array('section' => 'local_kaltura'))); +$PAGE->navbar->add(get_string('download_logs_title', 'local_kaltura')); +$PAGE->set_url($url); +$PAGE->set_context($context); + +$PAGE->set_context($context); +$PAGE->set_pagelayout('standard'); +$PAGE->set_pagetype('local-kaltura-download-log'); +$PAGE->set_title($heading); +$PAGE->set_heading($site->fullname); + +require_login(null, false); + +require_capability('local/kaltura:download_trace_logs', $context); + +$url = new moodle_url('/admin/settings.php', array('section' => 'local_kaltura')); +$downloadurl = new moodle_url('/local/kaltura/download_log.php'); + +$form = new local_kaltura_download_log_form(); +if ($data = $form->get_data()) { + // User hit cancel. Redirect them back to the settings page. + if (isset($data->cancel)) { + redirect($url); + } + + require_sesskey(); + + // User hit submit button. Check for records since the configured date. + if (isset($data->submitbutton)) { + $rs = $DB->get_recordset_select('local_kaltura_log', 'timecreated >= ?', array($data->logs_start_time), 'timecreated ASC'); + + // Check if the recordset contains any data. + if ($rs->valid()) { + header('Content-Type: text/csv; charset=utf-8'); + header('Content-Disposition: attachment; filename=kalturalogs.csv'); + + // create a file pointer connected to the output stream + $output = fopen('php://output', 'w'); + + // output the column headings + fputcsv($output, array(get_string('request', 'local_kaltura'), get_string('time', 'local_kaltura'), + get_string('module', 'local_kaltura'), get_string('endpoint', 'local_kaltura'), get_string('data', 'local_kaltura'))); + + foreach ($rs as $record) { + $record->data = json_encode(unserialize($record->data)); + fputcsv($output, array($record->type, userdate($record->timecreated), $record->module, $record->endpoint, $record->data)); + } + + $rs->close(); + die(); + } else { + notice(get_string('no_records', 'local_kaltura'), $downloadurl); + } + } + + if (isset($data->deletelogs)) { + $DB->delete_records_select('local_kaltura_log', 'id > 0'); + notice(get_string('records_deleted', 'local_kaltura'), $downloadurl); + } +} + +echo $OUTPUT->header(); +echo $OUTPUT->heading(get_string('download_logs_title', 'local_kaltura')); +$form->display(); +echo $OUTPUT->footer(); diff --git a/local/kaltura/download_log_form.php b/local/kaltura/download_log_form.php new file mode 100644 index 0000000000000..10d089d4d17a7 --- /dev/null +++ b/local/kaltura/download_log_form.php @@ -0,0 +1,46 @@ +. + +/** + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +defined('MOODLE_INTERNAL') || die; + +require_once($CFG->libdir.'/formslib.php'); +/** + * Download Kaltura logs form class. + */ +class local_kaltura_download_log_form extends moodleform { + /** + * This function defines the elements on the form. + */ + public function definition() { + $mform =& $this->_form; + + $mform->addElement('header', 'setup', get_string('options')); + $mform->addElement('date_selector', 'logs_start_time', get_string('download_log_range', 'local_kaltura')); + + $buttonarray=array(); + $buttonarray[] =& $mform->createElement('submit', 'submitbutton', get_string('download')); + $buttonarray[] =& $mform->createElement('submit', 'cancel', get_string('cancel')); + $buttonarray[] =& $mform->createElement('submit', 'deletelogs', get_string('delete_logs', 'local_kaltura')); + $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false); + } +} \ No newline at end of file diff --git a/local/kaltura/js/bse_iframe_resize.js b/local/kaltura/js/bse_iframe_resize.js new file mode 100644 index 0000000000000..b11172c947887 --- /dev/null +++ b/local/kaltura/js/bse_iframe_resize.js @@ -0,0 +1,17 @@ +(function() { + window.addEventListener('message', function (e) { + try { + var postMessageData = e.data; + if (postMessageData.subject === "lti.frameResize") { + var height = postMessageData.height; + if (height.toString().indexOf("%") === -1) { + height += "px"; + } + $('.kaltura-player-iframe').height(height); + } + } + catch (ex) { + console.error("encountered error in kms communication", ex); + } + }); +}()); diff --git a/local/kaltura/js/kea_resize.js b/local/kaltura/js/kea_resize.js new file mode 100644 index 0000000000000..60ca35f7a261e --- /dev/null +++ b/local/kaltura/js/kea_resize.js @@ -0,0 +1,15 @@ +(function() { + window.addEventListener('message', function (e) { + try { + var postMessageData = e.data; + if (postMessageData.subject === "lti.frameResize") { + var height = postMessageData.height; + var lti = document.querySelector("#contentframe"); + lti.style.height = height + "px"; + } + } + catch (ex) { + console.error("encountered error in kms communication", ex); + } + }); +}()); \ No newline at end of file diff --git a/local/kaltura/lang/en/local_kaltura.php b/local/kaltura/lang/en/local_kaltura.php new file mode 100644 index 0000000000000..4a20e5983b926 --- /dev/null +++ b/local/kaltura/lang/en/local_kaltura.php @@ -0,0 +1,104 @@ +. + +/** + * Kaltura language file. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$string['admin_secret'] = 'Admin secret'; +$string['admin_secret_desc'] = 'Enter the admin secret for your account.'; +$string['cancelbtn'] = 'Cancel'; +$string['categories_created'] = 'Number of categories created:'; +$string['data'] = 'Data (JSON)'; +$string['delete_logs'] = 'Purge all logs'; +$string['download_logs_title'] = 'Download logs'; +$string['download_log_range'] = 'Download logs newer than selected date'; +$string['endpoint'] = 'Endpoint'; +$string['entries_migrated'] = 'The number of entries migrated:'; +$string['insertbtn'] = 'Embed media'; +$string['invalid_url'] = 'Invalid URL'; +$string['kaf_configuration_hdr'] = 'KAF configuration'; +$string['kaf_uri'] = 'KAF URI'; +$string['kaf_uri_desc'] = 'Type in the server URI of your KAF instance.'; +$string['kaltura_course_reports'] = 'Kaltura Course Media Reports'; +$string['kaltura:download_trace_logs'] = 'Download Kaltura trace logs'; +$string['kaltura:migrate_data'] = 'Migrate Kaltura Data'; +$string['migration_cannot_connect'] = 'Error connecting to Kaltura.'; +$string['migration_complete_redirect'] = 'The migration has been completed.'; +$string['migration_has_stopped'] = 'Due to the large amounts of data only a portion of the migration was completed. The last known location has been saved and you may continue migrating your data.'; +$string['migration_header'] = 'Data migration'; +$string['migration_kaf_url_not_set'] = 'The KAF URI is not set. Please enter a KAF URI before starting the migration'; +$string['migration_not_started'] = 'Click the start/continue button to start the migration.'; +$string['migration_notice'] = 'Data from your account needs to be migrated in order to be used with this version of the plug-ins. Go to the Migration page to begin the process.'; +$string['migration_root_category_not_set'] = 'Unable to determine the root category id.'; +$string['migration_profile_id_not_set'] = 'Unable to determine the metadata profile id.'; +$string['migration_select_a_category'] = 'Select a KAF category to migrate to'; +$string['migration_start_continue'] = 'Start / Continue'; +$string['migration_start_over_redirect'] = 'The migration statistics and last known location has been restarted.'; +$string['migration_start_time'] = 'The migration was originally started at:'; +$string['missing_required_info'] = 'Warning: the Partner id or Admin secret is empty. The Kaltura plug-ins will not work.'; +$string['module'] = 'Module'; +$string['no_records'] = 'No records returned.'; +$string['original_kafcategory'] = 'The KAF category selected for migration.'; +$string['partner_id'] = 'Partner id'; +$string['partner_id_desc'] = 'Enter the partner id for your account.'; +$string['pluginname'] = 'Kaltura package libraries'; +$string['preview'] = 'Preview'; +$string['records_deleted'] = 'All Kaltura log records were deleted.'; +$string['request'] = 'Request/Response'; +$string['server_uri'] = 'Server URI'; +$string['server_uri_desc'] = 'Type in the server URI you want to connect to. Otherwise just type in the default settings (This setting is used for migration purposes).'; +$string['startover'] = 'Restart migration'; +$string['time'] = 'Time'; +$string['trace_log'] = 'Enable trace logging'; +$string['trace_log_desc'] = 'If enabled, all requests and responses to and from Kaltura are logged. These logs can be used by Kaltura support to diagnose any problems encountered. Enabling this setting may affect Moodle performance. You may download a CSV file of the logs from here.'; +$string['browse_and_embed'] = 'Browse and Embed'; +$string['enable_submission'] = 'Clone Submissions'; +$string['enable_submission_desc'] = 'If enabled, any media submitted via the Kaltura Video Submission flow will be cloned under a different user name to prevent editing and deletion.'; +$string['privacy:metadata:courseid'] = 'The ID of the course the user is accessing the LTI Consumer from'; +$string['privacy:metadata:courseidnumber'] = 'The ID number of the course the user is accessing the LTI Consumer from'; +$string['privacy:metadata:coursefullname'] = 'The fullname of the course the user is accessing the LTI Consumer from'; +$string['privacy:metadata:courseshortname'] = 'The shortname of the course the user is accessing the LTI Consumer from'; +$string['privacy:metadata:email'] = 'The email address of the user accessing the LTI Consumer'; +$string['privacy:metadata:externalpurpose'] = 'The LTI Consumer provides user information and context to the LTI Tool Provider.'; +$string['privacy:metadata:firstname'] = 'The firstname of the user accessing the LTI Consumer'; +$string['privacy:metadata:fullname'] = 'The fullname of the user accessing the LTI Consumer'; +$string['privacy:metadata:lastname'] = 'The lastname of the user accessing the LTI Consumer'; +$string['privacy:metadata:role'] = 'The role in the course for the user accessing the LTI Consumer'; +$string['privacy:metadata:userid'] = 'The ID of the user accessing the LTI Consumer'; +$string['privacy:metadata:useridnumber'] = 'The ID number of the user accessing the LTI Consumer'; +$string['privacy:metadata:username'] = 'The username of the user accessing the LTI Consumer'; +$string['privacy:metadata:editor'] = 'The editor of the user accessing the LTI Consumer'; +$string['privacy:metadata:module'] = 'The name of the module the user is accessing the LTI Consumer from'; +$string['privacy:metadata:source'] = 'The source URL of the media entry of the user accessing the LTI Consumer'; +$string['privacy:metadata:custompublishdata'] = 'The courses the user is enrolled in and the LTI roles the user has in the course'; +$string['lti_version'] = 'LTI Version'; +$string['lti_version_desc'] = 'Choose which LTI version the account works with'; +$string['lti1p1'] = 'LTI1.1'; +$string['lti1p3'] = 'LTI1.3'; +$string['public_keyset_url'] = 'Public keyset URL'; +$string['public_keyset_desc'] = 'Public keyset URL'; +$string['launch_url'] = 'Launch URL'; +$string['launch_url_desc'] = 'Launch URL'; +$string['client_id'] = 'Client ID'; +$string['client_id_desc'] = 'Client ID'; +$string['redirection_uris'] = 'Redirection URIs'; +$string['redirection_uris_desc'] = 'Redirection URIs'; \ No newline at end of file diff --git a/local/kaltura/lib.php b/local/kaltura/lib.php new file mode 100644 index 0000000000000..4778a2c55e957 --- /dev/null +++ b/local/kaltura/lib.php @@ -0,0 +1,24 @@ +. + +/** + * Kaltura library file. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ \ No newline at end of file diff --git a/local/kaltura/locallib.php b/local/kaltura/locallib.php new file mode 100644 index 0000000000000..f12db8170b64b --- /dev/null +++ b/local/kaltura/locallib.php @@ -0,0 +1,951 @@ +. + +/** + * Kaltura local library of functions. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +global $CFG; // should be defined in config.php + +require_once($CFG->dirroot.'/mod/lti/locallib.php'); + +define('KALTURA_PLUGIN_NAME', 'local_kaltura'); +define('KALTURA_DEFAULT_URI', 'www.kaltura.com'); +define('KALTURA_REPORT_DEFAULT_URI', 'http://apps.kaltura.com/hosted_pages'); +define('KAF_MYMEDIA_MODULE', 'mymedia'); +define('KAF_MEDIAGALLERY_MODULE', 'coursegallery'); +define('KAF_BROWSE_EMBED_MODULE', 'browseembed'); +define('KAF_MYMEDIA_ENDPOINT', 'hosted/index/my-media'); +define('KAF_MEDIAGALLERY_ENDPOINT', 'hosted/index/course-gallery'); +define('KAF_BROWSE_EMBED_ENDPOINT', 'browseandembed/index/browseandembed'); +define('KALTURA_LOG_REQUEST', 'REQ'); +define('KALTURA_LOG_RESPONSE', 'RES'); +define('KALTURA_PANEL_HEIGHT', 580); +define('KALTURA_PANEL_WIDTH', 1100); +define('KALTURA_LTI_LEARNER_ROLE', 'Learner'); +define('KALTURA_LTI_INSTRUCTOR_ROLE', 'Instructor'); +define('KALTURA_LTI_ADMIN_ROLE', 'urn:lti:sysrole:ims/lis/Administrator'); +define('KALTURA_REPO_NAME', 'kaltura'); +// For KALTURA_URI_TOKEN +// 1. Do not use characters that are used in regular expressions like {}[]() +// 2. Moodle cleans up urls that look like relative links into complete urls by inserting $CFG->wwwroot +define('KALTURA_URI_TOKEN', 'kaltura-kaf-uri.com'); + +/** + * This function validates whether a requested KAF module is valid. + * @param string $module The name of the module. + * @return bool True if valid, otherwise false. + */ +function local_kaltura_validate_kaf_module_request($module) { + $valid = false; + + switch ($module) { + case KAF_MYMEDIA_MODULE: + $valid = true; + break; + case KAF_MEDIAGALLERY_MODULE: + $valid = true; + break; + case KAF_BROWSE_EMBED_MODULE: + $valid = true; + break; + } + return $valid; +} + +/** + * This function calls @see lti_get_launch_container() to an LTI launch container to display the content. + * @param bool $withblocks Set to true to dislay embed content with Moodle blocks. Otherwise set to false. + * @return int Container value + */ +function local_kaltura_get_lti_launch_container($withblocks = true) { + $lti = new stdClass(); + $container = 0; + + if (!empty($withblocks)) { + $lti->launchcontainer = LTI_LAUNCH_CONTAINER_EMBED; + $container = lti_get_launch_container($lti, array('launchcontainer' => LTI_LAUNCH_CONTAINER_EMBED)); + } else { + $lti->launchcontainer = LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS; + $container = lti_get_launch_container($lti, array('launchcontainer' => LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS)); + } + + return $container; +} + +/** + * This function validates the parameters to see if all of the requirements for the module are met. + * @param array $params An array of parameters + * @return bool true if valid, otherwise false + */ +function local_kaltura_validate_mymedia_required_params($params) { + $valid = true; + + $expectedkeys = array( + // The activity instance id + 'id' => '', + // The KAL module requested + 'module' => '', + 'course' => new stdClass(), + 'title' => '', + 'width' => '', + 'height' => '', + 'cmid' => '', + 'custom_publishdata' => '', + ); + + // Get keys that reside in both parameters and expectedkeys + $matchingkeys = array_intersect_key($params, $expectedkeys); + + // The number of keys in the result should equal the number of expectedkeys + if (count($expectedkeys) != count($matchingkeys)) { + return false; + } + + $invalid = !is_numeric($params['id']) || !is_numeric($params['width']) || !is_numeric($params['height']) || !is_numeric($params['cmid']) || !is_object($params['course']); + + if ($invalid) { + return false; + } + + return true; +} + +/** + * This function validates the parameters to see if all of the requirements for the module are met. + * @param array $params An array of parameters + * @return bool true if valid, otherwise false + */ +function local_kaltura_validate_mediagallery_required_params($params) { + $valid = true; + + $expectedkeys = array( + // The activity instance id + 'id' => '', + // The KAL module requested + 'module' => '', + 'course' => new stdClass(), + 'title' => '', + 'width' => '', + 'height' => '', + 'cmid' => '', + 'custom_publishdata' => '', + ); + + // Get keys that reside in both parameters and expectedkeys + $matchingkeys = array_intersect_key($params, $expectedkeys); + + // The number of keys in the result should equal the number of expectedkeys + if (count($expectedkeys) != count($matchingkeys)) { + return false; + } + + $invalid = !is_numeric($params['id']) || !is_numeric($params['width']) || !is_numeric($params['height']) || !is_numeric($params['cmid']) || !is_object($params['course']); + + if ($invalid) { + return false; + } + + return true; +} + +/** + * This function validates the parameters to see if all of the requirements for the module are met. + * @param array $params An array of parameters + * @return bool true if valid, otherwise false + */ +function local_kaltura_validate_browseembed_required_params($params) { + $valid = true; + + $expectedkeys = array( + // The activity instance id + 'id' => '', + // The KAL module requested + 'module' => '', + 'course' => new stdClass(), + 'title' => '', + 'width' => '', + 'height' => '', + 'cmid' => '', + 'custom_publishdata' => '', + ); + + // Get keys that reside in both parameters and expectedkeys + $matchingkeys = array_intersect_key($params, $expectedkeys); + + // The number of keys in the result should equal the number of expectedkeys + if (count($expectedkeys) != count($matchingkeys)) { + return false; + } + + $invalid = !is_numeric($params['id']) || !is_numeric($params['width']) || !is_numeric($params['height']) || !is_numeric($params['cmid']) || !is_object($params['course']); + + if ($invalid) { + return false; + } + + return true; +} + +/** + * This function returns the endpoint URL belonging to the module that was requested. + * @param string $module The name of the module being requested. + * @param string Part of the URL that makes up the endpoint pertaining to the module requested. + * @return string Part of the URL for the end point designated for the module. Otherwise an empty string. + */ +function local_kaltura_get_endpoint($module) { + switch ($module) { + case KAF_MYMEDIA_MODULE: + return KAF_MYMEDIA_ENDPOINT; + break; + case KAF_MEDIAGALLERY_MODULE: + return KAF_MEDIAGALLERY_ENDPOINT; + break; + case KAF_BROWSE_EMBED_MODULE: + return KAF_BROWSE_EMBED_ENDPOINT; + break; + } + return ''; +} + +/** + * This function replaces the KALTURA_TOKEN_URI in a source URL with KAF URI domain. + * @param string $url A url which need the kaf_uri added. + * @return string Returns url with added KAF URI domain. + */ +function local_kaltura_add_kaf_uri_token($url) { + $configsettings = local_kaltura_get_config(); + // For records that have been migrated from old kaf uri to token format by search and replace. + if (preg_match('/https?:\/\/'.KALTURA_URI_TOKEN.'/', $url)) { + $url = preg_replace('/https?:\/\/'.KALTURA_URI_TOKEN.'/', $configsettings->kaf_uri, $url); + } + return $url; +} + +/** + * This function formats and returns an object that will be passed to mod_lti locallib.php functions. + * @param array $ltirequest An array of parameters to be converted into a properly formatted mod_lti instance. + * @return object Returns an object that meets the requirements for use with mod_lti locallib.php functions. + */ +function local_kaltura_format_lti_instance_object($ltirequest) { + $configsettings = local_kaltura_get_config(); + + // Convert request parameters into mod_lti friendly format for consumption. + $lti = new stdClass(); + $lti->course = $ltirequest['course']->id; + $lti->id = $ltirequest['id']; + $lti->name = $ltirequest['title']; + $lti->intro = isset($ltirequest['intro']) ? $ltirequest['intro'] : ''; + $lti->instructorchoicesendname = LTI_SETTING_ALWAYS; + $lti->instructorchoicesendemailaddr = LTI_SETTING_ALWAYS; + $lti->custom_publishdata = ''; + $lti->instructorcustomparameters = ''; + $lti->instructorchoiceacceptgrades = LTI_SETTING_NEVER; + $lti->instructorchoiceallowroster = LTI_SETTING_NEVER; + $lti->resourcekey = $configsettings->partner_id; + $lti->lti_version = $configsettings->lti_version; + + if ($configsettings->adminsecret) { + $lti->password = $configsettings->adminsecret; + } + + if ($configsettings->client_id) { + $lti->client_id = $configsettings->client_id; + } + + $lti->introformat = FORMAT_MOODLE; + // The Kaltura tool URL includes the account partner id. + $newuri = $configsettings->kaf_uri; + $lti->toolurl = $newuri; + if (!preg_match('/\/$/',$newuri)) { + $lti->toolurl .= '/'; + } + $lti->toolurl .= local_kaltura_get_endpoint($ltirequest['module']); + // Do not force SSL. At the module level. + $lti->forcessl = 0; + $lti->cmid = $ltirequest['cmid']; + + + + // Check if a source URL was passed. This means that a plug-in has requested to view a media entry and not a KAF interface. + if (!isset($ltirequest['source']) || empty($ltirequest['source'])) { + // If the Moodle site is configured to use HTTPS then this property will be used. + $lti->securetool = 'https://'.local_kaltura_format_uri(trim($lti->toolurl)); + $lti->toolurl = 'http://'.local_kaltura_format_uri(trim($lti->toolurl)); + } else { + $url = local_kaltura_format_uri($ltirequest['source']); + // If the Moodle site is configured to use HTTPS then this property will be used. + $lti->securetool = 'https://'.trim($url); + $lti->toolurl = 'http://'.trim($url); + } + + return $lti; +} + +/** + * This function formats an array that is passed to mod_lti locallib.php functions. + * @param object $lti An object returned from @see local_kaltura_format_lti_instance_object(). + * @param bool $withblocks Set to true to display blocks. Otherwise false. + * @return array An array formatted for use by mod_lti locallib.php functions. + */ +function local_kaltura_format_typeconfig($lti, $withblocks = true) { + $typeconfig = array(); + $typeconfig['sendname'] = $lti->instructorchoicesendname; + $typeconfig['sendemailaddr'] = $lti->instructorchoicesendemailaddr; + $typeconfig['customparameters'] = $lti->instructorcustomparameters; + $typeconfig['acceptgrades'] = $lti->instructorchoiceacceptgrades; + $typeconfig['allowroster'] = $lti->instructorchoiceallowroster; + $typeconfig['launchcontainer'] = local_kaltura_get_lti_launch_container($withblocks); + + return $typeconfig; +} + +/** + * This function is based off of the code from @see lti_view(). + * @param string $endpoint The URL to access the KAF LTI tool. + * @param string $params The signed parameters returned by @see lti_sign_parameters(). + */ +function local_kaltura_strip_querystring($endpoint, $params) { + $endpointurl = new moodle_url($endpoint); + $endpointparams = $endpointurl->params(); + + // Strip querystring params in endpoint url from $parms to avoid duplication. + if (!empty($endpointparams) && !empty($parms)) { + foreach (array_keys($endpointparams) as $paramname) { + if (isset($parms[$paramname])) { + unset($parms[$paramname]); + } + } + } +} + +/** + * This function converts an LTI request object into a properly formatted LTI request that can be consumed by Moodle's LTI local library. + * The function is modeled closely after @see lti_view(). The code was refactored because the original function relied too heavily on + * there being an LTI tool defined in the LTI activity instance table. + * @param array $ltirequest An array with parameters specifying some required information for an LTI launch. + * @param array $withblocks True if Moodle blocks are to be included on the page else false. + * @return string Returns HTML required to initiate an LTI launch. + */ +function local_kaltura_request_lti_launch($ltirequest, $withblocks = true, $editor = null) { + $ltiVersion = get_config(KALTURA_PLUGIN_NAME, 'lti_version'); + if($ltiVersion == LTI_VERSION_1P3) { + return local_kaltura_request_lti1p3_launch($ltirequest, $withblocks, $editor); + } + + global $CFG, $USER; + + if(is_null($editor)) + { + $editor = 'tinymce'; + } + + $requestparams = array(); + + $lti = local_kaltura_format_lti_instance_object($ltirequest); + + $typeconfig = local_kaltura_format_typeconfig($lti, $withblocks); + + // This line was taken from @see lti_add_type. + // Create a salt value to be used for signing passed data to extension services + // The outcome service uses the service salt on the instance. This can be used + // for communication with services not related to a specific LTI instance. + $lti->servicesalt = uniqid('', true); + + // If SSL is forced, use HTTPS. + $endpoint = $lti->toolurl; + if (lti_request_is_using_ssl()) { + $endpoint = $lti->securetool; + } + + $requestparams = array_merge(lti_build_standard_request((object) $lti, null, false), lti_build_request((object) $lti, $typeconfig, $ltirequest['course'])); + if(!isset($requestparams['resource_link_id'])) // fix to moodle 2.8 issue where this function (lti_build_request) does not set resource_link_id value + { + $requestparams['resource_link_id'] = $lti->id; + } + + // Moodle by default uses the Moodle user id. Overriding this parameter to user the Moodle username. + $requestparams['user_id'] = $USER->username; + + // This block of code is loosly based off code from @see lti_view(). + $urlparts = parse_url($CFG->wwwroot); + $requestparams['tool_consumer_instance_guid'] = $urlparts['host']; + + $returnurlparams['unsigned'] = '0'; + $returnurlparams['editor'] = $editor; + + // Add the return URL. We send the launch container along to help us avoid frames-within-frames when the user returns. + $url = new moodle_url('/local/kaltura/service.php', $returnurlparams); + $requestparams['launch_presentation_return_url'] = $url->out(false); + + $serviceurl = new moodle_url('/local/kaltura/service.php'); + $requestparams['lis_outcome_service_url'] = $serviceurl->out(false); + + // Add custom parameters + $requestparams['custom_publishdata'] = local_kaltura_get_kaf_publishing_data(); + $requestparams['custom_publishdata_encoded'] = '1'; + $requestparams['custom_moodle_plugin_version'] = local_kaltura_get_config()->version; + + if (isset($ltirequest['submission'])) { + $requestparams['assignment'] = $ltirequest['submission']; + } + + $params = lti_sign_parameters($requestparams, $endpoint, 'POST', $lti->resourcekey, $lti->password); + + local_kaltura_strip_querystring($endpoint, $params); + + $debuglaunch = 0; + + $content = lti_post_launch_html($params, $endpoint, $debuglaunch); + + // Check if debugging is enabled. + $enablelogging = get_config(KALTURA_PLUGIN_NAME, 'enable_logging'); + if (!empty($enablelogging)) { + local_kaltura_log_data($ltirequest['module'], $endpoint, $params, true); + } + + return $content; +} + +function local_kaltura_request_lti1p3_launch($ltirequest, $withblocks = true, $editor = null) { + global $SESSION; + + $configsettings = local_kaltura_get_config(); + $config = local_kaltura_lti_get_type_type_config($ltirequest, $configsettings); + + $config->lti_launchcontainer = local_kaltura_get_lti_launch_container($withblocks); + + $instance = local_kaltura_format_lti_instance_object($ltirequest); + if(is_null($editor)) { + $editor = 'tinymce'; + } + + $SESSION->editor = $editor; + + return lti_initiate_login($ltirequest['course']->id, $ltirequest['module'], $instance, $config, null, $ltirequest['title']); +} +/** + * Generates some of the tool configuration based on the admin configuration details + * + * @param array $ltirequest + * @param stdClass $kaltura_config + * + * @return stdClass Configuration details + */ +function local_kaltura_lti_get_type_type_config($ltirequest, $kaltura_config) { + + $type = new \stdClass(); + + $type->typeid = $ltirequest['module']; + + if (empty($ltirequest['source'])) { + $type->lti_toolurl = $kaltura_config->kaf_uri; + // The Kaltura tool URL includes the account partner id. + if (!preg_match('/\/$/',$type->lti_toolurl)) { + $type->lti_toolurl .= '/'; + } + $type->lti_toolurl .= local_kaltura_get_endpoint($ltirequest['module']); + } else { + $type->lti_toolurl = $ltirequest['source']; + } + + + $type->lti_ltiversion = $kaltura_config->lti_version; + + $type->lti_clientid = $kaltura_config->client_id; + + if (isset($kaltura_config->public_keyset_url)) { + $type->lti_publickeyset = $kaltura_config->public_keyset_url; + } + $type->lti_keytype = LTI_JWK_KEYSET; + + if (isset($kaltura_config->launch_url)) { + $type->lti_initiatelogin = $kaltura_config->launch_url; + } + if (isset($kaltura_config->redirection_uris)) { + $type->lti_redirectionuris = $kaltura_config->redirection_uris; + } + + $type->lti_instructorchoicesendname = LTI_SETTING_ALWAYS; + $type->lti_instructorchoicesendemailaddr = LTI_SETTING_ALWAYS; + + $type->lti_instructorchoiceacceptgrades = LTI_SETTING_NEVER; + + $type->lti_instructorchoiceallowroster = LTI_SETTING_NEVER; + + $type->lti_forcessl = false; + + return $type; +} + + +/** + * Re-write of the lti_get_launch_data lti method, necessitated by the original's reliance on the lti tool DB table + * The Kaltura plugin will only use this method when authorizing through LTI1.3 + * + * @param array $module context info + * @param string $nonce the nonce value to use (applies to LTI 1.3 only) + * @return array the endpoint URL and parameters (including the signature) + * @since Moodle 3.0 + */ +function local_kaltura_lti1p3_get_launch_data($module, $withblocks, $editor = null, $nonce = '') { + global $PAGE, $USER; + + $instance = local_kaltura_format_lti_instance_object($module); + + $typeconfig = local_kaltura_format_typeconfig($instance, $withblocks); + + $toolproxy = null; + if ($instance->lti_version === LTI_VERSION_1P3) { + $key = $instance->client_id; + $secret = ''; + } + + $endpoint = $instance->toolurl; + $endpoint = trim($endpoint); + + $ltiversion = $instance->lti_version; + + $course = isset($module["course"]) ? $module["course"] : $PAGE->course; + $allparams = lti_build_request($instance, $typeconfig, $course); + $requestparams = $allparams; + $requestparams = array_merge($requestparams, lti_build_standard_message($instance, null, LTI_VERSION_1P3)); + $requestparams['user_id'] = $USER->username; // override the Moodle default - Kaltura session info should be the Moodle username. + + $customstr = ''; + if (isset($typeconfig['customparameters'])) { + $customstr = $typeconfig['customparameters']; + } + + // Add custom parameters + $requestparams['custom_publishdata'] = local_kaltura_get_kaf_publishing_data(); + $requestparams['custom_publishdata_encoded'] = '1'; + $requestparams['custom_moodle_plugin_version'] = local_kaltura_get_config()->version; + + $requestparams = array_merge($requestparams, lti_build_custom_parameters(null, $instance, (object)$module, $allparams, $customstr, + $instance->instructorcustomparameters, null)); + + $launchcontainer = lti_get_launch_container($instance, $typeconfig); + $returnurlparams = array('course' => $course->id, + 'launch_container' => $launchcontainer, + 'instanceid' => $instance->id, + 'editor' => $editor, + 'sesskey' => sesskey()); + + // Add the return URL. We send the launch container along to help us avoid frames-within-frames when the user returns. + $url = new \moodle_url('/local/kaltura/service.php', $returnurlparams); + $returnurl = $url->out(false); + + if (isset($typeconfig['forcessl']) && ($typeconfig['forcessl'] == '1')) { + $returnurl = lti_ensure_url_is_https($returnurl); + } + + $target = ''; + switch($launchcontainer) { + case LTI_LAUNCH_CONTAINER_EMBED: + case LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS: + $target = 'iframe'; + break; + case LTI_LAUNCH_CONTAINER_REPLACE_MOODLE_WINDOW: + $target = 'frame'; + break; + case LTI_LAUNCH_CONTAINER_WINDOW: + $target = 'window'; + break; + } + if (!empty($target)) { + $requestparams['launch_presentation_document_target'] = $target; + } + + $requestparams['launch_presentation_return_url'] = $returnurl; + + $serviceurl = new moodle_url('/local/kaltura/service.php'); + $requestparams['lis_outcome_service_url'] = $serviceurl->out(false); + + if ((!empty($key) && !empty($secret)) || ($ltiversion === LTI_VERSION_1P3)) { + if ($ltiversion !== LTI_VERSION_1P3) { + $parms = lti_sign_parameters($requestparams, $endpoint, 'POST', $key, $secret); + } else { + $parms = lti_sign_jwt($requestparams, $endpoint, $key, $instance->resourcekey, $nonce); + } + + $endpointurl = new \moodle_url($endpoint); + $endpointparams = $endpointurl->params(); + + // Strip querystring params in endpoint url from $parms to avoid duplication. + if (!empty($endpointparams) && !empty($parms)) { + foreach (array_keys($endpointparams) as $paramname) { + if (isset($parms[$paramname])) { + unset($parms[$paramname]); + } + } + } + + } else { + // If no key and secret, do the launch unsigned. + $returnurlparams['unsigned'] = '1'; + $parms = $requestparams; + } + + return array($endpoint, $parms); +} + +/** + * Writes data to the log table. + * @param string $module The module where the request originated from. + * @param string $endpoint The URL the request went out to. + * @param array $data All parameters used to created the request. + * @param bool $request Set to true if this is a request. Set to false if it is a response. + * @return bool True if the log entry was created. Otherwise false. + */ +function local_kaltura_log_data($module, $endpoint, $data, $request = true) { + global $DB; + + if (!is_array($data)) { + return false; + } + + $record = new stdClass(); + $record->type = KALTURA_LOG_RESPONSE; + + // If this is a request being sent out, validate the module and make sure it is a supported module. + if (!empty($request)) { + // Validate whether the module is one that is supported. + if (!local_kaltura_validate_kaf_module_request($module)) { + return false; + } + + $record->type = KALTURA_LOG_REQUEST; + } + + $record->module = $module; + $record->timecreated = time(); + $record->endpoint = $endpoint; + $record->data = serialize($data); + $DB->insert_record('local_kaltura_log', $record); + + return true; +} + +/** + * This functions removes the HTTP protocol and the trailing slash from a URI. + * @param string $uri The URI to format. + * @return string The formatted URI with the protocol and trailing slash removed. + */ +function local_kaltura_format_uri($uri) { + $newuri = str_replace('https://', '', $uri); + $newuri = str_replace('http://', '', $newuri); + $newuri = str_replace('www.', '', $newuri); + $newuri = rtrim($newuri, '/'); + return $newuri; +} + +/** + * This function creates a JSON string of the courses the user is enrolled in and the LTI roles the user has in the course. + * The JSON string is cached in the user's session global for efficiency purposes. + * @return string A JSON data structure outlining the user's LTI roles in all of their enroled courses. + */ +function local_kaltura_get_kaf_publishing_data() { + global $USER, $SITE; + + $role = is_siteadmin($USER->id) ? KALTURA_LTI_ADMIN_ROLE : KALTURA_LTI_INSTRUCTOR_ROLE; + $json = new stdClass(); + $json->courses = array(); + $hascap = false; + + // If the user is not an admin then retrieve all of the user's enroled courses. + if (KALTURA_LTI_ADMIN_ROLE != $role) { + $courses = enrol_get_users_courses($USER->id, true, 'id,fullname,shortname', 'fullname ASC'); + } else { + // Calling refactored code that allows for a limit on the number of courses returned. + $courses = local_kaltura_get_user_capability_course('moodle/course:manageactivities', $USER->id, true, 'id,fullname,shortname', 'fullname ASC'); + } + + foreach ($courses as $course) { + if ($course->id === $SITE->id) { + // Don't want to include the site id in this list + continue; + } + + if (KALTURA_LTI_ADMIN_ROLE != $role) { + // Check if the user has the manage capability in the course. + $hascap = has_capability('moodle/course:manageactivities', context_course::instance($course->id), $USER->id, false); + $role = $hascap ? KALTURA_LTI_INSTRUCTOR_ROLE : KALTURA_LTI_LEARNER_ROLE; + } + + // The properties must be nameed "courseId", "courseName" and "roles". + $data = new stdClass(); + $data->courseId = $course->id; + $data->courseName = $course->fullname; + $data->courseShortName = $course->shortname; + $data->roles = $role; + $json->courses[$course->id] = $data; + } + + // Return an array with no pre-defined keys to structure the JSON the way Kaltura needs it to be. + $json->courses = array_values($json->courses); + + return base64_encode(json_encode($json)); +} + +/** + * NOTE: This function is refactored from @see get_user_capability_course() from accesslib.php. The difference is the ability to + * limit the number of records returned. + * + * This function gets the list of courses that this user has a particular capability in. + * It is still not very efficient. + * + * @param string $capability Capability in question. + * @param int $userid User ID or null for current user. + * @param bool $doanything True if 'doanything' is permitted (default). + * @param string $fieldsexceptid Leave blank if you only need 'id' in the course records; + * otherwise use a comma-separated list of the fields you require, not including id. + * @param string $orderby If set, use a comma-separated list of fields from course + * table with sql modifiers (DESC) if needed. + * @param string $limit Limit the set of data returned. + * @return array Array of courses, may have zero entries. Or false if query failed. + */ +function local_kaltura_get_user_capability_course($capability, $userid = null, $doanything = true, $fieldsexceptid = '', $orderby = '', $limit = 200) { + global $DB; + + // Convert fields list and ordering. + $fieldlist = ''; + if ($fieldsexceptid) { + $fields = explode(',', $fieldsexceptid); + foreach($fields as $field) { + $fieldlist .= ',c.'.$field; + } + } + if ($orderby) { + $fields = explode(',', $orderby); + $orderby = ''; + foreach($fields as $field) { + if ($orderby) { + $orderby .= ','; + } + $orderby .= 'c.'.$field; + } + $orderby = 'ORDER BY '.$orderby; + } + + // Obtain a list of everything relevant about all courses including context. + // Note the result can be used directly as a context (we are going to), the course + // fields are just appended. + + $contextpreload = context_helper::get_preload_record_columns_sql('x'); + + $courses = array(); + $sql = "SELECT c.id $fieldlist, $contextpreload + FROM {course} c + JOIN {context} x ON (c.id=x.instanceid + AND x.contextlevel=".CONTEXT_COURSE.") + $orderby"; + $rs = $DB->get_recordset_sql($sql, null, 0, $limit); + + // Check capability for each course in turn. + foreach ($rs as $course) { + context_helper::preload_from_record($course); + $context = context_course::instance($course->id); + if (has_capability($capability, $context, $userid, $doanything)) { + // We've got the capability. Make the record look like a course record + // and store it + $courses[] = $course; + } + } + $rs->close(); + return empty($courses) ? array() : $courses; +} + +/** + * This function gets the local configuration and sanitizes the settings. + * @return object Returns object containing configuration settings for kaltura local plugin. + */ +function local_kaltura_get_config() { + $configsettings = get_config(KALTURA_PLUGIN_NAME); + if (empty($configsettings->kaf_uri)) { + $configsettings->kaf_uri = ""; + } + // If a https url is needed for kaf_uri it should be entered into the kaf_uri setting as https://. + if (!empty($configsettings->kaf_uri) && !preg_match('#^https?://#', $configsettings->kaf_uri)) { + $configsettings->kaf_uri = 'http://'.$configsettings->kaf_uri; + } + + if (!empty($configsettings->kaf_uri) && $configsettings->lti_version == LTI_VERSION_1P3) { + $configsettings->public_keyset_url = $configsettings->kaf_uri . '/hosted/index/lti-advantage-key-set'; + $configsettings->launch_url = $configsettings->kaf_uri . '/hosted/index/oidc-init'; + $configsettings->redirection_uris = $configsettings->kaf_uri . '/hosted/index/oauth2-launch'; + } + + return $configsettings; +} + +/** + * This functions checks if a URL contains the host name that is configiured for the plug-in. + * @param string $url The URL to validate. + * @return bool Returns true if the URL contains the configured host name. Otherwise false. + */ +function local_kaltura_url_contains_configured_hostname($url) { + $configuration = local_kaltura_get_config(); + $configuri = local_kaltura_format_uri($configuration->kaf_uri); + + if (empty($configuri)) { + return false; + } + $position = strpos($url, $configuri); + if (false === $position) { + return false; + } + + return true; +} + +/** + * This function returns the URL parameter with a protocol prefixed, if non was detected. http:// is used by default if no protocol is found. + * @param string $url The URL to verify. + * @return string Returns the URL with the protocol. An empty string is returned in the case of an exception being thrown. + */ +function local_kaltura_add_protocol_to_url($url) { + $newurl = ''; + if (0 === strpos($url, 'https://')) { + $newurl = $url; + } else if (0 === strpos($url, 'http://')) { + $newurl = $url; + } else { + $newurl = 'http://'.$url; + } + + try { + $newurl = validate_param($newurl, PARAM_URL); + } catch (invalid_parameter_exception $e) { + return ''; + } + + return $newurl; +} + +/** + * This function searlizes an object or array and base 64 encodes it for storage into a table. + * @param array|object $object An object or array. + * @return string A base 64 encoded string of the parameter. + */ +function local_kaltura_encode_object_for_storage($object) { + // Check if the parameter either an object or array of if it's empty. + $data = $object; + if (!is_array($data)) { + $data = (array) $data; + } + + if (empty($data) || (!is_array($object) && !is_object($object))) { + return ''; + } + + return base64_encode(serialize($object)); +} + +/** + * This function base 64 decodes and unsearlizes an object. + * @param string $object A base 64 encoded string. + * @return array|object An array or object. + */ +function local_kaltura_decode_object_for_storage($object) { + // Check if the parameter is empty. + if (empty($object)) { + return ''; + } + + return unserialize(base64_decode($object)); +} + +/** + * This function takes a KalturaMediaEntry or KalturaDataEntry object and converts it into a Moodle metadata object. + * @param KalturaMediaEntry $object A KalturaMediaEntry object + * @return object|bool A slimed down version of the KalturaMediaEntry object, with slightly different object property names. Or false if an error was found. + */ +function local_kaltura_convert_kaltura_base_entry_object($object) { + $metadata = new stdClass; + + if ($object instanceof KalturaMediaEntry) { + + $metadata->url = ''; + $metadata->dataurl = $object->dataUrl; + $metadata->width = $object->width; + $metadata->height = $object->height; + $metadata->entryid = $object->id; + $metadata->title = $object->name; + $metadata->thumbnailurl = $object->thumbnailUrl; + $metadata->duration = $object->duration; + $metadata->description = $object->description; + $metadata->createdat = $object->createdAt; + $metadata->owner = $object->creatorId; + $metadata->tags = $object->tags; + $metadata->showtitle = 'on'; + $metadata->showdescription = 'on'; + $metadata->showowner = 'on'; + $metadata->player = ''; + $metadata->size = ''; + } else if ($object instanceof KalturaDataEntry) { + + $metadata->url = ''; + $metadata->dataurl = ''; + $metadata->url = ''; + $metadata->width = 0; + $metadata->height = 0; + $metadata->entryid = $object->id; + $metadata->title = $object->name; + $metadata->thumbnailurl = $object->thumbnailUrl; + $metadata->duration = 0; + $metadata->description = $object->description; + $metadata->createdat = $object->createdAt; + $metadata->owner = $object->creatorId; + $metadata->tags = $object->tags; + $metadata->showtitle = 'on'; + $metadata->showdescription = 'on'; + $metadata->showowner = 'on'; + $metadata->player = ''; + $metadata->size = ''; + } else { + $metadata = false; + } + + return $metadata; +} + +function local_kaltura_build_kaf_uri($source_url) { + $kaf_uri = local_kaltura_get_config()->kaf_uri; + $parsed_source_url = parse_url($source_url); + if ($parsed_source_url['host'] == KALTURA_URI_TOKEN) { + return $source_url; + } + if(!empty($parsed_source_url['path'])) { + $kaf_uri = parse_url($kaf_uri); + $source_host_and_path = $parsed_source_url['host'] . $parsed_source_url['path']; + $kaf_uri_host_and_path = $kaf_uri['host'] . (isset($kaf_uri['path']) ? $kaf_uri['path'] : ''); + + $source_url = str_replace($kaf_uri_host_and_path, '', $source_host_and_path); + $source_url = 'http://' . KALTURA_URI_TOKEN . $source_url; + } + + return $source_url; +} diff --git a/local/kaltura/migration.php b/local/kaltura/migration.php new file mode 100644 index 0000000000000..d75fd30c38717 --- /dev/null +++ b/local/kaltura/migration.php @@ -0,0 +1,117 @@ +. + +/** + * Migration page. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once('../../config.php'); +require_once($CFG->dirroot.'/local/kaltura/migration_form.php'); +require_once('locallib.php'); +require_once('API/KalturaClient.php'); +require_once($CFG->libdir.'/xmldb/xmldb_object.php'); +require_once($CFG->libdir.'/xmldb/xmldb_table.php'); +require_once('migrationlib.php'); + +$url = new moodle_url('/local/kaltura/migration.php'); +$context = context_system::instance(); +$heading = get_string('migration_header', 'local_kaltura'); +$site = get_site(); + +$PAGE->navbar->add(get_string('administrationsite')); +$PAGE->navbar->add(get_string('plugins', 'admin')); +$PAGE->navbar->add(get_string('localplugins')); +$PAGE->navbar->add(get_string('pluginname', 'local_kaltura'), new moodle_url('/admin/settings.php', array('section' => 'local_kaltura'))); +$PAGE->navbar->add(get_string('migration_header', 'local_kaltura')); + +$PAGE->set_url($url); +$PAGE->set_context($context); + +$PAGE->set_pagelayout('standard'); +$PAGE->set_pagetype('local-kaltura-migration'); +$PAGE->set_title($heading); +$PAGE->set_heading($site->fullname); + +require_login(null, false); + +require_capability('local/kaltura:migrate_data', $context); + +$url = new moodle_url('/admin/settings.php', array('section' => 'local_kaltura')); + +$form = new local_kaltura_migration_form(); +$redirectmessage = ''; + +if ($data = $form->get_data()) { + // User hit cancel. Redirect them back to the settings page. + if (isset($data->cancel)) { + redirect($url); + } + + require_sesskey(); + $migrationstats = new local_kaltura_migration_progress(); + + // User hit submit button. Check for records since the configured date. + if (isset($data->submitbutton)) { + if(local_kaltura_get_channels_id(local_kaltura_get_kaltura_client(), $data->kafcategory) === false) + { + $url = new moodle_url('/admin/settings.php', array('section' => 'local_kaltura')); + notice("Selected target root category does not have a KAF structure (subcategory '>site>channels' is missing)", $url); + } + // Set the migration start time and initialize the KAF root category id. + if (0 == local_kaltura_migration_progress::get_migrationstarted()) { + local_kaltura_migration_progress::init_migrationstarted(); + local_kaltura_migration_progress::set_kafcategoryrootid($data->kafcategory); + } + + // An array mapping of old categories to new categories. + $cachedcategories = array(); + + // Migrate entries that belong to categories under the old rood category. + list($categoryentries, $cachedcategories) = local_kaltura_move_entries_to_kaf_category_tree($data->kafcategory, 1); + // Migrate entries that are associated with the old profile id and contain metadata. + $metadataentries = local_kaltura_move_metadata_entries_to_kaf_category_tree($data->kafcategory, 1); + $redirectmessage = get_string('migration_has_stopped', 'local_kaltura'); + + // Update the Kaltura activities. + local_kaltura_update_activities(); + local_kaltura_set_activities_entries_to_categories(); + + // If both variables are null, then there is nother more to migrate. + if (is_null($categoryentries) && is_null($metadataentries)) { + // Hide migration is needed message on settings page. + set_config('migration_yes', 0, KALTURA_PLUGIN_NAME); + $redirectmessage = get_string('migration_complete_redirect', 'local_kaltura'); + } + } else if (isset($data->startover)) { + local_kaltura_migration_progress::reset_all(); + $redirectmessage = get_string('migration_start_over_redirect', 'local_kaltura'); + } + + $migrationurl = new moodle_url('/local/kaltura/migration.php'); + redirect($migrationurl, $redirectmessage, 5); +} + +local_kaltura_retrieve_repository_settings(); + +echo $OUTPUT->header(); +echo $OUTPUT->heading(get_string('migration_header', 'local_kaltura')); +$form->display(); +echo $OUTPUT->footer(); diff --git a/local/kaltura/migration_form.php b/local/kaltura/migration_form.php new file mode 100644 index 0000000000000..c12ec9193908f --- /dev/null +++ b/local/kaltura/migration_form.php @@ -0,0 +1,77 @@ +. + +/** + * Migrate data form. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +defined('MOODLE_INTERNAL') || die; + +require_once($CFG->libdir.'/formslib.php'); + +/** + * Download Kaltura logs form class. + */ +class local_kaltura_migration_form extends moodleform { + /** + * This function defines the elements on the form. + */ + public function definition() { + $mform =& $this->_form; + + $categories = local_kaltura_get_categories(); + $migrationstats = new local_kaltura_migration_progress(); + + $mform->addElement('header', 'setup', get_string('options')); + + // If was never started, print a status message, otherwise print the date the migration originally started. + $notstarted = get_string('migration_not_started', 'local_kaltura'); + $startedtimestamp = local_kaltura_migration_progress::get_migrationstarted(); + $datestarted = userdate($startedtimestamp); + $message = empty($startedtimestamp) ? $notstarted : $datestarted; + + // Print more stats on the current state of the migration. + $mform->addElement('static', 'migration_start_time', get_string('migration_start_time', 'local_kaltura'), $message); + $mform->addElement('static', 'entries_migrated', get_string('entries_migrated', 'local_kaltura'), local_kaltura_migration_progress::get_entriesmigrated()); + $mform->addElement('static', 'categories created', get_string('categories_created', 'local_kaltura'), local_kaltura_migration_progress::get_categoriescreated()); + + $buttonarray = array(); + + $mform->addElement('select', 'kafcategory', get_string('migration_select_a_category', 'local_kaltura'), $categories); + + $catid = local_kaltura_migration_progress::get_kafcategoryrootid(); + + // If the migration was started perviously, then prevent the user from chaning the migration category by disabling the drop down, but setting the default value. + $migrationstarted = local_kaltura_migration_progress::get_migrationstarted(); + if (!empty($migrationstarted) && !empty($catid) && isset($categories[$catid])) { + $mform->addElement('hidden', 'disabledropdown', $catid); + $mform->setType('disabledropdown', PARAM_INT); + + $mform->setDefault('kafcategory', $catid); + $mform->disabledIf('kafcategory', 'disabledropdown', 'eq', $catid); + } + + $buttonarray[] =& $mform->createElement('submit', 'submitbutton', get_string('migration_start_continue', 'local_kaltura')); + $buttonarray[] =& $mform->createElement('submit', 'startover', get_string('startover', 'local_kaltura')); + $buttonarray[] =& $mform->createElement('submit', 'cancel', get_string('back')); + $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false); + } +} diff --git a/local/kaltura/migrationlib.php b/local/kaltura/migrationlib.php new file mode 100644 index 0000000000000..f99f4e1d29044 --- /dev/null +++ b/local/kaltura/migrationlib.php @@ -0,0 +1,1261 @@ +. + +/** + * Kaltura migration functions. The migration consists of two parts. The first part is retrieving all Kaltura media entries that were created anytime before + * the current date; associate those entries to a different category structure used by the KAF instance. The second part is to look at the metadata for the + * Kaltura entry and associate the entry to a category structure used by the KAF instance. Some Kaltura entries may have been uploaded but never used within + * a Moodle course, so this is the reason why we must initially retrieve all entries by created date and not by Kaltura category . + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +/* This constant is used in the recursive functions as a hard stop flag. The recursive functions will not go any deeper than this value. */ +define('KALTURA_MIGRATION_HARD_STOP', 5); +/* Constants used for padding height and witch values when migrating kaltura entries for video resource, presentation and media assignment. */ +define('KALTURA_MIGRATION_HEIGHT_PADDING', 100); +define('KALTURA_MIGRATION_WIDTH_PADDING', 50); +define('KALTURA_MIGRATION_DEFAULT_HEIGHT', 285); +define('KALTURA_MIGRATION_DEFAULT_WIDTH', 400); + +/** + * This function creates a connection to Kaltura. + * @return KalturaConfiguration A Kaltura client object. + */ +function local_kaltura_get_kaltura_client() { + global $USER; + + static $client = null; + + if (!is_null($client)) { + return $client; + } + + $configsettings = get_config(KALTURA_PLUGIN_NAME); + $config = new KalturaConfiguration($configsettings->partner_id); + $client = new KalturaClient($config); + + try { + $ks = $client->generateSession($configsettings->adminsecret, $USER->id, KalturaSessionType::ADMIN, $configsettings->partner_id); + $client->setKs($ks); + } catch (Exception $ex) { + $url = new moodle_url('/admin/settings.php', array('section' => 'local_kaltura')); + notice(get_string('migration_cannot_connect', 'local_kaltura'), $url); + } + + return $client; +} + + +/** + * Writes data to the log table. + * @param string $method The method where the log originated from. + * @param array $data relevant information to be written to log. + */ +function local_kaltura_migration_log_data($method, $data = null) { + global $DB; + + $record = new stdClass(); + $record->type = 'MIG'; + $record->module = 'Kalturamigration'; + $record->timecreated = time(); + $record->endpoint = $method; + $record->data = serialize($data); + $DB->insert_record('local_kaltura_log', $record); + + return true; +} + +/** + * This function validates that a root category and a profile id have set. The root category is then queried to find a category id. + */ +function local_kaltura_retrieve_repository_settings() { + local_kaltura_migration_log_data(__FUNCTION__, array( + 'getting repository settings', + )); + $rootcategoryid = get_config(KALTURA_PLUGIN_NAME, 'migration_source_category'); + $metadataprofileid = get_config(KALTURA_PLUGIN_NAME, 'migration_metadata_profile_id'); + + // If the root category id configuration option is empty, try to retrieve the value from the repository config settings. + if (empty($rootcategoryid)) { + $rootcategoryid = get_config(KALTURA_REPO_NAME, 'rootcategory_id'); + + if (empty($rootcategoryid)) { + //notice(get_string('migration_root_category_not_set', 'local_kaltura')); + set_config('migration_source_category', -1, KALTURA_PLUGIN_NAME); + } + + set_config('migration_source_category', $rootcategoryid, KALTURA_PLUGIN_NAME); + } + + // If the metdata profile id configuration option is empty, try to retrieve the value from the repository config settings. + if (empty($metadataprofileid)) { + $metadataprofileid = get_config(KALTURA_REPO_NAME, 'metadata_profile_id'); + + if (empty($metadataprofileid)) { + //notice(get_string('migration_profile_id_not_set', 'local_kaltura')); + set_config('migration_metadata_profile_id', -1, KALTURA_PLUGIN_NAME); + } + + set_config('migration_metadata_profile_id', $metadataprofileid, KALTURA_PLUGIN_NAME); + } +} + +/** + * This function returns an array of all of the Kaltura categories. + * + * @return array An array of Kaltura category names. + */ +function local_kaltura_get_categories() { + static $list = array(); + + $client = local_kaltura_get_kaltura_client(); + $filter = null; + $pager = null; + + if (empty($list)) { + // Get a list of Kaltura categories. + $result = $client->category->listAction($filter, $pager); + + if ($result instanceof KalturaCategoryListResponse && 0 < count($result->objects)) { + foreach ($result->objects as $category) { + $list[$category->id] = $category->name; + } + asort($list); + } + } + + local_kaltura_migration_log_data(__FUNCTION__, $list); + + return $list; +} + +/** + * This function retrieves all Kaltura entries that were created before a specified date; and moves the entries to the new KAF category location. + * @param int $targetparentcatid The root category id configured for the KAF instance. + * @param int $index The page number to return from the paged API output. + * @param int $numofentries The number of entries to return from the API with. + * @return array An array whose index is the Kaltura entry id and value is an array of Kaltura category ids. + */ +function local_kaltura_move_entries_to_kaf_category_tree($targetparentcatid, $index = 1, $numofentries = 100) { + $rootcategoryid = get_config(KALTURA_PLUGIN_NAME, 'migration_source_category'); + if($rootcategoryid === -1) + { + // skip this part of the migration - repository was never configured in previous version + return true; + } + // The timestamp used to retrieve Kaltura entries that were created by or before the date. + static $createdby = 0; + // Which page is currently being processed. + static $pageindex = 1; + // The Kaltura plug-in settings variables. + static $reposettings = null; + // An array whose id is Kaltura entry ids; and value is an array of Kaltura category ids the entry belongs to. + static $entries = null; + // An object whose properties are: id - the 'channels' category id, fullname - the full path of the category. + static $channelscategory = null; + // An array of cached old to new category mappings. array(old category id => new category id). + static $cachedcategories = array(); + // An array of categories that currently exist on Kaltura. This is used to quickly retrieve the name of the category via the category id. + // Ex. array(old category id => category name). + static $currentcategories = null; + static $stop = 0; + + if (is_null($currentcategories)) { + $currentcategories = local_kaltura_get_categories(); + } + + // Retrieve the repository settings. + if (is_null($reposettings)) { + $reposettings = get_config(KALTURA_PLUGIN_NAME); + } + + // Set the timestamp for Kaltura entries created before the created by value. + if (empty($createdby)) { + $time = local_kaltura_migration_progress::get_existingcategoryrun(); + $createdby = empty($time) ? time() : $time; + } + + $client = local_kaltura_get_kaltura_client(); + + // Set the channels category ID. + if (is_null($channelscategory)) { + $channelscategory = local_kaltura_get_channels_id($client, $targetparentcatid); + } + + $pageindex = $index; + + // Create a Kaltura base filter object. + $filter = new KalturaBaseEntryFilter(); + $filter->categoryAncestorIdIn = $reposettings->migration_source_category; + $filter->createdAtLessThanOrEqual = $createdby; + $filter->orderBy = KalturaBaseEntryOrderBy::CREATED_AT_DESC; + + // Set page size and the page index. + $pager = new KalturaFilterPager(); + $pager->pageSize = $numofentries; + $pager->pageIndex = $pageindex; + + // Retrieve the Kaltura entry objects. + $result = $client->baseEntry->listAction($filter, $pager); + + // If the request was successful and the number of entries returned was greater than zero, get the old category ids and assign the entries them to the new KAF categories. + if ($result instanceof KalturaBaseEntryListResponse) { + if (0 < count($result->objects)) { + // Populate the entries array with key: entry id and value: an array of category ids the entry belongs to. + $entries = local_kaltura_get_entry_categories($client, $reposettings->migration_source_category, $result->objects); + + // Iterate over the array of entries and check if the category the entry belongs to has also been created under the new target category. + $cachedcategories = local_kaltura_assign_entries_to_new_categories($client, $entries, $channelscategory, $cachedcategories, $currentcategories); + + $lastentry = end($result->objects); + local_kaltura_migration_progress::set_existingcategoryrun($lastentry->createdAt - 1); + } else { + return null; + } + } + + // Increment the page index. + $pageindex++; + $stop++; + + // Check if the hard stop condition has reached. + if (KALTURA_MIGRATION_HARD_STOP == $stop) { + return array($entries, $cachedcategories); + } + + // Recusive call to retrieve the next set of Kaltura entries. + return local_kaltura_move_entries_to_kaf_category_tree($targetparentcatid, $pageindex, $numofentries); +} + +/** + * This function retrieves all Kaltura entries, created before a specified date and containing profile metadata; and moves the entries to the new KAF category location. + * @param int $targetparentcatid The root category id configured for the KAF instance. + * @param int $index The page number to return from the paged API output. + * @param int $numofentries The number of entries to return from the API with. + * @return array An array whose index is the Kaltura entry id and value is an array of Kaltura category ids. + */ +function local_kaltura_move_metadata_entries_to_kaf_category_tree($targetparentcatid, $index = 1, $numofentries = 100) { + $metadataprofileid = get_config(KALTURA_PLUGIN_NAME, 'migration_metadata_profile_id'); + if($metadataprofileid === -1) + { + // skip this part of the migration - repository was never configured in previous version + return true; + } + // The timestamp used to retrieve Kaltura entries that were created by or before the date. + static $createdby = 0; + // Which page is currently being processed. + static $pageindex = 1; + // The Kaltura plug-in settings variables. + static $reposettings = null; + // An array whose id is Kaltura entry ids; and value is an array of Kaltura category ids the entry belongs to. + static $entries = null; + // An object whose properties are: id - the 'channels' category id, fullname - the full path of the category. + static $channelscategory = null; + // An object whose properties are: id - the 'Shared Repository' category id, fullname - the full path of the category. + static $sharedrepocategory = null; + // An array of cached old to new category mappings. array(old category id => new category id). + static $cachedcategories = array(); + // An array of categories that currently exist on Kaltura. This is used to quickly retrieve the name of the category via the category id. + // Ex. array(old category id => category name). + static $currentcategories = null; + // A hard stop condition for the recursive method. + static $stop = 0; + + if (is_null($currentcategories)) { + $currentcategories = local_kaltura_get_categories(); + } + // Retrieve the repository settings. + if (is_null($reposettings)) { + $reposettings = get_config(KALTURA_PLUGIN_NAME); + } + + // Set the timestamp for Kaltura entries created before the created by value. + if (empty($createdby)) { + $time = local_kaltura_migration_progress::get_sharedcategoryrun(); + $createdby = empty($time) ? time() : $time; + } + + $client = local_kaltura_get_kaltura_client(); + + // Set the channels category ID. + if (is_null($channelscategory)) { + $channelscategory = local_kaltura_get_channels_id($client, $targetparentcatid); + } + + // Set the siteshared category ID. Using the channels category id as the parent. + if (is_null($sharedrepocategory)) { + $sharedrepocategory = local_kaltura_get_sharedrepo_id($client, $channelscategory->id, $targetparentcatid); + // Add the 'Shared Repository' category id to the array of cached categories. + $cachedcategories['sharedrepository'] = $sharedrepocategory->id; + } + + $pageindex = $index; + + // Retrieve all of the entries were created by a certain time and associated with a specific profile id. + $filter = new KalturaBaseEntryFilter(); + $filter->advancedSearch = new KalturaMetadataSearchItem(); + $filter->advancedSearch->type = KalturaSearchOperatorType::SEARCH_OR; + $filter->advancedSearch->metadataProfileId = $reposettings->migration_metadata_profile_id; + $filter->createdAtLessThanOrEqual = $createdby; + $filter->freeText = '*'; + $filter->orderBy = KalturaBaseEntryOrderBy::CREATED_AT_DESC; + + $pager = new KalturaFilterPager(); + $pager->pageSize = $numofentries; + $pager->pageIndex = $pageindex; + + $result = $client->baseEntry->listAction($filter, $pager); + + // If the request was successful and the number of entries returned was greater than zero, get the old category ids and assign the entries them to the new KAF categories. + if ($result instanceof KalturaBaseEntryListResponse) { + if (0 < count($result->objects)) { + // Populate the entries array with key: entry id and value: an array of category ids the entry belongs to. + list($entries, $currentcategories) = local_kaltura_get_entry_metadata($client, $result->objects, $reposettings->migration_metadata_profile_id, $currentcategories); + + // Iterate over the array of entries and check if the category the entry belongs to has also been created under the new target category. + $cachedcategories = local_kaltura_assign_entries_to_new_course_categories($client, $entries, $channelscategory, $cachedcategories, $currentcategories); + + // Get the date of the last processed entry and set the shared category run date. This allows the user to continue the migration exactly where the + // previous run left off. + $lastentry = end($result->objects); + local_kaltura_migration_progress::set_sharedcategoryrun($lastentry->createdAt - 1); + } else { + return null; + } + } + + // Increment the page index. + $pageindex++; + $stop++; + + // Check if the hard stop condition has reached. + if (KALTURA_MIGRATION_HARD_STOP == $stop) { + return $entries; + } + + // Recusive call to retrieve the next set of Kaltura entries. + return local_kaltura_move_metadata_entries_to_kaf_category_tree($targetparentcatid, $pageindex, $numofentries); +} + +/** + * This function assigns the Kaltura entries to the new KAF categories. + * Future TODO: Improve the progress tracking of this method, by inspecting the results of API calls and find entries that already existed but were part of a multi request. + * + * @param KalturaConfiguration $client A Kaltura client object. + * @param array $entries An array whose key is Kaltura entry ids and value is an array of category ids. + * @param int $parentcategory The 'channels' category object whose properties are id and fullname. + * @param array $cachedcategories An array of cateogires that have been created under the KAF root category. + * The array key is the category name and value is the category ids. + * @param array $currentcategories An array of current category ids and their names @see local_kaltura_get_categories() + * @return array An array of cateogires that have been created under the KAF root category. The array key is the category name and value is the category ids. + */ +function local_kaltura_assign_entries_to_new_categories($client, $entries, $parentcategory, $cachedcategories, $currentcategories) { + $newcategory = 0; + $counter = 1; + + foreach ($entries as $entryid => $entrycategories) { + foreach ($entrycategories as $oldcategoryid) { + // Check if the category exists in the cached categories. + if (isset($cachedcategories[$oldcategoryid])) { + // Check if the entry was already added to the 'InContext' category. If not then assign it to the category. + $filter = new KalturaCategoryEntryFilter(); + $filter->categoryIdEqual = $cachedcategories[$oldcategoryid]; + $filter->entryIdEqual = $entryid; + $pager = null; + $result = $client->categoryEntry->listAction($filter, $pager); + + if ($result instanceof KalturaCategoryEntryListResponse && 0 == $result->totalCount) { + // Assign the entry to the 'InContext' category. + $categoryentry = new KalturaCategoryEntry(); + $categoryentry->categoryId = $cachedcategories[$oldcategoryid]; + $categoryentry->entryId = $entryid; + try{ + $result = $client->categoryEntry->add($categoryentry); + } catch (Exception $ex) { + local_kaltura_migration_log_data(__FUNCTION__, array( + "failed adding entry to category", + $categoryentry->entryId, + $categoryentry->categoryId, + $ex->getCode(), + $ex->getMessage(), + base64_encode($ex->getTraceAsString()), + )); + } + local_kaltura_migration_progress::increment_entriesmigrated(); + } + } else { + // Get the name of the old root category. + $oldrootcategoryname = $currentcategories[$oldcategoryid]; + + // Check if the category exists under the KAF root matching on the category name. + $filter = new KalturaCategoryFilter(); + $filter->parentIdEqual = $parentcategory->id; + $filter->fullNameEqual = "{$parentcategory->fullname}>{$oldrootcategoryname}"; + $pager = null; + $result = $client->category->listAction($filter, $pager); + + // Cache the result or create a new category and cache the result. + if ($result instanceof KalturaCategoryListResponse && 1 == $result->totalCount) { + // Start multi-request, this will send multiple API calls as one batch request. + $client->startMultiRequest(); + // Get the 'InContext' sub category. + $filter = new KalturaCategoryFilter(); + $filter->parentIdEqual = $result->objects[0]->id; + $pager = null; + $client->category->listAction($filter, $pager); + + // Assign the entry to the 'InContext' sub category. + $categoryentry = new KalturaCategoryEntry(); + $categoryentry->categoryId = '{1:result:objects:0:id}'; + $categoryentry->entryId = $entryid; + $client->categoryEntry->add($categoryentry); + + $multirequest = $client->doMultiRequest(); + + local_kaltura_migration_progress::increment_entriesmigrated(); + + // Cache the mappting between the old category id and the 'InContext' category id. + $cachedcategories[$oldcategoryid] = $multirequest[0]->objects[0]->id; + } else { + // Start multi-request, this will send multiple API calls as one batch request. + $client->startMultiRequest(); + + $category = new KalturaCategory(); + $category->parentId = $parentcategory->id; + $category->name = $oldrootcategoryname; + $category->moderation = KalturaNullableBoolean::TRUE_VALUE; + $client->category->add($category); + + // Create the 'InContext' category under the new category. + $category = new KalturaCategory(); + $category->name = 'InContext'; + $category->parentId = '{1:result:id}'; + $category->moderation = KalturaNullableBoolean::TRUE_VALUE; + $client->category->add($category); + + $categoryentry = new KalturaCategoryEntry(); + $categoryentry->categoryId = '{2:result:id}'; + $categoryentry->entryId = $entryid; + $client->categoryEntry->add($categoryentry); + + $multirequest = $client->doMultiRequest(); + + local_kaltura_migration_progress::increment_entriesmigrated(); + // Increment categories twice. Once for the course name, the other for the 'InContext'. + local_kaltura_migration_progress::increment_categoriescreated(); + local_kaltura_migration_progress::increment_categoriescreated(); + + // Cache the mappting between the old category id and the 'InContext' category id. + $cachedcategories[$oldcategoryid] = $multirequest[1]->id; + } + } + } + } + return $cachedcategories; +} + +/** + * This is a refactored function of @see local_kaltura_assign_entries_to_new_categories(). The difference is that this adds a Kaltura media to the category + * Kaltura course category and not the 'InContext' sub-category of the course category. + * Future TODO: Improve the progress tracking of this method, by inspecting the results of API calls and find entries that already existed but were part of a multi request. + * + * @param KalturaConfiguration $client A Kaltura client object. + * @param array $entries An array whose key is Kaltura entry ids and value is an array of category ids. + * @param int $parentcategory The 'channels' category object whose properties are id and fullname. + * @param array $cachedcategories An array of cateogires that have been created under the KAF root category. + * The array key is the category name and value is the category ids. + * @param array $currentcategories An array of current category ids and their names @see local_kaltura_get_categories() + * @return array An array of cateogires that have been created under the KAF root category. The array key is the category name and value is the category ids. + */ +function local_kaltura_assign_entries_to_new_course_categories($client, $entries, $parentcategory, $cachedcategories, $currentcategories) { + $newcategory = 0; + $counter = 1; + + // Check if $entries is an array. + if (!is_array($entries)) { + return $cachedcategories; + } + + foreach ($entries as $entryid => $entrycategories) { + foreach ($entrycategories as $oldcategoryid) { + // Check if the course category exists in the cached categories. + if (isset($cachedcategories[$oldcategoryid])) { + // Check if the entry was already added to the course category. If not then assign it to the category. + $filter = new KalturaCategoryEntryFilter(); + $filter->categoryIdEqual = $cachedcategories[$oldcategoryid]; + $filter->entryIdEqual = $entryid; + $pager = null; + $result = $client->categoryEntry->listAction($filter, $pager); + + if ($result instanceof KalturaCategoryEntryListResponse && 0 == $result->totalCount) { + // Assign the entry to the course category. + $categoryentry = new KalturaCategoryEntry(); + $categoryentry->categoryId = $cachedcategories[$oldcategoryid]; + $categoryentry->entryId = $entryid; + try{ + $client->categoryEntry->add($categoryentry); + } catch (Exception $ex) { + local_kaltura_migration_log_data(__FUNCTION__, array( + "failed adding entry to category line: ".__LINE__, + $categoryentry->entryId, + $categoryentry->categoryId, + $ex->getCode(), + $ex->getMessage(), + base64_encode($ex->getTraceAsString()), + )); + } + + local_kaltura_migration_progress::increment_entriesmigrated(); + } + } else { + // Get the name of the old root category. + $oldrootcategoryname = $currentcategories[$oldcategoryid]; + + // Check if the category exists under the KAF root matching on the category name. + $filter = new KalturaCategoryFilter(); + $filter->parentIdEqual = $parentcategory->id; + $filter->fullNameEqual = "{$parentcategory->fullname}>{$oldrootcategoryname}"; + $pager = null; + $result = $client->category->listAction($filter, $pager); + + // Cache the result or create a new category and cache the result. + if ($result instanceof KalturaCategoryListResponse && 1 == $result->totalCount) { + + // Assign the entry to the course category. + $categoryentry = new KalturaCategoryEntry(); + $categoryentry->categoryId = $result->objects[0]->id; + $categoryentry->entryId = $entryid; + try{ + $categoryresult = $client->categoryEntry->add($categoryentry); + } catch (Exception $ex) { + local_kaltura_migration_log_data(__FUNCTION__, array( + "failed adding entry to category line: ".__LINE__, + $categoryentry->entryId, + $categoryentry->categoryId, + $ex->getCode(), + $ex->getMessage(), + base64_encode($ex->getTraceAsString()), + )); + $categoryresult = null; + } + + // If the result is a KalturaCategoryEntry then cache the category id. + if ($categoryresult instanceof KalturaCategoryEntry) { + // Cache the mapping between the old category id and the course category id. + $cachedcategories[$oldcategoryid] = $categoryresult->categoryId; + + local_kaltura_migration_progress::increment_entriesmigrated(); + } + } else { + // Start multi-request, this will send multiple API calls as one batch request. + $client->startMultiRequest(); + + $category = new KalturaCategory(); + $category->parentId = $parentcategory->id; + $category->name = $oldrootcategoryname; + $category->moderation = KalturaNullableBoolean::TRUE_VALUE; + $client->category->add($category); + + // Add the Kaltura media to the new course category. + $categoryentry = new KalturaCategoryEntry(); + $categoryentry->categoryId = '{1:result:id}'; + $categoryentry->entryId = $entryid; + $client->categoryEntry->add($categoryentry); + + $multirequest = $client->doMultiRequest(); + + local_kaltura_migration_progress::increment_entriesmigrated(); + // Increment categories created. + local_kaltura_migration_progress::increment_categoriescreated(); + + // Cache the mappting between the old category id and the course category id. + $cachedcategories[$oldcategoryid] = $multirequest[0]->id; + } + } + } + } + return $cachedcategories; +} + +/** + * This function returns the 'channels' category id, using the KAF root category id as part of the filter. The 'channels' category is created + * automatically when the user creates a new KAF instance. This function only needs to determine the category id. It does not need to create it. + * @param KalturaConfiguration $client A Kaltura client object. + * @param int $rootcatid The KAF root category id. + * @return object|bool An object whose properties are id and fullname, or false it's not found. + */ +function local_kaltura_get_channels_id($client, $rootcatid) { + static $channelsCategoryObj = null; + + if(!is_null($channelsCategoryObj)) + { + return $channelsCategoryObj; + } + + // Retrieve the array of categories and get the name of the parent category. + $catnames = local_kaltura_get_categories(); + $parentcatname = $catnames[$rootcatid]; + + $filter = new KalturaCategoryFilter(); + $filter->ancestorIdIn = $rootcatid; + $filter->fullNameStartsWith = "$parentcatname>site>channels"; + $pager = null; + $result = $client->category->listAction($filter, $pager); + + if ($result instanceof KalturaCategoryListResponse && 0 < $result->totalCount) { + $category = new stdClass(); + $category->id = $result->objects[0]->id; + $category->fullname = "$parentcatname>site>channels"; + + $channelsCategoryObj = $category; + return $category; + } else { + return false; + } +} + +/** + * This function returns the 'Shared Repository' category id, using the channels category id as part of the filter. If the the category doesn't exist + * then is must be created. + * @param KalturaConfiguration $client A Kaltura client object. + * @param int $channelsid The channels category id. + * @param int $rootcatid The KAF root category id. + * @return object|bool An object whose properties are id and fullname. + */ +function local_kaltura_get_sharedrepo_id($client, $channelsid, $rootcatid) { + // Retrieve the array of categories and get the name of the parent category. + $catnames = local_kaltura_get_categories(); + $parentcatname = $catnames[$rootcatid]; + $siterepocat = new stdClass(); + + $filter = new KalturaCategoryFilter(); + $filter->parentIdEqual = $channelsid; + $filter->fullNameStartsWith = "$parentcatname>site>channels>Shared Repository"; + $pager = null; + $result = $client->category->listAction($filter, $pager); + + // If he category already exists. + if ($result instanceof KalturaCategoryListResponse && 0 < $result->totalCount) { + $siterepocat->id = $result->objects[0]->id; + $siterepocat->fullname = $result->objects[0]->fullName; + return $siterepocat; + } else { + // Create 'Shared Repository' category. + $category = new KalturaCategory(); + $category->parentId = $channelsid; + $category->name = 'Shared Repository'; + $category->moderation = KalturaNullableBoolean::TRUE_VALUE; + try { + $result = $client->category->add($category); + } catch (Exception $ex) { + if($ex->getCode() == 'DUPLICATE_CATEGORY') + { + local_kaltura_migration_log_data(__FUNCTION__, array( + "category already exists", + $category, + $ex->getCode(), + $ex->getMessage(), + base64_encode($ex->getTraceAsString()), + )); + // nothing to do - category exists is a good thing + } + else { + local_kaltura_migration_log_data(__FUNCTION__, array( + "failed adding category", + $category, + $ex->getCode(), + $ex->getMessage(), + base64_encode($ex->getTraceAsString()), + )); + //throw $ex; // not throwing exception. always writing to log. + } + } + + + if ($result instanceof KalturaCategory) { + $siterepocat->id = $result->id; + $siterepocat->fullname = $result->fullName; + } + + local_kaltura_migration_progress::increment_categoriescreated(); + + return $siterepocat; + } +} + +/** + * This function retreives the custom metadata associated with a Kaltura entry. + * @param KalturaConfiguration $client A Kaltura client object. + * @param KalturaBaseEntryListResponse $entrylist An array of Kaltura entry objects. + * @param int $profileid A profile id. + * @param array $currentcategories An array of current category ids and their names @see local_kaltura_get_categories() + * @return Array An array. The first index is an array of Kaltura entry ids array(kaltura entry id => array(categories)). The second index + * is an array of current courses that will need to be created array(old category id => old category name). + */ +function local_kaltura_get_entry_metadata($client, $entrylist, $profileid, $currentcategories) { + $entries = array(); + $categories = array(); + + // Start multi-request, this will send multiple API calls as one batch request. + $client->startMultiRequest(); + + // Iterate ver each entry. Add it to the entries array (setting the entryid as the key), then retrieve the categories the entry belongs to. + foreach ($entrylist as $entry) { + // Call an API function to return all of the categories the entry belongs to. + $entries[$entry->id] = array(); + + $filter = new KalturaMetadataFilter(); + $filter->metadataProfileIdEqual = $profileid; + $filter->metadataObjectTypeEqual = KalturaMetadataObjectType::ENTRY; + $filter->objectIdEqual = $entry->id; + $pager = null; + $metadataplugin = KalturaMetadataClientPlugin::get($client); + $metadataplugin->metadata->listAction($filter, $pager); + } + + $multirequest = $client->doMultiRequest(); + + if (is_array($multirequest)) { + foreach ($multirequest as $metadatalists) { + if (is_array($metadatalists->objects)) { + foreach ($metadatalists->objects as $entrymetadata) { + // Get the metadata XML. + $xml = new SimpleXMLElement($entrymetadata->xml); + if (isset($xml->CourseShare)) { + $tempcat = (array) $xml->CourseShare; + // Add each category to the current categories array, as it will be required by the @see local_kaltura_assign_entries_to_new_categories(). + // With course shared metadata, the category may not actually exist yet. So insert a place holder that can be easily referenced in later functions. + foreach ($tempcat as $categoryname) { + $currentcategories["cs_$categoryname"] = $categoryname; + $categories[] = "cs_$categoryname"; + } + } + + if (1 == $xml->SystemShare) { + $categories[] = 'sharedrepository'; + } + + $entries[$entrymetadata->objectId] = $categories; + $categories = array(); + } + } + } + } + return array($entries, $currentcategories); +} + +/** + * This function retrieves all of the categories belonging to a Kaltura entry. + * @param KalturaConfiguration $client A Kaltura client object. + * @param int $rootcategoryid The Kaltura root category id. + * @param KalturaBaseEntryListResponse $entrylist An array of Kaltura entry objects. + * @return array An array of Kaltura entry ids where the keys of the array are the Kaltura entry ids and the values are array of Kaltura category ids. + */ +function local_kaltura_get_entry_categories($client, $rootcateogryid, $entrylist) { + $entries = array(); + + // Start multi-request, this will send multiple API calls as one batch request. + $client->startMultiRequest(); + + // Iterate ver each entry. Add it to the entries array (setting the entryid as the key), then retrieve the categories the entry belongs to. + foreach ($entrylist as $entry) { + // Call an API function to return all of the categories the entry belongs to. + $entries[$entry->id] = array(); + + $catfilter = new KalturaCategoryEntryFilter(); + $catfilter->entryIdEqual = $entry->id; + $catpager = new KalturaFilterPager(); + // Category limit per entry is 32, 100 is a high-enough limit. + $catpager->pageSize = 100; + $catpager->pageIndex = 1; + $client->categoryEntry->listAction($catfilter, $catpager); + } + + // Send the batch API request. + $multirequest = $client->doMultiRequest(); + $categories = array(); + $entryid = ''; + + // Iterate over an array of KalturaCategoryEntryListResponse results and save the category ids. + if (is_array($multirequest)) { + foreach ($multirequest as $entrylist) { + // Iterate over an array of KalturaCategoryEntry results. + if (is_array($entrylist->objects)) { + foreach ($entrylist->objects as $entrycategory) { + // Check that the categoryFullIds has the root category in it. + if (false === strpos($entrycategory->categoryFullIds, $rootcateogryid)) { + continue; + } + // Entry Id gets set multiple times... + $entryid = $entrycategory->entryId; + $categories[] = $entrycategory->categoryId; + } + } + + // Save the array of categories to the array of entries. + $entries[$entryid] = $categories; + // Reset categories array to make way for a new entry. + $categories = array(); + } + } + + return $entries; +} + +/** + * This function updates records for Kaltura video resrouce and media assignments; by adding a source URL and padding the width and height. + */ +function local_kaltura_update_activities() { + global $CFG, $DB; + + $configsettings = get_config(KALTURA_PLUGIN_NAME); + $client = local_kaltura_get_kaltura_client(); + + // Check if the KAF URi is initialized. + if (!isset($configsettings->kaf_uri) || empty($configsettings->kaf_uri)) { + $url = new moodle_url('/admin/settings.php', array('section' => 'local_kaltura')); + notice(get_string('migration_kaf_url_not_set', 'local_kaltura'), $url); + } + + // Check if the table exists. + $table = new xmldb_table('kalvidres'); + + if ($DB->get_manager()->table_exists($table)) { + // Migrate Kaltura video resrouce entries. + $sql = 'SELECT * + FROM {kalvidres} + WHERE source IS NULL'; + $records = $DB->get_records_sql($sql); + + foreach ($records as $id => $record) { + if (!is_null($record->entry_id) && !empty($record->entry_id)) { + $source = local_kaltura_build_source_url($record->entry_id, $record->height, $record->width, $record->uiconf_id); + $record->source = $source; + $record->width = $record->width + KALTURA_MIGRATION_WIDTH_PADDING; + $record->height = $record->height + KALTURA_MIGRATION_HEIGHT_PADDING; + + try { + // Retrieve the Kaltura base entry object. + $kalentry = $client->baseEntry->get($record->entry_id); + } + catch(Exception $ex) { + local_kaltura_migration_log_data(__FUNCTION__, array("could not get entry", $record->entry_id, $ex->getCode(), $ex->getMessage())); + // if from some reason we were not able to get the entry - lets make an empty object to use for empty metadata + // since this is for backward compatibility - we can ignore that for the sake of completing the migration + $kalentry = new stdClass(); + } + $newobject = local_kaltura_convert_kaltura_base_entry_object($kalentry); + // Searlize and base 64 encode the metadata. + $metadata = local_kaltura_encode_object_for_storage($newobject); + $record->metadata = $metadata; + + $DB->update_record('kalvidres', $record, true); + } + } + } + + $table = new xmldb_table('kalvidassign_submission'); + + if ($DB->get_manager()->table_exists($table)) { + // Migrate Kaltura video resrouce entries. + $sql = 'SELECT * + FROM {kalvidassign_submission} + WHERE source IS NULL'; + $records = $DB->get_records_sql($sql); + + foreach ($records as $id => $record) { + if (!is_null($record->entry_id) && !empty($record->entry_id)) { + + $height = $configsettings->kalvidassign_player_height; + $width = $configsettings->kalvidassign_player_width; + $player = empty($configsettings->player) ? $configsettings->player_custom : $configsettings->player; + + $source = local_kaltura_build_source_url($record->entry_id, $height, $width, $player); + $record->source = $source; + $record->width = $width + KALTURA_MIGRATION_WIDTH_PADDING; + $record->height = $height + KALTURA_MIGRATION_HEIGHT_PADDING; + + try { + // Retrieve the Kaltura base entry object. + $kalentry = $client->baseEntry->get($record->entry_id); + } + catch(Exception $ex) { + local_kaltura_migration_log_data(__FUNCTION__, array("could not get entry", $record->entry_id, $ex->getCode(), $ex->getMessage())); + // if from some reason we were not able to get the entry - lets make an empty object to use for empty metadata + // since this is for backward compatibility - we can ignore that for the sake of completing the migration + $kalentry = new stdClass(); + } + $newobject = local_kaltura_convert_kaltura_base_entry_object($kalentry); + // Searlize and base 64 encode the metadata. + $metadata = local_kaltura_encode_object_for_storage($newobject); + $record->metadata = $metadata; + + $DB->update_record('kalvidassign_submission', $record, true); + } + } + } +} + +/** + * This function makes sure that allactivity entries are also assigned to the right category in KAF structure. + */ +function local_kaltura_set_activities_entries_to_categories() { + global $CFG, $DB; + + $configsettings = get_config(KALTURA_PLUGIN_NAME); + + // Check if the KAF URi is initialized. + if (!isset($configsettings->kaf_uri) || empty($configsettings->kaf_uri)) { + $url = new moodle_url('/admin/settings.php', array('section' => 'local_kaltura')); + notice(get_string('migration_kaf_url_not_set', 'local_kaltura'), $url); + } + + // Check if the table exists. + $table = new xmldb_table('kalvidres'); + + if ($DB->get_manager()->table_exists($table)) { + // Migrate Kaltura video resrouce entries. + $sql = 'SELECT * + FROM {kalvidres}'; + $records = $DB->get_records_sql($sql); + + foreach ($records as $id => $record) { + if (!is_null($record->entry_id) && !empty($record->entry_id)) { + local_kaltura_set_activity_entry_to_incontext($record->entry_id, $record->course); + } + } + } + + $table = new xmldb_table('kalvidassign_submission'); + + if ($DB->get_manager()->table_exists($table)) { + // Migrate Kaltura video resrouce entries. + $sql = 'SELECT * + FROM {kalvidassign_submission}'; + $records = $DB->get_records_sql($sql); + + foreach ($records as $id => $record) { + if (!is_null($record->entry_id) && !empty($record->entry_id)) { + $assignmentSql = 'SELECT * FROM {kalvidassign} WHERE id = '.$record->vidassignid; + $assignmentRecords = $DB->get_records_sql($assignmentSql); + if(isset($assignmentRecords[$record->vidassignid])) + { + $assignmentRecord = $assignmentRecords[$record->vidassignid]; + local_kaltura_set_activity_entry_to_incontext($record->entry_id, $assignmentRecord->course); + } + } + } + } +} + +/** + * This function makes sure that the entry of activity (assignment submission, resource) is assigned to the InContext category or the respective course. + * This function is used in order to bridge the gap in cases where the moodle kaltura repository + * was disabled in V3, or was enabled after resources have already been created which would make those resources to not be in the old category tree. + * + * @param string $entryId + * @param string $courseId + */ +function local_kaltura_set_activity_entry_to_incontext($entryId, $courseId) +{ + $client = local_kaltura_get_kaltura_client(); + $channelCatData = local_kaltura_get_channels_id($client, local_kaltura_migration_progress::get_kafcategoryrootid()); + + $inContextCategoryName = $channelCatData->fullname . '>'. $courseId . '>InContext'; + + // check if the course channel and its InContext categories exists for the given course ID + $filter = new KalturaCategoryFilter(); + + $filter->fullNameStartsWith = $channelCatData->fullname . '>'. $courseId; + + try + { + $result = $client->category->listAction($filter); + } + catch(Exception $ex) + { + local_kaltura_migration_log_data(__FUNCTION__, array("could not list categories", $record->entry_id, $ex->getCode(), $ex->getMessage())); + } + + $inContextCategoryId = null; + $courseCategoryId = null; + foreach($result->objects as $category) + { + if($category->fullName == $inContextCategoryName) + { + $inContextCategoryId = $category->id; + } + if($category->fullName == $filter->fullNameStartsWith) + { + $courseCategoryId = $category->id; + } + } + + // if not - create the missing categories (channels>{courseID} and channels>{courseID}>InContext) + if(is_null($inContextCategoryId)) + { + $isMultiRequest = false; + if(is_null($courseCategoryId)) + { + $client->startMultiRequest(); + $isMultiRequest = true; + $courseCategory = new KalturaCategory(); + $courseCategory->parentId = $channelCatData->id; + $courseCategory->name = $courseId; + + $client->category->add($courseCategory); + $courseCategoryId = '{1:result:id}'; + } + + $inContextCategory = new KalturaCategory(); + $inContextCategory->parentId = $courseCategoryId; + $inContextCategory->name = 'InContext'; + + $res = $client->category->add($inContextCategory); + + if($isMultiRequest) + { + $multiResponse = $client->doMultiRequest(); + if(isset($multiResponse[1]) && $multiResponse[1] instanceof KalturaCategory) + { + $inContextCategoryId = $multiResponse[1]->id; + } + } + else + { + $inContextCategoryId = $res->id; + } + } + + // assign the entry to the InContext category + if(is_null($inContextCategoryId)) + { + local_kaltura_migration_log_data(__FUNCTION__, array( + 'Failed getting/creating InContext category for course', + $courseId, + 'single request response: '.base64_encode(print_r($res, true)), + 'multi request response: '. base64_encode(print_r($multiResponse, true)), + )); + } + + $categoryEntry = new KalturaCategoryEntry(); + $categoryEntry->entryId = $entryId; + $categoryEntry->categoryId = $inContextCategoryId; + + try + { + $client->categoryEntry->add($categoryEntry); + } catch (Exception $ex) { + // write to log? + if($ex->getCode() == 'CATEGORY_ENTRY_ALREADY_EXISTS') + { + local_kaltura_migration_log_data(__FUNCTION__, array( + "failed edding entry to category - already exists", + $categoryEntry->entryId, + $categoryEntry->categoryId, + $ex->getCode(), + $ex->getMessage(), + $ex->getTraceAsString(), + )); + } + else + { + local_kaltura_migration_log_data(__FUNCTION__, array( + "failed edding entry to category - reason unexpected", + $categoryEntry->entryId, + $categoryEntry->categoryId, + $ex->getCode(), + $ex->getMessage(), + $ex->getTraceAsString(), + )); + } + } +} + +/** + * This function takes a Kaltura entry id height, width and uiconf_id and returns a source URL pointing to the entry. + * @param string $entryid The Kaltura entry id. + * @param int $height The entry height. + * @param int $width The entry width. + * @param int $uiconfid The Kaltura player id. + * @return string A source URL. + */ +function local_kaltura_build_source_url($entryid, $height, $width, $uiconfid) { + $newheight = empty($height) ? KALTURA_MIGRATION_DEFAULT_HEIGHT : $height; + $newwidth = empty($width) ? KALTURA_MIGRATION_DEFAULT_WIDTH : $width; + $kafuri = local_kaltura_get_config()->kaf_uri; + $kafuri = local_kaltura_format_uri($kafuri); + $url = 'http://'.$kafuri."/browseandembed/index/media/entryid/{$entryid}/showDescription/true/showTitle/true/showTags/true/showDuration/true/showOwner/"; + $url .= "true/showUploadDate/false/playerSize/{$newwidth}x{$newheight}/playerSkin/{$uiconfid}/"; + return $url; +} + +/** + * This class keeps statistics on the last entries that were process, as well as how many categories were created. + * It is also used to allow the use to continue the migration from where it last left off. + */ +class local_kaltura_migration_progress { + /** @var int The timestamp used to retrieve Kaltura entries that were created on or before this date. */ + static protected $existingcategoryrun = 0; + /** @var int The timestamp used to retrieve Kaltura entries where the metadata was created on or before this date. */ + static protected $sharedcategoryrun = 0; + /** @var int The number of categories that have been created. */ + static protected $categoriescreated = 0; + /** @var int The number of entries that have been migrated. */ + static protected $entriesmigrated = 0; + /** @var int The date the migration originally started. */ + static protected $migrationstarted = 0; + /** @var int KAF root category id. */ + static protected $kafcategoryrootid = 0; + + /** + * Constructor initializes static properties. + */ + public function __construct() { + $config = get_config(KALTURA_PLUGIN_NAME); + self::$migrationstarted = (isset($config->migrationstarted) && !empty($config->migrationstarted)) ? $config->migrationstarted : 0; + self::$existingcategoryrun = isset($config->existingcategoryrun) ? $config->existingcategoryrun : 0; + self::$sharedcategoryrun = isset($config->sharedcategoryrun) ? $config->sharedcategoryrun : 0; + self::$categoriescreated = isset($config->categoriescreated) ? $config->categoriescreated : 0; + self::$entriesmigrated = isset($config->entriesmigrated) ? $config->entriesmigrated : 0; + self::$kafcategoryrootid = isset($config->kafcategoryrootid) ? $config->kafcategoryrootid : 0; + } + + /** + * Returns the timestamp value of the date created for the last entry that was processed. + * @return int Unix timestamp. + */ + static public function get_existingcategoryrun() { + return self::$existingcategoryrun; + } + + /** + * Set the timestamp value. + * @param int $data A unix timestamp. + */ + static public function set_existingcategoryrun($data) { + self::$existingcategoryrun = $data; + } + + /** + * Returns the timestampe value of the date created for the last entry metadata that was processed. + * @return int Unix timestamp. + */ + static public function get_sharedcategoryrun() { + return self::$sharedcategoryrun; + } + + /** + * Set the timestamp value. + * @param int $data A unix timestamp. + */ + static public function set_sharedcategoryrun($data) { + self::$sharedcategoryrun = $data; + } + + /** + * Returns the number of categories created. + * @return int Unix timestamp. + */ + static public function get_categoriescreated() { + return self::$categoriescreated; + } + + /** + * Increment categories created. + */ + static public function increment_categoriescreated() { + self::$categoriescreated++; + } + + /** + * Returns the number of entries that were migrated. + * @return int Unix timestamp. + */ + static public function get_entriesmigrated() { + return self::$entriesmigrated; + } + + /** + * Increment entries migrated. + */ + static public function increment_entriesmigrated() { + self::$entriesmigrated++; + } + + /** + * Returns the timestamp for the original date the migration was started. + * @return int Unix timestamp. + */ + static public function get_migrationstarted() { + return self::$migrationstarted; + } + + /** + * Sets the time the migration started time to now. + */ + static public function init_migrationstarted() { + self::$migrationstarted = time(); + } + + /** + * Returns the KAF root category id + * @return int Unix timestamp. + */ + static public function get_kafcategoryrootid() { + return self::$kafcategoryrootid; + } + + /** + * Sets the the KAF root category id. + * @param int $data a Kaltura category id. + */ + static public function set_kafcategoryrootid($data) { + self::$kafcategoryrootid = $data; + } + + /** + * Reset all stats to nothing. + */ + static public function reset_all() { + self::$migrationstarted = 0; + self::$entriesmigrated = 0; + self::$categoriescreated = 0; + self::$sharedcategoryrun = 0; + self::$existingcategoryrun = 0; + self::$kafcategoryrootid = 0; + } + + /** + * Destructor that saves static properties to the DB. + */ + public function __destruct() { + set_config('existingcategoryrun', self::$existingcategoryrun, KALTURA_PLUGIN_NAME); + set_config('sharedcategoryrun', self::$sharedcategoryrun, KALTURA_PLUGIN_NAME); + set_config('categoriescreated', self::$categoriescreated, KALTURA_PLUGIN_NAME); + set_config('entriesmigrated', self::$entriesmigrated, KALTURA_PLUGIN_NAME); + set_config('migrationstarted', self::$migrationstarted, KALTURA_PLUGIN_NAME); + set_config('kafcategoryrootid', self::$kafcategoryrootid, KALTURA_PLUGIN_NAME); + } +} diff --git a/local/kaltura/pix/icon.png b/local/kaltura/pix/icon.png new file mode 100644 index 0000000000000..8d5961396d824 Binary files /dev/null and b/local/kaltura/pix/icon.png differ diff --git a/local/kaltura/pix/icon.svg b/local/kaltura/pix/icon.svg new file mode 100644 index 0000000000000..23a9f3a2e2cf5 --- /dev/null +++ b/local/kaltura/pix/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/local/kaltura/pix/kavatar.png b/local/kaltura/pix/kavatar.png new file mode 100644 index 0000000000000..05c1f59049e45 Binary files /dev/null and b/local/kaltura/pix/kavatar.png differ diff --git a/local/kaltura/pix/quiz.svg b/local/kaltura/pix/quiz.svg new file mode 100644 index 0000000000000..dc625bf4ae52e --- /dev/null +++ b/local/kaltura/pix/quiz.svg @@ -0,0 +1,3 @@ + + + diff --git a/local/kaltura/pix/vidThumb.png b/local/kaltura/pix/vidThumb.png new file mode 100644 index 0000000000000..cdf48281daab5 Binary files /dev/null and b/local/kaltura/pix/vidThumb.png differ diff --git a/local/kaltura/service.php b/local/kaltura/service.php new file mode 100644 index 0000000000000..19383c1f6abf6 --- /dev/null +++ b/local/kaltura/service.php @@ -0,0 +1,116 @@ +. + +/** + * Kaltura LTI service script used receive data sent from the Kaltura content provider. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(__FILE__).'/../../config.php'); +require_once($CFG->dirroot.'/local/kaltura/locallib.php'); + +require_login(); + +global $PAGE; + + +$url = required_param('url', PARAM_URL); +$width = required_param('width', PARAM_INT); +$height = required_param('height', PARAM_INT); +$entryid = required_param('entry_id', PARAM_TEXT); +$title = required_param('title', PARAM_TEXT); +$thumbnailurl = optional_param('thumbnailUrl', '', PARAM_URL); +$duration = optional_param('duration', '', PARAM_TEXT); +$description = optional_param('description', '', PARAM_TEXT); +$createdat = optional_param('createdAt', '', PARAM_TEXT); +$owner = optional_param('owner', '', PARAM_TEXT); +$tags = optional_param('tags', '', PARAM_TEXT); +$showtitle = optional_param('showTitle', '', PARAM_TEXT); +$showdescription = optional_param('showDescription', '', PARAM_TEXT); +$showtags = optional_param('showTags', '', PARAM_TEXT); +$showduration = optional_param('showDuration', '', PARAM_TEXT); +$showowner = optional_param('showOwner', '', PARAM_TEXT); +$player = optional_param('player', '', PARAM_TEXT); +$size = optional_param('size', '', PARAM_TEXT); +$editor = optional_param('editor', 'tinymce', PARAM_TEXT); + + +$serviceurl = new moodle_url('/local/kaltura/service.php'); + +// Log the request. +$enablelogging = get_config(KALTURA_PLUGIN_NAME, 'enable_logging'); +if (!empty($enablelogging)) { + $param = array( + 'url' => $url, + 'width' => $width, + 'height' => $height, + 'entryid' => $entryid, + '$title' => $title + ); + local_kaltura_log_data(KAF_BROWSE_EMBED_MODULE, $serviceurl->out(), $param, false); +} + +// Create a metadata object and serialize it. +$metadata = new stdClass(); +$metadata->url = $url; +$metadata->width = $width; +$metadata->height = $height; +$metadata->entryid = $entryid; +$metadata->title = $title; +$metadata->thumbnailurl = $thumbnailurl; +$metadata->duration = $duration; +$metadata->description = $description; +$metadata->createdat = $createdat; +$metadata->owner = $owner; +$metadata->tags = $tags; +$metadata->showtitle = $showtitle; +$metadata->showdescription = $showdescription; +$metadata->showduration = $showduration; +$metadata->showowner = $showowner; +$metadata->player = $player; +$metadata->size = $size; + +$metadata = local_kaltura_encode_object_for_storage($metadata); + +$PAGE->set_url($serviceurl); +$PAGE->set_context(context_system::instance()); +$previewltilaunchurl = new moodle_url('/local/kaltura/bsepreview_ltilaunch.php?playurl=' . urlencode($url)); +$params = array( + 'iframeurl' => urlencode($url), + 'width' => $width, + 'height' => $height, + 'entryid' => $entryid, + 'title' => $title, + 'metadata' => $metadata, + 'editor' => $editor, + 'previewltilauncher' => $previewltilaunchurl->out(), +); +if($editor == 'atto') +{ + require_once('attoembed.php'); +} +else +{ + $PAGE->requires->yui_module('moodle-local_kaltura-ltiservice', 'M.local_kaltura.init', array($params)); + $PAGE->set_pagelayout('embedded'); + + echo $OUTPUT->header(); + echo $OUTPUT->footer(); +} diff --git a/local/kaltura/settings.php b/local/kaltura/settings.php new file mode 100644 index 0000000000000..d89b926fb8bba --- /dev/null +++ b/local/kaltura/settings.php @@ -0,0 +1,132 @@ +. + +/** + * Kaltura config settings script. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +// It must be included from a Moodle page. +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +use mod_lti\local\ltiopenid\registration_helper; + +require_once($CFG->dirroot.'/local/kaltura/locallib.php'); +require_once($CFG->dirroot.'/mod/lti/locallib.php'); +require_once($CFG->dirroot.'/lib/moodlelib.php'); + +if ($hassiteconfig) { + + // Add local plug-in configuration settings link to the navigation block. + $settings = new admin_settingpage('local_kaltura', get_string('pluginname', 'local_kaltura')); + $ADMIN->add('localplugins', $settings); + + $configsettings = get_config(KALTURA_PLUGIN_NAME); + $missinginfo = get_string('missing_required_info', 'local_kaltura'); + $message = ''; + + if (isset($configsettings->kaf_uri) && !empty($configsettings->kaf_uri)) { + $url = local_kaltura_add_protocol_to_url($configsettings->kaf_uri); + if (empty($url)) { + $message = get_string('invalid_url', 'local_kaltura'); + } else { + $message = $url.'/admin'; + $message = html_writer::tag('a', $message, array('href' => $message)); + $message = html_writer::tag('center', $message); + } + } + + if (empty($configsettings->partner_id) || empty($configsettings->adminsecret)) { + $message .= html_writer::empty_tag('br'); + $message .= html_writer::tag('center', $missinginfo); + } + + // Pull the Kaltura repository settings (if exists). + $kalrepoconfig = get_config(KALTURA_REPO_NAME); + $repoprofileid = (!empty($kalrepoconfig) && !empty($kalrepoconfig->metadata_profile_id)) ? $kalrepoconfig->metadata_profile_id : ''; + + $adminsetting = new admin_setting_heading('kaf_url_heading', get_string('kaf_configuration_hdr', 'local_kaltura'), $message); + $adminsetting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($adminsetting); + + $adminsetting = new admin_setting_configtext('kaf_uri', get_string('kaf_uri', 'local_kaltura'), get_string('kaf_uri_desc', 'local_kaltura'), '', PARAM_URL); + $adminsetting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($adminsetting); + + $adminsetting = new admin_setting_configtext('uri', get_string('server_uri', 'local_kaltura'), get_string('server_uri_desc', 'local_kaltura'), KALTURA_DEFAULT_URI, PARAM_URL); + $adminsetting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($adminsetting); + + $setting = new admin_setting_configselect( + 'lti_version', + get_string('lti_version', KALTURA_PLUGIN_NAME), + get_string('lti_version_desc', KALTURA_PLUGIN_NAME), + LTI_VERSION_1, + array( + LTI_VERSION_1 => get_string('oauthsecurity', 'lti'), + LTI_VERSION_1P3 => get_string('jwtsecurity', 'lti'), + ) + ); + $setting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($setting); + + $adminsetting = new admin_setting_configtext('partner_id', get_string('partner_id', 'local_kaltura'), get_string('partner_id_desc', 'local_kaltura'), '', PARAM_INT); + $adminsetting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($adminsetting); + + $adminsetting = new admin_setting_configtext('adminsecret', get_string('admin_secret', 'local_kaltura'), get_string('admin_secret_desc', 'local_kaltura'), '', PARAM_ALPHANUM); + $adminsetting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($adminsetting); + + + if(!$clientid = get_config(KALTURA_PLUGIN_NAME,'client_id')){ + + $clientid = random_string(15); + + set_config('client_id', $clientid, KALTURA_PLUGIN_NAME); + } + + $adminsetting = new admin_setting_description('client_id', 'Client ID', '

Should be used in the KAF hosted module

'); + $adminsetting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($adminsetting); + + $url = new moodle_url('/local/kaltura/download_log.php'); + $adminsetting = new admin_setting_configcheckbox('enable_logging', get_string('trace_log', 'local_kaltura'), get_string('trace_log_desc', 'local_kaltura', $url->out()), 0); + $adminsetting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($adminsetting); + + $adminsetting = new admin_setting_configcheckbox('enable_submission', get_string('enable_submission', 'local_kaltura'), get_string('enable_submission_desc', 'local_kaltura'), 0); + $adminsetting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($adminsetting); + + $settings->hide_if(KALTURA_PLUGIN_NAME.'/adminsecret', KALTURA_PLUGIN_NAME .'/lti_version', 'eq', LTI_VERSION_1P3); + $settings->hide_if(KALTURA_PLUGIN_NAME.'/client_id', KALTURA_PLUGIN_NAME. '/lti_version', 'eq', LTI_VERSION_1); + + if (isset($configsettings->migration_yes) && $configsettings->migration_yes == 1) { + $url = new moodle_url('/local/kaltura/migration.php'); + + $adminsetting = new admin_setting_heading('migration_url_heading', get_string('migration_notice', 'local_kaltura', $url->out()), ''); + $adminsetting->plugin = KALTURA_PLUGIN_NAME; + $settings->add($adminsetting); + } +} + diff --git a/local/kaltura/styles.css b/local/kaltura/styles.css new file mode 100644 index 0000000000000..420652c8b1185 --- /dev/null +++ b/local/kaltura/styles.css @@ -0,0 +1,33 @@ +/* stylelint-disable declaration-no-important */ + +#contentframe { + border-style: none; +} + +#panelcontentframecontainer { + overflow: scroll; + -webkit-overflow-scrolling: touch; + height: 100%; + width: 100%; +} + +@media (max-width: 767px) { + .kaltura-player-container { + width: 100%; + position: relative; + /* aspect ratio - 16:9 */ + padding-top: 56.25%; + /* player's control bar */ + padding-bottom: 30px; + } + + .kaltura-player-iframe { + position: absolute; + width: 100% !important; + height: 100% !important; + top: 0; + left: 0; + right: 0; + bottom: 0; + } +} \ No newline at end of file diff --git a/local/kaltura/test.php b/local/kaltura/test.php new file mode 100644 index 0000000000000..faa03e5325084 --- /dev/null +++ b/local/kaltura/test.php @@ -0,0 +1,27 @@ +set_url($url); +$PAGE->set_context($context); + +echo $OUTPUT->header(); + +require_capability('moodle/site:config', $context); + +$session = local_kaltura_login(true, '', 2); + +if ($session) { + echo 'Connection successful'; +} else { + echo 'Connection not successful'; +} diff --git a/local/kaltura/tests/locallib_test.php b/local/kaltura/tests/locallib_test.php new file mode 100644 index 0000000000000..70682990b1fda --- /dev/null +++ b/local/kaltura/tests/locallib_test.php @@ -0,0 +1,1261 @@ +. + +/** + * Kaltura local library phpunit tests. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +defined('MOODLE_INTERNAL') || die(); + +global $CFG; +require_once($CFG->dirroot.'/local/kaltura/locallib.php'); +require_once($CFG->dirroot.'/local/kaltura/API/KalturaTypes.php'); + +/** + * @group local_kaltura + */ +class local_kaltura_locallib_testcase extends advanced_testcase { + /** + * A Dataprovider method, providing invalid data. + */ + public function mymedia_test_required_param_fail() { + $data = array( + array( + array( + // 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + // 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + // 'width' => 100, + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ), + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + // 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + // 'module' => '', + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + // 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + // 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + // 'custom_publishdata' => '', + ) + ), + array( + array( + // Non-numeric. + 'id' => 'string', + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + // Non-numeric. + 'width' => 'string', + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + // Non-numeric. + 'height' => 'string', + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + // Not an object. + 'course' => 'string', + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MYMEDIA_MODULE, + 'course' => new stdClass(), + // Non-numeric. + 'cmid' => 'string', + 'custom_publishdata' => '', + ) + ), + ); + return $data; + } + + /** + * This function tests whether the parameters contain all required fields. + * @param array $data An array of parameters that are invalid. + * @dataProvider mymedia_test_required_param_fail + */ + public function test_local_kaltura_validate_mymedia_required_params_fail($data) { + $this->resetAfterTest(true); + $result = local_kaltura_validate_mymedia_required_params($data); + $this->assertFalse($result); + } + + /** + * A Dataprovider method, providing invalid data. + */ + public function mediagallery_test_required_param_fail() { + $data = array( + array( + array( + // 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + // 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + // 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ), + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + // 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + // 'module' => '', + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + // 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + // 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + // 'custom_publishdata' => '', + ) + ), + array( + array( + // Non-numeric. + 'id' => 'string', + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + // Non-numeric. + 'width' => 'string', + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + // Non-numeric. + 'height' => 'string', + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + // Not an object. + 'course' => 'string', + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + // Non-numeric. + 'cmid' => 'string', + 'custom_publishdata' => '', + ) + ), + ); + return $data; + } + + /** + * This function tests whether the parameters contain all required fields. + * @param array $data An array of parameters that are invalid. + * @dataProvider mediagallery_test_required_param_fail + */ + public function test_local_kaltura_validate_coursegallery_required_params_fail($data) { + $this->resetAfterTest(true); + $result = local_kaltura_validate_mediagallery_required_params($data); + $this->assertFalse($result); + } + + /** + * This function tests whether the parameters contain all required fields. + */ + public function test_local_kaltura_validate_coursegallery_required_params() { + $this->resetAfterTest(true); + $data = array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_MEDIAGALLERY_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '' + ); + + $result = local_kaltura_validate_mediagallery_required_params($data); + $this->assertTrue($result); + } + + /** + * A Dataprovider method, providing invalid data. + */ + public function browseembed_test_required_param_fail() { + $data = array( + array( + array( + // 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + // 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + // 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ), + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + // 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + // 'module' => '', + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + // 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + // 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + // 'custom_publishdata' => '', + ) + ), + array( + array( + // Non-numeric. + 'id' => 'string', + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + // Non-numeric. + 'width' => 'string', + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + // Non-numeric. + 'height' => 'string', + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + // Not an object. + 'course' => 'string', + 'cmid' => 0, + 'custom_publishdata' => '', + ) + ), + array( + array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + // Non-numeric. + 'cmid' => 'string', + 'custom_publishdata' => '', + ) + ), + ); + return $data; + } + + /** + * This function tests whether the parameters contain all required fields. + * @param array $data An array of parameters that are invalid. + * @dataProvider browseembed_test_required_param_fail + */ + public function test_local_kaltura_validate_browseembed_required_params_fail($data) { + $result = local_kaltura_validate_browseembed_required_params($data); + $this->assertFalse($result); + } + + /** + * This function tests whether the parameters contain all required fields. + */ + public function test_local_kaltura_validate_browseembed_required_params() { + $data = array( + 'id' => 1, + 'title' => 'title', + 'width' => 100, + 'height' => 100, + 'module' => KAF_BROWSE_EMBED_MODULE, + 'course' => new stdClass(), + 'cmid' => 0, + 'custom_publishdata' => '' + ); + + $result = local_kaltura_validate_browseembed_required_params($data); + $this->assertTrue($result); + } + + /** + * This function tests the return values for @see local_kaltura_get_lti_launch_container(). + */ + public function test_local_kaltura_get_lti_launch_container() { + global $CFG; + + $this->resetAfterTest(true); + $result = local_kaltura_get_lti_launch_container(true); + $this->assertEquals(LTI_LAUNCH_CONTAINER_EMBED, $result); + + $result = local_kaltura_get_lti_launch_container(false); + $this->assertEquals(LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS, $result); + } + + /** + * Data provider for different KAF service names. + */ + public function module_name_test_fail() { + $data = array( + array('nothing'), + array(''), + array(1234) + ); + return $data; + } + + /** + * Test validating available KAF services. + * @param array $data An array of parameters that are invalid. + * @dataProvider module_name_test_fail + */ + public function test_local_kaltura_validate_kaf_module_request_fail($data) { + $this->resetAfterTest(true); + $result = local_kaltura_validate_kaf_module_request($data); + $this->assertFalse($result); + } + + /** + * Data provider for different KAF service names. + */ + public function module_name_test() { + $data = array( + array('mymedia'), + array('coursegallery'), + ); + return $data; + } + + /** + * Test validating available KAF services. + * @param array $data An array of parameters that is valid. + * @dataProvider module_name_test + */ + public function test_local_kaltura_validate_kaf_module_request($data) { + $this->resetAfterTest(true); + $result = local_kaltura_validate_kaf_module_request($data); + $this->assertTrue($result); + } + + /** + * Test that the correct end point is returned. + */ + public function test_local_kaltura_get_endpoint() { + $this->resetAfterTest(true); + $result = local_kaltura_get_endpoint(KAF_MYMEDIA_MODULE); + $this->assertEquals(KAF_MYMEDIA_ENDPOINT, $result); + $result = local_kaltura_get_endpoint(KAF_MEDIAGALLERY_MODULE); + $this->assertEquals(KAF_MEDIAGALLERY_ENDPOINT, $result); + $result = local_kaltura_get_endpoint(KAF_BROWSE_EMBED_MODULE); + $this->assertEquals(KAF_BROWSE_EMBED_ENDPOINT, $result); + } + + /** + * This functions tests properties of the mod_lti object returned by local_kaltura_format_lti_instance_object(). + */ + public function test_local_kaltura_format_lti_instance_object() { + $this->resetAfterTest(true); + + set_config('partner_id', 12345, 'local_kaltura'); + set_config('adminsecret', 54321, 'local_kaltura'); + set_config('kaf_uri', 'http://phpunit.tests/local_kaltura/tests/', 'local_kaltura'); + $expecteduri = 'phpunit.tests/local_kaltura/tests'; + + $configsettings = get_config('local_kaltura'); + + $course = new stdClass(); + $course->id = 1; + $param = array( + 'id' => 1, + 'module' => 'mymedia', + 'course' => $course, + 'title' => 'phpunit test', + 'width' => 100, + 'height' => 100, + 'cmid' => 0, + 'intro' => 'phpunitintro', + ); + + $expected = new stdClass(); + + $result = local_kaltura_format_lti_instance_object($param); + + $this->assertObjectHasAttribute('course', $result); + $this->assertObjectHasAttribute('id', $result); + $this->assertObjectHasAttribute('name', $result); + $this->assertObjectHasAttribute('intro', $result); + $this->assertObjectHasAttribute('instructorchoicesendname', $result); + $this->assertObjectHasAttribute('instructorchoicesendemailaddr', $result); + $this->assertObjectHasAttribute('instructorcustomparameters', $result); + $this->assertObjectHasAttribute('instructorchoiceacceptgrades', $result); + $this->assertObjectHasAttribute('instructorchoiceallowroster', $result); + $this->assertObjectHasAttribute('resourcekey', $result); + $this->assertObjectHasAttribute('password', $result); + $this->assertObjectHasAttribute('toolurl', $result); + $this->assertObjectHasAttribute('securetool', $result); + $this->assertObjectHasAttribute('forcessl', $result); + $this->assertObjectHasAttribute('cmid', $result); + + $this->assertEquals(1, $result->course); + $this->assertEquals(1, $result->id); + $this->assertEquals('phpunit test', $result->name); + $this->assertEquals('phpunitintro', $result->intro); + $this->assertEquals(LTI_SETTING_ALWAYS, $result->instructorchoicesendname); + $this->assertEquals(LTI_SETTING_ALWAYS, $result->instructorchoicesendemailaddr); + $this->assertEquals('', $result->instructorcustomparameters); + $this->assertEquals(LTI_SETTING_NEVER, $result->instructorchoiceacceptgrades); + $this->assertEquals(LTI_SETTING_NEVER, $result->instructorchoiceallowroster); + $this->assertEquals($configsettings->partner_id, $result->resourcekey); + $this->assertEquals($configsettings->adminsecret, $result->password); + $this->assertEquals('http://phpunit.tests/local_kaltura/tests/'.KAF_MYMEDIA_ENDPOINT, $result->toolurl); + $this->assertEquals('https://phpunit.tests/local_kaltura/tests/'.KAF_MYMEDIA_ENDPOINT, $result->securetool); + $this->assertEquals(0, $result->cmid); + } + + /** + * Test the formatting of an array to be used by mod_lti. + */ + public function test_local_kaltura_format_typeconfig() { + $this->resetAfterTest(true); + + $param = new stdClass(); + $param->instructorchoicesendname = 0; + $param->instructorchoicesendemailaddr = 'a@a.com'; + $param->instructorcustomparameters = ''; + $param->instructorchoiceacceptgrades = 0; + $param->instructorchoiceallowroster = 3; + + $expected = array( + 'sendname' => 0, + 'sendemailaddr' => 'a@a.com', + 'customparameters' => '', + 'acceptgrades' => 0, + 'allowroster' => 3, + 'launchcontainer' => 2, + ); + + $result = local_kaltura_format_typeconfig($param); + + ksort($result); + ksort($expected); + $this->assertEquals($expected, $result); + + // call function specifying no blocks to be displayed + $expected['launchcontainer'] = 3; + $result = local_kaltura_format_typeconfig($param, false); + $this->assertEquals($expected, $result); + } + + /** + * Data provider for different KAF service names. + */ + public function invalid_logging_data() { + $data = array( + array( + 'string' + ), + array( + 1 + ), + array( + new stdClass() + ) + ); + return $data; + } + + /** + * Test logging. + * @param array $data Sample data from data provider method. + * @dataProvider module_name_test + */ + public function test_local_kaltura_log_data_invalid_logging_data($data) { + $this->resetAfterTest(true); + + $result = local_kaltura_log_data('mymedia', 'http://localhost', $data, true); + $this->assertFalse($result); + } + + /** + * Test logging. + */ + public function test_local_kaltura_log_data_invalid_module() { + $this->resetAfterTest(true); + + $json = '{"courses":[{"courseId":123,"courseName":"something","roles":"ltirole1,ltirole2"},{"courseId":456,"courseName":"else","roles":"ltirole3,ltirole4"}]'; + $data = array(); + $data['test1'] = 'test2'; + $data['test3'] = 'test4'; + $data['json'] = $json; + + $result = local_kaltura_log_data('invalidmodule', 'http://localhost', $data, true); + $this->assertFalse($result); + } + + /** + * Test logging. + */ + public function test_local_kaltura_log_data_logging_request_data() { + global $DB; + + $this->resetAfterTest(true); + + $json = '{"courses":[{"courseId":123,"courseName":"something","roles":"ltirole1,ltirole2"},{"courseId":456,"courseName":"else","roles":"ltirole3,ltirole4"}]'; + $data = array(); + $data['test1'] = 'test2'; + $data['test3'] = 'test4'; + $data['json'] = $json; + + $result = local_kaltura_log_data(KAF_MYMEDIA_MODULE, 'http://localhost', $data, true); + $this->assertTrue($result); + $record = $DB->get_record('local_kaltura_log', array('module'=> 'mymedia')); + + $this->assertObjectHasAttribute('id', $record); + + $this->assertObjectHasAttribute('module', $record); + $this->assertEquals(KAF_MYMEDIA_MODULE, $record->module); + + $this->assertObjectHasAttribute('type', $record); + $this->assertEquals(KALTURA_LOG_REQUEST, $record->type); + + $this->assertObjectHasAttribute('endpoint', $record); + $this->assertEquals('http://localhost', $record->endpoint); + + $this->assertObjectHasAttribute('data', $record); + $this->assertEquals(serialize($data), $record->data); + + $this->assertObjectHasAttribute('timecreated', $record); + $this->assertNotEquals(0, $record); + + $result = local_kaltura_log_data(KAF_MEDIAGALLERY_MODULE, 'http://localhost', $data, true); + $this->assertTrue($result); + + $record = $DB->get_record('local_kaltura_log', array('module'=> 'coursegallery')); + + $this->assertObjectHasAttribute('id', $record); + + $this->assertObjectHasAttribute('module', $record); + $this->assertEquals(KAF_MEDIAGALLERY_MODULE, $record->module); + + $this->assertObjectHasAttribute('type', $record); + $this->assertEquals(KALTURA_LOG_REQUEST, $record->type); + + $this->assertObjectHasAttribute('endpoint', $record); + $this->assertEquals('http://localhost', $record->endpoint); + + $this->assertObjectHasAttribute('data', $record); + $this->assertEquals(serialize($data), $record->data); + + $this->assertObjectHasAttribute('timecreated', $record); + $this->assertNotEquals(0, $record); + } + + /** + * Test logging. + */ + public function test_local_kaltura_log_data_logging_response_data() { + global $DB; + + $this->resetAfterTest(true); + + $json = '{"courses":[{"courseId":123,"courseName":"something","roles":"ltirole1,ltirole2"},{"courseId":456,"courseName":"else","roles":"ltirole3,ltirole4"}]'; + $data = array(); + $data['test1'] = 'test2'; + $data['test3'] = 'test4'; + $data['json'] = $json; + + $result = local_kaltura_log_data('phpunit response', 'http://localhost', $data, false); + $this->assertTrue($result); + + $record = $DB->get_record('local_kaltura_log', array('module'=> 'phpunit response')); + + $this->assertObjectHasAttribute('id', $record); + + $this->assertObjectHasAttribute('module', $record); + $this->assertEquals('phpunit response', $record->module); + + $this->assertObjectHasAttribute('type', $record); + $this->assertEquals(KALTURA_LOG_RESPONSE, $record->type); + + $this->assertObjectHasAttribute('endpoint', $record); + $this->assertEquals('http://localhost', $record->endpoint); + + $this->assertObjectHasAttribute('data', $record); + $this->assertEquals(serialize($data), $record->data); + + $this->assertObjectHasAttribute('timecreated', $record); + $this->assertNotEquals(0, $record); + } + + /** + * Data provider for test_local_kaltura_format_uri(). + */ + public function uri_format_test() { + return array( + array('http://phpunit.tests/local_kaltura/tests'), + array('http://phpunit.tests/local_kaltura/tests/'), + array('https://phpunit.tests/local_kaltura/tests'), + array('https://phpunit.tests/local_kaltura/tests/'), + array('https://www.phpunit.tests/local_kaltura/tests/'), + ); + } + + /** + * Test local_kaltura_format_uri(). + * @param string $url differnt URI formats. + * @dataProvider uri_format_test + */ + public function test_local_kaltura_format_uri($uri) { + $result = local_kaltura_format_uri($uri); + $this->assertEquals('phpunit.tests/local_kaltura/tests', $result); + } + + /** + * Test local_kaltura_get_kaf_publishing_data(). This test creates 4 coures. Enrolls the user as an editing teacher in coures 1 and 4, + * then enrolls the user as a student in course 2. + */ + public function test_local_kaltura_get_kaf_publishing_data_for_non_admin() { + global $DB; + + $this->resetAfterTest(true); + + // Get the roles. + $sql = "SELECT shortname,id + FROM {role}"; + $role = (array) $DB->get_records_sql($sql); + // Create a test user. + $user = $this->getDataGenerator()->create_user(); + + // Create test courses and assign the user roles. + $coursedata = array( + 'fullname' => 'Test 1', + 'shortname' => 'T1' + ); + $courseone = $this->getDataGenerator()->create_course($coursedata); + + $this->getDataGenerator()->enrol_user($user->id, $courseone->id, $role['editingteacher']->id, 'manual'); + + $coursedata = array( + 'fullname' => 'Test 2', + 'shortname' => 'T2' + ); + $coursetwo = $this->getDataGenerator()->create_course($coursedata); + + $this->getDataGenerator()->enrol_user($user->id, $coursetwo->id, $role['student']->id, 'manual'); + + $coursedata = array( + 'fullname' => 'Test 3', + 'shortname' => 'T3' + ); + $coursethree = $this->getDataGenerator()->create_course($coursedata); + + $coursedata = array( + 'fullname' => 'Test 4', + 'shortname' => 'T4' + ); + $coursefour = $this->getDataGenerator()->create_course($coursedata); + + $this->getDataGenerator()->enrol_user($user->id, $coursefour->id, $role['editingteacher']->id, 'manual'); + + // Set the current user to the test user. + advanced_testcase::setuser($user->id); + + $result = local_kaltura_get_kaf_publishing_data(); + + $json = '{"courses":[{"courseId":"'.$courseone->id.'","courseName":"'.$courseone->fullname.'","courseShortName":"'.$courseone->shortname.'","roles":"Instructor"}'; + $json .= ',{"courseId":"'.$coursetwo->id.'","courseName":"'.$coursetwo->fullname.'","courseShortName":"'.$coursetwo->shortname.'","roles":"Learner"}'; + $json .= ',{"courseId":"'.$coursefour->id.'","courseName":"'.$coursefour->fullname.'","courseShortName":"'.$coursefour->shortname.'","roles":"Instructor"}]}'; + + $this->assertEquals(base64_encode($json), $result); + } + + /** + * Test local_kaltura_get_kaf_publishing_data(). This test creates 4 coures. Enrolls the user as an editing teacher in coures 1 and 4, + * then enrolls the user as a student in course 2. + */ + public function test_local_kaltura_get_kaf_publishing_data_for_admin() { + $this->resetAfterTest(true); + + // Create test courses and assign the user roles. + $coursedata = array( + 'fullname' => 'Test 1', + 'shortname' => 'T1' + ); + $courseone = $this->getDataGenerator()->create_course($coursedata); + + $coursedata = array( + 'fullname' => 'Test 2', + 'shortname' => 'T2' + ); + $coursetwo = $this->getDataGenerator()->create_course($coursedata); + + $coursedata = array( + 'fullname' => 'Test 3', + 'shortname' => 'T3' + ); + $coursethree = $this->getDataGenerator()->create_course($coursedata); + + $coursedata = array( + 'fullname' => 'Test 4', + 'shortname' => 'T4' + ); + $coursefour = $this->getDataGenerator()->create_course($coursedata); + + advanced_testcase::setAdminUser(); + + $result = local_kaltura_get_kaf_publishing_data(); + + $json = '{"courses":[{"courseId":"'.$courseone->id.'","courseName":"'.$courseone->fullname.'","courseShortName":"'.$courseone->shortname.'","roles":"urn:lti:sysrole:ims\/lis\/Administrator"}'; + $json .= ',{"courseId":"'.$coursetwo->id.'","courseName":"'.$coursetwo->fullname.'","courseShortName":"'.$coursetwo->shortname.'","roles":"urn:lti:sysrole:ims\/lis\/Administrator"}'; + $json .= ',{"courseId":"'.$coursethree->id.'","courseName":"'.$coursethree->fullname.'","courseShortName":"'.$coursethree->shortname.'","roles":"urn:lti:sysrole:ims\/lis\/Administrator"}'; + $json .= ',{"courseId":"'.$coursefour->id.'","courseName":"'.$coursefour->fullname.'","courseShortName":"'.$coursefour->shortname.'","roles":"urn:lti:sysrole:ims\/lis\/Administrator"}]}'; + + $this->assertEquals(base64_encode($json), $result); + } + + /** + * Data provider for test_local_kaltura_url_contains_configured_hostname_fail(). + */ + public function uri_hostname_tests_invalid() { + return array( + array('http://phpunit1.tests/local_kaltura/tests'), + array('http://phpunit.2tests/local_kaltura/tests/'), + array('http://tests.phpunit/local_kaltura/tests/'), + ); + } + + /** + * Test test_local_kaltura_url_contains_configured_hostname_fail(). + * @param string $url differnt URI formats. + * @dataProvider uri_hostname_tests_invalid + */ + public function test_local_kaltura_url_contains_configured_hostname_fail($url) { + $this->resetAfterTest(true); + + set_config('kaf_uri', 'phpunit.tests', 'local_kaltura'); + + $result = local_kaltura_url_contains_configured_hostname($url); + $this->assertFalse($result); + } + + /** + * Data provider for test_local_kaltura_url_contains_configured_hostname(). + */ + public function uri_hostname_tests_valid() { + return array( + array('http://phpunit.tests/local_kaltura/'), + array('https://phpunit.tests/local_kaltura/tests/'), + ); + } + + /** + * Test test_local_kaltura_url_contains_configured_hostname(). + * @param string $url differnt URI formats. + * @dataProvider uri_hostname_tests_valid + */ + public function test_local_kaltura_url_contains_configured_hostname($url) { + $this->resetAfterTest(true); + + set_config('kaf_uri', 'phpunit.tests', 'local_kaltura'); + + $result = local_kaltura_url_contains_configured_hostname($url); + $this->assertTrue($result); + } + + /** + * Test local_kaltura_add_protocol_to_url(). + */ + public function test_local_kaltura_add_protocol_to_url() { + $expected = 'http://example.com'; + $url = local_kaltura_add_protocol_to_url($expected); + $this->assertEquals($expected, $url); + + $expected = 'https://example.com'; + $url = local_kaltura_add_protocol_to_url($expected); + $this->assertEquals($expected, $url); + + $expected = 'http://example.com'; + $url = local_kaltura_add_protocol_to_url('example.com'); + $this->assertEquals($expected, $url); + + $url = local_kaltura_add_protocol_to_url('htdddtp://example.com'); + $this->assertEmpty($url); + } + + /** + * Test local_kaltura_add_kaf_uri_token(). + */ + public function test_local_kaltura_add_kaf_uri_token() { + $this->resetAfterTest(true); + + // Set KAF URI to HTTP. + $url = 'http://this-is-a-test-with-phpunit.com'; + set_config('kaf_uri', $url, 'local_kaltura'); + + $path = '/phpunit/testing/test1/'; + $expected = $url.$path; + + // Test HTTP returns with the confgirued URL in HTTP. + $actual = 'http://'.KALTURA_URI_TOKEN.$path; + $result = local_kaltura_add_kaf_uri_token($actual); + + $this->assertEquals($expected, $result); + + // Test HTTPS returns with the configured URL in HTTP. + $actual = 'https://'.KALTURA_URI_TOKEN.$path; + $result = local_kaltura_add_kaf_uri_token($actual); + + $this->assertEquals($expected, $result); + + // Set KAF URI to HTTPS. + $url = 'https://this-is-a-test-with-phpunit.com'; + set_config('kaf_uri', $url, 'local_kaltura'); + $expected = $url.$path; + + // Test HTTP returns with the confgirued URL in HTTPS. + $actual = 'http://'.KALTURA_URI_TOKEN.$path; + $result = local_kaltura_add_kaf_uri_token($actual); + + $this->assertEquals($expected, $result); + + // Test HTTPS returns with the confgirued URL in HTTPS. + $actual = 'https://'.KALTURA_URI_TOKEN.$path; + $result = local_kaltura_add_kaf_uri_token($actual); + + $this->assertEquals($expected, $result); + } + + /** + * Test local_kaltura_encode_object_for_storage() + */ + public function test_local_kaltura_encode_object_for_storage() { + $data = array(); + $result = local_kaltura_encode_object_for_storage($data); + $this->assertEquals('', $result); + + $data = new stdClass(); + $result = local_kaltura_encode_object_for_storage($data); + $this->assertEquals('', $result); + + $data = 'hello'; + $result = local_kaltura_encode_object_for_storage($data); + $this->assertEquals('', $result); + + $data = ''; + $result = local_kaltura_encode_object_for_storage($data); + $this->assertEquals('', $result); + + $data = new stdClass(); + $data->one = 'abc'; + $data->two = 'def'; + $result = local_kaltura_encode_object_for_storage($data); + $expected = base64_encode(serialize($data)); + $this->assertEquals($expected, $result); + + $data = array('one' => 'abc', 'two' => 'def'); + $result = local_kaltura_encode_object_for_storage($data); + $expected = base64_encode(serialize($data)); + $this->assertEquals($expected, $result); + } + + /** + * Test local_kaltura_decode_object_for_storage() + */ + public function test_local_kaltura_decode_object_for_storage() { + $result = local_kaltura_decode_object_for_storage(''); + $this->assertEquals('', $result); + + $expected = new stdClass(); + $expected->one = 'abc'; + $expected->two = 'def'; + $data = base64_encode(serialize($expected)); + $result = local_kaltura_decode_object_for_storage($data); + $this->assertEquals($expected, $result); + + $expected = array('one' => 'abc', 'two' => 'def'); + $data = base64_encode(serialize($expected)); + $result = local_kaltura_decode_object_for_storage($data); + $this->assertEquals($expected, $result); + } + + /** + * Test local_kaltura_convert_kaltura_base_entry_object() + */ + public function test_local_kaltura_convert_kaltura_base_entry_object() { + $result = local_kaltura_convert_kaltura_base_entry_object(new stdclass()); + $this->assertFalse($result); + + // Test converting a video entry. + $time = time(); + $base = new KalturaMediaEntry(); + $base->dataUrl = 'http:/phpunittest.com'; + $base->width = 100; + $base->height = 200; + $base->id = 'phpunit'; + $base->name = 'phpunit title'; + $base->thumbnailUrl = 'http://phpunittest.com/thumb'; + $base->duration = 300; + $base->description = 'phpunit description'; + $base->createdAt = $time; + $base->creatorId = 'phpunit user'; + $base->tags = ''; + + $expected = new stdClass(); + $expected->url = ''; + $expected->dataurl = 'http:/phpunittest.com'; + $expected->width = 100; + $expected->height = 200; + $expected->entryid = 'phpunit'; + $expected->title = 'phpunit title'; + $expected->thumbnailurl = 'http://phpunittest.com/thumb'; + $expected->duration = 300; + $expected->description = 'phpunit description'; + $expected->createdat = $time; + $expected->owner = 'phpunit user'; + $expected->tags = ''; + $expected->showtitle = 'on'; + $expected->showdescription = 'on'; + $expected->showowner = 'on'; + $expected->player = ''; + $expected->size = ''; + + $result = local_kaltura_convert_kaltura_base_entry_object($base); + $this->assertEquals($expected, $result); + } +} diff --git a/local/kaltura/tests/migrationlib_test.php b/local/kaltura/tests/migrationlib_test.php new file mode 100644 index 0000000000000..787db66afa10a --- /dev/null +++ b/local/kaltura/tests/migrationlib_test.php @@ -0,0 +1,194 @@ +. + +/** + * Kaltura local_kaltura_migration_progress class phpunit tests. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +defined('MOODLE_INTERNAL') || die(); + +global $CFG; +require_once($CFG->dirroot.'/local/kaltura/locallib.php'); +require_once($CFG->dirroot.'/local/kaltura/migrationlib.php'); + +/** + * @group local_kaltura + */ +class local_kaltura_migrationlib_testcase extends advanced_testcase { + /** + * Test initialization of config values. + */ + public function test_initialization_of_config_values() { + $this->resetAfterTest(true); + + $result = new local_kaltura_migration_progress(); + $result = null; + + $configsettings = get_config(KALTURA_PLUGIN_NAME); + + $this->assertObjectHasAttribute('migrationstarted', $configsettings); + $this->assertObjectHasAttribute('existingcategoryrun', $configsettings); + $this->assertObjectHasAttribute('sharedcategoryrun', $configsettings); + $this->assertObjectHasAttribute('categoriescreated', $configsettings); + $this->assertObjectHasAttribute('entriesmigrated', $configsettings); + $this->assertObjectHasAttribute('kafcategoryrootid', $configsettings); + $this->assertEquals(0, $configsettings->migrationstarted); + $this->assertEquals(0, $configsettings->existingcategoryrun); + $this->assertEquals(0, $configsettings->sharedcategoryrun); + $this->assertEquals(0, $configsettings->categoriescreated); + $this->assertEquals(0, $configsettings->entriesmigrated); + $this->assertEquals(0, $configsettings->kafcategoryrootid); + } + + /** + * Test existingcategory accessor functions. + */ + public function test_existingcategoryrun() { + $this->resetAfterTest(true); + + $result = new local_kaltura_migration_progress(); + local_kaltura_migration_progress::set_existingcategoryrun(11); + $value = local_kaltura_migration_progress::get_existingcategoryrun(); + + $this->assertEquals(11, $value); + + $result = null; + $value = get_config(KALTURA_PLUGIN_NAME, 'existingcategoryrun'); + + $this->assertEquals(11, $value); + } + + /** + * Test sharedcategoryrun accessor functions. + */ + public function test_sharedcategoryrun() { + $this->resetAfterTest(true); + + $result = new local_kaltura_migration_progress(); + local_kaltura_migration_progress::set_sharedcategoryrun(11); + $value = local_kaltura_migration_progress::get_sharedcategoryrun(); + + $this->assertEquals(11, $value); + + $result = null; + $value = get_config(KALTURA_PLUGIN_NAME, 'sharedcategoryrun'); + + $this->assertEquals(11, $value); + } + + /** + * Test kafcategoryrootid functions. + */ + public function test_kafcategoryrootid() { + $this->resetAfterTest(true); + + $result = new local_kaltura_migration_progress(); + local_kaltura_migration_progress::set_kafcategoryrootid(11); + $value = local_kaltura_migration_progress::get_kafcategoryrootid(); + + $this->assertEquals(11, $value); + + $result = null; + $value = get_config(KALTURA_PLUGIN_NAME, 'kafcategoryrootid'); + + $this->assertEquals(11, $value); + } + + /** + * Test categoriescreated functions. + */ + public function test_categoriescreated() { + $this->resetAfterTest(true); + + $result = new local_kaltura_migration_progress(); + local_kaltura_migration_progress::increment_categoriescreated(); + $value = local_kaltura_migration_progress::get_categoriescreated(); + + $this->assertEquals(1, $value); + + $result = null; + $value = get_config(KALTURA_PLUGIN_NAME, 'categoriescreated'); + + $this->assertEquals(1, $value); + } + + /** + * Test entriesmigrated functions. + */ + public function test_entriesmigrated() { + $this->resetAfterTest(true); + + $result = new local_kaltura_migration_progress(); + local_kaltura_migration_progress::increment_entriesmigrated(); + $value = local_kaltura_migration_progress::get_entriesmigrated(); + + $this->assertEquals(1, $value); + + $result = null; + $value = get_config(KALTURA_PLUGIN_NAME, 'entriesmigrated'); + + $this->assertEquals(1, $value); + } + + /** + * Test migrationstarted functions. + */ + public function test_migrationstarted() { + $this->resetAfterTest(true); + + $result = new local_kaltura_migration_progress(); + local_kaltura_migration_progress::init_migrationstarted(); + $value = local_kaltura_migration_progress::get_migrationstarted(); + + $this->assertNotEquals(0, $value); + + $result = null; + $value = get_config(KALTURA_PLUGIN_NAME, 'migrationstarted'); + + $this->assertNotEquals(0, $value); + } + + /** + * Test resetting all migration progress properties functions. + */ + public function test_resetall() { + $this->resetAfterTest(true); + + $result = new local_kaltura_migration_progress(); + local_kaltura_migration_progress::set_existingcategoryrun(11); + local_kaltura_migration_progress::set_sharedcategoryrun(11); + local_kaltura_migration_progress::increment_categoriescreated(); + local_kaltura_migration_progress::increment_entriesmigrated(); + local_kaltura_migration_progress::init_migrationstarted(); + local_kaltura_migration_progress::set_kafcategoryrootid(11); + local_kaltura_migration_progress::reset_all(); + + $result = null; + + $configsettings = get_config(KALTURA_PLUGIN_NAME); + $this->assertEquals(0, $configsettings->migrationstarted); + $this->assertEquals(0, $configsettings->existingcategoryrun); + $this->assertEquals(0, $configsettings->sharedcategoryrun); + $this->assertEquals(0, $configsettings->categoriescreated); + $this->assertEquals(0, $configsettings->entriesmigrated); + $this->assertEquals(0, $configsettings->kafcategoryrootid); + } +} \ No newline at end of file diff --git a/local/kaltura/version.php b/local/kaltura/version.php new file mode 100644 index 0000000000000..05dc484b3fcae --- /dev/null +++ b/local/kaltura/version.php @@ -0,0 +1,62 @@ +. + +/** + * Kaltura version file. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +$plugin->version = 2024100702; +$plugin->component = 'local_kaltura'; +$plugin->release = 'Kaltura release 4.5.1'; +$plugin->requires = 2024042200; +$plugin->maturity = MATURITY_STABLE; + +try { + global $DB; + + $localKalturaPluginVersionRecord = $DB->get_records_select('config_plugins', "plugin = 'local_kaltura' AND name = 'version'"); + + $kalturaPluginVersion = ""; + if ($localKalturaPluginVersionRecord) { + $localKalturaPluginVersionRecordValue = array_pop($localKalturaPluginVersionRecord); + $kalturaPluginVersion = $localKalturaPluginVersionRecordValue->value; + } + + $updatedVersion = null; + if ($kalturaPluginVersion == 20210620311) { + $updatedVersion = 2021051700; + } else if ($kalturaPluginVersion == 20201215310 || $kalturaPluginVersion == 20210620310) { + $updatedVersion = 2020110900; + } else if ($kalturaPluginVersion == 2020070539 || $kalturaPluginVersion == 2020121539 || $kalturaPluginVersion == 2021062039) { + $updatedVersion = 2020061500; + } + + if (!empty($updatedVersion)) { + $pluginsRecords = $DB->get_records_select('config_plugins', "plugin in ('local_kaltura', 'local_kalturamediagallery', 'local_mymedia', 'atto_kalturamedia','block_kalturamediagallery','filter_kaltura','tinymce_kalturamedia','mod_kalvidassign','mod_kalvidres', 'tiny_kalturamedia') AND name = 'version' AND value = '$kalturaPluginVersion'"); + + foreach ($pluginsRecords as $record) { + $record->value = $updatedVersion; + $DB->update_record('config_plugins', $record); + } + } +} catch (Exception $e) {} diff --git a/local/kaltura/yui/build/moodle-local_kaltura-lticontainer/moodle-local_kaltura-lticontainer-debug.js b/local/kaltura/yui/build/moodle-local_kaltura-lticontainer/moodle-local_kaltura-lticontainer-debug.js new file mode 100644 index 0000000000000..4479d14bca651 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-lticontainer/moodle-local_kaltura-lticontainer-debug.js @@ -0,0 +1,203 @@ +YUI.add('moodle-local_kaltura-lticontainer', function (Y, NAME) { + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module used to resize the LTI launch container. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/* eslint-disable max-len */ + +/** + * This method calls the base class constructor + * @method LTICONTAINER + */ +var LTICONTAINER = function() { + LTICONTAINER.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTICONTAINER, Y.Base, { + /** + * The last known height of the element. + * @property lastheight + * @type {Integer} + * @default null + */ + lastheight: null, + + /** + * Add padding to make the bottom of the iframe visible. The iframe wasn't visible on some themes. Probably because of border widths, etc. + * @property padding + * @type {Integer} + * @default 15 + */ + padding: 15, + + /** + * Height of window. + * @property viewportheight + * @type {Integer} + * @default 15 + */ + viewportheight: null, + + /** + * Height of the entire document. + * @property documentheight + * @type {Integer} + * @default null + */ + documentheight: null, + + /** + * Height of the body element. + * @property documentheight + * @type {Integer} + * @default null + */ + clientheight: null, + + /** + * User video width size selection. + * @property kalvidwidth + * @type {Integer} + * @default null + */ + kalvidwidth: null, + + /** + * The YUI node object for the iframe container. + * @property ltiframe + * @type {Object} + * @default null + */ + ltiframe: null, + + /** + * The width of the entry + * @property width + * @type {int} + * @default null + */ + width: null, + + /** + * The height of the entry + * @property height + * @type {int} + * @default null + */ + height: null, + + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(params) { + var bodynode = Y.one('body[class~='+params.bodyclass+']'); + + if(params.height && params.width) + { + this.height = params.height; + this.width = params.width; + } + + this.lastheight = params.lastheight; + this.padding = params.padding; + this.viewportheight = bodynode.get('winHeight'); + this.documentheight = bodynode.get('docHeight'); + this.clientheight = bodynode.getDOMNode.clientHeight; + this.ltiframe = Y.one('#contentframe'); + this.kalvidwidth = params.kalvidwidth; + + this.resize(); + this.timer = Y.later(250, this, this.resize); + }, + + /** + * This function resizes the iframe height and width. + */ + resize : function() { + if (this.lastheight !== Math.min(this.documentheight, this.viewportheight)) { + var newheight = this.viewportheight - this.ltiframe.getY() - this.padding; + //Get the original height which is 600px, but we're getting it as 600px and need to remove the last two characters + var originalheight = this.ltiframe._node.height.slice(0,this.ltiframe._node.height.length-2); + if (newheight < originalheight) { + return; + } + this.ltiframe.setStyle('height', newheight+'px'); + this.lastheight = Math.min(this.documentheight, this.viewportheight); + } + + var kalvidcontent = Y.one('#kalvid_content'); + if (kalvidcontent !== null) { + var maxwidth = kalvidcontent.get('offsetWidth'); + var allowedsize = maxwidth - this.padding; + + if (this.kalvidwidth !== null) { + // Double current user's video width selection as requested by Kaltura. + var newsize = this.kalvidwidth * 2; + + // If "newsize" if over allowed size then set it to the maximum allowed. + if (newsize > allowedsize) { + this.ltiframe.setStyle('width', allowedsize+'px'); + } else { + this.ltiframe.setStyle('width', newsize+'px'); + } + } + } + + // if we have the entry's dimensions - use them to adjust the iframe size. + if(this.height && this.width) + { + this.ltiframe.setStyle('width', this.width+'px'); + this.ltiframe.setStyle('height', this.height+'px'); + } + } +}, +{ + NAME : 'moodle-local_kaltura-lticontainer', + ATTRS : { + bodyclass : { + value : null + }, + lastheight : { + value : null + }, + padding: { + value : 15 + } + } +}); +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for lticontainer module + * @param string params additional parameters. + * @return object the lticontainer object + */ +M.local_kaltura.init = function(params) { + return new LTICONTAINER(params); +}; + + +}, '@VERSION@', {"requires": ["base", "node"]}); diff --git a/local/kaltura/yui/build/moodle-local_kaltura-lticontainer/moodle-local_kaltura-lticontainer-min.js b/local/kaltura/yui/build/moodle-local_kaltura-lticontainer/moodle-local_kaltura-lticontainer-min.js new file mode 100644 index 0000000000000..f5a8e7c1a72dd --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-lticontainer/moodle-local_kaltura-lticontainer-min.js @@ -0,0 +1 @@ +YUI.add("moodle-local_kaltura-lticontainer",function(h,t){var i=function(){i.superclass.constructor.apply(this,arguments)};h.extend(i,h.Base,{lastheight:null,padding:15,viewportheight:null,documentheight:null,clientheight:null,kalvidwidth:null,ltiframe:null,width:null,height:null,init:function(t){var i=h.one("body[class~="+t.bodyclass+"]");t.height&&t.width&&(this.height=t.height,this.width=t.width),this.lastheight=t.lastheight,this.padding=t.padding,this.viewportheight=i.get("winHeight"),this.documentheight=i.get("docHeight"),this.clientheight=i.getDOMNode.clientHeight,this.ltiframe=h.one("#contentframe"),this.kalvidwidth=t.kalvidwidth,this.resize(),this.timer=h.later(250,this,this.resize)},resize:function(){var t,i;if(this.lastheight!==Math.min(this.documentheight,this.viewportheight)){if((t=this.viewportheight-this.ltiframe.getY()-this.padding). + +/** + * YUI module used to resize the LTI launch container. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/* eslint-disable max-len */ + +/** + * This method calls the base class constructor + * @method LTICONTAINER + */ +var LTICONTAINER = function() { + LTICONTAINER.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTICONTAINER, Y.Base, { + /** + * The last known height of the element. + * @property lastheight + * @type {Integer} + * @default null + */ + lastheight: null, + + /** + * Add padding to make the bottom of the iframe visible. The iframe wasn't visible on some themes. Probably because of border widths, etc. + * @property padding + * @type {Integer} + * @default 15 + */ + padding: 15, + + /** + * Height of window. + * @property viewportheight + * @type {Integer} + * @default 15 + */ + viewportheight: null, + + /** + * Height of the entire document. + * @property documentheight + * @type {Integer} + * @default null + */ + documentheight: null, + + /** + * Height of the body element. + * @property documentheight + * @type {Integer} + * @default null + */ + clientheight: null, + + /** + * User video width size selection. + * @property kalvidwidth + * @type {Integer} + * @default null + */ + kalvidwidth: null, + + /** + * The YUI node object for the iframe container. + * @property ltiframe + * @type {Object} + * @default null + */ + ltiframe: null, + + /** + * The width of the entry + * @property width + * @type {int} + * @default null + */ + width: null, + + /** + * The height of the entry + * @property height + * @type {int} + * @default null + */ + height: null, + + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(params) { + var bodynode = Y.one('body[class~='+params.bodyclass+']'); + + if(params.height && params.width) + { + this.height = params.height; + this.width = params.width; + } + + this.lastheight = params.lastheight; + this.padding = params.padding; + this.viewportheight = bodynode.get('winHeight'); + this.documentheight = bodynode.get('docHeight'); + this.clientheight = bodynode.getDOMNode.clientHeight; + this.ltiframe = Y.one('#contentframe'); + this.kalvidwidth = params.kalvidwidth; + + this.resize(); + this.timer = Y.later(250, this, this.resize); + }, + + /** + * This function resizes the iframe height and width. + */ + resize : function() { + if (this.lastheight !== Math.min(this.documentheight, this.viewportheight)) { + var newheight = this.viewportheight - this.ltiframe.getY() - this.padding; + //Get the original height which is 600px, but we're getting it as 600px and need to remove the last two characters + var originalheight = this.ltiframe._node.height.slice(0,this.ltiframe._node.height.length-2); + if (newheight < originalheight) { + return; + } + this.ltiframe.setStyle('height', newheight+'px'); + this.lastheight = Math.min(this.documentheight, this.viewportheight); + } + + var kalvidcontent = Y.one('#kalvid_content'); + if (kalvidcontent !== null) { + var maxwidth = kalvidcontent.get('offsetWidth'); + var allowedsize = maxwidth - this.padding; + + if (this.kalvidwidth !== null) { + // Double current user's video width selection as requested by Kaltura. + var newsize = this.kalvidwidth * 2; + + // If "newsize" if over allowed size then set it to the maximum allowed. + if (newsize > allowedsize) { + this.ltiframe.setStyle('width', allowedsize+'px'); + } else { + this.ltiframe.setStyle('width', newsize+'px'); + } + } + } + + // if we have the entry's dimensions - use them to adjust the iframe size. + if(this.height && this.width) + { + this.ltiframe.setStyle('width', this.width+'px'); + this.ltiframe.setStyle('height', this.height+'px'); + } + } +}, +{ + NAME : 'moodle-local_kaltura-lticontainer', + ATTRS : { + bodyclass : { + value : null + }, + lastheight : { + value : null + }, + padding: { + value : 15 + } + } +}); +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for lticontainer module + * @param string params additional parameters. + * @return object the lticontainer object + */ +M.local_kaltura.init = function(params) { + return new LTICONTAINER(params); +}; + + +}, '@VERSION@', {"requires": ["base", "node"]}); diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-debug.js b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-debug.js new file mode 100644 index 0000000000000..528dc3214aba5 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-debug.js @@ -0,0 +1,367 @@ +YUI.add('moodle-local_kaltura-ltipanel', function (Y, NAME) { + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module for displaying an LTI launch within a YUI panel. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/* eslint-disable max-len */ + + /** + * This method calls the base class constructor + * @method LTIPANEL + */ +var LTIPANEL = function() { + LTIPANEL.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTIPANEL, Y.Base, { + /** + * The name of the initiating module. + * @property modulename + * @type {String} + * @default null + */ + modulename: null, + + /** + * The id value of the add media button. + * @property addvidbtnid + * @type {String} + * @default null + */ + addvidbtnid: null, + + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(params) { + // Check to make sure parameters are initialized + if ('0' === params.addvidbtnid || '0' === params.ltilaunchurl || 0 === params.courseid || 0 === params.height || 0 === params.width) { + alert('Some parameters were not initialized.'); + return; + } + + this.modulename = params.modulename; + this.addvidbtnid = params.addvidbtnid; + + var addvideobtn = Y.one('#'+params.addvidbtnid); + addvideobtn.on('click', this.open_bse_popup_callback, this, params.ltilaunchurl, params.height, params.width); + }, + + /** + * Event handler callback for when the add video button is clicked. This function creates the a panel element. + * @property e + * @type {Object} + */ + open_bse_popup_callback : function(e, url, height, width) { + var w = 1200; + var h = 700; + var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; + var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; + + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + + var left = ((width / 2) - (w / 2)) + dualScreenLeft; + var top = ((height / 2) - (h / 2)) + dualScreenTop; + var bsePopup = window.open(url, M.util.get_string("browse_and_embed", "local_kaltura"), 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); + + if (window.focus) { + bsePopup.focus(); + } + + document.body.bsePopup = bsePopup; + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; + document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); + }, + + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; + }, + + + + /** + * Event handler callback for when a simulated click event is triggered on a specifc element. + */ + close_popup_callback : function() { + // hide the thumbnail image. + var imagenode = Y.one('img[id=video_thumbnail]'); + imagenode.setStyle('display', 'none'); + // Update the iframe element attributes + var iframenode = Y.one('iframe[id=contentframe]'); + iframenode.setAttribute('width', Y.one('input[id=width]').getAttribute('value')); + iframenode.setAttribute('height', Y.one('input[id=height]').getAttribute('value')); + iframenode.setStyle('display', 'inline'); + + // If the page is a Video resource execute a function to change the button caption KALDEV-579 + var element = Y.one('input[name=modulename]'); + + if (undefined !== element && 'kalvidres' === this.modulename) { + this.lti_panel_change_add_media_button_caption(); + } + + document.body.bsePopup.close(); + }, + + lti_panel_change_add_media_button_caption : function() { + // Need to find a better way of doing this. Change was made for KALDEV-579. + var buttoncaption = M.util.get_string('replace_video', this.modulename); + if (buttoncaption !== Y.one('#'+this.addvidbtnid).getAttribute('value')) { + Y.one('#'+this.addvidbtnid).setAttribute('value', buttoncaption); + } + }, +}, +{ + NAME : 'moodle-local_kaltura-ltipanel', + ATTRS : { + addvidbtnid : { + value: '0' + }, + ltilaunchurl : { + value: '0' + }, + height : { + value: 0 + }, + width : { + value: 0 + }, + modulename : { + value: '' + } + } +}); + +/** + * This method calls the base class constructor. The primary difference between LTIPANELMEDIAASSIGNMENT and LTIPANEL is that + * LTIPANELMEDIAASSIGNMENT creates a node and appends it to the body tag of the page. The reason for this is due to an issue with the Moodle + * navbar covering up part of the YUI panel, if the panel markup is appended to a child element within the body tag. + * @method LTIPANELMEDIAASSIGNMENT + */ +var LTIPANELMEDIAASSIGNMENT = function() { + LTIPANELMEDIAASSIGNMENT.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTIPANELMEDIAASSIGNMENT, Y.Base, { + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(params) { + // Check to make sure parameters are initialized + if ('0' === params.addvidbtnid || '0' === params.ltilaunchurl || 0 === params.courseid || 0 === params.height || 0 === params.width) { + return; + } + + var addvideobtn = Y.one('#'+params.addvidbtnid); + addvideobtn.on('click', this.open_bse_popup_callback, this, params.ltilaunchurl, params.height, params.width); + }, + + /** + * Event handler callback for when the panel content is changed + * @property e + * @type {Object} + */ + open_bse_popup_callback: function(e, url, height, width) { + var w = 1200; + var h = 700; + var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; + var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; + + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + + var left = ((width / 2) - (w / 2)) + dualScreenLeft; + var top = ((height / 2) - (h / 2)) + dualScreenTop; + var bsePopup = window.open(url, M.util.get_string("browse_and_embed", "local_kaltura"), 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); + + if (window.focus) { + bsePopup.focus(); + } + + document.body.bsePopup = bsePopup; + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; + document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); + }, + + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; + }, + + close_popup_callback: function() { + Y.one('input[id=submit_video]').removeAttribute('disabled'); + // hide the thumbnail image. + var imagenode = Y.one('img[id=video_thumbnail]'); + imagenode.setStyle('display', 'none'); + // Update the iframe element attributes + var iframenode = Y.one('iframe[id=contentframe]'); + iframenode.setAttribute('width', Y.one('input[id=width]').getAttribute('value')); + iframenode.setAttribute('height', Y.one('input[id=height]').getAttribute('value')); + iframenode.setStyle('display', 'inline'); + Y.one('#id_add_video').set('value', M.util.get_string('replacevideo', 'kalvidassign')); + // Update button classes. + Y.one('#id_add_video').addClass('btn-secondary'); + Y.one('#submit_video').addClass('btn-primary'); + Y.one('#id_add_video').removeClass('btn-primary'); + Y.one('#submit_video').removeClass('btn-secondary'); + document.body.bsePopup.close(); + }, + +}, +{ + NAME : 'moodle-local_kaltura-ltipanel', + ATTRS : { + addvidbtnid : { + value: '0' + }, + ltilaunchurl : { + value: '0' + }, + height : { + value: 0 + }, + width : { + value: 0 + } + } +}); + +/** + * This method calls the base class constructor. This module renders a Panel for viewing media from multiple sources. + * @method LTISUBMISSIONREVIEW + */ +var LTISUBMISSIONREVIEW = function() { + LTISUBMISSIONREVIEW.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTISUBMISSIONREVIEW, Y.Base, { + /** + * An instance of the ltimediaassignment class. + * @property ltimediaassignment + * @type {Object} + * @default null + */ + ltimediaassignment: null, + + + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(ltimediaassignment) { + this.ltimediaassignment = ltimediaassignment; + Y.one('form[id=fastgrade]').delegate('click', this.review_submission, 'a[name=submission_source]', this); + }, + + /** + * Callback function for when a user clicks on the review submission link. + * @property e + * @type {Object} + */ + review_submission : function(e) { + e.preventDefault(); + var source, height, width; + // Test if the target is an anchor tag or img tag. + if (e.target.test('a')) { + source = e.target.getAttribute('href'); + height = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=height]').get('value'); + width = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=width]').get('value'); + } else { + source = e.target.ancestor('a[name=submission_source]').getAttribute('href'); + height = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=height]').get('value'); + width = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=width]').get('value'); + } + + this.ltimediaassignment.open_bse_popup_callback(null, source, height, width); + } +}, +{ + NAME : 'moodle-local_kaltura-ltipanel' +}); + +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for ltipanel module + * @param string params additional parameters. + * @return object the ltipanel object + */ +M.local_kaltura.init = function(params) { + return new LTIPANEL(params); +}; + +/** + * Entry point for ltipanelmediaassignment module + * @param string params additional parameters. + * @return object the ltipanel object + */ +M.local_kaltura.initmediaassignment = function(params) { + return new LTIPANELMEDIAASSIGNMENT(params); +}; + +/** + * Entry point for ltipanelmediaassignment module + * @param string params additional parameters. + * @return object the ltipanel object + */ +M.local_kaltura.initreviewsubmission = function() { + var args = { + addvidbtnid: '0', + ltilaunchurl: '0', + courseid: 0, + height: 0, + width: 0 + }; + var mediaassignment = new LTIPANELMEDIAASSIGNMENT(args); + return new LTISUBMISSIONREVIEW(mediaassignment); +}; + + +}, '@VERSION@', {"requires": ["base", "node", "panel", "node-event-simulate"]}); diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-min.js b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-min.js new file mode 100644 index 0000000000000..83e6afa907d44 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel-min.js @@ -0,0 +1 @@ +YUI.add("moodle-local_kaltura-ltipanel",function(t,e){var n,i,d=function(){d.superclass.constructor.apply(this,arguments)};t.extend(d,t.Base,{modulename:null,addvidbtnid:null,init:function(e){"0"!==e.addvidbtnid&&"0"!==e.ltilaunchurl&&0!==e.courseid&&0!==e.height&&0!==e.width?(this.modulename=e.modulename,this.addvidbtnid=e.addvidbtnid,t.one("#"+e.addvidbtnid).on("click",this.open_bse_popup_callback,this,e.ltilaunchurl,e.height,e.width)):alert("Some parameters were not initialized.")},open_bse_popup_callback:function(e,t,n,i){var d=window.screenLeft!=undefined?window.screenLeft:screen.left,o=window.screenTop!=undefined?window.screenTop:screen.top,d=(window.innerWidth||document.documentElement.clientWidth||screen.width)/2-600+d,o=(window.innerHeight||document.documentElement.clientHeight||screen.height)/2-350+o,t=window.open(t,M.util.get_string("browse_and_embed","local_kaltura"),"scrollbars=yes, width=1200, height=700, top="+o+", left="+d);window.focus&&t.focus(),document.body.bsePopup=t,o=this.createEntrySelectedEvent(),document.body.entrySelectedEvent=o,document.body.addEventListener("entrySelected",this.close_popup_callback.bind(this),!1)},createEntrySelectedEvent:function(){var e;return"function"==typeof window.CustomEvent?e=new CustomEvent("entrySelected"):(e=document.createEvent("CustomEvent")).initCustomEvent("entrySelected",!1,!1,{}),e},close_popup_callback:function(){var e=t.one("img[id=video_thumbnail]");e.setStyle("display","none"),(e=t.one("iframe[id=contentframe]")).setAttribute("width",t.one("input[id=width]").getAttribute("value")),e.setAttribute("height",t.one("input[id=height]").getAttribute("value")),e.setStyle("display","inline"),e=t.one("input[name=modulename]"),undefined!==e&&"kalvidres"===this.modulename&&this.lti_panel_change_add_media_button_caption(),document.body.bsePopup.close()},lti_panel_change_add_media_button_caption:function(){var e=M.util.get_string("replace_video",this.modulename);e!==t.one("#"+this.addvidbtnid).getAttribute("value")&&t.one("#"+this.addvidbtnid).setAttribute("value",e)}},{NAME:"moodle-local_kaltura-ltipanel",ATTRS:{addvidbtnid:{value:"0"},ltilaunchurl:{value:"0"},height:{value:0},width:{value:0},modulename:{value:""}}}),t.extend(n=function(){n.superclass.constructor.apply(this,arguments)},t.Base,{init:function(e){"0"!==e.addvidbtnid&&"0"!==e.ltilaunchurl&&0!==e.courseid&&0!==e.height&&0!==e.width&&t.one("#"+e.addvidbtnid).on("click",this.open_bse_popup_callback,this,e.ltilaunchurl,e.height,e.width)},open_bse_popup_callback:function(e,t,n,i){var d=window.screenLeft!=undefined?window.screenLeft:screen.left,o=window.screenTop!=undefined?window.screenTop:screen.top,d=(window.innerWidth||document.documentElement.clientWidth||screen.width)/2-600+d,o=(window.innerHeight||document.documentElement.clientHeight||screen.height)/2-350+o,t=window.open(t,M.util.get_string("browse_and_embed","local_kaltura"),"scrollbars=yes, width=1200, height=700, top="+o+", left="+d);window.focus&&t.focus(),document.body.bsePopup=t,o=this.createEntrySelectedEvent(),document.body.entrySelectedEvent=o,document.body.addEventListener("entrySelected",this.close_popup_callback.bind(this),!1)},createEntrySelectedEvent:function(){var e;return"function"==typeof window.CustomEvent?e=new CustomEvent("entrySelected"):(e=document.createEvent("CustomEvent")).initCustomEvent("entrySelected",!1,!1,{}),e},close_popup_callback:function(){var e;t.one("input[id=submit_video]").removeAttribute("disabled"),t.one("img[id=video_thumbnail]").setStyle("display","none"),(e=t.one("iframe[id=contentframe]")).setAttribute("width",t.one("input[id=width]").getAttribute("value")),e.setAttribute("height",t.one("input[id=height]").getAttribute("value")),e.setStyle("display","inline"),t.one("#id_add_video").set("value",M.util.get_string("replacevideo","kalvidassign")),t.one("#id_add_video").addClass("btn-secondary"),t.one("#submit_video").addClass("btn-primary"),t.one("#id_add_video").removeClass("btn-primary"),t.one("#submit_video").removeClass("btn-secondary"),document.body.bsePopup.close()}},{NAME:"moodle-local_kaltura-ltipanel",ATTRS:{addvidbtnid:{value:"0"},ltilaunchurl:{value:"0"},height:{value:0},width:{value:0}}}),t.extend(i=function(){i.superclass.constructor.apply(this,arguments)},t.Base,{ltimediaassignment:null,init:function(e){this.ltimediaassignment=e,t.one("form[id=fastgrade]").delegate("click",this.review_submission,"a[name=submission_source]",this)},review_submission:function(e){var t,n;e.preventDefault(),e=(n=(t=(e.target.test("a")?e.target:e.target.ancestor("a[name=submission_source]")).getAttribute("href"),e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=height]").get("value")),e.target.ancestor("div[name=media_submission]").get("childNodes").filter("input[name=width]").get("value")),this.ltimediaassignment.open_bse_popup_callback(null,t,n,e)}},{NAME:"moodle-local_kaltura-ltipanel"}),M.local_kaltura=M.local_kaltura||{},M.local_kaltura.init=function(e){return new d(e)},M.local_kaltura.initmediaassignment=function(e){return new n(e)},M.local_kaltura.initreviewsubmission=function(){var e={addvidbtnid:"0",ltilaunchurl:"0",courseid:0,height:0,width:0},e=new n(e);return new i(e)}},"@VERSION@",{requires:["base","node","panel","node-event-simulate"]}); \ No newline at end of file diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel.js b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel.js new file mode 100644 index 0000000000000..528dc3214aba5 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltipanel/moodle-local_kaltura-ltipanel.js @@ -0,0 +1,367 @@ +YUI.add('moodle-local_kaltura-ltipanel', function (Y, NAME) { + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module for displaying an LTI launch within a YUI panel. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/* eslint-disable max-len */ + + /** + * This method calls the base class constructor + * @method LTIPANEL + */ +var LTIPANEL = function() { + LTIPANEL.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTIPANEL, Y.Base, { + /** + * The name of the initiating module. + * @property modulename + * @type {String} + * @default null + */ + modulename: null, + + /** + * The id value of the add media button. + * @property addvidbtnid + * @type {String} + * @default null + */ + addvidbtnid: null, + + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(params) { + // Check to make sure parameters are initialized + if ('0' === params.addvidbtnid || '0' === params.ltilaunchurl || 0 === params.courseid || 0 === params.height || 0 === params.width) { + alert('Some parameters were not initialized.'); + return; + } + + this.modulename = params.modulename; + this.addvidbtnid = params.addvidbtnid; + + var addvideobtn = Y.one('#'+params.addvidbtnid); + addvideobtn.on('click', this.open_bse_popup_callback, this, params.ltilaunchurl, params.height, params.width); + }, + + /** + * Event handler callback for when the add video button is clicked. This function creates the a panel element. + * @property e + * @type {Object} + */ + open_bse_popup_callback : function(e, url, height, width) { + var w = 1200; + var h = 700; + var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; + var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; + + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + + var left = ((width / 2) - (w / 2)) + dualScreenLeft; + var top = ((height / 2) - (h / 2)) + dualScreenTop; + var bsePopup = window.open(url, M.util.get_string("browse_and_embed", "local_kaltura"), 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); + + if (window.focus) { + bsePopup.focus(); + } + + document.body.bsePopup = bsePopup; + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; + document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); + }, + + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; + }, + + + + /** + * Event handler callback for when a simulated click event is triggered on a specifc element. + */ + close_popup_callback : function() { + // hide the thumbnail image. + var imagenode = Y.one('img[id=video_thumbnail]'); + imagenode.setStyle('display', 'none'); + // Update the iframe element attributes + var iframenode = Y.one('iframe[id=contentframe]'); + iframenode.setAttribute('width', Y.one('input[id=width]').getAttribute('value')); + iframenode.setAttribute('height', Y.one('input[id=height]').getAttribute('value')); + iframenode.setStyle('display', 'inline'); + + // If the page is a Video resource execute a function to change the button caption KALDEV-579 + var element = Y.one('input[name=modulename]'); + + if (undefined !== element && 'kalvidres' === this.modulename) { + this.lti_panel_change_add_media_button_caption(); + } + + document.body.bsePopup.close(); + }, + + lti_panel_change_add_media_button_caption : function() { + // Need to find a better way of doing this. Change was made for KALDEV-579. + var buttoncaption = M.util.get_string('replace_video', this.modulename); + if (buttoncaption !== Y.one('#'+this.addvidbtnid).getAttribute('value')) { + Y.one('#'+this.addvidbtnid).setAttribute('value', buttoncaption); + } + }, +}, +{ + NAME : 'moodle-local_kaltura-ltipanel', + ATTRS : { + addvidbtnid : { + value: '0' + }, + ltilaunchurl : { + value: '0' + }, + height : { + value: 0 + }, + width : { + value: 0 + }, + modulename : { + value: '' + } + } +}); + +/** + * This method calls the base class constructor. The primary difference between LTIPANELMEDIAASSIGNMENT and LTIPANEL is that + * LTIPANELMEDIAASSIGNMENT creates a node and appends it to the body tag of the page. The reason for this is due to an issue with the Moodle + * navbar covering up part of the YUI panel, if the panel markup is appended to a child element within the body tag. + * @method LTIPANELMEDIAASSIGNMENT + */ +var LTIPANELMEDIAASSIGNMENT = function() { + LTIPANELMEDIAASSIGNMENT.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTIPANELMEDIAASSIGNMENT, Y.Base, { + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(params) { + // Check to make sure parameters are initialized + if ('0' === params.addvidbtnid || '0' === params.ltilaunchurl || 0 === params.courseid || 0 === params.height || 0 === params.width) { + return; + } + + var addvideobtn = Y.one('#'+params.addvidbtnid); + addvideobtn.on('click', this.open_bse_popup_callback, this, params.ltilaunchurl, params.height, params.width); + }, + + /** + * Event handler callback for when the panel content is changed + * @property e + * @type {Object} + */ + open_bse_popup_callback: function(e, url, height, width) { + var w = 1200; + var h = 700; + var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; + var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; + + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + + var left = ((width / 2) - (w / 2)) + dualScreenLeft; + var top = ((height / 2) - (h / 2)) + dualScreenTop; + var bsePopup = window.open(url, M.util.get_string("browse_and_embed", "local_kaltura"), 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); + + if (window.focus) { + bsePopup.focus(); + } + + document.body.bsePopup = bsePopup; + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; + document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); + }, + + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; + }, + + close_popup_callback: function() { + Y.one('input[id=submit_video]').removeAttribute('disabled'); + // hide the thumbnail image. + var imagenode = Y.one('img[id=video_thumbnail]'); + imagenode.setStyle('display', 'none'); + // Update the iframe element attributes + var iframenode = Y.one('iframe[id=contentframe]'); + iframenode.setAttribute('width', Y.one('input[id=width]').getAttribute('value')); + iframenode.setAttribute('height', Y.one('input[id=height]').getAttribute('value')); + iframenode.setStyle('display', 'inline'); + Y.one('#id_add_video').set('value', M.util.get_string('replacevideo', 'kalvidassign')); + // Update button classes. + Y.one('#id_add_video').addClass('btn-secondary'); + Y.one('#submit_video').addClass('btn-primary'); + Y.one('#id_add_video').removeClass('btn-primary'); + Y.one('#submit_video').removeClass('btn-secondary'); + document.body.bsePopup.close(); + }, + +}, +{ + NAME : 'moodle-local_kaltura-ltipanel', + ATTRS : { + addvidbtnid : { + value: '0' + }, + ltilaunchurl : { + value: '0' + }, + height : { + value: 0 + }, + width : { + value: 0 + } + } +}); + +/** + * This method calls the base class constructor. This module renders a Panel for viewing media from multiple sources. + * @method LTISUBMISSIONREVIEW + */ +var LTISUBMISSIONREVIEW = function() { + LTISUBMISSIONREVIEW.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTISUBMISSIONREVIEW, Y.Base, { + /** + * An instance of the ltimediaassignment class. + * @property ltimediaassignment + * @type {Object} + * @default null + */ + ltimediaassignment: null, + + + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(ltimediaassignment) { + this.ltimediaassignment = ltimediaassignment; + Y.one('form[id=fastgrade]').delegate('click', this.review_submission, 'a[name=submission_source]', this); + }, + + /** + * Callback function for when a user clicks on the review submission link. + * @property e + * @type {Object} + */ + review_submission : function(e) { + e.preventDefault(); + var source, height, width; + // Test if the target is an anchor tag or img tag. + if (e.target.test('a')) { + source = e.target.getAttribute('href'); + height = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=height]').get('value'); + width = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=width]').get('value'); + } else { + source = e.target.ancestor('a[name=submission_source]').getAttribute('href'); + height = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=height]').get('value'); + width = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=width]').get('value'); + } + + this.ltimediaassignment.open_bse_popup_callback(null, source, height, width); + } +}, +{ + NAME : 'moodle-local_kaltura-ltipanel' +}); + +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for ltipanel module + * @param string params additional parameters. + * @return object the ltipanel object + */ +M.local_kaltura.init = function(params) { + return new LTIPANEL(params); +}; + +/** + * Entry point for ltipanelmediaassignment module + * @param string params additional parameters. + * @return object the ltipanel object + */ +M.local_kaltura.initmediaassignment = function(params) { + return new LTIPANELMEDIAASSIGNMENT(params); +}; + +/** + * Entry point for ltipanelmediaassignment module + * @param string params additional parameters. + * @return object the ltipanel object + */ +M.local_kaltura.initreviewsubmission = function() { + var args = { + addvidbtnid: '0', + ltilaunchurl: '0', + courseid: 0, + height: 0, + width: 0 + }; + var mediaassignment = new LTIPANELMEDIAASSIGNMENT(args); + return new LTISUBMISSIONREVIEW(mediaassignment); +}; + + +}, '@VERSION@', {"requires": ["base", "node", "panel", "node-event-simulate"]}); diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-debug.js b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-debug.js new file mode 100644 index 0000000000000..2f327fc95bdd4 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-debug.js @@ -0,0 +1,131 @@ +YUI.add('moodle-local_kaltura-ltiservice', function (Y, NAME) { + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module for displaying an LTI launch within a YUI panel. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + + /** + * This method calls the base class constructor + * @method LTISERVICE + */ +var LTISERVICE = function() { + LTISERVICE.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTISERVICE, Y.Base, { + /** + * Init function for triggering a custom event and setting attributes. Also checks whether optional elements exist in the + * parent window. + * @property params + * @type {Object} + */ + init : function(params) { + var documentElement = window.opener ? window.opener.parent.document : window.parent.document; + if (documentElement.getElementById('video_title')) { + Y.one(documentElement.getElementById('video_title')).setAttribute('value', params.title); + } + + if (documentElement.getElementById('entry_id')) { + Y.one(documentElement.getElementById('entry_id')).setAttribute('value', params.entryid); + } + + if (documentElement.getElementById('height')) { + Y.one(documentElement.getElementById('height')).setAttribute('value', params.height); + } + + if (documentElement.getElementById('width')) { + Y.one(documentElement.getElementById('width')).setAttribute('value', params.width); + } + + if (documentElement.getElementById('uiconf_id')) { + Y.one(documentElement.getElementById('uiconf_id')).setAttribute('value', '1'); + } + + if (documentElement.getElementById('widescreen')) { + Y.one(documentElement.getElementById('widescreen')).setAttribute('value', '1'); + } + + if (documentElement.getElementById('video_preview_frame')) { + Y.one(documentElement.getElementById('video_preview_frame')).setAttribute('src', params.previewltilauncher); + } else if (documentElement.getElementById('contentframe')) { + Y.one(documentElement.getElementById('contentframe')).setAttribute('src', decodeURIComponent(params.iframeurl)); + Y.one(documentElement.getElementById('contentframe')).setStyle('width', params.width + 'px'); + Y.one(documentElement.getElementById('contentframe')).setStyle('height', params.height + 'px'); + } + + // This element must exist. + Y.one(documentElement.getElementById('source')).setAttribute('value', decodeURIComponent(params.iframeurl)); + + if (documentElement.getElementById('metadata')) { + Y.one(documentElement.getElementById('metadata')).setAttribute('value', params.metadata); + } + + if (window.parent.insertMedia) { + window.parent.insertMedia(); + return; + } + + if (documentElement.getElementById('closeltipanel')) { + Y.one(documentElement.getElementById('closeltipanel')).simulate('click'); + } + + documentElement.body.dispatchEvent(documentElement.body.entrySelectedEvent); + } +}, +{ + NAME : 'moodle-local_kaltura-ltiservice', + ATTRS : { + iframeurl : { + value: '' + }, + width : { + value: '' + }, + height : { + value: '' + }, + entryid : { + value: '' + }, + title : { + value: '' + }, + metadata : { + value: '' + } + } + +}); +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for ltiservice module + * @param string params additional parameters. + * @return object the ltiservice object + */ +M.local_kaltura.init = function(params) { + return new LTISERVICE(params); +}; + + +}, '@VERSION@', {"requires": ["base", "node", "node-event-simulate"]}); diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-min.js b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-min.js new file mode 100644 index 0000000000000..71bce3687a2a4 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice-min.js @@ -0,0 +1 @@ +YUI.add("moodle-local_kaltura-ltiservice",function(n,e){var t=function(){t.superclass.constructor.apply(this,arguments)};n.extend(t,n.Base,{init:function(e){var t=(window.opener||window).parent.document;t.getElementById("video_title")&&n.one(t.getElementById("video_title")).setAttribute("value",e.title),t.getElementById("entry_id")&&n.one(t.getElementById("entry_id")).setAttribute("value",e.entryid),t.getElementById("height")&&n.one(t.getElementById("height")).setAttribute("value",e.height),t.getElementById("width")&&n.one(t.getElementById("width")).setAttribute("value",e.width),t.getElementById("uiconf_id")&&n.one(t.getElementById("uiconf_id")).setAttribute("value","1"),t.getElementById("widescreen")&&n.one(t.getElementById("widescreen")).setAttribute("value","1"),t.getElementById("video_preview_frame")?n.one(t.getElementById("video_preview_frame")).setAttribute("src",e.previewltilauncher):t.getElementById("contentframe")&&(n.one(t.getElementById("contentframe")).setAttribute("src",decodeURIComponent(e.iframeurl)),n.one(t.getElementById("contentframe")).setStyle("width",e.width+"px"),n.one(t.getElementById("contentframe")).setStyle("height",e.height+"px")),n.one(t.getElementById("source")).setAttribute("value",decodeURIComponent(e.iframeurl)),t.getElementById("metadata")&&n.one(t.getElementById("metadata")).setAttribute("value",e.metadata),window.parent.insertMedia?window.parent.insertMedia():(t.getElementById("closeltipanel")&&n.one(t.getElementById("closeltipanel")).simulate("click"),t.body.dispatchEvent(t.body.entrySelectedEvent))}},{NAME:"moodle-local_kaltura-ltiservice",ATTRS:{iframeurl:{value:""},width:{value:""},height:{value:""},entryid:{value:""},title:{value:""},metadata:{value:""}}}),M.local_kaltura=M.local_kaltura||{},M.local_kaltura.init=function(e){return new t(e)}},"@VERSION@",{requires:["base","node","node-event-simulate"]}); \ No newline at end of file diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice.js b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice.js new file mode 100644 index 0000000000000..2f327fc95bdd4 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltiservice/moodle-local_kaltura-ltiservice.js @@ -0,0 +1,131 @@ +YUI.add('moodle-local_kaltura-ltiservice', function (Y, NAME) { + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module for displaying an LTI launch within a YUI panel. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + + /** + * This method calls the base class constructor + * @method LTISERVICE + */ +var LTISERVICE = function() { + LTISERVICE.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTISERVICE, Y.Base, { + /** + * Init function for triggering a custom event and setting attributes. Also checks whether optional elements exist in the + * parent window. + * @property params + * @type {Object} + */ + init : function(params) { + var documentElement = window.opener ? window.opener.parent.document : window.parent.document; + if (documentElement.getElementById('video_title')) { + Y.one(documentElement.getElementById('video_title')).setAttribute('value', params.title); + } + + if (documentElement.getElementById('entry_id')) { + Y.one(documentElement.getElementById('entry_id')).setAttribute('value', params.entryid); + } + + if (documentElement.getElementById('height')) { + Y.one(documentElement.getElementById('height')).setAttribute('value', params.height); + } + + if (documentElement.getElementById('width')) { + Y.one(documentElement.getElementById('width')).setAttribute('value', params.width); + } + + if (documentElement.getElementById('uiconf_id')) { + Y.one(documentElement.getElementById('uiconf_id')).setAttribute('value', '1'); + } + + if (documentElement.getElementById('widescreen')) { + Y.one(documentElement.getElementById('widescreen')).setAttribute('value', '1'); + } + + if (documentElement.getElementById('video_preview_frame')) { + Y.one(documentElement.getElementById('video_preview_frame')).setAttribute('src', params.previewltilauncher); + } else if (documentElement.getElementById('contentframe')) { + Y.one(documentElement.getElementById('contentframe')).setAttribute('src', decodeURIComponent(params.iframeurl)); + Y.one(documentElement.getElementById('contentframe')).setStyle('width', params.width + 'px'); + Y.one(documentElement.getElementById('contentframe')).setStyle('height', params.height + 'px'); + } + + // This element must exist. + Y.one(documentElement.getElementById('source')).setAttribute('value', decodeURIComponent(params.iframeurl)); + + if (documentElement.getElementById('metadata')) { + Y.one(documentElement.getElementById('metadata')).setAttribute('value', params.metadata); + } + + if (window.parent.insertMedia) { + window.parent.insertMedia(); + return; + } + + if (documentElement.getElementById('closeltipanel')) { + Y.one(documentElement.getElementById('closeltipanel')).simulate('click'); + } + + documentElement.body.dispatchEvent(documentElement.body.entrySelectedEvent); + } +}, +{ + NAME : 'moodle-local_kaltura-ltiservice', + ATTRS : { + iframeurl : { + value: '' + }, + width : { + value: '' + }, + height : { + value: '' + }, + entryid : { + value: '' + }, + title : { + value: '' + }, + metadata : { + value: '' + } + } + +}); +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for ltiservice module + * @param string params additional parameters. + * @return object the ltiservice object + */ +M.local_kaltura.init = function(params) { + return new LTISERVICE(params); +}; + + +}, '@VERSION@', {"requires": ["base", "node", "node-event-simulate"]}); diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltitinymcepanel/moodle-local_kaltura-ltitinymcepanel-debug.js b/local/kaltura/yui/build/moodle-local_kaltura-ltitinymcepanel/moodle-local_kaltura-ltitinymcepanel-debug.js new file mode 100644 index 0000000000000..6efdd6ae8abd0 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltitinymcepanel/moodle-local_kaltura-ltitinymcepanel-debug.js @@ -0,0 +1,135 @@ +YUI.add('moodle-local_kaltura-ltitinymcepanel', function (Y, NAME) { + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module for displaying an LTI launch within a YUI panel. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/* eslint-disable max-len */ + +/** + * This method calls the base class constructor + * @method LTITINYMCEPANEL + */ +var LTITINYMCEPANEL = function() { + LTITINYMCEPANEL.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTITINYMCEPANEL, Y.Base, { + /** + * The context id the editor was launched in. + * @property contextid + * @type {Integer} + * @default null + */ + contextid: 0, + + /** + * Init function for the checkboxselection module + * @property {Object} params Data to help initialize the YUI module. + */ + init : function(params) { + // Check to make sure parameters are initialized. + if ('' === params.ltilaunchurl || '' === params.objecttagheight || '' === params.objecttagid || '' === params.previewiframeid) { + alert('Some parameters were not initialized.'); + return; + } + + // Initialize the the browse when the window is initially rendered. + this.load_lti_content(params.ltilaunchurl, params.objecttagid, params.objecttagheight); + + // Listen to simulated click event send from local/kaltura/service.php + Y.one('#closeltipanel').on('click', this.user_selected_video_callback, this, params.objecttagid, params.previewiframeid, params.objecttagheight); + + if (null !== Y.one('#page-footer')) { + Y.one('#page-footer').setStyle('display', 'none'); + } + }, + + /** + * A funciton to load the LTI content. This is called when the YUI module is first initialized. + * @property {String} url LTI launch URL. + * @property {String} iframeid iframe tag id. + * @property {String} iframeheight iframe tag height. + */ + load_lti_content : function(url, iframeid, iframeheight) { + if (0 === this.contextid) { + this.contextid = Y.one('#lti_launch_context_id').get('value'); + } + + var content = ''; + Y.one('#'+iframeid).setContent(content); + }, + + /** + * This function serves as a call back method for when the closeltipanel div has been clicked. It means that the user has + * selected a video for embedding into the TinyMCE edotor. Enabling the insert button, removing the contents LTI launch element and + * adding content to the media preview element. + * @property {Object} e Event object. + * @property {String} objecttagid Object tag id. + * @property {String} previewiframeid Preview iframe tag id. + * @property {String} height Height of the iframe. + */ + user_selected_video_callback : function(e, objecttagid, previewiframeid, height) { + Y.one('#'+objecttagid).setContent(''); + + var center = Y.Node.create('
'); + var iframe = Y.Node.create(''); + iframe.setAttribute('allowfullscreen', ''); + iframe.setAttribute('width', Y.one('#width').get('value')+'px'); + iframe.setAttribute('height', height+'px'); + iframe.setAttribute('src', Y.one('#video_preview_frame').getAttribute('src')); + + center.append(iframe); + Y.one('#'+previewiframeid).append(center); + } + }, + { + NAME : 'moodle-local_kaltura-ltitinymcepanel', + ATTRS : { + ltilaunchurl : { + value : '' + }, + objecttagheight : { + value : '' + }, + objecttagid : { + value : '' + }, + previewiframeid : { + value : '' + } + } + }); +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for ltipanel module + * @param {Object} params Additional parameters. + * @return {Object} the ltipanel object + */ +M.local_kaltura.init = function(params) { + return new LTITINYMCEPANEL(params); +}; + + +}, '@VERSION@', {"requires": ["base", "node", "panel", "node-event-simulate"]}); diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltitinymcepanel/moodle-local_kaltura-ltitinymcepanel-min.js b/local/kaltura/yui/build/moodle-local_kaltura-ltitinymcepanel/moodle-local_kaltura-ltitinymcepanel-min.js new file mode 100644 index 0000000000000..06da10f82eee7 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltitinymcepanel/moodle-local_kaltura-ltitinymcepanel-min.js @@ -0,0 +1 @@ +YUI.add("moodle-local_kaltura-ltitinymcepanel",function(n,e){var t=function(){t.superclass.constructor.apply(this,arguments)};n.extend(t,n.Base,{contextid:0,init:function(e){""!==e.ltilaunchurl&&""!==e.objecttagheight&&""!==e.objecttagid&&""!==e.previewiframeid?(this.load_lti_content(e.ltilaunchurl,e.objecttagid,e.objecttagheight),n.one("#closeltipanel").on("click",this.user_selected_video_callback,this,e.objecttagid,e.previewiframeid,e.objecttagheight),null!==n.one("#page-footer")&&n.one("#page-footer").setStyle("display","none")):alert("Some parameters were not initialized.")},load_lti_content:function(e,t,i){0===this.contextid&&(this.contextid=n.one("#lti_launch_context_id").get("value"));i='';n.one("#"+t).setContent(i)},user_selected_video_callback:function(e,t,i,a){var l;n.one("#"+t).setContent(""),t=n.Node.create("
"),(l=n.Node.create("")).setAttribute("allowfullscreen",""),l.setAttribute("width",n.one("#width").get("value")+"px"),l.setAttribute("height",a+"px"),l.setAttribute("src",n.one("#video_preview_frame").getAttribute("src")),t.append(l),n.one("#"+i).append(t)}},{NAME:"moodle-local_kaltura-ltitinymcepanel",ATTRS:{ltilaunchurl:{value:""},objecttagheight:{value:""},objecttagid:{value:""},previewiframeid:{value:""}}}),M.local_kaltura=M.local_kaltura||{},M.local_kaltura.init=function(e){return new t(e)}},"@VERSION@",{requires:["base","node","panel","node-event-simulate"]}); \ No newline at end of file diff --git a/local/kaltura/yui/build/moodle-local_kaltura-ltitinymcepanel/moodle-local_kaltura-ltitinymcepanel.js b/local/kaltura/yui/build/moodle-local_kaltura-ltitinymcepanel/moodle-local_kaltura-ltitinymcepanel.js new file mode 100644 index 0000000000000..6efdd6ae8abd0 --- /dev/null +++ b/local/kaltura/yui/build/moodle-local_kaltura-ltitinymcepanel/moodle-local_kaltura-ltitinymcepanel.js @@ -0,0 +1,135 @@ +YUI.add('moodle-local_kaltura-ltitinymcepanel', function (Y, NAME) { + +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module for displaying an LTI launch within a YUI panel. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/* eslint-disable max-len */ + +/** + * This method calls the base class constructor + * @method LTITINYMCEPANEL + */ +var LTITINYMCEPANEL = function() { + LTITINYMCEPANEL.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTITINYMCEPANEL, Y.Base, { + /** + * The context id the editor was launched in. + * @property contextid + * @type {Integer} + * @default null + */ + contextid: 0, + + /** + * Init function for the checkboxselection module + * @property {Object} params Data to help initialize the YUI module. + */ + init : function(params) { + // Check to make sure parameters are initialized. + if ('' === params.ltilaunchurl || '' === params.objecttagheight || '' === params.objecttagid || '' === params.previewiframeid) { + alert('Some parameters were not initialized.'); + return; + } + + // Initialize the the browse when the window is initially rendered. + this.load_lti_content(params.ltilaunchurl, params.objecttagid, params.objecttagheight); + + // Listen to simulated click event send from local/kaltura/service.php + Y.one('#closeltipanel').on('click', this.user_selected_video_callback, this, params.objecttagid, params.previewiframeid, params.objecttagheight); + + if (null !== Y.one('#page-footer')) { + Y.one('#page-footer').setStyle('display', 'none'); + } + }, + + /** + * A funciton to load the LTI content. This is called when the YUI module is first initialized. + * @property {String} url LTI launch URL. + * @property {String} iframeid iframe tag id. + * @property {String} iframeheight iframe tag height. + */ + load_lti_content : function(url, iframeid, iframeheight) { + if (0 === this.contextid) { + this.contextid = Y.one('#lti_launch_context_id').get('value'); + } + + var content = ''; + Y.one('#'+iframeid).setContent(content); + }, + + /** + * This function serves as a call back method for when the closeltipanel div has been clicked. It means that the user has + * selected a video for embedding into the TinyMCE edotor. Enabling the insert button, removing the contents LTI launch element and + * adding content to the media preview element. + * @property {Object} e Event object. + * @property {String} objecttagid Object tag id. + * @property {String} previewiframeid Preview iframe tag id. + * @property {String} height Height of the iframe. + */ + user_selected_video_callback : function(e, objecttagid, previewiframeid, height) { + Y.one('#'+objecttagid).setContent(''); + + var center = Y.Node.create('
'); + var iframe = Y.Node.create(''); + iframe.setAttribute('allowfullscreen', ''); + iframe.setAttribute('width', Y.one('#width').get('value')+'px'); + iframe.setAttribute('height', height+'px'); + iframe.setAttribute('src', Y.one('#video_preview_frame').getAttribute('src')); + + center.append(iframe); + Y.one('#'+previewiframeid).append(center); + } + }, + { + NAME : 'moodle-local_kaltura-ltitinymcepanel', + ATTRS : { + ltilaunchurl : { + value : '' + }, + objecttagheight : { + value : '' + }, + objecttagid : { + value : '' + }, + previewiframeid : { + value : '' + } + } + }); +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for ltipanel module + * @param {Object} params Additional parameters. + * @return {Object} the ltipanel object + */ +M.local_kaltura.init = function(params) { + return new LTITINYMCEPANEL(params); +}; + + +}, '@VERSION@', {"requires": ["base", "node", "panel", "node-event-simulate"]}); diff --git a/local/kaltura/yui/src/lticontainer/build.json b/local/kaltura/yui/src/lticontainer/build.json new file mode 100644 index 0000000000000..cc70a98cbce94 --- /dev/null +++ b/local/kaltura/yui/src/lticontainer/build.json @@ -0,0 +1,10 @@ +{ + "name": "moodle-local_kaltura-lticontainer", + "builds": { + "moodle-local_kaltura-lticontainer": { + "jsfiles": [ + "lticontainer.js" + ] + } + } +} \ No newline at end of file diff --git a/local/kaltura/yui/src/lticontainer/js/lticontainer.js b/local/kaltura/yui/src/lticontainer/js/lticontainer.js new file mode 100644 index 0000000000000..f94fda133c831 --- /dev/null +++ b/local/kaltura/yui/src/lticontainer/js/lticontainer.js @@ -0,0 +1,198 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module used to resize the LTI launch container. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/* eslint-disable max-len */ + +/** + * This method calls the base class constructor + * @method LTICONTAINER + */ +var LTICONTAINER = function() { + LTICONTAINER.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTICONTAINER, Y.Base, { + /** + * The last known height of the element. + * @property lastheight + * @type {Integer} + * @default null + */ + lastheight: null, + + /** + * Add padding to make the bottom of the iframe visible. The iframe wasn't visible on some themes. Probably because of border widths, etc. + * @property padding + * @type {Integer} + * @default 15 + */ + padding: 15, + + /** + * Height of window. + * @property viewportheight + * @type {Integer} + * @default 15 + */ + viewportheight: null, + + /** + * Height of the entire document. + * @property documentheight + * @type {Integer} + * @default null + */ + documentheight: null, + + /** + * Height of the body element. + * @property documentheight + * @type {Integer} + * @default null + */ + clientheight: null, + + /** + * User video width size selection. + * @property kalvidwidth + * @type {Integer} + * @default null + */ + kalvidwidth: null, + + /** + * The YUI node object for the iframe container. + * @property ltiframe + * @type {Object} + * @default null + */ + ltiframe: null, + + /** + * The width of the entry + * @property width + * @type {int} + * @default null + */ + width: null, + + /** + * The height of the entry + * @property height + * @type {int} + * @default null + */ + height: null, + + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(params) { + var bodynode = Y.one('body[class~='+params.bodyclass+']'); + + if(params.height && params.width) + { + this.height = params.height; + this.width = params.width; + } + + this.lastheight = params.lastheight; + this.padding = params.padding; + this.viewportheight = bodynode.get('winHeight'); + this.documentheight = bodynode.get('docHeight'); + this.clientheight = bodynode.getDOMNode.clientHeight; + this.ltiframe = Y.one('#contentframe'); + this.kalvidwidth = params.kalvidwidth; + + this.resize(); + this.timer = Y.later(250, this, this.resize); + }, + + /** + * This function resizes the iframe height and width. + */ + resize : function() { + if (this.lastheight !== Math.min(this.documentheight, this.viewportheight)) { + var newheight = this.viewportheight - this.ltiframe.getY() - this.padding; + //Get the original height which is 600px, but we're getting it as 600px and need to remove the last two characters + var originalheight = this.ltiframe._node.height.slice(0,this.ltiframe._node.height.length-2); + if (newheight < originalheight) { + return; + } + this.ltiframe.setStyle('height', newheight+'px'); + this.lastheight = Math.min(this.documentheight, this.viewportheight); + } + + var kalvidcontent = Y.one('#kalvid_content'); + if (kalvidcontent !== null) { + var maxwidth = kalvidcontent.get('offsetWidth'); + var allowedsize = maxwidth - this.padding; + + if (this.kalvidwidth !== null) { + // Double current user's video width selection as requested by Kaltura. + var newsize = this.kalvidwidth * 2; + + // If "newsize" if over allowed size then set it to the maximum allowed. + if (newsize > allowedsize) { + this.ltiframe.setStyle('width', allowedsize+'px'); + } else { + this.ltiframe.setStyle('width', newsize+'px'); + } + } + } + + // if we have the entry's dimensions - use them to adjust the iframe size. + if(this.height && this.width) + { + this.ltiframe.setStyle('width', this.width+'px'); + this.ltiframe.setStyle('height', this.height+'px'); + } + } +}, +{ + NAME : 'moodle-local_kaltura-lticontainer', + ATTRS : { + bodyclass : { + value : null + }, + lastheight : { + value : null + }, + padding: { + value : 15 + } + } +}); +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for lticontainer module + * @param string params additional parameters. + * @return object the lticontainer object + */ +M.local_kaltura.init = function(params) { + return new LTICONTAINER(params); +}; diff --git a/local/kaltura/yui/src/lticontainer/meta/lticontainer.json b/local/kaltura/yui/src/lticontainer/meta/lticontainer.json new file mode 100644 index 0000000000000..f3a5d478c89f3 --- /dev/null +++ b/local/kaltura/yui/src/lticontainer/meta/lticontainer.json @@ -0,0 +1,8 @@ +{ + "moodle-local_kaltura-lticontainer": { + "requires": [ + "base", + "node" + ] + } +} \ No newline at end of file diff --git a/local/kaltura/yui/src/ltipanel/build.json b/local/kaltura/yui/src/ltipanel/build.json new file mode 100644 index 0000000000000..037cdbe58b803 --- /dev/null +++ b/local/kaltura/yui/src/ltipanel/build.json @@ -0,0 +1,10 @@ +{ + "name": "moodle-local_kaltura-ltipanel", + "builds": { + "moodle-local_kaltura-ltipanel": { + "jsfiles": [ + "ltipanel.js" + ] + } + } +} diff --git a/local/kaltura/yui/src/ltipanel/js/ltipanel.js b/local/kaltura/yui/src/ltipanel/js/ltipanel.js new file mode 100644 index 0000000000000..8aa45c421cc6a --- /dev/null +++ b/local/kaltura/yui/src/ltipanel/js/ltipanel.js @@ -0,0 +1,362 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module for displaying an LTI launch within a YUI panel. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/* eslint-disable max-len */ + + /** + * This method calls the base class constructor + * @method LTIPANEL + */ +var LTIPANEL = function() { + LTIPANEL.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTIPANEL, Y.Base, { + /** + * The name of the initiating module. + * @property modulename + * @type {String} + * @default null + */ + modulename: null, + + /** + * The id value of the add media button. + * @property addvidbtnid + * @type {String} + * @default null + */ + addvidbtnid: null, + + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(params) { + // Check to make sure parameters are initialized + if ('0' === params.addvidbtnid || '0' === params.ltilaunchurl || 0 === params.courseid || 0 === params.height || 0 === params.width) { + alert('Some parameters were not initialized.'); + return; + } + + this.modulename = params.modulename; + this.addvidbtnid = params.addvidbtnid; + + var addvideobtn = Y.one('#'+params.addvidbtnid); + addvideobtn.on('click', this.open_bse_popup_callback, this, params.ltilaunchurl, params.height, params.width); + }, + + /** + * Event handler callback for when the add video button is clicked. This function creates the a panel element. + * @property e + * @type {Object} + */ + open_bse_popup_callback : function(e, url, height, width) { + var w = 1200; + var h = 700; + var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; + var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; + + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + + var left = ((width / 2) - (w / 2)) + dualScreenLeft; + var top = ((height / 2) - (h / 2)) + dualScreenTop; + var bsePopup = window.open(url, M.util.get_string("browse_and_embed", "local_kaltura"), 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); + + if (window.focus) { + bsePopup.focus(); + } + + document.body.bsePopup = bsePopup; + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; + document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); + }, + + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; + }, + + + + /** + * Event handler callback for when a simulated click event is triggered on a specifc element. + */ + close_popup_callback : function() { + // hide the thumbnail image. + var imagenode = Y.one('img[id=video_thumbnail]'); + imagenode.setStyle('display', 'none'); + // Update the iframe element attributes + var iframenode = Y.one('iframe[id=contentframe]'); + iframenode.setAttribute('width', Y.one('input[id=width]').getAttribute('value')); + iframenode.setAttribute('height', Y.one('input[id=height]').getAttribute('value')); + iframenode.setStyle('display', 'inline'); + + // If the page is a Video resource execute a function to change the button caption KALDEV-579 + var element = Y.one('input[name=modulename]'); + + if (undefined !== element && 'kalvidres' === this.modulename) { + this.lti_panel_change_add_media_button_caption(); + } + + document.body.bsePopup.close(); + }, + + lti_panel_change_add_media_button_caption : function() { + // Need to find a better way of doing this. Change was made for KALDEV-579. + var buttoncaption = M.util.get_string('replace_video', this.modulename); + if (buttoncaption !== Y.one('#'+this.addvidbtnid).getAttribute('value')) { + Y.one('#'+this.addvidbtnid).setAttribute('value', buttoncaption); + } + }, +}, +{ + NAME : 'moodle-local_kaltura-ltipanel', + ATTRS : { + addvidbtnid : { + value: '0' + }, + ltilaunchurl : { + value: '0' + }, + height : { + value: 0 + }, + width : { + value: 0 + }, + modulename : { + value: '' + } + } +}); + +/** + * This method calls the base class constructor. The primary difference between LTIPANELMEDIAASSIGNMENT and LTIPANEL is that + * LTIPANELMEDIAASSIGNMENT creates a node and appends it to the body tag of the page. The reason for this is due to an issue with the Moodle + * navbar covering up part of the YUI panel, if the panel markup is appended to a child element within the body tag. + * @method LTIPANELMEDIAASSIGNMENT + */ +var LTIPANELMEDIAASSIGNMENT = function() { + LTIPANELMEDIAASSIGNMENT.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTIPANELMEDIAASSIGNMENT, Y.Base, { + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(params) { + // Check to make sure parameters are initialized + if ('0' === params.addvidbtnid || '0' === params.ltilaunchurl || 0 === params.courseid || 0 === params.height || 0 === params.width) { + return; + } + + var addvideobtn = Y.one('#'+params.addvidbtnid); + addvideobtn.on('click', this.open_bse_popup_callback, this, params.ltilaunchurl, params.height, params.width); + }, + + /** + * Event handler callback for when the panel content is changed + * @property e + * @type {Object} + */ + open_bse_popup_callback: function(e, url, height, width) { + var w = 1200; + var h = 700; + var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left; + var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top; + + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; + + var left = ((width / 2) - (w / 2)) + dualScreenLeft; + var top = ((height / 2) - (h / 2)) + dualScreenTop; + var bsePopup = window.open(url, M.util.get_string("browse_and_embed", "local_kaltura"), 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); + + if (window.focus) { + bsePopup.focus(); + } + + document.body.bsePopup = bsePopup; + var entrySelectedEvent = this.createEntrySelectedEvent(); + document.body.entrySelectedEvent = entrySelectedEvent; + document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false); + }, + + createEntrySelectedEvent: function() { + var entrySelectedEvent; + if(typeof window.CustomEvent === 'function') { + entrySelectedEvent = new CustomEvent('entrySelected'); + } + else { + // ie >= 9 + entrySelectedEvent = document.createEvent('CustomEvent'); + entrySelectedEvent.initCustomEvent('entrySelected', false, false, {}); + } + + return entrySelectedEvent; + }, + + close_popup_callback: function() { + Y.one('input[id=submit_video]').removeAttribute('disabled'); + // hide the thumbnail image. + var imagenode = Y.one('img[id=video_thumbnail]'); + imagenode.setStyle('display', 'none'); + // Update the iframe element attributes + var iframenode = Y.one('iframe[id=contentframe]'); + iframenode.setAttribute('width', Y.one('input[id=width]').getAttribute('value')); + iframenode.setAttribute('height', Y.one('input[id=height]').getAttribute('value')); + iframenode.setStyle('display', 'inline'); + Y.one('#id_add_video').set('value', M.util.get_string('replacevideo', 'kalvidassign')); + // Update button classes. + Y.one('#id_add_video').addClass('btn-secondary'); + Y.one('#submit_video').addClass('btn-primary'); + Y.one('#id_add_video').removeClass('btn-primary'); + Y.one('#submit_video').removeClass('btn-secondary'); + document.body.bsePopup.close(); + }, + +}, +{ + NAME : 'moodle-local_kaltura-ltipanel', + ATTRS : { + addvidbtnid : { + value: '0' + }, + ltilaunchurl : { + value: '0' + }, + height : { + value: 0 + }, + width : { + value: 0 + } + } +}); + +/** + * This method calls the base class constructor. This module renders a Panel for viewing media from multiple sources. + * @method LTISUBMISSIONREVIEW + */ +var LTISUBMISSIONREVIEW = function() { + LTISUBMISSIONREVIEW.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTISUBMISSIONREVIEW, Y.Base, { + /** + * An instance of the ltimediaassignment class. + * @property ltimediaassignment + * @type {Object} + * @default null + */ + ltimediaassignment: null, + + + /** + * Init function for the checkboxselection module + * @property params + * @type {Object} + */ + init : function(ltimediaassignment) { + this.ltimediaassignment = ltimediaassignment; + Y.one('form[id=fastgrade]').delegate('click', this.review_submission, 'a[name=submission_source]', this); + }, + + /** + * Callback function for when a user clicks on the review submission link. + * @property e + * @type {Object} + */ + review_submission : function(e) { + e.preventDefault(); + var source, height, width; + // Test if the target is an anchor tag or img tag. + if (e.target.test('a')) { + source = e.target.getAttribute('href'); + height = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=height]').get('value'); + width = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=width]').get('value'); + } else { + source = e.target.ancestor('a[name=submission_source]').getAttribute('href'); + height = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=height]').get('value'); + width = e.target.ancestor('div[name=media_submission]').get('childNodes').filter('input[name=width]').get('value'); + } + + this.ltimediaassignment.open_bse_popup_callback(null, source, height, width); + } +}, +{ + NAME : 'moodle-local_kaltura-ltipanel' +}); + +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for ltipanel module + * @param string params additional parameters. + * @return object the ltipanel object + */ +M.local_kaltura.init = function(params) { + return new LTIPANEL(params); +}; + +/** + * Entry point for ltipanelmediaassignment module + * @param string params additional parameters. + * @return object the ltipanel object + */ +M.local_kaltura.initmediaassignment = function(params) { + return new LTIPANELMEDIAASSIGNMENT(params); +}; + +/** + * Entry point for ltipanelmediaassignment module + * @param string params additional parameters. + * @return object the ltipanel object + */ +M.local_kaltura.initreviewsubmission = function() { + var args = { + addvidbtnid: '0', + ltilaunchurl: '0', + courseid: 0, + height: 0, + width: 0 + }; + var mediaassignment = new LTIPANELMEDIAASSIGNMENT(args); + return new LTISUBMISSIONREVIEW(mediaassignment); +}; diff --git a/local/kaltura/yui/src/ltipanel/meta/ltipanel.json b/local/kaltura/yui/src/ltipanel/meta/ltipanel.json new file mode 100644 index 0000000000000..c6fd71178cfe7 --- /dev/null +++ b/local/kaltura/yui/src/ltipanel/meta/ltipanel.json @@ -0,0 +1,10 @@ +{ + "moodle-local_kaltura-ltipanel": { + "requires": [ + "base", + "node", + "panel", + "node-event-simulate" + ] + } +} diff --git a/local/kaltura/yui/src/ltiservice/build.json b/local/kaltura/yui/src/ltiservice/build.json new file mode 100644 index 0000000000000..a6512cc4eb485 --- /dev/null +++ b/local/kaltura/yui/src/ltiservice/build.json @@ -0,0 +1,10 @@ +{ + "name": "moodle-local_kaltura-ltiservice", + "builds": { + "moodle-local_kaltura-ltiservice": { + "jsfiles": [ + "ltiservice.js" + ] + } + } +} diff --git a/local/kaltura/yui/src/ltiservice/js/ltiservice.js b/local/kaltura/yui/src/ltiservice/js/ltiservice.js new file mode 100644 index 0000000000000..9888011b08fbd --- /dev/null +++ b/local/kaltura/yui/src/ltiservice/js/ltiservice.js @@ -0,0 +1,126 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module for displaying an LTI launch within a YUI panel. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + + /** + * This method calls the base class constructor + * @method LTISERVICE + */ +var LTISERVICE = function() { + LTISERVICE.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTISERVICE, Y.Base, { + /** + * Init function for triggering a custom event and setting attributes. Also checks whether optional elements exist in the + * parent window. + * @property params + * @type {Object} + */ + init : function(params) { + var documentElement = window.opener ? window.opener.parent.document : window.parent.document; + if (documentElement.getElementById('video_title')) { + Y.one(documentElement.getElementById('video_title')).setAttribute('value', params.title); + } + + if (documentElement.getElementById('entry_id')) { + Y.one(documentElement.getElementById('entry_id')).setAttribute('value', params.entryid); + } + + if (documentElement.getElementById('height')) { + Y.one(documentElement.getElementById('height')).setAttribute('value', params.height); + } + + if (documentElement.getElementById('width')) { + Y.one(documentElement.getElementById('width')).setAttribute('value', params.width); + } + + if (documentElement.getElementById('uiconf_id')) { + Y.one(documentElement.getElementById('uiconf_id')).setAttribute('value', '1'); + } + + if (documentElement.getElementById('widescreen')) { + Y.one(documentElement.getElementById('widescreen')).setAttribute('value', '1'); + } + + if (documentElement.getElementById('video_preview_frame')) { + Y.one(documentElement.getElementById('video_preview_frame')).setAttribute('src', params.previewltilauncher); + } else if (documentElement.getElementById('contentframe')) { + Y.one(documentElement.getElementById('contentframe')).setAttribute('src', decodeURIComponent(params.iframeurl)); + Y.one(documentElement.getElementById('contentframe')).setStyle('width', params.width + 'px'); + Y.one(documentElement.getElementById('contentframe')).setStyle('height', params.height + 'px'); + } + + // This element must exist. + Y.one(documentElement.getElementById('source')).setAttribute('value', decodeURIComponent(params.iframeurl)); + + if (documentElement.getElementById('metadata')) { + Y.one(documentElement.getElementById('metadata')).setAttribute('value', params.metadata); + } + + if (window.parent.insertMedia) { + window.parent.insertMedia(); + return; + } + + if (documentElement.getElementById('closeltipanel')) { + Y.one(documentElement.getElementById('closeltipanel')).simulate('click'); + } + + documentElement.body.dispatchEvent(documentElement.body.entrySelectedEvent); + } +}, +{ + NAME : 'moodle-local_kaltura-ltiservice', + ATTRS : { + iframeurl : { + value: '' + }, + width : { + value: '' + }, + height : { + value: '' + }, + entryid : { + value: '' + }, + title : { + value: '' + }, + metadata : { + value: '' + } + } + +}); +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for ltiservice module + * @param string params additional parameters. + * @return object the ltiservice object + */ +M.local_kaltura.init = function(params) { + return new LTISERVICE(params); +}; diff --git a/local/kaltura/yui/src/ltiservice/meta/ltiservice.json b/local/kaltura/yui/src/ltiservice/meta/ltiservice.json new file mode 100644 index 0000000000000..0252ffd4bbf59 --- /dev/null +++ b/local/kaltura/yui/src/ltiservice/meta/ltiservice.json @@ -0,0 +1,9 @@ +{ + "moodle-local_kaltura-ltiservice": { + "requires": [ + "base", + "node", + "node-event-simulate" + ] + } +} \ No newline at end of file diff --git a/local/kaltura/yui/src/ltitinymcepanel/build.json b/local/kaltura/yui/src/ltitinymcepanel/build.json new file mode 100644 index 0000000000000..c74304ce7f21e --- /dev/null +++ b/local/kaltura/yui/src/ltitinymcepanel/build.json @@ -0,0 +1,10 @@ +{ + "name": "moodle-local_kaltura-ltitinymcepanel", + "builds": { + "moodle-local_kaltura-ltitinymcepanel": { + "jsfiles": [ + "ltitinymcepanel.js" + ] + } + } +} diff --git a/local/kaltura/yui/src/ltitinymcepanel/js/ltitinymcepanel.js b/local/kaltura/yui/src/ltitinymcepanel/js/ltitinymcepanel.js new file mode 100644 index 0000000000000..e021b59ed742b --- /dev/null +++ b/local/kaltura/yui/src/ltitinymcepanel/js/ltitinymcepanel.js @@ -0,0 +1,130 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * YUI module for displaying an LTI launch within a YUI panel. + * + * @package local_kaltura + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/* eslint-disable max-len */ + +/** + * This method calls the base class constructor + * @method LTITINYMCEPANEL + */ +var LTITINYMCEPANEL = function() { + LTITINYMCEPANEL.superclass.constructor.apply(this, arguments); +}; + +Y.extend(LTITINYMCEPANEL, Y.Base, { + /** + * The context id the editor was launched in. + * @property contextid + * @type {Integer} + * @default null + */ + contextid: 0, + + /** + * Init function for the checkboxselection module + * @property {Object} params Data to help initialize the YUI module. + */ + init : function(params) { + // Check to make sure parameters are initialized. + if ('' === params.ltilaunchurl || '' === params.objecttagheight || '' === params.objecttagid || '' === params.previewiframeid) { + alert('Some parameters were not initialized.'); + return; + } + + // Initialize the the browse when the window is initially rendered. + this.load_lti_content(params.ltilaunchurl, params.objecttagid, params.objecttagheight); + + // Listen to simulated click event send from local/kaltura/service.php + Y.one('#closeltipanel').on('click', this.user_selected_video_callback, this, params.objecttagid, params.previewiframeid, params.objecttagheight); + + if (null !== Y.one('#page-footer')) { + Y.one('#page-footer').setStyle('display', 'none'); + } + }, + + /** + * A funciton to load the LTI content. This is called when the YUI module is first initialized. + * @property {String} url LTI launch URL. + * @property {String} iframeid iframe tag id. + * @property {String} iframeheight iframe tag height. + */ + load_lti_content : function(url, iframeid, iframeheight) { + if (0 === this.contextid) { + this.contextid = Y.one('#lti_launch_context_id').get('value'); + } + + var content = ''; + Y.one('#'+iframeid).setContent(content); + }, + + /** + * This function serves as a call back method for when the closeltipanel div has been clicked. It means that the user has + * selected a video for embedding into the TinyMCE edotor. Enabling the insert button, removing the contents LTI launch element and + * adding content to the media preview element. + * @property {Object} e Event object. + * @property {String} objecttagid Object tag id. + * @property {String} previewiframeid Preview iframe tag id. + * @property {String} height Height of the iframe. + */ + user_selected_video_callback : function(e, objecttagid, previewiframeid, height) { + Y.one('#'+objecttagid).setContent(''); + + var center = Y.Node.create('
'); + var iframe = Y.Node.create(''); + iframe.setAttribute('allowfullscreen', ''); + iframe.setAttribute('width', Y.one('#width').get('value')+'px'); + iframe.setAttribute('height', height+'px'); + iframe.setAttribute('src', Y.one('#video_preview_frame').getAttribute('src')); + + center.append(iframe); + Y.one('#'+previewiframeid).append(center); + } + }, + { + NAME : 'moodle-local_kaltura-ltitinymcepanel', + ATTRS : { + ltilaunchurl : { + value : '' + }, + objecttagheight : { + value : '' + }, + objecttagid : { + value : '' + }, + previewiframeid : { + value : '' + } + } + }); +M.local_kaltura = M.local_kaltura || {}; + +/** + * Entry point for ltipanel module + * @param {Object} params Additional parameters. + * @return {Object} the ltipanel object + */ +M.local_kaltura.init = function(params) { + return new LTITINYMCEPANEL(params); +}; diff --git a/local/kaltura/yui/src/ltitinymcepanel/meta/ltitinymcepanel.json b/local/kaltura/yui/src/ltitinymcepanel/meta/ltitinymcepanel.json new file mode 100644 index 0000000000000..4d0cc2d1ded4a --- /dev/null +++ b/local/kaltura/yui/src/ltitinymcepanel/meta/ltitinymcepanel.json @@ -0,0 +1,10 @@ +{ + "moodle-local_kaltura-ltitinymcepanel": { + "requires": [ + "base", + "node", + "panel", + "node-event-simulate" + ] + } +} diff --git a/local/kalturamediagallery/classes/privacy/provider.php b/local/kalturamediagallery/classes/privacy/provider.php new file mode 100644 index 0000000000000..caaf4200df5c8 --- /dev/null +++ b/local/kalturamediagallery/classes/privacy/provider.php @@ -0,0 +1,20 @@ +. + +/** + * Kaltura media gallery capabilities. + * + * @package local_kalturamediagallery + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$capabilities = array( + 'local/kalturamediagallery:view' => array( + 'captype' => 'read', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array( + 'student' => CAP_ALLOW, + 'editingteacher' => CAP_ALLOW, + 'teacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); \ No newline at end of file diff --git a/local/kalturamediagallery/index.php b/local/kalturamediagallery/index.php new file mode 100644 index 0000000000000..54748664dce8e --- /dev/null +++ b/local/kalturamediagallery/index.php @@ -0,0 +1,72 @@ +. + +/** + * Kaltura media gallery main viewing page. + * + * @package local_kalturamediagallery + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); + +global $USER, $PAGE; + +require_login(); +$courseid = required_param('courseid', PARAM_INT); + +$context = context_course::instance($courseid); +require_capability('local/kalturamediagallery:view', $context); + +$course = get_course($courseid); + +$PAGE->set_context($context); +$PAGE->set_course($course); +$header = format_string($course->fullname) . ": " . get_string('heading_mediagallery', 'local_kalturamediagallery'); + +$PAGE->set_url('/local/kalturamediagallery/index.php', array('courseid' => $courseid)); +$PAGE->set_pagetype('kalturamediagallery-index'); +$PAGE->set_title($header); +$PAGE->set_heading($header); + +$pageclass = 'kaltura-mediagallery-body'; +$PAGE->add_body_class($pageclass); + +echo $OUTPUT->header(); + +// Request the launch content with an iframe tag. +$attr = array( + 'id' => 'contentframe', + 'height' => '600px', + 'width' => '100%', + 'allowfullscreen' => 'true', + 'src' => 'lti_launch.php?courseid='.$courseid, + 'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;', +); +echo html_writer::tag('iframe', '', $attr); + +// Require a YUI module to make the iframe tag be as large as possible. +$params = array( + 'bodyclass' => $pageclass, + 'lastheight' => null, + 'padding' => 15 +); +$PAGE->requires->yui_module('moodle-local_kaltura-lticontainer', 'M.local_kaltura.init', array($params), null, true); +$PAGE->requires->js(new moodle_url('/local/kaltura/js/kea_resize.js')); + +echo $OUTPUT->footer(); diff --git a/local/kalturamediagallery/lang/en/local_kalturamediagallery.php b/local/kalturamediagallery/lang/en/local_kalturamediagallery.php new file mode 100644 index 0000000000000..2b8ab26ac0708 --- /dev/null +++ b/local/kalturamediagallery/lang/en/local_kalturamediagallery.php @@ -0,0 +1,36 @@ +. + +/** + * Kaltura media gallery language file. + * + * @package local_kalturamediagallery + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$string['heading_mediagallery'] = 'Media Gallery'; +$string['invalid_launch_parameters'] = 'Invalid launch parameters'; +$string['kalturamediagallery:view'] = 'View Media Gallery'; +$string['nav_mediagallery'] = 'Media Gallery'; +$string['pluginname'] = 'Kaltura Media Gallery'; +$string['setting_heading_desc'] = 'Settings'; +$string['link_location'] = 'Link location'; +$string['link_location_desc'] = 'Choose where mediagallery link is displayed'; +$string['link_location_navigation'] = 'Navigation block'; +$string['link_location_course_settings'] = 'Course settings'; +$string['privacy:metadata'] = 'Kaltura media gallery plugin does not store any personal data.'; diff --git a/local/kalturamediagallery/lib.php b/local/kalturamediagallery/lib.php new file mode 100644 index 0000000000000..bb09399348fdf --- /dev/null +++ b/local/kalturamediagallery/lib.php @@ -0,0 +1,123 @@ +. + +/** + * Kaltura media gallery lib script. + * + * @package local_kalturamediagallery + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +define('LOCAL_KALTURAMEDIAGALLERY_LINK_LOCATION_NAVIGATION_BLOCK', 0); +define('LOCAL_KALTURAMEDIAGALLERY_LINK_LOCATION_COURSE_SETTINGS', 1); +/** + * This function adds Kaltura media gallery link to the navigation block. The code ensures that the Kaltura media gallery link is only displayed in the 'Current courses' + * menu true. In addition it check if the current context is one that is below the course context. + * @param global_navigation $navigation a global_navigation object + * @return void + */ +function local_kalturamediagallery_extend_navigation($navigation) { + global $USER, $PAGE, $DB; + + // Either a set value of 0 or an unset value means hook into navigation block. + if (!empty(get_config('local_kalturamediagallery', 'link_location'))) { + return; + } + + if (empty($USER->id)) { + return; + } + + // When on the admin-index page, first check if the capability exists. + // This is to cover the edge case on the Plugins check page, where a check for the capability is performed before the capability has been added to the Moodle mdl_capabilities + // table. + if ('admin-index' === $PAGE->pagetype) { + $exists = $DB->record_exists('capabilities', array('name' => 'local/kalturamediagallery:view')); + + if (!$exists) { + return; + } + } + + // Check the current page context. If the context is not of a course or module then we are in another area of Moodle and return void. + $context = context::instance_by_id($PAGE->context->id); + $isvalidcontext = ($context instanceof context_course || $context instanceof context_module) ? true : false; + if (!$isvalidcontext) { + return; + } + + // If the context if a module then get the parent context. + $coursecontext = null; + if ($context instanceof context_module) { + $coursecontext = $context->get_course_context(); + } else { + $coursecontext = $context; + } + + if(!has_capability('local/kalturamediagallery:view', $coursecontext, $USER)) { + return; + } + + $icon = getMediaGalleryIcon(); + $mediaGalleryLinkName = get_string('nav_mediagallery', 'local_kalturamediagallery'); + $linkUrl = new moodle_url('/local/kalturamediagallery/index.php', array('courseid' => $coursecontext->instanceid)); + + $currentCourseNode = $navigation->find('currentcourse', $navigation::TYPE_ROOTNODE); + if (isNodeNotEmpty($currentCourseNode)) { + // we have a 'current course' node, add the link to it. + $currentCourseNode->add($mediaGalleryLinkName, $linkUrl, navigation_node::NODETYPE_LEAF, $mediaGalleryLinkName, 'kalturacoursegallerylink-currentcourse', $icon); + } + + $myCoursesNode = $navigation->find('mycourses', $navigation::TYPE_ROOTNODE); + if(isNodeNotEmpty($myCoursesNode)) { + $currentCourseInMyCourses = $myCoursesNode->find($coursecontext->instanceid, navigation_node::TYPE_COURSE); + if($currentCourseInMyCourses) { + // we found the current course in 'my courses' node, add the link to it. + $currentCourseInMyCourses->add($mediaGalleryLinkName, $linkUrl, navigation_node::NODETYPE_LEAF, $mediaGalleryLinkName, 'kalturacoursegallerylink-mycourses', $icon); + } + } + + $coursesNode = $navigation->find('courses', $navigation::TYPE_ROOTNODE); + if (isNodeNotEmpty($coursesNode)) { + $currentCourseInCourses = $coursesNode->find($coursecontext->instanceid, navigation_node::TYPE_COURSE); + if ($currentCourseInCourses) { + // we found the current course in the 'courses' node, add the link to it. + $currentCourseInCourses->add($mediaGalleryLinkName, $linkUrl, navigation_node::NODETYPE_LEAF, $mediaGalleryLinkName, 'kalturacoursegallerylink-allcourses', $icon); + } + } +} + +function local_kalturamediagallery_extend_navigation_course(navigation_node $parent, stdClass $course, context_course $context) { + global $USER; + + if (get_config('local_kalturamediagallery', 'link_location') != LOCAL_KALTURAMEDIAGALLERY_LINK_LOCATION_COURSE_SETTINGS + || empty($USER->id) + || !has_capability('local/kalturamediagallery:view', $context, $USER)) { + return; + } + + $name = get_string('nav_mediagallery', 'local_kalturamediagallery'); + $url = new moodle_url('/local/kalturamediagallery/index.php', array('courseid' => $course->id)); + $parent->add($name, $url, navigation_node::NODETYPE_LEAF, $name, 'kalturamediagallery-settings', getMediaGalleryIcon()); +} + +function isNodeNotEmpty(navigation_node $node) { + return $node !== false && $node->has_children(); +} + +function getMediaGalleryIcon() { + return new pix_icon('media-gallery', '', 'local_kalturamediagallery'); +} \ No newline at end of file diff --git a/local/kalturamediagallery/lti_launch.php b/local/kalturamediagallery/lti_launch.php new file mode 100644 index 0000000000000..ac873e5e48903 --- /dev/null +++ b/local/kalturamediagallery/lti_launch.php @@ -0,0 +1,53 @@ +. + +/** + * Kaltura media gallery LTI launch page. + * + * @package local_kalturamediagallery + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); + +global $USER; + +require_login(); +$courseid = required_param('courseid', PARAM_INT); + +$context = context_course::instance($courseid); +require_capability('local/kalturamediagallery:view', $context); +$course = get_course($courseid); + +$launch = array(); +$launch['id'] = 1; +$launch['cmid'] = 0; +$launch['title'] = 'Kaltura media gallery'; +$launch['module'] = KAF_MEDIAGALLERY_MODULE; +$launch['course'] = $course; +$launch['width'] = '300'; +$launch['height'] = '300'; +$launch['custom_publishdata'] = ''; + +if (local_kaltura_validate_mediagallery_required_params($launch)) { + $content = local_kaltura_request_lti_launch($launch); + echo $content; +} else { + echo get_string('invalid_launch_parameters', 'local_kalturamediagallery'); +} \ No newline at end of file diff --git a/local/kalturamediagallery/pix/media-gallery-big.png b/local/kalturamediagallery/pix/media-gallery-big.png new file mode 100755 index 0000000000000..049c022fe00ad Binary files /dev/null and b/local/kalturamediagallery/pix/media-gallery-big.png differ diff --git a/local/kalturamediagallery/pix/media-gallery-big.svg b/local/kalturamediagallery/pix/media-gallery-big.svg new file mode 100755 index 0000000000000..e0e7a856e4019 --- /dev/null +++ b/local/kalturamediagallery/pix/media-gallery-big.svg @@ -0,0 +1,7 @@ + + +media-gallery-big + + + + diff --git a/local/kalturamediagallery/pix/media-gallery.png b/local/kalturamediagallery/pix/media-gallery.png new file mode 100755 index 0000000000000..f0f7d0d5f4540 Binary files /dev/null and b/local/kalturamediagallery/pix/media-gallery.png differ diff --git a/local/kalturamediagallery/pix/media-gallery.svg b/local/kalturamediagallery/pix/media-gallery.svg new file mode 100755 index 0000000000000..d531d4dfb1666 --- /dev/null +++ b/local/kalturamediagallery/pix/media-gallery.svg @@ -0,0 +1,7 @@ + + +media-gallery + + + + diff --git a/local/kalturamediagallery/settings.php b/local/kalturamediagallery/settings.php new file mode 100644 index 0000000000000..48c5388d7e5e5 --- /dev/null +++ b/local/kalturamediagallery/settings.php @@ -0,0 +1,60 @@ +. + +/* + * @package local + * @subpackage kalturamediagallery + * @copyright 2016 Queen Mary University of London + * @author Phil Lello + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * + */ + +defined('MOODLE_INTERNAL') || die('Invalid access'); + +global $CFG; +require_once $CFG->dirroot. '/local/kalturamediagallery/lib.php'; + +if ($hassiteconfig) { + $settings = new admin_settingpage( + 'local_kalturamediagallery', + get_string('pluginname', 'local_kalturamediagallery') + ); + + //heading + $setting = new admin_setting_heading( + 'heading', + '', get_string('setting_heading_desc', 'local_kalturamediagallery') + ); + $setting->plugin = 'local_kalturamediagallery'; + $settings->add($setting); + + //link location + $setting = new admin_setting_configselect( + 'link_location', + get_string('link_location', 'local_kalturamediagallery'), + get_string('link_location_desc', 'local_kalturamediagallery'), + LOCAL_KALTURAMEDIAGALLERY_LINK_LOCATION_NAVIGATION_BLOCK, + array( + LOCAL_KALTURAMEDIAGALLERY_LINK_LOCATION_NAVIGATION_BLOCK => get_string('link_location_navigation', 'local_kalturamediagallery'), + LOCAL_KALTURAMEDIAGALLERY_LINK_LOCATION_COURSE_SETTINGS => get_string('link_location_course_settings', 'local_kalturamediagallery'), + ) + ); + $setting->plugin = 'local_kalturamediagallery'; + $settings->add($setting); + + $ADMIN->add('localplugins', $settings); +} diff --git a/local/kalturamediagallery/version.php b/local/kalturamediagallery/version.php new file mode 100644 index 0000000000000..efdf5df9bb2ed --- /dev/null +++ b/local/kalturamediagallery/version.php @@ -0,0 +1,36 @@ +. + +/** + * Kaltura media gallery version file. + * + * @package local_kalturamediagallery + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +$plugin->version = 2024100702; +$plugin->component = 'local_kalturamediagallery'; +$plugin->release = 'Kaltura release 4.5.1'; +$plugin->requires = 2024042200; +$plugin->maturity = MATURITY_STABLE; +$plugin->dependencies = array( + 'local_kaltura' => 2024100702 +); diff --git a/local/mymedia/classes/privacy/provider.php b/local/mymedia/classes/privacy/provider.php new file mode 100644 index 0000000000000..18ba40cee2ba2 --- /dev/null +++ b/local/mymedia/classes/privacy/provider.php @@ -0,0 +1,20 @@ +. + +/** + * My Media capabilities. + * + * @package local_mymedia + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$capabilities = array( + 'local/mymedia:view' => array( + 'captype' => 'read', + 'contextlevel' => CONTEXT_USER, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), +); \ No newline at end of file diff --git a/local/mymedia/lang/en/local_mymedia.php b/local/mymedia/lang/en/local_mymedia.php new file mode 100644 index 0000000000000..35d19e50029bf --- /dev/null +++ b/local/mymedia/lang/en/local_mymedia.php @@ -0,0 +1,37 @@ +. + +/** + * My Media language file. + * + * @package local_mymedia + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$string['heading_mymedia'] = 'My Media'; +$string['invalid_launch_parameters'] = 'Invalid launch parameters'; +$string['mymedia:view'] = 'View My Media page'; +$string['nav_mymedia'] = 'My Media'; +$string['pluginname'] = 'My Media'; +$string['setting_heading_desc'] = 'Settings'; +$string['link_location'] = 'Link location'; +$string['link_location_desc'] = 'Choose where My Media link is displayed'; +$string['link_location_top_menu'] = 'Top navigation menu'; +$string['link_location_side_menu'] = 'Side navigation menu'; +$string['link_location_user_menu'] = 'User navigation menu'; +$string['privacy:metadata'] = 'My Media plugin does not store any personal data.'; diff --git a/local/mymedia/lib.php b/local/mymedia/lib.php new file mode 100644 index 0000000000000..5adc340b5372e --- /dev/null +++ b/local/mymedia/lib.php @@ -0,0 +1,88 @@ +. + +/** + * Kaltura my media library script + * + * @package local_mymedia + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +define('LOCAL_KALTURAMYMEDIA_LINK_LOCATION_TOP_NAVIGATION_MENU', 0); +define('LOCAL_KALTURAMYMEDIA_LINK_LOCATION_SIDE_NAVIGATION_MENU', 1); +define('LOCAL_KALTURAMYMEDIA_LINK_LOCATION_USER_NAVIGATION_MENU', 2); + +/** + * This function adds my media links to the navigation block + * @param global_navigation $navigation a global_navigation object + * @return void + */ +function local_mymedia_extend_navigation($navigation) { + global $USER, $DB, $PAGE, $CFG; + + if (empty($USER->id)) { + return; + } + + // When on the admin-index page, first check if the capability exists. + // This is to cover the edge case on the Plugins check page, where a check for the capability is performed before the capability has been added to the Moodle mdl_capabilities + // table. + if ('admin-index' === $PAGE->pagetype) { + $exists = $DB->record_exists('capabilities', array('name' => 'local/mymedia:view')); + + if (!$exists) { + return; + } + } + + $context = context_user::instance($USER->id); + + if (!has_capability('local/mymedia:view', $context, $USER)) { + return; + } + + $linkLocation = get_config('local_mymedia', 'link_location'); + $mymediaString = get_string('nav_mymedia', 'local_mymedia'); + $mymediaUrl = '/local/mymedia/mymedia.php'; + $fullMenuItem = "\n$mymediaString|$mymediaUrl"; + + // handle link placement based on link_location configuration + switch ($linkLocation) { + case LOCAL_KALTURAMYMEDIA_LINK_LOCATION_SIDE_NAVIGATION_MENU: + // add to side navigation + $nodehome = $navigation->get('home'); + if (empty($nodehome)){ + $nodehome = $navigation; + } + $icon = new pix_icon('my-media', '', 'local_mymedia'); + $nodemymedia = $nodehome->add($mymediaString, new moodle_url($mymediaUrl), navigation_node::NODETYPE_LEAF, $mymediaString, 'mymedia', $icon); + $nodemymedia->showinflatnavigation = true; + break; + case LOCAL_KALTURAMYMEDIA_LINK_LOCATION_USER_NAVIGATION_MENU: + // add menu item to user menu if it does not already exist + if (strpos($CFG->customusermenuitems, $mymediaString) === false) { + $CFG->customusermenuitems .= $fullMenuItem; + } + break; + case LOCAL_KALTURAMYMEDIA_LINK_LOCATION_TOP_NAVIGATION_MENU: + default: + // add menu item to top navigation menu if it does not already exist + if (strpos($CFG->custommenuitems, $mymediaString) === false) { + $CFG->custommenuitems .= $fullMenuItem; + } + break; + } +} diff --git a/local/mymedia/lti_launch.php b/local/mymedia/lti_launch.php new file mode 100644 index 0000000000000..2f8942319b5f9 --- /dev/null +++ b/local/mymedia/lti_launch.php @@ -0,0 +1,51 @@ +. + +/** + * My Media LTI launch page. + * + * @package local_mymedia + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); + +global $USER; + +require_login(); + +$context = context_user::instance($USER->id); +require_capability('local/mymedia:view', $context); + +$launch = array(); +$launch['id'] = 1; +$launch['cmid'] = 0; +$launch['title'] = 'My Media'; +$launch['module'] = KAF_MYMEDIA_MODULE; +$launch['course'] = $PAGE->course; +$launch['width'] = '300'; +$launch['height'] = '300'; +$launch['custom_publishdata'] = ''; + +if (local_kaltura_validate_mymedia_required_params($launch)) { + $content = local_kaltura_request_lti_launch($launch); + echo $content; +} else { + echo get_string('invalid_launch_parameters', 'local_mymedia'); +} \ No newline at end of file diff --git a/local/mymedia/mymedia.php b/local/mymedia/mymedia.php new file mode 100644 index 0000000000000..7038f2c3564e2 --- /dev/null +++ b/local/mymedia/mymedia.php @@ -0,0 +1,68 @@ +. + +/** + * My Media main viewing page. + * + * @package local_mymedia + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); + +global $USER; + +require_login(); + +$context = context_user::instance($USER->id); +require_capability('local/mymedia:view', $context); + +$PAGE->set_context(context_system::instance()); +$header = fullname($USER) . ": " . get_string('heading_mymedia', 'local_mymedia'); + +$PAGE->set_url('/local/mymedia/mymedia.php'); +$PAGE->set_pagetype('mymedia-index'); +$PAGE->set_title($header); +$PAGE->set_heading($header); + +$pageclass = 'kaltura-mediagallery-body'; +$PAGE->add_body_class($pageclass); + +echo $OUTPUT->header(); + +// Request the launch content with an iframe tag. +$attr = array( + 'id' => 'contentframe', + 'height' => '600px', + 'width' => '100%', + 'allowfullscreen' => 'true', + 'src' => 'lti_launch.php', + 'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;', +); +echo html_writer::tag('iframe', '', $attr); + +// Require a YUI module to make the iframe tag be as large as possible. +$params = array( + 'bodyclass' => $pageclass, + 'lastheight' => null, + 'padding' => 15 +); +$PAGE->requires->yui_module('moodle-local_kaltura-lticontainer', 'M.local_kaltura.init', array($params), null, true); +$PAGE->requires->js(new moodle_url('/local/kaltura/js/kea_resize.js')); + +echo $OUTPUT->footer(); diff --git a/local/mymedia/pix/my-media-big.png b/local/mymedia/pix/my-media-big.png new file mode 100755 index 0000000000000..7e26b25462b2d Binary files /dev/null and b/local/mymedia/pix/my-media-big.png differ diff --git a/local/mymedia/pix/my-media-big.svg b/local/mymedia/pix/my-media-big.svg new file mode 100755 index 0000000000000..8617af9d1c0e9 --- /dev/null +++ b/local/mymedia/pix/my-media-big.svg @@ -0,0 +1,8 @@ + + +my-media-big + + + + + diff --git a/local/mymedia/pix/my-media.png b/local/mymedia/pix/my-media.png new file mode 100755 index 0000000000000..1d49160528f6e Binary files /dev/null and b/local/mymedia/pix/my-media.png differ diff --git a/local/mymedia/pix/my-media.svg b/local/mymedia/pix/my-media.svg new file mode 100755 index 0000000000000..b7c458ac20b57 --- /dev/null +++ b/local/mymedia/pix/my-media.svg @@ -0,0 +1,8 @@ + + +my-media + + + + + diff --git a/local/mymedia/renderer.php b/local/mymedia/renderer.php new file mode 100644 index 0000000000000..0a80fe4d0d1eb --- /dev/null +++ b/local/mymedia/renderer.php @@ -0,0 +1,922 @@ +. + +/** + * My Media display library + * + * @package local_mymedia + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page +} + +require_once(dirname(dirname(dirname(__FILE__))) . '/lib/tablelib.php'); + +class local_mymedia_renderer extends plugin_renderer_base { + + /** + * This function outputs a table layout for display videos + * + * @param array - array of Kaltura video entry objects + * + * @return HTML markup + */ + public function create_vidoes_table($video_list = array()) { + $output = ''; + $max_columns = 3; + + $table = new html_table(); + + $table->id = 'mymedia_vidoes'; + $table->size = array('25%', '25%', '25%'); + $table->colclasses = array('mymedia column 1', 'mymedia column 2', 'mymedia column 3'); + + $table->align = array('center', 'center', 'center'); + $table->data = array(); + + $i = 0; + $x = 0; + $data = array(); + + foreach ($video_list as $key => $video) { + + if (KalturaEntryStatus::READY == $video->status) { + $data[] = $this->create_video_entry_markup($video); + } else { + $data[] = $this->create_video_entry_markup($video, false); + } + + + // When the max number of columns is reached, add the data to the table object + if ($max_columns == count($data)) { + + $table->data[] = $data; + $table->rowclasses[] = 'row_' . $i; + $data = array(); + $i++; + + } else if ($x == count($video_list) -1 ) { + + $left_over_cells = $max_columns - count($data); + + // Add some extra cells to make the table symetrical + if ($left_over_cells) { + for ($t = 1; $t <= $left_over_cells; $t++) { + $data[] = ''; + } + } + $table->data[] = $data; + $table->rowclasses[] = 'row_' . $i; + + } + + $x++; + } + + $attr = array('style' => 'overflow:auto;overflow-y:hidden'); + $output .= html_writer::start_tag('center'); + $output .= html_writer::start_tag('div', $attr); + $output .= html_writer::table($table); + $output .= html_writer::end_tag('div'); + $output .= html_writer::end_tag('center'); + + echo $output; + } + + /** + * This function creates HTML markup used to sort the video listing. + * + * @return HTML Markup for sorting pulldown. + */ + public function create_sort_option() { + global $CFG, $SESSION; + + $recent = null; + $old = null; + $nameasc = null; + $namedesc = null; + $sorturl = $CFG->wwwroot.'/local/mymedia/mymedia.php?sort='; + + if (isset($SESSION->mymediasort) && !empty($SESSION->mymediasort)) { + $sort = $SESSION->mymediasort; + if ($sort == 'recent') { + $recent = "selected"; + } else if ($sort == 'old') { + $old = "selected"; + } else if ($sort == 'name_asc') { + $nameasc = "selected"; + } else if ($sort == 'name_desc') { + $namedesc = "selected"; + } else { + $recent = "selected"; + } + } else { + $recent = "selected"; + } + + $sort = html_writer::tag('label', get_string('sortby', 'local_mymedia').':'); + $sort .= html_writer::start_tag('select', array('id' => 'mymediasort')); + $sort .= html_writer::tag('option', get_string('mostrecent', 'local_mymedia'), array('value' => $sorturl.'recent', 'selected' => $recent)); + $sort .= html_writer::tag('option', get_string('oldest', 'local_mymedia'), array('value' => $sorturl.'old', 'selected' => $old)); + $sort .= html_writer::tag('option', get_string('medianameasc', 'local_mymedia'), array('value' => $sorturl.'name_asc', 'selected' => $nameasc)); + $sort .= html_writer::tag('option', get_string('medianamedesc', 'local_mymedia'), array('value' => $sorturl.'name_desc', 'selected' => $namedesc)); + $sort .= html_writer::end_tag('select'); + + return $sort; + } + + public function create_options_table_upper($page, $partner_id = '', $login_session = '') { + global $USER; + + $output = ''; + + $attr = array('border' => 0, 'width' => '100%', + 'class' => 'mymedia upper paging upload search'); + $output .= html_writer::start_tag('table', $attr); + + $attr = array('class' => 'mymedia upper row_0 upload search'); + $output .= html_writer::start_tag('tr', $attr); + + $attr = array('colspan' => 3, 'align' => 'right', + 'class' => 'mymedia upper col_0'); + $output .= html_writer::start_tag('td', $attr); + + $upload = ''; + $simple_search = ''; + $screenrec = ''; + $enable_ksr = get_config(KALTURA_PLUGIN_NAME, 'enable_screen_recorder'); + + $context = context_user::instance($USER->id); + + if (has_capability('local/mymedia:upload', $context, $USER)) { + $upload = $this->create_upload_markup(); + } + + if ($enable_ksr && has_capability('local/mymedia:screenrecorder', $context, $USER)) { + $screenrec = $this->create_screenrecorder_markup($partner_id, $login_session); + } + + if (has_capability('local/mymedia:search', $context, $USER)) { + $simple_search = $this->create_search_markup(); + } + + $output .= $upload . '  ' . $screenrec . $simple_search; + + $output .= html_writer::end_tag('td'); + + $output .= html_writer::end_tag('tr'); + + $attr = array('class' => 'mymedia upper row_1 paging'); + $output .= html_writer::start_tag('tr', $attr); + + $attr = array('colspan' => 3, 'align' => 'center', + 'class' => 'mymedia upper col_0'); + $output .= html_writer::start_tag('td', $attr); + + if (!empty($page)) { + $output .= $this->create_sort_option(); + $output .= $page; + } + + $output .= html_writer::end_tag('td'); + + $output .= html_writer::end_tag('tr'); + + $output .= html_writer::end_tag('table'); + + return $output; + } + + public function create_options_table_lower($page) { + global $USER; + + $output = ''; + + $attr = array('border' => 0, 'width' => '100%'); + $output .= html_writer::start_tag('table', $attr); + + $output .= html_writer::start_tag('tr'); + + $attr = array('colspan' => 3, 'align' => 'center'); + $output .= html_writer::start_tag('td', $attr); + + $output .= $page; + + $output .= html_writer::end_tag('td'); + + $output .= html_writer::end_tag('tr'); + + $output .= html_writer::end_tag('table'); + + return $output; + } + + /** + * This function creates HTML markup used to display the video name + * + * @param string - name of video + * @return HTML markup + */ + public function create_video_name_markup($name) { + + $output = ''; + $attr = array('class' => 'mymedia video name', + 'title' => $name); + + $output .= html_writer::start_tag('div', $attr); + $output .= html_writer::tag('label', $name); + $output .= html_writer::end_tag('div'); + + return $output; + } + + /** + * This function creates HTML markup used to display the video thumbnail + * + * @param string - thumbnail URL + * @param string - alternate text + * + * @param HTML markup + */ + public function create_video_thumbnail_markup($url, $alt) { + + $output = ''; + $attr = array('class' => 'mymedia video thumbnail'); + + $output .= html_writer::start_tag('div', $attr); + + $attr = array('src' => $url . '/width/150/height/100/type/3', + 'alt' => $alt, + 'height' => 100, + 'width' => 150, + 'title' => $alt); + + $output .= html_writer::empty_tag('img', $attr); + + $output .= html_writer::end_tag('div'); + + return $output; + } + + public function create_video_created_markup($date) { + + $output = ''; + $attr = array('class' => 'mymedia video created', + 'title' => userdate($date)); + + $output .= html_writer::start_tag('div', $attr); + $output .= html_writer::tag('label', userdate($date)); + $output .= html_writer::end_tag('div'); + + return $output; + } + + public function create_video_preview_link_markup() { + + $output = ''; + + $attr = array('class' => 'mymedia video preview container'); + $output .= html_writer::start_tag('span', $attr); + + $attr = array('class' => 'mymedia video preview', + 'href' => '#', + 'title' => get_string('preview_link', 'local_mymedia') + ); + + $output .= html_writer::start_tag('a', $attr); + $output .= get_string('preview_link', 'local_mymedia'); + $output .= html_writer::end_tag('a'); + + $output .= html_writer::end_tag('span'); + + return $output; + } + + public function create_video_share_link_markup() { + + $output = ''; + + $attr = array('class' => 'mymedia video share container'); + $output .= html_writer::start_tag('span', $attr); + + $attr = array('class' => 'mymedia video share', + 'href' => '#', + 'title' => get_string('share_link', 'local_mymedia') + ); + + $output .= html_writer::start_tag('a', $attr); + $output .= get_string('share_link', 'local_mymedia'); + $output .= html_writer::end_tag('a'); + + $output .= html_writer::end_tag('span'); + + return $output; + } + + public function create_video_edit_link_markup() { + + $output = ''; + + $attr = array('class' => 'mymedia video edit container'); + $output .= html_writer::start_tag('span', $attr); + + $attr = array('class' => 'mymedia video edit', + 'href' => '#', + 'title' => get_string('edit_link', 'local_mymedia') + ); + + $output .= html_writer::start_tag('a', $attr); + $output .= get_string('edit_link', 'local_mymedia'); + $output .= html_writer::end_tag('a'); + + $output .= html_writer::end_tag('span'); + + return $output; + } + + public function create_video_clip_link_markup() { + + $output = ''; + + $attr = array('class' => 'mymedia video clip container'); + $output .= html_writer::start_tag('span', $attr); + + $attr = array('class' => 'mymedia video clip', + 'href' => '#', + ); + + $output .= html_writer::start_tag('a', $attr); + $output .= get_string('clip_link', 'local_mymedia'); + $output .= html_writer::end_tag('a'); + + $output .= html_writer::end_tag('span'); + + return $output; + } + + public function create_video_delete_link_markup($entry) { + + global $CFG; + + $output = ''; + + $attr = array('class' => 'mymedia video delete container'); + $output .= html_writer::start_tag('span', $attr); + + $attr = array('class' => 'mymedia video delete', + 'href' => new moodle_url($CFG->wwwroot . '/local/mymedia/delete_video.php', array('entry_id' => $entry->id)) + ); + + $output .= html_writer::start_tag('a', $attr); + $output .= get_string('delete_link', 'local_mymedia'); + $output .= html_writer::end_tag('a'); + + $output .= html_writer::end_tag('span'); + + return $output; + } + + /** + * This function creates HTML markup for a video entry + * + * @param obj - Kaltura video object + */ + public function create_video_entry_markup($entry, $entry_ready = true) { + + global $USER; + + $output = ''; + + $attr = array('class' => 'mymedia video entry', + 'id' => $entry->id); + + $output .= html_writer::start_tag('div', $attr); + + if ($entry_ready) { + + $output .= $this->create_video_name_markup($entry->name); + + $output .= $this->create_video_thumbnail_markup($entry->thumbnailUrl, + $entry->name); + } else { + + $output .= $this->create_video_name_markup($entry->name . ' (' . + get_string('converting', 'local_mymedia') . ')'); + + $output .= $this->create_video_thumbnail_markup($entry->thumbnailUrl, + $entry->name); + } + + + $output .= $this->create_video_created_markup($entry->createdAt); + + $attr = array('class' => 'mymedia video action bar', + 'id' => $entry->id . '_action'); + + $output .= html_writer::start_tag('div', $attr); + + $context = context_user::instance($USER->id); + + $output .= $this->create_video_preview_link_markup(); + $output .= '  '; + + if (has_capability('local/mymedia:editmetadata', $context, $USER)) { + $output .= $this->create_video_edit_link_markup(); + $output .= '  '; + } + + if (local_mymedia_check_capability('local/mymedia:sharesite') || local_mymedia_check_capability('local/mymedia:sharecourse')) { + $output .= $this->create_video_share_link_markup(); + } + +/* + if (has_capability('local/mymedia:delete', $context, $USER)) { + $output .= $this->create_video_delete_link_markup($entry); + } +*/ + $output .= html_writer::end_tag('div'); + + $output .= html_writer::end_tag('div'); + + // Add entry to cache + $entries = new KalturaStaticEntries(); + KalturaStaticEntries::addEntryObject($entry); + return $output; + + } + + /** + * Displays the YUI panel markup used to display embedded video markup + * + * @return string - HTML markup + */ + public function video_details_markup($courses) { + $output = ''; + + $attr = array('id' => 'id_video_details', + 'class' => 'video_details'); + $output .= html_writer::start_tag('div', $attr); + + $attr = array('class' => 'hd'); + $output .= html_writer::tag('div', get_string('details', 'local_mymedia'), $attr); + + $attr = array('class' => 'bd'); + $output .= html_writer::tag('div', $this->video_details_tabs_markup($courses), $attr); + + + $attr = array('id' => 'id_video_details_save', + 'type' => 'submit', + 'value' => get_string('save', 'local_mymedia')); + + $button = html_writer::empty_tag('input', $attr); + + $attr = array('class' => 'ft'); + $output .= html_writer::tag('div', "
$button
", $attr); + + $output .= html_writer::end_tag('div'); + + return $output; + + } + + /** + * This function returns YUI TabView HTML markup + * + * @param none + * @return string - HTML markup + */ + public function video_details_tabs_markup($courses) { + + $output = ''; + + $attr = array('id' => 'id_video_details_tab'); + + $output .= html_writer::start_tag('div', $attr); + + $output .= html_writer::start_tag('ul'); + + $attr = array('href' => '#preview', + 'title' => get_string('tab_preview', 'local_mymedia')); + $element = html_writer::tag('a', get_string('tab_preview', 'local_mymedia'), $attr); + $output .= html_writer::tag('li', $element); + + + $attr = array('href' => '#metadata', + 'title' => get_string('tab_metadata', 'local_mymedia')); + $element = html_writer::tag('a', get_string('tab_metadata', 'local_mymedia'), $attr); + $output .= html_writer::tag('li', $element); + + $attr = array('href' => '#share', + 'title' => get_string('tab_share', 'local_mymedia')); + $element = html_writer::tag('a', get_string('tab_share', 'local_mymedia'), $attr); + $output .= html_writer::tag('li', $element); + + $output .= html_writer::end_tag('ul'); + + $output .= html_writer::start_tag('div'); + + $attr = array('id' => 'preview'); + $output .= html_writer::tag('div', '', $attr); + + $attr = array('id' => 'metadata'); + $output .= html_writer::tag('div', $this->video_metadata_form(), $attr); + + $attr = array('id' => 'share'); + $output .= html_writer::tag('div', $this->enrolled_course_share_markup($courses), $attr); + + $output .= html_writer::end_tag('div'); + + $output .= html_writer::end_tag('div'); + + return $output; + } + + /** + * This function outputs the video edit metadata elements + * + * @param none + * @return string - HTML markup + */ + public function video_metadata_form() { + $output = ''; + + + $attr = array('id' => 'mymedia_video_metadata_table', + 'class' => 'mymedia video metadata_table', + 'border' => 0); + + $output .= html_writer::start_tag('table', $attr); + + $output .= html_writer::start_tag('tr'); + + $output .= html_writer::start_tag('td'); + + $output .= html_writer::tag('label', get_string('metadata_video_name', 'local_mymedia')); + + $output .= html_writer::end_tag('td'); + + // Add video name text field + $attr = array('type' => 'text', + 'size' => 35, + 'maxlength' => 100, + 'id' => 'metadata_video_name', + 'name' => 'video_name', + 'class' => 'mymedia video name metadata', + 'title' => get_string('metadata_video_name', 'local_mymedia')); + + $output .= html_writer::start_tag('td'); + + $output .= html_writer::empty_tag('input', $attr); + + $output .= html_writer::end_tag('td'); + + $output .= html_writer::end_tag('tr'); + $output .= html_writer::start_tag('tr'); + + $output .= html_writer::start_tag('td'); + + $output .= html_writer::tag('label', get_string('metadata_video_tags', 'local_mymedia')); + + $output .= html_writer::end_tag('td'); + + // Add video tags text field + $attr = array('type' => 'text', + 'size' => 35, + 'maxlength' => 100, + 'id' => 'metadata_video_tags', + 'name' => 'video_tags', + 'class' => 'mymedia video tags metadata', + 'title' => get_string('metadata_video_tags', 'local_mymedia')); + + $output .= html_writer::start_tag('td'); + + $output .= html_writer::empty_tag('input', $attr); + + $output .= html_writer::end_tag('td'); + + $output .= html_writer::end_tag('tr'); + $output .= html_writer::start_tag('tr'); + + $output .= html_writer::start_tag('td'); + + $output .= html_writer::tag('label', get_string('metadata_video_desc', 'local_mymedia')); + + $output .= html_writer::end_tag('td'); + + // Add description text area + $attr = array('rows' => '7', + 'cols' => '35', + 'id' => 'metadata_video_desc', + 'name' => 'video_desc', + 'class' => 'mymedia video desc metadata', + 'title' => get_string('metadata_video_desc', 'local_mymedia')); + + $output .= html_writer::start_tag('td'); + + $output .= html_writer::tag('textarea', '', $attr); + + // Add hidden element + $attr = array('type' => 'hidden', + 'id' => 'metadata_entry_id', + 'name' => 'metadata_entry_id'); + + $output .= html_writer::empty_tag('input', $attr); + + $output .= html_writer::end_tag('td'); + + + $output .= html_writer::end_tag('tr'); + + $output .= html_writer::end_tag('table'); + + return $output; + + } + + /** + * This function prints a global share checkbox and a list of courses as + * checkboxes + * + * @param array - array of courses (minimum id and fullname fields) + */ + public function enrolled_course_share_markup($courses) { + + // Print beginning of div container + $attr = array('id' => 'mymedia_course_list', + 'class' => 'mymedia course list checkboxes', + ); + + $output = html_writer::start_tag('div', $attr); + + // Print site share checkbox + $attr = array('type' => 'checkbox', + 'name' => 'site_share', + 'class' => 'mymedia course checkbox site_share', + 'id' => 'site_share', + 'value' => '1', + 'title' => get_string('site_share', 'local_mymedia')); + + $output .= html_writer::empty_tag('input', $attr); + + $output .= ' ' . get_string('site_share', 'local_mymedia') . '

'; + + + // Print check all checkbox + if (!empty($courses)) { + $attr = array('type' => 'checkbox', + 'name' => 'check_all_courses', + 'class' => 'mymedia course checkbox checkall', + 'id' => 'check_all', + 'value' => '0', + 'title' => get_string('check_all', 'local_mymedia')); + + $output .= html_writer::empty_tag('input', $attr); + + $output .= ' ' . get_string('check_all', 'local_mymedia') . '
'; + } + + // Print beginning of table + $attr = array('border' => 0, + 'class' => 'mymedia course checkbox table', + 'id' => 'mymedia_courses_table'); + + $output .= html_writer::start_tag('table', $attr); + + + // Print courses and table cols/rows + $attr = array('type' => 'checkbox', + 'name' => 'enrolled_courses', + 'class' => 'mymedia course chexkbox'); + + $row_attr = array('class' => 'mymedia course checkbox table row'); + $col_attr = array('class' => 'mymedia course checkbox table col checkbox'); + $col2_attr = array('class' => 'mymedia course checkbox table col name'); + foreach ($courses as $course) { + + $checkbox_name = $course->fullname; + $attr['value'] = $course->id; + $attr['title'] = $checkbox_name; + + $checkbox = html_writer::empty_tag('input', $attr); + + $output .= html_writer::start_tag('tr', $row_attr); + + $output .= html_writer::tag('td', $checkbox, $col_attr); + + $output .= html_writer::tag('td', $checkbox_name, $col2_attr); + + $output .= html_writer::end_tag('tr'); + } + + $output .= html_writer::end_tag('table'); + + $output .= html_writer::end_tag('div'); + + return $output; + + } + + public function create_simple_dialog_markup() { + + $attr = array('id' => 'mymedia_simple_dialog'); + $output = html_writer::start_tag('div'); + + $attr = array('class' => 'hd'); + $output .= html_writer::tag('div', '', $attr); + + $attr = array('class' => 'bd'); + $output .= html_writer::tag('div', '', $attr); + + $output .= html_writer::end_tag('div'); + + // tabindex -1 is required in order for the focus event to be capture + // amongst all browsers + $attr = array('id' => 'notification', + 'class' => 'mymedia notification', + 'tabindex' => '-1'); + $output .= html_writer::tag('div', '', $attr); + + return $output; + } + + public function create_kcw_panel_markup() { + + $output = ''; + + $attr = array('id' => 'kcw_panel'); + $output .= html_writer::start_tag('div', $attr); + + $attr = array('class' => 'hd'); + $output .= html_writer::tag('div', '', $attr); + + $attr = array('class' => 'bd'); + $output .= html_writer::tag('div', '', $attr); + + $output .= html_writer::end_tag('div'); + + return $output; + } + + public function create_search_markup() { + global $SESSION; + + $attr = array('id' => 'simple_search_container', + 'class' => 'mymedia simple search container'); + + $output = html_writer::start_tag('span', $attr); + + $attr = array('method' => 'post', + 'action' => new moodle_url('/local/mymedia/mymedia.php'), + 'class' => 'mymedia search form'); + + $output .= html_writer::start_tag('form', $attr); + + $default_value = (isset($SESSION->mymedia) && !empty($SESSION->mymedia)) ? $SESSION->mymedia : ''; + $attr = array('type' => 'text', + 'id' => 'simple_search', + 'class' => 'mymedia simple search', + 'name' => 'simple_search_name', + 'value' => $default_value, + 'title' => get_string('search_text_tooltip', 'local_mymedia')); + + $output .= html_writer::empty_tag('input', $attr); + + $attr = array('type' => 'hidden', + 'id' => 'sesskey_id', + 'name' => 'sesskey', + 'value' => sesskey()); + + $output .= html_writer::empty_tag('input', $attr); + + $output .= '  '; + + $attr = array('type' => 'submit', + 'id' => 'simple_search_btn', + 'name' => 'simple_search_btn_name', + 'value' => get_string('search', 'local_mymedia'), + 'class' => 'mymedia simple search button', + 'title' => get_string('search', 'local_mymedia')); + + $output .= html_writer::empty_tag('input', $attr); + + $attr = array('type' => 'submit', + 'id' => 'clear_simple_search_btn', + 'name' => 'clear_simple_search_btn_name', + 'value' => get_string('search_clear', 'local_mymedia'), + 'class' => 'mymedia simple search button clear', + 'title' => get_string('search_clear', 'local_mymedia')); + + $output .= html_writer::empty_tag('input', $attr); + + $output .= html_writer::end_tag('form'); + + $output .= html_writer::end_tag('span'); + + return $output; + } + + public function create_upload_markup() { + + $attr = array('id' => 'upload_btn_container', + 'class' => 'mymedia upload button container'); + + $output = html_writer::start_tag('span', $attr); + + $attr = array('id' => 'upload_btn', + 'class' => 'mymedia upload button', + 'value' => get_string('upload', 'local_mymedia'), + 'type' => 'button', + 'title' => get_string('upload', 'local_mymedia')); + + $output .= html_writer::empty_tag('input', $attr); + + $output .= html_writer::end_tag('span'); + + return $output; + + } + + public function create_loading_screen_markup() { + + $attr = array('id' => 'wait'); + $output = html_writer::start_tag('div', $attr); + + $attr = array('class' => 'hd'); + $output .= html_writer::tag('div', '', $attr); + + $attr = array('class' => 'bd'); + + $output .= html_writer::tag('div', '', $attr); + + $output .= html_writer::end_tag('div'); + + return $output; + } + + /** + * Generate the screen recorder button markup. + * + * @param int $partner_id The Kaltura partner ID + * @param string $login_session The Kaltura session + * @return string HTML Markup for screen recorder button + */ + public function create_screenrecorder_markup($partner_id, $login_session) { + + $attr = array('id' => 'screenrecorder_btn_container', + 'class' => 'mymedia screenrecorder button container'); + + $output = html_writer::start_tag('span', $attr); + + $attr = array('id' => 'scr_btn', + 'class' => 'mymedia screenrecorder button', + 'value' => get_string('screenrecorder', 'local_mymedia'), + 'type' => 'button', + 'title' => get_string('screenrecorder', 'local_mymedia'), + 'onclick' => "document.getElementById('progress_bar_container').style.visibility = 'visible';". + "document.getElementById('slider_border').style.borderStyle = 'none';". + "document.getElementById('loading_text').innerHTML = '".get_string('checkingforjava', 'local_mymedia')."';". + "kalturaScreenRecord.setDetectResultErrorMessageElementId('loading_text');". + "kalturaScreenRecord.setDetectTextJavaDisabled('".get_string('javanotenabled', 'local_mymedia')."');". + "kalturaScreenRecord.setDetectTextmacLionNeedsInstall('".get_string('javanotenabled', 'local_mymedia')."');". + "kalturaScreenRecord.setDetectTextjavaNotDetected('".get_string('javanotenabled', 'local_mymedia')."');". + "kalturaScreenRecord.startCallBack.detection_in_progress = true;". + "kalturaScreenRecord.startCallBack.detection_process = setTimeout('kalturaScreenRecord.clearDetectionFlagAndDisplayError()', 30000);". + "kalturaScreenRecord.startKsr('{$partner_id}', '{$login_session}', 'true');" + ); + + $output .= html_writer::empty_tag('input', $attr); + + $output .= html_writer::end_tag('span'); + + // Add progress bar + $attr = array('id' => 'progress_bar'); + $progress_bar = html_writer::tag('span', '', $attr); + + $attr = array('id' => 'slider_border'); + $slider_border = html_writer::tag('div', $progress_bar, $attr); + + $attr = array('id' => 'loading_text'); + $loading_text = html_writer::tag('div', get_string('checkingforjava', 'local_mymedia'), $attr); + + $attr = array('id' => 'progress_bar_container'); + $output = $output . html_writer::tag('span', $slider_border . $loading_text, $attr); + + return $output; + + } +} diff --git a/local/mymedia/settings.php b/local/mymedia/settings.php new file mode 100644 index 0000000000000..3c4af3135ac30 --- /dev/null +++ b/local/mymedia/settings.php @@ -0,0 +1,58 @@ +. + +/* + * @package local + * @subpackage mymedia + * + */ + +defined('MOODLE_INTERNAL') || die('Invalid access'); + +global $CFG; +require_once $CFG->dirroot. '/local/mymedia/lib.php'; + +if ($hassiteconfig) { + $settings = new admin_settingpage( + 'local_mymedia', + get_string('pluginname', 'local_mymedia') + ); + + //heading + $setting = new admin_setting_heading( + 'heading', + '', get_string('setting_heading_desc', 'local_mymedia') + ); + $setting->plugin = 'local_mymedia'; + $settings->add($setting); + + //link location + $setting = new admin_setting_configselect( + 'link_location', + get_string('link_location', 'local_mymedia'), + get_string('link_location_desc', 'local_mymedia'), + LOCAL_KALTURAMYMEDIA_LINK_LOCATION_TOP_NAVIGATION_MENU, + array( + LOCAL_KALTURAMYMEDIA_LINK_LOCATION_TOP_NAVIGATION_MENU => get_string('link_location_top_menu', 'local_mymedia'), + LOCAL_KALTURAMYMEDIA_LINK_LOCATION_SIDE_NAVIGATION_MENU => get_string('link_location_side_menu', 'local_mymedia'), + LOCAL_KALTURAMYMEDIA_LINK_LOCATION_USER_NAVIGATION_MENU => get_string('link_location_user_menu', 'local_mymedia') + ) + ); + $setting->plugin = 'local_mymedia'; + $settings->add($setting); + + $ADMIN->add('localplugins', $settings); +} diff --git a/local/mymedia/version.php b/local/mymedia/version.php new file mode 100644 index 0000000000000..5ed2f3f5b8288 --- /dev/null +++ b/local/mymedia/version.php @@ -0,0 +1,35 @@ +. + +/** + * My Media version file. + * + * @package local_mymedia + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +$plugin->version = 2024100702; +$plugin->component = 'local_mymedia'; +$plugin->release = 'Kaltura release 4.5.1'; +$plugin->requires = 2024042200; +$plugin->maturity = MATURITY_STABLE; +$plugin->dependencies = array( + 'local_kaltura' => 2024100702 +); diff --git a/mod/kalvidassign/backup/moodle2/backup_kalvidassign_activity_task.class.php b/mod/kalvidassign/backup/moodle2/backup_kalvidassign_activity_task.class.php new file mode 100644 index 0000000000000..f2b8e7517b095 --- /dev/null +++ b/mod/kalvidassign/backup/moodle2/backup_kalvidassign_activity_task.class.php @@ -0,0 +1,67 @@ +. + +/** + * Kaltura video assignment backup activity task class. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once($CFG->dirroot.'/mod/kalvidassign/backup/moodle2/backup_kalvidassign_stepslib.php'); +require_once($CFG->dirroot.'/mod/kalvidassign/backup/moodle2/backup_kalvidassign_settingslib.php'); + +/** + * kalvidassign backup task that provides all the settings and steps to perform one + * complete backup of the activity + */ +class backup_kalvidassign_activity_task extends backup_activity_task { + + /** + * Define (add) particular settings this activity can have. + */ + protected function define_my_settings() { + // No particular settings for this activity. + } + + /** + * Define (add) particular steps this activity can have. + */ + protected function define_my_steps() { + // Choice only has one structure step. + $this->add_step(new backup_kalvidassign_activity_structure_step('kalvidassign_structure', 'kalvidassign.xml')); + } + + /** + * Code the transformations to perform in the activity in + * order to get transportable (encoded) links. + */ + static public function encode_content_links($content) { + global $CFG; + + $base = preg_quote($CFG->wwwroot, '/'); + + // Link to the list of kalvidassigns. + $search="/(".$base."\/mod\/kalvidassign\/index.php\?id\=)([0-9]+)/"; + $content= preg_replace($search, '$@KALVIDASSIGNINDEX*$2@$', $content); + + // Link to kalvidassign view by moduleid. + $search="/(".$base."\/mod\/kalvidassign\/view.php\?id\=)([0-9]+)/"; + $content= preg_replace($search, '$@KALVIDASSIGNVIEWBYID*$2@$', $content); + + return $content; + } +} \ No newline at end of file diff --git a/mod/kalvidassign/backup/moodle2/backup_kalvidassign_settingslib.php b/mod/kalvidassign/backup/moodle2/backup_kalvidassign_settingslib.php new file mode 100644 index 0000000000000..6bf1022679e88 --- /dev/null +++ b/mod/kalvidassign/backup/moodle2/backup_kalvidassign_settingslib.php @@ -0,0 +1,26 @@ +. + +/** + * Kaltura backup settingslib script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + + // This activity has no particular settings but the inherited from the generic + // backup_activity_task so here there isn't any class definition, like the ones + // existing in /backup/moodle2/backup_settingslib.php (activities section) \ No newline at end of file diff --git a/mod/kalvidassign/backup/moodle2/backup_kalvidassign_stepslib.php b/mod/kalvidassign/backup/moodle2/backup_kalvidassign_stepslib.php new file mode 100644 index 0000000000000..f7f5380c7c3d3 --- /dev/null +++ b/mod/kalvidassign/backup/moodle2/backup_kalvidassign_stepslib.php @@ -0,0 +1,100 @@ +. + +/** + * Kaltura video assignment backup stepslib script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/** + * Define all the backup steps that will be used by the backup_kalvidassign_activity_task + */ + +/** + * Define the complete kalvidassign structure for backup, with file and id annotations + */ +class backup_kalvidassign_activity_structure_step extends backup_activity_structure_step { + + /** + * This function defines the structure used to backup the activity. + * @return backup_nested_element The $activitystructure wrapped by the common 'activity' element. + */ + protected function define_structure() { + + // To know if we are including userinfo. + $userinfo = $this->get_setting_value('userinfo'); + + // Define each element separated. + $columns = array( + 'course', + 'name', + 'intro', + 'introformat', + 'timeavailable', + 'timedue', + 'preventlate', + 'resubmit', + 'emailteachers', + 'grade', + 'timecreated', + 'timemodified', + 'completionsubmit' + ); + $kalvidassign = new backup_nested_element('kalvidassign', array('id'), $columns); + + $issues = new backup_nested_element('submissions'); + + $columns = array( + 'userid', + 'entry_id', + 'source', + 'width', + 'height', + 'grade', + 'submissioncomment', + 'format', + 'teacher', + 'mailed', + 'timemarked', + 'timecreated', + 'timemodified' + ); + $issue = new backup_nested_element('submission', array('id'), $columns); + + // Build the tree. + $kalvidassign->add_child($issues); + $issues->add_child($issue); + + // Define sources. + $kalvidassign->set_source_table('kalvidassign', array('id' => backup::VAR_ACTIVITYID)); + + // All the rest of elements only happen if we are including user info. + if ($userinfo) { + $issue->set_source_table('kalvidassign_submission', array('vidassignid' => backup::VAR_PARENTID)); + } + + // Annotate the user id's where required. + $issue->annotate_ids('user', 'userid'); + + // Annotate the file areas in use. + $issue->annotate_files('mod_kalvidassign', 'submission', 'id'); + + // Return the root element, wrapped into standard activity structure. + return $this->prepare_activity_structure($kalvidassign); + } +} \ No newline at end of file diff --git a/mod/kalvidassign/backup/moodle2/restore_kalvidassign_activity_task.class.php b/mod/kalvidassign/backup/moodle2/restore_kalvidassign_activity_task.class.php new file mode 100644 index 0000000000000..0ed52df4f50bb --- /dev/null +++ b/mod/kalvidassign/backup/moodle2/restore_kalvidassign_activity_task.class.php @@ -0,0 +1,109 @@ +. + +/** + * Kaltura video assignment restore activity task class script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +defined('MOODLE_INTERNAL') || die(); + +require_once($CFG->dirroot.'/mod/kalvidassign/backup/moodle2/restore_kalvidassign_stepslib.php'); + +/** + * kalvidassign restore task that provides all the settings and steps to perform one + * complete restore of the activity. + */ +class restore_kalvidassign_activity_task extends restore_activity_task { + + /** + * Define (add) particular settings this activity can have. + */ + protected function define_my_settings() { + // No particular settings for this activity. + } + + /** + * Define (add) particular steps this activity can have. + */ + protected function define_my_steps() { + // Certificate only has one structure step. + $this->add_step(new restore_kalvidassign_activity_structure_step('kalvidassign_structure', 'kalvidassign.xml')); + } + + /** + * Define the contents in the activity that must be + * processed by the link decoder. + */ + static public function define_decode_contents() { + $contents = array(); + + $contents[] = new restore_decode_content('kalvidassign', array('intro'), 'kalvidassign'); + + return $contents; + } + + /** + * Define the decoding rules for links belonging + * to the activity to be executed by the link decoder. + */ + static public function define_decode_rules() { + $rules = array(); + + $rules[] = new restore_decode_rule('KALVIDASSIGNVIEWBYID', '/mod/kalvidassign/view.php?id=$1', 'course_module'); + $rules[] = new restore_decode_rule('KALVIDASSIGNINDEX', '/mod/kalvidassign/index.php?id=$1', 'course'); + + return $rules; + + } + + /** + * Define the restore log rules that will be applied + * by the {@link restore_logs_processor} when restoring + * kalvidassign logs. It must return one array + * of {@link restore_log_rule} objects. + */ + static public function define_restore_log_rules() { + $rules = array(); + + $rules[] = new restore_log_rule('kalvidassign', 'add', 'view.php?id={course_module}', '{kalvidassign}'); + $rules[] = new restore_log_rule('kalvidassign', 'update', 'view.php?id={course_module}', '{kalvidassign}'); + $rules[] = new restore_log_rule('kalvidassign', 'view', 'view.php?id={course_module}', '{kalvidassign}'); + + return $rules; + } + + /** + * Define the restore log rules that will be applied + * by the {@link restore_logs_processor} when restoring + * course logs. It must return one array + * of {@link restore_log_rule} objects. + * + * Note this rules are applied when restoring course logs + * by the restore final task, but are defined here at + * activity level. All them are rules not linked to any module instance (cmid = 0). + */ + static public function define_restore_log_rules_for_course() { + $rules = array(); + + // Fix old wrong uses (missing extension) + $rules[] = new restore_log_rule('kalvidassign', 'view all', 'index.php?id={course}', null); + + return $rules; + } +} \ No newline at end of file diff --git a/mod/kalvidassign/backup/moodle2/restore_kalvidassign_stepslib.php b/mod/kalvidassign/backup/moodle2/restore_kalvidassign_stepslib.php new file mode 100644 index 0000000000000..a32272af6603e --- /dev/null +++ b/mod/kalvidassign/backup/moodle2/restore_kalvidassign_stepslib.php @@ -0,0 +1,82 @@ +. + +/** + * Kaltura video assignment restore stepslib script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/** + * Define all the restore steps that will be used by the restore_kalvidassign_activity_task + */ + +/** + * Structure step to restore one kalvidassign activity. + */ +class restore_kalvidassign_activity_structure_step extends restore_activity_structure_step { + + protected function define_structure() { + + $paths = array(); + $userinfo = $this->get_setting_value('userinfo'); + + $paths[] = new restore_path_element('kalvidassign', '/activity/kalvidassign'); + + if ($userinfo) { + $paths[] = new restore_path_element('kalvidassign_submission', '/activity/kalvidassign/submissions/submission'); + } + + // Return the paths wrapped into standard activity structure. + return $this->prepare_activity_structure($paths); + } + + protected function process_kalvidassign($data) { + global $DB; + + $data = (object)$data; + $oldid = $data->id; + $data->course = $this->get_courseid(); + + $data->timemodified = $this->apply_date_offset($data->timemodified); + + // insert the kalvidassign record. + $newitemid = $DB->insert_record('kalvidassign', $data); + // immediately after inserting "activity" record, call this. + $this->apply_activity_instance($newitemid); + } + + protected function process_kalvidassign_submission($data) { + global $DB; + + $data = (object)$data; + $oldid = $data->id; + + $data->vidassignid = $this->get_new_parentid('kalvidassign'); + $data->userid = $this->get_mappingid('user', $data->userid); + $data->timecreated = $this->apply_date_offset($data->timecreated); + + $newitemid = $DB->insert_record('kalvidassign_submission', $data); + $this->set_mapping('kalvidassign_submission', $oldid, $newitemid); + } + + + protected function after_execute() { + // Add kalvidassign related files, no need to match by itemname (just internally handled context). + $this->add_related_files('mod_kalvidassign', 'submission', 'kalvidassign_submission'); + } +} diff --git a/mod/kalvidassign/classes/completion/custom_completion.php b/mod/kalvidassign/classes/completion/custom_completion.php new file mode 100644 index 0000000000000..0772bb31865d1 --- /dev/null +++ b/mod/kalvidassign/classes/completion/custom_completion.php @@ -0,0 +1,88 @@ +. + +declare(strict_types = 1); + +namespace mod_kalvidassign\completion; + +use core_completion\activity_custom_completion; + +/** + * Activity custom completion subclass for the kalvidassign activity. + * + * Class for defining mod_kalvidassign's custom completion rules and fetching the completion statuses + * of the custom completion rules for a given kalvidassign instance and a user. + * + * @package mod_kalvidassign + * @copyright 2025 Roi Levi + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class custom_completion extends activity_custom_completion { + + /** + * Fetches the completion state for a given completion rule. + * + * @param string $rule The completion rule. + * @return int The completion state. + */ + public function get_state(string $rule): int { + global $DB; + + $this->validate_rule($rule); + + $kalvidassignobj = $DB->get_record('kalvidassign', array('id' => $this->cm->instance)); + + $status = $DB->record_exists('kalvidassign_submission', ['vidassignid' => $kalvidassignobj->id, 'userid' => $this->userid]); + + return $status ? COMPLETION_COMPLETE : COMPLETION_INCOMPLETE; + } + + /** + * Fetch the list of custom completion rules that this module defines. + * + * @return array + */ + public static function get_defined_custom_rules(): array { + return [ + 'completionsubmit' + ]; + } + + /** + * Returns an associative array of the descriptions of custom completion rules. + * + * @return array + */ + public function get_custom_rule_descriptions(): array { + return [ + 'completionsubmit' => get_string('completiondetail:submit', 'kalvidassign') + ]; + } + + /** + * Returns an array of all completion rules, in the order they should be displayed to users. + * + * @return array + */ + public function get_sort_order(): array { + return [ + 'completionview', + 'completionsubmit', + 'completionusegrade', + 'completionpassgrade' + ]; + } +} \ No newline at end of file diff --git a/mod/kalvidassign/classes/event/assignment_details_viewed.php b/mod/kalvidassign/classes/event/assignment_details_viewed.php new file mode 100644 index 0000000000000..4597acc7ae6d7 --- /dev/null +++ b/mod/kalvidassign/classes/event/assignment_details_viewed.php @@ -0,0 +1,59 @@ +. + +/** + * The assignment_details_viewed event. + * + * @package mod + * @subpackage kalvidassign + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +namespace mod_kalvidassign\event; +defined('MOODLE_INTERNAL') || die(); +/** + * The assignment_details_viewed event class. + * + * + * @since Moodle 2.7 + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + **/ +class assignment_details_viewed extends \core\event\base { + protected function init() { + $this->data['crud'] = 'r'; // c(reate), r(ead), u(pdate), d(elete) + $this->data['edulevel'] = self::LEVEL_PARTICIPATING; + $this->data['objecttable'] = 'kalvidassign'; + } + + public static function get_name() { + return get_string('eventassignment_details_viewed', 'kalvidassign'); + } + + public function get_description() { + return "The user with id '{$this->userid}' viewed the details" + . " of the Kaltura media assignment with the course module id of '{$this->contextinstanceid}'."; + } + + public function get_url() { + return new \moodle_url('/mod/kalvidassign/view.php', array('cmid' => $this->contextinstanceid)); + } + + public function get_legacy_logdata() { + return array($this->courseid, 'kalvidassign', 'view assignment details', + $this->get_url(), $this->objectid, $this->contextinstanceid); + } +} \ No newline at end of file diff --git a/mod/kalvidassign/classes/event/assignment_submitted.php b/mod/kalvidassign/classes/event/assignment_submitted.php new file mode 100644 index 0000000000000..12fe04410aa17 --- /dev/null +++ b/mod/kalvidassign/classes/event/assignment_submitted.php @@ -0,0 +1,59 @@ +. + +/** + * The assignment_submitted event. + * + * @package mod + * @subpackage kalvidassign + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +namespace mod_kalvidassign\event; +defined('MOODLE_INTERNAL') || die(); +/** + * The assignment_submitted event class. + * + * + * @since Moodle 2.7 + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + **/ +class assignment_submitted extends \core\event\base { + protected function init() { + $this->data['crud'] = 'u'; // c(reate), r(ead), u(pdate), d(elete) + $this->data['edulevel'] = self::LEVEL_PARTICIPATING; + $this->data['objecttable'] = 'kalvidassign_submission'; + } + + public static function get_name() { + return get_string('eventassignment_submitted', 'kalvidassign'); + } + + public function get_description() { + return "The user with id '{$this->userid}' made a submission to the Kaltura media" + . " assignment with the course module id of '{$this->contextinstanceid}'."; + } + + public function get_url() { + return new \moodle_url('/mod/kalvidassign/view.php', array('cmid' => $this->contextinstanceid)); + } + + public function get_legacy_logdata() { + return array($this->courseid, 'kalvidassign', 'submit', + $this->get_url(), $this->objectid, $this->contextinstanceid); + } +} \ No newline at end of file diff --git a/mod/kalvidassign/classes/event/grade_submissions_page_viewed.php b/mod/kalvidassign/classes/event/grade_submissions_page_viewed.php new file mode 100644 index 0000000000000..e247bb49e7348 --- /dev/null +++ b/mod/kalvidassign/classes/event/grade_submissions_page_viewed.php @@ -0,0 +1,59 @@ +. + +/** + * The grade_submissions_page_viewed event. + * + * @package mod + * @subpackage kalvidassign + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +namespace mod_kalvidassign\event; +defined('MOODLE_INTERNAL') || die(); +/** + * The grade_submissions_page_viewed event class. + * + * + * @since Moodle 2.7 + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + **/ +class grade_submissions_page_viewed extends \core\event\base { + protected function init() { + $this->data['crud'] = 'r'; // c(reate), r(ead), u(pdate), d(elete) + $this->data['edulevel'] = self::LEVEL_TEACHING; + $this->data['objecttable'] = 'kalvidassign'; + } + + public static function get_name() { + return get_string('eventgrade_submissions_page_viewed', 'kalvidassign'); + } + + public function get_description() { + return "The user with id '{$this->userid}' viewed the grade submissions page for " + . "the Kaltura media assignment with the course module id '{$this->contextinstanceid}'."; + } + + public function get_url() { + return new \moodle_url('/mod/kalvidassign/grade_submissions.php', array('cmid' => $this->contextinstanceid)); + } + + public function get_legacy_logdata() { + return array($this->courseid, 'kalvidassign', 'view submissions page', + $this->get_url(), $this->objectid, $this->contextinstanceid); + } +} \ No newline at end of file diff --git a/mod/kalvidassign/classes/event/grades_updated.php b/mod/kalvidassign/classes/event/grades_updated.php new file mode 100644 index 0000000000000..e837b1edbf221 --- /dev/null +++ b/mod/kalvidassign/classes/event/grades_updated.php @@ -0,0 +1,61 @@ +. + +/** + * The grades_updated event. + * + * @package mod + * @subpackage kalvidassign + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +namespace mod_kalvidassign\event; +defined('MOODLE_INTERNAL') || die(); +/** + * The grades_updated event class. + * + * @property-read array $other { + * 'crud' => string 'c', 'r', 'u', or 'd', depending on context the event is triggered in + * } + * + * @since Moodle 2.7 + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + **/ +class grades_updated extends \core\event\base { + protected function init() { + $this->data['crud'] = 'u'; // c(reate), r(ead), u(pdate), d(elete) + $this->data['edulevel'] = self::LEVEL_TEACHING; + } + + public static function get_name() { + return get_string('eventgrades_updated', 'kalvidassign'); + } + + public function get_description() { + return "The user with id '{$this->userid}' updated the grades" + . " for the Kaltura media assignment with the course module id of '{$this->contextinstanceid}'."; + } + + public function get_url() { + return new \moodle_url('/mod/kalvidassign/grade_submissions.php', array('cmid' => $this->contextinstanceid)); + } + + public function get_legacy_logdata() { + return array($this->courseid, 'kalvidassign', 'update grades', + $this->get_url(), $this->contextinstanceid); + } +} \ No newline at end of file diff --git a/mod/kalvidassign/classes/event/single_submission_page_viewed.php b/mod/kalvidassign/classes/event/single_submission_page_viewed.php new file mode 100644 index 0000000000000..b622819ce3549 --- /dev/null +++ b/mod/kalvidassign/classes/event/single_submission_page_viewed.php @@ -0,0 +1,59 @@ +. + +/** + * The single_submission_page_viewed event. + * + * @package mod + * @subpackage kalvidassign + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +namespace mod_kalvidassign\event; +defined('MOODLE_INTERNAL') || die(); +/** + * The single_submission_page_viewed event class. + * + * + * @since Moodle 2.7 + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + **/ +class single_submission_page_viewed extends \core\event\base { + protected function init() { + $this->data['crud'] = 'r'; // c(reate), r(ead), u(pdate), d(elete) + $this->data['edulevel'] = self::LEVEL_TEACHING; + $this->data['objecttable'] = 'kalvidassign_submission'; + } + + public static function get_name() { + return get_string('eventsingle_submission_page_viewed', 'kalvidassign'); + } + + public function get_description() { + return "The user with id '{$this->userid}' viewed the submission with id '{$this->objectid}'" + . " for the Kaltura media assignment with the course module id of '{$this->contextinstanceid}'."; + } + + public function get_url() { + return new \moodle_url('/mod/kalvidassign/single_submission.php', array('cmid' => $this->contextinstanceid)); + } + + public function get_legacy_logdata() { + return array($this->courseid, 'kalvidassign', 'view submission page', + $this->get_url(), $this->objectid, $this->contextinstanceid); + } +} \ No newline at end of file diff --git a/mod/kalvidassign/classes/privacy/provider.php b/mod/kalvidassign/classes/privacy/provider.php new file mode 100644 index 0000000000000..0b9748e98539e --- /dev/null +++ b/mod/kalvidassign/classes/privacy/provider.php @@ -0,0 +1,470 @@ +add_subsystem_link('core_message', [], 'privacy:metadata:emailteachersexplanation'); + + $collection->add_database_table( + 'kalvidassign_submission', + [ + 'userid' => 'privacy:metadata:kalvidassign_submission:userid', + 'entry_id' => 'privacy:metadata:kalvidassign_submission:entryid', + 'source' => 'privacy:metadata:kalvidassign_submission:source', + 'grade' => 'privacy:metadata:kalvidassign_submission:grade', + 'submissioncomment' => 'privacy:metadata:kalvidassign_submission:submissioncomment', + 'teacher' => 'privacy:metadata:kalvidassign_submission:teacher', + 'mailed' => 'privacy:metadata:kalvidassign_submission:mailed', + 'timemarked' => 'privacy:metadata:kalvidassign_submission:timemarked', + 'metadata' => 'privacy:metadata:kalvidassign_submission:metadata', + 'timecreated' => 'privacy:metadata:kalvidassign_submission:timecreated', + 'timemodified' => 'privacy:metadata:kalvidassign_submission:timemodified' + ], + 'privacy:metadata:kalvidassign_submission' + ); + + $collection->add_user_preference('kalvidassign_filter', 'privacy:metadata:kalvidassignfilter'); + $collection->add_user_preference('kalvidassign_group_filter', 'privacy:metadata:kalvidassigngroupfilter'); + $collection->add_user_preference('kalvidassign_perpage', 'privacy:metadata:kalvidassignperpage'); + $collection->add_user_preference('kalvidassign_quickgrade', 'privacy:metadata:kalvidassignquickgrade'); + + return $collection; + } + + /** + * Stores the user preferences related to mod_kalvidassign. + * + * @param int $userid The user ID that we want the preferences for. + */ + public static function export_user_preferences(int $userid) { + $context = \context_system::instance(); + $assignmentpreferences = [ + 'kalvidassign_filter' => get_string('privacy:metadata:kalvidassignfilter', 'mod_kalvidassign'), + 'kalvidassign_group_filter' => get_string('privacy:metadata:kalvidassigngroupfilter', 'mod_kalvidassign'), + 'kalvidassign_perpage' => get_string('privacy:metadata:kalvidassignperpage', 'mod_kalvidassign'), + 'kalvidassign_quickgrade' => get_string('privacy:metadata:kalvidassignquickgrade', 'mod_kalvidassign') + ]; + + foreach ($assignmentpreferences as $key => $preferencestring) { + $value = get_user_preferences($key, null, $userid); + + if (isset($value)) { + writer::with_context($context) + ->export_user_preference('mod_kalvidassign', $key, $value, $preferencestring); + } + } + } + + /** + * Get the list of contexts that contain user information for the specified user. + * + * @param int $userid The user to search. + * @return contextlist $contextlist The list of contexts used in this plugin. + */ + public static function get_contexts_for_userid(int $userid) : contextlist { + $contextlist = new \core_privacy\local\request\contextlist(); + + $sql = "SELECT DISTINCT + ctx.id + FROM {context} ctx + JOIN {course_modules} cm ON cm.id = ctx.instanceid AND ctx.contextlevel = :contextlevel + JOIN {modules} m ON cm.module = m.id AND m.name = :modulename + JOIN {kalvidassign} a ON cm.instance = a.id + JOIN {kalvidassign_submission} s ON s.vidassignid = a.id + WHERE s.userid = :userid + OR s.teacher = :teacher"; + + $params = [ + 'modulename' => 'kalvidassign', + 'contextlevel' => CONTEXT_MODULE, + 'userid' => $userid, + 'teacher' => $userid + ]; + + $contextlist->add_from_sql($sql, $params); + + return $contextlist; + } + + /** + * Get the list of users who have data within a context. + * + * @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination. + */ + public static function get_users_in_context(userlist $userlist) { + $context = $userlist->get_context(); + + if ($context->contextlevel !== CONTEXT_MODULE) { + return; + } + + $params = [ + 'modulename' => 'kalvidassign', + 'contextlevel' => CONTEXT_MODULE, + 'contextid' => $context->id + ]; + + $sql = "SELECT s.userid + FROM {kalvidassign_submission} s + JOIN {kalvidassign} a ON s.vidassignid = a.id + JOIN {modules} m ON m.name = :modulename + JOIN {course_modules} cm ON a.id = cm.instance AND cm.module = m.id + JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :contextlevel + WHERE ctx.id = :contextid"; + $userlist->add_from_sql('userid', $sql, $params); + + $sql = "SELECT s.teacher + FROM {kalvidassign_submission} s + JOIN {kalvidassign} a ON s.vidassignid = a.id + JOIN {modules} m ON m.name = :modulename + JOIN {course_modules} cm ON a.id = cm.instance AND cm.module = m.id + JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :contextlevel + WHERE ctx.id = :contextid"; + $userlist->add_from_sql('teacher', $sql, $params); + } + + /** + * Export personal data for the given approved_contextlist. + * User and context information is contained within the contextlist. + * + * @param approved_contextlist $contextlist a list of contexts approved for export. + */ + public static function export_user_data(approved_contextlist $contextlist) { + if (empty($contextlist->count())) { + return; + } + + $user = $contextlist->get_user(); + + foreach ($contextlist->get_contexts() as $context) { + if ($context->contextlevel !== CONTEXT_MODULE) { + continue; + } + + // Cannot make use of helper::export_context_files(), need to manually export kalvidassign details + $kalvidassigndata = self::get_kalvidassign_by_context($context); + + // Get kalvidassign details object for output + $kalvidassign = self::get_kalvidassign_output($kalvidassigndata); + writer::with_context($context)->export_data([], $kalvidassign); + + // Check if the user has marked any kalvidassign's submissions to determine kalvidassign submissions to export + $teacher = (self::has_marked_kalvidassign_submissions($kalvidassigndata->id, $user->id) == true) ? true : false; + + // Get the kalvidassign submissions submitted by & marked by the user for an kalvidassign + $submissionsdata = self::get_kalvidassign_submissions_by_kalvidassign($kalvidassigndata->id, $user->id, $teacher); + + foreach ($submissionsdata as $submissiondata) { + // Default subcontext path to export assignment submissions submitted by the user. + $subcontexts = [ + get_string('privacy:submissionpath', 'mod_kalvidassign') + ]; + + if ($teacher == true) { + if ($submissiondata->teacher == $user->id) { + // Export kalvidassign submissions that have been marked by the user + $subcontexts = [ + get_string('privacy:markedsubmissionspath', 'mod_kalvidassign'), + transform::user($submissiondata->userid) + ]; + } + } + + // Get kalvidassign submission details object for output + $submission = self::get_kalvidassign_submission_output($submissiondata); + + writer::with_context($context)->export_data($subcontexts, $submission); + } + } + } + + /** + * Delete all personal data for all users in the specified context. + * + * @param context $context Context to delete data from. + */ + public static function delete_data_for_all_users_in_context(\context $context) { + global $DB; + + if ($context->contextlevel !== CONTEXT_MODULE) { + return; + } + + // Delete all kalvidassign submissions for the kalvidassign associated with the context module. + $kalvidassign = self::get_kalvidassign_by_context($context); + + if ($kalvidassign != null) { + $DB->delete_records('kalvidassign_submission', ['vidassignid' => $kalvidassign->id]); + } + } + + /** + * Delete all user data for the specified user, in the specified contexts. + * + * @param approved_contextlist $contextlist a list of contexts approved for deletion. + */ + public static function delete_data_for_user(approved_contextlist $contextlist) { + global $DB; + + if (empty($contextlist->count())) { + return; + } + + $userid = $contextlist->get_user()->id; + + // Only retrieve kalvidassign submissions submitted by the user for deletion. + $kalvidassignsubmissionids = array_keys(self::get_kalvidassign_submissions_by_contextlist($contextlist, $userid)); + $DB->delete_records_list('kalvidassign_submission', 'id', $kalvidassignsubmissionids); + } + + /** + * Delete multiple users within a single context. + * + * @param approved_userlist $userlist The approved context and user information to delete information for. + */ + public static function delete_data_for_users(approved_userlist $userlist) { + global $DB; + + $context = $userlist->get_context(); + + // If the context isn't for a module then return early. + if ($context->contextlevel !== CONTEXT_MODULE) { + return; + } + + // Fetch the kalvidassign + $kalvidassign = self::get_kalvidassign_by_context($context); + $userids = $userlist->get_userids(); + + list($inorequalsql, $params) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED); + $params['videoassignid'] = $kalvidassign->id; + + // Get kalvidassign submissions ids + $sql = " + SELECT s.id + FROM {kalvidassign_submission} s + JOIN {kalvidassign} a ON s.vidassignid = a.id + WHERE a.id = :videoassignid + AND s.userid $inorequalsql"; + + $submissionids = $DB->get_records_sql($sql, $params); + + // Delete related tables. + $DB->delete_records_list('assignment_submissions', 'id', array_keys($submissionids)); + } + + /** + * Helper function to return kalvidassign submissions submitted by / marked by a user and their contextlist. + * + * @param object $contextlist Object with the contexts related to a userid to retrieve kalvidassign submissions by. + * @param int $userid The user ID to find kalvidassign submissions that were submitted by. + * @return array Array of kalvidassign submission details. + * @throws \coding_exception + * @throws \dml_exception + */ + protected static function get_kalvidassign_submissions_by_contextlist($contextlist, $userid) { + global $DB; + + list($contextsql, $contextparams) = $DB->get_in_or_equal($contextlist->get_contextids(), SQL_PARAMS_NAMED); + + $params = [ + 'contextlevel' => CONTEXT_MODULE, + 'modulename' => 'kalvidassign', + 'userid' => $userid + ]; + + $sql = "SELECT s.id as id, + s.vidassignid as vidassignid, + s.entry_id as entryid, + s.source as source, + s.grade as grade, + s.submissioncomment as submissioncomment, + s.teacher as teacher, + s.timemarked as timemarked, + s.timecreated as timecreated, + s.timemodified as timemodified + FROM {context} ctx + JOIN {course_modules} cm ON cm.id = ctx.instanceid AND ctx.contextlevel = :contextlevel + JOIN {modules} m ON cm.module = m.id AND m.name = :modulename + JOIN {kalvidassign} a ON cm.instance = a.id + JOIN {kalvidassign_submission} s ON s.vidassignid = a.id + WHERE (s.userid = :userid)"; + + $sql .= " AND ctx.id {$contextsql}"; + $params += $contextparams; + + return $DB->get_records_sql($sql, $params); + } + + /** + * Helper function to return kalvidassign for a context module. + * + * @param object $context The context module object to return the kalvidassign record by. + * @return mixed The kalvidassign details or null record associated with the context module. + * @throws \dml_exception + */ + protected static function get_kalvidassign_by_context($context) { + global $DB; + + $params = [ + 'modulename' => 'kalvidassign', + 'contextmodule' => CONTEXT_MODULE, + 'contextid' => $context->id + ]; + + $sql = "SELECT a.id, + a.name, + a.intro, + a.grade, + a.timedue, + a.timeavailable, + a.timemodified + FROM {kalvidassign} a + JOIN {course_modules} cm ON a.id = cm.instance + JOIN {modules} m ON m.id = cm.module AND m.name = :modulename + JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :contextmodule + WHERE ctx.id = :contextid"; + + return $DB->get_record_sql($sql, $params); + } + + /** + * Helper function generate kalvidassign output object for exporting. + * + * @param object $kalvidassigndata Object containing kalvidassign data. + * @return object Formatted kalvidassign output object for exporting. + */ + protected static function get_kalvidassign_output($kalvidassigndata) { + $kalvidassign = (object) [ + 'name' => $kalvidassigndata->name, + 'intro' => $kalvidassigndata->intro, + 'grade' => $kalvidassigndata->grade, + 'timemodified' => transform::datetime($kalvidassigndata->timemodified) + ]; + + if ($kalvidassigndata->timeavailable != 0) { + $kalvidassign->timeavailable = transform::datetime($kalvidassigndata->timeavailable); + } + + if ($kalvidassigndata->timedue != 0) { + $kalvidassign->timedue = transform::datetime($kalvidassigndata->timedue); + } + + return $kalvidassign; + } + + /** + * Helper function to check if a user has marked kalvidassign submissions for a given kalvidassign. + * + * @param int $kalvidassignid The kalvidassign ID to check if user has marked associated submissions. + * @param int $userid The user ID to check if user has marked associated submissions. + * @return bool If user has marked associated submissions returns true, otherwise false. + * @throws \dml_exception + */ + protected static function has_marked_kalvidassign_submissions($kalvidassignid, $userid) { + global $DB; + + $params = [ + 'vidassignid' => $kalvidassignid, + 'teacher' => $userid + ]; + + $sql = "SELECT count(s.id) as nomarked + FROM {kalvidassign_submission} s + WHERE s.vidassignid = :vidassignid + AND s.teacher = :teacher"; + + $results = $DB->get_record_sql($sql, $params); + + return ($results->nomarked > 0) ? true : false; + } + + /** + * Helper function to retrieve kalvidassign submissions submitted by / marked by a user for a specific kalvidassign. + * + * @param int $kalvidassignid The kalvidassign ID to retrieve kalvidassign submissions by. + * @param int $userid The user ID to retrieve kalvidassign submissions submitted / marked by. + * @param bool $teacher The teacher status to determine if marked kalvidassign submissions should be returned. + * @return array Array of kalvidassign submissions details. + * @throws \dml_exception + */ + protected static function get_kalvidassign_submissions_by_kalvidassign($kalvidassignid, $userid, $teacher = false) { + global $DB; + + $params = [ + 'vidassignid' => $kalvidassignid, + 'userid' => $userid + ]; + + $sql = "SELECT s.id as id, + s.vidassignid as vidassignid, + s.entry_id as entryid, + s.source as source, + s.grade as grade, + s.submissioncomment as submissioncomment, + s.teacher as teacher, + s.timemarked as timemarked, + s.timecreated as timecreated, + s.timemodified as timemodified, + s.userid as userid + FROM {kalvidassign_submission} s + WHERE s.vidassignid = :vidassignid + AND (s.userid = :userid"; + + if ($teacher == true) { + $sql .= " OR s.teacher = :teacher"; + $params['teacher'] = $userid; + } + + $sql .= ")"; + + return $DB->get_records_sql($sql, $params); + } + + /** + * Helper function generate kalvidassign submission output object for exporting. + * + * @param object $submissiondata Object containing kalvidassign submission data. + * @return object Formatted kalvidassign submission output for exporting. + */ + protected static function get_kalvidassign_submission_output($submissiondata) { + $submission = (object) [ + 'vidassignid' => $submissiondata->vidassignid, + 'entry_id' => $submissiondata->entryid, + 'source' => $submissiondata->source, + 'grade' => $submissiondata->grade, + 'submissioncomment' => $submissiondata->submissioncomment, + 'teacher' => transform::user($submissiondata->teacher) + ]; + + if ($submissiondata->timecreated != 0) { + $submission->timecreated = transform::datetime($submissiondata->timecreated); + } + + if ($submissiondata->timemarked != 0) { + $submission->timemarked = transform::datetime($submissiondata->timemarked); + } + + if ($submissiondata->timemodified != 0) { + $submission->timemodified = transform::datetime($submissiondata->timemodified); + } + + return $submission; + } +} diff --git a/mod/kalvidassign/db/access.php b/mod/kalvidassign/db/access.php new file mode 100644 index 0000000000000..2c849c6f7849b --- /dev/null +++ b/mod/kalvidassign/db/access.php @@ -0,0 +1,55 @@ +. + +/** + * Kaltura video assignment access script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$capabilities = array( + + 'mod/kalvidassign:addinstance' => array( + 'riskbitmask' => RISK_XSS, + 'captype' => 'write', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ), + 'clonepermissionsfrom' => 'moodle/course:manageactivities' + ), + + 'mod/kalvidassign:gradesubmission' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_MODULE, + 'archetypes' => array( + 'teacher' => CAP_ALLOW, + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW, + ) + ), + + 'mod/kalvidassign:submit' => array( + + 'captype' => 'write', + 'contextlevel' => CONTEXT_MODULE, + 'archetypes' => array( + 'student' => CAP_ALLOW + ) + ), +); \ No newline at end of file diff --git a/mod/kalvidassign/db/install.xml b/mod/kalvidassign/db/install.xml new file mode 100755 index 0000000000000..8b131ce6b1207 --- /dev/null +++ b/mod/kalvidassign/db/install.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
\ No newline at end of file diff --git a/mod/kalvidassign/db/log.php b/mod/kalvidassign/db/log.php new file mode 100644 index 0000000000000..4cbc9949e2b30 --- /dev/null +++ b/mod/kalvidassign/db/log.php @@ -0,0 +1,32 @@ +. + +/** + * Kaltura video assignment log script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module' => 'kalvidassign', 'action' => 'add', 'mtable' => 'kalvidassign', 'field' => 'name'), + array('module' => 'kalvidassign', 'action' => 'update', 'mtable' => 'kalvidassign', 'field' =>' name'), + array('module' => 'kalvidassign', 'action' => 'view', 'mtable' => 'kalvidassign', 'field' => 'name'), + array('module' => 'kalvidassign', 'action' => 'delete', 'mtable' => 'kalvidassign', 'field' => 'name') +); \ No newline at end of file diff --git a/mod/kalvidassign/db/messages.php b/mod/kalvidassign/db/messages.php new file mode 100644 index 0000000000000..ceeb90aaefde9 --- /dev/null +++ b/mod/kalvidassign/db/messages.php @@ -0,0 +1,26 @@ +. + +/** + * Kaltura video assignment messages script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$messageproviders = array( + 'kalvidassign_updates' => array() +); \ No newline at end of file diff --git a/mod/kalvidassign/db/upgrade.php b/mod/kalvidassign/db/upgrade.php new file mode 100644 index 0000000000000..82ab7e1ced8fe --- /dev/null +++ b/mod/kalvidassign/db/upgrade.php @@ -0,0 +1,104 @@ +. + +/** + * Kaltura video assignment upgrade script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +function xmldb_kalvidassign_upgrade($oldversion) { + global $CFG, $DB; + + $dbman = $DB->get_manager(); + + if ($oldversion < 2011091301) { + + // Changing type of field intro on table kalvidassign to text + $table = new xmldb_table('kalvidassign'); + $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'small', null, null, null, null, 'name'); + + // Launch change of type for field intro + $dbman->change_field_type($table, $field); + + // kalvidassign savepoint reached + upgrade_mod_savepoint(true, 2011091301, 'kalvidassign'); + } + + if ($oldversion < 2014013000) { + + // Define field source to be added to kalvidassign_submission. + $table = new xmldb_table('kalvidassign_submission'); + $field = new xmldb_field('source', XMLDB_TYPE_TEXT, null, null, null, null, null, 'entry_id'); + + // Conditionally launch add field source. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Define field width to be added to kalvidassign_submission. + $field = new xmldb_field('width', XMLDB_TYPE_INTEGER, '10', null, null, null, '0', 'source'); + + // Conditionally launch add field width. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Define field height to be added to kalvidassign_submission. + $field = new xmldb_field('height', XMLDB_TYPE_INTEGER, '10', null, null, null, '0', 'width'); + + // Conditionally launch add field height. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Kalvidassign savepoint reached. + upgrade_mod_savepoint(true, 2014013000, 'kalvidassign'); + } + + if ($oldversion < 2014023000.01) { + + // Define field metadata to be added to kalvidassign_submission. + $table = new xmldb_table('kalvidassign_submission'); + $field = new xmldb_field('metadata', XMLDB_TYPE_TEXT, null, null, null, null, null, 'timemarked'); + + // Conditionally launch add field metadata. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Kalvidassign savepoint reached. + upgrade_mod_savepoint(true, 2014023000.01, 'kalvidassign'); + } + + if ($oldversion < 2024042202) { + + // Define field completionsubmit to be added to kalvidassign + $table = new xmldb_table('kalvidassign'); + $field = new xmldb_field('completionsubmit', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'timemodified'); + + // Conditionally launch add field completionsubmit + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // kalvidassign savepoint reached + upgrade_mod_savepoint(true, 2024042202, 'kalvidassign'); + } + + return true; +} \ No newline at end of file diff --git a/mod/kalvidassign/grade_preferences_form.php b/mod/kalvidassign/grade_preferences_form.php new file mode 100644 index 0000000000000..85c3bad005f69 --- /dev/null +++ b/mod/kalvidassign/grade_preferences_form.php @@ -0,0 +1,124 @@ +. + +/** + * Kaltura grade preferences form. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +require_once(dirname(dirname(dirname(__FILE__))).'/course/moodleform_mod.php'); +require_once(dirname(__FILE__).'/locallib.php'); +require_once($CFG->libdir.'/formslib.php'); + +class kalvidassign_gradepreferences_form extends moodleform { + /** + * This function defines all of the elements displayed on the grade preferences form. + */ + public function definition() { + global $CFG, $COURSE, $USER; + + $mform =& $this->_form; + + $mform->addElement('hidden', 'cmid', $this->_customdata['cmid']); + $mform->setType('cmid', PARAM_INT); + + $mform->addElement('header', 'kal_vid_subm_hdr', get_string('optionalsettings', 'kalvidassign')); + + $context = context_module::instance($this->_customdata['cmid']); + + $group_opt = array(); + $groups = array(); + + // If the user doesn't have access to all group print the groups they have access to + if (!has_capability('moodle/site:accessallgroups', $context)) { + + // Determine the groups mode + switch($this->_customdata['groupmode']) { + case NOGROUPS: + // No groups, do nothing + break; + case SEPARATEGROUPS: + $groups = groups_get_all_groups($COURSE->id, $USER->id); + break; + case VISIBLEGROUPS: + $groups = groups_get_all_groups($COURSE->id); + break; + } + + $group_opt[0] = get_string('all', 'mod_kalvidassign'); + + foreach ($groups as $group_obj) { + $group_opt[$group_obj->id] = $group_obj->name; + } + + } else { + $groups = groups_get_all_groups($COURSE->id); + + $group_opt[0] = get_string('all', 'mod_kalvidassign'); + + foreach ($groups as $group_obj) { + $group_opt[$group_obj->id] = $group_obj->name; + } + + } + + $mform->addElement('select', 'group_filter', get_string('group_filter', 'mod_kalvidassign'), $group_opt); + + $filters = array( + KALASSIGN_ALL => get_string('all', 'kalvidassign'), + KALASSIGN_REQ_GRADING => get_string('reqgrading', 'kalvidassign'), + KALASSIGN_SUBMITTED => get_string('submitted', 'kalvidassign') + ); + + $mform->addElement('select', 'filter', get_string('show'), $filters); + $mform->addHelpButton('filter', 'show', 'kalvidassign'); + + $mform->addElement('text', 'perpage', get_string('pagesize', 'kalvidassign'), array('size' => 3, 'maxlength' => 3)); + $mform->setType('perpage', PARAM_INT); + $mform->addHelpButton('perpage', 'pagesize', 'kalvidassign'); + + $mform->addElement('checkbox', 'quickgrade', get_string('quickgrade', 'kalvidassign')); + $mform->setDefault('quickgrade', ''); + $mform->addHelpButton('quickgrade', 'quickgrade', 'kalvidassign'); + + $savepref = get_string('savepref', 'kalvidassign'); + + $mform->addElement('submit', 'savepref', $savepref); + } + + /** + * This funciton validates te submitted data. + * @param array $data array of ("fieldname"=>value) of submitted data + * @param array $files array of uploaded files "element_name"=>tmp_file_path + * @return array of "element_name"=>"error_description" if there are errors, + * or an empty array if everything is OK (true allowed for backwards compatibility too). + */ + public function validation($data, $files) { + $errors = parent::validation($data, $files); + + if (0 == (int) $data['perpage']) { + $errors['perpage'] = get_string('invalidperpage', 'kalvidassign'); + } + + return $errors; + } +} \ No newline at end of file diff --git a/mod/kalvidassign/grade_submissions.php b/mod/kalvidassign/grade_submissions.php new file mode 100644 index 0000000000000..057d10d173932 --- /dev/null +++ b/mod/kalvidassign/grade_submissions.php @@ -0,0 +1,228 @@ +. + +/** + * Kaltura grade submission script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(__FILE__).'/lib.php'); +require_once(dirname(__FILE__).'/renderer.php'); +require_once(dirname(__FILE__).'/locallib.php'); +require_once(dirname(__FILE__).'/grade_preferences_form.php'); + +$id = required_param('cmid', PARAM_INT); // Course Module ID +$mode = optional_param('mode', 0, PARAM_TEXT); +$tifirst = optional_param('tifirst', '', PARAM_TEXT); +$tilast = optional_param('tilast', '', PARAM_TEXT); +$page = optional_param('page', 0, PARAM_INT); + +$url = new moodle_url('/mod/kalvidassign/grade_submissions.php'); +$url->param('cmid', $id); + +if (!empty($mode)) { + if (!confirm_sesskey()) { + throw new \moodle_exception('confirmsesskeybad', 'error'); + } +} + +list($cm, $course, $kalvidassignobj) = kalvidassign_validate_cmid($id); + +require_login($course->id, false, $cm); + +global $PAGE, $OUTPUT, $USER; + +$currentcrumb = get_string('singlesubmissionheader', 'kalvidassign'); +$PAGE->set_url($url); +$PAGE->set_title(format_string($kalvidassignobj->name)); +$PAGE->set_heading($course->fullname); +$PAGE->navbar->add($currentcrumb); + +$renderer = $PAGE->get_renderer('mod_kalvidassign'); +$courseid = $PAGE->context->get_course_context(false); + +echo $OUTPUT->header(); + +require_capability('mod/kalvidassign:gradesubmission', context_module::instance($cm->id)); + +$event = \mod_kalvidassign\event\grade_submissions_page_viewed::create(array( + 'objectid' => $kalvidassignobj->id, + 'context' => context_module::instance($cm->id) +)); +$event->trigger(); + +// Ensure we use the appropriate group mode, either course or module +if (($course->groupmodeforce) == 1) { + $prefform = new kalvidassign_gradepreferences_form(null, array('cmid' => $cm->id, 'groupmode' => $course->groupmode)); +} else { + $prefform = new kalvidassign_gradepreferences_form(null, array('cmid' => $cm->id, 'groupmode' => $cm->groupmode)); +} + +$data = null; + +if ($data = $prefform->get_data()) { + set_user_preference('kalvidassign_group_filter', $data->group_filter); + + set_user_preference('kalvidassign_filter', $data->filter); + + if ($data->perpage > 0) { + set_user_preference('kalvidassign_perpage', $data->perpage); + } + + if (isset($data->quickgrade)) { + set_user_preference('kalvidassign_quickgrade', $data->quickgrade); + } else { + set_user_preference('kalvidassign_quickgrade', '0'); + } + +} + +if (empty($data)) { + $data = new stdClass(); +} + +$data->filter = get_user_preferences('kalvidassign_filter', 0); +$data->perpage = get_user_preferences('kalvidassign_perpage', 10); +$data->quickgrade = get_user_preferences('kalvidassign_quickgrade', 0); +$data->group_filter = get_user_preferences('kalvidassign_group_filter', 0); + +$gradedata = data_submitted(); + +// Check if fast grading was passed to the form and process the data +if (!empty($gradedata->mode)) { + + $usersubmission = array(); + $time = time(); + $updated = false; + + foreach ($gradedata->users as $userid => $val) { + + $param = array('vidassignid' => $kalvidassignobj->id, 'userid' => $userid); + + $usersubmissions = $DB->get_record('kalvidassign_submission', $param); + + if ($usersubmissions) { + + if (array_key_exists($userid, $gradedata->menu)) { + + // Update grade + if (($gradedata->menu[$userid] != $usersubmissions->grade)) { + + $usersubmissions->grade = $gradedata->menu[$userid]; + $usersubmissions->timemarked = $time; + $usersubmissions->teacher = $USER->id; + + $updated = true; + } + } + + if (array_key_exists($userid, $gradedata->submissioncomment)) { + + if (0 != strcmp($usersubmissions->submissioncomment, $gradedata->submissioncomment[$userid])) { + $usersubmissions->submissioncomment = $gradedata->submissioncomment[$userid]; + + $updated = true; + + } + } + + // trigger grade event + if ($DB->update_record('kalvidassign_submission', $usersubmissions)) { + + $grade = new stdClass(); + $grade->userid = $userid; + $grade = kalvidassign_get_submission_grade_object($kalvidassignobj->id, $userid); + + $kalvidassignobj->cmidnumber = $cm->idnumber; + + kalvidassign_grade_item_update($kalvidassignobj, $grade); + + // Add to log only if updating. + $event = \mod_kalvidassign\event\grades_updated::create(array( + 'context' => context_module::instance($cm->id), + 'other' => array( + 'crud' => 'u' + ) + )); + $event->trigger(); + } + + } else { + // No user submission however the instructor has submitted grade data + $usersubmissions = new stdClass(); + $usersubmissions->vidassignid = $cm->instance; + $usersubmissions->userid = $userid; + $usersubmissions->entry_id = ''; + $usersubmissions->teacher = $USER->id; + $usersubmissions->timemarked = $time; + + // Need to prevent completely empty submissions from getting entered + // into the video submissions' table + // Check for unchanged grade value and an empty feedback value + $emptygrade = array_key_exists($userid, $gradedata->menu) && '-1' == $gradedata->menu[$userid]; + + $emptycomment = array_key_exists($userid, $gradedata->submissioncomment) && empty($gradedata->submissioncomment[$userid]); + + if ($emptygrade && $emptycomment ) { + continue; + } + + if (array_key_exists($userid, $gradedata->menu)) { + $usersubmissions->grade = $gradedata->menu[$userid]; + } + + if (array_key_exists($userid, $gradedata->submissioncomment)) { + $usersubmissions->submissioncomment = $gradedata->submissioncomment[$userid]; + } + + // trigger grade event + if ($DB->insert_record('kalvidassign_submission', $usersubmissions)) { + + $grade = new stdClass(); + $grade->userid = $userid; + $grade = kalvidassign_get_submission_grade_object($kalvidassignobj->id, $userid); + + $kalvidassignobj->cmidnumber = $cm->idnumber; + + kalvidassign_grade_item_update($kalvidassignobj, $grade); + + // Add to log only if updating + $event = \mod_kalvidassign\event\grades_updated::create(array( + 'context' => context_module::instance($cm->id), + 'other' => array( + 'crud' => 'c' + ) + )); + $event->trigger(); + } + + } + + $updated = false; + } +} + +$renderer->display_submissions_table($cm, $data->group_filter, $data->filter, $data->perpage, $data->quickgrade, $tifirst, $tilast, $page); + +$prefform->set_data($data); +$prefform->display(); + +$PAGE->requires->yui_module('moodle-local_kaltura-ltipanel', 'M.local_kaltura.initreviewsubmission'); + +echo $OUTPUT->footer(); diff --git a/mod/kalvidassign/index.php b/mod/kalvidassign/index.php new file mode 100644 index 0000000000000..440d715f2e5c4 --- /dev/null +++ b/mod/kalvidassign/index.php @@ -0,0 +1,48 @@ +. + +/** + * Kaltura index script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once("../../config.php"); +require_once($CFG->dirroot.'/local/kaltura/locallib.php'); +require_once($CFG->dirroot.'/mod/kalvidassign/locallib.php'); + +$id = required_param('id', PARAM_INT); // Course ID. + +$course = $DB->get_record('course', array('id' => $id), '*', MUST_EXIST); + +require_login($course); + +global $SESSION, $CFG; + +$strplural = get_string("modulenameplural", "mod_kalvidassign"); +$PAGE->set_url('/mod/kalvidassign/index.php', array('id' => $id)); +$PAGE->set_pagelayout('incourse'); +$PAGE->navbar->add($strplural); +$PAGE->set_title($strplural); +$PAGE->set_heading($course->fullname); + +echo $OUTPUT->header(); + +$renderer = $PAGE->get_renderer('mod_kalvidassign'); +$renderer->display_kalvidassignments_table($course); + +echo $OUTPUT->footer(); diff --git a/mod/kalvidassign/lang/en/kalvidassign.php b/mod/kalvidassign/lang/en/kalvidassign.php new file mode 100644 index 0000000000000..2fe1956fdfe48 --- /dev/null +++ b/mod/kalvidassign/lang/en/kalvidassign.php @@ -0,0 +1,147 @@ +. + +/** + * Kaltura video assignment language file. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$string['activity_not_migrated'] = 'This activity has not yet been migrated to use the new Kaltura instance.'; +$string['modulenameplural'] = 'Kaltura Media Assignments'; +$string['modulename'] = 'Kaltura Media Assignment'; +$string['modulename_help'] = 'The Kaltura Media Assignment enables a teacher to create assignments that require students to upload and submit Kaltura videos. Teachers can grade student submissions and provide feedback.'; +$string['name'] = 'Name'; +$string['availabledate'] = 'Available from'; +$string['duedate'] = 'Due Date'; +$string['preventlate'] = 'Prevent late submissions'; +$string['allowdeleting'] = 'Allow resubmitting'; +$string['allowdeleting_help'] = 'If enabled, students may replace submitted videos. Whether it is possible to submit after the due date is controlled by the \'Prevent late submissions\' setting'; +$string['emailteachers'] = 'Email alerts to teachers'; +$string['emailteachers_help'] = 'If enabled, teachers receive email notification whenever students add or update an assignment submission. Only teachers who are able to grade the particular assignment are notified. So, for example, if the course uses separate groups, teachers restricted to particular groups won\'t receive notification about students in other groups.'; +$string['invalidid'] = 'Invalid ID'; +$string['invalid_launch_parameters'] = 'Invalid launch parameters'; +$string['pluginadministration'] = 'Kaltura Media Assignment'; +$string['addvideo'] = 'Add media submission'; +$string['submitvideo'] = 'Submit media'; +$string['replacevideo'] = 'Replace media'; +$string['previewvideo'] = 'Preview'; +$string['gradesubmission'] = 'Grade submissions'; +$string['numberofsubmissions'] = 'Number of submissions: {$a}'; +$string['assignmentexpired'] = 'Submission cancelled. The assignment due date has passed'; +$string['notallowedtoreplacemedia'] = 'You are not allowed to replace the media.'; +$string['assignmentsubmitted'] = 'Success, your assignment has been submitted'; +$string['emptyentryid'] = 'Video assignment was not submitted correctly. Please try to resubmit.'; +$string['deleteallsubmissions'] = 'Delete all video submissions'; +$string['fullname'] = 'Name'; +$string['grade'] = 'Grade'; +$string['submissioncomment'] = 'Comment'; +$string['timemodified'] = 'Last modified (Submission)'; +$string['grademodified'] = 'Last modified (Grade)'; +$string['finalgrade'] = 'Final grade'; +$string['status'] = 'Status'; +$string['optionalsettings'] = 'Optional settings'; +$string['savepref'] = 'Save preferences'; +$string['all'] = 'All'; +$string['reqgrading'] = 'Require grading'; +$string['submitted'] = 'Submitted'; +$string['pagesize'] = 'Submissions shown per page'; +$string['pagesize_help'] = 'Set the number of assignment to display per page'; +$string['show'] = 'Show'; +$string['show_help'] = "If filter is set to 'All' then all student submissions will be displayed; even if the student didn't submit anything. If set to 'Require grading' only submissions that has not been graded or submissions that were updated by the student after it was graded will be shown. If set to 'Submitted' only students who submitted a video assignment."; +$string['quickgrade'] = 'Allow quick grade'; +$string['quickgrade_help'] = 'If enabled, multiple assignments can be graded on one page. Add grades and comments then click the "Save all my feedback" button to save all changes for that page.'; +$string['invalidperpage'] = 'Enter a number greater than zero'; +$string['savefeedback'] = 'Save feedback'; +$string['submission'] = 'Submission'; +$string['grades'] = 'Grades'; +$string['feedback'] = 'Feedback'; +$string['singlesubmissionheader'] = 'Grade submission'; +$string['singlegrade'] = 'Add help text'; +$string['singlegrade_help'] = 'Add help text'; +$string['late'] = '{$a} late'; +$string['early'] = '{$a} early'; +$string['lastgrade'] = 'Last grade'; +$string['savedchanges'] = 'Changed Saved'; +$string['save'] = 'Save Changes'; +$string['cancel'] = 'Close'; +$string['checkconversionstatus'] = 'Check video conversion status'; +$string['pluginname'] = 'Kaltura Media Assignment'; +$string['video_converting'] = 'The video is still converting. Please check the status of the video at a later time.'; +$string['emailteachermail'] = '{$a->username} has updated their assignment submission +for \'{$a->assignment}\' at {$a->timeupdated} + +It is available here: + + {$a->url}'; +$string['emailteachermailhtml'] = '{$a->username} has updated their assignment submission +for \'{$a->assignment}\' at {$a->timeupdated}

+It is available on the web site.'; +$string['messageprovider:kalvidassign_updates'] = 'Kaltura Media assignment notifications'; +$string['video_preview_header'] = 'Submission preview'; +$string['kalvidassign:gradesubmission'] = 'Grade video submissions'; +$string['kalvidassign:addinstance'] = 'Add a Kaltura Media Assignment'; +$string['kalvidassign:submit'] = 'Submit videos'; +$string['grade_video_not_cache'] = 'This video may still be in the process of converting...'; +$string['noenrolledstudents'] = 'No students are enrolled in the course'; +$string['group_filter'] = 'Group Filter'; +$string['use_screen_recorder'] = 'Record screen'; +$string['use_kcw'] = 'Upload media or record from webcam'; +$string['scr_loading'] = 'Loading...'; +$string['reviewvideo'] = 'Review submission'; +$string['kalvidassign:screenrecorder'] = 'Screen recorder'; +$string['checkingforjava'] = 'Checking for Java'; +$string['javanotenabled'] = 'Failed to detect Java, please make sure you have the latest version of Java installed and enabled and then try again.'; +$string['cannotdisplaythumbnail'] = 'Unable to display thumbnail'; +$string['noassignments'] = 'No Kaltura video assignments found in the course'; +$string['submitted'] = 'Submitted'; +$string['nosubmission'] = 'No submission'; +$string['nosubmissions'] = 'No submissions'; +$string['viewsubmission'] = 'View submission'; +$string['failedtoinsertsubmission'] = 'Failed to insert submission record.'; +$string['video_thumbnail'] = 'Video thumbnail'; +$string['feedbackfromteacher'] = 'Feedback From Teacher'; +$string['currentgrade'] = 'Current grade in gradebook'; +$string['eventgrade_submissions_page_viewed'] = 'Grade submissions page viewed'; +$string['eventsingle_submission_page_viewed'] = 'Single submission page viewed'; +$string['eventgrades_updated'] = 'Assignment grades updated'; +$string['eventassignment_submitted'] = 'Assignment submitted'; +$string['eventassignment_details_viewed'] = 'Assignment details viewed'; +$string['nosubmissionsforgrading'] = 'There are no submissions available for grading'; +$string['privacy:metadata:emailteachersexplanation'] = 'Messages are sent to teachers through the messaging system.'; +$string['privacy:metadata:kalvidassign_submission'] = 'Kaltura video assignment submissions'; +$string['privacy:metadata:kalvidassign_submission:userid'] = 'Moodle user id'; +$string['privacy:metadata:kalvidassign_submission:entryid'] = 'Kaltura entry id'; +$string['privacy:metadata:kalvidassign_submission:source'] = 'The source URL of the media entry'; +$string['privacy:metadata:kalvidassign_submission:grade'] = 'Grade score for the submission'; +$string['privacy:metadata:kalvidassign_submission:submissioncomment'] = 'Submission teacher comment'; +$string['privacy:metadata:kalvidassign_submission:teacher'] = 'Moodle userId of the teacher who marked the submission'; +$string['privacy:metadata:kalvidassign_submission:mailed'] = 'Whether the assignment submission notification has been emailed to the teacher'; +$string['privacy:metadata:kalvidassign_submission:timemarked'] = 'Time the assignment submission was marked'; +$string['privacy:metadata:kalvidassign_submission:metadata'] = 'Stores a base 64 encoded serialized metadata object'; +$string['privacy:metadata:kalvidassign_submission:timecreated'] = 'Time the submission record was created'; +$string['privacy:metadata:kalvidassign_submission:timemodified'] = 'Time the assignment submission was modified'; +$string['privacy:metadata:kalvidassignfilter'] = 'Filter preference of assignment submissions.'; +$string['privacy:metadata:kalvidassigngroupfilter'] = 'Group filter preference of assignment submissions.'; +$string['privacy:metadata:kalvidassignperpage'] = 'Number of assignment submissions shown per page preference.'; +$string['privacy:metadata:kalvidassignquickgrade'] = 'Quick grading preference for assignment submissions.'; +$string['privacy:markedsubmissionspath'] = 'markedsubmissions'; +$string['privacy:submissionpath'] = 'submission'; +$string['completionsubmit'] = 'Make a submission'; +$string['completiondetail:submit'] = 'Make a submission'; +$string['addsubmission'] = 'Add submission'; +$string['calendardue'] = '{$a} is due'; \ No newline at end of file diff --git a/mod/kalvidassign/lib.php b/mod/kalvidassign/lib.php new file mode 100644 index 0000000000000..814eb3c3d3402 --- /dev/null +++ b/mod/kalvidassign/lib.php @@ -0,0 +1,545 @@ +. + +/** + * Kaltura video assignment main library script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +require_once($CFG->dirroot.'/calendar/lib.php'); + +/** + * Given an object containing all the necessary data, + * (defined by the form in mod_form.php) this function + * will create a new instance and return the id number + * of the new instance. + * + * @param object $kalvidassign An object from the form in mod_form.php + * @return int The id of the newly inserted kalvidassign record + */ +function kalvidassign_add_instance($kalvidassign) { + global $DB; + + $kalvidassign->timecreated = time(); + + $kalvidassign->id = $DB->insert_record('kalvidassign', $kalvidassign); + + if ($kalvidassign->timedue) { + $event = new stdClass(); + $event->name = $kalvidassign->name; + $event->description = format_module_intro('kalvidassign', $kalvidassign, $kalvidassign->coursemodule, false); + $event->format = FORMAT_HTML; + $event->courseid = $kalvidassign->course; + $event->groupid = 0; + $event->userid = 0; + $event->modulename = 'kalvidassign'; + $event->instance = $kalvidassign->id; + $event->eventtype = 'due'; + $event->type = CALENDAR_EVENT_TYPE_ACTION; + $event->timestart = $kalvidassign->timedue; + $event->timesort = $kalvidassign->timedue; + $event->timeduration = 0; + + // add calendar events + calendar_event::create($event); + // add timeline reminder event if requested by user + $completionexpected = (!empty($kalvidassign->completionexpected)) ? $kalvidassign->completionexpected : null; + \core_completion\api::update_completion_date_event($kalvidassign->coursemodule, 'kalvidassign', $kalvidassign->id, $completionexpected); + } + + kalvidassign_grade_item_update($kalvidassign); + + return $kalvidassign->id; +} + +/** + * Given an object containing all the necessary data, + * (defined by the form in mod_form.php) this function + * will update an existing instance with new data. + * + * @param object $kalvidassign An object from the form in mod_form.php + * @return bool Returns true on success, otherwise false. + */ +function kalvidassign_update_instance($kalvidassign) { + global $DB; + + $kalvidassign->timemodified = time(); + $kalvidassign->id = $kalvidassign->instance; + + $updated = $DB->update_record('kalvidassign', $kalvidassign); + + if ($kalvidassign->timedue) { + $event = new stdClass(); + + if ($event->id = $DB->get_field('event', 'id', array('modulename' => 'kalvidassign', 'instance' => $kalvidassign->id))) { + + $event->name = $kalvidassign->name; + $event->description = format_module_intro('kalvidassign', $kalvidassign, $kalvidassign->coursemodule, false); + $event->format = FORMAT_HTML; + $event->timestart = $kalvidassign->timedue; + + $calendarevent = calendar_event::load($event->id); + $calendarevent->update($event); + // update timeline reminder event if requested by user + $completionexpected = (!empty($kalvidassign->completionexpected)) ? $kalvidassign->completionexpected : null; + \core_completion\api::update_completion_date_event($kalvidassign->coursemodule, 'kalvidassign', $kalvidassign->id, $completionexpected); + } else { + $event = new stdClass(); + $event->name = $kalvidassign->name; + $event->description = format_module_intro('kalvidassign', $kalvidassign, $kalvidassign->coursemodule, false); + $event->format = FORMAT_HTML; + $event->courseid = $kalvidassign->course; + $event->groupid = 0; + $event->userid = 0; + $event->modulename = 'kalvidassign'; + $event->instance = $kalvidassign->id; + $event->eventtype = 'due'; + $event->type = CALENDAR_EVENT_TYPE_ACTION; + $event->timestart = $kalvidassign->timedue; + $event->timesort = $kalvidassign->timedue; + $event->timeduration = 0; + + // add calendar events + calendar_event::create($event); + // add timeline reminder event if requested by user + $completionexpected = (!empty($kalvidassign->completionexpected)) ? $kalvidassign->completionexpected : null; + \core_completion\api::update_completion_date_event($kalvidassign->coursemodule, 'kalvidassign', $kalvidassign->id, $completionexpected); + } + } else { + $DB->delete_records('event', array('modulename' => 'kalvidassign', 'instance' => $kalvidassign->id)); + } + + if ($updated) { + kalvidassign_grade_item_update($kalvidassign); + } + + return $updated; +} + +/** + * Given an ID of an instance of this module, + * this function will permanently delete the instance + * and any data that depends on it. + * + * @param int $id Id of the module instance + * @return bool True on success, else false. + */ +function kalvidassign_delete_instance($id) { + global $DB; + + $result = true; + + if (! $kalvidassign = $DB->get_record('kalvidassign', array('id' => $id))) { + return false; + } + + if (! $DB->delete_records('kalvidassign_submission', array('vidassignid' => $kalvidassign->id))) { + $result = false; + } + + if (! $DB->delete_records('event', array('modulename' => 'kalvidassign', 'instance' => $kalvidassign->id))) { + $result = false; + } + + if (! $DB->delete_records('kalvidassign', array('id' => $kalvidassign->id))) { + $result = false; + } + + kalvidassign_grade_item_delete($kalvidassign); + + return $result; +} + +/** + * Return a small object with summary information about what a + * user has done with a given particular instance of this module + * Used for user activity reports. + * $return->time = the time they did it + * $return->info = a short text description + * + * @return object Returns time and info properties. + */ +function kalvidassign_user_outline($course, $user, $mod, $kalvidassign) { + $return = new stdClass; + $return->time = 0; + $return->info = ''; + return $return; +} + + +/** + * Print a detailed representation of what a user has done with + * a given particular instance of this module, for user activity reports. + * + * @return boolean always return true. + */ +function kalvidassign_user_complete($course, $user, $mod, $kalvidassign) { + return true; +} + +/** + * Given a course and a time, this module should find recent activity + * that has occurred in kalvidassign activities and print it out. + * Return true if there was output, or false is there was none. + * + * @return boolean Always returns false. + */ +function kalvidassign_print_recent_activity($course, $viewfullnames, $timestart) { + return false; +} + + +/** + * Must return an array of users who are participants for a given instance + * of kalvidassign. Must include every user involved in the instance, + * independient of his role (student, teacher, admin...). The returned objects + * must contain at least id property. See other modules as example. + * + * @param int $kalvidassign ID of an instance of this module + * @return bool Always returns false. + */ +function kalvidassign_get_participants($kalvidassignid) { + return false; +} + + +/** + * This function returns if a scale is being used by one kalvidassign + * if it has support for grading and scales. Commented code should be + * modified if necessary. See forum, glossary or journal modules + * as reference. + * + * @param int $kalvidassign id ID of an instance of this module + * @return bool Returns false as scales are not supportd by this module. + */ +function kalvidassign_scale_used($kalvidassignid, $scaleid) { + return false; +} + +/** + * Checks if scale is being used by any instance of kalvidassign. + * This function was added in 1.9 + * + * This is used to find out if scale used anywhere + * @param int $scaleid The scale id. + * @return bool True if the scale is used by any kalvidassign + */ +function kalvidassign_scale_used_anywhere($scaleid) { + global $DB; + + $param = array('grade' => -$scaleid); + if ($scaleid and $DB->record_exists('kalvidassign', $param)) { + return true; + } else { + return false; + } +} + +/** + * @param string $feature FEATURE_xx constant for requested feature + * @return mixed True if module supports feature, null if doesn't know + */ +function kalvidassign_supports($feature) { + switch($feature) { + case FEATURE_GROUPS: + return true; + break; + case FEATURE_GROUPINGS: + return true; + break; + case FEATURE_GROUPMEMBERSONLY: + return true; + break; + case FEATURE_MOD_INTRO: + return true; + break; + case FEATURE_COMPLETION_TRACKS_VIEWS: + return true; + break; + case FEATURE_COMPLETION_HAS_RULES: + return true; + break; + case FEATURE_GRADE_HAS_GRADE: + return true; + break; + case FEATURE_GRADE_OUTCOMES: + return true; + break; + case FEATURE_BACKUP_MOODLE2: + return true; + break; + case FEATURE_MOD_PURPOSE: + return MOD_PURPOSE_ASSESSMENT; + break; + default: + return null; + break; + } +} + +/** + * Create/update grade item for given kaltura video assignment + * + * @global object + * @param object kalvidassign object with extra cmidnumber + * @param mixed optional array/object of grade(s); 'reset' means reset grades in gradebook + * @return int, 0 if ok, error code otherwise + */ +function kalvidassign_grade_item_update($kalvidassign, $grades = null) { + require_once(dirname(dirname(dirname(__FILE__))).'/lib/gradelib.php'); + + $params = array('itemname' => $kalvidassign->name, 'idnumber' => $kalvidassign->cmidnumber); + + if ($kalvidassign->grade > 0) { + $params['gradetype'] = GRADE_TYPE_VALUE; + $params['grademax'] = $kalvidassign->grade; + $params['grademin'] = 0; + + } else if ($kalvidassign->grade < 0) { + $params['gradetype'] = GRADE_TYPE_SCALE; + $params['scaleid'] = -$kalvidassign->grade; + + } else { + $params['gradetype'] = GRADE_TYPE_TEXT; + } + + if ($grades === 'reset') { + $params['reset'] = true; + $grades = null; + } + + return grade_update('mod/kalvidassign', $kalvidassign->course, 'mod', 'kalvidassign', $kalvidassign->id, 0, $grades, $params); +} + +/** + * Update activity grades. + * + * @param stdClass $kalvidassign database record + * @param int $userid specific user only, 0 means all + * @param bool $nullifnone - not used + */ +function kalvidassign_update_grades($kalvidassign, $userid = 0, $nullifnone = true) { + kalvidassign_grade_item_update($kalvidassign, null); +} + +/** + * Removes all grades from gradebook + * + * @global object + * @param int $courseid + * @param string optional type + */ +function kalvidassign_reset_gradebook($courseid, $type = '') { + global $DB; + + $sql = "SELECT l.*, cm.idnumber as cmidnumber, l.course as courseid + FROM {kalvidassign} l, {course_modules} cm, {modules} m + WHERE m.name = 'kalvidassign' AND m.id = cm.module AND cm.instance = l.id AND l.course = :course"; + + $params = array ('course' => $courseid); + + if ($kalvisassigns = $DB->get_records_sql($sql, $params)) { + + foreach ($kalvisassigns as $kalvisassign) { + kalvidassign_grade_item_update($kalvisassign, 'reset'); + } + } +} + +/** + * Actual implementation of the reset course functionality, delete all the + * kaltura video submissions attempts for course $data->courseid. + * + * @global stdClass + * @global object + * @param object $data the data submitted from the reset course. + * @return array status array + */ +function kalvidassign_reset_userdata($data) { + global $DB; + + $componentstr = get_string('modulenameplural', 'kalvidassign'); + $status = array(); + + if (!empty($data->reset_kalvidassign)) { + $kalvidassignsql = "SELECT l.id + FROM {kalvidassign} l + WHERE l.course=:course"; + + $params = array ("course" => $data->courseid); + $DB->delete_records_select('kalvidassign_submission', "vidassignid IN ($kalvidassignsql)", $params); + + // remove all grades from gradebook + if (empty($data->reset_gradebook_grades)) { + kalvidassign_reset_gradebook($data->courseid); + } + + $status[] = array('component' => $componentstr, 'item' => get_string('deleteallsubmissions', 'kalvidassign'), 'error' => false); + } + + // updating dates - shift may be negative too + if ($data->timeshift) { + shift_course_mod_dates('kalvidassign', array('timedue', 'timeavailable'), $data->timeshift, $data->courseid); + $status[] = array('component' => $componentstr, 'item' => get_string('datechanged'), 'error' => false); + } + + return $status; +} + +/** + * This functions deletes a grade item. + * @param object $kalvidassign a Kaltura video assignment data object. + * @return int Returns GRADE_UPDATE_OK, GRADE_UPDATE_FAILED, GRADE_UPDATE_MULTIPLE or GRADE_UPDATE_ITEM_LOCKED. + */ +function kalvidassign_grade_item_delete($kalvidassign) { + global $CFG; + require_once($CFG->libdir.'/gradelib.php'); + return grade_update('mod/kalvidassign', $kalvidassign->course, 'mod', 'kalvidassign', $kalvidassign->id, 0, null, array('deleted' => 1)); +} + +/** + * Function to be run periodically according to the moodle cron + * + * Finds all assignment notifications that have yet to be mailed out, and mails them. + * @return bool Returns false as the this module doesn't support cron jobs + */ +function kalvidassign_cron () { + return false; +} + +/** + * Add a get_coursemodule_info function in case any assignment type wants to add 'extra' information + * for the course (see resource). + * + * Given a course_module object, this function returns any "extra" information that may be needed + * when printing this activity in a course listing. See get_array_of_activities() in course/lib.php. + * + * @param stdClass $coursemodule The coursemodule object (record). + * @return cached_cm_info An object on information that the courses + * will know about (most noticeably, an icon). + */ +function kalvidassign_get_coursemodule_info($coursemodule) { + global $DB; + + $dbparams = ['id' => $coursemodule->instance]; + $fields = 'id, name, completionsubmit'; + if (!$kalvidassign = $DB->get_record('kalvidassign', $dbparams, $fields)) { + return false; + } + + $result = new cached_cm_info(); + $result->name = $kalvidassign->name; + + // Populate the custom completion rules as key => value pairs, but only if the completion mode is 'automatic'. + if ($coursemodule->completion == COMPLETION_TRACKING_AUTOMATIC) { + $result->customdata['customcompletionrules']['completionsubmit'] = $kalvidassign->completionsubmit; + } + + return $result; +} + +/** + * Callback which returns human-readable strings describing the active completion custom rules for the module instance. + * + * @param cm_info|stdClass $cm object with fields ->completion and ->customdata['customcompletionrules'] + * @return array $descriptions the array of descriptions for the custom rules. + */ +function mod_kalvidassign_get_completion_active_rule_descriptions($cm) { + // Values will be present in cm_info, and we assume these are up to date. + if (empty($cm->customdata['customcompletionrules']) + || $cm->completion != COMPLETION_TRACKING_AUTOMATIC) { + return []; + } + + $descriptions = []; + foreach ($cm->customdata['customcompletionrules'] as $key => $val) { + switch ($key) { + case 'completionsubmit': + if (!empty($val)) { + $descriptions[] = get_string('completionsubmit', 'kalvidassign'); + } + break; + default: + break; + } + } + return $descriptions; +} + +/** + * This function receives a calendar event and returns the action associated with it, or null if there is none. + * + * This is used by block_myoverview in order to display the event appropriately. If null is returned then the event + * is not displayed on the block. + * + * @param calendar_event $event + * @param \core_calendar\action_factory $factory + * @param int $userid User id to use for all capability checks, etc. Set to 0 for current user (default). + * @return \core_calendar\local\event\entities\action_interface|null + */ +function mod_kalvidassign_core_calendar_provide_event_action(calendar_event $event, + \core_calendar\action_factory $factory, + int $userid = 0) { + global $USER; + + if (!$userid) { + $userid = $USER->id; + } + + $cm = get_fast_modinfo($event->courseid, $userid)->instances['kalvidassign'][$event->instance]; + + if (!$cm->uservisible) { + // The module is not visible to the user for any reason. + return null; + } + + $completion = new \completion_info($cm->get_course()); + + $completiondata = $completion->get_data($cm, false, $userid); + + if ($completiondata->completionstate != COMPLETION_INCOMPLETE) { + return null; + } + + return $factory->create_instance( + get_string('addsubmission', 'kalvidassign'), + new \moodle_url('/mod/kalvidassign/view.php', array('id' => $cm->id)), + 1, + true + ); +} + +/** + * Callback to fetch the activity event type lang string. + * + * @param string $eventtype The event type. + * @return lang_string The event type lang string. + */ +function mod_kalvidassign_core_calendar_get_event_action_string(string $eventtype): string { + $modulename = get_string('modulename', 'kalvidassign'); + + if ($eventtype === 'due') { + return get_string('calendardue', 'kalvidassign', $modulename); + } else { + return get_string('requiresaction', 'calendar', $modulename); + } +} diff --git a/mod/kalvidassign/locallib.php b/mod/kalvidassign/locallib.php new file mode 100644 index 0000000000000..f56ee045448d1 --- /dev/null +++ b/mod/kalvidassign/locallib.php @@ -0,0 +1,357 @@ +. + +/** + * Kaltura video assignment locallib script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/** + * This function returns true if the assignment submission period is over + * + * @param kalvidassign obj + * + * @return bool - true if assignment submission period is over else false + */ + +define('KALASSIGN_ALL', 0); +define('KALASSIGN_REQ_GRADING', 1); +define('KALASSIGN_SUBMITTED', 2); + +require_once(dirname(dirname(dirname(__FILE__))).'/lib/gradelib.php'); +require_once($CFG->dirroot.'/mod/kalvidassign/renderable.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); + +/** + * Check if the assignment submission end date has passed or if late submissions + * are prohibited + * + * @param object - Kaltura instance video assignment object + * @return bool - true if expired, otherwise false + */ +function kalvidassign_assignemnt_submission_expired($kalvidassign) { + $expired = false; + + if ($kalvidassign->preventlate) { + $expired = (0 != $kalvidassign->timedue) && (time() > $kalvidassign->timedue); + } + + return $expired; +} + +/** + * Retrieve a list of users who have submitted assignments + * + * @param int $kalvidassignid The assignment id. + * @param string $filter Filter results by assignments that have been submitted or + * assignment that need to be graded or no filter at all. + * @return mixed collection of users or false. + */ +function kalvidassign_get_submissions($kalvidassignid, $filter = '') { + global $DB; + + $where = ''; + switch ($filter) { + case KALASSIGN_SUBMITTED: + $where = ' timemodified > 0 AND '; + break; + case KALASSIGN_REQ_GRADING: + $where = ' timemarked < timemodified AND '; + break; + } + + $param = array('instanceid' => $kalvidassignid); + $where .= ' vidassignid = :instanceid'; + + // Reordering the fields returned to make it easier to use in the grade_get_grades function. + $columns = 'userid,vidassignid,entry_id,grade,submissioncomment,format,teacher,mailed,timemarked,timecreated,timemodified,source,width,height'; + $records = $DB->get_records_select('kalvidassign_submission', $where, $param, 'timemodified DESC', $columns); + + if (empty($records)) { + return false; + } + + return $records; +} + +/** + * This function retrives the user's submission record. + * @param int $kalvidassignid The activity instance id. + * @param int $userid The user id. + * @return object A data object consisting of the user's submission. + */ +function kalvidassign_get_submission($kalvidassignid, $userid) { + global $DB; + + $param = array('instanceid' => $kalvidassignid, 'userid' => $userid); + $where = ''; + $where .= ' vidassignid = :instanceid AND userid = :userid'; + + // Reordering the fields returned to make it easier to use in the grade_get_grades function. + $columns = 'userid,id,vidassignid,entry_id,grade,submissioncomment,format,teacher,mailed,timemarked,timecreated,timemodified,source,width,height'; + $record = $DB->get_record_select('kalvidassign_submission', $where, $param, '*'); + + if (empty($record)) { + return false; + } + + return $record; + +} + +/** + * This function retrieves the submission grade object. + * @param int $instanceid The activity instance id. + * @param int $userid The user id. + * @return object A data object consisting of the user's submission. + */ +function kalvidassign_get_submission_grade_object($instanceid, $userid) { + global $DB; + + $param = array('kvid' => $instanceid, 'userid' => $userid); + + $sql = "SELECT u.id, u.id AS userid, s.grade AS rawgrade, s.submissioncomment AS feedback, s.format AS feedbackformat, + s.teacher AS usermodified, s.timemarked AS dategraded, s.timemodified AS datesubmitted + FROM {user} u, {kalvidassign_submission} s + WHERE u.id = s.userid AND s.vidassignid = :kvid + AND u.id = :userid"; + + $data = $DB->get_record_sql($sql, $param); + + if (-1 == $data->rawgrade) { + $data->rawgrade = null; + } + + return $data; +} + +/** + * This function validates the course module id and returns the course module object, course object and activity instance object. + * @return array an array with the following values array(course module object, $course object, activity instance object). + */ +function kalvidassign_validate_cmid ($cmid) { + global $DB; + + if (!$cm = get_coursemodule_from_id('kalvidassign', $cmid)) { + throw new \moodle_exception('invalidcoursemodule'); + } + + if (!$course = $DB->get_record('course', array('id' => $cm->course))) { + throw new \moodle_exception('coursemisconf'); + } + + if (!$kalvidassignobj = $DB->get_record('kalvidassign', array('id' => $cm->instance))) { + throw new \moodle_exception('invalidid', 'kalvidassign'); + } + + return array($cm, $course, $kalvidassignobj); +} + +/** + * This function returns HTML markup to signify a submission was late. + * @return string HTML markup + */ +function kalvidassign_display_lateness($timesubmitted, $timedue) { + if (!$timedue) { + return ''; + } + $time = $timedue - $timesubmitted; + if ($time < 0) { + $timetext = get_string('late', 'kalvidassign', format_time($time)); + return ' ('.$timetext.')'; + } else { + $timetext = get_string('early', 'kalvidassign', format_time($time)); + return ' ('.$timetext.')'; + } +} + +/** + * Alerts teachers by email of new or changed assignments that need grading + * + * First checks whether the option to email teachers is set for this assignment. + * Sends an email to ALL teachers in the course (or in the group if using separate groups). + * Uses the methods kalvidassign_email_teachers_text() and kalvidassign_email_teachers_html() to construct the content. + * + * @global object + * @global object + * @param object $cm Kaltura video assignment course module object. + * @param string $name Name of the video assignment instance. + * @param object $submission The submission that has changed. + * @param object $context The context object. + * @return void + */ +function kalvidassign_email_teachers($cm, $name, $submission, $context) { + global $CFG, $DB, $COURSE; + + $user = $DB->get_record('user', array('id'=>$submission->userid)); + + if ($teachers = kalvidassign_get_graders($cm, $user, $context)) { + + $strassignments = get_string('modulenameplural', 'kalvidassign'); + $strassignment = get_string('modulename', 'kalvidassign'); + $strsubmitted = get_string('submitted', 'kalvidassign'); + + foreach ($teachers as $teacher) { + $info = new stdClass(); + $info->username = fullname($user, true); + $info->assignment = format_string($name, true); + $info->url = $CFG->wwwroot.'/mod/kalvidassign/grade_submissions.php?cmid='.$cm->id; + $info->timeupdated = strftime('%c', $submission->timemodified); + $info->courseid = $cm->course; + $info->cmid = $cm->id; + + $postsubject = $strsubmitted.': '.$user->username.' -> '.$name; + $posttext = kalvidassign_email_teachers_text($info); + $posthtml = ($teacher->mailformat == 1) ? kalvidassign_email_teachers_html($info) : ''; + + $eventdata = new \core\message\message(); + $eventdata->courseid = $COURSE->id; + $eventdata->modulename = 'kalvidassign'; + $eventdata->userfrom = $user; + $eventdata->userto = $teacher; + $eventdata->subject = $postsubject; + $eventdata->fullmessage = $posttext; + $eventdata->fullmessageformat = FORMAT_PLAIN; + $eventdata->fullmessagehtml = $posthtml; + $eventdata->smallmessage = $postsubject; + + $eventdata->name = 'kalvidassign_updates'; + $eventdata->component = 'mod_kalvidassign'; + $eventdata->notification = 1; + $eventdata->contexturl = $info->url; + $eventdata->contexturlname = $info->assignment; + + message_send($eventdata); + } + } +} + +/** + * Returns a list of teachers that should be grading given submission. + * + * @param object $cm Kaltura video assignment course module object. + * @param object $user The Moodle user object. + * @param object $context A context object. + * @return array An array of grading userids + */ +function kalvidassign_get_graders($cm, $user, $context) { + // Potential graders. + $potgraders = get_enrolled_users($context, 'mod/kalvidassign:gradesubmission', 0, 'u.*', null, 0, 0, true); + + $graders = array(); + // Separate groups are being used. + if (groups_get_activity_groupmode($cm) == SEPARATEGROUPS) { + // Try to find all groups. + if ($groups = groups_get_all_groups($cm->course, $user->id)) { + foreach ($groups as $group) { + foreach ($potgraders as $t) { + if ($t->id == $user->id) { + continue; // do not send self + } + if (groups_is_member($group->id, $t->id)) { + $graders[$t->id] = $t; + } + } + } + } else { + // user not in group, try to find graders without group + foreach ($potgraders as $t) { + if ($t->id == $user->id) { + // do not send self. + continue; + } + // ugly hack. + if (!groups_get_all_groups($cm->course, $t->id)) { + $graders[$t->id] = $t; + } + } + } + } else { + foreach ($potgraders as $t) { + if ($t->id == $user->id) { + // do not send self. + continue; + } + $graders[$t->id] = $t; + } + } + return $graders; +} + +/** + * Creates the text content for emails to teachers + * + * @param $info object The info used by the 'emailteachermail' language string + * @return string + */ +function kalvidassign_email_teachers_text($info) { + global $DB; + + $param = array('id' => $info->courseid); + $course = $DB->get_record('course', $param); + $posttext = ''; + + if (!empty($course)) { + $posttext = format_string($course->shortname, true, $course->id).' -> '.get_string('modulenameplural', 'kalvidassign').' -> '; + $posttext .= format_string($info->assignment, true, $course->id)."\n"; + $posttext .= '---------------------------------------------------------------------'."\n"; + $posttext .= get_string("emailteachermail", "kalvidassign", $info)."\n"; + $posttext .= "\n---------------------------------------------------------------------\n"; + } + + return $posttext; +} + +/** + * Creates the html content for emails to teachers + * + * @param object $info The info used by the 'emailteachermailhtml' language string + * @return string + */ +function kalvidassign_email_teachers_html($info) { + global $CFG, $DB; + + $param = array('id' => $info->courseid); + $course = $DB->get_record('course', $param); + $posthtml = ''; + + if (!empty($course)) { + $posthtml .= html_writer::start_tag('p'); + $attr = array('href' => new moodle_url('/course/view.php', array('id' => $course->id))); + $posthtml .= html_writer::tag('a', format_string($course->shortname, true, $course->id), $attr); + $posthtml .= '->'; + $attr = array('href' => new moodle_url('/mod/kalvidassign/view.php', array('id' => $info->cmid))); + $posthtml .= html_writer::tag('a', format_string($info->assignment, true, $course->id), $attr); + $posthtml .= html_writer::end_tag('p'); + $posthtml .= html_writer::start_tag('hr'); + $posthtml .= html_writer::tag('p', get_string('emailteachermailhtml', 'kalvidassign', $info)); + $posthtml .= html_writer::end_tag('hr'); + } + return $posthtml; +} + +/** + * This function retrieves a list of enrolled users with the capability to submit to the activity. + * @return array An array of user objects. + */ +function kalvidassign_get_assignment_students($cm) { + $context = context_module::instance($cm->id); + $users = get_enrolled_users($context, 'mod/kalvidassign:submit', 0, 'u.id'); + + return $users; +} \ No newline at end of file diff --git a/mod/kalvidassign/lti_launch.php b/mod/kalvidassign/lti_launch.php new file mode 100644 index 0000000000000..e2d8e3b12bd8f --- /dev/null +++ b/mod/kalvidassign/lti_launch.php @@ -0,0 +1,90 @@ +. + +/** + * Kaltura video assignment LTI launch script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); +require_once(dirname(__FILE__).'/locallib.php'); + +global $USER; + +require_login(); +$courseid = required_param('courseid', PARAM_INT); +$cmid = required_param('cmid', PARAM_INT); +$height = required_param('height', PARAM_INT); +$width = required_param('width', PARAM_INT); +$withblocks = optional_param('withblocks', 0, PARAM_INT); +$source = optional_param('source', '', PARAM_URL); + +$context = context_course::instance($courseid); +require_capability('mod/kalvidassign:submit', $context); +$course = get_course($courseid); + +$launch = array(); +$launch['id'] = 1; +$launch['cmid'] = $cmid; +$launch['title'] = 'Kaltura video assignment'; +$launch['module'] = KAF_BROWSE_EMBED_MODULE; +$launch['course'] = $course; +$launch['width'] = $width; +$launch['height'] = $height; +$launch['custom_publishdata'] = ''; + +$source = $source = local_kaltura_add_kaf_uri_token($source); + +if (!$cm = get_coursemodule_from_id('kalvidassign', $cmid)) { + throw new \moodle_exception('invalidcoursemodule'); +} + +if (!$kalvidassignobj = $DB->get_record('kalvidassign', array('id' => $cm->instance))) { + throw new \moodle_exception('invalidid', 'kalvidassign'); +} + +$submissionParams = array('vidassignid' => $kalvidassignobj->id, 'userid' => $USER->id); +$submission = $DB->get_record('kalvidassign_submission', $submissionParams); + +if (false === local_kaltura_url_contains_configured_hostname($source) && !empty($source)) { + echo get_string('invalid_source_parameter', 'mod_kalvidres'); + die; +} else { + $launch['source'] = urldecode($source); +} + +$isResubmit = !empty($submission->entry_id) || !empty($submission->timecreated); +$isExpired = kalvidassign_assignemnt_submission_expired($kalvidassignobj); +$isReplaceMediaDisabled = $isExpired || !$kalvidassignobj->resubmit; + +if ($isResubmit && $isReplaceMediaDisabled && empty($source)) { + echo get_string('notallowedtoreplacemedia', 'mod_kalvidassign'); + die; +} +if (!empty(get_config(KALTURA_PLUGIN_NAME, 'enable_submission'))) { + $launch['submission'] = 'yes'; +} +if (local_kaltura_validate_browseembed_required_params($launch)) { + $content = local_kaltura_request_lti_launch($launch, $withblocks); + echo $content; +} else { + echo get_string('invalid_launch_parameters', 'mod_kalvidassign'); +} diff --git a/mod/kalvidassign/lti_launch_grade.php b/mod/kalvidassign/lti_launch_grade.php new file mode 100644 index 0000000000000..5909f7388b668 --- /dev/null +++ b/mod/kalvidassign/lti_launch_grade.php @@ -0,0 +1,69 @@ +. + +/** + * Kaltura video assignment LTI launch script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); + +global $USER; + +require_login(); +$courseid = required_param('courseid', PARAM_INT); +$cmid = required_param('cmid', PARAM_INT); +$height = required_param('height', PARAM_INT); +$width = required_param('width', PARAM_INT); +$withblocks = optional_param('withblocks', 0, PARAM_INT); +$source = required_param('source', PARAM_TEXT); + +// The capability requirement should always be at the course module context. +// This inherits course context if not set. Otherwise module local role assignments breaks. +require_capability('mod/kalvidassign:gradesubmission', context_module::instance($cmid)); + +$course = get_course($courseid); + +$launch = array(); +$launch['id'] = 1; +$launch['cmid'] = $cmid; +$launch['title'] = 'Kaltura video assignment'; +$launch['module'] = KAF_BROWSE_EMBED_MODULE; +$launch['course'] = $course; +$launch['width'] = $width; +$launch['height'] = $height; +$launch['custom_publishdata'] = ''; + +$source = $source = local_kaltura_add_kaf_uri_token($source); + +if (false === local_kaltura_url_contains_configured_hostname($source) && !empty($source)) { + echo get_string('invalid_source_parameter', 'mod_kalvidres'); + die; +} else { + $launch['source'] = urldecode($source); +} + +if (local_kaltura_validate_browseembed_required_params($launch)) { + $content = local_kaltura_request_lti_launch($launch, $withblocks); + echo $content; +} else { + echo get_string('invalid_launch_parameters', 'mod_kalvidassign'); +} diff --git a/mod/kalvidassign/mod_form.php b/mod/kalvidassign/mod_form.php new file mode 100644 index 0000000000000..8108acb4cb5b9 --- /dev/null +++ b/mod/kalvidassign/mod_form.php @@ -0,0 +1,124 @@ +. + +/** + * Kaltura video assignment mod_form script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +require_once(dirname(dirname(dirname(__FILE__))).'/course/moodleform_mod.php'); + +class mod_kalvidassign_mod_form extends moodleform_mod { + /** + * Definition function for the form. + */ + public function definition() { + global $CFG, $COURSE; + + $mform =& $this->_form; + + $mform->addElement('hidden', 'course', $COURSE->id); + + $mform->addElement('header', 'general', get_string('general', 'form')); + + $mform->addElement('text', 'name', get_string('name', 'kalvidassign'), array('size' => '64')); + + if (!empty($CFG->formatstringstriptags)) { + $mform->setType('name', PARAM_TEXT); + } else { + $mform->setType('name', PARAM_CLEANHTML); + } + $mform->addRule('name', null, 'required', null, 'client'); + + $this->standard_intro_elements(); + + $mform->addElement('date_time_selector', 'timeavailable', get_string('availabledate', 'kalvidassign'), array('optional' => true)); + $mform->setDefault('timeavailable', time()); + $mform->addElement('date_time_selector', 'timedue', get_string('duedate', 'kalvidassign'), array('optional' => true)); + $mform->setDefault('timedue', time()+7*24*3600); + + $ynoptions = array( 0 => get_string('no'), 1 => get_string('yes')); + + $mform->addElement('select', 'preventlate', get_string('preventlate', 'kalvidassign'), $ynoptions); + $mform->setDefault('preventlate', 0); + + $mform->addElement('select', 'resubmit', get_string('allowdeleting', 'kalvidassign'), $ynoptions); + $mform->addHelpButton('resubmit', 'allowdeleting', 'kalvidassign'); + $mform->setDefault('resubmit', 0); + + $mform->addElement('select', 'emailteachers', get_string('emailteachers', 'kalvidassign'), $ynoptions); + $mform->addHelpButton('emailteachers', 'emailteachers', 'kalvidassign'); + $mform->setDefault('emailteachers', 0); + + $this->standard_grading_coursemodule_elements(); + + $this->standard_coursemodule_elements(); + + $this->add_action_buttons(); + } + + /** + * Add any custom completion rules to the form. + * + * @return array Contains the names of the added form elements + */ + public function add_completion_rules() { + $mform =& $this->_form; + + $suffix = $this->get_suffix(); + $completionsubmitel = 'completionsubmit' . $suffix; + $mform->addElement('checkbox', $completionsubmitel, '', get_string('completionsubmit', 'kalvidassign')); + // Enable this completion rule by default. + $mform->setDefault($completionsubmitel, 1); + return [$completionsubmitel]; + } + + /** + * Allows module to modify the data returned by form get_data(). + * This method is also called in the bulk activity completion form. + * + * Only available on moodleform_mod. + * + * @param stdClass $data the form data to be modified. + */ + public function data_postprocessing($data) { + parent::data_postprocessing($data); + // Set up completion section even if checkbox is not ticked. + if (!empty($data->completionunlocked)) { + $suffix = $this->get_suffix(); + if (empty($data->{'completionsubmit' . $suffix})) { + $data->{'completionsubmit' . $suffix} = 0; + } + } + } + + /** + * Determines if completion is enabled for this module. + * + * @param array $data + * @return bool + */ + public function completion_rule_enabled($data) { + $suffix = $this->get_suffix(); + return !empty($data['completionsubmit' . $suffix]); + } +} \ No newline at end of file diff --git a/mod/kalvidassign/pix/monologo.svg b/mod/kalvidassign/pix/monologo.svg new file mode 100644 index 0000000000000..50168731cedd2 --- /dev/null +++ b/mod/kalvidassign/pix/monologo.svg @@ -0,0 +1,3 @@ + + + diff --git a/mod/kalvidassign/renderable.php b/mod/kalvidassign/renderable.php new file mode 100644 index 0000000000000..f4546a36f954b --- /dev/null +++ b/mod/kalvidassign/renderable.php @@ -0,0 +1,69 @@ +. + +/** + * Kaltura video assignment renderable script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +defined('MOODLE_INTERNAL') || die(); + +/** + * Renderable course index summary + */ +class kalvidassign_course_index_summary implements renderable { + /** @var array assignments A list of course module info and submission counts or statuses */ + public $assignments = array(); + /** @var boolean usesections Does this course format support sections? */ + public $usesections = false; + /** @var string courseformat The current course format name */ + public $courseformatname = ''; + + /** + * constructor + * + * @param $usesections boolean True if this course format uses sections + * @param $courseformatname string The id of this course format + */ + public function __construct($usesections, $courseformatname) { + $this->usesections = $usesections; + $this->courseformatname = $courseformatname; + } + + /** + * Add a row of data to display on the course index page + * + * @param int $cmid The course module id for generating a link + * @param string $cmname The course module name for generating a link + * @param string $sectionname The name of the course section (only if $usesections is true) + * @param int $timedue The due date for the assignment - may be 0 if no duedate + * @param string $submissioninfo A string with either the number of submitted assignments, or the + * status of the current users submission depending on capabilities. + * @param string $gradeinfo The current users grade if they have been graded and it is not hidden. + */ + public function add_assign_info($cmid, $cmname, $sectionname, $timedue, $submissioninfo, $gradeinfo) { + $this->assignments[] = array( + 'cmid' => $cmid, + 'cmname' => $cmname, + 'sectionname' => $sectionname, + 'timedue' => $timedue, + 'submissioninfo' => $submissioninfo, + 'gradeinfo' => $gradeinfo + ); + } +} diff --git a/mod/kalvidassign/renderer.php b/mod/kalvidassign/renderer.php new file mode 100644 index 0000000000000..551e24af54700 --- /dev/null +++ b/mod/kalvidassign/renderer.php @@ -0,0 +1,1193 @@ +. + +/** + * Kaltura video assignment renderer script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +require_once(dirname(dirname(dirname(__FILE__))).'/lib/tablelib.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/lib/moodlelib.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); + +/** + * Table class for displaying video submissions for grading + */ +class submissions_table extends table_sql { + /* @var bool Set to true if a quick grade form needs to be rendered. */ + public $quickgrade; + /* @var object An object returned from @see grade_get_grades(). */ + public $gradinginfo; + /* @var int The course module instnace id. */ + public $cminstance; + /* @var int The maximum grade point set for the activity instance. */ + public $grademax; + /* @var int The number of columns of the quick grade textarea element. */ + public $cols = 20; + /* @var int The number of rows of the quick grade textarea element. */ + public $rows = 4; + /* @var string The first initial of the first name filter. */ + public $tifirst; + /* @var string The first initial of the last name filter. */ + public $tilast; + /* @var int The current page number. */ + public $page; + /* @var int The current course ID */ + public $courseId; + + /** + * Constructor function for the submissions table class. + * @param int $uniqueid Unique id. + * @param int $cm Course module id. + * @param object $gradinginfo An object returned from @see grade_get_grades(). + * @param bool $quickgrade Set to true if a quick grade form needs to be rendered. + * @param string $tifirst The first initial of the first name filter. + * @param string $tilast The first initial of the first name filter. + * @param int $page The current page number. + */ + public function __construct($uniqueid, $cm, $gradinginfo, $quickgrade = false, $tifirst = '', $tilast = '', $page = 0) { + global $DB; + + parent::__construct($uniqueid); + + $this->quickgrade = $quickgrade; + $this->gradinginfo = $gradinginfo; + + $instance = $DB->get_record('kalvidassign', array('id' => $cm->instance), 'id,grade'); + + $this->courseId = $cm->course; + + $instance->cmid = $cm->id; + + $this->cminstance = $instance; + + $this->grademax = $this->gradinginfo->items[0]->grademax; + + $this->tifirst = $tifirst; + $this->tilast = $tilast; + $this->page = $page; + } + + /** + * The function renders the picture column. + * @param object $data information about the current row being rendered. + * @return string HTML markup. + */ + public function col_picture($data) { + global $OUTPUT; + + $user = new stdClass(); + $user->id = $data->id; + $user->picture = $data->picture; + $user->imagealt = $data->imagealt; + $user->firstname = $data->firstname; + $user->lastname = $data->lastname; + $user->email = $data->email; + $user->alternatename = $data->alternatename; + $user->middlename = $data->middlename; + $user->firstnamephonetic = $data->firstnamephonetic; + $user->lastnamephonetic = $data->lastnamephonetic; + + $output = $OUTPUT->user_picture($user); + + $attr = array('type' => 'hidden', 'name' => 'users['.$data->id.']', 'value' => $data->id); + $output .= html_writer::empty_tag('input', $attr); + + return $output; + } + + /** + * The function renders the select grade column. + * @param object $data information about the current row being rendered. + * @return string HTML markup. + */ + public function col_selectgrade($data) { + global $CFG; + + $output = ''; + $finalgrade = false; + + if (array_key_exists($data->id, $this->gradinginfo->items[0]->grades)) { + + $finalgrade = $this->gradinginfo->items[0]->grades[$data->id]; + + if ($CFG->enableoutcomes) { + + $finalgrade->formatted_grade = $this->gradinginfo->items[0]->grades[$data->id]->str_grade; + } else { + + // Equation taken from mod/assignment/lib.php display_submissions() + $finalgrade->formatted_grade = round($finalgrade->grade, 2).' / '.round($this->grademax, 2); + } + } + + if (!is_bool($finalgrade) && ($finalgrade->locked || $finalgrade->overridden) ) { + + $locked_overridden = 'locked'; + + if ($finalgrade->overridden) { + $locked_overridden = 'overridden'; + } + $attr = array('id' => 'g'.$data->id, 'class' => $locked_overridden); + + $output = html_writer::tag('div', $finalgrade->formatted_grade, $attr); + + } else if (!empty($this->quickgrade)) { + + $attributes = array(); + + $grades_menu = make_grades_menu($this->cminstance->grade); + + $default = array(-1 => get_string('nograde')); + + $grade = null; + + if (!empty($data->timemarked)) { + $grade = $data->grade; + } + + $output = html_writer::select($grades_menu, 'menu['.$data->id.']', $grade, $default, $attributes); + + } else { + + $output = get_string('nograde'); + + if (!empty($data->timemarked)) { + $output = $this->display_grade($data->grade); + } + } + + return $output; + } + + /** + * The function renders the submissions comment column. + * @param object $data information about the current row being rendered. + * @return string HTML markup. + */ + public function col_submissioncomment($data) { + global $OUTPUT; + + $output = ''; + $finalgrade = false; + + if (array_key_exists($data->id, $this->gradinginfo->items[0]->grades)) { + $finalgrade = $this->gradinginfo->items[0]->grades[$data->id]; + } + + if ( (!is_bool($finalgrade) && ($finalgrade->locked || $finalgrade->overridden)) ) { + + $output = shorten_text(strip_tags($data->submissioncomment), 15); + + } else if (!empty($this->quickgrade)) { + + $param = array( + 'id' => 'comments_'.$data->submitid, + 'rows' => $this->rows, + 'cols' => $this->cols, + 'name' => 'submissioncomment['.$data->id.']'); + + $output .= html_writer::start_tag('textarea', $param); + $output .= $data->submissioncomment; + $output .= html_writer::end_tag('textarea'); + + } else { + $output = shorten_text(strip_tags($data->submissioncomment), 15); + } + + return $output; + } + + /** + * The function renders the grade marked column. + * @param object $data information about the current row being rendered. + * @return string HTML markup. + */ + public function col_grademarked($data) { + + $output = ''; + + if (!empty($data->timemarked)) { + $output = userdate($data->timemarked); + } + + return $output; + } + + /** + * The function renders the time modified column. + * @param object $data information about the current row being rendered. + * @return string HTML markup. + */ + public function col_timemodified($data) { + $data->source = local_kaltura_add_kaf_uri_token($data->source); + $attr = array('name' => 'media_submission'); + $output = html_writer::start_tag('div', $attr); + + $attr = array('id' => 'ts'.$data->id); + + $date_modified = $data->timemodified; + $date_modified = is_null($date_modified) || empty($data->timemodified) ? '' : userdate($date_modified); + + $output .= html_writer::tag('div', $date_modified, $attr); + + $output .= html_writer::empty_tag('br'); + + // If the metadata property is empty only display an anchor tag. Otherwise display a thumbnail image. + if (!empty($data->entry_id)) { + + // Decode the additional video metadata. + $metadata = local_kaltura_decode_object_for_storage($data->metadata); + + // Check if the metadata thumbnailurl property is empty. If not then display the thumbnail. Otherwise display a text link. + if (!empty($metadata->thumbnailurl) && !is_null($metadata->thumbnailurl)) { + + $output .= html_writer::start_tag('center'); + $metadata = local_kaltura_decode_object_for_storage($data->metadata); + + $attr = array('src' => $metadata->thumbnailurl, 'class' => 'kalsubthumb'); + $thumbnail = html_writer::empty_tag('img', $attr); + + $attr = array('name' => 'submission_source', 'href' => $this->_generateLtiLaunchLink($data->source, $data), 'class' => 'kalsubthumbanchor'); + $output .= html_writer::tag('a', $thumbnail, $attr); + $output .= html_writer::end_tag('center'); + + } else { + + $output .= html_writer::start_tag('center'); + $attr = array('name' => 'submission_source', 'href' => $this->_generateLtiLaunchLink($data->source, $data), 'class' => 'kalsubanchor'); + $output .= html_writer::tag('a', get_string('viewsubmission', 'kalvidassign'), $attr); + $output .= html_writer::end_tag('center'); + } + } + + // Display hidden elements. + if (!empty($data->entry_id)) { + $attr = array('type' => 'hidden', 'name' => 'width', 'value' => $data->width); + $output .= html_writer::empty_tag('input', $attr); + + $attr = array('type' => 'hidden', 'name' => 'height', 'value' => $data->height); + $output .= html_writer::empty_tag('input', $attr); + } + + $output .= html_writer::end_tag('div'); + return $output; + } + + /** + * The function renders the grade column. + * @param object $data information about the current row being rendered. + * @return string HTML markup. + */ + public function col_grade($data) { + $finalgrade = false; + + if (array_key_exists($data->id, $this->gradinginfo->items[0]->grades)) { + $finalgrade = $this->gradinginfo->items[0]->grades[$data->id]; + } + + $finalgrade = (!is_bool($finalgrade)) ? $finalgrade->str_grade : '-'; + + $attr = array('id' => 'finalgrade_'.$data->id); + $output = html_writer::tag('span', $finalgrade, $attr); + + return $output; + } + + /** + * The function renders the time marked column. + * @param object $data information about the current row being rendered. + * @return string HTML markup. + */ + public function col_timemarked($data) { + $output = '-'; + + if (0 < $data->timemarked) { + + $attr = array('id' => 'tt'.$data->id); + $output = html_writer::tag('div', userdate($data->timemarked), $attr); + + } else { + $otuput = '-'; + } + + return $output; + } + + /** + * The function renders the submission status column. + * @param object $data information about the current row being rendered. + * @return string HTML markup. + */ + public function col_status($data) { + global $OUTPUT, $CFG; + + require_once(dirname(dirname(dirname(__FILE__))).'/lib/weblib.php'); + + $url = new moodle_url('/mod/kalvidassign/single_submission.php', array('cmid' => $this->cminstance->cmid, 'userid' => $data->id, 'sesskey' => sesskey())); + + if (!empty($this->tifirst)) { + $url->param('tifirst', $this->tifirst); + } + + if (!empty($this->tilast)) { + $url->param('tilast', $this->tilast); + } + + if (!empty($this->page)) { + $url->param('page', $this->page); + } + + $buttontext = ''; + // Check if the user submitted the assignment. + $submitted = !is_null($data->timemarked); + + if ($data->timemarked > 0) { + $class = 's1'; + $buttontext = get_string('update'); + } else { + $class = 's0'; + $buttontext = get_string('grade'); + } + + if (!$submitted) { + $class ='s1'; + $buttontext = get_string('nosubmission', 'kalvidassign'); + } + + $attr = array('id' => 'up'.$data->id, + 'class' => $class); + + $output = html_writer::link($url, $buttontext, $attr); + + return $output; + } + + /** + * Return a grade in user-friendly form, whether it's a scale or not + * + * @global object + * @param mixed $grade + * @return string User-friendly representation of grade + * + * TODO: Move this to locallib.php + */ + public function display_grade($grade) { + global $DB; + + // Cache scales for each assignment - they might have different scales!! + static $kalscalegrades = array(); + + // Normal number + if ($this->cminstance->grade >= 0) { + if ($grade == -1) { + return '-'; + } else { + return $grade.' / '.$this->cminstance->grade; + } + + } else { + // Scale + if (empty($kalscalegrades[$this->cminstance->id])) { + + if ($scale = $DB->get_record('scale', array('id'=>-($this->cminstance->grade)))) { + + $kalscalegrades[$this->cminstance->id] = make_menu_from_list($scale->scale); + } else { + + return '-'; + } + } + + if (isset($kalscalegrades[$this->cminstance->id][$grade])) { + return $kalscalegrades[$this->cminstance->id][$grade]; + } + return '-'; + } + } + + private function _generateLtiLaunchLink($source, $data) + { + $cmid = $this->cminstance->cmid; + + $width = 485; + $height = 450; + if(isset($data->height) && isset($data->width)) + { + $width = $data->width; + $height = $data->height; + } + $realSource = local_kaltura_add_kaf_uri_token($source); + $hashedSource = base64_encode($realSource); + + $target = new moodle_url('/mod/kalvidassign/lti_launch_grade.php?cmid='.$cmid.'&source='.urlencode($source).'&height='.$height.'&width='.$width.'&courseid='.$this->courseId); + return $target; + } +} + +/** + * This class renders the submission pages. + */ +class mod_kalvidassign_renderer extends plugin_renderer_base { + /** + * The function displays information about the assignment settings. + * @param object $data information about the current row being rendered. + * @return string HTML markup. + */ + public function display_mod_info($kalvideoobj, $context) { + global $DB; + $html = ''; + + if (!empty($kalvideoobj->timeavailable)) { + $html .= html_writer::start_tag('p'); + $html .= html_writer::tag('b', get_string('availabledate', 'kalvidassign').': '); + $html .= userdate($kalvideoobj->timeavailable); + $html .= html_writer::end_tag('p'); + } + + if (!empty($kalvideoobj->timedue)) { + $html .= html_writer::start_tag('p'); + $html .= html_writer::tag('b', get_string('duedate', 'kalvidassign').': '); + $html .= userdate($kalvideoobj->timedue); + $html .= html_writer::end_tag('p'); + } + + // Display a count of the numuber of submissions + if (has_capability('mod/kalvidassign:gradesubmission', $context)) { + + $param = array('vidassignid' => $kalvideoobj->id, 'timecreated' => 0, 'timemodified' => 0); + + $csql = "SELECT COUNT(*) + FROM {kalvidassign_submission} + WHERE vidassignid = :vidassignid + AND (timecreated > :timecreated OR timemodified > :timemodified) "; + + $count = $DB->count_records_sql($csql, $param); + + if ($count) { + $html .= html_writer::start_tag('p'); + $html .= get_string('numberofsubmissions', 'kalvidassign', $count); + $html .= html_writer::end_tag('p'); + } + + } + + return $html; + } + + /** + * This function returns HTML markup to render a form and submission buttons. + * @param object $cm A course module object. + * @param int $userid The current user id. + * @param bool $disablesubmit Set to true to disable the submit button. + * @return string Returns HTML markup. + */ + public function display_student_submit_buttons($cm, $userid, $disablesubmit = false) { + $html = ''; + + $target = new moodle_url('/mod/kalvidassign/submission.php'); + + $attr = array('method' => 'POST', 'action' => $target); + + $html .= html_writer::start_tag('form', $attr); + + $attr = array( + 'type' => 'hidden', + 'name' => 'entry_id', + 'id' => 'entry_id', + 'value' => '' + ); + + $html .= html_writer::empty_tag('input', $attr); + + $attr = array( + 'type' => 'hidden', + 'name' => 'cmid', + 'value' => $cm->id + ); + $html .= html_writer::empty_tag('input', $attr); + + $attr = array( + 'type' => 'hidden', + 'name' => 'sesskey', + 'value' => sesskey() + ); + $html .= html_writer::empty_tag('input', $attr); + + $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'width', 'name' => 'width', 'value' => 0)); + $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'height', 'name' => 'height', 'value' => 0)); + $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'source', 'name' => 'source', 'value' => 0)); + $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'metadata', 'name' => 'metadata', 'value' => 0)); + + $html .= html_writer::start_tag('center', ['class' => 'm-t-2 m-b-1']); + + $attr = array( + 'class' => 'btn btn-primary mr-2', + 'type' => 'button', + 'id' => 'id_add_video', + 'name' => 'add_video', + 'value' => get_string('addvideo', 'kalvidassign') + ); + + if ($disablesubmit) { + $attr['disabled'] = 'disabled'; + } + + $html .= html_writer::empty_tag('input', $attr); + + $attr = array( + 'class' => 'btn btn-secondary', + 'type' => 'submit', + 'name' => 'submit_video', + 'id' => 'submit_video', + 'disabled' => 'disabled', + 'value' => get_string('submitvideo', 'kalvidassign')); + + $html .= html_writer::empty_tag('input', $attr); + + $html .= html_writer::end_tag('center'); + + $html .= html_writer::end_tag('form'); + + return $html; + } + + /** + * This function returns HTML markup to render a form and submission buttons. + * @param object $cm A course module object. + * @param int $userid The current user id. + * @param bool $disablesubmit Set to true to disable the submit button. + * @return string Returns HTML markup. + */ + public function display_student_resubmit_buttons($cm, $userid, $disablesubmit = false) { + global $DB; + + $param = array('vidassignid' => $cm->instance, 'userid' => $userid); + $submissionrec = $DB->get_record('kalvidassign_submission', $param); + + $html = ''; + + $target = new moodle_url('/mod/kalvidassign/submission.php'); + + $attr = array('method' => 'POST', 'action' => $target); + + $html .= html_writer::start_tag('form', $attr); + + $attr = array( + 'type' => 'hidden', + 'name' => 'cmid', + 'value' => $cm->id + ); + + $html .= html_writer::empty_tag('input', $attr); + + $attr = array( + 'type' => 'hidden', + 'name' => 'entry_id', + 'id' => 'entry_id', + 'value' => $submissionrec->entry_id + ); + + $html .= html_writer::empty_tag('input', $attr); + + $attr = array( + 'type' => 'hidden', + 'name' => 'sesskey', + 'value' => sesskey() + ); + + $html .= html_writer::empty_tag('input', $attr); + + $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'width', 'name' => 'width', 'value' => 0)); + $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'height', 'name' => 'height', 'value' => 0)); + $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'source', 'name' => 'source', 'value' => 0)); + $html .= html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'metadata', 'name' => 'metadata', 'value' => 0)); + + $html .= html_writer::start_tag('center', ['class' => 'm-t-2 m-b-1']); + + // Add submit and review buttons. + $attr = array( + 'class' => 'btn btn-primary mr-2', + 'type' => 'button', + 'name' => 'add_video', + 'id' => 'id_add_video', + 'value' => get_string('replacevideo', 'kalvidassign') + ); + + if ($disablesubmit) { + $attr['disabled'] = 'disabled'; + } + + $html .= html_writer::empty_tag('input', $attr); + + $attr = array( + 'class' => 'btn btn-secondary', + 'type' => 'submit', + 'id' => 'submit_video', + 'name' => 'submit_video', + 'disabled' => 'disabled', + 'value' => get_string('submitvideo', 'kalvidassign') + ); + + if ($disablesubmit) { + $attr['disabled'] = 'disabled'; + } + + $html .= html_writer::empty_tag('input', $attr); + + $html .= html_writer::end_tag('center'); + + $html .= html_writer::end_tag('form'); + + return $html; + } + + /** + * This function returns HTML markup to render a form and submission buttons. + * @param object $cm A course module object. + * @param int $userid The current user id. + * @param bool $disablesubmit Set to true to disable the submit button. + * @return string Returns HTML markup. + */ + public function display_instructor_buttons($cm, $userid) { + $html = ''; + + $target = new moodle_url('/mod/kalvidassign/grade_submissions.php'); + + $attr = array('method' => 'POST', 'action' => $target); + + $html .= html_writer::start_tag('form', $attr); + + $html .= html_writer::start_tag('center'); + + $attr = array('type' => 'hidden', + 'name' => 'sesskey', + 'value' => sesskey()); + $html .= html_writer::empty_tag('input', $attr); + + $attr = array('type' => 'hidden', + 'name' => 'cmid', + 'value' => $cm->id); + $html .= html_writer::empty_tag('input', $attr); + + $attr = array('class' => 'btn btn-secondary', + 'type' => 'submit', + 'name' => 'grade_submissions', + 'value' => get_string('gradesubmission', 'kalvidassign'), + 'class' => 'btn btn-secondary'); + + $html .= html_writer::empty_tag('input', $attr); + + $html .= html_writer::end_tag('center'); + + $html .= html_writer::end_tag('form'); + + return $html; + } + + /** + * This function returns HTML markup to render a the submissions table + * @param object $cm A course module object. + * @param int $groupfilter The group id to filter against. + * @param string $filter Filter users who have submitted, submitted and graded or everyone. + * @param int $perpage The number of submissions to display on a page. + * @param bool $quickgrade True if the quick grade table needs to be rendered, otherwsie false. + * @param string $tifirst The first initial of the first name. + * @param string $tilast The first initial of the last name. + * @param int $page The current page to render. + * @return string Returns HTML markup. + */ + public function display_submissions_table($cm, $groupfilter = 0, $filter = 'all', $perpage, $quickgrade = false, $tifirst = '', $tilast = '', $page = 0) { + + global $DB, $COURSE, $USER; + + // Get a list of users who have submissions and retrieve grade data for those users. + $users = kalvidassign_get_submissions($cm->instance, $filter); + + $define_columns = array('picture', 'fullname', 'selectgrade', 'submissioncomment', 'timemodified', 'timemarked', 'status', 'grade'); + + if (empty($users)) { + $users = array(); + } + + $entryids = array(); + + foreach ($users as $usersubmission) { + $entryids[$usersubmission->entry_id] = $usersubmission->entry_id; + } + + // Compare student who have submitted to the assignment with students who are + // currently enrolled in the course + $students = array_keys(kalvidassign_get_assignment_students($cm)); + $users = array_intersect(array_keys($users), $students); + + if (empty($students)) { + echo html_writer::tag('p', get_string('noenrolledstudents', 'kalvidassign')); + return; + } + + $gradinginfo = grade_get_grades($cm->course, 'mod', 'kalvidassign', $cm->instance, $users); + + $where = ''; + switch ($filter) { + case KALASSIGN_SUBMITTED: + $where = ' kvs.timemodified > 0 AND '; + break; + case KALASSIGN_REQ_GRADING: + $where = ' kvs.timemarked < kvs.timemodified AND '; + break; + } + + // Determine logic needed for groups mode + $param = array(); + $groupswhere = ''; + $groupscolumn = ''; + $groupsjoin = ''; + $groups = array(); + $mergedgroups = array(); + $groupids = ''; + $context = context_course::instance($COURSE->id); + + // Get all groups that the user belongs to, check if the user has capability to access all groups + if (!has_capability('moodle/site:accessallgroups', $context, $USER->id)) { + // It's very important we use the group limited user function here + $groups = groups_get_user_groups($COURSE->id, $USER->id); + + if (empty($groups)) { + $message = get_string('nosubmissions', 'kalvidassign'); + echo html_writer::tag('center', $message); + return; + } + // Collapse all the group ids into one array for use later. + // We have to do this here as the user groups function returns different data than the all groups function. + foreach ($groups as $group) { + foreach ($group as $value) { + $value = trim($value); + if (!in_array($value, (array)$mergedgroups)) { + $mergedgroups[] = $value; + } + } + } + } else { + // Here we can use the all groups function as it ensures non-group-bound users can see/grade all groups. + $groups = groups_get_all_groups($COURSE->id); + // Collapse all the group ids into one array for use later. + // We have to do this here (and differntly than above) as the all groups function returns different data than the user groups function. + foreach ($groups as $group) { + $mergedgroups[] = $group->id; + } + } + + // Create a comma separated list of group ids + $groupids .= implode(',', (array)$mergedgroups); + // If the user is not a member of any groups, set $groupids = 0 to avoid issues. + $groupids = $groupids ? $groupids : 0; + + // Ignore all this if there are no course groups + if (groups_get_all_groups($COURSE->id)) { + switch (groups_get_activity_groupmode($cm)) { + case NOGROUPS: + // No groups, do nothing if all groups selected. + // If non-group limited, user can select and limit by group. + if (0 != $groupfilter) { + $groupscolumn = ', gm.groupid '; + $groupsjoin = ' RIGHT JOIN {groups_members} gm ON gm.userid = u.id RIGHT JOIN {groups} g ON g.id = gm.groupid '; + $param['courseid'] = $cm->course; + $groupswhere .= ' AND g.courseid = :courseid '; + $param['groupid'] = $groupfilter; + $groupswhere .= ' AND gm.groupid = :groupid '; + } + break; + case SEPARATEGROUPS: + // If separate groups, but displaying all users then we must display only users + // who are in the same group as the current user. Otherwise, show only groupmembers + // of the selected group. + if (0 == $groupfilter) { + $groupscolumn = ', gm.groupid '; + $groupsjoin = ' INNER JOIN {groups_members} gm ON gm.userid = u.id INNER JOIN {groups} g ON g.id = gm.groupid '; + $param['courseid'] = $cm->course; + $groupswhere .= ' AND g.courseid = :courseid '; + $param['groupid'] = $groupfilter; + $groupswhere .= ' AND g.id IN ('.$groupids.') '; + } else { + $groupscolumn = ', gm.groupid '; + $groupsjoin = ' INNER JOIN {groups_members} gm ON gm.userid = u.id INNER JOIN {groups} g ON g.id = gm.groupid '; + $param['courseid'] = $cm->course; + $groupswhere .= ' AND g.courseid = :courseid '; + $param['groupid'] = $groupfilter; + $groupswhere .= ' AND g.id IN ('.$groupids.') AND g.id = :groupid '; + + } + break; + + case VISIBLEGROUPS: + // if visible groups but displaying a specific group then we must display users within + // that group, if displaying all groups then display all users in the course + if (0 != $groupfilter) { + + $groupscolumn = ', gm.groupid '; + $groupsjoin = ' RIGHT JOIN {groups_members} gm ON gm.userid = u.id RIGHT JOIN {groups} g ON g.id = gm.groupid '; + + $param['courseid'] = $cm->course; + $groupswhere .= ' AND g.courseid = :courseid '; + + $param['groupid'] = $groupfilter; + $groupswhere .= ' AND gm.groupid = :groupid '; + + } + break; + } + } + + $table = new submissions_table('kal_vid_submit_table', $cm, $gradinginfo, $quickgrade, $tifirst, $tilast, $page); + + // In order for the sortable first and last names to work. User ID has to be the first column returned and must be + // returned as id. Otherwise the table will display links to user profiles that are incorrect or do not exist + $columns = user_picture::fields('u').', kvs.id AS submitid, '; + $columns .= ' kvs.grade, kvs.submissioncomment, kvs.timemodified, kvs.entry_id, kvs.source, kvs.width, kvs.height, kvs.timemarked, '; + $columns .= 'kvs.metadata, 1 AS status, 1 AS selectgrade'.$groupscolumn; + $where .= ' u.deleted = 0 AND u.id IN ('.implode(',', $students).') '.$groupswhere; + + $param['instanceid'] = $cm->instance; + $from = "{user} u LEFT JOIN {kalvidassign_submission} kvs ON kvs.userid = u.id AND kvs.vidassignid = :instanceid ".$groupsjoin; + + $baseurl = new moodle_url('/mod/kalvidassign/grade_submissions.php', array('cmid' => $cm->id)); + + $col1 = get_string('fullname', 'kalvidassign'); + $col2 = get_string('grade', 'kalvidassign'); + $col3 = get_string('submissioncomment', 'kalvidassign'); + $col4 = get_string('timemodified', 'kalvidassign'); + $col5 = get_string('grademodified', 'kalvidassign'); + $col6 = get_string('status', 'kalvidassign'); + $col7 = get_string('finalgrade', 'kalvidassign'); + + $table->set_sql($columns, $from, $where, $param); + $table->define_baseurl($baseurl); + $table->collapsible(true); + + $table->define_columns($define_columns); + $table->define_headers(array('', $col1, $col2, $col3, $col4, $col5, $col6, $col7)); + + echo html_writer::start_tag('center'); + + $attributes = array('action' => new moodle_url('grade_submissions.php'), 'id' => 'fastgrade', 'method' => 'post'); + echo html_writer::start_tag('form', $attributes); + + $attributes = array('type' => 'hidden', 'name' => 'cmid', 'value' => $cm->id); + echo html_writer::empty_tag('input', $attributes); + + $attributes['name'] = 'mode'; + $attributes['value'] = 'fastgrade'; + + echo html_writer::empty_tag('input', $attributes); + + $attributes['name'] = 'sesskey'; + $attributes['value'] = sesskey(); + + echo html_writer::empty_tag('input', $attributes); + + $table->out($perpage, true); + + if ($quickgrade) { + $attributes = array('type' => 'submit', 'name' => 'save_feedback', 'value' => get_string('savefeedback', 'kalvidassign')); + + echo html_writer::empty_tag('input', $attributes); + } + + echo html_writer::end_tag('form'); + + echo html_writer::end_tag('center'); + } + + /** + * Displays the assignments listing table. + * + * @param object $course The course odject. + */ + public function display_kalvidassignments_table($course) { + global $CFG, $DB, $USER; + + echo html_writer::start_tag('center'); + + $strplural = get_string('modulenameplural', 'kalvidassign'); + + if (!$cms = get_coursemodules_in_course('kalvidassign', $course->id, 'm.timedue')) { + echo get_string('noassignments', 'mod_kalvidassign'); + echo $this->output->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id); + } + + $strsectionname = get_string('sectionname', 'format_'.$course->format); + $usesections = course_format_uses_sections($course->format); + $modinfo = get_fast_modinfo($course); + + if ($usesections) { + $sections = $modinfo->get_section_info_all(); + } + $courseindexsummary = new kalvidassign_course_index_summary($usesections, $strsectionname); + + $timenow = time(); + $currentsection = ''; + $assignmentcount = 0; + + foreach ($modinfo->instances['kalvidassign'] as $cm) { + if (!$cm->uservisible) { + continue; + } + + $assignmentcount++; + $timedue = $cms[$cm->id]->timedue; + + $sectionname = ''; + if ($usesections && $cm->sectionnum) { + $sectionname = get_section_name($course, $sections[$cm->sectionnum]); + } + + $submitted = ''; + $context = context_module::instance($cm->id); + + if (has_capability('mod/kalvidassign:gradesubmission', $context)) { + $submitted = $DB->count_records('kalvidassign_submission', array('vidassignid' => $cm->instance)); + } else if (has_capability('mod/kalvidassign:submit', $context)) { + if ($DB->count_records('kalvidassign_submission', array('vidassignid' => $cm->instance, 'userid' => $USER->id)) > 0) { + $submitted = get_string('submitted', 'mod_kalvidassign'); + } else { + $submitted = get_string('nosubmission', 'mod_kalvidassign'); + } + } + + $gradinginfo = grade_get_grades($course->id, 'mod', 'kalvidassign', $cm->instance, $USER->id); + if (isset($gradinginfo->items[0]->grades[$USER->id]) && !$gradinginfo->items[0]->grades[$USER->id]->hidden ) { + $grade = $gradinginfo->items[0]->grades[$USER->id]->str_grade; + } else { + $grade = '-'; + } + + $courseindexsummary->add_assign_info($cm->id, $cm->name, $sectionname, $timedue, $submitted, $grade); + } + + if ($assignmentcount > 0) { + $pagerenderer = $this->page->get_renderer('mod_kalvidassign'); + echo $pagerenderer->render($courseindexsummary); + } + + echo html_writer::end_tag('center'); + } + + /** + * This function displays HTML markup needed by the ltipanel YUI module to display a popup window containing the LTI launch. + * @param object $submission A Kaltura video assignment video submission table object. + * @param int $courseid The course id. + * @param int $cmid The ccourse module id. + * @return string HTML markup. + */ + public function display_video_container_markup($submission, $courseid, $cmid) { + $source = new moodle_url('/local/kaltura/pix/vidThumb.png'); + $alt = get_string('video_thumbnail', 'mod_kalvidassign'); + $title = get_string('video_thumbnail', 'mod_kalvidassign'); + $url = null; + + $attr = array( + 'id' => 'video_thumbnail', + 'src' => $source->out(), + 'alt' => $alt, + 'title' => $title + ); + + // If the submission object contains a source URL then display the video as part of an LTI launch. + if (!empty($submission->source)) { + $attr['style'] = 'display: none'; + + $params = array( + 'courseid' => $courseid, + 'height' => $submission->height, + 'width' => $submission->width, + 'withblocks' => 0, + 'source' => local_kaltura_add_kaf_uri_token($submission->source), + 'cmid' => $cmid + ); + $url = new moodle_url('/mod/kalvidassign/lti_launch.php', $params); + } + + $output = html_writer::empty_tag('img', $attr); + + $params = array( + 'id' => 'contentframe', + 'class' => 'kaltura-player-iframe', + 'src' => ($url instanceof moodle_url) ? $url->out(false) : '', + 'allowfullscreen' => 'true', + 'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;', + 'height' => '100%', + 'width' => !empty($submission->width) ? $submission->width : '' + ); + + if (empty($submission->source)) { + $params['style'] = 'display: none'; + } + + $iframe = html_writer::tag('iframe', '', $params); + $iframeContainer = html_writer::tag('div', $iframe, array( + 'class' => 'kaltura-player-container' + )); + + $output .= $iframeContainer; + + return $output; + } + + /** + * Display the feedback to the student + * + * This default method prints the teacher picture and name, date when marked, + * grade and teacher submissioncomment. + * + * @global object + * @global object + * @global object + * @param object $submission The submission object or NULL in which case it will be loaded + * + * TODO: correct documentation for this function + */ + public function display_grade_feedback($kalvidassign, $context) { + global $USER, $CFG, $DB; + + require_once($CFG->libdir.'/gradelib.php'); + + // Check if the user is enrolled to the coruse and can submit to the assignment + if (!is_enrolled($context, $USER, 'mod/kalvidassign:submit')) { + // can not submit assignments -> no feedback + return; + } + + // Get the user's submission obj + $gradinginfo = grade_get_grades($kalvidassign->course, 'mod', 'kalvidassign', $kalvidassign->id, $USER->id); + + $item = $gradinginfo->items[0]; + $grade = $item->grades[$USER->id]; + + // Hidden or error. + if ($grade->hidden or $grade->grade === false) { + return; + } + + // Nothing to show yet. + if ($grade->grade === null and empty($grade->str_feedback)) { + return; + } + + $gradedate = $grade->dategraded; + $gradeby = $grade->usermodified; + + // We need the teacher info + if (!$teacher = $DB->get_record('user', array('id'=>$gradeby))) { + throw new \moodle_exception('cannotfindteacher'); + } + + // Print the feedback + echo $this->output->heading(get_string('feedbackfromteacher', 'kalvidassign', fullname($teacher))); + + echo ''; + + echo ''; + echo ''; + echo ''; + echo ''; + + echo ''; + echo ''; + echo ''; + + echo ''; + } + + /** + * Render a course index summary. + * + * @param kalvidassign_course_index_summary $indexsummary Structure for index summary. + * @return string HTML for assignments summary table + */ + public function render_kalvidassign_course_index_summary(kalvidassign_course_index_summary $indexsummary) { + $strplural = get_string('modulenameplural', 'kalvidassign'); + $strsectionname = $indexsummary->courseformatname; + $strduedate = get_string('duedate', 'kalvidassign'); + $strsubmission = get_string('submission', 'kalvidassign'); + $strgrade = get_string('grade'); + + $table = new html_table(); + if ($indexsummary->usesections) { + $table->head = array ($strsectionname, $strplural, $strduedate, $strsubmission, $strgrade); + $table->align = array ('left', 'left', 'center', 'right', 'right'); + } else { + $table->head = array ($strplural, $strduedate, $strsubmission, $strgrade); + $table->align = array ('left', 'left', 'center', 'right'); + } + $table->data = array(); + + $currentsection = ''; + foreach ($indexsummary->assignments as $info) { + $params = array('id' => $info['cmid']); + $link = html_writer::link(new moodle_url('/mod/kalvidassign/view.php', $params), $info['cmname']); + $due = $info['timedue'] ? userdate($info['timedue']) : '-'; + + $printsection = ''; + if ($indexsummary->usesections) { + if ($info['sectionname'] !== $currentsection) { + if ($info['sectionname']) { + $printsection = $info['sectionname']; + } + if ($currentsection !== '') { + $table->data[] = 'hr'; + } + $currentsection = $info['sectionname']; + } + } + + if ($indexsummary->usesections) { + $row = array($printsection, $link, $due, $info['submissioninfo'], $info['gradeinfo']); + } else { + $row = array($link, $due, $info['submissioninfo'], $info['gradeinfo']); + } + $table->data[] = $row; + } + + return html_writer::table($table); + } +} diff --git a/mod/kalvidassign/single_submission.php b/mod/kalvidassign/single_submission.php new file mode 100644 index 0000000000000..b646e6b0f4557 --- /dev/null +++ b/mod/kalvidassign/single_submission.php @@ -0,0 +1,227 @@ +. + +/** + * Kaltura video assignment single submission script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(__FILE__).'/lib.php'); +require_once(dirname(__FILE__).'/renderer.php'); +require_once(dirname(__FILE__).'/locallib.php'); +require_once(dirname(__FILE__).'/single_submission_form.php'); + +$id = required_param('cmid', PARAM_INT); +$userid = required_param('userid', PARAM_INT); +$tifirst = optional_param('tifirst', '', PARAM_TEXT); +$tilast = optional_param('tilast', '', PARAM_TEXT); +$page = optional_param('page', 0, PARAM_INT); + + +list($cm, $course, $kalvidassignobj) = kalvidassign_validate_cmid($id); + +require_login($course->id, false, $cm); + +if (!confirm_sesskey()) { + throw new \moodle_exception('confirmsesskeybad', 'error'); +} + +global $CFG, $PAGE, $OUTPUT, $USER; + +$url = new moodle_url('/mod/kalvidassign/single_submission.php'); +$url->params(array('cmid' => $id, 'userid' => $userid)); + +$context = context_module::instance($cm->id); + +$PAGE->set_url($url); +$PAGE->set_title(format_string($kalvidassignobj->name)); +$PAGE->set_heading($course->fullname); +$PAGE->set_context($context); + +$previousurl = new moodle_url('/mod/kalvidassign/grade_submissions.php', array('cmid' => $cm->id, 'tifirst' => $tifirst, 'tilast' => $tilast, 'page' => $page)); +$prevousurlstring = get_string('singlesubmissionheader', 'kalvidassign'); +$PAGE->navbar->add($prevousurlstring, $previousurl); +$PAGE->requires->css('/local/kaltura/styles.css'); + +require_capability('mod/kalvidassign:gradesubmission', $context); + +$event = \mod_kalvidassign\event\single_submission_page_viewed::create(array( + 'objectid' => $kalvidassignobj->id, + 'context' => context_module::instance($cm->id) +)); +$event->trigger(); + +// Get a single submission record +$submission = kalvidassign_get_submission($cm->instance, $userid); + +// Get the submission user and the time they submitted the video +$param = array('id' => $userid); +$user = $DB->get_record('user', $param); + +$submissionuserpic = $OUTPUT->user_picture($user); +$submissionmodified = ' - '; +$datestringlate = ' - '; +$datestring = ' - '; + +$submissionuserinfo = fullname($user); + +// Get grading information +$gradinginfo = grade_get_grades($cm->course, 'mod', 'kalvidassign', $cm->instance, array($userid)); +$gradingdisabled = $gradinginfo->items[0]->grades[$userid]->locked || $gradinginfo->items[0]->grades[$userid]->overridden; + +// Get marking teacher information and the time the submission was marked +$teacher = ''; +if (!empty($submission)) { + $datestringlate = kalvidassign_display_lateness($submission->timemodified, $kalvidassignobj->timedue); + $submissionmodified = userdate($submission->timemodified); + $datestring = userdate($submission->timemarked)."  (".format_time(time() - $submission->timemarked).")"; + + $submissionuserinfo .= '
'.$submissionmodified.$datestringlate; + + $param = array('id' => $submission->teacher); + $teacher = $DB->get_record('user', $param); +} + +$markingteacherpic = ''; +$markingtreacherinfo = ''; + +if (!empty($teacher)) { + $markingteacherpic = $OUTPUT->user_picture($teacher); + $markingtreacherinfo = fullname($teacher).'
'.$datestring; +} + +// Setup form data +$formdata = new stdClass(); +$formdata->submissionuserpic = $submissionuserpic; +$formdata->submissionuserinfo = $submissionuserinfo; +$formdata->markingteacherpic = $markingteacherpic; +$formdata->markingteacherinfo = $markingtreacherinfo; +$formdata->grading_info = $gradinginfo; +$formdata->gradingdisabled = $gradingdisabled; +$formdata->cm = $cm; +$formdata->context = $context; +$formdata->cminstance = $kalvidassignobj; +$formdata->submission = $submission; +$formdata->userid = $userid; +$formdata->enableoutcomes = $CFG->enableoutcomes; +$formdata->submissioncomment_editor = array('text' => $submission->submissioncomment, 'format' => FORMAT_HTML); +$formdata->tifirst = $tifirst; +$formdata->tilast = $tilast; +$formdata->page = $page; + +$submissionform = new kalvidassign_singlesubmission_form(null, $formdata); + +if ($submissionform->is_cancelled()) { + redirect($previousurl); +} else if ($submitted_data = $submissionform->get_data()) { + + if (!isset($submitted_data->cancel) && isset($submitted_data->xgrade) && isset($submitted_data->submissioncomment_editor)) { + + // Flag used when an instructor is about to grade a user who does not have + // a submittion (see KALDEV-126) + $updategrade = true; + + if ($submission) { + + $submissionchanged = strcmp($submission->submissioncomment, $submitted_data->submissioncomment_editor['text']); + if ($submission->grade == $submitted_data->xgrade && !$submissionchanged) { + $updategrade = false; + } + if ($submissionchanged || $updategrade) { + $submission->grade = $submitted_data->xgrade; + $submission->submissioncomment = $submitted_data->submissioncomment_editor['text']; + $submission->format = $submitted_data->submissioncomment_editor['format']; + $submission->timemarked = time(); + $submission->teacher = $USER->id; + $DB->update_record('kalvidassign_submission', $submission); + } + } else { + + // Check for unchanged values + if ('-1' == $submitted_data->xgrade && empty($submitted_data->submissioncomment_editor['text'])) { + + $updategrade = false; + } else { + + $submission = new stdClass(); + $submission->vidassignid = $cm->instance; + $submission->userid = $userid; + $submission->grade = $submitted_data->xgrade; + $submission->submissioncomment = $submitted_data->submissioncomment_editor['text']; + $submission->format = $submitted_data->submissioncomment_editor['format']; + $submission->timemarked = time(); + $submission->teacher = $USER->id; + + $DB->insert_record('kalvidassign_submission', $submission); + } + } + + if ($updategrade) { + $kalvidassignobj->cmidnumber = $cm->idnumber; + + $gradeobj = kalvidassign_get_submission_grade_object($kalvidassignobj->id, $userid); + + kalvidassign_grade_item_update($kalvidassignobj, $gradeobj); + + // Add to log. + $event = \mod_kalvidassign\event\grades_updated::create(array( + 'context' => context_module::instance($cm->id), + )); + $event->trigger(); + } + + // Handle outcome data + if (!empty($CFG->enableoutcomes)) { + require_once($CFG->libdir.'/gradelib.php'); + + $data = array(); + $gradinginfo = grade_get_grades($course->id, 'mod', 'kalvidassign', $kalvidassignobj->id, $userid); + + if (!empty($gradinginfo->outcomes)) { + foreach ($gradinginfo->outcomes as $n => $old) { + $name = 'outcome_'.$n; + if (isset($submitted_data->{$name}[$userid]) and + $old->grades[$userid]->grade != $submitted_data->{$name}[$userid]) { + + $data[$n] = $submitted_data->{$name}[$userid]; + } + } + } + + if (count($data) > 0) { + grade_update_outcomes('mod/kalvidassign', $course->id, 'mod', 'kalvidassign', $kalvidassignobj->id, $userid, $data); + } + } + + } + + redirect($previousurl); + +} + +$pageheading = get_string('gradesubmission', 'kalvidassign'); + +echo $OUTPUT->header(); +echo $OUTPUT->heading($pageheading.': '.fullname($user)); + +$submissionform->set_data($formdata); + +$submissionform->display(); + +echo $OUTPUT->footer(); diff --git a/mod/kalvidassign/single_submission_form.php b/mod/kalvidassign/single_submission_form.php new file mode 100644 index 0000000000000..8a9afe72834be --- /dev/null +++ b/mod/kalvidassign/single_submission_form.php @@ -0,0 +1,225 @@ +. + +/** + * Kaltura video assignment single submission form. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +require_once(dirname(dirname(dirname(__FILE__))).'/course/moodleform_mod.php'); + +class kalvidassign_singlesubmission_form extends moodleform { + + /** + * This function defines the forums elments that are to be displayed + */ + public function definition() { + global $CFG, $PAGE; + + $mform =& $this->_form; + + $cm = $this->_customdata->cm; + $userid = $this->_customdata->userid; + + $mform->addElement('hidden', 'cmid', $cm->id); + $mform->setType('cmid', PARAM_INT); + $mform->addelement('hidden', 'userid', $userid); + $mform->setType('userid', PARAM_INT); + $mform->addElement('hidden', 'tifirst', $this->_customdata->tifirst); + $mform->setType('tifirst', PARAM_TEXT); + $mform->addElement('hidden', 'tilast', $this->_customdata->tilast); + $mform->setType('tilast', PARAM_TEXT); + $mform->addElement('hidden', 'page', $this->_customdata->page); + $mform->setType('page', PARAM_INT); + + /* Submission section */ + $mform->addElement('header', 'single_submission_1', get_string('submission', 'kalvidassign')); + + $mform->addelement('static', 'submittinguser', $this->_customdata->submissionuserpic, $this->_customdata->submissionuserinfo); + + /* Video preview */ + $mform->addElement('header', 'single_submission_2', get_string('previewvideo', 'kalvidassign')); + + $submission = $this->_customdata->submission; + $gradinginfo = $this->_customdata->grading_info; + $entryobject = ''; + $timemodified = ''; + + if (!empty($submission->entry_id) && !empty($submission->source)) { + $attr = array( + 'src' => $this->_generateLtiLaunchLink($submission->source, $submission), + 'height' => $submission->height, + 'width' => $submission->width, + 'allowfullscreen' => 'true', + 'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;', + ); + $mform->addElement('html', html_writer::tag('iframe', '', $attr)); + } + + /* Grades section */ + $mform->addElement('header', 'single_submission_3', get_string('grades', 'kalvidassign')); + + $attributes = array(); + + if ($this->_customdata->gradingdisabled || $this->_customdata->gradingdisabled) { + $attributes['disabled'] = 'disabled'; + } + + $grademenu = make_grades_menu($this->_customdata->cminstance->grade); + $grademenu['-1'] = get_string('nograde'); + + $mform->addElement('select', 'xgrade', get_string('grade').':', $grademenu, $attributes); + + if (isset($submission->grade)) { + $mform->setDefault('xgrade', $this->_customdata->submission->grade ); + } else { + $mform->setDefault('xgrade', '-1' ); + } + + $mform->setType('xgrade', PARAM_INT); + + if (!empty($this->_customdata->enableoutcomes) && !empty($gradinginfo)) { + + foreach ($gradinginfo->outcomes as $n => $outcome) { + + $options = make_grades_menu(-$outcome->scaleid); + + if (array_key_exists($this->_customdata->userid, $outcome->grades) && + $outcome->grades[$this->_customdata->userid]->locked) { + + $options[0] = get_string('nooutcome', 'grades'); + echo $options[$outcome->grades[$this->_customdata->userid]->grade]; + + } else { + + $options[''] = get_string('nooutcome', 'grades'); + $attributes = array('id' => 'menuoutcome_'.$n ); + $mform->addElement('select', 'outcome_'.$n.'['.$this->_customdata->userid.']', $outcome->name.':', $options, $attributes ); + $mform->setType('outcome_'.$n.'['.$this->_customdata->userid.']', PARAM_INT); + + if (array_key_exists($this->_customdata->userid, $outcome->grades)) { + $mform->setDefault('outcome_'.$n.'['.$this->_customdata->userid.']', $outcome->grades[$this->_customdata->userid]->grade ); + } + } + } + } + + if (has_capability('gradereport/grader:view', $this->_customdata->context) && has_capability('moodle/grade:viewall', $this->_customdata->context)) { + + if (empty($gradinginfo) || !array_key_exists($this->_customdata->userid, $gradinginfo->items[0]->grades)) { + + $grade = ' - '; + + } else if (0 != strcmp('-', $gradinginfo->items[0]->grades[$this->_customdata->userid]->str_grade)) { + + $grade = ''; + $grade .= $this->_customdata->grading_info->items[0]->grades[$this->_customdata->userid]->str_grade.''; + } else { + + $grade = $this->_customdata->grading_info->items[0]->grades[$this->_customdata->userid]->str_grade; + } + + } else { + + $grade = $this->_customdata->grading_info->items[0]->grades[$this->_customdata->userid]->str_grade; + + } + + $mform->addElement('static', 'finalgrade', get_string('currentgrade', 'kalvidassign').':', $grade); + $mform->setType('finalgrade', PARAM_INT); + + /* Feedback section */ + $mform->addElement('header', 'single_submission_4', get_string('feedback', 'kalvidassign')); + + if (!empty($this->_customdata->gradingdisabled)) { + + if (array_key_exists($this->_customdata->userid, $gradinginfo->items[0]->grades)) { + $mform->addElement('static', 'disabledfeedback', ' ', $gradinginfo->items[0]->grades[$this->_customdata->userid]->str_feedback ); + } else { + $mform->addElement('static', 'disabledfeedback', ' ', '' ); + } + + } else { + + $mform->addElement('editor', 'submissioncomment_editor', get_string('feedback', 'kalvidassign').':', null, $this->get_editor_options() ); + $mform->setType('submissioncomment_editor', PARAM_RAW); + + } + + /* Marked section */ + $mform->addElement('header', 'single_submission_5', get_string('lastgrade', 'kalvidassign')); + + $mform->addElement('static', 'markingteacher', $this->_customdata->markingteacherpic, $this->_customdata->markingteacherinfo); + + $this->add_action_buttons(); + } + + /** + * This function sets the text editor format. + * @param object|array $data object or array of default values + * @return void + */ + public function set_data($data) { + + if (!isset($data->submission->format)) { + $data->textformat = FORMAT_HTML; + } else { + $data->textformat = $data->submission->format; + } + + $editoroptions = $this->get_editor_options(); + + return parent::set_data($data); + + } + + /** + * This function gets the editor options. + * @return array An array of editor options. + */ + protected function get_editor_options() { + $editoroptions = array(); + $editoroptions['component'] = 'mod_kalvidassign'; + $editoroptions['noclean'] = false; + $editoroptions['maxfiles'] = 0; + $editoroptions['context'] = $this->_customdata->context; + + return $editoroptions; + } + + private function _generateLtiLaunchLink($source, $data) + { + $cmid = $this->_customdata->cm->id; + $courseId = $this->_customdata->cm->course; + + $width = 485; + $height = 450; + if(isset($data->height) && isset($data->width)) + { + $width = $data->width; + $height = $data->height; + } + + $target = new moodle_url('/mod/kalvidassign/lti_launch_grade.php?cmid='.$cmid.'&source='.urlencode($source).'&height='.$height.'&width='.$width.'&courseid='.$courseId); + return $target; + } +} diff --git a/mod/kalvidassign/styles.css b/mod/kalvidassign/styles.css new file mode 100644 index 0000000000000..ebfa2bc7a4b32 --- /dev/null +++ b/mod/kalvidassign/styles.css @@ -0,0 +1,50 @@ +/* stylelint-disable declaration-colon-space-after */ + +#page-mod-kalvidassign-single_submission #page #page-header .navbar { + display:none; +} + + +#page-mod-kalvidassign-single_submission #page #page-content { + min-width: 500px; +} + + +#page-mod-kalvidassign-view .feedback { + border: 1px solid #DDDDDD; + margin:10px auto; +} + +#page-mod-kalvidassign-view .feedback .grade { + text-align: right; + font-weight: bold; +} + +#page-mod-kalvidassign-view .feedback .topic { + border-color: #DDDDDD; + border-style: solid; + border-width: 0 0 1px; + padding: 4px; +} + +#page-mod-kalvidassign-view .feedback .topic .fullname { + font-weight: bold; +} + +#slider_border { + width: 10%; + height: 18px; + border: 1px solid #000000; + overflow: hidden; +} + +#id_add_video { + float: none; +} + +#video_thumbnail { + display: block; + margin-left: auto; + margin-right: auto; + margin-bottom: 5px; +} \ No newline at end of file diff --git a/mod/kalvidassign/submission.php b/mod/kalvidassign/submission.php new file mode 100644 index 0000000000000..96808e3c237ed --- /dev/null +++ b/mod/kalvidassign/submission.php @@ -0,0 +1,164 @@ +. + +/** + * Kaltura video assignment submission script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(__FILE__).'/locallib.php'); + +if (!confirm_sesskey()) { + throw new \moodle_exception('confirmsesskeybad', 'error'); +} + +$entryid = required_param('entry_id', PARAM_TEXT); +$source = required_param('source', PARAM_URL); +$cmid = required_param('cmid', PARAM_INT); +$width = required_param('width', PARAM_TEXT); +$height = required_param('height', PARAM_TEXT); +$metadata = required_param('metadata', PARAM_TEXT); + +global $USER, $OUTPUT, $DB, $PAGE; + +$source = local_kaltura_build_kaf_uri($source); + +if (! $cm = get_coursemodule_from_id('kalvidassign', $cmid)) { + throw new \moodle_exception('invalidcoursemodule'); +} + +if (! $course = $DB->get_record('course', array('id' => $cm->course))) { + throw new \moodle_exception('coursemisconf'); +} + +if (! $kalvidassignobj = $DB->get_record('kalvidassign', array('id' => $cm->instance))) { + throw new \moodle_exception('invalidid', 'kalvidassign'); +} + +require_course_login($course->id, true, $cm); + +$PAGE->set_url('/mod/kalvidassign/view.php', array('id' => $course->id)); +$PAGE->set_title(format_string($kalvidassignobj->name)); +$PAGE->set_heading($course->fullname); + + +if (kalvidassign_assignemnt_submission_expired($kalvidassignobj)) { + throw new \moodle_exception('assignmentexpired', 'kalvidassign', 'course/view.php?id='.$course->id); +} + +echo $OUTPUT->header(); + +if (empty($entryid)) { + throw new \moodle_exception('emptyentryid', 'kalvidassign', new moodle_url('/mod/kalvidassign/view.php', array('id' => $cm->id))); +} + +// If the entry_id field is not empty but the source field is empty, then the data for this activity has not yet been migrated. +if (empty($source)) { + throw new \moodle_exception('activity_not_migrated', 'kalvidassign', new moodle_url('/mod/kalvidassign/view.php', array('id' => $cm->id))); +} + +$param = array('vidassignid' => $kalvidassignobj->id, 'userid' => $USER->id); +$submission = $DB->get_record('kalvidassign_submission', $param); + +$time = time(); +$url = new moodle_url('/mod/kalvidassign/view.php', array('id' => $cm->id)); + +if ($submission) { + $submission->entry_id = $entryid; + $submission->source = $source; + $submission->width = $width; + $submission->height = $height; + $submission->timemodified = $time; + $submission->metadata = $metadata; + + if (0 == $submission->timecreated) { + $submission->timecreated = $time; + } + + if ($DB->update_record('kalvidassign_submission', $submission)) { + + $message = get_string('assignmentsubmitted', 'kalvidassign'); + $continue = get_string('continue'); + + echo $OUTPUT->notification($message, 'success'); + + echo html_writer::start_tag('center'); + + echo $OUTPUT->single_button($url, $continue, 'post'); + echo html_writer::end_tag('center'); + + $event = \mod_kalvidassign\event\assignment_submitted::create(array( + 'objectid' => $kalvidassignobj->id, + 'context' => context_module::instance($cm->id) + )); + $event->trigger(); + } else { + notice(get_string('failedtoinsertsubmission', 'kalvidassign'), $url, $course); + } + +} else { + $submission = new stdClass(); + $submission->entry_id = $entryid; + $submission->userid = $USER->id; + $submission->vidassignid = $kalvidassignobj->id; + $submission->grade = -1; + $submission->source = $source; + $submission->width = $width; + $submission->height = $height; + $submission->metadata = $metadata; + $submission->timecreated = $time; + $submission->timemodified = $time; + + if ($DB->insert_record('kalvidassign_submission', $submission)) { + + $message = get_string('assignmentsubmitted', 'kalvidassign'); + $continue = get_string('continue'); + + echo $OUTPUT->notification($message, 'success'); + + echo html_writer::start_tag('center'); + + echo $OUTPUT->single_button($url, $continue, 'post'); + echo html_writer::end_tag('center'); + + $event = \mod_kalvidassign\event\assignment_submitted::create(array( + 'objectid' => $kalvidassignobj->id, + 'context' => context_module::instance($cm->id) + )); + $event->trigger(); + + // update completionsubmit state if enabled on kalvidassign + $completion = new completion_info($course); + if ($completion->is_enabled($cm) && $kalvidassignobj->completionsubmit) { + $completion->update_state($cm, COMPLETION_COMPLETE); + } + } else { + notice(get_string('failedtoinsertsubmission', 'kalvidassign'), $url, $course); + } + +} + +$context = $PAGE->context; + +// Email an alert to the teacher +if ($kalvidassignobj->emailteachers) { + kalvidassign_email_teachers($cm, $kalvidassignobj->name, $submission, $context); +} + +echo $OUTPUT->footer(); diff --git a/mod/kalvidassign/version.php b/mod/kalvidassign/version.php new file mode 100644 index 0000000000000..ed72c4394d619 --- /dev/null +++ b/mod/kalvidassign/version.php @@ -0,0 +1,36 @@ +. + +/** + * Kaltura version script + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +$plugin->version = 2024100702; +$plugin->component = 'mod_kalvidassign'; +$plugin->release = 'Kaltura release 4.5.1'; +$plugin->requires = 2024042200; +$plugin->cron = 0; +$plugin->maturity = MATURITY_STABLE; +$plugin->dependencies = array( + 'local_kaltura' => 2024100702, +); diff --git a/mod/kalvidassign/view.php b/mod/kalvidassign/view.php new file mode 100644 index 0000000000000..d8de3bb906c78 --- /dev/null +++ b/mod/kalvidassign/view.php @@ -0,0 +1,141 @@ +. + +/** + * Kaltura video assignment view script. + * + * @package mod_kalvidassign + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); +require_once(dirname(__FILE__).'/locallib.php'); + +$id = optional_param('id', 0, PARAM_INT); + +// Retrieve module instance. +if (empty($id)) { + throw new \moodle_exception('invalidid', 'kalvidassign'); +} + +if (!empty($id)) { + list($cm, $course, $kalvidassign) = kalvidassign_validate_cmid($id); +} + +require_course_login($course->id, true, $cm); + +global $SESSION, $CFG; + +$PAGE->set_url('/mod/kalvidassign/view.php', array('id' => $id)); +$PAGE->set_title(format_string($kalvidassign->name)); +$PAGE->set_heading($course->fullname); +$pageclass = 'kaltura-kalvidassign-body'; +$PAGE->add_body_class($pageclass); + +$context = context_module::instance($cm->id); + +$event = \mod_kalvidassign\event\assignment_details_viewed::create(array( + 'objectid' => $kalvidassign->id, + 'context' => context_module::instance($cm->id) + )); +$event->trigger(); + +// Update 'viewed' state if required by completion system +$completion = new completion_info($course); +$completion->set_module_viewed($cm); + +$PAGE->requires->css('/mod/kalvidassign/styles.css'); +$PAGE->requires->css('/local/kaltura/styles.css'); +echo $OUTPUT->header(); + +$renderer = $PAGE->get_renderer('mod_kalvidassign'); + +echo $OUTPUT->box_start('generalbox'); + +echo $renderer->display_mod_info($kalvidassign, $context); + +echo $OUTPUT->box_end(); + +$disabled = false; +$url = ''; +$width = 0; +$height = 0; + +// Here we can assume that the user has permission to submit no matter what their role is. +// The old method denied module-level locally assigned instructors the right to submit items, +// even if they were also students within the course. +$param = array('vidassignid' => $kalvidassign->id, 'userid' => $USER->id); +$submission = $DB->get_record('kalvidassign_submission', $param); + +echo $renderer->display_video_container_markup($submission, $course->id, $cm->id); + +if (kalvidassign_assignemnt_submission_expired($kalvidassign)) { + $disabled = true; +} + +if (empty($submission->entry_id) && empty($submission->timecreated)) { + echo $renderer->display_student_submit_buttons($cm, $USER->id, $disabled); + echo $renderer->display_grade_feedback($kalvidassign, $context); +} else { + if ($disabled || !$kalvidassign->resubmit) { + $disabled = true; + } + echo $renderer->display_student_resubmit_buttons($cm, $USER->id, $disabled); + echo $renderer->display_grade_feedback($kalvidassign, $context); +} + +$params = array( + 'withblocks' => 0, + 'courseid' => $course->id, + 'width' => KALTURA_PANEL_WIDTH, + 'height' => KALTURA_PANEL_HEIGHT, + 'cmid' => $cm->id +); + +$url = new moodle_url('/mod/kalvidassign/lti_launch.php', $params); + +$params = array( + 'addvidbtnid' => 'id_add_video', + 'ltilaunchurl' => $url->out(false), + 'height' => KALTURA_PANEL_HEIGHT, + 'width' => KALTURA_PANEL_WIDTH +); + +$PAGE->requires->yui_module('moodle-local_kaltura-ltipanel', 'M.local_kaltura.initmediaassignment', array($params), null, true); + +// Require a YUI module to make the object tag be as large as possible. +$params = array( + 'bodyclass' => $pageclass, + 'lastheight' => null, + 'padding' => 15 +); + +if(isset($submission->width) && isset($submission->height)) +{ + $params['width'] = $submission->width; + $params['height'] = $submission->height; +} + +$PAGE->requires->yui_module('moodle-local_kaltura-lticontainer', 'M.local_kaltura.init', array($params), null, true); +$PAGE->requires->string_for_js('replacevideo', 'kalvidassign'); + +// Limit the instructor buttons to ONLY those users with the role appropriate for them. +if (has_capability('mod/kalvidassign:gradesubmission', $context)) { + echo $renderer->display_instructor_buttons($cm, $USER->id); +} + +echo $OUTPUT->footer(); diff --git a/mod/kalvidres/backup/moodle2/backup_kalvidres_activity_task.class.php b/mod/kalvidres/backup/moodle2/backup_kalvidres_activity_task.class.php new file mode 100644 index 0000000000000..a73ff6be762a0 --- /dev/null +++ b/mod/kalvidres/backup/moodle2/backup_kalvidres_activity_task.class.php @@ -0,0 +1,66 @@ +. + +/** + * Kaltura video resource backup activity tasks script. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once($CFG->dirroot.'/mod/kalvidres/backup/moodle2/backup_kalvidres_stepslib.php'); +require_once($CFG->dirroot.'/mod/kalvidres/backup/moodle2/backup_kalvidres_settingslib.php'); + +/** + * kalvidres backup task that provides all the settings and steps to perform one + * complete backup of the activity + */ +class backup_kalvidres_activity_task extends backup_activity_task { + /** + * Define (add) particular settings this activity can have + */ + protected function define_my_settings() { + // No particular settings for this activity + } + + /** + * Define (add) particular steps this activity can have + */ + protected function define_my_steps() { + // Choice only has one structure step + $this->add_step(new backup_kalvidres_activity_structure_step('kalvidres_structure', 'kalvidres.xml')); + } + + /** + * Code the transformations to perform in the activity in + * order to get transportable (encoded) links + */ + static public function encode_content_links($content) { + global $CFG; + + $base = preg_quote($CFG->wwwroot, "/"); + + // Link to the list of kalvidress + $search="/(".$base."\/mod\/kalvidres\/index.php\?id\=)([0-9]+)/"; + $content= preg_replace($search, '$@KALVIDRESINDEX*$2@$', $content); + + // Link to kalvidres view by moduleid + $search="/(".$base."\/mod\/kalvidres\/view.php\?id\=)([0-9]+)/"; + $content= preg_replace($search, '$@KALVIDRESVIEWBYID*$2@$', $content); + + return $content; + } +} diff --git a/mod/kalvidres/backup/moodle2/backup_kalvidres_settingslib.php b/mod/kalvidres/backup/moodle2/backup_kalvidres_settingslib.php new file mode 100644 index 0000000000000..d42bab7691745 --- /dev/null +++ b/mod/kalvidres/backup/moodle2/backup_kalvidres_settingslib.php @@ -0,0 +1,26 @@ +. + +/** + * Kaltura video resource backup settingslib script. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + + // This activity has no particular settings but the inherited from the generic + // backup_activity_task so here there isn't any class definition, like the ones + // existing in /backup/moodle2/backup_settingslib.php (activities section) diff --git a/mod/kalvidres/backup/moodle2/backup_kalvidres_stepslib.php b/mod/kalvidres/backup/moodle2/backup_kalvidres_stepslib.php new file mode 100644 index 0000000000000..8d5d06a50f348 --- /dev/null +++ b/mod/kalvidres/backup/moodle2/backup_kalvidres_stepslib.php @@ -0,0 +1,49 @@ +. + +/** + * Kaltura video resource backup stepslib script. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/** + * Define all the backup steps that will be used by the backup_kalvidres_activity_task + */ + +/** + * Define the complete kalvidres structure for backup, with file and id annotations + */ +class backup_kalvidres_activity_structure_step extends backup_activity_structure_step { + + protected function define_structure() { + + // Define each element separated + $kalvidres = new backup_nested_element('kalvidres', array('id'), array( + 'name', 'intro', 'introformat', 'entry_id', 'video_title', + 'uiconf_id', 'widescreen', 'height', 'width', 'source', 'timemodified', 'timecreated')); + + // Define sources + $kalvidres->set_source_table('kalvidres', array('id' => backup::VAR_ACTIVITYID)); + + // Define file annotations + $kalvidres->annotate_files('mod_kalvidres', 'intro', null); // This files area doesn't have itemid + + // Return the root element, wrapped into standard activity structure + return $this->prepare_activity_structure($kalvidres); + } +} diff --git a/mod/kalvidres/backup/moodle2/restore_kalvidres_activity_task.class.php b/mod/kalvidres/backup/moodle2/restore_kalvidres_activity_task.class.php new file mode 100644 index 0000000000000..fbd26b2b83f26 --- /dev/null +++ b/mod/kalvidres/backup/moodle2/restore_kalvidres_activity_task.class.php @@ -0,0 +1,107 @@ +. + +/** + * Kaltura video resource restore activity tasks script. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +defined('MOODLE_INTERNAL') || die(); + +require_once($CFG->dirroot.'/mod/kalvidres/backup/moodle2/restore_kalvidres_stepslib.php'); + +/** + * kalvidres restore task that provides all the settings and steps to perform one + * complete restore of the activity + */ +class restore_kalvidres_activity_task extends restore_activity_task { + + /** + * Define (add) particular settings this activity can have + */ + protected function define_my_settings() { + // No particular settings for this activity + } + + /** + * Define (add) particular steps this activity can have + */ + protected function define_my_steps() { + // Certificate only has one structure step + $this->add_step(new restore_kalvidres_activity_structure_step('kalvidres_structure', 'kalvidres.xml')); + } + + /** + * Define the contents in the activity that must be + * processed by the link decoder + */ + static public function define_decode_contents() { + $contents = array(); + + $contents[] = new restore_decode_content('kalvidres', array('intro'), 'kalvidres'); + + return $contents; + } + + /** + * Define the decoding rules for links belonging + * to the activity to be executed by the link decoder + */ + static public function define_decode_rules() { + $rules = array(); + + $rules[] = new restore_decode_rule('KALVIDRESVIEWBYID', '/mod/kalvidres/view.php?id=$1', 'course_module'); + $rules[] = new restore_decode_rule('KALVIDRESINDEX', '/mod/kalvidres/index.php?id=$1', 'course'); + + return $rules; + + } + + /** + * Define the restore log rules that will be applied + * by the {@link restore_logs_processor} when restoring + * kalvidres logs. It must return one array + * of {@link restore_log_rule} objects + */ + static public function define_restore_log_rules() { + $rules = array(); + + $rules[] = new restore_log_rule('kalvidres', 'view', 'view.php?id={course_module}', '{kalvidres}'); + + return $rules; + } + + /** + * Define the restore log rules that will be applied + * by the {@link restore_logs_processor} when restoring + * course logs. It must return one array + * of {@link restore_log_rule} objects + * + * Note this rules are applied when restoring course logs + * by the restore final task, but are defined here at + * activity level. All them are rules not linked to any module instance (cmid = 0) + */ + static public function define_restore_log_rules_for_course() { + $rules = array(); + + // Fix old wrong uses (missing extension) + $rules[] = new restore_log_rule('kalvidres', 'view all', 'index.php?id={course}', null); + + return $rules; + } +} diff --git a/mod/kalvidres/backup/moodle2/restore_kalvidres_stepslib.php b/mod/kalvidres/backup/moodle2/restore_kalvidres_stepslib.php new file mode 100644 index 0000000000000..9aaac8a0bfbc5 --- /dev/null +++ b/mod/kalvidres/backup/moodle2/restore_kalvidres_stepslib.php @@ -0,0 +1,62 @@ +. + +/** + * Kaltura video resource restore stepslib script. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +/** + * Define all the restore steps that will be used by the restore_kalvidres_activity_task + */ + +/** + * Structure step to restore one kalvidres activity + */ +class restore_kalvidres_activity_structure_step extends restore_activity_structure_step { + + protected function define_structure() { + + $paths = array(); + + $paths[] = new restore_path_element('kalvidres', '/activity/kalvidres'); + + // Return the paths wrapped into standard activity structure + return $this->prepare_activity_structure($paths); + } + + protected function process_kalvidres($data) { + global $DB; + + $data = (object)$data; + $oldid = $data->id; + $data->course = $this->get_courseid(); + + $data->timemodified = $this->apply_date_offset($data->timemodified); + + // insert the kalvidres record + $newitemid = $DB->insert_record('kalvidres', $data); + // immediately after inserting "activity" record, call this + $this->apply_activity_instance($newitemid); + } + + protected function after_execute() { + // Add kalvidres related files, no need to match by itemname (just internally handled context) + $this->add_related_files('mod_kalvidres', 'intro', null); + } +} diff --git a/mod/kalvidres/classes/event/video_resource_viewed.php b/mod/kalvidres/classes/event/video_resource_viewed.php new file mode 100644 index 0000000000000..22c77be006a50 --- /dev/null +++ b/mod/kalvidres/classes/event/video_resource_viewed.php @@ -0,0 +1,58 @@ +. + +/** + * The video_resource_viewed event. + * + * @package mod + * @subpackage kalvidres + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +namespace mod_kalvidres\event; +defined('MOODLE_INTERNAL') || die(); +/** + * The video_resource_viewed event class. + * + * @since Moodle 2.7 + * @copyright 2015 Rex Lorenzo + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + **/ +class video_resource_viewed extends \core\event\base { + protected function init() { + $this->data['crud'] = 'r'; // c(reate), r(ead), u(pdate), d(elete) + $this->data['edulevel'] = self::LEVEL_PARTICIPATING; + $this->data['objecttable'] = 'kalvidres'; + } + + public static function get_name() { + return get_string('eventvideo_resource_viewed', 'kalvidres'); + } + + public function get_description() { + return "The user with id '{$this->userid}' viewed the Kaltura video resource with " + . "the course module id '{$this->contextinstanceid}'."; + } + + public function get_url() { + return new \moodle_url('/mod/kalvidres/view.php', array('id' => $this->contextinstanceid)); + } + + public function get_legacy_logdata() { + return array($this->courseid, 'kalvidres', 'view video resource', + $this->get_url(), $this->objectid, $this->contextinstanceid); + } +} \ No newline at end of file diff --git a/mod/kalvidres/classes/privacy/provider.php b/mod/kalvidres/classes/privacy/provider.php new file mode 100644 index 0000000000000..080f87d66f52e --- /dev/null +++ b/mod/kalvidres/classes/privacy/provider.php @@ -0,0 +1,20 @@ +. + +/** + * Kaltura video resource accesslib. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +$capabilities = array( + 'mod/kalvidres:addinstance' => array( + 'riskbitmask' => RISK_XSS, + 'captype' => 'write', + 'contextlevel' => CONTEXT_COURSE, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ), + 'clonepermissionsfrom' => 'moodle/course:manageactivities' + ), + ); \ No newline at end of file diff --git a/mod/kalvidres/db/install.xml b/mod/kalvidres/db/install.xml new file mode 100644 index 0000000000000..8f8762757be6e --- /dev/null +++ b/mod/kalvidres/db/install.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
\ No newline at end of file diff --git a/mod/kalvidres/db/log.php b/mod/kalvidres/db/log.php new file mode 100644 index 0000000000000..2006b3cb7e043 --- /dev/null +++ b/mod/kalvidres/db/log.php @@ -0,0 +1,28 @@ +. + +/** + * Kaltura video resource log file. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +defined('MOODLE_INTERNAL') || die(); + +$logs = array( + array('module' => 'kalvidres', 'action' => 'view', 'mtable' => 'kalvidres', 'field' => 'name'), +); diff --git a/mod/kalvidres/db/upgrade.php b/mod/kalvidres/db/upgrade.php new file mode 100644 index 0000000000000..d1f998af65f91 --- /dev/null +++ b/mod/kalvidres/db/upgrade.php @@ -0,0 +1,83 @@ +get_manager(); + + if ($oldversion < 2018112735) { + // Changing precision of field video_title on table kalvidres to (256). + $table = new xmldb_table('kalvidres'); + $field = new xmldb_field('video_title', XMLDB_TYPE_CHAR, '256', null, XMLDB_NOTNULL, null, null, 'entry_id'); + + // Launch change of precision for field video_title. + $dbman->change_field_precision($table, $field); + + // Kalvidres savepoint reached. + upgrade_mod_savepoint(true, 2018112735, 'kalvidres'); + } + + if ($oldversion < 2011110702) { + + // Changing type of field intro on table kalvidres to text. + $table = new xmldb_table('kalvidres'); + $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'small', null, null, null, null, 'name'); + + // Launch change of type for field intro. + $dbman->change_field_type($table, $field); + + // Kalvidres savepoint reached. + upgrade_mod_savepoint(true, 2011110702, 'kalvidres'); + } + + if ($oldversion < 2014013000) { + + // Define field source to be added to kalvidres. + $table = new xmldb_table('kalvidres'); + $field = new xmldb_field('source', XMLDB_TYPE_TEXT, null, null, null, null, null, 'width'); + + // Conditionally launch add field source. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Kalvidres savepoint reached. + upgrade_mod_savepoint(true, 2014013000, 'kalvidres'); + } + + if ($oldversion < 2014023000.01) { + + // Define field metadata to be added to kalvidres. + $table = new xmldb_table('kalvidres'); + $field = new xmldb_field('metadata', XMLDB_TYPE_TEXT, null, null, null, null, null, 'source'); + + // Conditionally launch add field metadata. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Kalvidassign savepoint reached. + upgrade_mod_savepoint(true, 2014023000.01, 'kalvidres'); + } + + return true; +} \ No newline at end of file diff --git a/mod/kalvidres/index.php b/mod/kalvidres/index.php new file mode 100644 index 0000000000000..60c1c6fa2cea7 --- /dev/null +++ b/mod/kalvidres/index.php @@ -0,0 +1,96 @@ +. + +/** + * Kaltura video resource library script. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once('../../config.php'); + +$id = required_param('id', PARAM_INT); // Course ID. +$course = $DB->get_record('course', array('id' => $id), '*', MUST_EXIST); + +require_course_login($course, true); +$PAGE->set_pagelayout('incourse'); + +$strlastmodified = get_string("lastmodified"); // Last Modified. +$strintro = get_string("moduleintro"); // Description. +$strsectionname = get_string('sectionname', 'format_'.$course->format); // Section. +$strplural = get_string("modulenameplural", "mod_kalvidres"); // Video Resource. + +$PAGE->set_url('/mod/kalvidres/index.php', array('id' => $course->id)); +$PAGE->set_title($course->shortname.': '.$strplural); +$PAGE->set_heading($course->fullname); +$PAGE->navbar->add($strplural); +echo $OUTPUT->header(); +echo $OUTPUT->heading($strplural); + +// Since $includeinvisible defaults to false, all res in vidres will be uservisible according to get_fast_modinfo. +if (!$vidres = get_all_instances_in_course('kalvidres', $course)) { + notice(get_string('noresource', 'mod_kalvidres'), "$CFG->wwwroot/course/view.php?id=$course->id"); + exit; +} + +$usesections = course_format_uses_sections($course->format); + +$table = new html_table(); +$table->attributes['class'] = 'generaltable mod_index'; + +if ($usesections) { + $table->head = array ($strsectionname, $strplural, $strintro); + $table->align = array ('center', 'left', 'left'); +} else { + $table->head = array ($strlastmodified, $strplural, $strintro); + $table->align = array ('left', 'left', 'left'); +} + +$currentsection = ''; +foreach ($vidres as $res) { + if ($usesections) { + $printsection = ''; + if ($res->section !== $currentsection) { + if ($res->section) { + $printsection = get_section_name($course, $res->section); + } + if ($currentsection !== '') { + $table->data[] = 'hr'; + } + $currentsection = $res->section; + } + } else { + $printsection = ''.userdate($res->timemodified).""; + } + + $icon = $OUTPUT->pix_icon('icon', get_string('modulename', 'mod_kalvidres'), 'mod_kalvidres'); + + $class = $res->visible ? '' : 'class="dimmed"'; // Hidden modules are dimmed. + + $table->data[] = array ( + $printsection, + "coursemodule\">".$icon.format_string($res->name)."", + format_module_intro('kalvidres', $res, $res->coursemodule) + ); + +} + +echo html_writer::table($table); + +echo $OUTPUT->footer(); \ No newline at end of file diff --git a/mod/kalvidres/lang/en/kalvidres.php b/mod/kalvidres/lang/en/kalvidres.php new file mode 100644 index 0000000000000..fcb4db825c6ad --- /dev/null +++ b/mod/kalvidres/lang/en/kalvidres.php @@ -0,0 +1,39 @@ +. + +/** + * Kaltura video resource language file. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ +$string['modulenameplural'] = 'Kaltura Video Resource'; +$string['modulename'] = 'Kaltura Video Resource'; +$string['modulename_help'] = 'The Kaltura Video Resource enables a teacher to create a resource using a Kaltura video.'; +$string['pluginadministration'] = 'Kaltura Video Resource'; +$string['noresource'] = 'No video resource found in the course'; +$string['pluginname'] = 'Kaltura Video Resource'; +$string['name'] = 'Name'; +$string['novidsource'] = 'No media content found. You must add media content in order to save a video resource.'; +$string['video_hdr'] = 'Video'; +$string['add_video'] = 'Add media'; +$string['invalidid'] = 'Invalid ID'; +$string['invalid_launch_parameters'] = 'Invalid launch parameters'; +$string['invalid_source_parameter'] = 'Invalid source parameter'; +$string['replace_video'] = 'Replace media'; +$string['kalvidres:addinstance'] = 'Add a Kaltura Video Resource'; +$string['eventvideo_resource_viewed'] = 'Video resource viewed'; +$string['privacy:metadata'] = 'Kaltura video resource plugin does not store any personal data.'; diff --git a/mod/kalvidres/lib.php b/mod/kalvidres/lib.php new file mode 100644 index 0000000000000..0551e5d447506 --- /dev/null +++ b/mod/kalvidres/lib.php @@ -0,0 +1,240 @@ +. + +/** + * Kaltura video resource library script. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +/** + * Given an object containing all the necessary data, + * (defined by the form in mod_form.php) this function + * will create a new instance and return the id number + * of the new instance. + * + * @param object $kalvidres An object from the form in mod_form.php + * @return int The id of the newly inserted kalvidassign record + */ +function kalvidres_add_instance($kalvidres) { + global $DB, $CFG; + require_once($CFG->dirroot.'/local/kaltura/locallib.php'); + + $kalvidres->timecreated = time(); + $kalvidres->source = local_kaltura_build_kaf_uri($kalvidres->source); + $kalvidres->id = $DB->insert_record('kalvidres', $kalvidres); + + // add timeline reminder event if requested by user + $completionexpected = !empty($kalvidres->completionexpected) ? $kalvidres->completionexpected : null; + \core_completion\api::update_completion_date_event($kalvidres->coursemodule, 'kalvidres', $kalvidres->id, $completionexpected); + + return $kalvidres->id; +} + +/** + * Given an object containing all the necessary data, + * (defined by the form in mod_form.php) this function + * will update an existing instance with new data. + * + * @param object $kalvidres An object from the form in mod_form.php + * @return boolean Success/Fail + */ +function kalvidres_update_instance($kalvidres) { + global $DB, $CFG; + require_once($CFG->dirroot.'/local/kaltura/locallib.php'); + + $kalvidres->timemodified = time(); + $kalvidres->id = $kalvidres->instance; + $kalvidres->source = local_kaltura_build_kaf_uri($kalvidres->source); + $updated = $DB->update_record('kalvidres', $kalvidres); + + // update timeline reminder event if requested by user + $completionexpected = !empty($kalvidres->completionexpected) ? $kalvidres->completionexpected : null; + \core_completion\api::update_completion_date_event($kalvidres->coursemodule, 'kalvidres', $kalvidres->id, $completionexpected); + + return $updated; +} + +/** + * Given an ID of an instance of this module, + * this function will permanently delete the instance + * and any data that depends on it. + * + * @param int $id Id of the module instance + * @return boolean Success/Failure + */ +function kalvidres_delete_instance($id) { + global $DB; + + if (! $kalvidres = $DB->get_record('kalvidres', array('id' => $id))) { + return false; + } + + // delete timeline reminder event if set + $cm = get_coursemodule_from_instance('kalvidres', $id); + \core_completion\api::update_completion_date_event($cm->id, 'kalvidres', $kalvidres->id, null); + + $DB->delete_records('kalvidres', array('id' => $kalvidres->id)); + + return true; +} + +/** + * Return a small object with summary information about what a + * user has done with a given particular instance of this module + * Used for user activity reports. + * $return->time = the time they did it + * $return->info = a short text description + * + * @return null + * @todo Finish documenting this function + */ +function kalvidres_user_outline($course, $user, $mod, $kalvidres) { + $return = new stdClass; + $return->time = 0; + $return->info = ''; + return $return; +} + +/** + * Print a detailed representation of what a user has done with + * a given particular instance of this module, for user activity reports. + * + * @return boolean + * @todo Finish documenting this function + */ +function kalvidres_user_complete($course, $user, $mod, $kalvidres) { + return true; +} + +/** + * Given a course and a time, this module should find recent activity + * that has occurred in kalvidres activities and print it out. + * Return true if there was output, or false is there was none. + * + * @return boolean + * @todo Finish documenting this function + */ +function kalvidres_print_recent_activity($course, $viewfullnames, $timestart) { + // TODO: finish this function + return false; // True if anything was printed, otherwise false +} + +/** + * Function to be run periodically according to the moodle cron + * This function searches for things that need to be done, such + * as sending out mail, toggling flags etc ... + * + * @return boolean + */ +function kalvidres_cron () { + return false; +} + +/** + * Must return an array of users who are participants for a given instance + * of kalvidres. Must include every user involved in the instance, independient + * of his role (student, teacher, admin...). The returned objects must contain + * at least id property. See other modules as example. + * + * @param int $kalvidresid ID of an instance of this module + * @return boolean|array false if no participants, array of objects otherwise + */ +function kalvidres_get_participants($kalvidresid) { + // TODO: finish this function + return false; +} + +/** + * @param string $feature FEATURE_xx constant for requested feature + * @return mixed True if module supports feature, null if doesn't know + */ +function kalvidres_supports($feature) { + switch($feature) { + case FEATURE_MOD_ARCHETYPE: + return MOD_ARCHETYPE_RESOURCE; + case FEATURE_GROUPS: + return true; + case FEATURE_GROUPINGS: + return true; + case FEATURE_GROUPMEMBERSONLY: + return true; + case FEATURE_MOD_INTRO: + return true; + case FEATURE_COMPLETION_TRACKS_VIEWS: + return false; + case FEATURE_GRADE_HAS_GRADE: + return false; + case FEATURE_GRADE_OUTCOMES: + return false; + case FEATURE_BACKUP_MOODLE2: + return true; + case FEATURE_SHOW_DESCRIPTION: + return true; + case FEATURE_MOD_PURPOSE: + return MOD_PURPOSE_CONTENT; + default: + return null; + } +} + +/** + * This function receives a calendar event and returns the action associated with it, or null if there is none. + * + * This is used by block_myoverview in order to display the event appropriately. If null is returned then the event + * is not displayed on the block. + * + * @param calendar_event $event + * @param \core_calendar\action_factory $factory + * @param int $userid User id to use for all capability checks, etc. Set to 0 for current user (default). + * @return \core_calendar\local\event\entities\action_interface|null + */ +function mod_kalvidres_core_calendar_provide_event_action(calendar_event $event, + \core_calendar\action_factory $factory, + int $userid = 0) { + global $USER; + + if (!$userid) { + $userid = $USER->id; + } + + $cm = get_fast_modinfo($event->courseid, $userid)->instances['kalvidres'][$event->instance]; + + if (!$cm->uservisible) { + // The module is not visible to the user for any reason. + return null; + } + + $completion = new \completion_info($cm->get_course()); + + $completiondata = $completion->get_data($cm, false, $userid); + + if ($completiondata->completionstate != COMPLETION_INCOMPLETE) { + return null; + } + + return $factory->create_instance( + get_string('view'), + new \moodle_url('/mod/kalvidres/view.php', array('id' => $cm->id)), + 1, + true + ); +} \ No newline at end of file diff --git a/mod/kalvidres/lti_launch.php b/mod/kalvidres/lti_launch.php new file mode 100644 index 0000000000000..7655931c53d36 --- /dev/null +++ b/mod/kalvidres/lti_launch.php @@ -0,0 +1,73 @@ +. + +/** + * Kaltura video resource LTI launch page. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); + +global $USER; + +require_login(); + +$courseid = required_param('courseid', PARAM_INT); +$height = required_param('height', PARAM_INT); +$width = required_param('width', PARAM_INT); +$withblocks = optional_param('withblocks', 0, PARAM_INT); +$source = optional_param('source', '', PARAM_URL); + +$context = context_course::instance($courseid); + +// If the user isn't a teacher or they are not enrolled in the course context then return with an error. +if (!has_capability('mod/kalvidres:addinstance', $context) && is_guest($context)) { + echo get_string('nocapabilitytousethisservice', 'error'); + die(); +} + +$course = get_course($courseid); + +$launch = array(); +$launch['id'] = 1; +$launch['cmid'] = 0; +$launch['title'] = 'Kaltura video resource'; +$launch['module'] = KAF_BROWSE_EMBED_MODULE; +$launch['course'] = $course; +$launch['width'] = $width; +$launch['height'] = $height; +$launch['custom_publishdata'] = ''; + +$source = local_kaltura_add_kaf_uri_token($source); + +if (false === local_kaltura_url_contains_configured_hostname($source) && !empty($source)) { + echo get_string('invalid_source_parameter', 'mod_kalvidres'); + die; +} else { + $launch['source'] = urldecode($source); +} + +if (local_kaltura_validate_browseembed_required_params($launch)) { + $content = local_kaltura_request_lti_launch($launch, $withblocks); + echo $content; +} else { + echo get_string('invalid_launch_parameters', 'mod_kalvidres'); +} diff --git a/mod/kalvidres/mod_form.php b/mod/kalvidres/mod_form.php new file mode 100644 index 0000000000000..7eb75cf95ff96 --- /dev/null +++ b/mod/kalvidres/mod_form.php @@ -0,0 +1,245 @@ +. + +/** + * Kaltura video resource formslib class. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +require_once(dirname(dirname(dirname(__FILE__))).'/course/moodleform_mod.php'); +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); + +class mod_kalvidres_mod_form extends moodleform_mod { + /** @var string Part of the id for the add video button. */ + protected $addvideobutton = 'add_video'; + + /** + * Forms lib definition function + */ + public function definition() { + global $CFG, $COURSE, $PAGE; + + $params = array( + 'withblocks' => 0, + 'courseid' => $COURSE->id, + 'width' => KALTURA_PANEL_WIDTH, + 'height' => KALTURA_PANEL_HEIGHT + ); + + $url = new moodle_url('/mod/kalvidres/lti_launch.php', $params); + + $params = array( + 'addvidbtnid' => 'id_'.$this->addvideobutton, + 'ltilaunchurl' => $url->out(false), + 'height' => KALTURA_PANEL_HEIGHT, + 'width' => KALTURA_PANEL_WIDTH, + 'modulename' => 'kalvidres' + ); + + $PAGE->requires->yui_module('moodle-local_kaltura-ltipanel', 'M.local_kaltura.init', array($params), null, true); + // Make replace media language string available to the YUI modules + $PAGE->requires->string_for_js('replace_video', 'kalvidres'); + $PAGE->requires->string_for_js('browse_and_embed', 'local_kaltura'); + + $mform =& $this->_form; + + // This line is needed to avoid a PHP warning when the form is submitted. + // Because this value is set as the default for one of the formslib elements. + $uiconf_id = ''; + + /* Hidden fields */ + $attr = array('id' => 'entry_id'); + $mform->addElement('hidden', 'entry_id', '', $attr); + $mform->setType('entry_id', PARAM_NOTAGS); + + $attr = array('id' => 'source'); + $mform->addElement('hidden', 'source', '', $attr); + $mform->setType('source', PARAM_URL); + + $attr = array('id' => 'video_title'); + $mform->addElement('hidden', 'video_title', 'x', $attr); + $mform->setType('video_title', PARAM_TEXT); + + $attr = array('id' => 'uiconf_id'); + $mform->addElement('hidden', 'uiconf_id', '', $attr); + $mform->setDefault('uiconf_id', $uiconf_id); + $mform->setType('uiconf_id', PARAM_INT); + + $attr = array('id' => 'widescreen'); + $mform->addElement('hidden', 'widescreen', 'x', $attr); + $mform->setDefault('widescreen', 0); + $mform->setType('widescreen', PARAM_INT); + + $attr = array('id' => 'height'); + $mform->addElement('hidden', 'height', '', $attr); + $mform->setDefault('height', '365'); + $mform->setType('height', PARAM_TEXT); + + $attr = array('id' => 'width'); + $mform->addElement('hidden', 'width', '', $attr); + $mform->setDefault('width', '400'); + $mform->setType('width', PARAM_TEXT); + + $attr = array('id' => 'metadata'); + $mform->addElement('hidden', 'metadata', '', $attr); + $mform->setType('metadata', PARAM_TEXT); + + $mform->addElement('header', 'general', get_string('general', 'form')); + + $mform->addElement('text', 'name', get_string('name', 'kalvidres'), array('size' => '64')); + + if (!empty($CFG->formatstringstriptags)) { + $mform->setType('name', PARAM_TEXT); + } else { + $mform->setType('name', PARAM_CLEANHTML); + } + + $mform->addRule('name', null, 'required', null, 'client'); + + $this->standard_intro_elements(); + + $mform->addElement('header', 'video', get_string('video_hdr', 'kalvidres')); + $mform->setExpanded('video',true); + $this->add_video_definition($mform); + + $this->standard_coursemodule_elements(); + + $this->add_action_buttons(); + } + + /** + * This function adds the video thumbnail element and buttons to the form. + * @param MoodleQuickForm $mform An instance of MoodleQuickForm used to add elements to the form. + */ + private function add_video_definition($mform) { + $addinstance = empty($this->current->entry_id) ? true : false; + + $thumbnail = $this->get_thumbnail_markup(!$addinstance); + + $videopreview = $this->get_iframe_video_preview_markup($addinstance); + + $mform->addElement('static', 'add_video_thumb', ' ', $thumbnail); + $mform->addElement('html', $videopreview); + + $videogroup = array(); + if ($addinstance) { + $videogroup[] =& $mform->createElement('button', $this->addvideobutton, get_string('add_video', 'kalvidres')); + } else { + $videogroup[] =& $mform->createElement('button', $this->addvideobutton, get_string('replace_video', 'kalvidres')); + } + + $mform->addGroup($videogroup, 'video_group', ' ', ' ', false); + } + + /** + * This functions returns the markup to display a thumbnail image. + * @param bool $hide Set to true to hide it, otherwise false. When set to hide the thumbnail markup is still rendered + * but the display style is set to none. The reason for this is that the YUI module uses the img tag to place the iframe just below it. + * As well as to hide the image tag when a new video is selected. + * @return string Returns an image element markup. + */ + private function get_thumbnail_markup($hide = false) { + $source = new moodle_url('/local/kaltura/pix/vidThumb.png'); + $alt = get_string('add_video', 'kalvidres'); + $title = get_string('add_video', 'kalvidres'); + + $attr = array( + 'id' => 'video_thumbnail', + 'src' => $source->out(), + 'alt' => $alt, + 'title' => $title + ); + + if ($hide) { + $attr['style'] = 'display:none'; + } + + $output = html_writer::empty_tag('img', $attr); + + return $output; + } + + /** + * This functions returns iframe markup for displaying the video preview interface. + * @param bool $hide True to hide the element, otherwise false. + * @return string Returns an iframe markup + */ + private function get_iframe_video_preview_markup($hide = true) { + $width = empty($this->current->width) ? '0px' : $this->current->width.'px'; + $height = empty($this->current->height) ? 'opx' : $this->current->height.'px'; + $source = empty($this->current->source) ? '' : $this->current->source; + + $params = array( + 'id' => 'contentframe', + 'class' => 'kaltura-player-iframe', + 'src' => $source, + 'height' => $height, + 'width' => $width, + 'allowfullscreen' => 'true', + 'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;', + ); + + if ($hide) { + $params['style'] = 'display: none'; + } + + // If the source attribute is not empty, initiate an LTI launch to avoid having ACL issues when another user with permissions edits the module. + // This also assists with full screen functionality on some mobile devices. + if (!empty($source)) { + $ltiparams = array( + 'courseid' => $this->current->course, + 'height' => $height, + 'width' => $width, + 'withblocks' => 0, + 'source' => $source + ); + + $url = new moodle_url('/mod/kalvidres/lti_launch.php', $ltiparams); + $params['src'] = $url->out(false); + } + + $iframe = html_writer::tag('iframe', '', $params); + + $iframeContainer = html_writer::tag('div', $iframe, array( + 'class' => 'kaltura-player-container' + )); + + return $iframeContainer; + } + + /** + * This function validates the form on save. + * + * @param array $data Array of form values + * @param array $files Array of files + * @return array $errors Array of error messages + */ + public function validation($data, $files) { + $errors = array(); + + if (empty($data['source'])) { + $errors['add_video_thumb'] = get_string('novidsource', 'kalvidres'); + } + + return $errors; + } +} diff --git a/mod/kalvidres/pix/monologo.svg b/mod/kalvidres/pix/monologo.svg new file mode 100644 index 0000000000000..ce9e59bb6f49b --- /dev/null +++ b/mod/kalvidres/pix/monologo.svg @@ -0,0 +1,3 @@ + + + diff --git a/mod/kalvidres/renderer.php b/mod/kalvidres/renderer.php new file mode 100644 index 0000000000000..93e92056feb3d --- /dev/null +++ b/mod/kalvidres/renderer.php @@ -0,0 +1,81 @@ +. + +/** + * Kaltura video resource renderer file. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +require_once(dirname(dirname(dirname(__FILE__))).'/local/kaltura/locallib.php'); + +class mod_kalvidres_renderer extends plugin_renderer_base { + /** + * This function displays the title of the video in bold. + * @param string $title The title of the video. + * @return string HTML markup. + */ + public function display_mod_info($title) { + $output = ''; + + $attr = array('for' => 'video_name'); + $output .= html_writer::start_tag('b'); + $output .= html_writer::tag('div', $title); + $output .= html_writer::end_tag('b'); + $output .= html_writer::empty_tag('br'); + + return $output; + } + + /** + * This function displays the iframe markup. + * @param object $kalvidres A Kaltura video resource instance object. + * @param int $courseid A course id. + * @return string HTML markup. + */ + public function display_iframe($kalvidres, $courseid) { + $params = array( + 'courseid' => $courseid, + 'height' => $kalvidres->height, + 'width' => $kalvidres->width, + 'withblocks' => 0, + 'source' => $kalvidres->source + ); + $url = new moodle_url('/mod/kalvidres/lti_launch.php', $params); + + $attr = array( + 'id' => 'contentframe', + 'class' => 'kaltura-player-iframe', + 'height' => '100%', + 'width' => $kalvidres->width, + 'src' => $url->out(false), + 'allowfullscreen' => 'true', + 'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;', + ); + + $iframe = html_writer::tag('iframe', '', $attr); + $iframeContainer = html_writer::tag('div', $iframe, array( + 'class' => 'kaltura-player-container' + )); + + return $iframeContainer; + } +} \ No newline at end of file diff --git a/mod/kalvidres/styles.css b/mod/kalvidres/styles.css new file mode 100644 index 0000000000000..7b48bd626b546 --- /dev/null +++ b/mod/kalvidres/styles.css @@ -0,0 +1,36 @@ +/* stylelint-disable selector-list-comma-newline-after, declaration-colon-space-after */ + +#id_add_video { + float: left; +} + +#id_video_properties, #id_video_preview { + float: left; + margin-left: 5px; +} + +#slider_border { + width: 100%; + height: 18px; + border: 1px solid #000000; + overflow: hidden; +} + +#progress_bar { + float: left; + height: 18px; + width: 0%; + /*border-right: 1px solid #000000;*/ + background: #00FF00; +} + +#loading_text { + position: relative; + top: -18px; + font-weight: bold; + left: 12px; +} + +#id_video #video_thumbnail { + float: left; +} diff --git a/mod/kalvidres/version.php b/mod/kalvidres/version.php new file mode 100644 index 0000000000000..707236d4a7a4c --- /dev/null +++ b/mod/kalvidres/version.php @@ -0,0 +1,36 @@ +. + +/** + * Kaltura video resource version file. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +if (!defined('MOODLE_INTERNAL')) { + die('Direct access to this script is forbidden.'); +} + +$plugin->version = 2024100702; +$plugin->component = 'mod_kalvidres'; +$plugin->release = 'Kaltura release 4.5.1'; +$plugin->requires = 2024042200; +$plugin->cron = 0; +$plugin->maturity = MATURITY_STABLE; +$plugin->dependencies = array( + 'local_kaltura' => 2024100702 +); diff --git a/mod/kalvidres/view.php b/mod/kalvidres/view.php new file mode 100644 index 0000000000000..baa002afd5003 --- /dev/null +++ b/mod/kalvidres/view.php @@ -0,0 +1,87 @@ +. + +/** + * Kaltura video resource view page. + * + * @package mod_kalvidres + * @author Remote-Learner.net Inc + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net + */ + +require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); + +$id = optional_param('id', 0, PARAM_INT); + +// Retrieve module instance. +if (empty($id)) { + throw new \moodle_exception('invalidid', 'kalvidres'); +} + +if (!empty($id)) { + + if (!$cm = get_coursemodule_from_id('kalvidres', $id)) { + throw new \moodle_exception('invalidcoursemodule'); + } + + if (!$course = $DB->get_record('course', array('id' => $cm->course))) { + throw new \moodle_exception('coursemisconf'); + } + + if (!$kalvidres = $DB->get_record('kalvidres', array("id" => $cm->instance))) { + throw new \moodle_exception('invalidid', 'kalvidres'); + } +} + +require_course_login($course->id, true, $cm); + +global $SESSION, $CFG; + +$PAGE->set_url('/mod/kalvidres/view.php', array('id' => $id)); +$PAGE->set_title(format_string($kalvidres->name)); +$PAGE->set_heading($course->fullname); +$pageclass = 'kaltura-kalvidres-body'; +$PAGE->add_body_class($pageclass); + +$context = $PAGE->context; + +$event = \mod_kalvidres\event\video_resource_viewed::create(array( + 'objectid' => $kalvidres->id, + 'context' => context_module::instance($cm->id) +)); +$event->trigger(); + +$completion = new completion_info($course); +$completion->set_module_viewed($cm); + +$PAGE->requires->css('/mod/kalvidres/styles.css'); +echo $OUTPUT->header(); + +$renderer = $PAGE->get_renderer('mod_kalvidres'); + +// Require a YUI module to make the object tag be as large as possible. +$params = array( + 'bodyclass' => $pageclass, + 'lastheight' => null, + 'padding' => 15, + 'width' => $kalvidres->width, + 'height' => $kalvidres->height +); +$PAGE->requires->yui_module('moodle-local_kaltura-lticontainer', 'M.local_kaltura.init', array($params), null, true); +$PAGE->requires->js(new moodle_url('/local/kaltura/js/bse_iframe_resize.js')); + +echo $renderer->display_iframe($kalvidres, $course->id); + +echo $OUTPUT->footer();