Sandbox-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
June 2015
- 4 participants
- 174 discussions
Author: ygrego
Date: 2015-06-09 21:38:59 +0000 (Tue, 09 Jun 2015)
New Revision: 1678
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1678
Log:
The property map and channelNameMap have not been added to the class ProgrammeHelper.
Modified:
oipf/lib/js/utils/ProgrammeHelper.js
Modified: oipf/lib/js/utils/ProgrammeHelper.js
===================================================================
--- oipf/lib/js/utils/ProgrammeHelper.js 2015-06-09 21:23:56 UTC (rev 1677)
+++ oipf/lib/js/utils/ProgrammeHelper.js 2015-06-09 21:38:59 UTC (rev 1678)
@@ -6,6 +6,30 @@
class ProgrammeHelper {
constructor(channelService) {
+ this.map = {
+ "title": "name",
+ "start": "startTime",
+ "desc": "description",
+ "length#text": "duration",
+ "episode-num#text": "episode"
+ };
+
+ this.channelNameMap = {
+ "ART1.kazer.org" : "ARTE",
+ "EUR2.kazer.org" : "D17",
+ "FRA2.kazer.org" : "FRANCE_2",
+ "FRA3.kazer.org" : "FRANCE_3",
+ "FRA4.kazer.org" : "FRANCE_4",
+ "FRA5.kazer.org" : "FRANCE_5",
+ "M61.kazer.org" : "M6",
+ "NRJ1.kazer.org" : "NRJ_12",
+ "NT11.kazer.org" : "NT1",
+ "RTL2.kazer.org" : "RTL9",
+ "TF11.kazer.org" : "TF1",
+ "TMC1.kazer.org" : "TMC",
+ "W91.kazer.org" : "W9"
+ };
+
this.programmes = null;
this.channelService = channelService;
this.programmes = [];
1
0
Author: ygrego
Date: 2015-06-09 21:23:56 +0000 (Tue, 09 Jun 2015)
New Revision: 1677
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1677
Log:
The property programmes of ProgrammeHelper don't takes part to class.
Modified:
oipf/lib/js/utils/ProgrammeHelper.js
Modified: oipf/lib/js/utils/ProgrammeHelper.js
===================================================================
--- oipf/lib/js/utils/ProgrammeHelper.js 2015-06-09 20:40:34 UTC (rev 1676)
+++ oipf/lib/js/utils/ProgrammeHelper.js 2015-06-09 21:23:56 UTC (rev 1677)
@@ -6,7 +6,7 @@
class ProgrammeHelper {
constructor(channelService) {
- programmes = null;
+ this.programmes = null;
this.channelService = channelService;
this.programmes = [];
}
1
0
Author: ygrego
Date: 2015-06-09 20:40:34 +0000 (Tue, 09 Jun 2015)
New Revision: 1676
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1676
Log:
Transformation of theses classes in ES6 classes.
Modified:
oipf/lib/js/utils/Timeout.js
oipf/lib/js/utils/TimerManager.js
oipf/lib/js/utils/TimerRecordingManager.js
oipf/lib/js/utils/XmlParser.js
oipf/lib/js/utils/XmlToJson.js
Modified: oipf/lib/js/utils/Timeout.js
===================================================================
--- oipf/lib/js/utils/Timeout.js 2015-06-09 19:40:16 UTC (rev 1675)
+++ oipf/lib/js/utils/Timeout.js 2015-06-09 20:40:34 UTC (rev 1676)
@@ -1,37 +1,39 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var Timeout = Class.extend({
- timerId: null,
-
- promise: null,
-
- init: function(time) {
+class Timeout {
+
+ constructor(time) {
+ this.timerId = null;
+
+ this.promise = null;
+
var self = this;
+
this.promise = new Promise(function(resolve, reject) {
self.timerId = setTimeout(function() {
resolve();
- }, time || 0);
+ }, time || 0);
});
- },
-
- then: function(callback) {
+ }
+
+ then(callback) {
this.promise.then(callback);
return this;
- },
-
- catch: function(callback) {
+ }
+
+ catch(callback) {
this.promise.catch(callback);
return this;
- },
-
- cancel: function() {
+ }
+
+ cancel() {
clearTimeout(this.timerId);
this.timerId = null;
this.promise = null;
}
-
-});
+}
+
Modified: oipf/lib/js/utils/TimerManager.js
===================================================================
--- oipf/lib/js/utils/TimerManager.js 2015-06-09 19:40:16 UTC (rev 1675)
+++ oipf/lib/js/utils/TimerManager.js 2015-06-09 20:40:34 UTC (rev 1676)
@@ -1,25 +1,26 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var TimerManager = Class.extend({
-
- timer: null,
+class TimerManager {
- createTimer: function(time) {
+ constructor() {
+ this.timer = null;
+ }
+
+ createTimer(time) {
this.clearTimer();
this.timer = new Timeout(time);
console.log("createTimer", this.timer.timerId);
return this.timer;
- },
+ }
- clearTimer: function() {
+ clearTimer() {
if (this.timer) {
this.timer.cancel();
console.log("cancelTimer", this.timer.timerId);
}
}
-
-});
+}
Modified: oipf/lib/js/utils/TimerRecordingManager.js
===================================================================
--- oipf/lib/js/utils/TimerRecordingManager.js 2015-06-09 19:40:16 UTC (rev 1675)
+++ oipf/lib/js/utils/TimerRecordingManager.js 2015-06-09 20:40:34 UTC (rev 1676)
@@ -1,29 +1,28 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var TimerRecordingManager = Class.extend({
-
- init: function() {
+class TimerRecordingManager {
+
+ constructor() {
this.recordingTimers = {};
- },
-
- createTimer: function(time) {
+ }
+
+ createTimer(time) {
var timer = new Timeout(time);
console.log("createTimer", timer.timerId);
return timer;
- },
+ }
- clearTimer: function(recordingID) {
+ clearTimer(recordingID) {
console.log("Method clearTimer called.");
var timers = this.recordingTimers[recordingID];
- timers.start && timers.start.cancel() &&
+ timers.start && timers.start.cancel() &&
console.log("cancelTimer", "Start timer: ", timers.start.timerId);
timers.end && timers.end.cancel() &&
console.log("cancelTimer", "End timer: ", timers.end.timerId);
}
-
-});
+}
Modified: oipf/lib/js/utils/XmlParser.js
===================================================================
--- oipf/lib/js/utils/XmlParser.js 2015-06-09 19:40:16 UTC (rev 1675)
+++ oipf/lib/js/utils/XmlParser.js 2015-06-09 20:40:34 UTC (rev 1676)
@@ -1,40 +1,40 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var XmlParser = Class.extend({
-
- init: function() {
-
+class XmlParser {
+
+ constructor() {
+
this.initParser();
this.xmlDocument;
- },
-
- initParser: function() {
+ }
+
+ initParser() {
if (window.DOMParser) {
- this.parser=new DOMParser();
+ this.parser = new DOMParser();
}
- },
-
- createAXmlStringDocument: function(defaultPropertiesObject) {
+ }
+
+ createAXmlStringDocument(defaultPropertiesObject) {
console.log("Method createAXmlStringDocument called");
var defaultProperties = defaultPropertiesObject.rearrangeDefaultProperties();
var objectsNames = Object.keys(defaultProperties);
var xmlStringDocument = "<" + defaultPropertiesObject.roots + ">";
for (var i = 0, l = objectsNames.length; i < l; i++) {
-
+
var currentObjectName = objectsNames[i];
xmlStringDocument += "<" + currentObjectName;
var currentObjectData = defaultProperties[currentObjectName];
var currentAttributes = currentObjectData.attributes;
-
+
if (currentAttributes) {
xmlStringDocument = this.createAttributes(currentAttributes,
xmlStringDocument);
}
-
+
var currentObjectValue = currentObjectData.value;
xmlStringDocument += ">" + currentObjectValue;
xmlStringDocument += "</" + currentObjectName + ">";
@@ -42,32 +42,32 @@
xmlStringDocument += "</" + defaultPropertiesObject.roots + ">";
console.log("Method createAXmlStringDocument completed");
return xmlStringDocument;
- },
-
- createAttributes: function(currentAttributes, xmlStringDocument) {
+ }
+
+ createAttributes(currentAttributes, xmlStringDocument) {
var currentAttributesNames = Object.keys(currentAttributes);
for (var i = 0, l = currentAttributesNames.length; i < l; i++) {
var currentAttributeName = currentAttributesNames[i];
var currentAttributeValue = currentAttributes[currentAttributeName];
- xmlStringDocument += " " + currentAttributeName
+ xmlStringDocument += " " + currentAttributeName
+ "='" + currentAttributeValue + "'";
}
return xmlStringDocument;
- },
-
- getXmlDocument: function(defaultProperties) {
+ }
+
+ getXmlDocument(defaultProperties) {
if (!this.parser) {
this.initParser();
}
- var xmlStringDocument =
+ var xmlStringDocument =
this.createAXmlStringDocument(defaultProperties);
-
- this.xmlDocument =
+
+ this.xmlDocument =
this.parser.parseFromString(xmlStringDocument, "text/xml");
-
+
return this.xmlDocument;
}
-
-});
+}
+
Modified: oipf/lib/js/utils/XmlToJson.js
===================================================================
--- oipf/lib/js/utils/XmlToJson.js 2015-06-09 19:40:16 UTC (rev 1675)
+++ oipf/lib/js/utils/XmlToJson.js 2015-06-09 20:40:34 UTC (rev 1676)
@@ -1,97 +1,98 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var XmlToJson = Class.extend({
- unwantedNodeName: {
- "#text": true,
- "#comment": true
- },
-
- mappingValue: {
- "true": true,
- "false": false
- },
-
- wantedNode: "channel",
-
- init: function(xmlDocument) {
+class XmlToJson {
+
+ constructor(xmlDocument) {
xmlDocument && (this.xmlDocument = xmlDocument) &&
(this.json = {}) && this.initJson();
- },
-
- initJson: function() {
+
+ this.unwantedNodeName = {
+ "#text": true,
+ "#comment": true
+ };
+
+ this.mappingValue = {
+ "true": true,
+ "false": false
+ };
+
+ this.wantedNode = "channel";
+ }
+
+ initJson() {
if (!this.xmlDocument) {
return null;
}
-
+
this.rootsNode = this.xmlDocument.firstChild;
-
+
//We already know that document contains at least one child.
var rootsName = this.rootsNode.nodeName;
this.rootsElementJson = this.json[rootsName] = {};
-
+
var rootsObject = this.json[rootsName];
-
+
this.convertAttributesToProperties(rootsObject, this.rootsNode);
- },
-
- convertAttributesToProperties: function(object, node) {
+ }
+
+ convertAttributesToProperties(object, node) {
var attributesList = node.attributes;
-
+
for (var i = 0, li = attributesList.length; i < li; i++) {
var currentAttributes = attributesList[i];
var name = currentAttributes.name;
- var value = currentAttributes.value;
+ var value = currentAttributes.value;
object[name] = value;
}
return object;
- },
-
- getJson: function() {
+ }
+
+ getJson() {
if (!this.json) {
console.log("Your xml document is not valid or null.");
return null;
}
var data = this.rootsNode.childNodes;
var dataStoredByKind = {};
-
+
for (var i = 0, li = data.length; i < li; i++) {
var currentNode = data[i];
this.setPropertiesFromDomNodeList(currentNode, this.rootsElementJson);
}
return this.json;
- },
-
- setPropertiesFromDomNodeList: function(currentNode, parentContainer) {
-
+ }
+
+ setPropertiesFromDomNodeList(currentNode, parentContainer) {
+
if (this.unwantedNodeName[currentNode.nodeName]) {
return;
}
-
+
var childNodes = currentNode.childNodes;
var childNodeName;
var currentChildNode;
var nodeDataMap = {};
if (currentNode.hasAttributes()) {
- nodeDataMap =
+ nodeDataMap =
this.convertAttributesToProperties(nodeDataMap, currentNode);
}
-
+
for (var i = 0, li = childNodes.length; i < li; i++) {
currentChildNode = childNodes[i];
childNodeName = currentChildNode.nodeName;
-
+
if (!this.unwantedNodeName[childNodeName]) {
nodeDataMap = this.setPropertiesFromDomNodeList
(currentChildNode, nodeDataMap);
}
-
- if (/\w+/.exec(currentChildNode.nodeValue) &&
+
+ if (/\w+/.exec(currentChildNode.nodeValue) &&
(currentChildNode.childNodes.length == 0)) {
-
+
if (!this.isMapNotEmpty(nodeDataMap)) {
var currentNodeName = currentNode.nodeName;
var key = currentNodeName;
@@ -99,8 +100,8 @@
this.addPropertiesToMap(parentContainer, key, value,
currentNode.parentNode);
}
-
- //This add concern only the nodes which have an atomic content
+
+ //This add concern only the nodes which have an atomic content
if (this.isMapNotEmpty(nodeDataMap) && childNodes.length == 1) {
var key = "#text";
var value = currentChildNode.nodeValue;
@@ -109,14 +110,14 @@
}
}
}
-
+
//Addition of node in parent container even if this one have not a value
- if (!this.unwantedNodeName[currentNode.nodeName] &&
+ if (!this.unwantedNodeName[currentNode.nodeName] &&
!currentChildNode) {
-
+
var currentNodeName = currentNode.nodeName;
var key = currentNodeName;
- this.addPropertiesToMap(parentContainer, key, null,
+ this.addPropertiesToMap(parentContainer, key, null,
currentNode.parentNode);
}
@@ -124,46 +125,46 @@
if (this.isMapNotEmpty(nodeDataMap)) {
var key = currentNodeName;
// parentContainer[key] = nodeDataMap;
- this.addPropertiesToMap(parentContainer, key, nodeDataMap,
+ this.addPropertiesToMap(parentContainer, key, nodeDataMap,
currentNode.parentNode);
}
-
+
return parentContainer;
- },
-
- isMapNotEmpty: function(map) {
+ }
+
+ isMapNotEmpty(map) {
return Object.keys(map).length > 0;
- },
-
+ }
+
/*
- *
+ *
*/
- addPropertiesToMap: function(map, key, value, parentNode) {
+ addPropertiesToMap(map, key, value, parentNode) {
// map[key] = value;
-
+
var childNodesWithSpecificName = parentNode.getElementsByTagName(key);
- var specificNodesNumber = childNodesWithSpecificName.length;
-
+ var specificNodesNumber = childNodesWithSpecificName.length;
+
if ((specificNodesNumber > 1) && !map[key]) {
- map[key] = [];
+ map[key] = [];
}
-
+
var nodeValue = map[key];
-
+
var value = this.setValue(value);
-
+
if (nodeValue && (nodeValue instanceof Array)) {
map[key].push(value);
} else {
map[key] = value;
}
- },
-
- setValue: function(value) {
+ }
+
+ setValue(value) {
var newValue = this.mappingValue[value];
if ((typeof value) == "string" && newValue != undefined) {
return newValue;
}
return value;
}
-});
+}
1
0
Author: ygrego
Date: 2015-06-09 19:40:16 +0000 (Tue, 09 Jun 2015)
New Revision: 1675
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1675
Log:
Refactoring of class ProgrammeService in an ES6 class.
Modified:
oipf/lib/js/utils/ProgrammeService.js
Modified: oipf/lib/js/utils/ProgrammeService.js
===================================================================
--- oipf/lib/js/utils/ProgrammeService.js 2015-06-09 16:29:13 UTC (rev 1674)
+++ oipf/lib/js/utils/ProgrammeService.js 2015-06-09 19:40:16 UTC (rev 1675)
@@ -1,12 +1,12 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var ProgrammeService = Class.extend({
-
- init: function(programmes) {
+class ProgrammeService {
+
+ constructor(programmes) {
this.programmes = programmes;
}
-});
+}
1
0
Author: ygrego
Date: 2015-06-09 16:29:13 +0000 (Tue, 09 Jun 2015)
New Revision: 1674
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1674
Log:
Refactoring of class ProgrammeHelper in an ES6 class.
Modified:
oipf/lib/js/utils/ProgrammeHelper.js
Modified: oipf/lib/js/utils/ProgrammeHelper.js
===================================================================
--- oipf/lib/js/utils/ProgrammeHelper.js 2015-06-09 16:12:46 UTC (rev 1673)
+++ oipf/lib/js/utils/ProgrammeHelper.js 2015-06-09 16:29:13 UTC (rev 1674)
@@ -3,44 +3,19 @@
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var ProgrammeHelper = Class.extend({
+class ProgrammeHelper {
- map: {
- "title": "name",
- "start": "startTime",
- "desc": "description",
- "length#text": "duration",
- "episode-num#text": "episode"
- },
-
- channelNameMap: {
- "ART1.kazer.org" : "ARTE",
- "EUR2.kazer.org" : "D17",
- "FRA2.kazer.org" : "FRANCE_2",
- "FRA3.kazer.org" : "FRANCE_3",
- "FRA4.kazer.org" : "FRANCE_4",
- "FRA5.kazer.org" : "FRANCE_5",
- "M61.kazer.org" : "M6",
- "NRJ1.kazer.org" : "NRJ_12",
- "NT11.kazer.org" : "NT1",
- "RTL2.kazer.org" : "RTL9",
- "TF11.kazer.org" : "TF1",
- "TMC1.kazer.org" : "TMC",
- "W91.kazer.org" : "W9"
- },
-
- programmes: null,
-
- init: function(channelService) {
+ constructor(channelService) {
+ programmes = null;
this.channelService = channelService;
this.programmes = [];
- },
+ }
/*
* Description:
* Don't take in charge the "credits" property of a xmlTv programmes for the moment.
*/
- initProgrammes: function(programmeList) {
+ initProgrammes(programmeList) {
for (var i = 0, l = programmeList.length; i < l; i++) {
var programme = {};
var object = programmeList[i];
@@ -61,7 +36,7 @@
channelName = self.channelNameMap[element];
}
if (key == "#text") {
- key = parentKey+key;
+ key = parentKey + key;
if (key == "length#text") {
element = self.minutesToSeconds(element);
}
@@ -82,13 +57,13 @@
}
return this.programmes;
- },
+ }
- initChannel: function(name) {
+ initChannel(name) {
return this.channelService.getADvbTChannel(name);
- },
+ }
- transformToActualDate: function(wrongDateFormat) {
+ transformToActualDate(wrongDateFormat) {
var pattern = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\s\+(\d{2})/;
var tmpDate = wrongDateFormat;
@@ -107,15 +82,15 @@
var actualDate = new Date(year, month, day, hs, mins, secs);
return actualDate;
- },
+ }
- transformInSecondSince01011970: function(wrongDateFormat) {
+ transformInSecondSince01011970(wrongDateFormat) {
return this.transformToActualDate(wrongDateFormat).getTime() / 1000;
- },
+ }
- minutesToSeconds: function(minutes) {
- return minutes*60;
+ minutesToSeconds(minutes) {
+ return minutes * 60;
}
-});
+}
1
0
Author: smaisonneuve
Date: 2015-06-09 16:12:46 +0000 (Tue, 09 Jun 2015)
New Revision: 1673
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1673
Log:
[Refactor] - Fixing VideoBroadcastObject init method
Modified:
oipf/lib/js/impl/VideoBroadcastObject.js
Modified: oipf/lib/js/impl/VideoBroadcastObject.js
===================================================================
--- oipf/lib/js/impl/VideoBroadcastObject.js 2015-06-09 15:51:00 UTC (rev 1672)
+++ oipf/lib/js/impl/VideoBroadcastObject.js 2015-06-09 16:12:46 UTC (rev 1673)
@@ -141,6 +141,10 @@
*/
this.currentChannel = null;
+ this.init();
+ }
+
+ init() {
this.playState = 0;
this._listeners = {};
this._callbacks = {};
1
0
Author: smaisonneuve
Date: 2015-06-09 15:51:00 +0000 (Tue, 09 Jun 2015)
New Revision: 1672
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1672
Log:
[Refactor] Turning SearchResults into es6 class
Modified:
oipf/lib/js/impl/model/SearchResults.js
Modified: oipf/lib/js/impl/model/SearchResults.js
===================================================================
--- oipf/lib/js/impl/model/SearchResults.js 2015-06-09 15:48:11 UTC (rev 1671)
+++ oipf/lib/js/impl/model/SearchResults.js 2015-06-09 15:51:00 UTC (rev 1672)
@@ -1,5 +1,5 @@
/*
-* Description:
+* 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.
@@ -14,113 +14,105 @@
* 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 = Array.extend({
+class SearchResults extends Array {
- /*
- * 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
- */
- length: null,
-
- /*
- * Description :
- * The current offset into the total result set.
- *
- * 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,
-
- _cachedResults: null,
-
- _search: null,
-
- init: function(search) {
+ constructor(search) {
+ super();
+
+ /*
+ * 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
+ */
+ this.length = 0;
+
+ /*
+ * Description :
+ * The current offset into the total result set.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.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
+ */
+ this.totalSize = null;
+
this._cachedResults = [];
+ this._search = search;
this._timerManager = new TimerManager();
this._timeout = this._timerManager.createTimer.bind(this._timerManager, 0);
- this._search = search;
- this.length = 0;
this.totalSize = 0;
-
- this._fireEventUncompleted = this._search._searchManager
- ._fireEventUncompleted.bind(this._search._searchManager);
- this._fireEventFinished = this._search._searchManager
- ._fireEventFinished.bind(this._search._searchManager);
+ this._methodToCall = {
+ 0: "equals",
+ 1: "notEquals",
+ 2: "superior",
+ 3: "superiorOrEquals",
+ 4: "inferior",
+ 5: "inferiorOrEquals",
+ 6: "contains"
+ };
- },
-
- _methodToCall: {
- 0: "equals",
- 1: "notEquals",
- 2: "superior",
- 3: "superiorOrEquals",
- 4: "inferior",
- 5: "inferiorOrEquals",
- 6: "contains"
- },
-
+ this._fireEventUncompleted = this._search._searchManager._fireEventUncompleted.bind(this._search._searchManager);
+ this._fireEventFinished = this._search._searchManager._fireEventFinished.bind(this._search._searchManager);
+ }
+
/*
- * 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.
- * FIXME: Yannis - 08/04/2015 - Verification about results ordering constraint
- */
- getResults: function(offset, count) {
+ * 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.
+ * FIXME: Yannis - 08/04/2015 - Verification about results ordering constraint
+ */
+ getResults(offset, count) {
var parameters = arguments;
- if (parameters.length != 2) {
+ if (parameters.length !== 2) {
throw new TypeError("Insufficient number of arguments");
}
-
+
if (!Number.isInteger(offset) ||
!Number.isInteger(count)) {
- throw new TypeError
- ("This function cannot be called with these arguments.");
+ throw new TypeError("This function cannot be called with these arguments.");
}
-
+
this.offset = offset;
this._count = count;
- var self = this;
+
var programmes = this._search._searchManager._metadata;
-
+
/*
* Verify some conditions before beginning of
- * search.
+ * search.
*/
if (this._search._currentQuery && programmes) {
-
+
/*
- * A verification must be done on the presence of cached results
- * in order to not restart a complete search when
+ * A verification must be done on the presence of cached results
+ * in order to not restart a complete search when
* that's not necessary.
*/
- if (this._cachedResults.length != 0) {
+ if (this._cachedResults.length !== 0) {
this._timeout()
.then(this._getResultFromInterval.bind(this));
-
+
} else {
this._timeout()
@@ -128,49 +120,49 @@
.then(this._timeout)
.then(this._getResultFromInterval.bind(this));
}
-
+
} else {
this._fireEventUncompleted(this._search);
}
-
+
return false;
- },
-
- begin: function(programmes) {
+ }
+
+ begin(programmes) {
/*
- * When the search corresponds to current programme
- * the code differs from other usual query.
- */
- if (this._search._currentQuery._type == "current") {
+ * When the search corresponds to current programme
+ * the code differs from other usual query.
+ */
+ if (this._search._currentQuery._type === "current") {
- this._getCurrentProgramme(programmes);
+ this._getCurrentProgramme(programmes);
- } else {
+ } else {
- this._getAnyProgramme(programmes);
- }
- },
-
+ this._getAnyProgramme(programmes);
+ }
+ }
+
/*
- * Description:
+ * 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() {
+ abort() {
this._timerManager.clearTimer();
this._search._removeConstraints();
this._search._removeQuery();
this._search._removeOrdering();
this._cachedResults.length = 0;
this.length = 0;
- },
-
- _getResultFromInterval: function() {
+ }
+
+ _getResultFromInterval() {
this.length = 0;
if (this._cachedResults) {
@@ -183,124 +175,117 @@
console.log("[Info]No results found.");
}
}
-
+
this._fireEventFinished(this._search);
this.totalSize = this._cachedResults.length;
}
- },
-
- _getAnyProgramme: function(programmes) {
-
+ }
+
+ _getAnyProgramme(programmes) {
+
for (var i = 0, l = programmes.length; i < l; i++) {
var programme = programmes[i];
if (this._evaluateQuery(this._search._currentQuery, programme)) {
var constraints = this._search.
_constraints.channels;
-
+
var next = true;
- if (constraints.length > 0 &&
+ if (constraints.length > 0 &&
oipf.utils.isPresent(constraints, programme.channel.name)) {
this._cachedResults.push(programme);
- var next = false;
+ next = false;
}
- if (next && constraints.length == 0) {
+ if (next && constraints.length === 0) {
this._cachedResults.push(programme);
-
+
}
}
}
- },
-
- _getCurrentProgramme: function(programmes) {
+ }
+
+ _getCurrentProgramme(programmes) {
var time = new Date().getTime() / 1000;
var constraints = this._search.
_constraints.channels;
-
+
for (var i = 0, l = programmes.length; i < l; i++) {
var programme = programmes[i];
-
+
if (constraints.length > 0 &&
oipf.utils.isPresent(constraints, programme.channel.name) &&
programme.duration) {
var stopTime = programme.startTime +
programme.duration;
- var self = this;
-
+
if (time >= programme.startTime && time <= stopTime) {
-
+
this._cachedResults.push(programme);
i = l;
}
}
}
- },
-
+ }
+
/*
- * Description:
+ * 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) {
+ item(index) {
return this[index];
- },
+ }
- _evaluateQuery: function(query, programme) {
+ _evaluateQuery(query, programme) {
var field = this._getPropertyName(this._search._currentQuery._field);
var comparison = this._search._currentQuery._comparison;
var value = this._search._currentQuery._value;
var methodName = this._methodToCall[comparison];
-
- if (query._and.length > 0 && query._or.length > 0) {
- return
- (oipf.utils[methodName].call(null, programme[field], value) &&
- this._evaluateQueryLoop(query._and, programme)) ||
- (oipf.utils[methodName].call(null, programme[field], value) ||
- this._evaluateQueryLoop(query._and, programme));
+ if (query._and.length > 0 && query._or.length > 0) {
- } else if (query._and.length > 0 && query._or.length == 0) {
+ return (oipf.utils[methodName].call(null, programme[field], value) && this._evaluateQueryLoop(query._and, programme))
+ || (oipf.utils[methodName].call(null, programme[field], value)
+ || this._evaluateQueryLoop(query._and, programme));
- return
- (oipf.utils[methodName].call(null, programme[field], value) &&
- this._evaluateQueryLoop(query._and, programme));
+ } else if (query._and.length > 0 && query._or.length === 0) {
- } else if (query._or.length > 0 && query._and.length == 0) {
+ return (oipf.utils[methodName].call(null, programme[field], value) && this._evaluateQueryLoop(query._and, programme));
- return
- (oipf.utils[methodName].call(null, programme[field], value) &&
- this._evaluateQueryLoop(query._or, programme));
+ } else if (query._or.length > 0 && query._and.length === 0) {
- } else if (query._and.length == 0 && query._or.length == 0) {
- return (oipf.utils[methodName].call(null, programme[field], value));
- }
-
- },
-
- _evaluateQueryLoop: function(query, programme) {
+ return (oipf.utils[methodName].call(null, programme[field], value) && this._evaluateQueryLoop(query._or, programme));
+
+ } else if (query._and.length === 0 && query._or.length === 0) {
+ return (oipf.utils[methodName].call(null, programme[field], value));
+ }
+
+ }
+
+ _evaluateQueryLoop(query, programme) {
for (var i = 0, l = query; i < l; i++) {
if (!this._evaluateQuery(query, programme)) {
return false;
}
}
- },
-
- _getPropertyName: function(field) {
+ }
+
+ _getPropertyName(field) {
var pattern = /\w+.(\w+)/;
var propertyName = pattern.exec(field);
-
+
return propertyName[1];
}
-
-});
\ No newline at end of file
+
+}
1
0
Author: ygrego
Date: 2015-06-09 15:48:11 +0000 (Tue, 09 Jun 2015)
New Revision: 1671
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1671
Log:
Refactoring of the classes MetadataManager and Metadata in ES6 classes.
Modified:
oipf/lib/js/utils/EventManager.js
oipf/lib/js/utils/MetaData.js
oipf/lib/js/utils/MetadataManager.js
Modified: oipf/lib/js/utils/EventManager.js
===================================================================
--- oipf/lib/js/utils/EventManager.js 2015-06-09 15:43:19 UTC (rev 1670)
+++ oipf/lib/js/utils/EventManager.js 2015-06-09 15:48:11 UTC (rev 1671)
@@ -47,5 +47,3 @@
return new CustomEvent(type, {detail: param});
}
}
-
-
Modified: oipf/lib/js/utils/MetaData.js
===================================================================
--- oipf/lib/js/utils/MetaData.js 2015-06-09 15:43:19 UTC (rev 1670)
+++ oipf/lib/js/utils/MetaData.js 2015-06-09 15:48:11 UTC (rev 1671)
@@ -1,9 +1,9 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var MetaData = Class.extend({
-
-});
+class MetaData {
+
+}
Modified: oipf/lib/js/utils/MetadataManager.js
===================================================================
--- oipf/lib/js/utils/MetadataManager.js 2015-06-09 15:43:19 UTC (rev 1670)
+++ oipf/lib/js/utils/MetadataManager.js 2015-06-09 15:48:11 UTC (rev 1671)
@@ -1,27 +1,29 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var MetadataManager = Class.extend({
-
- metadata: {},
-
- addMetadata: function(metadata) {
+class MetadataManager {
+
+ constructor() {
+ this.metadata = {};
+ }
+
+ addMetadata(metadata) {
var type = metadata.type;
-
+
if (type) {
this.metadata[type] = metadata;
return true;
}
return false;
- },
-
- getMetadata: function(type) {
+ }
+
+ getMetadata(type) {
if (type && this.metadata) {
return this.metadata[type];
}
return null;
}
-});
+}
1
0
Author: ygrego
Date: 2015-06-09 15:43:19 +0000 (Tue, 09 Jun 2015)
New Revision: 1670
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1670
Log:
Refactoring of the class EventManager in an ES6 class.
Modified:
oipf/lib/js/utils/EventManager.js
Modified: oipf/lib/js/utils/EventManager.js
===================================================================
--- oipf/lib/js/utils/EventManager.js 2015-06-09 15:42:18 UTC (rev 1669)
+++ oipf/lib/js/utils/EventManager.js 2015-06-09 15:43:19 UTC (rev 1670)
@@ -1,48 +1,51 @@
-/*
+/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
-var EventManager = Class.extend({
-
- addEventListener: function(type, listener, target) {
+class EventManager {
+ constructor() {
+ }
+
+ addEventListener(type, listener, target) {
var listenersList = target._listeners[type];
-
+
if (listenersList) {
listenersList.push(listener);
} else {
target._listeners[type] = [listener];
}
- },
+ }
- fireEvent: function(event, target) {
+ fireEvent(event, target) {
var listeners = target._listeners[event.type];
-
- listeners && listeners.forEach(function(listener){
- console.log(">>fireEvent")
+
+ listeners && listeners.forEach(function(listener) {
+ console.log(">>fireEvent");
+
oipf.utils.timeout(0)
- .then(listener.apply.bind(listener, target, event.detail));
+ .then(listener.apply.bind(listener, target, event.detail));
});
-
+
var callback = target._callbacks[event.type];
-
- callback && callback.apply(target, event.detail);
- },
- removeEventListener: function(type, listener, target){
+ callback && callback.apply(target, event.detail);
+ }
+
+ removeEventListener(type, listener, target) {
var listeners = target._listeners[type];
-
+
if (listeners) {
- target._listeners[type] = listeners.filter(function(currentListener){
+ target._listeners[type] = listeners.filter(function(currentListener) {
return currentListener != listener;
});
}
- },
-
- createCustomEvent: function(type, param) {
- return new CustomEvent(type, {detail :param});
}
-});
+ createCustomEvent(type, param) {
+ return new CustomEvent(type, {detail: param});
+ }
+}
+
1
0
Author: jruchaud
Date: 2015-06-09 15:42:18 +0000 (Tue, 09 Jun 2015)
New Revision: 1669
Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1669
Log:
Use class
Modified:
oipf/lib/js/impl/model/Programme.js
oipf/lib/js/impl/model/Query.js
oipf/lib/js/impl/model/Recording.js
oipf/lib/js/impl/model/ScheduledRecording.js
oipf/lib/js/impl/model/ScheduledRecordingCollection.js
Modified: oipf/lib/js/impl/model/Programme.js
===================================================================
--- oipf/lib/js/impl/model/Programme.js 2015-06-09 15:39:44 UTC (rev 1668)
+++ oipf/lib/js/impl/model/Programme.js 2015-06-09 15:42:18 UTC (rev 1669)
@@ -8,7 +8,7 @@
* the (scheduled) recording with programme metadata. The use of these metadata properties is optional. If such programme
* metadata is provided, it is retained in the ScheduledRecording object that is returned if the recording of the
* programme was scheduled successfully.
-*
+*
* Metadata extensions to Programme:
* The OITF SHALL extend the Programme class defined in section 7.16.2 with the properties and methods described
* below.
@@ -26,351 +26,325 @@
* Clients supporting the recording management APIs defined in this section SHALL indicate this by adding the attribute
* " manageRecordings " to the <recording> element with a value unequal to ‘ none ’ in the client capability
* description as defined in section 9.3.3.
-*
*/
+class Programme {
-var Programme = Class.extend({
-
/*
- * Description:
- * The short name of the programme, e.g. 'Star Trek: DS9'.
- */
- name: null,
+ * FIXME:
+ * Yannis - 30/04/2015 - The properties initialized here must be disappear
+ * in future.
+ *
+ * @param {Object} initObject
+ * @returns {undefined}
+ */
+ constructor(initObject) {
+ /*
+ * Description:
+ * The short name of the programme, e.g. 'Star Trek: DS9'.
+ */
+ this.name = null;
- /*
- * Description:
- * The long name of the programme, e.g. 'Star Trek: Deep Space Nine'. If the long name is not available, this property will be undefined.
- */
- longName: null,
+ /*
+ * Description:
+ * The long name of the programme, e.g. 'Star Trek: Deep Space Nine'. If the long name is not available, this property will be undefined.
+ */
+ this.longName = null;
- /*
- * Description:
- * The description of the programme, e.g. an episode synopsis. If no description is available, this property will be undefined.
- */
- description: null,
+ /*
+ * Description:
+ * The description of the programme, e.g. an episode synopsis. If no description is available, this property will be undefined.
+ */
+ this.description = null;
- /*
- * Description:
- * The long description of the programme. If no description is available, this property will be undefined .
- */
- longDescription: null,
-
- /*
- * Description:
- * The long description of the programme. If no description is available, this property will be undefined .
- */
- startTime: null,
+ /*
+ * Description:
+ * The long description of the programme. If no description is available, this property will be undefined .
+ */
+ this.longDescription = null;
- /*
- * Description:
- * The duration of the programme (in seconds).
- */
- duration: null,
-
- /*
- * Description:
- * The identifier of the channel from which the broadcasted content is to be recorded. Specifies either a ccid or
- * ipBroadcastID (as defined by the Channel object in section 7.13.11)
- */
- channelID: null,
-
- /*
- * Description:
- * The episode number for the programme if it is part of a series. This property is undefined when the
- * programme is not part of a series or the information is not available.
- */
- episode: null,
+ /*
+ * Description:
+ * The long description of the programme. If no description is available, this property will be undefined .
+ */
+ this.startTime = null;
- /*
- * Description:
- * If the programme is part of a series, the total number of episodes in the series. This property is undefined
- * when the programme is not part of a series or the information is not available.
- */
- totalEpisodes: null,
+ /*
+ * Description:
+ * The duration of the programme (in seconds).
+ */
+ this.duration = null;
- /*
- * Description:
- * Flag indicating whether the programme has 3D video.
- *
- * Visibility Type: readonly Boolean
- */
- is3D: null,
+ /*
+ * Description:
+ * The identifier of the channel from which the broadcasted content is to be recorded. Specifies either a ccid or
+ * ipBroadcastID (as defined by the Channel object in section 7.13.11)
+ */
+ this.channelID = null;
- /*
- * Description:
- * The unique identifier of the programme or series, e.g., a TV-Anytime CRID (Content Reference Identifier).
- */
- programmeID: null,
+ /*
+ * Description:
+ * The episode number for the programme if it is part of a series. This property is undefined when the
+ * programme is not part of a series or the information is not available.
+ */
+ this.episode = null;
- /*
- * Description:
- * The type of identification used to reference the programme, as indicated by one of the ID_* constants
- * defined above.
- */
- programmeIDType: null,
+ /*
+ * Description:
+ * If the programme is part of a series, the total number of episodes in the series. This property is undefined
+ * when the programme is not part of a series or the information is not available.
+ */
+ this.totalEpisodes = null;
- /*
- * Description:
- * The TV-Anytime Instance Metadata ID for this programme.
- *
- * Visibility Type: readonly String
- */
- IMI: null,
-
- /*
- * Description:
- * A collection of parental rating values for the programme for zero or more parental rating schemes supported
- * by the OITF. For instances of the Programme class created by the createProgramme() method defined in
- * section 7.10.1.1, the initial value of this property (upon creation of the Programme object) is an instance of
- * the ParentalRatingCollection object (as defined in section 7.9.5) with length 0. Parental rating values
- * can be added to this empty readonly parental rating collection by using the addParentalRating() method
- * of the ParentalRatingCollection object. The ParentalRatingCollection is defined in section 7.9.5.
- * The related ParentalRating and ParentalRatingScheme objects are defined in section 7.9.4 and 7.9.2
- * respectively.
- * For instances of the Programme class returned through the metadata APIs defined in section 7.12 or through
- * the programmes property of the video/broadcast object defined in section 7.13.3, the initial value of this
- * property SHALL include the parental rating value(s) carried in the metadata or DVB-SI entry describing the
- * programme, if this information is included.
- * Note that if the service provider specifies a certain parental rating (e.g. PG-13) through this property and the
- * actual parental rating extracted from the stream says that the content is rated PG-16, then the conflict
- * resolution is implementation dependent.
- *
- * Visibility Type: readonly ParentalRatingCollection
- */
- parentalRatings: null,
-
- /*
- * Description:
- * The group CRIDs associated with this programme.
- *
- * Visibility Type: readonly StringCollection
- */
- groupCRIDs: null,
+ /*
+ * Description:
+ * Flag indicating whether the programme has 3D video.
+ *
+ * Visibility Type: readonly Boolean
+ */
+ this.is3D = null;
-
-
-
- /*
- * Description:
- * Reference to the broadcast channel where the programme is available.
- * The value of this field is derived from the serviceIDref attribute of the Schedule element that refers to this
- * programme.
- *
- * Visibility Type: readonly Channel
- */
- channel: null,
-
- /*
- * Description:
- * Reference to the broadcast channel where the programme is available.
- * The value of this field is derived from the serviceIDref attribute of the Schedule element that refers to this
- * programme.
- * Flag indicating whether the programme is blocked due to parental control settings or conditional access
- * restrictions.
- * The blocked and locked properties work together to provide a tri-state flag describing the status of a
- * programme. This can best be described by the following table:
- * -------------------------------------------------------------------------------------------------------
- * Description | blocked | locked
- * ------------------------------------------------------------------------------ ----------- ------------
- * No parental control applies. | false | false
- * ------------------------------------------------------------------------------ ----------- ------------
- * Item is above the parental rating threshold (or manually blocked); no PIN has | true | true
- * been entered to view it and so the item cannot currently be viewed. | |
- * ------------------------------------------------------------------------------ ----------- ------------
- * Item is above the parental rating threshold (or manually blocked); the PIN has| true | false
- * been entered and so the item can be viewed. | |
- * ------------------------------------------------------------------------------ ----------- ------------
- * Invalid combination – OITFs SHALL NOT support this combination | false | true
- * -------------------------------------------------------------------------------------------------------
- *
- * Visibility Type: readonly Boolean
- */
- blocked: null,
-
- /*
- * Description:
- * Flag indicating the type of show (live, first run, rerun, etc,).
- * The value of this property is determined by the child elements of the programme’s BroadcastEvent or
- * ScheduleEvent element from the Program Location Table. Values are determined as follows:
- * programme.
- * Flag indicating whether the programme is blocked due to parental control settings or conditional access
- * restrictions.
- * The blocked and locked properties work together to provide a tri-state flag describing the status of a
- * programme. This can best be described by the following table:
- * ----------------------------------------------------------------------------------
- * Value | Description
- * ----------------------------------------------------------------------------------
- * 1 | The programme is live; indicated by the presence of a Live element with
- * | a value attribute set to true.
- * ----------------------------------------------------------------------------------
- * 2 | The programme is a first-run show; indicated by the presence of a
- * | FirstShowing element with a value attribute set to true.
- * ----------------------------------------------------------------------------------
- * 3 | The programme is a rerun; indicated by the presence of a Repeat
- * | element with a value attribute set to true.
- * ----------------------------------------------------------------------------------
- *
- * If none of the above conditions are met, the default value of this field SHALL be 2.
- *
- * Visibility Type: readonly Boolean
- */
- showType: null,
-
- /*
- * Description:
- * Flag indicating whether subtitles or closed-caption information is available.
- * This flag SHALL be true if one or more BCG CaptionLanguage elements are present in this programme’s
- * description, false otherwise.
- *
- * Type: Boolean
- */
- subtitles: null,
-
- /*
- * Description:
- * Flag indicating whether the programme has high-definition video.
- * This flag SHALL be true if a VerticalSize element is present in the programme’s description and has a
- * value greater than 576, false otherwise.
- *
- * Type: Boolean
- */
- isHD: null,
-
- /*
- * Description:
- * Bitfield indicating the type of audio that is available for the programme.
- * The value of this field is determined by the NumOfChannels elements in a programme’s A/V attributes.
- * Values are determined as follows:
- *
- * -------------------------------------------------------------------------------------------------------
- * Value | Description
- * -------------------------------------------------------------------------------------------------------
- * 1 | A mono audio stream is available (at least one AvAttributes.AudioAttributes element is present
- * | which has a child NumOfChannels element whose value is 1).
- * -------------------------------------------------------------------------------------------------------
- * 2 | A mono audio stream is available (at least one AvAttributes.AudioAttributes element is present
- * | which has a child NumOfChannels element whose value is 2).
- * -------------------------------------------------------------------------------------------------------
- * 4 | A mono audio stream is available (at least one AvAttributes.AudioAttributes element is present
- * | which has a child NumOfChannels element whose value is 4).
- * -------------------------------------------------------------------------------------------------------
- * For programmes with multiple audio streams, these values may be ORed together.
- */
- audioType: null,
-
- /*
- * Description:
- * Flag indicating whether more than one audio language is available for the programme.
- * This flag SHALL be true if more than one BCG Language element is present in the programme’s
- * description, false otherwise.
- *
- * Visibility Type: Boolean
- */
- isMultilingual: null,
+ /*
+ * Description:
+ * The unique identifier of the programme or series, e.g., a TV-Anytime CRID (Content Reference Identifier).
+ */
+ this.programmeID = null;
- /*
- * Description:
- * A collection of genres that describe this programme.
- * The value of this field is the concatenation of the values of any Name elements that are children of Genre
- * elements in the programme’s description.
- *
- * Type: StringCollection
- */
- genre: null,
+ /*
+ * Description:
+ * The type of identification used to reference the programme, as indicated by one of the ID_* constants
+ * defined above.
+ */
+ this.programmeIDType = null;
- /*
- * Description:
- * Flag indicating whether the Programme has a recording associated with it (either scheduled, in progress, or
- * completed).
- *
- * Type: readonly Boolean
- */
- hasRecording: null,
+ /*
+ * Description:
+ * The TV-Anytime Instance Metadata ID for this programme.
+ *
+ * Visibility Type: readonly String
+ */
+ this.IMI = null;
- /*
- * Description:
- * Supported audio languages, indicated by their ISO.639-2 language codes as defined in [ISO 639-2].
- *
- * Type: StringCollection
- */
- audioLanguages: null,
+ /*
+ * Description:
+ * A collection of parental rating values for the programme for zero or more parental rating schemes supported
+ * by the OITF. For instances of the Programme class created by the createProgramme() method defined in
+ * section 7.10.1.1, the initial value of this property (upon creation of the Programme object) is an instance of
+ * the ParentalRatingCollection object (as defined in section 7.9.5) with length 0. Parental rating values
+ * can be added to this empty readonly parental rating collection by using the addParentalRating() method
+ * of the ParentalRatingCollection object. The ParentalRatingCollection is defined in section 7.9.5.
+ * The related ParentalRating and ParentalRatingScheme objects are defined in section 7.9.4 and 7.9.2
+ * respectively.
+ * For instances of the Programme class returned through the metadata APIs defined in section 7.12 or through
+ * the programmes property of the video/broadcast object defined in section 7.13.3, the initial value of this
+ * property SHALL include the parental rating value(s) carried in the metadata or DVB-SI entry describing the
+ * programme, if this information is included.
+ * Note that if the service provider specifies a certain parental rating (e.g. PG-13) through this property and the
+ * actual parental rating extracted from the stream says that the content is rated PG-16, then the conflict
+ * resolution is implementation dependent.
+ *
+ * Visibility Type: readonly ParentalRatingCollection
+ */
+ this.parentalRatings = null;
- /*
- * Description:
- * Supported subtitle languages, indicated by their ISO.639-2 language codes as defined in [ISO 639-2].
- *
- * Visibility Type: readonly StringCollection
- */
- subtitleLanguages: null,
+ /*
+ * Description:
+ * The group CRIDs associated with this programme.
+ *
+ * Visibility Type: readonly StringCollection
+ */
+ this.groupCRIDs = null;
- /*
- * Description:
- * Flag indicating whether the current state of the parental control system prevents the programme from being
- * viewed (e.g. a correct parental control PIN has not been entered to allow the programme to be viewed).
- *
- * Visibility Type: readonly Boolean
- */
- locked: null,
-
- /*
- * Description:
- * If available, this property represents the recording associated with this programme (either scheduled, in-
- * progress or completed). Has value undefined if this programme has no scheduled recording associated with
- * it.
- *
- * Visibility Type: readonly ScheduledRecording
- */
- recording: null,
+ /*
+ * Description:
+ * Reference to the broadcast channel where the programme is available.
+ * The value of this field is derived from the serviceIDref attribute of the Schedule element that refers to this
+ * programme.
+ *
+ * Visibility Type: readonly Channel
+ */
+ this.channel = null;
- /*
- * FIXME:
- * Yannis - 30/04/2015 - The properties initialized here must be disappear
- * in future.
- *
- * @param {Object} initObject
- * @returns {undefined}
- */
- init: function(initObject) {
- oipf.utils.initProperties.call(this, initObject);
+ /*
+ * Description:
+ * Reference to the broadcast channel where the programme is available.
+ * The value of this field is derived from the serviceIDref attribute of the Schedule element that refers to this
+ * programme.
+ * Flag indicating whether the programme is blocked due to parental control settings or conditional access
+ * restrictions.
+ * The blocked and locked properties work together to provide a tri-state flag describing the status of a
+ * programme. This can best be described by the following table:
+ * -------------------------------------------------------------------------------------------------------
+ * Description | blocked | locked
+ * ------------------------------------------------------------------------------ ----------- ------------
+ * No parental control applies. | false | false
+ * ------------------------------------------------------------------------------ ----------- ------------
+ * Item is above the parental rating threshold (or manually blocked); no PIN has | true | true
+ * been entered to view it and so the item cannot currently be viewed. | |
+ * ------------------------------------------------------------------------------ ----------- ------------
+ * Item is above the parental rating threshold (or manually blocked); the PIN has| true | false
+ * been entered and so the item can be viewed. | |
+ * ------------------------------------------------------------------------------ ----------- ------------
+ * Invalid combination – OITFs SHALL NOT support this combination | false | true
+ * -------------------------------------------------------------------------------------------------------
+ *
+ * Visibility Type: readonly Boolean
+ */
this.blocked = null;
- this.longName = null;
- this.longDescription = null;
- this.channelID = null;
- this.totalEpisodes = null;
- this.is3D = null;
- this.programmeIDType = null;
- this.IMI = null;
- this.parentalRatings = null;
- this.groupCRIDs = null;
+
+ /*
+ * Description:
+ * Flag indicating the type of show (live, first run, rerun, etc,).
+ * The value of this property is determined by the child elements of the programme’s BroadcastEvent or
+ * ScheduleEvent element from the Program Location Table. Values are determined as follows:
+ * programme.
+ * Flag indicating whether the programme is blocked due to parental control settings or conditional access
+ * restrictions.
+ * The blocked and locked properties work together to provide a tri-state flag describing the status of a
+ * programme. This can best be described by the following table:
+ * ----------------------------------------------------------------------------------
+ * Value | Description
+ * ----------------------------------------------------------------------------------
+ * 1 | The programme is live; indicated by the presence of a Live element with
+ * | a value attribute set to true.
+ * ----------------------------------------------------------------------------------
+ * 2 | The programme is a first-run show; indicated by the presence of a
+ * | FirstShowing element with a value attribute set to true.
+ * ----------------------------------------------------------------------------------
+ * 3 | The programme is a rerun; indicated by the presence of a Repeat
+ * | element with a value attribute set to true.
+ * ----------------------------------------------------------------------------------
+ *
+ * If none of the above conditions are met, the default value of this field SHALL be 2.
+ *
+ * Visibility Type: readonly Boolean
+ */
this.showType = null;
+
+ /*
+ * Description:
+ * Flag indicating whether subtitles or closed-caption information is available.
+ * This flag SHALL be true if one or more BCG CaptionLanguage elements are present in this programme’s
+ * description, false otherwise.
+ *
+ * Type: Boolean
+ */
this.subtitles = null;
+
+ /*
+ * Description:
+ * Flag indicating whether the programme has high-definition video.
+ * This flag SHALL be true if a VerticalSize element is present in the programme’s description and has a
+ * value greater than 576, false otherwise.
+ *
+ * Type: Boolean
+ */
this.isHD = null;
+
+ /*
+ * Description:
+ * Bitfield indicating the type of audio that is available for the programme.
+ * The value of this field is determined by the NumOfChannels elements in a programme’s A/V attributes.
+ * Values are determined as follows:
+ *
+ * -------------------------------------------------------------------------------------------------------
+ * Value | Description
+ * -------------------------------------------------------------------------------------------------------
+ * 1 | A mono audio stream is available (at least one AvAttributes.AudioAttributes element is present
+ * | which has a child NumOfChannels element whose value is 1).
+ * -------------------------------------------------------------------------------------------------------
+ * 2 | A mono audio stream is available (at least one AvAttributes.AudioAttributes element is present
+ * | which has a child NumOfChannels element whose value is 2).
+ * -------------------------------------------------------------------------------------------------------
+ * 4 | A mono audio stream is available (at least one AvAttributes.AudioAttributes element is present
+ * | which has a child NumOfChannels element whose value is 4).
+ * -------------------------------------------------------------------------------------------------------
+ * For programmes with multiple audio streams, these values may be ORed together.
+ */
this.audioType = null;
+
+ /*
+ * Description:
+ * Flag indicating whether more than one audio language is available for the programme.
+ * This flag SHALL be true if more than one BCG Language element is present in the programme’s
+ * description, false otherwise.
+ *
+ * Visibility Type: Boolean
+ */
this.isMultilingual = null;
+
+ /*
+ * Description:
+ * A collection of genres that describe this programme.
+ * The value of this field is the concatenation of the values of any Name elements that are children of Genre
+ * elements in the programme’s description.
+ *
+ * Type: StringCollection
+ */
this.genre = null;
+
+ /*
+ * Description:
+ * Flag indicating whether the Programme has a recording associated with it (either scheduled, in progress, or
+ * completed).
+ *
+ * Type: readonly Boolean
+ */
this.hasRecording = null;
+
+ /*
+ * Description:
+ * Supported audio languages, indicated by their ISO.639-2 language codes as defined in [ISO 639-2].
+ *
+ * Type: StringCollection
+ */
this.audioLanguages = null;
+
+ /*
+ * Description:
+ * Supported subtitle languages, indicated by their ISO.639-2 language codes as defined in [ISO 639-2].
+ *
+ * Visibility Type: readonly StringCollection
+ */
this.subtitleLanguages = null;
+
+ /*
+ * Description:
+ * Flag indicating whether the current state of the parental control system prevents the programme from being
+ * viewed (e.g. a correct parental control PIN has not been entered to allow the programme to be viewed).
+ *
+ * Visibility Type: readonly Boolean
+ */
this.locked = null;
+
+ /*
+ * Description:
+ * If available, this property represents the recording associated with this programme (either scheduled, in-
+ * progress or completed). Has value undefined if this programme has no scheduled recording associated with
+ * it.
+ *
+ * Visibility Type: readonly ScheduledRecording
+ */
this.recording = null;
- },
-
+
+ oipf.utils.initProperties.call(this, initObject);
+ }
+
/*
- * Description:
+ * Description:
* Get the value of the field referred to by fieldId that is contained in the metadata for this
* programme. If the field does not exist, this method SHALL return undefined .
*
- * Arguments:
+ * Arguments:
* - fieldId: The name of the field whose value SHALL be retrieved.
*
* Return: String
*/
- getField: function(fieldId) {
-
- },
-
+ getField(fieldId) {
+
+ }
+
/*
- * Description:
+ * Description:
* Get the contents of the descriptor specified by descriptorTag from the DVB SI EIT
* programme's descriptor loop. If more than one descriptor with the specified tag is available for
* the given programme, the contents of all matching descriptors SHALL be returned in the
@@ -394,7 +368,7 @@
* via MetadataSearch events targeted at the application/oipfSearchManager object
* used to retrieve the programme metadata.
*
- * Arguments:
+ * Arguments:
* - descriptorTag: The descriptor tag as specified by [EN 300 468].
*
* - descriptorTag: An optional argument giving the descriptor tag extension as
@@ -407,9 +381,8 @@
*
* Return: StringCollection
*/
- getSIDescriptors: function(descriptorTag, descriptorTagExtension, privateDataSpecifier) {
-
-
+ getSIDescriptors(descriptorTag, descriptorTagExtension, privateDataSpecifier) {
+
}
-});
\ No newline at end of file
+}
Modified: oipf/lib/js/impl/model/Query.js
===================================================================
--- oipf/lib/js/impl/model/Query.js 2015-06-09 15:39:44 UTC (rev 1668)
+++ oipf/lib/js/impl/model/Query.js 2015-06-09 15:42:18 UTC (rev 1669)
@@ -1,33 +1,25 @@
/*
* The Query class represents a metadata query that the user wants to carry out.
* This may be a simple search, or a complex search involving Boolean logic.
- * Queries are immutable; an operation on a query SHALL return
- * a new Query object, allowing applications to continue referring to
+ * Queries are immutable; an operation on a query SHALL return
+ * a new Query object, allowing applications to continue referring to
* the original query.
*/
-var Query = Class.extend({
-
- _inverse: {
- 0: 1,
- 1: 0,
- 2: 4,
- 3: 5,
- 4: 2,
- 5: 3,
- 6: 1
- },
-
- _type: null,
-
- _field: null,
-
- _comparison: null,
-
- _value: null,
-
- init: function(field, comparison, value, count) {
+class Query {
+
+ constructor(field, comparison, value, count) {
+ this._inverse = {
+ 0: 1,
+ 1: 0,
+ 2: 4,
+ 3: 5,
+ 4: 2,
+ 5: 3,
+ 6: 1
+ };
+
if (field == "startTime" && value == null) {
- this._type = "current";
+ this._type = "current";
} else {
this._type = "undifferent";
}
@@ -39,40 +31,34 @@
if (count) {
this._count = count;
}
- },
-
- and: function(query) {
-
+ }
+
+ and(query) {
var queryClone = this._cloneKeys(this);
queryClone._and && queryClone._and.push(query);
-
+
return queryClone;
- },
-
- or: function(query) {
-
+ }
+
+ or(query) {
var queryClone = this._cloneKeys(this);
queryClone._or && queryClone._or.push(query);
-
+
return queryClone;
- },
-
- _cloneKeys: function(query) {
-
+ }
+
+ _cloneKeys(query) {
var keys = Object.keys(query);
var newQuery = new Query();
for (var i = 0, l = keys.length; i < l; i++) {
newQuery[keys[i]] = query[keys[i]];
}
-
+
return newQuery;
-
- },
-
- not: function() {
+ }
+
+ not() {
var queryClone = this._cloneKeys(this);
- queryClone._comparison = this._inverse[queryClone._comparison];
+ queryClone._comparison = this._inverse[queryClone._comparison];
}
-
-
-});
\ No newline at end of file
+}
Modified: oipf/lib/js/impl/model/Recording.js
===================================================================
--- oipf/lib/js/impl/model/Recording.js 2015-06-09 15:39:44 UTC (rev 1668)
+++ oipf/lib/js/impl/model/Recording.js 2015-06-09 15:42:18 UTC (rev 1669)
@@ -1,75 +1,71 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
+class Recording extends ScheduledRecording {
-var Recording = ScheduledRecording.extend({
-
- uri: null,
- id: null,
- doNotDelete: null,
- saveDays: null,
- saveEpisodes: null,
- blocked: null,
- showType: null,
- subtitles: null,
-
/*
- * Decsription:
- *
- * Visibilty Type: readonly StringCollection
- */
- subtitleLanguages: null,
- isHD: null,
- is3D: null,
- audioType: null,
- isMultilingual: null,
-
- /*
- * Decsription:
- *
- * Visibilty Type: readonly StringCollection
- */
- audioLanguages: null,
-
- /*
- * Decsription:
- *
- * Visibilty Type: readonly StringCollection
- */
- genres: null,
- recordingStartTime: null,
- recordingDuration: null,
-
- /*
- * Decsription:
- *
- * Visibilty Type: readonly BookmarkCollection
- */
- bookmarks: null,
- locked: null,
-
- /*
- * FIXME:
- * Yannis - 28/04/2015 - Initialize its own properties matching(not the inherited)
+ * FIXME:
+ * Yannis - 28/04/2015 - Initialize its own properties matching(not the inherited)
* programme field contained by its inherited property channel
*/
- init: function(associatedScheduledRecording) {
+ constructor(associatedScheduledRecording) {
+ super(associatedScheduledRecording);
+
+ this.uri = null;
+ this.id = null;
+ this.doNotDelete = null;
+ this.saveDays = null;
+ this.saveEpisodes = null;
+ this.blocked = null;
+ this.showType = null;
+ this.subtitles = null;
+
+ /*
+ * Decsription:
+ *
+ * Visibilty Type: readonly StringCollection
+ */
+ this.subtitleLanguages = null;
+ this.isHD = null;
+ this.is3D = null;
+ this.audioType = null;
+ this.isMultilingual = null;
+
+ /*
+ * Decsription:
+ *
+ * Visibilty Type: readonly StringCollection
+ */
+ this.audioLanguages = null;
+
+ /*
+ * Decsription:
+ *
+ * Visibilty Type: readonly StringCollection
+ */
+ this.genres = null;
+ this.recordingStartTime = null;
+ this.recordingDuration = null;
+
+ /*
+ * Decsription:
+ *
+ * Visibilty Type: readonly BookmarkCollection
+ */
+ this.bookmarks = null;
+ this.locked = null;
+
this.isManual = true;
- associatedScheduledRecording &&
+ associatedScheduledRecording &&
oipf.utils.initProperties.call(this, associatedScheduledRecording);
-
+
this.id = createUUID();
- },
-
- _setRecordingStartTime: function(recordingStartTime) {
- this.recordingStartTime= recordingStartTime;
- },
-
- _setRecordingEndTime: function(recordingEndTime) {
+ }
+
+ _setRecordingStartTime(recordingStartTime) {
+ this.recordingStartTime = recordingStartTime;
+ }
+
+ _setRecordingEndTime(recordingEndTime) {
this.recordingEndTime = recordingEndTime;
}
-
-});
+}
+
Modified: oipf/lib/js/impl/model/ScheduledRecording.js
===================================================================
--- oipf/lib/js/impl/model/ScheduledRecording.js 2015-06-09 15:39:44 UTC (rev 1668)
+++ oipf/lib/js/impl/model/ScheduledRecording.js 2015-06-09 15:42:18 UTC (rev 1669)
@@ -1,241 +1,238 @@
-/*
+/*
* The ScheduledRecording object represents a scheduled programme in the system,
- * i.e. a recording that is scheduled but which has not yet started.
- * For group recordings (e.g. recording an entire series),
+ * i.e. a recording that is scheduled but which has not yet started.
+ * For group recordings (e.g. recording an entire series),
* a ScheduledRecording object is also used to represent a “parent” recording
* that enables management of the group recording without representing any of
- * the actual recordings in the group.
+ * the actual recordings in the group.
* The values of the properties of a ScheduledRecording (except for
- * startPadding and endPadding ) are provided when the object is created
- * using one of the record() methods in section 7.10.1, for example by
+ * startPadding and endPadding ) are provided when the object is created
+ * using one of the record() methods in section 7.10.1, for example by
* using a corresponding Programme object as argument for the record() method,
- * and can not be changed for this scheduled recording object
+ * and can not be changed for this scheduled recording object
* (except for startPadding and endPadding).
*/
+class ScheduledRecording {
-var ScheduledRecording = Class.extend({
+ constructor(...parameters) {
+ /*
+ * This specification does not define values for these constants.
+ * Implementations may use any values as long as the value of
+ * each constant is unique.
+ */
+ this.RECORDING_SCHEDULED = 0;
+ this.RECORDING_REC_STARTED = 1;
+ this.RECORDING_REC_COMPLETED = 2;
+ this.RECORDING_REC_PARTIALLY_COMPLETED = 3;
+ this.RECORDING_ERROR = 4;
+ this.ERROR_REC_RESOURCE_LIMITATION = 1712;
+ this.ERROR_INSUFFICIENT_STORAGE = 918;
+ this.ERROR_REC_UNKNOWN = 21;
- /*
- * This specification does not define values for these constants.
- * Implementations may use any values as long as the value of
- * each constant is unique.
- */
- RECORDING_SCHEDULED: 0,
- RECORDING_REC_STARTED: 1,
- RECORDING_REC_COMPLETED: 2,
- RECORDING_REC_PARTIALLY_COMPLETED: 3,
- RECORDING_ERROR: 4,
- ERROR_REC_RESOURCE_LIMITATION: 1712,
- ERROR_INSUFFICIENT_STORAGE: 918,
- ERROR_REC_UNKNOWN: 21,
-
- ID_TVA_GROUP_CRID: 2,
-
- /*
- * Description:
- * The state of the recording. Valid values are:
- * RECORDING_REC_STARTED
- * RECORDING_REC_COMPLETED
- * RECORDING_REC_PARTIALLY_COMPLETED
- * RECORDING_SCHEDULED
- * RECORDING_ERROR
- *
- * Visibility Type: readonly Integer
- */
- state: null,
-
- /*
- * Description:
- * If the state of the recording has changed due to an error,
- * this field contains an error code detailing the type of error.
- * This is only valid if the value of the state argument is RECORDING_ERROR
- * or RECORDING_REC_PARTIALLY_COMPLETED otherwise
- * this property SHALL be null . Valid values are:
- * ERROR_REC_RESOURCE_LIMITATION
- * ERROR_INSUFFICIENT_STORAGE
- * ERROR_REC_UNKNOWN
- *
- * Visibility Type: readonly Integer
- */
- error: null,
-
- scheduleID: null,
- customID: null,
- startPadding: null,
- endPadding: null,
-
- /*
- * Description:
- * Bitfield indicating which days of the week the recording SHOULD
- * be repeated. Values are as follows:
- * ------------------------------------------------------------------------
- * Day | Bitfield Value
- * ------------- ----------------------------------------------------------
- * Sunday | Indicates there are no analogue video outputs
- * ------------- ----------------------------------------------------------
- * Monday | Indicates platform support for the NTSC TV standard.
- * ------------- ----------------------------------------------------------
- * Tuesday | Indicates platform support for the PAL-BGH TV standard.
- * ------------- ----------------------------------------------------------
- * Wednesday | Indicates platform support for the SECAM TV standard.
- * ------------- ----------------------------------------------------------
- * Thursday | Indicates platform support for the PAL-M TV standard.
- * ------------- ----------------------------------------------------------
- * Friday | Indicates platform support for the PAL-N TV standard.
- * ------------------------------------------------------------------------
- * Saturday | Indicates platform support for the PAL-N TV standard.
- * ------------------------------------------------------------------------
- *
- * Visibility Type: readonly Integer
- *
- * FIXME: Yannis - 27/04/2015 - Express this properties as a bitfield.
- */
- repeatDays: null,
-
- /*
- * Description:
- * The short name of the programme, e.g. 'Star Trek: DS9'.
- *
- * Type: String
- */
- name: null,
+ this.ID_TVA_GROUP_CRID = 2;
- /*
- * Description:
- * The long name of the programme, e.g. 'Star Trek: Deep Space Nine'.
- * If the long name is not available, this property will be undefined.
- *
- * Type: String
- */
- longName: null,
+ /*
+ * Description:
+ * The state of the recording. Valid values are:
+ * RECORDING_REC_STARTED
+ * RECORDING_REC_COMPLETED
+ * RECORDING_REC_PARTIALLY_COMPLETED
+ * RECORDING_SCHEDULED
+ * RECORDING_ERROR
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.state = null;
- /*
- * Description:
- * The description of the programme, e.g. an episode synopsis. If no description is available, this property will be undefined.
- *
- * Type: String
- */
- description: null,
+ /*
+ * Description:
+ * If the state of the recording has changed due to an error,
+ * this field contains an error code detailing the type of error.
+ * This is only valid if the value of the state argument is RECORDING_ERROR
+ * or RECORDING_REC_PARTIALLY_COMPLETED otherwise
+ * this property SHALL be null . Valid values are:
+ * ERROR_REC_RESOURCE_LIMITATION
+ * ERROR_INSUFFICIENT_STORAGE
+ * ERROR_REC_UNKNOWN
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.error = null;
- /*
- * Description:
- * The long description of the programme. If no description is available, this property will be undefined.
- *
- * Type: String
- */
- longDescription: null,
-
- /*
- * Description:
- * The long description of the programme. If no description is available, this property will be undefined.
- *
- * Visibility Type: readonly Integer
- */
- startTime: null,
+ this.scheduleID = null;
+ this.customID = null;
+ this.startPadding = null;
+ this.endPadding = null;
- /*
- * Description:
- * The duration of the programme (in seconds).
- *
- * Visibility Type: readonly Integer
- */
- duration: null,
-
- /*
- * Description:
- * Reference to the broadcast channel where the scheduled programme
- * is available.
- *
- * Visibility Type: reaonly Channel
- */
- channel: null,
-
- /*
- * Description:
- * true if the recording was scheduled using
- * oipfRecordingScheduler.recordAt() or using a terminal-specific approach
- * that does not use guide data to determine what to record, false otherwise.
- * If false , then any fields whose name matches a field in the Programme
- * object contains details from the programme guide on the programme
- * that has been recorded. If true , only the channel , startTime and
- * duration properties are required to be valid.
- *
- * Visibility Type: readonly Boolean
- */
- isManual: null,
-
- /*
- * Description:
- * The episode number for the programme if it is part of a series. This property is undefined when the
- * programme is not part of a series or the information is not available.
- *
- * Visibility Type: readonly Integer
- */
- episode: null,
+ /*
+ * Description:
+ * Bitfield indicating which days of the week the recording SHOULD
+ * be repeated. Values are as follows:
+ * ------------------------------------------------------------------------
+ * Day | Bitfield Value
+ * ------------- ----------------------------------------------------------
+ * Sunday | Indicates there are no analogue video outputs
+ * ------------- ----------------------------------------------------------
+ * Monday | Indicates platform support for the NTSC TV standard.
+ * ------------- ----------------------------------------------------------
+ * Tuesday | Indicates platform support for the PAL-BGH TV standard.
+ * ------------- ----------------------------------------------------------
+ * Wednesday | Indicates platform support for the SECAM TV standard.
+ * ------------- ----------------------------------------------------------
+ * Thursday | Indicates platform support for the PAL-M TV standard.
+ * ------------- ----------------------------------------------------------
+ * Friday | Indicates platform support for the PAL-N TV standard.
+ * ------------------------------------------------------------------------
+ * Saturday | Indicates platform support for the PAL-N TV standard.
+ * ------------------------------------------------------------------------
+ *
+ * Visibility Type: readonly Integer
+ *
+ * FIXME: Yannis - 27/04/2015 - Express this properties as a bitfield.
+ */
+ this.repeatDays = null;
- /*
- * Description:
- * If the programme is part of a series, the total number of episodes in the series. This property is undefined
- * when the programme is not part of a series or the information is not available.
- *
- * Visibility Type: readonly Integer
- */
- totalEpisodes: null,
+ /*
+ * Description:
+ * The short name of the programme, e.g. 'Star Trek: DS9'.
+ *
+ * Type: String
+ */
+ this.name = null;
- /*
- * Description:
- * The unique identifier of the programme or series, e.g.,
- * a TV-Anytime CRID (Content Reference Identifier).
- *
- * Visibility Type: readonly Integer
- */
- programmeID: null,
+ /*
+ * Description:
+ * The long name of the programme, e.g. 'Star Trek: Deep Space Nine'.
+ * If the long name is not available, this property will be undefined.
+ *
+ * Type: String
+ */
+ this.longName = null;
- /*
- * Description:
- * The type of identification used to reference the programme,
- * as indicated by one of the ID_* constants
- * defined above.
- *
- * Visibility Type: readonly Integer
- */
- programmeIDType: null,
-
- /*
- * Description:
- * A collection of parental rating values for the programme for zero or more
- * parental rating schemes supported by the OITF. The value of this property
- * is typically provided by a corresponding “ Programme ” object that is
- * used to schedule the recording and can not be changed for this scheduled
- * recording object. If no parental rating information is available for this
- * scheduled recording, this property is a ParentalRatingCollection
- * object (as defined in section 7.9.5) with length 0.
- * Note that if the parentalRating property contains a certain
- * parental rating (e.g. PG-13) and the broadcastchannel associated with
- * this scheduled recording has metadata that says that the content is
- * rated PG-16,then the conflict resolution is implementation dependent.
- * Note that this property was formerly called “parentalRating”
- * (singular not plural).
- *
- * Visibility Type: readonly ParentalRatingCollection
- */
- parentalRatings: null,
-
- /*
- * Description:
- * Application-specific information for this recording.
- * This value is information that the DAE application can set in order
- * to retain additional information on this scheduled recording. It is not
- * changed by the OITF. The OITF SHALL support values up to and including
- * 16 K Bytes in size. Strings longer than this MAY get truncated.
- *
- * Type: String
- */
- customMetadata: null,
-
- init: function() {
- var parameters = arguments;
-
+ /*
+ * Description:
+ * The description of the programme, e.g. an episode synopsis. If no description is available, this property will be undefined.
+ *
+ * Type: String
+ */
+ this.description = null;
+
+ /*
+ * Description:
+ * The long description of the programme. If no description is available, this property will be undefined.
+ *
+ * Type: String
+ */
+ this.longDescription = null;
+
+ /*
+ * Description:
+ * The long description of the programme. If no description is available, this property will be undefined.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.startTime = null;
+
+ /*
+ * Description:
+ * The duration of the programme (in seconds).
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.duration = null;
+
+ /*
+ * Description:
+ * Reference to the broadcast channel where the scheduled programme
+ * is available.
+ *
+ * Visibility Type: reaonly Channel
+ */
+ this.channel = null;
+
+ /*
+ * Description:
+ * true if the recording was scheduled using
+ * oipfRecordingScheduler.recordAt() or using a terminal-specific approach
+ * that does not use guide data to determine what to record, false otherwise.
+ * If false , then any fields whose name matches a field in the Programme
+ * object contains details from the programme guide on the programme
+ * that has been recorded. If true , only the channel , startTime and
+ * duration properties are required to be valid.
+ *
+ * Visibility Type: readonly Boolean
+ */
+ this.isManual = null;
+
+ /*
+ * Description:
+ * The episode number for the programme if it is part of a series. This property is undefined when the
+ * programme is not part of a series or the information is not available.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.episode = null;
+
+ /*
+ * Description:
+ * If the programme is part of a series, the total number of episodes in the series. This property is undefined
+ * when the programme is not part of a series or the information is not available.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.totalEpisodes = null;
+
+ /*
+ * Description:
+ * The unique identifier of the programme or series, e.g.,
+ * a TV-Anytime CRID (Content Reference Identifier).
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.programmeID = null;
+
+ /*
+ * Description:
+ * The type of identification used to reference the programme,
+ * as indicated by one of the ID_* constants
+ * defined above.
+ *
+ * Visibility Type: readonly Integer
+ */
+ this.programmeIDType = null;
+
+ /*
+ * Description:
+ * A collection of parental rating values for the programme for zero or more
+ * parental rating schemes supported by the OITF. The value of this property
+ * is typically provided by a corresponding “ Programme ” object that is
+ * used to schedule the recording and can not be changed for this scheduled
+ * recording object. If no parental rating information is available for this
+ * scheduled recording, this property is a ParentalRatingCollection
+ * object (as defined in section 7.9.5) with length 0.
+ * Note that if the parentalRating property contains a certain
+ * parental rating (e.g. PG-13) and the broadcastchannel associated with
+ * this scheduled recording has metadata that says that the content is
+ * rated PG-16,then the conflict resolution is implementation dependent.
+ * Note that this property was formerly called “parentalRating”
+ * (singular not plural).
+ *
+ * Visibility Type: readonly ParentalRatingCollection
+ */
+ this.parentalRatings = null;
+
+ /*
+ * Description:
+ * Application-specific information for this recording.
+ * This value is information that the DAE application can set in order
+ * to retain additional information on this scheduled recording. It is not
+ * changed by the OITF. The OITF SHALL support values up to and including
+ * 16 K Bytes in size. Strings longer than this MAY get truncated.
+ *
+ * Type: String
+ */
+ this.customMetadata = null;
+
this.state = this.RECORDING_SCHEDULED;
this.scheduleID = createUUID();
if (parameters.length == 1) {
@@ -243,23 +240,23 @@
} else {
this._initFromFields.apply(this, parameters);
}
- },
-
- _initFromProgramme: function(programme) {
+ }
+
+ _initFromProgramme(programme) {
console.log("Method _initFromProgramme called.");
- var keys = Object.keys(programme);
-
+ var keys = Object.keys(programme);
+
if (programme.programmeIDType == this.ID_TVA_GROUP_CRID) {
-
+
} else {
- for(var i = 0, l = keys.length; i < l; i++) {
+ for (var i = 0, l = keys.length; i < l; i++) {
this[keys[i]] = programme[keys[i]];
}
this.isManual = false;
}
- },
-
- _initFromFields: function(startTime, duration, repeatDays, channelID) {
+ }
+
+ _initFromFields(startTime, duration, repeatDays, channelID) {
console.log("Method _initFromFields called");
this.startTime = startTime;
this.duration = duration;
@@ -267,22 +264,22 @@
this.isManual = true;
this.programmeID = undefined;
this.programmeIDType = undefined;
- },
-
- _setDuration: function(duration) {
+ }
+
+ _setDuration(duration) {
this.duration = duration;
- },
-
- _setStartTime: function(startTime) {
+ }
+
+ _setStartTime(startTime) {
this.startTime = startTime;
- },
-
- _setRepeatDays: function(repeatDays) {
+ }
+
+ _setRepeatDays(repeatDays) {
this.repeatDays = repeatDays;
- },
-
- _setState: function(state) {
+ }
+
+ _setState(state) {
this.state = state;
}
-});
+}
Modified: oipf/lib/js/impl/model/ScheduledRecordingCollection.js
===================================================================
--- oipf/lib/js/impl/model/ScheduledRecordingCollection.js 2015-06-09 15:39:44 UTC (rev 1668)
+++ oipf/lib/js/impl/model/ScheduledRecordingCollection.js 2015-06-09 15:42:18 UTC (rev 1669)
@@ -1,15 +1,7 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
+class ScheduledRecordingCollection extends Collection{
-var ScheduledRecordingCollection = Collection.extend({
-
- init: function() {
- this.super.init.apply(this, arguments);
+ constructor(...args) {
+ super(...args);
}
-
-});
-
+}
1
0