[Sugar-devel] HTML activities

Simon Schampijer simon at schampijer.de
Mon Jan 28 12:30:57 EST 2013


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.

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.

Cheers,
    Simon

[1] https://npmjs.org/package/node-dbus


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-ds-listener.js
Type: application/javascript
Size: 2670 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130128/bd0b24c0/attachment.js>


More information about the Sugar-devel mailing list