See a demo of KCW Custom Seach Provider
Background
The Kaltura Contribution Wizard is a fully customizable content ingestion wizard, enabling end users to upload and import media from various sources.
Kaltura’s ingestion engine allows users to add videos, photos, and audio files in a wide variety of formats [...]
This demo explain the workflow of defining a custom content search provider for the KCW widget.
Why define a custom search provider for the KCW?
On some occasions, you will have a repository of content of your own,
creating a custom search provider for the KCW will enable your users to use KCW widget as if they were searching through the Kaltura Network.
For example: A university library would like to allow it's students to interact with it's current media content through the Kaltura tools (player, editor, etc.).
So - the IT guy for the university should create a custom search provider (see below), define the new search provider inside his KCW uiConf and immediately all the content will be reachable for import through the KCW.
What is a search KCW provider?
In it's simplest form - this is an xml file containing a list of media elements.
However, to provide the search functionality where the user will be able to search through the repository content, a search provider should be a server script that is:
- Accessible by the Kaltura server (either your CE or EE server or the SaaS account that you use)
- Receive in POST the following set of parameters
- Returns an XML describing the list of media files
The Search Provider Script
The search script should receive a set of POST parameters and return the results as XML according to format below.
The following list of POST parameters are provided to the search provider script:
| Parameter | Type | Description |
|---|---|---|
| uid | String | The user id of the user using the KCW |
| search | String | The keywords the user is searching for (there is not any preprocessing of special characters) |
| media_type | Integer | 1 - video, 2 - image, 5 - audio |
| page | Integer | The page number for paginating the results. First page is 1 |
| page_size | Integer | The page size (the CW asks for 20 entries by defaults) |
| filter | Integer | 0 - search all, 1 - Search only my friends (for use by Social Network Sites and a like) |
The Search Provider Result XML
The search provider should return an XML formatted list of media content that answer the user's search terms in the following format:
<num_0>
<id>xyz123</id><!-- An id that uniquely identify the media -->
<url>http://example.com/data/xyz123_media.flv</url><!-- The url to download the media file from -->
<tags>dunk,amazing</tags><!-- Comma delimited tags -->
<title>amazing dunk</title><!-- The name of the media -->
<thumb>http://example.com/thumb/xyz123_thumb.jpg</thumb><!-- Thumbnail url -->
<description>amazing jump (30 secs)</description><!-- Displayed description shown in the CW as a tooltip - this will not be stored after import -->
<source_link>http://example.com/media_page/xyz123</source_link><!-- OPTIONAL - link to an html page containing the media (for source attribution) -->
<credit>john dunker</credit><!-- OPTIONAL - containing attribution information -->
<media_source></media_source><!-- OPTIONAL - overrides the request media source -->
<flash_playback_type></flash_playback_type><!-- OPTIONAL - for audio files "audio" / "video" -->
<license></license><!-- OPTIONAL - enumeration for license type -->
</num_0>
<num_1>
<id>...</id>
<url>...</url>
<tags>...</tags>
<title>...</title>
<thumb>...</thumb>
<description>...</description>
<source_link>...</source_link>
<credit>...</credit>
<media_source>...</media_source>
<flash_playback_type>...</flash_playback_type>
<license>...</license>
</num_1>
...
<num_N>
...
</num_N>
</objects>
The KCW uiConf setup for using a custom search provider
To define a tab for the custom search provider inside the KCW, you need to edit the KCW uiConf:
- Use the API TestMe console
- Create a session using the session.start action, your partner id, admin secret and select a ADMIN type
- Use the uiConf.get action to download the uiConf xml of the KCW instance you wish to use
After obtaining the XML of the KCW uiConf you wish to use, edit the uiConf xml in your text editor of choice,
and under the <mediaTypes> node, add your custom search provider for every media type separately:
<provider id="thissite" name="anywebpage" code="28"> <!-- leave the id and code attributes as is, the name attribute is linked to the locale used -->
<moduleUrl>SearchView.swf</moduleUrl> <!-- Always leave as is - this define the actual KCW view to load -->
<authMethodList>
<authMethod type="1" />
</authMethodList>
<tokens>
<token>
<name>extra_data</name>
<value>http://www.kaltura.org/sites/default/themes/kdotorg/demos/kcw-custom-provider/sample-provider.xml</value>
</token>
</tokens>
</provider>
</media>
Notes:
- The
<provider>name attribute define the text that will be shown on the KCW tab - if you wish to change this, add a text of your own to the KCW locale, compile a new locale and change the locale attribute in the KCW uiConf - The
<authMethodList>node lists the available authorization modes used to access the media provider's content repository. with custom search provider only the public functionality is available (no authorization available) - so leave this attribute as is - The extra_data token value define the url of the search provider script to be called, change this url to the url of your custom search provider script
Additional information
When using a custom provider, the KCW is not calling directly to the custom provider script, rather proxy the call to the custom provider through the Kaltura server it is working on (whether CE/EE or hosted SaaS account).
To learn more or extend and customize the functionality of the proxy provided by the Kaltura server in self-hosted environments, refer to the the proxy class "mySearchProxyServices" located at:
/alpha/apps/kaltura/lib/extservices/mySearchProxyServices.class.php




Comments
Filter by admin_tag
I am using kalturaCE with differents aplications. When you upload a video, each application set a different value in the admin_tag video attribute with the name of the application. I want to search my videos filtering by "admin_tag", but I can't use the POST parameters of the search provider script.
I have tested the "search" function with the API Testme Console but I can't understand the purpose of the attribute "extraData".
Can I use the extraData attribute to find my videos filtered by admin_tags?
Can I use another POST parameters?
Is there any way or work around to achieve my goal?
best regards