Author: raido
Date: Wed May  5 16:22:50 2010
New Revision: 941366

URL: http://svn.apache.org/viewvc?rev=941366&view=rev
Log:
Add locale support, setLocale(str locale), getLocale()


Modified:
    incubator/wookie/trunk/connector/php/TestWookieService.php
    incubator/wookie/trunk/connector/php/WookieConnectorService.php
    incubator/wookie/trunk/connector/php/WookieConnectorServiceInterface.php

Modified: incubator/wookie/trunk/connector/php/TestWookieService.php
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/connector/php/TestWookieService.php?rev=941366&r1=941365&r2=941366&view=diff
==============================================================================
--- incubator/wookie/trunk/connector/php/TestWookieService.php (original)
+++ incubator/wookie/trunk/connector/php/TestWookieService.php Wed May  5 
16:22:50 2010
@@ -26,6 +26,8 @@ error_reporting(E_ALL &~ E_NOTICE);
 require_once("WookieConnectorService.php");
 
 $test = new WookieConnectorService("http://dev.ubuntu-box.htk:8081/wookie/";, 
"TEST", "localhost_dev", "demo_1");
+//set locale
+$test->setLocale("en");
 //set logging path, if not set then logger doesnt do nohting
 //$test->setLogPath("/home/raido/dev/www/php_framework/logs/");
 //setup different userName
@@ -81,7 +83,6 @@ if($_GET['widget_id'] != '') {
        $widget = $test->getOrCreateInstance($_GET['widget_id']);
   
        if($widget) {
-         echo $widget->isMaximizable();
                echo '<iframe src="'.$widget->getUrl().'" 
width="'.$widget->getWidth().'" height="'.$widget->getHeight().'"></iframe><br 
/>';
        }
        //add participant

Modified: incubator/wookie/trunk/connector/php/WookieConnectorService.php
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/connector/php/WookieConnectorService.php?rev=941366&r1=941365&r2=941366&view=diff
==============================================================================
--- incubator/wookie/trunk/connector/php/WookieConnectorService.php (original)
+++ incubator/wookie/trunk/connector/php/WookieConnectorService.php Wed May  5 
16:22:50 2010
@@ -38,6 +38,7 @@ class WookieConnectorService implements 
        private $user;
        private $httpStreamCtx;
        private $logger;
+       private $locale;
        
        /** Create new connector
         * 
@@ -72,6 +73,18 @@ class WookieConnectorService implements 
        return $this->logger;
        }
        
+       /** Set locale */
+       
+       public function setLocale($locale) {
+               $this->locale = (string) $locale;
+       }
+       
+       /** Get locale */
+       
+       public function getLocale() {
+               return $this->locale;
+       }
+       
        /** Set Wookie connection
         * 
         * @param WookieServerConnection new WookieServerConnection instance
@@ -184,6 +197,9 @@ class WookieConnectorService implements 
                        $request.= '&userid='.$this->getUser()->getLoginName();
                        $request.= 
'&shareddatakey='.$this->getConnection()->getSharedDataKey();
                        $request.= '&widgetid='.$guid;
+                   if($locale = $this->getLocale()) {
+                $request .= '&locale='.$locale;
+            }
 
                        if(!$this->checkURL($requestUrl)) {
                                throw new WookieConnectorException("URL for 
supplied Wookie Server is malformed: ".$requestUrl);
@@ -414,6 +430,9 @@ class WookieConnectorService implements 
                $widgets = array();
                try {
                        $request = 
$this->getConnection()->getURL().'widgets?all=true';
+                       if($locale = $this->getLocale()) {
+                               $request .= '&locale='.$locale;
+                       }
                        if(!$this->checkURL($request)) {
                                throw new WookieConnectorException("URL for 
Wookie is malformed");
                        }

Modified: 
incubator/wookie/trunk/connector/php/WookieConnectorServiceInterface.php
URL: 
http://svn.apache.org/viewvc/incubator/wookie/trunk/connector/php/WookieConnectorServiceInterface.php?rev=941366&r1=941365&r2=941366&view=diff
==============================================================================
--- incubator/wookie/trunk/connector/php/WookieConnectorServiceInterface.php 
(original)
+++ incubator/wookie/trunk/connector/php/WookieConnectorServiceInterface.php 
Wed May  5 16:22:50 2010
@@ -106,5 +106,17 @@ interface WookieConnectorServiceInterfac
        
        public function deleteProperty($widgetInstance, $propertyInstance );
        
+       /**
+        * Set locale
+        * @param String locale
+        */
+       
+       public function setLocale($locale);
+       
+       /** Get current locale setting
+        * @return String current locale
+        */
+       
+       public function getLocale();
 }
 ?>
\ No newline at end of file


Reply via email to