Author: doll
Date: Wed Feb 13 12:23:10 2008
New Revision: 627581
URL: http://svn.apache.org/viewvc?rev=627581&view=rev
Log:
Provide some more useful default implementations for the container spis. Now,
for all of the request* methods the not implemented error code is returned
correctly for you by default.
Containers which override these methods in their subclasses should be
unaffected.
Modified:
incubator/shindig/trunk/features/opensocial-reference/container.js
Modified: incubator/shindig/trunk/features/opensocial-reference/container.js
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/features/opensocial-reference/container.js?rev=627581&r1=627580&r2=627581&view=diff
==============================================================================
--- incubator/shindig/trunk/features/opensocial-reference/container.js
(original)
+++ incubator/shindig/trunk/features/opensocial-reference/container.js Wed Feb
13 12:23:10 2008
@@ -97,7 +97,12 @@
* @private
*/
opensocial.Container.prototype.requestSendMessage = function(recipients,
- message, opt_callback) {};
+ message, opt_callback) {
+ if (opt_callback) {
+ opt_callback(new opensocial.ResponseItem(
+ null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+ }
+};
/**
@@ -125,7 +130,12 @@
* @private
*/
opensocial.Container.prototype.requestShareApp = function(recipients, reason,
- opt_callback) {};
+ opt_callback) {
+ if (opt_callback) {
+ opt_callback(new opensocial.ResponseItem(
+ null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+ }
+};
/**
@@ -143,7 +153,12 @@
* @private
*/
opensocial.Container.prototype.requestCreateActivity = function(activity,
- priority, opt_callback) {};
+ priority, opt_callback) {
+ if (opt_callback) {
+ opt_callback(new opensocial.ResponseItem(
+ null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+ }
+};
/**
@@ -155,7 +170,9 @@
*
* @private
*/
-opensocial.Container.prototype.hasPermission = function(permission) {};
+opensocial.Container.prototype.hasPermission = function(permission) {
+ return false;
+};
/**
@@ -172,7 +189,12 @@
* @private
*/
opensocial.Container.prototype.requestPermission = function(permissions,
reason,
- opt_callback) {};
+ opt_callback) {
+ if (opt_callback) {
+ opt_callback(new opensocial.ResponseItem(
+ null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null));
+ }
+};
/**