Merge lp:~ken-vandine/unity-webapps-qml/content-hub-api-updates into lp:unity-webapps-qml

Proposed by Ken VanDine
Status: Merged
Merged at revision: 123
Proposed branch: lp:~ken-vandine/unity-webapps-qml/content-hub-api-updates
Merge into: lp:unity-webapps-qml
Prerequisite: lp:~abreu-alexandre/unity-webapps-qml/content-hub-share-import
Diff against target: 155 lines (+38/-5)
2 files modified
src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js (+12/-0)
src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub.js (+26/-5)
To merge this branch: bzr merge lp:~ken-vandine/unity-webapps-qml/content-hub-api-updates
Reviewer Review Type Date Requested Status
Alexandre Abreu (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+222503@code.launchpad.net

Commit message

Updates for the content-hub bindings:
 * Added new content types: Videos and Links
 * Added ContentTransfer states: Downloading and Downloaded
 * Fixed a few typos and errors in doc strings

Description of the change

Updates for the content-hub bindings:
 * Added new content types: Videos and Links
 * Added ContentTransfer states: Downloading and Downloaded
 * Fixed a few typos and errors in doc strings

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

A small nit L9

review: Needs Fixing
123. By Ken VanDine

fixed typo in content types, should be Links.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandre Abreu (abreu-alexandre) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js'
2--- src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js 2014-06-10 13:14:18 +0000
3+++ src/Ubuntu/UnityWebApps/bindings/content-hub/backend/content-hub.js 2014-06-10 13:14:18 +0000
4@@ -39,6 +39,8 @@
5 "Documents": ContentHubBridge.ContentType.Documents,
6 "Music": ContentHubBridge.ContentType.Music,
7 "Contacts": ContentHubBridge.ContentType.Contacts,
8+ "Videos": ContentHubBridge.ContentType.Videos,
9+ "Links": ContentHubBridge.ContentType.Links,
10 };
11 return name in contentTypePerName ?
12 contentTypePerName[name]
13@@ -57,6 +59,10 @@
14 return "Music";
15 else if (state === ContentHubBridge.ContentType.Contacts)
16 return "Contacts";
17+ else if (state === ContentHubBridge.ContentType.Videos)
18+ return "Videos";
19+ else if (state === ContentHubBridge.ContentType.Links)
20+ return "Links";
21 return "Unknown";
22 };
23
24@@ -146,6 +152,8 @@
25 "Collected": ContentHubBridge.ContentTransfer.Collected,
26 "Aborted": ContentHubBridge.ContentTransfer.Aborted,
27 "Finalized": ContentHubBridge.ContentTransfer.Finalized,
28+ "Downloading": ContentHubBridge.ContentTransfer.Downloading,
29+ "Downloaded": ContentHubBridge.ContentTransfer.Downloaded,
30 };
31 return name in contentTransferStatePerName ?
32 contentTransferStatePerName[name]
33@@ -166,6 +174,10 @@
34 return "Aborted";
35 else if (state === ContentHubBridge.ContentTransfer.Finalized)
36 return "Finalized";
37+ else if (state === ContentHubBridge.ContentTransfer.Downloading)
38+ return "Downloading";
39+ else if (state === ContentHubBridge.ContentTransfer.Downloaded)
40+ return "Downloaded";
41 return "<Unknown State>";
42 };
43
44
45=== modified file 'src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub.js'
46--- src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub.js 2014-06-10 13:14:18 +0000
47+++ src/Ubuntu/UnityWebApps/bindings/content-hub/client/content-hub.js 2014-06-10 13:14:18 +0000
48@@ -230,7 +230,7 @@
49 /**
50 * ContentPeer is an object returned by the ContentHub.
51 It represents a remote peer that can be used in a request
52- to export or import date.
53+ to import, export or share content.
54
55 * @class ContentPeer
56 * @module ContentHub
57@@ -421,7 +421,7 @@
58 // methods
59
60 /**
61- * Request to import data from this ContentPeer.
62+ * Request to exchange content with this ContentPeer.
63 *
64 * @method request
65 * @param callback {Function(ContentTransfer)} Called with the resulting content transfer
66@@ -431,7 +431,7 @@
67 },
68
69 /**
70- * Request to import data from this ContentPeer and use a ContentStore for permanent storage.
71+ * Request to import content from this ContentPeer and use a ContentStore for permanent storage.
72 *
73 * @method requestForStore
74 * @param store {ContentStore} Store used as a permanent storage
75@@ -586,6 +586,10 @@
76
77 Contacts
78
79+ Videos
80+
81+ Links
82+
83 @static
84 @property ContentType {String}
85
86@@ -603,6 +607,8 @@
87 Documents: "Documents",
88 Music: "Music",
89 Contacts: "Contacts",
90+ Videos: "Videos",
91+ Links: "Links",
92 },
93
94 /**
95@@ -665,6 +671,10 @@
96 Aborted: Transfer has been aborted.
97
98 Finalized: Transfer has been finished and cleaned up.
99+
100+ Downloaded: Download specified by downloadId has completed.
101+
102+ Downloading: Transfer is downloading item specified by downloadId.
103
104 @static
105 @property ContentTransfer.State {String}
106@@ -715,6 +725,12 @@
107
108 // Transfer has been finished and cleaned up.
109 Finalized: "Finalized",
110+
111+ // Transfer has finished downloading.
112+ Downloaded: "Downloaded",
113+
114+ // Transfer is downloading.
115+ Downloading: "Downloading",
116 },
117
118 /**
119@@ -726,6 +742,8 @@
120
121 Export
122
123+ Share
124+
125 @static
126 @property ContentTransfer.Direction {String}
127 */
128@@ -735,6 +753,9 @@
129
130 // Transfer is a request to export content
131 Export: "Export",
132+
133+ // Transfer is a request to share content
134+ Share: "Share",
135 },
136
137 /**
138@@ -840,7 +861,7 @@
139 * Sets a handler that is to be called when the current application is the
140 * target of an share request.
141 *
142- * @method onExportRequested
143+ * @method onShareRequested
144 * @param callback {Function(ContentTransfer)} Function when one requests a resource to be shared.
145 * The corresponding ContentTransfer is provided as a parameter.
146 *
147@@ -895,7 +916,7 @@
148 *
149 * @method api.importContent
150 * @param type {ContentType} type of the content to import
151- * @param peer {ContentPeer} peer whos content should be imported
152+ * @param peer {ContentPeer} peer who's content should be imported
153 * @param transferOptions {Object} a dictionary of transfer options. The options are the following:
154 * - multipleFiles {Bool}: specified if a transfer should involve multiple files or not
155 * - scope {ContentScope}: specifies the location where the transferred files should be copied to

Subscribers

People subscribed via source and target branches

to all changes: