[the-board/wip/http-api: 4/6] [ui] Export Application DBus json methods via HTTP



commit 345c7175a78a8048ca2434b9dc28e947ab07f3fb
Author: Lucas Rocha <lucasr gnome org>
Date:   Tue Nov 23 01:29:24 2010 +0000

    [ui] Export Application DBus json methods via HTTP
    
    This is to allow browser extensions to communicate with The Board.

 src/js/ui/application.js |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/js/ui/application.js b/src/js/ui/application.js
index 6994ddb..faadce5 100644
--- a/src/js/ui/application.js
+++ b/src/js/ui/application.js
@@ -10,9 +10,11 @@ const Mx = imports.gi.Mx;
 const MainWindow = imports.ui.mainWindow;
 
 // util imports
+const Http = imports.util.http;
 const Path = imports.util.path;
 
 const _THE_BOARD_DBUS_PATH = "/org/gnome/TheBoard";
+const _THE_BOARD_HTTP_PORT = 2010;
 
 const TheBoardIface = {
     name: "org.gnome.TheBoard",
@@ -74,6 +76,7 @@ Application.prototype = {
         log('Application: acquired ' + TheBoardIface.name);
 
         DBus.session.exportObject(_THE_BOARD_DBUS_PATH, this);
+        Http.exportObject(_THE_BOARD_HTTP_PORT, TheBoardIface, this);
 
         this._defineStyleAndThemes();
         this._createMainWindow();
@@ -99,9 +102,9 @@ Application.prototype = {
         this._mainWindow.present();
     },
 
-    // DBus method
+    // DBus/HTTP method
     addThing : function(args) {
-        log('Application: addThing via DBus');
+        log('Application: addThing via DBus/HTTP');
 
         if (!('thingId' in args)) {
             log('Application: addThing needs a thingId argument');



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]