Author: doll
Date: Tue Jan 29 10:27:50 2008
New Revision: 616466
URL: http://svn.apache.org/viewvc?rev=616466&view=rev
Log:
Fixed feature.xml bug that Jamey pointed out, it was referencing the wrong
files. Also fixed the sample container to move the old opensocial concepts:
surfaces, global app data, instance app data, etc. Have not added the new
concepts to the sample container yet (viral apis etc).
More cls coming.
Changed the sample container
Modified:
incubator/shindig/trunk/features/opensocial-reference/feature.xml
incubator/shindig/trunk/features/opensocial-samplecontainer/samplecontainer.js
incubator/shindig/trunk/features/opensocial-samplecontainer/statefileparser.js
incubator/shindig/trunk/javascript/samplecontainer/state.dtd
Modified: incubator/shindig/trunk/features/opensocial-reference/feature.xml
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-reference/feature.xml?rev=616466&r1=616465&r2=616466&view=diff
==============================================================================
--- incubator/shindig/trunk/features/opensocial-reference/feature.xml (original)
+++ incubator/shindig/trunk/features/opensocial-reference/feature.xml Tue Jan
29 10:27:50 2008
@@ -21,13 +21,21 @@
<gadget>
<script src="opensocial.js"/>
<script src="activity.js"/>
+ <script src="address.js"/>
+ <script src="bodytype.js"/>
<script src="collection.js"/>
<script src="container.js"/>
<script src="datarequest.js"/>
<script src="dataresponse.js"/>
+ <script src="email.js"/>
+ <script src="enum.js"/>
<script src="environment.js"/>
+ <script src="message.js"/>
+ <script src="name.js"/>
+ <script src="organization.js"/>
<script src="person.js"/>
+ <script src="phone.js"/>
<script src="responseitem.js"/>
- <script src="surface.js"/>
+ <script src="url.js"/>
</gadget>
</feature>
Modified:
incubator/shindig/trunk/features/opensocial-samplecontainer/samplecontainer.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-samplecontainer/samplecontainer.js?rev=616466&r1=616465&r2=616466&view=diff
==============================================================================
---
incubator/shindig/trunk/features/opensocial-samplecontainer/samplecontainer.js
(original)
+++
incubator/shindig/trunk/features/opensocial-samplecontainer/samplecontainer.js
Tue Jan 29 10:27:50 2008
@@ -28,6 +28,16 @@
/**
* Implements the opensocial.Container apis.
+ * @constructor
+ */
+opensocial.SampleContainer = function() {
+ opensocial.Container.call(this);
+ this.resetData(this.newPerson());
+};
+opensocial.SampleContainer.inherits(opensocial.Container);
+
+
+/**
*
* @param {Person} viewer Person object that corresponds to the viewer.
* @param {Person} opt_owner Person object that corresponds to the owner.
@@ -35,32 +45,19 @@
* viewer's friends
* @param {Collection.<Person>} opt_ownerFriends A collection of the
* owner's friends
- * @param {Map.<String, String>} opt_globalAppData map from key to value
- * of the global app data
- * @param {Map.<String, String>} opt_instanceAppData map from key to value
- * of this gadget's instance data
* @param {Map.<Person, Map.<String, String>>} opt_personAppData map
* from person to a map of app data key value pairs.
* @param {Map.<String, Array.<Activity>>} opt_activities A map of
* person ids to the activities they have.
- * @constructor
+ * @param {String} opt_appId An optional application id
*/
-opensocial.SampleContainer = function() {
- opensocial.Container.call(this);
- this.resetData(this.newPerson());
-};
-opensocial.SampleContainer.inherits(opensocial.Container);
-
-
opensocial.SampleContainer.prototype.resetData = function(viewer,
- opt_owner, opt_viewerFriends, opt_ownerFriends, opt_globalAppData,
- opt_instanceAppData, opt_personAppData, opt_activities, opt_appId) {
+ opt_owner, opt_viewerFriends, opt_ownerFriends, opt_personAppData,
+ opt_activities, opt_appId) {
this.viewer = viewer;
this.owner = opt_owner;
this.viewerFriends = opt_viewerFriends || this.newCollection([]);
this.ownerFriends = opt_ownerFriends || this.newCollection([]);
- this.globalAppData = opt_globalAppData || {};
- this.instanceAppData = opt_instanceAppData || {};
this.personAppData = opt_personAppData || {};
this.activities = opt_activities || {};
this.appId = opt_appId || 'sampleContainerAppId';
@@ -68,7 +65,6 @@
opensocial.SampleContainer.prototype.getEnvironment = function() {
- var canvasSurface = this.newSurface("canvas", true);
var supportedFields = {
'person' : {
'id' : true,
@@ -100,8 +96,7 @@
};
// In a real container this environment will probably be static
- return this.newEnvironment("samplecontainer", canvasSurface, [canvasSurface],
- supportedFields, this.params);
+ return this.newEnvironment("samplecontainer", supportedFields);
};
@@ -140,25 +135,6 @@
};
-opensocial.SampleContainer.prototype.requestNavigateTo = function(surface,
- opt_params) {
- // The sample container only supports one surface so that part of navigation
- // does not make sense. It does however support parameters and so we set the
- // new parameters. Real containers should do something a lot more
complicated.
- this.params = opt_params;
- // TODO(doll): Change this to use a log
- alert("This gadget has been navigated and has new parameters");
- // TODO(doll): We should somehow reload the gadget here
-};
-
-
-opensocial.SampleContainer.prototype.makeRequest = function(url, callback,
- opt_params) {
- // TODO(doll): Add support for this
- alert("The sample container does not yet support makeRequest calls.");
-};
-
-
/**
* Get a list of ids corresponding to a passed in idspec
*
@@ -273,28 +249,6 @@
persons.length);
break;
- case 'FETCH_GLOBAL_APP_DATA' :
- var values = {};
- var keys = request.keys;
- for (var i = 0; i < keys.length; i++) {
- values[keys[i]] = this.globalAppData[keys[i]];
- }
- requestedValue = values;
- break;
-
- case 'FETCH_INSTANCE_APP_DATA' :
- var values = {};
- var keys = request.keys;
- for (var i = 0; i < keys.length; i++) {
- values[keys[i]] = this.instanceAppData[keys[i]];
- }
- requestedValue = values;
- break;
-
- case 'UPDATE_INSTANCE_APP_DATA' :
- this.instanceAppData[request.key] = request.value;
- break;
-
case 'FETCH_PERSON_APP_DATA' :
var ids = this.getIds(request.idSpec);
@@ -397,50 +351,6 @@
opensocial.SampleContainer.prototype.newFetchPeopleRequest = function(idSpec,
opt_params) {
return {'type' : 'FETCH_PEOPLE', 'idSpec' : idSpec, 'params': opt_params};
-};
-
-
-/**
- * Used to request global app data.
- * When processed, returns a Map<String, String> object.
- *
- * @param {Array.<String> | String} keys The keys you want data for. This
- * can be an array of key names, a single key name, or "*" to mean
- * "all keys".
- * @return {Object} a request object
- */
-opensocial.SampleContainer.prototype.newFetchGlobalAppDataRequest = function(
- keys) {
- return {'type' : 'FETCH_GLOBAL_APP_DATA', 'keys' : keys};
-};
-
-
-/**
- * Used to request instance app data.
- * When processed, returns a Map<String, String> object.
- *
- * @param {Array.<String> | String} keys The keys you want data for. This
- * can be an array of key names, a single key name, or "*" to mean
- * "all keys".
- * @return {Object} a request object
- */
-opensocial.SampleContainer.prototype.newFetchInstanceAppDataRequest = function(
- keys) {
- return {'type' : 'FETCH_INSTANCE_APP_DATA', 'keys' : keys};
-};
-
-
-/**
- * Used to request an update of an app instance field from the server.
- * When processed, does not return any data.
- *
- * @param {String} key The name of the key
- * @param {String} value The value
- * @return {Object} a request object
- */
-opensocial.SampleContainer.prototype.newUpdateInstanceAppDataRequest =
function(
- key, value) {
- return {'type' : 'UPDATE_INSTANCE_APP_DATA', 'key' : key, 'value' : value};
};
Modified:
incubator/shindig/trunk/features/opensocial-samplecontainer/statefileparser.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-samplecontainer/statefileparser.js?rev=616466&r1=616465&r2=616466&view=diff
==============================================================================
---
incubator/shindig/trunk/features/opensocial-samplecontainer/statefileparser.js
(original)
+++
incubator/shindig/trunk/features/opensocial-samplecontainer/statefileparser.js
Tue Jan 29 10:27:50 2008
@@ -121,22 +121,6 @@
});
// Build the App data
- var globalAppData = {};
- var globalDataNode = $(containerNode).find('globalAppData')[0];
- if (globalDataNode) {
- $(globalDataNode).find('data').each(function() {
- globalAppData[$(this).attr('field')] = $(this).text();
- });
- }
-
- var instanceAppData = {};
- var instanceDataNode = $(containerNode).find('instanceAppData')[0];
- if (instanceDataNode) {
- $(instanceDataNode).find('data').each(function() {
- instanceAppData[$(this).attr('field')] = $(this).text();
- });
- }
-
var personAppData = {};
var personDataNode = $(containerNode).find('personAppData')[0];
if (personDataNode) {
@@ -193,8 +177,8 @@
// Initialize the sample container with the state that has been read
container.resetData(viewer, owner,
container.newCollection(viewerFriends),
- container.newCollection(ownerFriends), globalAppData,
- instanceAppData, personAppData, activities, appId);
+ container.newCollection(ownerFriends),
+ personAppData, activities, appId);
callback();
};
@@ -241,26 +225,6 @@
xmlText += ' </ownerFriends>\n';
// Dump App Data
- xmlText += ' <globalAppData>\n';
- for (var field in container.globalAppData) {
- if (___.canInnocentEnum(container.globalAppData, field)) {
- xmlText += ' <data field="' + field + '">';
- xmlText += container.globalAppData[field];
- xmlText += '</data>\n';
- }
- }
- xmlText += ' </globalAppData>\n';
-
- xmlText += ' <instanceAppData>\n';
- for (var field in container.instanceAppData) {
- if (___.canInnocentEnum(container.instanceAppData, field)) {
- xmlText += ' <data field="' + field + '">';
- xmlText += container.instanceAppData[field];
- xmlText += '</data>\n';
- }
- }
- xmlText += ' </instanceAppData>\n';
-
xmlText += ' <personAppData>\n';
for (var person in container.personAppData) {
if (___.canInnocentEnum(container.personAppData, person)) {
Modified: incubator/shindig/trunk/javascript/samplecontainer/state.dtd
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/samplecontainer/state.dtd?rev=616466&r1=616465&r2=616466&view=diff
==============================================================================
--- incubator/shindig/trunk/javascript/samplecontainer/state.dtd (original)
+++ incubator/shindig/trunk/javascript/samplecontainer/state.dtd Tue Jan 29
10:27:50 2008
@@ -1,5 +1,5 @@
<!ELEMENT container (viewer, owner?, viewerFriends?, ownerFriends?, appId?,
- globalAppData?, instanceAppData?, personAppData?, activities?)>
+ personAppData?, activities?)>
<!ELEMENT viewer (person)>
<!ELEMENT owner (person)>
@@ -13,8 +13,6 @@
thumbnailUrl CDATA #IMPLIED
profileUrl CDATA #IMPLIED>
-<!ELEMENT globalAppData (data*)>
-<!ELEMENT instanceAppData (data*)>
<!ELEMENT personAppData (data*)>
<!ELEMENT data (#PCDATA)>