Author: ygrego Date: 2015-02-05 15:10:38 +0000 (Thu, 05 Feb 2015) New Revision: 771 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/771 Log: Implementation of 'SearchManagerObject.getResults', moving of each class 'Configuration', 'Tuner', 'TunerCollection', 'LocalSystem', 'Query', 'Channel', 'MetadatSearch' and 'SearchResults' to their respective file, adding of 'onMetadatasearch' into 'testGetCurrentProgram' and a directory 'js/impl/model', call of method 'testGetCurrentProgram' into 'welcome.html'. Added: oipf/js/impl/model/ Modified: oipf/js/impl/OipfObjectFactory.js oipf/js/impl/SearchManagerObject.js oipf/js/initObj/init.js oipf/js/test/test.js oipf/view/welcome.html Modified: oipf/js/impl/OipfObjectFactory.js =================================================================== --- oipf/js/impl/OipfObjectFactory.js 2015-02-04 13:39:59 UTC (rev 770) +++ oipf/js/impl/OipfObjectFactory.js 2015-02-05 15:10:38 UTC (rev 771) @@ -29,7 +29,7 @@ //this.applicationManagerObject = new ApplicationManagerObject(); //this.capabilitiesObject = new CapabilitiesObject(); //this.codManagerObject = new CodManagerObject(); - this.channelConfig = new ChannelConfig(null, currentchannel); + this.channelConfig = new ChannelConfig(null, currentChannel); //this.imsObject = new IMSObecjet(); //this.mdtfObject = new MDTFObject(); //this.notifSocketObject = new NotifSocket(); Modified: oipf/js/impl/SearchManagerObject.js =================================================================== --- oipf/js/impl/SearchManagerObject.js 2015-02-04 13:39:59 UTC (rev 770) +++ oipf/js/impl/SearchManagerObject.js 2015-02-05 15:10:38 UTC (rev 771) @@ -1,14 +1,3 @@ -var metadataSearchEvent = new Event('MetadataSearch'); //Could be change to put data into event -var metadataUpdateEvent = new Event('MetadataUpdate'); //Could be change to put data into event -/*// Listen for the event. -elem.addEventListener('build', function (e) { ... }, false); - -// Dispatch the event. -elem.dispatchEvent(event); -*/ - -var currentQuery; - /* * Description: OITFs SHALL implement the application/oipfSearchManager embedded object. This object provides a * mechanism for applications to create and manage metadata searches. @@ -68,9 +57,7 @@ * • Object object – the affected channel, programme, or CoD asset prior to the change. If more than * one is affected, then this argument SHALL take the value null. */ - onMetadataUpdate: function(action, info, object) {channels, for instance. - - }, + onMetadataUpdate: null, /* * Description: @@ -95,35 +82,7 @@ * | results). * ------ -------------------------------------------------------------------------------------------------------------------------------------------------------- */ - onMetadataSearch: function(search, state) { - console.log("[INFO]: onMetadataSearch called", search); - - var message = ""; - - switch(state) { - - case 0: - - console.log("RESULT FOUND :-) :-) :-) X-D"); - console.log(getCurrentChannelProgramName(search.result[0])); - break; - - case 3: - - message = " MetadataSearch in Idle state because of either search abort or parameters have been modified \ - (query, constraints or search target)"; - break; - - case 4: - - message = " The search cannot be complete because of lack of ressources or any other reason.\ - (memory insufficient to cache all of the requested results.)"; - break; - - default: - console.log("Unknow state :("); - } - }, + onMetadataSearch: null, init: function() { @@ -169,284 +128,3 @@ } }); - -/* -* Description: -* A MetadataSearch object represents a query of the metadata about available programmes. Applications can create -* MetadataSearch objects using the createSearch() method on the application/oipfSearchManager -* object. When metadata queries are performed on a remote server, the protocol used is defined in section 4.1.2.2 of -* [OIPF_META2]. -* -* Each search consists of three steps: -* 1. Definition of the query. The application creates a MetadataSearch object, and either creates its associated -* Query object, or sets a query using the findProgrammesFromStream() method, and sets any applicable -* constraints and result ordering. -* -* 2. Acquisition of results. The OITF acquires some or all of the items that match the specified query and constraints, and -* caches the requested subset of the results. This is typically triggered by a call to getResults(). -* -* 3. Retrieval. The application accesses the results via the SearchResults class. -* The MetadataSearch and SearchResults classes work together to manage an individual search. For every search, -* the MetadataSearch object and its corresponding SearchResults object SHALL be in one of three states as -* described in table below: -* -* --------------------------------------------------------------------------------------------------------------------------------------------------------------- -* State | Description -* ---------- ---------------------------------------------------------------------------------------------------------------------------------------------------- -* Idle | The search is idle; no results are available. This is the initial state of the search. In this -* | state, the application can set or modify the query, constraints or ordering rules that are -* | applied to the search. -* | No search results are available in this state – any calls to SearchResults.item() -* | SHALL return undefined and the values of the length and totalSize properties on the -* | SearchResults object SHALL return zero. Any search results that have been cached by -* | the terminal SHALL be discarded when the Idle state is entered. -* | Calling the SearchResults.getResults() method SHALL cause a state transition to -* | the Searching state. -* ---------- --------------------------------------------------------------------------------------------------------------------------------------------------- -* Searching | Results are being retrieved and are not yet available to applications. -* | -* | If the terminal has not previously cached the full set of search results, the terminal -* | performs the search to gather the requested results. -* | -* | If a new version of the metadata is detected (e.g. due to an EIT update) while the search -* | is in this state, results SHALL be retrieved from either the new or original version of the -* | metadata but SHALL NOT be retrieved from a combination of the two versions. -* | -* | Calls to SearchResults.item() SHALL return undefined. -* | -* | Any modification of the search parameters (e.g. changing the query or adding/removing -* | constraints, or calling findProgrammesFromStream() ) by the application SHALL stop -* | the current search and cause a transition to the Idle state. The terminal SHALL dispatch a -* | MetadataSearch event with state =3. -* | -* | When all requested results have been found, the terminal SHALL dispatch a -* | MetadataSearch event with state =0 and a state transition to the Found state SHALL -* | occur. -* | -* | If the search cannot be completed due to a lack of resources or any other reason, the -* | terminal SHALL dispatch a MetadataSearch event with state =4 and a state transition to -* | the Idle state SHALL occur. -* | -* | Calls to the SearchResults.getResults() method SHALL abort the retrieval of search -* | results and attempt to retrieve the newly-requested set of results instead. -* | -* | NOTE: Calling getResults() when in the searching state may be used to fetch a group -* | of items starting at a different offset or with a different count. -* ---------- ------------------------------------------------------------------------------------------------------------------------------------------------------- -* Found | Search results are available and can be retrieved by applications. The data exposed via -* | the SearchResults.item() method is static and never changes as a result of any -* | updates to the underlying metadata database until SearchResults.getResults() is -* | next called. -* | -* | If a new version of the metadata is detected (e.g. due to an EIT update), a -* | MetadataUpdate event is dispatched with action =1. Subsequent calls to -* | SearchResult.getResults() SHALL return results based on the updated metadata. -* | -* | Calls to SearchResults.getResults() SHALL cause a state transition to the -* | Searching state. -* | -* | Any modification of the search parameters (e.g. changing the query or adding/removing -* | constraints, or calling findProgrammesFromStream() ) by the application SHALL cause -* | the current set of results to be discarded and SHALL cause a transition to the Idle state. -* | The terminal SHALL dispatch a MetadataSearch event with state =3. -* ------------------------------------------------------------------------------------------------------------------------------------------------------------------- -* -* The findProgrammesFromStream() method acts as a shortcut for setting a query and a set of constraints on the -* MetadataSearch object . Regardless of whether the query and constraints are set explicitly by the application or via -* findProgrammesFromStream() , results are retrieved using the getResults() method. -* -* Changes to the search parameters (e.g. changing the query or adding/removing constraints or modifying the search target, -* or calling findProgrammesFromStream() ) SHALL be applied when the getResults() method on the -* corresponding SearchResults object is called. Due to the nature of metadata queries, searches are asynchronous and -* events are used to notify the application that results are available. MetadataSearch events SHALL be targeted at the -* application/oipfSearchManager object. -* -* The present document is intentionally silent about the implementation of the search mechanism and the algorithm for -* retrieving and caching search results except where described in Table 7 above. When performing a search, the receiver -* MAY gather all search results and cache them (or cache a set of pointers into the full database), or gather only the subset -* of search results determined by the getResults() parameters, or take an alternative approach not described here. -*/ -var MetadataSearch = Class.extend({ - - /* - * Description: - * The subset of search results that has been requested by the application. - * - * Visibility Type: readonly SearchResults - */ - result: null, - - /* - * Description : - * The target(s) of the search. Valid values are: - * - * ----------------------------------------------------------------- - * Value | Description - * ------ ---------------------------------------------------------- - * 1 | Metadata relating to scheduled content SHALL be searched. - * 2 | Metadata relating to on-demand content SHALL be searched. - * - * These values SHALL be treated as a bitfield, allowing searches to be carried out across multiple search - * targets. - * - * Visibility: readonly - */ - searchTarget: null, - - init: function(searchTarget) { - - this.searchTarget= searchTarget; - }, - - /* - * Description: - * Set a query and constraints for retrieving metadata for programmes from a given channel - * and given start time from metadata contained in the stream as defined in section 4.1.3 of - * [OIPF_META2]. Setting the search parameters using this method will implicitly remove any - * existing constraints, ordering or queries created by prior calls to methods on this object. - * This method does not cause the search to be performed; applications must call - * getResults() to retrieve the results. - * - * Arguments: - * - channel: The channel for which programme information should be found. - * - * - startTime: The start of the time period for which results should be returned measured in - * seconds since midnight (GMT) on 1/1/1970. The start time is inclusive; any - * programmes starting at the start time, or which are showing at the start time, - * will be included in the search results. If null , the search will start from the - * current time. - * - * -count: Optional argument giving the maximum number of programmes for which - * information should be fetched. This places an upper bound on the number of - * results that will be present in the result set – for instance, specifying a value of - * 2 for this argument will result in at most two results being returned by calls to - * getResults() even if a call to getResults() requests more results. - * If this argument is not specified, no restrictions are imposed on the number of - * results which may be returned by calls to getResults(). - * - */ - findProgrammesFromStream: function(channel, startTime, count) { - console.log("[INFO]: findProgrammesFromStream [IN]"); - currentQuery = new Query(channel, startTime, count); - console.log("[INFO]: findProgrammesFromStream [Out]"); - }, - -}); - -/* -* Description: -* The SearchResults class represents the results of a metadata search. Since the result set may contain a large number -* of items, applications request a ‘window’ on to the result set, similar to the functionality provided by the OFFSET and -* LIMIT clauses in SQL. -* -* Applications MAY request the contents of the result in groups of an arbitrary size, based on an offset from the beginning -* of the result set. The data SHALL be fetched from the appropriate source, and the application SHALL be notified when -* the data is available. -* The set of results SHALL only be valid if a call to getResults() has been made and a MetadataSearch event notifying -* the application that results are available has been dispatched. If this event has not been dispatched, the set of results -* SHALL be empty (i.e. the value of the totalSize property SHALL be 0 and calls to item() SHALL return -* undefined ). -* In addition to the properties and methods defined below a SearchResults object SHALL support the array notation to -* access the results in this collection. -*/ -var SearchResults = Class.extend({ - - /* - * Description : - * The number of items in the current window within the overall result set. The value of this property SHALL be - * zero until getResults() has been called and a MetadataSearch event notifying the application that results - * are available has been dispatched. If the current window onto the result set is in fact the whole result set then - * length will be the same as totalSize. Otherwise length will be less than totalSize. - * - * Visibility: readonly - */ - lentgh: null, - - /* - * Description : - * The number of items in the current window within the overall result set. The value of this property SHALL be - * zero until getResults() has been called and a MetadataSearch event notifying the application that results - * are available has been dispatched. If the current window onto the result set is in fact the whole result set then - * length will be the same as totalSize. Otherwise length will be less than totalSize. - * - * Visibility Type: readonly Integer - */ - offset: null, - - /* - * Description : - * The total number of items in the result set. - * The value of this property SHALL be zero until getResults() has been called and a MetadataSearch - * event notifying the application that results are available has been dispatched. - * - * Visibility: readonly - */ - totalSize: null, - - init: function() { - - }, - - /* - * Description: - * Perform the search and retrieve the specified subset of the items that match the query. - * Results SHALL be returned asynchronously. A MetadataSearch event with state=0 - * SHALL be dispatched when results are available. - * This method SHALL always return false. - * - * Arguments: - * - offset: The number of items at the start of the result set to be skipped before data is retrieved. - * - * - count: The number of results to retrieve. - * - */ - getResults: function(offset, count) { - - }, - - /* - * Description: - * Abort any outstanding request for results and remove any query, constraints or ordering - * rules set on the MetadataSearch object that is associated with this SearchResults - * object. Regardless of whether or not there is an outstanding request for results, items - * currently in the collection SHALL be removed (i.e. the value of the length property SHALL - * be 0 and any calls to item() SHALL return undefined ). All cached search results SHALL - * be discarded. - * - */ - abort: function() { - - }, - - /* - * Description: - * Return the item at position index in the collection of currently available results, or - * undefined if no item is present at that position. This function SHALL only return objects - * that are instances of Programme , CODAsset , CODFolder , or CODService . - * - * Arguments: - * - index: The index into the result set. - * - */ - item: function(index) { - - } - -}); - - -var Query = Class.extend({ - - channel: null, - - startTime: null, - - count: null, - - init: function(channel, startTime, count) { - this.channel= channel; - this.startTime= startTime; - this.count= count; - } - -}); \ No newline at end of file Modified: oipf/js/initObj/init.js =================================================================== --- oipf/js/initObj/init.js 2015-02-04 13:39:59 UTC (rev 770) +++ oipf/js/initObj/init.js 2015-02-05 15:10:38 UTC (rev 771) @@ -6,380 +6,9 @@ extends: "object" }); -/* -* Description: -* The TunerCollection class represents a collection of Tuner objects. See Annex K for the definition of the collection template. -* -*/ -var TunerCollection = Collection.extend({ - - init : function(elements) { - - this.super.init(elements); - } - -}); - -/* -* Description: -* The LocalSystem object allows hardware settings related to the local device to be read and modified. -* -* Note: The standbyState property has been removed from this class. -*/ -var LocalSystem = Class.extend({ - - /* - * Description: - * Get or set the overall system volume. Valid values for this property are in the range 0 - 100. The OITF SHALL store this setting persistently. - * - * Type: Integer - */ - volume: null, - - /* - * Description: - * Get or set the mute status of the default audio output(s). A value of true indicates that the default output(s) are currently muted. - * - * Type: Boolean - */ - mute: null, - - /* - * Description: - * A collection of Tuner objects representing the physical tuners available in the OITF. - * - * Visibility Type: readonly TunerCollection - */ - tuners: null, - - init: function() { - - } - -}); - -/* -* Description: -* The Channel object represents a broadcast stream or service. -* Channel objects typically represent channels stored in the channel list (see section 7.13.10). Channel objects may also -* represent locally defined channels created by an application using the createChannelObject() methods on the -* video/broadcast embedded object or the ChannelConfig class or the createChannelList() method on the -* ChannelConfig class. Accessing the channel property of a ScheduledRecording object or Recording object -* which is scheduled on a locally defined channel SHALL return a Channel object representing that locally defined -* channel. -* Except for the hidden property, writing to the writable properties on a Channel object SHALL have no effect for -* Channel objects representing channels stored in the channel list. Applications SHOULD only change these writable -* properties of a locally defined channel before the Channel object is referenced by another object or passed to an API -* call as an input parameter. The effects of writing to these properties at any other time is implementation dependent. -* The LocalSystem object allows hardware settings related to the local device to be read and modified. -* -* Note: The standbyState property has been removed from this class. -*/ -var Channel = Class.extend({ - - /* - * Description: - * The type of channel. The value MAY be indicated by one of the TYPE_* constants defined above. If the - * type of the channel is unknown then the value SHALL be “ undefined ”. - * NOTE: Values of this type between 256 and 511 are reserved for use by related specifications on request by - * liaison. - * - * Visibility Type: readonly Integer - */ - channelType: null, - - /* - * Description: - * The name of the channel. Can be used for linking analog channels without CNI. Typically, it will contain the - * call sign of the station (e.g. 'HBO'). - * - * Type: String - */ - name: null, - - /* - * Description: - * Optional unique identifier of the tuner within the scope of the OITF that is able to receive the given channel. - * - * Visibility Type: readonly String - */ - tunerID: null, - - init: function(name , channelType) { - this.name = name; - this.channelType = CHANNEL_CONSTANT[channelType]; - } - -}); - -/* -* Description: -* A Tuner object represents the source of broadcast content provided through a physical tuner in the OITF. Each Tuner -* object is represented by a <video_broadcast> element in the capability description as defined in section 9.3.1. -* A Tuner object that is capable of tuning at the same time to multiple transponders SHALL have the nrstreams attribute -* of the <video_broadcast> element set to a value equal to the number of transponders. -* A Tuner object that is capable of tuning to transponders of different types SHALL include all those types in the types -* attribute of the <video_broadcast> element. -* NOTE: An OITF may contain a physical tuner that has its capabilities split into multiple Tuner objects to fit the -* restrictions on the <video_broadcast> element outlined above and in section 9.3.1. -* -* Note: The standbyState property has been removed from this class. -*/ -var Tuner = Class.extend({ - - /* - * Description: A unique identifier of the tuner. - * - * Visibility Type: readonly Integer - */ - id: null, - - /* - * Description: The name of the tuner as designated in OITF. - * - * Visibility Type: readonly String - */ - name: null, - - /* - * Description: Returns a collection of the types supported by the tuner. The types are according to the ID types in section 7.13.11.1 under Channel object. - * - * Visibility Type: readonly IntegerCollection - */ - idTypes: null, - - /* - * Description: - * The property enables ( true ) and disables ( false ) the tuner. Reading the property provides the current - * state, enabled or disabled. Attempting to disable the tuner while the resource is in use has no effect and the tuner SHALL continue to be enabled. - * While disabled: - * • any external power feed (if applicable) SHALL be turned off; - * • the value of the signalInfo property is not defined; - * • the value of the lnbInfo property is not defined; - * • the tuner SHALL NOT be available for use by any JavaScript object (e.g. the video/broadcast object) or by the underlying OITF system (e.g. to perform a * scheduled recording). Note the property enableTuner is available in order to re-enable the tuner and get access to the tuner again. - * - * The set value of the property SHALL persist after OITF restarts. - * - * Type: Boolean - */ - enableTuner: null, - - /* - * Description: The property returns a SignalInfo object with signal information for example signal strength. - * - * Visibility Type: readonly SignalInfo - */ - signalInfo: null, - - /* - * Description: The property returns a LNBInfo object with information regarding the LNB associated with the tuner. - * - * Visibility Type: readonly LNBInfo - */ - lnbInfo: null, - - /* - * Description: Indicates the physical interface associated with the tuner. - * - * Visibility Type: readonly Integer - */ - frontEndPosition: null, - - /* - * Description: - * The property turns on (true) and off (false) the power applied to the external interface of the tuner unless the - * tuner is disabled. Reading the property provides the current value, on or off. Attempting to modify the - * property while the resource is in use has no effect. The value of the property SHALL persist after OITF - * restarts. - * For DVB-S/S2 power is supplied to the LNB(s) and if present the DiSEqC switch. - * For DVB-T/T2 a supply +5V is supplied to the antenna with built in amplifier. Note that applying power may - * have adverse effects to the external equipment if it has its own power supply. It is a strong recommendation - * to indicate to the end user a possible adverse effect before using this method. - * For DVB-C/C2 there is no effect. - * Reading the property provides the current value. - * - * Type: Boolean - */ - powerOnExternal: null, - - init: function() { - - } - -}); - -var Configuration = Class.extend({ - - /* - * Description: - * A comma-separated set of languages to be used for audio playback, in order of preference. Each language SHALL be indicated by its ISO 639-2 language code as * defined in [ISO 639-2]. - * - * Type: String - */ - preferredAudioLanguage: null, - - /* - * Description: - * A comma-separated set of languages to be used for subtitle playback, in order of preference. The subtitle - * component (see section 7.16.5.5) that matches the highest ordered language SHALL be activated - * (equivelant to the selectComponent method) and all other subtitle components SHALL be deactivated - * (equivelant to the unselectComponent method). - * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2] or as a - * wildcard specifier " *** ". - * If the wildcard is included it SHALL be the last item in the set. If no subtitle component in the content - * matches a language in this property and the wildcard is included then the first (lowest) subtitle component - * SHALL be selected. - * - * Type: String - */ - preferredSubtitleLanguage: null, - - /* - * Description: - * A comma-separated set of languages to be used for the user interface of a service, in order of preference. - * Each language SHALL be indicated by its ISO 639-2 language code as defined in [ISO 639-2]. - * If present, the HTTP Accept-language header shall contain the same languages as the - * preferredUILanguage property with the same order of preference. NOTE: The order of preference in the - * Accept-language header is indicated using the quality factor. - * - * Type: String - */ - preferredUILanguage: null, - - /* - * Description: - * An ISO-3166 three character country code identifying the country in which the receiver is deployed. - * - * Type: String - */ - countryId: null, - - /* - * Description: - * An integer indicating the time zone within a country in which the receiver is deployed. A value of 0 SHALL - * represent the eastern-most time zone in the country, a value of 1 SHALL represent the next time zone to - * the west, and so on. Valid values are in the range 0 – 60. - * - * Type: Integer - */ - regionId: null, - - /* - * Description: - * The policy dictates what mechanism the system should use when storage space is exceeded. - * Valid values are shown in the table below. - * ------------------------------------------------------------------------------------------------ - * Value | Description - * ------ ----------------------------------------------------------------------------------------- - * 0 | Indicates a recording management policy where no recordings are to be deleted. - * ------ ----------------------------------------------------------------------------------------- - * 1 | Indicates a recording management policy where only watched recordings MAY be deleted. - * ------ ----------------------------------------------------------------------------------------- - * 2 | Indicates a recording management policy where only recordings older than the specified - * | threshold (given by the pvrSaveDays and pvrSaveEpisodes properties) MAY be deleted. - * ------------------------------------------------------------------------------------------------ - * - * Type: Integer - */ - pvrPolicy: null, - - - /* - * Description: - * When the pvrPolicy property is set to the value 2, this property indicates the minimum number of - * episodes that SHALL be saved for series-link recordings. - * - * Type: Integer - */ - pvrSaveEpisodes: null, - - - /* - * Description: - * When the pvrPolicy property is set to the value 2, this property indicates the minimum save time (in - * days) for individual recordings. Only recordings older than the save time MAY be deleted. - * - * Type: Integer - */ - pvrSaveDays: null, - - - /* - * Description: - * The default padding (measured in seconds) to be added at the start of a recording. - * - * Type: Integer - */ - pvrStartPadding: null, - - /* - * Description: - * The default padding (measured in seconds) to be added at the end of a recording. - * - * Type: Integer - */ - pvrEndPadding: null, - - - /* - * Description: - * The time shift mode indicates the preferred mode of operation for support of timeshift playback in the - * video/broadcast object. Valid values are defined in the timeShiftMode property in section 7.13.2.2. The - * default value is 0, timeshift is turned off. - * - * Type: Integer - */ - preferredTimeShiftMode: null, - - init: function() { - - }, - - /* - * Description: - * Get the system text string that has been set for the specified key. - * - * Argument: - * -key: A key identifying the system text string to be retrieved. - * - * Return: String - */ - getText: function(key) { - - - }, - - /* - * Description: - * Set the system text string that has been set for the specified key. System text strings are - * used for automatically-generated messages in certain cases, e.g. parental control messages. - * - * Arguments: - * -key: The key for the text string to be set. Valid keys are: - * ----------------------------------------------------------------------------------------------------------------------------------------------------- - * Key | Description - * ------------------ ---------------------------------------------------------------------------------------------------------------------------------- - * no_title | Text string used as the title for programmes and channels where no guide information is available. Defaults to “No information” - * ------------------ ---------------------------------------------------------------------------------------------------------------------------------- - * no_synopsis | Text string used as the synopsis for programmes where no guide information is available. Defaults to “No further information - | available” - * ------------------ ---------------------------------------------------------------------------------------------------------------------------------- - * manual_recording | Text string used to identify a manual recording. Defaults to “Manual Recording” - * ----------------------------------------------------------------------------------------------------------------------------------------------------- - * - * -value: The new value for the system text string. - * - */ - setText: function(key, value) { - - - } - - -}); - +var currentQuery; var currentChannelType = "TYPE_TV"; var currentChannelName = "ARTE"; -var currentchannel = new Channel(currentChannelName, currentChannelType); +var currentChannel = new Channel(currentChannelName, currentChannelType); var oipfObjectFactory = new OipfObjectFactory(); var metadata = data; Modified: oipf/js/test/test.js =================================================================== --- oipf/js/test/test.js 2015-02-04 13:39:59 UTC (rev 770) +++ oipf/js/test/test.js 2015-02-05 15:10:38 UTC (rev 771) @@ -75,7 +75,39 @@ searchManagerObject = oipfObjectFactory.createSearchManagerObject(); channelConfig = oipfObjectFactory.createChannelConfig(); - metaDataSearch= searchManagerObject.createSearch(searchTarget); + metaDataSearch = searchManagerObject.createSearch(searchTarget); metaDataSearch.findProgrammesFromStream(channelConfig.currentChannel, null); metaDataSearch.result.getResults(offset,count); + + searchManagerObject.onMetadataSearch = function(search, state) { + + console.log("[INFO]: onMetadataSearch called", search); + + var message = ""; + + switch(state) { + + case 0: + + console.log("[INFO] Result found."); + console.log(search.result[0]); + break; + + case 3: + + message = " MetadataSearch in Idle state because of either search abort or parameters have been modified \ + (query, constraints or search target)"; + break; + + case 4: + + message = " The search cannot be complete because of lack of ressources or any other reason.\ + (memory insufficient to cache all of the requested results.)"; + break; + + default: + console.log("Unknow state :("); + + } + } } \ No newline at end of file Modified: oipf/view/welcome.html =================================================================== --- oipf/view/welcome.html 2015-02-04 13:39:59 UTC (rev 770) +++ oipf/view/welcome.html 2015-02-05 15:10:38 UTC (rev 771) @@ -13,6 +13,8 @@ <script src="../js/test/test.js" type="text/javascript"></script> <script> testCreatingVidBroadObj(); + //console.log(data.tv.channel); + testGetCurrentProgram(1,null,null,0,1); //document.body.innerHTML ="<object is='video-broadcast'></object>" //testCreatingSearchManagerObj();<x-foo-with-markup><x-foo-with-markup/> //testCreatingChannelConfigObj();