incubator-olio-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject svn commit: r785802 - in /incubator/olio: webapp/php/trunk/controllers/ webapp/php/trunk/views/ workload/java/trunk/src/org/apache/olio/workload/driver/ workload/php/trunk/src/org/apache/olio/workload/driver/ workload/rails/trunk/src/org/apache/olio/wo...
Date Wed, 17 Jun 2009 21:05:48 GMT
Author: shanti
Date: Wed Jun 17 21:05:48 2009
New Revision: 785802

URL: http://svn.apache.org/viewvc?rev=785802&view=rev
Log:
Fix for OLIO-85. This commit fixes all the driver side code as well as the php
application. The rails app has yet to be fixed. The Java app is covered by a
separate JIRA.

Modified:
    incubator/olio/webapp/php/trunk/controllers/Users_Controller.php
    incubator/olio/webapp/php/trunk/views/users.php
    incubator/olio/workload/java/trunk/src/org/apache/olio/workload/driver/JavaUIDriver.java
    incubator/olio/workload/php/trunk/src/org/apache/olio/workload/driver/UIDriver.java
    incubator/olio/workload/rails/trunk/src/org/apache/olio/workload/driver/UIDriver.java

Modified: incubator/olio/webapp/php/trunk/controllers/Users_Controller.php
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/controllers/Users_Controller.php?rev=785802&r1=785801&r2=785802&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/controllers/Users_Controller.php (original)
+++ incubator/olio/webapp/php/trunk/controllers/Users_Controller.php Wed Jun 17 21:05:48 2009
@@ -64,6 +64,7 @@
        }
    }
    
+/*****
    function getFriendCloud($username,$connection){
         $sql = "select firstname, lastname, friends_username from PERSON as p, PERSON_PERSON
as pp where pp.person_username='$username' and p.username=pp.friends_username and pp.is_accepted=1";
         $result = $connection->query($sql);
@@ -82,27 +83,38 @@
           return 'This person has no friends.';
         }
    }
-   /*
+****/
+   
    function getFriendCloud($username,$connection){
-        $sql = "select firstname, lastname, friends_username, imagethumburl from PERSON as
p, PERSON_PERSON as pp where pp.person_username='$username' and p.username=pp.friends_username
and pp.is_accepted=1 limit 6";
+        $sql = "select firstname, lastname, friends_username, imagethumburl from PERSON as
p, PERSON_PERSON as pp where pp.person_username='$username' and p.username=pp.friends_username
and pp.is_accepted=1";
         $result = $connection->query($sql);
         $rowsFound = false;
+        $count = 0;
+        $space = " ";
         while($row = $result->getArray()) {
+	    $count = $count + 1;
             $rowsFound = true;
             $friend = $row['friends_username'];
             $fn = $row['firstname'];
             $ln = $row['lastname'];
             $image = $row['imagethumburl'];
-            $friendCloud = $friendCloud." ".'<div class="friend_cloud_item"> <a
href="users.php?username=<?echo $username; ?>" style="display: block;"> <img src="fileService.php?cache=false&file=<?=$image?>"
height=150px width=150px /> </a><br /> <a href="users.php?username='.$friend.'">'.$fn.'
'.$ln.'</a> </div>';
+            $friendCloud = $friendCloud." ".'<div class="friend_cloud_item"> <a
href="users.php?username='.$friend.'" style="display: block;"> <img src="fileService.php?cache=false&file='.$image.'"
height=50px width=50px /> </a><br /> <a href="users.php?username='.$friend.'">'.$fn.'
'.$ln.' </a> '.$space.' </div>';
+	    if($count >= 6){
+		break;
+	    }
         }
         unset($result);
         if ($rowsFound == true) {
-          return $friendCloud;
+	  if ($count >= 6){
+          	return $friendCloud."<br/ ". '<a href="friends.php?username='.$username.'">more...</a>';
+	  }else{
+		return $friendCloud;
+	  }
         }else{
           return 'This person has no friends.';
         }
    }
-   */
+   
    
    function getFriendsList($usernm,$loggedinuser,$connection,$offset){
         $sql = "select firstname, lastname, friends_username as username, imagethumburl from
PERSON as p, PERSON_PERSON as pp where pp.person_username='$usernm' and p.username=pp.friends_username
and pp.is_accepted=1 limit $offset,10";

Modified: incubator/olio/webapp/php/trunk/views/users.php
URL: http://svn.apache.org/viewvc/incubator/olio/webapp/php/trunk/views/users.php?rev=785802&r1=785801&r2=785802&view=diff
==============================================================================
--- incubator/olio/webapp/php/trunk/views/users.php (original)
+++ incubator/olio/webapp/php/trunk/views/users.php Wed Jun 17 21:05:48 2009
@@ -128,7 +128,6 @@
   <p id="friendCloud"><?=$friendCloud;?></p>
   <p class="clr" />
 </div>
-<? echo '<a href="friends.php?username='.$username.'">more...</a>'; ?>
 <?if ($username == $_SESSION["uname"]) {?>
 <a name="incoming_requests"></a>
 <div id="incoming">

Modified: incubator/olio/workload/java/trunk/src/org/apache/olio/workload/driver/JavaUIDriver.java
URL: http://svn.apache.org/viewvc/incubator/olio/workload/java/trunk/src/org/apache/olio/workload/driver/JavaUIDriver.java?rev=785802&r1=785801&r2=785802&view=diff
==============================================================================
--- incubator/olio/workload/java/trunk/src/org/apache/olio/workload/driver/JavaUIDriver.java
(original)
+++ incubator/olio/workload/java/trunk/src/org/apache/olio/workload/driver/JavaUIDriver.java
Wed Jun 17 21:05:48 2009
@@ -734,11 +734,14 @@
         StringBuilder responseBuffer = http.getResponseBuffer();
         if (responseBuffer.length() == 0)
             throw new IOException("Received empty response");
-        //Set<String> images = parseImages(responseBuffer);
+        Set<String> images = parseImages(responseBuffer);
         loadStatics(personStatics);
         //logger.info("The buffer is before appending is " + buffer.toString() );
         //logger.info("readURL is: " + buffer.toString() + id +".jpg"); 
+		/**
         http.readURL(buffer.append(id).append(".jpg").toString());
+		*/
+		loadImages(images);
     }
 
     public void doAddAttendee() throws IOException {

Modified: incubator/olio/workload/php/trunk/src/org/apache/olio/workload/driver/UIDriver.java
URL: http://svn.apache.org/viewvc/incubator/olio/workload/php/trunk/src/org/apache/olio/workload/driver/UIDriver.java?rev=785802&r1=785801&r2=785802&view=diff
==============================================================================
--- incubator/olio/workload/php/trunk/src/org/apache/olio/workload/driver/UIDriver.java (original)
+++ incubator/olio/workload/php/trunk/src/org/apache/olio/workload/driver/UIDriver.java Wed
Jun 17 21:05:48 2009
@@ -612,9 +612,14 @@
         StringBuilder responseBuffer = http.getResponseBuffer();
         if (responseBuffer.length() == 0)
             throw new IOException("Received empty response");
+		/*
+		 * We need to also retrieve the images in the friend cloud
+        http.readURL(buffer.append(id).append(".jpg").toString());
+		 */
 
+        Set<String> images = parseImages(responseBuffer);
         loadStatics(personStatics);       
-        http.readURL(buffer.append(id).append(".jpg").toString());
+		loadImages(images);
     }
 
     public void doAddAttendee() throws IOException {

Modified: incubator/olio/workload/rails/trunk/src/org/apache/olio/workload/driver/UIDriver.java
URL: http://svn.apache.org/viewvc/incubator/olio/workload/rails/trunk/src/org/apache/olio/workload/driver/UIDriver.java?rev=785802&r1=785801&r2=785802&view=diff
==============================================================================
--- incubator/olio/workload/rails/trunk/src/org/apache/olio/workload/driver/UIDriver.java
(original)
+++ incubator/olio/workload/rails/trunk/src/org/apache/olio/workload/driver/UIDriver.java
Wed Jun 17 21:05:48 2009
@@ -679,7 +679,8 @@
             StringBuilder responseBuffer = new StringBuilder(personDetailGet.getResponseBodyAsString());
             if (responseBuffer.length() == 0)
                 throw new IOException("Received empty response");
-
+            Set<String> images = parseImages(responseBuffer);
+			loadImages(images);
             String event = RandomUtil.randomEvent(random, responseBuffer);
             if (event != null)
                 selectedEvent = event;



Mime
View raw message