shindig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lind...@apache.org
Subject svn commit: r1148650 - in /shindig/trunk: content/samplecontainer/examples/embeddedexperiences/ content/sampledata/ features/ features/src/main/javascript/features/ features/src/main/javascript/features/embeddedexperiences/ features/src/test/javascript...
Date Wed, 20 Jul 2011 08:41:47 GMT
Author: lindner
Date: Wed Jul 20 08:41:44 2011
New Revision: 1148650

URL: http://svn.apache.org/viewvc?rev=1148650&view=rev
Log:
Patch from Ryan Baxter | Embedded Experiences Feature Implementation and Referece Implementation

Added:
    shindig/trunk/content/samplecontainer/examples/embeddedexperiences/
    shindig/trunk/content/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml
    shindig/trunk/content/samplecontainer/examples/embeddedexperiences/EEContainer.js
    shindig/trunk/content/samplecontainer/examples/embeddedexperiences/PhotoList.xml
    shindig/trunk/content/samplecontainer/examples/embeddedexperiences/index.html
    shindig/trunk/features/src/main/javascript/features/embeddedexperiences/
    shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js
    shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_container.js
    shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_gadgets.js
    shindig/trunk/features/src/main/javascript/features/embeddedexperiences/feature.xml
    shindig/trunk/features/src/test/javascript/features/embeddedexperiences/
    shindig/trunk/features/src/test/javascript/features/embeddedexperiences/embedded_experiences_container_test.js
Modified:
    shindig/trunk/content/sampledata/canonicaldb.json
    shindig/trunk/features/pom.xml
    shindig/trunk/features/src/main/javascript/features/features.txt
    shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomId.xml
    shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomIds.xml
    shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonDelete.json
    shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonGroup.json
    shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonId.json
    shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonIds.json
    shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlId.xml
    shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlIds.xml

Added: shindig/trunk/content/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/content/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml?rev=1148650&view=auto
==============================================================================
--- shindig/trunk/content/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml (added)
+++ shindig/trunk/content/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml Wed Jul 20 08:41:44 2011
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<Module>
+	<ModulePrefs title="Photo Album Viewer" description="View Photos From An Album" height="400" width="650">
+		<Require feature="embedded-experiences"></Require>
+        <Require feature="dynamic-height"></Require>
+        <Require feature="views"></Require>
+	</ModulePrefs>
+	<Content type="html" view="embedded, default">
+   <![CDATA[
+   	 <style type="text/css">
+		.photo {
+			float: left;
+			margin-left: 20px;
+			margin-right: 20px;
+			margin-bottom: 70px;
+			maring-top: 20px;
+			padding: 2px 2px 2px 2px;
+			border: 1px solid black;
+		}
+		
+		#wrapper{
+			border: 1px solid black;
+		}
+		
+		#header{
+			font-size: 120%;
+			padding: 10px 10px 10px 10px;
+			color: #0F67A1;
+		}     	
+		
+		.clear{
+			clear: both;
+		} 	
+     </style>
+     
+ 
+     <script type="text/javascript">     	
+     	function initAlbum(){
+     		opensocial.data.getDataContext().registerListener('org.opensocial.ee.context', function(key){
+     			createAlbumHTML(opensocial.data.getDataContext().getDataSet(key));
+     		});
+     	}
+     	
+     	function createAlbumHTML(context){
+     	    var photos = context.photoUrls;
+     		var result = "";
+     		for(var i = 0; i < photos.length; i++){
+     			result = result + '<div class="photo"><img src="' + photos[i] + '"/></div>';
+     		}
+     		document.getElementById('header').innerHTML = context.albumName;
+     		document.getElementById("album").innerHTML = result;
+            gadgets.views.setReturnValue("Rendered Album");
+     	}
+     	
+     	gadgets.util.registerOnLoadHandler(initAlbum);
+   	 </script>
+	 
+	 <div id="wrapper">
+	 	<div id="header"></div>
+	 	<div id="album"></div>
+	 	<div class="clear"/>
+	 </div>
+  ]]>
+	</Content>
+</Module>

Added: shindig/trunk/content/samplecontainer/examples/embeddedexperiences/EEContainer.js
URL: http://svn.apache.org/viewvc/shindig/trunk/content/samplecontainer/examples/embeddedexperiences/EEContainer.js?rev=1148650&view=auto
==============================================================================
--- shindig/trunk/content/samplecontainer/examples/embeddedexperiences/EEContainer.js (added)
+++ shindig/trunk/content/samplecontainer/examples/embeddedexperiences/EEContainer.js Wed Jul 20 08:41:44 2011
@@ -0,0 +1,148 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+//The URL to request the activity stream
+var ACTIVITY_STREAMS_URL = "http://localhost:8080/social/rest/activitystreams/john.doe/";
+
+//When the document is ready kick off the request so we can render the activity stream
+$(document).ready(function() {
+	var makeRequestParams = {"CONTENT_TYPE" : "JSON", "METHOD" : "GET", "POST_DATA" : {}};
+	gadgets.io.makeNonProxiedRequest(
+			ACTIVITY_STREAMS_URL, 
+			function(response) {renderAS(response.data);},
+			makeRequestParams,
+			"application/javascript"
+	);
+});
+
+
+
+//Initiate the common container code and register any RPC listeners for embedded experiences
+var CommonContainer = new osapi.container.Container({});
+CommonContainer.init = new function(){
+	
+	CommonContainer.rpcRegister('ee_gadget_rendered', gadgetRendered);
+	
+	CommonContainer.views.createElementForEmbeddedExperience = function(opt_viewTarget){
+	  return document.getElementById('preview');
+	};
+	
+	CommonContainer.views.destroyElement = function(site){
+	  CommonContainer.ee.close(site);
+	};
+}
+
+/**
+ * Handles the RPC request letting the container know that the embedded experience gadget is rendered.
+ * @param rpcArgs the RPC args from the request
+ * @param data any data passed in from the caller
+ * @return void
+ */
+function gadgetRendered(rpcArgs, data){
+	var gadgetSite = rpcArgs.gs;
+	var renderParams = gadgetSite.currentGadgetHolder_.renderParams_;
+	var eeDataModel = renderParams.eeDataModel;
+	var context = null;
+	if(eeDataModel){
+		context = eeDataModel.context;
+	}
+	rpcArgs.callback(context);
+}
+
+/**
+ * Renders the activity stream on the page
+ * @param stream the activity stream json
+ * @return void
+ */
+function renderAS(stream){
+	jQuery.each(stream.entry, createAccordianEntry);
+	$("#accordion").accordion({
+		clearStyle: true,
+		active: false,
+		change: function(event, ui){
+			closeCurrentGadget();
+			onAccordionChange(stream, event, ui);
+		}
+
+	});
+}
+
+/**
+ * Closes the current gadget when a new accordian is selected.
+ */
+var currentEESite;
+function closeCurrentGadget(){
+	if(currentEESite)
+		CommonContainer.ee.close(currentEESite);
+	
+	var preview = document.getElementById('preview');
+	var previewChildren = preview.childNodes;
+	if(previewChildren.length > 0){
+	  var iframe = previewChildren[0];
+	  var iframeId = iframe.getAttribute('id');
+	  var site = CommonContainer.getGadgetSiteByIframeId_(iframeId);
+	  CommonContainer.ee.close(site);
+	}
+}
+
+/**
+ * Called when a new accordian pane is opened.
+ * @param stream the activity stream for the accordian
+ * @param event the event that occurred
+ * @param ui the ui elements changing
+ * @return void
+ */
+
+function onAccordionChange(stream, event, ui){
+	var id = ui.newHeader.context.id;
+	var localStream = stream;
+	var entry = localStream.entry[id];
+	var extensions = entry.openSocial;
+	if(extensions){
+		var embed = extensions.embed;
+		if(embed){
+			var eeElement = document.getElementById("ee" + id);
+			var urlRenderingParams = {
+					'height' : 400,
+					'width' : 650
+			};
+			currentEESite = CommonContainer.ee.navigate(eeElement, embed, 
+					{'urlRenderParams' : urlRenderingParams}, function(site, metaData){
+					  console.log("Embedded Experiences callback called");
+					  console.log(gadgets.json.stringify(metaData));
+					});
+		}
+	}
+
+
+}
+
+/**
+ * Called for each activity entry and adds the necessary HTML to the page.
+ * @param i the item in the activity stream we are currently rendering
+ * @param entry the activity stream entry json
+ * @return void
+ */
+function createAccordianEntry(i, entry){
+	var result = '<h3 id=' + i + '><a href="#">' + entry.title + '</a></h3><div>';
+	if(entry.body)
+		result = result + '<p>' + entry.body + '</p>';
+	result = result + '<div id="ee' + i + '"></div></div>';
+
+	$('#accordion').append(result);
+}
\ No newline at end of file

Added: shindig/trunk/content/samplecontainer/examples/embeddedexperiences/PhotoList.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/content/samplecontainer/examples/embeddedexperiences/PhotoList.xml?rev=1148650&view=auto
==============================================================================
--- shindig/trunk/content/samplecontainer/examples/embeddedexperiences/PhotoList.xml (added)
+++ shindig/trunk/content/samplecontainer/examples/embeddedexperiences/PhotoList.xml Wed Jul 20 08:41:44 2011
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<Module>
+    <ModulePrefs title="Photo List" description="View Photos From An Album" height="400" width="650">
+        <Require feature="embedded-experiences"></Require>
+        <Require feature="views"></Require>
+    </ModulePrefs>
+    <Content type="html" view="embedded, default">
+   <![CDATA[
+        <style type="text/css">
+        .photo {
+            float: left;
+            margin-left: 20px;
+            margin-right: 20px;
+            margin-bottom: 70px;
+            maring-top: 20px;
+            padding: 2px 2px 2px 2px;
+            border: 1px solid black;
+        }
+        
+        #wrapper{
+            border: 1px solid black;
+        }
+        
+        #header{
+            font-size: 120%;
+            padding: 10px 10px 10px 10px;
+            color: #0F67A1;
+        }         
+        
+        .clear{
+            clear: both;
+        }     
+     </style>
+     
+ 
+     <script type="text/javascript"> 
+     
+         var currentSite;
+                 
+         function initAlbum(){
+             opensocial.data.getDataContext().registerListener('org.opensocial.ee.context', function(key){
+                 createAlbumHTML(opensocial.data.getDataContext().getDataSet(key));
+             });
+         };
+         var context;
+         function createAlbumHTML(context){
+             this.context=context;
+             var photos = context.photoUrls;
+             var result = "";
+             for(var i = 0; i < photos.length; i++){
+                 count = i+1;
+                 result = result + '<li style="text-decoration: underline; color: blue; cursor: pointer" onclick="showPreviewPhoto(\''+i+'\')">Photo '+count+'</li></br>';
+             }
+             document.getElementById('header').innerHTML = context.albumName;
+             document.getElementById("album").innerHTML = result;
+         };
+         
+         gadgets.util.registerOnLoadHandler(initAlbum);
+         
+         function showPreviewPhoto(index) {
+                  
+            var eeDataModel = {
+                'gadget' : 'http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml',
+                'context' : {              
+                  "albumName": context.albumName, 
+                  "photoUrls": [context.photoUrls[index]]
+              }
+            };
+            
+            var navigateCallback = function(site, metadata){currentSite = site; console.log("Nagivate callback");};  
+            var returnCallback = function(returnValue){console.log("Return Value: " + returnValue);};
+            gadgets.views.openEmbeddedExperience(returnCallback, navigateCallback, eeDataModel, {'viewTarget' : 'preview'});
+         };
+         
+         function closePreview(){
+            if(currentSite != null){
+                gadgets.views.close(currentSite);
+            }
+            return false;
+         };
+        </script>
+     
+     <div id="wrapper">
+         <div id="header"></div>
+         <div id="album"></div>
+         <div class="clear"/>
+         <a href="#" onclick="closePreview();">Close Preview</a>
+     </div>
+  ]]>
+    </Content>
+</Module>

Added: shindig/trunk/content/samplecontainer/examples/embeddedexperiences/index.html
URL: http://svn.apache.org/viewvc/shindig/trunk/content/samplecontainer/examples/embeddedexperiences/index.html?rev=1148650&view=auto
==============================================================================
--- shindig/trunk/content/samplecontainer/examples/embeddedexperiences/index.html (added)
+++ shindig/trunk/content/samplecontainer/examples/embeddedexperiences/index.html Wed Jul 20 08:41:44 2011
@@ -0,0 +1,59 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">    
+  <head>
+        <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
+		<style type="text/css">
+			html,body{
+				width: 100%;
+				height: 100%;
+			}
+			#content {
+				width: 100%;
+				height: 100%;
+			}
+
+			#preview {
+				height: 100%;
+				width: 45%;
+				float: left;
+				margin-left: 10px;
+			}
+
+			#accordion {
+				width: 50%;
+				float: left;
+			}
+		</style>
+		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
+        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
+        <script type="text/javascript" src="/gadgets/js/core:container:rpc:views.js?c=1&debug=1&container=default"></script>
+        <script type="text/javascript" src="EEContainer.js"></script>
+    </head>
+    <body style="font-size:62.5%;">
+      <div id="content">    
+        <div id="accordion">
+        </div>
+        <div id="preview"></div>
+        <div style="clear: both;"/>
+      </div>
+    </body>
+</html>
\ No newline at end of file

Modified: shindig/trunk/content/sampledata/canonicaldb.json
URL: http://svn.apache.org/viewvc/shindig/trunk/content/sampledata/canonicaldb.json?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/content/sampledata/canonicaldb.json (original)
+++ shindig/trunk/content/sampledata/canonicaldb.json Wed Jul 20 08:41:44 2011
@@ -352,7 +352,7 @@
 "activityEntries" : {
 	"john.doe": [{
 		"id": "activity1",
-		"title": "John posted a new blog entry",
+		"title": "John shared new photos with you",
 	    "published": "2011-02-10T15:04:55Z",
 	    "actor": {
 	      "url": "http://example.org/john",
@@ -375,7 +375,24 @@
 	      "objectType": "blog",
 	      "id": "target1",
 	      "displayName": "John's Blog"
-	    }
+	    },
+          "openSocial": {
+          "embed" : {
+          "gadget" : "http://localhost:8080/samplecontainer/examples/embeddedexperiences/PhotoList.xml",
+          "context" : {
+            "albumName": "Germany 2009",
+            "photoUrls": [
+              "http://farm4.static.flickr.com/3495/3925132517_5959dac775.jpg",
+                 "http://farm4.static.flickr.com/3629/3394799776_47676abb46.jpg",
+               "http://farm5.static.flickr.com/4009/4413640211_715d924d9b.jpg",
+               "http://farm3.static.flickr.com/2340/3528537244_d2fb037aba.jpg",
+               "http://farm1.static.flickr.com/36/98407782_9c4c5866d1.jpg",
+               "http://farm1.static.flickr.com/48/180544479_bb0d0f6559.jpg",
+               "http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7.jpg"
+             ]
+           }
+        }
+        }
 	  }, {
 	  	"id": "activity2",
         "published": "2011-03-10T15:04:55Z",
@@ -385,7 +402,7 @@
         "provider": {
           "url": "http://example.org/activity-stream"
         },
-        "title": "John posted a new video to his album.",
+        "title": "John posted a new photo album.",
         "actor": {
           "url": "http://example.org/john",
           "objectType": "person",
@@ -427,11 +444,21 @@
           }
         },
         "openSocial": {
-          "embed": {
-            "url": "http://example.org/album/",
-            "gadget": "http://example.org/albumViewer.xml",
-            "context": "1234"
-          }
+          "embed" : {
+          "gadget" : "http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml",
+          "context" : {
+            "albumName": "Germany 2009",
+            "photoUrls": [
+              "http://farm4.static.flickr.com/3495/3925132517_5959dac775_t.jpg",
+                 "http://farm4.static.flickr.com/3629/3394799776_47676abb46_t.jpg",
+               "http://farm5.static.flickr.com/4009/4413640211_715d924d9b_t.jpg",
+               "http://farm3.static.flickr.com/2340/3528537244_d2fb037aba_t.jpg",
+               "http://farm1.static.flickr.com/36/98407782_9c4c5866d1_t.jpg",
+               "http://farm1.static.flickr.com/48/180544479_bb0d0f6559_t.jpg",
+               "http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7_t.jpg"
+             ]
+           }
+        }
         }
       }]
 },

Modified: shindig/trunk/features/pom.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/features/pom.xml (original)
+++ shindig/trunk/features/pom.xml Wed Jul 20 08:41:44 2011
@@ -182,6 +182,8 @@
                 <source>actions/actions_container.js</source>
                 <source>actions/actions.js</source>
                 <source>opensearch/opensearch.js</source>
+                <source>embeddedexperiences/constant.js</source>
+                <source>embeddedexperiences/embedded_experiences_container.js</source>
               </sources>
               <testSourceDirectory>${basedir}/src/test/javascript/features</testSourceDirectory>
               <testSuites>

Added: shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js?rev=1148650&view=auto
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js (added)
+++ shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js Wed Jul 20 08:41:44 2011
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+/**
+ * @fileoverview Constants used throughout the container classes for
+ * embedded experiences.
+ */
+
+/**
+ * Embedded experience namespace
+ * @type {Object}
+ */
+osapi.container.ee = {};
+
+/**
+ * Rendering params for an embedded experience
+ * @enum {string}
+ */
+osapi.container.ee.RenderParams = {};
+osapi.container.ee.RenderParams.GADGET_RENDER_PARAMS = 'gadgetRenderParams';
+osapi.container.ee.RenderParams.GADGET_VIEW_PARAMS = 'gadgetViewParams';
+osapi.container.ee.RenderParams.URL_RENDER_PARAMS = 'urlRenderParams';
+osapi.container.ee.RenderParams.DATA_MODEL = 'eeDataModel';
+osapi.container.ee.RenderParams.EMBEDDED = 'embedded';

Added: shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_container.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_container.js?rev=1148650&view=auto
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_container.js (added)
+++ shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_container.js Wed Jul 20 08:41:44 2011
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * This feature adds additional functionality to the common container to support
+ * rendering embedded experiences.
+ */
+(function() {
+
+  osapi.container.Container.addMixin('ee', function(context) {
+
+    /**
+     * Navigates to an EE gadget
+     * @param {Element} element the element to put the gadget in.
+     * @param {Object} dataModel the EE data model.
+     * @param {Object} renderParams params to augment the rendering.
+     * @param {Function} opt_callback called once the gadget has been navigated to.
+     */
+    function navigateGadget_(element, dataModel, 
+            renderParams, opt_callback) {
+      var viewParams = renderParams[osapi.container.ee.RenderParams.GADGET_VIEW_PARAMS] || {};
+      var localRenderParams =
+        renderParams[osapi.container.ee.RenderParams.GADGET_RENDER_PARAMS] || {};
+      localRenderParams[osapi.container.ee.RenderParams.DATA_MODEL] = dataModel;
+      localRenderParams[osapi.container.RenderParam.VIEW] =
+        osapi.container.ee.RenderParams.EMBEDDED;
+      var site = context.newGadgetSite(element);
+      var gadgetUrl = dataModel.gadget;
+
+      context.preloadGadget(gadgetUrl, function(metadata) {
+        if (metadata[gadgetUrl] == null ||
+                (metadata[gadgetUrl] != null && metadata[gadgetUrl].error)) {
+          //There was an error preloading the gadget URL lets try and render the
+          //URL EE if there is one
+          if (dataModel.url != null) {
+            navigateUrl_(element, dataModel, renderParams, opt_callback);
+          }
+          else if (opt_callback != null) {
+            opt_callback(site, metadata);
+          }
+        }
+        else {
+          context.navigateGadget(site, gadgetUrl, viewParams, localRenderParams,
+            function(metadata) {
+              if (opt_callback != null) {
+                opt_callback(site, metadata);
+              }
+         });
+        }
+      });
+    };
+
+    /**
+     * Navigates to a URL
+     * @param {Element} element the element to render the URL in.
+     * @param {Object} dataModel the EE data model.
+     * @param {Object} renderParams params to augment the rendering.
+     * Valid rendering parameters include osapi.container.RenderParam.CLASS,
+     * osapi.container.RenderParam.HEIGHT, and osapi.container.RenderParam.WIDTH.
+     * @param {Function} opt_callback called when the URL has been navigated to.
+     */
+    function navigateUrl_(element, dataModel, renderParams, opt_callback) {
+      var urlRenderParams =
+        renderParams[osapi.container.ee.RenderParams.URL_RENDER_PARAMS] || {};
+      var site = context.newUrlSite(element);
+      var toReturn = context.navigateUrl(site, dataModel.url, urlRenderParams);
+      if (opt_callback) {
+        opt_callback(toReturn, null);
+      }
+    };
+
+    return {
+
+      /**
+       * Navigate to an embedded experience.  Call this method to render any embedded experience.
+       * @param {Element} element the element to render the embedded experience in.
+       * @param {Object} datModel the EE data model.
+       * @param {Object} renderParams parameters for the embedded experience.
+       * @param {Function} opt_callback callback function which will be called after the
+       * gadget has rendered.
+       */
+      'navigate' : function(element, dataModel, renderParams, opt_callback) {
+        if (dataModel.gadget) {
+          navigateGadget_(element, dataModel, renderParams, opt_callback);
+        }
+        else if (dataModel.url) {
+          navigateUrl_(element, dataModel, renderParams, opt_callback);
+        }
+      },
+
+      /**
+       * Closes the embedded experience on the page.
+       * @param {object} site one of osapi.container.GadgetSite or osapi.container.UrlSite.
+       */
+      'close' : function(site) {
+        /*
+         * At the moment this will work fine because an EE can be either a gadget or URL
+         * and at the moment they both have a close method.  However it is hard
+         * to have both the GadgetSite and UrlSite classes adhear to this contract in Javascript
+         * so it may be better to wrap both classes in one class.
+         */
+        if (site instanceof osapi.container.GadgetSite) {
+          context.closeGadget(site);
+        }
+
+        if (site instanceof osapi.container.UrlSite) {
+          site.close();
+        }
+      }
+    };
+  });
+})();

Added: shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_gadgets.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_gadgets.js?rev=1148650&view=auto
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_gadgets.js (added)
+++ shindig/trunk/features/src/main/javascript/features/embeddedexperiences/embedded_experiences_gadgets.js Wed Jul 20 08:41:44 2011
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+gadgets['embeddedExperiences'] = gadgets['embeddedExperiences'] || {};
+
+(function() {
+  /**
+   * Sets the context for this embedded experience.
+   * @param {Object} context the embedded experiences context.
+   */
+  function setDataContext(context) {
+    opensocial.data.DataContext.putDataSet('org.opensocial.ee.context', context);
+  };
+
+  /**
+   * Init the embedded experiences feature.  This calls an RPC handler to get
+   * the embedded experiences context and puts it in the gadgets data context.
+   * @param {Object} config configuration for the feature.
+   */
+  function init(config) {
+    gadgets.rpc.call(null, 'ee_gadget_rendered', setDataContext, {});
+    gadgets.rpc.register('ee_set_context', setDataContext);
+  };
+
+  if (gadgets.config) {
+    gadgets.config.register('embedded-experiences', null, init);
+  }
+
+}());

Added: shindig/trunk/features/src/main/javascript/features/embeddedexperiences/feature.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/embeddedexperiences/feature.xml?rev=1148650&view=auto
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/embeddedexperiences/feature.xml (added)
+++ shindig/trunk/features/src/main/javascript/features/embeddedexperiences/feature.xml Wed Jul 20 08:41:44 2011
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations under the License.
+-->
+<feature>
+    <name>embedded-experiences</name>
+    <dependency>core.config</dependency>
+    <dependency>opensocial-data-context</dependency>
+    <dependency>opensocial</dependency>
+    <dependency>container</dependency>
+    <gadget>
+        <script src="embedded_experiences_gadgets.js" />
+    </gadget>
+    <container>
+        <script src="constant.js" />
+        <script src="embedded_experiences_container.js" />
+        <api>
+            <exports type="js">osapi.container.Container.ee</exports>
+            <exports type="js">osapi.container.Container.ee.navigate</exports>
+            <exports type="js">osapi.container.Container.ee.close</exports>
+            <exports type="js">osapi.container.ee.RenderParams.GADGET_RENDER_PARAMS</exports>
+            <exports type="js">osapi.container.ee.RenderParams.GADGET_VIEW_PARAMS</exports>
+            <exports type="js">osapi.container.ee.RenderParams.URL_RENDER_PARAMS</exports>
+            <exports type="js">osapi.container.ee.RenderParams.DATA_MODEL</exports>
+            <exports type="js">osapi.container.ee.RenderParams.EMBEDDED</exports>
+        </api>
+    </container>
+</feature>
\ No newline at end of file

Modified: shindig/trunk/features/src/main/javascript/features/features.txt
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/features.txt?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/features.txt (original)
+++ shindig/trunk/features/src/main/javascript/features/features.txt Wed Jul 20 08:41:44 2011
@@ -51,6 +51,7 @@ features/defer.test/feature.xml
 features/dynamic-height.height/feature.xml
 features/dynamic-height.util/feature.xml
 features/dynamic-height/feature.xml
+features/embeddedexperiences/feature.xml
 features/exportjs/feature.xml
 features/flash/feature.xml
 features/gadgets.json.ext/feature.xml

Added: shindig/trunk/features/src/test/javascript/features/embeddedexperiences/embedded_experiences_container_test.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/test/javascript/features/embeddedexperiences/embedded_experiences_container_test.js?rev=1148650&view=auto
==============================================================================
--- shindig/trunk/features/src/test/javascript/features/embeddedexperiences/embedded_experiences_container_test.js (added)
+++ shindig/trunk/features/src/test/javascript/features/embeddedexperiences/embedded_experiences_container_test.js Wed Jul 20 08:41:44 2011
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @fileoverview Tests for container APIs for embedded experiences
+ */
+
+function EEContainerTest(name) {
+  TestCase.call(this, name);
+}
+
+EEContainerTest.inherits(TestCase);
+EEContainerTest.prototype.setUp = function() {
+      this.apiUri = window.__API_URI;
+      window.__API_URI = shindig.uri('http://shindig.com');
+      this.containerUri = window.__CONTAINER_URI;
+      window.__CONTAINER_URI = shindig.uri('http://container.com');
+      this.shindigContainerGadgetSite = osapi.container.GadgetSite;
+      this.shindigContainerUrlSite = osapi.container.UrlSite;
+      this.shindigContainerPreload = osapi.container.Container.preloadGadget;
+      this.gadgetsRpc = gadgets.rpc;
+};
+
+EEContainerTest.prototype.tearDown = function() {
+      window.__API_URI = this.apiUri;
+      window.__CONTAINER_URI = this.containerUri;
+      osapi.container.GadgetSite = this.shindigContainerGadgetSite;
+      osapi.container.UrlSite = this.shindigContainerUrlSite;
+      osapi.container.Container.preloadGadget = this.shindigContainerPreload;
+      gadgets.rpc = this.gadgetsRpc;
+};
+
+EEContainerTest.prototype.testNavigateGadget = function(){
+      this.setupGadgetsRpcRegister();
+      var container = new osapi.container.Container({
+        'allowDefaultView' : true,
+        'renderCajole' : true,
+        'renderDebug' : true,
+        'renderTest' : true
+      });
+      
+      var eeDataModel = {"gadget" : "http://example.com/gadget.xml", "context" : "123"};
+
+      this.setupGadgetSite(1, {}, null);
+      this.setupPreload();
+      container.ee.navigate({}, eeDataModel, {});
+      var renderParamDataModel = this.site_navigateTo_renderParams['eeDataModel'];
+      this.assertEquals("http://example.com/gadget.xml", renderParamDataModel.gadget);
+      this.assertEquals("123", renderParamDataModel.context);
+      this.assertEquals('embedded', this.site_navigateTo_renderParams['view']);
+      this.assertEquals("http://example.com/gadget.xml", this.site_navigateTo_gadgetUrl);
+      this.assertTrue(this.site_navigateTo_renderParams['allowDefaultView']);
+      this.assertTrue(this.site_navigateTo_renderParams['cajole']);
+      this.assertTrue(this.site_navigateTo_renderParams['debug']);
+      this.assertTrue(this.site_navigateTo_renderParams['nocache']);
+      this.assertTrue(this.site_navigateTo_renderParams['testmode']);
+    
+};
+
+EEContainerTest.prototype.setupGadgetsRpcRegister = function() {
+      gadgets.rpc = {
+        register: function() {
+        }
+      };
+};
+
+EEContainerTest.prototype.setupGadgetSite = function(id, gadgetInfo, gadgetHolder) {
+    var self = this;
+    osapi.container.GadgetSite = function() {
+        return {
+            'getId' : function() {
+                return id;
+            },
+            'navigateTo' : function(gadgetUrl, viewParams, renderParams, func) {
+                self.site_navigateTo_gadgetUrl = gadgetUrl;
+                self.site_navigateTo_viewParams = viewParams;
+                self.site_navigateTo_renderParams = renderParams;
+                func(gadgetInfo);
+            },
+            'getActiveGadgetHolder' : function() {
+                return gadgetHolder;
+            }
+        };
+    };
+};
+
+EEContainerTest.prototype.setupUrlSite = function(id, url, urlHolder){
+    var self = this;
+    osapi.container.UrlSite = function(){
+        return {
+            "getId" : function(){
+                return id;
+            },
+            "render" : function(url, renderParams){
+                self.urlsite_render_url = url;
+                self.urlsite_render_renderParams = renderParams;
+            }
+        };
+    };
+};
+
+EEContainerTest.prototype.setupPreload = function(){
+  osapi.container.Container.prototype.preloadGadget = function(gadgetUrl, func){
+    var ret = [];
+    ret[gadgetUrl] = {};
+    func(ret);
+  };
+};
\ No newline at end of file

Modified: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomId.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomId.xml?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomId.xml (original)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomId.xml Wed Jul 20 08:41:44 2011
@@ -1,7 +1,7 @@
 <feed xmlns="http://www.w3.org/2005/Atom" xmlns:osearch="http://a9.com/-/spec/opensearch/1.1">
   <entry>
     <id>activity2</id>
-    <title>John posted a new video to his album.</title>
+    <title>John posted a new photo album.</title>
     <summary>Photo posted</summary>
     <author>
       <uri>john.doe</uri>
@@ -64,13 +64,24 @@
           <objectType>photo-album</objectType>
           <url>http://example.org/album/</url>
         </target>
-        <title>John posted a new video to his album.</title>
+        <title>John posted a new photo album.</title>
         <verb>post</verb>
         <openSocial>
           <embed>
-            <context>1234</context>
-            <gadget>http://example.org/albumViewer.xml</gadget>
-            <url>http://example.org/album/</url>
+            <gadget>http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml</gadget>
+            <context>
+              <albumName>Germany 2009</albumName>
+                <photoUrls>
+                  <java.lang.String>http://farm4.static.flickr.com/3495/3925132517_5959dac775_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm4.static.flickr.com/3629/3394799776_47676abb46_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm5.static.flickr.com/4009/4413640211_715d924d9b_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2340/3528537244_d2fb037aba_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/36/98407782_9c4c5866d1_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/48/180544479_bb0d0f6559_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7_t.jpg</java.lang.String>
+                </photoUrls>              
+            </context>
+           
           </embed>
         </openSocial>
       </activityEntry>

Modified: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomIds.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomIds.xml?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomIds.xml (original)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryAtomIds.xml Wed Jul 20 08:41:44 2011
@@ -1,7 +1,7 @@
 <feed xmlns="http://www.w3.org/2005/Atom" xmlns:osearch="http://a9.com/-/spec/opensearch/1.1">
   <entry>
     <id>activity2</id>
-    <title>John posted a new video to his album.</title>
+    <title>John posted a new photo album.</title>
     <summary>Photo posted</summary>
     <author>
       <uri>john.doe</uri>
@@ -51,9 +51,19 @@
         </object>
         <openSocial>
           <embed>
-            <context>1234</context>
-            <gadget>http://example.org/albumViewer.xml</gadget>
-            <url>http://example.org/album/</url>
+            <context>
+                <albumName>Germany 2009</albumName>
+                <photoUrls>
+                  <java.lang.String>http://farm4.static.flickr.com/3495/3925132517_5959dac775_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm4.static.flickr.com/3629/3394799776_47676abb46_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm5.static.flickr.com/4009/4413640211_715d924d9b_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2340/3528537244_d2fb037aba_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/36/98407782_9c4c5866d1_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/48/180544479_bb0d0f6559_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7_t.jpg</java.lang.String>
+                </photoUrls>              
+            </context>
+            <gadget>http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml</gadget>
           </embed>
         </openSocial>
         <provider>
@@ -71,14 +81,14 @@
           <objectType>photo-album</objectType>
           <url>http://example.org/album/</url>
         </target>
-        <title>John posted a new video to his album.</title>
+        <title>John posted a new photo album.</title>  
         <verb>post</verb>
       </activityEntry>
     </content>
   </entry>
   <entry>
     <id>activity1</id>
-    <title>John posted a new blog entry</title>
+    <title>John shared new photos with you</title>
     <author>
       <uri>john.doe</uri>
       <name xmlns="http://ns.opensocial.org/2008/opensocial">John Doe</name>
@@ -101,6 +111,23 @@
           <id>object1</id>
           <url>http://example.org/blog/2011/02/entry</url>
         </object>
+         <openSocial>
+          <embed>
+            <context>
+                <albumName>Germany 2009</albumName>
+                <photoUrls>
+                  <java.lang.String>http://farm4.static.flickr.com/3495/3925132517_5959dac775.jpg</java.lang.String>
+                  <java.lang.String>http://farm4.static.flickr.com/3629/3394799776_47676abb46.jpg</java.lang.String>
+                  <java.lang.String>http://farm5.static.flickr.com/4009/4413640211_715d924d9b.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2340/3528537244_d2fb037aba.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/36/98407782_9c4c5866d1.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/48/180544479_bb0d0f6559.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7.jpg</java.lang.String>
+                </photoUrls>              
+            </context>
+            <gadget>http://localhost:8080/samplecontainer/examples/embeddedexperiences/PhotoList.xml</gadget>
+          </embed>
+        </openSocial>
         <published>2011-02-10T15:04:55Z</published>
         <target>
           <displayName>John&apos;s Blog</displayName>
@@ -108,7 +135,7 @@
           <objectType>blog</objectType>
           <url>http://example.org/blog/</url>
         </target>
-        <title>John posted a new blog entry</title>
+        <title>John shared new photos with you</title>
         <verb>post</verb>
       </activityEntry>
     </content>

Modified: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonDelete.json
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonDelete.json?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonDelete.json (original)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonDelete.json Wed Jul 20 08:41:44 2011
@@ -11,7 +11,7 @@
         "provider": {
           "url": "http://example.org/activity-stream"
         },
-        "title": "John posted a new video to his album.",
+        "title": "John posted a new photo album.",
         "actor": {
           "url": "http://example.org/john",
           "objectType": "person",
@@ -53,10 +53,20 @@
           }
         },
         "openSocial":{
-          "embed":{
-            "gadget":"http://example.org/albumViewer.xml",
-            "context":"1234",
-            "url":"http://example.org/album/"
+          "embed" : {
+            "gadget" : "http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml",
+            "context" : {
+              "albumName": "Germany 2009",
+              "photoUrls": [
+                "http://farm4.static.flickr.com/3495/3925132517_5959dac775_t.jpg",
+     	        "http://farm4.static.flickr.com/3629/3394799776_47676abb46_t.jpg",
+     		    "http://farm5.static.flickr.com/4009/4413640211_715d924d9b_t.jpg",
+     		    "http://farm3.static.flickr.com/2340/3528537244_d2fb037aba_t.jpg",
+     		    "http://farm1.static.flickr.com/36/98407782_9c4c5866d1_t.jpg",
+     		    "http://farm1.static.flickr.com/48/180544479_bb0d0f6559_t.jpg",
+     		    "http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7_t.jpg"
+     		  ]
+     	    }
           }
         }
       }

Modified: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonGroup.json
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonGroup.json?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonGroup.json (original)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonGroup.json Wed Jul 20 08:41:44 2011
@@ -4,7 +4,7 @@
    "entry":[
       {
 		"id": "activity1",
-		"title": "John posted a new blog entry",
+		"title": "John shared new photos with you",
 	    "published": "2011-02-10T15:04:55Z",
 	    "actor": {
 	      "url": "http://example.org/john",
@@ -27,7 +27,24 @@
 	      "objectType": "blog",
 	      "id": "target1",
 	      "displayName": "John's Blog"
-	    }
+	    },
+          "openSocial":{
+          "embed" : {
+            "gadget" : "http://localhost:8080/samplecontainer/examples/embeddedexperiences/PhotoList.xml",
+            "context" : {
+              "albumName": "Germany 2009",
+              "photoUrls": [
+                "http://farm4.static.flickr.com/3495/3925132517_5959dac775.jpg",
+     	        "http://farm4.static.flickr.com/3629/3394799776_47676abb46.jpg",
+     		    "http://farm5.static.flickr.com/4009/4413640211_715d924d9b.jpg",
+     		    "http://farm3.static.flickr.com/2340/3528537244_d2fb037aba.jpg",
+     		    "http://farm1.static.flickr.com/36/98407782_9c4c5866d1.jpg",
+     		    "http://farm1.static.flickr.com/48/180544479_bb0d0f6559.jpg",
+     		    "http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7.jpg"
+     		  ]
+     	    }
+          }
+        }
 	  }, {
 	  	"id": "activity2",
         "published": "2011-03-10T15:04:55Z",
@@ -37,7 +54,7 @@
         "provider": {
           "url": "http://example.org/activity-stream"
         },
-        "title": "John posted a new video to his album.",
+        "title": "John posted a new photo album.",
         "actor": {
           "url": "http://example.org/john",
           "objectType": "person",
@@ -79,10 +96,20 @@
           }
         },
         "openSocial":{
-          "embed":{
-            "gadget":"http://example.org/albumViewer.xml",
-            "context":"1234",
-            "url":"http://example.org/album/"
+          "embed" : {
+            "gadget" : "http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml",
+            "context" : {
+              "albumName": "Germany 2009",
+              "photoUrls": [
+                "http://farm4.static.flickr.com/3495/3925132517_5959dac775_t.jpg",
+     	        "http://farm4.static.flickr.com/3629/3394799776_47676abb46_t.jpg",
+     		    "http://farm5.static.flickr.com/4009/4413640211_715d924d9b_t.jpg",
+     		    "http://farm3.static.flickr.com/2340/3528537244_d2fb037aba_t.jpg",
+     		    "http://farm1.static.flickr.com/36/98407782_9c4c5866d1_t.jpg",
+     		    "http://farm1.static.flickr.com/48/180544479_bb0d0f6559_t.jpg",
+     		    "http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7_t.jpg"
+     		  ]
+     	    }
           }
         }
       }

Modified: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonId.json
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonId.json?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonId.json (original)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonId.json Wed Jul 20 08:41:44 2011
@@ -1,7 +1,7 @@
 {
    "entry":{
 		"id": "activity1",
-		"title": "John posted a new blog entry",
+		"title": "John shared new photos with you",
 	    "published": "2011-02-10T15:04:55Z",
 	    "actor": {
 	      "url": "http://example.org/john",
@@ -24,6 +24,25 @@
 	      "objectType": "blog",
 	      "id": "target1",
 	      "displayName": "John's Blog"
-	    }
+	    },
+          "openSocial":{
+          "embed" : {
+            "gadget" : "http://localhost:8080/samplecontainer/examples/embeddedexperiences/PhotoList.xml",
+            "context" : {
+              "albumName": "Germany 2009",
+              "photoUrls": [
+                "http://farm4.static.flickr.com/3495/3925132517_5959dac775.jpg",
+     	        "http://farm4.static.flickr.com/3629/3394799776_47676abb46.jpg",
+     		    "http://farm5.static.flickr.com/4009/4413640211_715d924d9b.jpg",
+     		    "http://farm3.static.flickr.com/2340/3528537244_d2fb037aba.jpg",
+     		    "http://farm1.static.flickr.com/36/98407782_9c4c5866d1.jpg",
+     		    "http://farm1.static.flickr.com/48/180544479_bb0d0f6559.jpg",
+     		    "http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7.jpg"
+     		  ]
+     	    }
+          }
+        }
+
+
 	  }
 }
\ No newline at end of file

Modified: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonIds.json
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonIds.json?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonIds.json (original)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryJsonIds.json Wed Jul 20 08:41:44 2011
@@ -4,7 +4,7 @@
    "entry":[
       {
 		"id": "activity1",
-		"title": "John posted a new blog entry",
+		"title": "John shared new photos with you",
 	    "published": "2011-02-10T15:04:55Z",
 	    "actor": {
 	      "url": "http://example.org/john",
@@ -27,7 +27,25 @@
 	      "objectType": "blog",
 	      "id": "target1",
 	      "displayName": "John's Blog"
-	    }
+	    },
+          "openSocial":{
+          "embed" : {
+            "gadget" : "http://localhost:8080/samplecontainer/examples/embeddedexperiences/PhotoList.xml",
+            "context" : {
+              "albumName": "Germany 2009",
+              "photoUrls": [
+                "http://farm4.static.flickr.com/3495/3925132517_5959dac775.jpg",
+     	        "http://farm4.static.flickr.com/3629/3394799776_47676abb46.jpg",
+     		    "http://farm5.static.flickr.com/4009/4413640211_715d924d9b.jpg",
+     		    "http://farm3.static.flickr.com/2340/3528537244_d2fb037aba.jpg",
+     		    "http://farm1.static.flickr.com/36/98407782_9c4c5866d1.jpg",
+     		    "http://farm1.static.flickr.com/48/180544479_bb0d0f6559.jpg",
+     		    "http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7.jpg"
+     		  ]
+     	    }
+          }
+        }
+
 	  }, {
 	  	"id": "activity2",
         "published": "2011-03-10T15:04:55Z",
@@ -37,7 +55,7 @@
         "provider": {
           "url": "http://example.org/activity-stream"
         },
-        "title": "John posted a new video to his album.",
+        "title": "John posted a new photo album.",
         "actor": {
           "url": "http://example.org/john",
           "objectType": "person",
@@ -79,10 +97,20 @@
           }
         },
         "openSocial":{
-          "embed":{
-            "gadget":"http://example.org/albumViewer.xml",
-            "context":"1234",
-            "url":"http://example.org/album/"
+          "embed" : {
+            "gadget" : "http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml",
+            "context" : {
+              "albumName": "Germany 2009",
+              "photoUrls": [
+                "http://farm4.static.flickr.com/3495/3925132517_5959dac775_t.jpg",
+     	        "http://farm4.static.flickr.com/3629/3394799776_47676abb46_t.jpg",
+     		    "http://farm5.static.flickr.com/4009/4413640211_715d924d9b_t.jpg",
+     		    "http://farm3.static.flickr.com/2340/3528537244_d2fb037aba_t.jpg",
+     		    "http://farm1.static.flickr.com/36/98407782_9c4c5866d1_t.jpg",
+     		    "http://farm1.static.flickr.com/48/180544479_bb0d0f6559_t.jpg",
+     		    "http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7_t.jpg"
+     		  ]
+     	    }
           }
         }
       }

Modified: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlId.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlId.xml?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlId.xml (original)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlId.xml Wed Jul 20 08:41:44 2011
@@ -46,9 +46,19 @@
   </object>
   <openSocial>
     <embed>
-      <context>1234</context>
-      <gadget>http://example.org/albumViewer.xml</gadget>
-      <url>http://example.org/album/</url>
+      <context>
+           <albumName>Germany 2009</albumName>
+                <photoUrls>
+                  <java.lang.String>http://farm4.static.flickr.com/3495/3925132517_5959dac775_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm4.static.flickr.com/3629/3394799776_47676abb46_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm5.static.flickr.com/4009/4413640211_715d924d9b_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2340/3528537244_d2fb037aba_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/36/98407782_9c4c5866d1_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/48/180544479_bb0d0f6559_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7_t.jpg</java.lang.String>
+                </photoUrls>              
+      </context>
+      <gadget>http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml</gadget>
     </embed>
   </openSocial>
   <provider>
@@ -69,6 +79,6 @@
     <url>http://example.org/album/</url>
 
   </target>
-  <title>John posted a new video to his album.</title>
+  <title>John posted a new photo album.</title>
   <verb>post</verb>
 </activityEntry></response>
\ No newline at end of file

Modified: shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlIds.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlIds.xml?rev=1148650&r1=1148649&r2=1148650&view=diff
==============================================================================
--- shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlIds.xml (original)
+++ shindig/trunk/java/social-api/src/test/java/org/apache/shindig/social/dataservice/integration/fixtures/ActivityEntryXmlIds.xml Wed Jul 20 08:41:44 2011
@@ -21,7 +21,7 @@
         <url>http://example.org/john</url>
       </actor>
       <id>activity1</id>
-	  <title>John posted a new blog entry</title>
+	  <title>John shared new photos with you</title>
       <object>
         <id>object1</id>
         <url>http://example.org/blog/2011/02/entry</url>
@@ -35,6 +35,23 @@
         <url>http://example.org/blog/</url>
       </target>
       <verb>post</verb>
+      <openSocial>
+        <embed>
+          <context>
+               <albumName>Germany 2009</albumName>
+                <photoUrls>
+                  <java.lang.String>http://farm4.static.flickr.com/3495/3925132517_5959dac775.jpg</java.lang.String>
+                  <java.lang.String>http://farm4.static.flickr.com/3629/3394799776_47676abb46.jpg</java.lang.String>
+                  <java.lang.String>http://farm5.static.flickr.com/4009/4413640211_715d924d9b.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2340/3528537244_d2fb037aba.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/36/98407782_9c4c5866d1.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/48/180544479_bb0d0f6559.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7.jpg</java.lang.String>
+                </photoUrls>              
+          </context>
+          <gadget>http://localhost:8080/samplecontainer/examples/embeddedexperiences/PhotoList.xml</gadget>
+        </embed>
+      </openSocial>
     </activityEntry>
   </entry>
 
@@ -103,13 +120,23 @@
 
         <url>http://example.org/album/</url>
       </target>
-      <title>John posted a new video to his album.</title>
+      <title>John posted a new photo album.</title>
       <verb>post</verb>
       <openSocial>
         <embed>
-          <context>1234</context>
-          <gadget>http://example.org/albumViewer.xml</gadget>
-          <url>http://example.org/album/</url>
+          <context>
+               <albumName>Germany 2009</albumName>
+                <photoUrls>
+                  <java.lang.String>http://farm4.static.flickr.com/3495/3925132517_5959dac775_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm4.static.flickr.com/3629/3394799776_47676abb46_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm5.static.flickr.com/4009/4413640211_715d924d9b_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2340/3528537244_d2fb037aba_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/36/98407782_9c4c5866d1_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm1.static.flickr.com/48/180544479_bb0d0f6559_t.jpg</java.lang.String>
+                  <java.lang.String>http://farm3.static.flickr.com/2668/3858018351_1e7b73c0b7_t.jpg</java.lang.String>
+                </photoUrls>              
+          </context>
+          <gadget>http://localhost:8080/samplecontainer/examples/embeddedexperiences/AlbumViewer.xml</gadget>
         </embed>
       </openSocial>
     </activityEntry>



Mime
View raw message