Discussion:
DataEngine in JavaScript: Help
Onur-Hayri Bakici
2010-06-16 22:49:17 UTC
Permalink
Hey guys.

i have issues about running this code:


function sourceRequestEvent(source)
{
print("Test");
setData("Hello", "World");
return true;

}

function updateSourceEvent(source)
{
return true;
}

it doesnt do anything. not printing out test, nothing.
i already have plasma-scriptengines-javascript installed.

here is my metadata.desktop:

X-KDE-ServiceTypes=Plasma/DataEngine
Type=Service


X-Plasma-API=javascript
X-Plasma-MainScript=mediadataengine.js
X-Plasma-ComponentTypes=DataEngine

X-Plasma-EngineName=webmedia
X-KDE-Library=plasma_engine_webmedia
X-KDE-PluginInfo-Author=test
X-KDE-PluginInfo-Email=***@test.com
X-KDE-PluginInfo-Name=webmedia
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=Multimedia
X-KDE-PluginInfo-License=LGPL
X-KDE-PluginInfo-EnabledByDefault=true

i am also not quite sure, if i have the X-KDE-ServiceTypes correct, because
the plasma-scriptengine-dataengine-javascript.desktop in
kdebase/runtime/plasma/scriptengines/javascript

thank you in advance

cheers
thehayro
Alessandro Diaferia
2010-06-19 11:07:56 UTC
Permalink
I had a look at the dataengine. When loading it via plasmaenginexplorer it
says "package is in path which is a "Plasmoid" package" .. This seems no
good to me.
Can you point out what's wrong?

Also, are there any implementations of JS DataEngines to take inspiration
from? As there's near to 0 docs about them. Or probably i wasn't able to
find any.

Thanks.
Post by Onur-Hayri Bakici
Hey guys.
function sourceRequestEvent(source)
{
print("Test");
setData("Hello", "World");
return true;
}
function updateSourceEvent(source)
{
return true;
}
it doesnt do anything. not printing out test, nothing.
i already have plasma-scriptengines-javascript installed.
X-KDE-ServiceTypes=Plasma/DataEngine
Type=Service
X-Plasma-API=javascript
X-Plasma-MainScript=mediadataengine.js
X-Plasma-ComponentTypes=DataEngine
X-Plasma-EngineName=webmedia
X-KDE-Library=plasma_engine_webmedia
X-KDE-PluginInfo-Author=test
X-KDE-PluginInfo-Name=webmedia
X-KDE-PluginInfo-Version=0.1
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=Multimedia
X-KDE-PluginInfo-License=LGPL
X-KDE-PluginInfo-EnabledByDefault=true
i am also not quite sure, if i have the X-KDE-ServiceTypes correct, because
the plasma-scriptengine-dataengine-javascript.desktop in
kdebase/runtime/plasma/scriptengines/javascript
thank you in advance
cheers
thehayro
_______________________________________________
Plasma-devel mailing list
https://mail.kde.org/mailman/listinfo/plasma-devel
--
Alessandro Diaferia
KDE Developer
KDE e.V. member
Aaron J. Seigo
2010-06-21 02:31:41 UTC
Permalink
Post by Alessandro Diaferia
Also, are there any implementations of JS DataEngines to take inspiration
from?
none, sorry. my javascript plugins time has all gone into plasmoids and their
documentation. dataengine functions, but is undocumented. fixing that is
welcome.
--
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
Aaron J. Seigo
2010-06-21 02:34:10 UTC
Permalink
Post by Onur-Hayri Bakici
function sourceRequestEvent(source)
engine.sourceRequestEvent = function(source)
Post by Onur-Hayri Bakici
{
print("Test");
setData("Hello", "World");
return true;
}
function updateSourceEvent(source)
engine.updateSourceEvent = function(source)
Post by Onur-Hayri Bakici
{
return true;
}
also, if you can provide your entire zip'd package, that's often easier to
test with.
--
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
Onur-Hayri Bakici
2010-06-21 23:59:26 UTC
Permalink
Here is the url of my repository:

git://gitorious.org/lilflickr/lilflickr.git

the engine is in dataengine/contents/

thank you
bests
Aaron J. Seigo
2010-06-22 01:49:00 UTC
Permalink
Post by Onur-Hayri Bakici
git://gitorious.org/lilflickr/lilflickr.git
the engine is in dataengine/contents/
thanks :)

if you update kdebase/runtime/plasma/javascript it now works.

some notes/input on the javascript engine:

* by convention, scripts go into contents/code/. obviously, you don't have to
do this (at least not currently), but it would be nice to stick to that
convention.

* the dataengine is currently called webmedia. if it is going to ship as part
of KDE at some future point, then it should be called org.kde.webmedia for
namespacing reasons

but i'm stoked that the js dataengine works now ... next step is documenting
some of this stuff :)
--
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
Loading...