Author: remi
Date: 2009-07-07 13:26:05 +0200 (Tue, 07 Jul 2009)
New Revision: 5072

Modified:
   
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
   
software_suite_v3/smart-core/smart-server/trunk/resources/05_user_configurations/00_resourceUsers.py
   
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
Log:
* Set the default attitunes user path on starting Attitunes Studio from the 
"tools" page.

Modified: 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
    2009-07-07 11:25:13 UTC (rev 5071)
+++ 
software_suite_v3/smart-core/smart-server/trunk/data/web_interface/user_01/xsl/tools.xsl
    2009-07-07 11:26:05 UTC (rev 5072)
@@ -56,6 +56,15 @@
                 getRequest("/plugins_server/start_plugin", args);
             }
 
+            function startAttitunesStudio()
+            {
+                var language = document.getElementById("language").value;
+                var args = {
+                    "language" : language
+                }
+                getRequest("/wi_user_01/start_attitunes_studio", args);
+            }
+
             function updateWindowAbout(uuid)
             {
                 if (!icon1AlreadyPng)
@@ -140,7 +149,7 @@
                     <xsl:element name="a">
                         <xsl:attribute name="class">toolsBtnTitle 
toolsBtnStartEnable</xsl:attribute>
                         <xsl:attribute 
name="id">toolsStartAttitunesStatudio</xsl:attribute>
-                        <xsl:attribute 
name="onclick">javascript:startATool('<xsl:value-of 
select="root/data/attitunes_studio/uuid"/>');return false;</xsl:attribute>
+                        <xsl:attribute 
name="onclick">javascript:startAttitunesStudio();return false;</xsl:attribute>
                         <xsl:attribute 
name="href">#</xsl:attribute><xsl:value-of select="root/translations/start"/>
                     </xsl:element>
                     <span class="toolsRowName"><xsl:value-of 
select="root/data/attitunes_studio/name"/></span>

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/05_user_configurations/00_resourceUsers.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/05_user_configurations/00_resourceUsers.py
        2009-07-07 11:25:13 UTC (rev 5071)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/05_user_configurations/00_resourceUsers.py
        2009-07-07 11:26:05 UTC (rev 5072)
@@ -124,6 +124,13 @@
         @return: The current user configuration as string.
         """
         return self.__userConfiguration
+        
+    def getCurrentUserBasePath(self):
+        """Get the current user base directory
+        @return: A string.
+        """
+        userName = self.__userConfiguration['name']
+        return os.path.join(TDS_USERS_CONF_PATH, userName)
 
     def updateCurrentUserConfiguration(self, userConfiguration):
         """Update the current user configuration.

Modified: 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
===================================================================
--- 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
  2009-07-07 11:25:13 UTC (rev 5071)
+++ 
software_suite_v3/smart-core/smart-server/trunk/resources/07_web_interfaces/01_resourceWIUser01.py
  2009-07-07 11:26:05 UTC (rev 5072)
@@ -457,6 +457,41 @@
 resourceWIUser01.addService(TDSServiceWIUser01ApplyGadget)
 
 # 
------------------------------------------------------------------------------
+# Declaration of the service "start_attitunes_studio".
+# 
------------------------------------------------------------------------------
+class TDSServiceWIUser01StartAttitunesStudio(TDSService):
+
+    def configure(self):
+        self.parametersDict = {
+            'language' : 'string',
+        }
+        self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+        self.exclusiveExecution = False
+        self.name = "start_attitunes_studio"
+        self.comment = "Edit an attitune with Attitunes Studio."
+
+    def execute(self, id, parameters):
+        headersStruct = self.getDefaultHeadersStruct()
+        contentStruct = self.getDefaultContentStruct()
+        contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+        language = parameters['language']
+        outputPath = os.path.join(resourceUsers.getCurrentUserBasePath(),
+            "attitunes")
+        t = threading.Thread(target = resourcePluginsServer.startPlugin,
+            args = (
+                "548f7a9a-567d-773e-a0dd-102fe68a1b49",
+                "run",
+                {
+                    'outputpath' : outputPath,
+                    'language' : language,
+                }))
+        t.start()
+        return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceWIUser01.addService(TDSServiceWIUser01StartAttitunesStudio)
+
+# 
------------------------------------------------------------------------------
 # Declaration of the service "edit_attitune".
 # 
------------------------------------------------------------------------------
 class TDSServiceWIUser01EditAttitune(TDSService):


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to