Author: remi
Date: 2009-03-17 11:42:29 +0100 (Tue, 17 Mar 2009)
New Revision: 4108

Modified:
   
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceGadgetFramework.py
   software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Gadget.py
Log:
* updated web gadgets methods

Modified: 
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceGadgetFramework.py
===================================================================
--- 
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceGadgetFramework.py
 2009-03-17 10:28:31 UTC (rev 4107)
+++ 
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceGadgetFramework.py
 2009-03-17 10:42:29 UTC (rev 4108)
@@ -113,10 +113,12 @@
             googleGadgetUrl = '/%s/google_gadget_code.txt' % 
description.getUuid()
             struct['google_gadget_code'] = googleGadgetUrl
             googleGadgetCode = gadget.generateGoogleGadgetCode(
+                "http://127.0.0.1:270/gadget_framework/web_gadget?";,
                 gadget.getCommands()[0].getName(), {})
             resourcesManager.addContentToServe(googleGadgetCode,
                 googleGadgetUrl)
             struct['web_gadget_url'] = gadget.getWebGadgetUrl(
+                "http://127.0.0.1:270/gadget_framework/web_gadget?";,
                 gadget.getCommands()[0].getName(), {})
             description.setStructure(struct)
         self.__publishEvents(True, ST_NAME_FW_CONTAINER_DEPLOYED, ["True",])

Modified: software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Gadget.py
===================================================================
--- software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Gadget.py       
2009-03-17 10:28:31 UTC (rev 4107)
+++ software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Gadget.py       
2009-03-17 10:42:29 UTC (rev 4108)
@@ -244,8 +244,9 @@
     # 
--------------------------------------------------------------------------
     # Get the url for a web gadget.
     # 
--------------------------------------------------------------------------
-    def getWebGadgetUrl(self, command, parameters = {}):
+    def getWebGadgetUrl(self, baseUrl, command, parameters = {}):
         """Get the url for a web gadget.
+        @param baseUrl: Base url of the web gadgets.
         @param command: Gadget command.
         @param parameters: Parameters dictionary.
         """
@@ -253,22 +254,23 @@
         for key in parameters:
             params += "%s=%s|" % (key, parameters[key])
         uuid = self.getDescription().getUuid()
-        url = 
"http://127.0.0.1:270/gadget_framework/web_gadget?uuid=%s&command=%s&parameters=%s";
 % (
-            uuid, command, params)
+        url = "%suuid=%s&command=%s&parameters=%s" % (baseUrl, uuid, command,
+            params)
         return url
 
     # 
--------------------------------------------------------------------------
     # Generate the code of a google gadget.
     # 
--------------------------------------------------------------------------
-    def generateGoogleGadgetCode(self, command, parameters = {}):
+    def generateGoogleGadgetCode(self, baseUrl, command, parameters = {}):
         """Generate the code of a google gadget.
+        @param baseUrl: Base url of the web gadgets.
         @param command: Gadget command.
         @param parameters: Parameters dictionary.
         """
         framework = self.getContainer().getFramework()
         if not framework.isStarted():
             return None
-        url = self.getWebGadgetUrl(command, parameters)
+        url = self.getWebGadgetUrl(baseUrl, command, parameters)
         result = GOOGLE_GADGET_BASE_CODE % (
             self.getDescription().getName(),
             self.getDescription().getAuthor(),


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to