[Sugar-devel] HTML activities

Simon Schampijer simon at schampijer.de
Mon Jan 28 13:11:22 EST 2013


On 01/28/2013 06:37 PM, Peter Robinson wrote:
> On Mon, Jan 28, 2013 at 5:30 PM, Simon Schampijer <simon at schampijer.de> wrote:
>> Hey Daniel,
>>
>> thanks for the writeup!
>>
>>
>> On 01/26/2013 03:27 PM, Daniel Narvaez wrote:
>>>
>>> Hello,
>>>
>>> the desire to be able to write activities using html has been expressed
>>> several
>>> times by developers. We have seen several approaches but there is not much
>>> support for it in the core platform yet.
>>>
>>> I and Simon have been trying to figure out how to best integrate this with
>>> the
>>> existing platform. Bits of code can be pulled from the sugar-build html
>>> branch.
>>> We don't have much of a demo yet, but I think the basic pieces of the
>>> infrastucture are becoming clear, so I thought it would be good to try and
>>> summarize them in an email to the list.
>>>
>>> 1 sugar-toolkit-html
>>>
>>> * A new module.
>>> * Independent from the native sugar API, so that html activities might be
>>> run
>>>     on other platforms, like Android or even inside a web browser.
>>> * HTML equivalents of the gtk widgets. For example Toolbar and Palette.
>>> * Per-platform (sugar-os, android, web-browser...) implementations of the
>>>     same javascript interface to the sugar services. For example it might
>>>     provide a datastore.save(metadata, file) method or an
>>>     icon.get_with_colors(xo_colors)
>>>
>>> 2 sugar-http-server
>>>
>>> * A sugar-os internal component. Other platforms might implement the
>>>     html/javascript API without even using an http server.
>>> * Implemented by the sugar-toolkit-html module but managed by the sugar
>>> shell.
>>> * Serves the activity bundles content with something like
>>>     http://localhost:8000/org.sugarlabs.HTMLDemo/index.html.
>>> * Exposes the sugar services API with json methods like
>>>     http://localhost:8000/org.sugarlabs.HTMLDemo/datastore/save
>>
>>
>> As we talked about today, I was looking at node-dbus [1] in order to talk to
>> the DS over dbus from java script. Looks straight forward. I installed the
>> module (npm install node-dbus) and did a quick example based on the test in
>> the repo to listen on the 'Created' signal from the DS. Works fine.

I added as well an example for dbus methods, you can delete DS entries 
now :) http://dev.laptop.org/~erikos/html-activity/

>> Of course, if we use nodejs we have to handle the modules packaging as
>> nodejs itself is rather limited and a most of the functionality is in the
>> modules.
>
> There's 100s of them currently being packaged for Fedora, there's
> about 50 in F-18 already, I think a lot more (maybe it just seems that
> way from the build reports) in F-19.
>
> "yum list nodejs*" will give you more details.

Perfect, that is good news. This reminds me that I should switch to F18 
now...:)

Cheers,
    Simon



More information about the Sugar-devel mailing list