questions about "remote web services"

Aaron J. Seigo aseigo at kde.org
Wed May 18 16:20:02 CEST 2011


On Wednesday, May 18, 2011 15:36:38 Jérôme Pigeot wrote:
> If the search get a certain number of videos, how do you integrate it in the
> dataengine??? and then in the applet??

in that case, the DataEngine would create multiple key/value entries. however, 
what i would really recommend is doing it the way that the Share engine does 
it:

* one source per service, e.g. youtube
* implement serviceForSource, wich the applet uses to get a Plasma::Service 
object which does the actual query

this will end up being a much more natural feeling result in the code.

however, if you want to just make a youtube thing, you could just as well 
start by using the HTTP Javascript API extension:

http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API#HTTP

and do it all in your script itself. for parsing xml, there is:

http://xmljs.sourceforge.net/

i'd recommend using a DataEngine approach if you were going to do a multi-
source (e.g. youtube, blip, etc. etc.) system which could then be more easily 
re-used by other plasmoids .. which is exactly what the Plasma MediaCenter 
people were doing, though i don't know what the status of those DataEngines 
are at this point.

it would be quite possible to write the entire engine in JavaScript using 
JavaScript addons with the addons providing the Service objects and speaking 
html to the web service.

> The dataengine will just give infos to the applet : url of the video,
> image... that means the applet needs a to get the data via KIO??

no; create a VideoWidget and then set the url on it. it will handle the rest.

> What is the "recommanded" language to write dataengines??

javascript is a good choice, but often c++ is required.

> Is it better to separate the dataengine and the applet sources or place them
> in the same "package"???

depends if the DataEngine is meant to be re-used or not.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20110518/1ded9edf/attachment.sig 


More information about the Plasma-devel mailing list