Review Board 1.7.22


Add support for Embedded Experience Gadgets in the CommonContainer test environment

Review Request #3165 - Created Dec. 13, 2011 and submitted

Matt Marum
trunk
SHINDIG-1675
Reviewers
shindig
shindig
As we start to build (and promote the use of) embedded experience gadgets, we need to provide easier ways for Gadget developers to quickly prototype these gadgets. I'd like to add an Embedded Experience Gadgets section to the Common Container test environment (http://localhost:8080/samplecontainer/examples/commoncontainer/) so you can quickly set a Gadget URL and the context to be passed on render.

This has makes quickly testing EE gadgets much easier.

Tested locally with some EE gadgets I've been building.  Andy Smith has used it too.  There are no automated tests for the sample containers.
/trunk/content/samplecontainer/examples/commoncontainer/assembler.js
Revision 1220905 New Change
[20] 34 lines
[+20]
35
// the DefaultSecurityTokenCodec to let UrlParameterAuthenticationHandler create valid security token.
35
// the DefaultSecurityTokenCodec to let UrlParameterAuthenticationHandler create valid security token.
36
shindig.auth.updateSecurityToken('john.doe:john.doe:appid:cont:url:0:default');
36
shindig.auth.updateSecurityToken('john.doe:john.doe:appid:cont:url:0:default');
37

    
   
37

   
38
// Need to pull these from values supplied in the dialog
38
// Need to pull these from values supplied in the dialog
39
CommonContainer.init = function() {
39
CommonContainer.init = function() {

    
   
40

   
40
  //Create my new managed hub
41
  //Create my new managed hub
41
  CommonContainer.managedHub = new OpenAjax.hub.ManagedHub({
42
  CommonContainer.managedHub = new OpenAjax.hub.ManagedHub({
42
    onSubscribe: function(topic, container) {
43
    onSubscribe: function(topic, container) {
43
      log(container.getClientID() + " subscribes to this topic '" + topic + "'");
44
      log(container.getClientID() + " subscribes to this topic '" + topic + "'");
44
      return true;// return false to reject the request.
45
      return true;// return false to reject the request.
[+20] [20] 47 lines
[+20] [+] onDisconnect: function(container) { /* Called when client connects */ }
92
	var gadgetSite = CommonContainer.newGadgetSite(el);
93
	var gadgetSite = CommonContainer.newGadgetSite(el);
93
	CommonContainer.navigateGadget(gadgetSite, gadgetURL, {}, params);
94
	CommonContainer.navigateGadget(gadgetSite, gadgetURL, {}, params);
94
	return gadgetSite;
95
	return gadgetSite;
95

    
   
96

   
96
};
97
};

    
   
98

   
97
//TODO:  To be implemented. Identify where to hook this into the page (in the gadget title bar/gadget management, etc)
99
//TODO:  To be implemented. Identify where to hook this into the page (in the gadget title bar/gadget management, etc)
98
CommonContainer.navigateView = function(gadgetSite, gadgetURL, view) {
100
CommonContainer.navigateView = function(gadgetSite, gadgetURL, view) {
99
	var renderParms = {};
101
	var renderParms = {};
100
	if (view === null || view === '') {
102
	if (view === null || view === '') {
101
		view = 'default';
103
		view = 'default';
[+20] [20] 4 lines
[+20] onDisconnect: function(container) { /* Called when client connects */ }
106

    
   
108

   
107
    CommonContainer.navigateGadget(gadgetSite, gadgetURL, {}, renderParms);
109
    CommonContainer.navigateGadget(gadgetSite, gadgetURL, {}, renderParms);
108
};
110
};
109

    
   
111

   
110
//TODO:  Add in UI controls in portlet header to remove gadget from the canvas
112
//TODO:  Add in UI controls in portlet header to remove gadget from the canvas
111
CommonContainer.colapseGadget = function(gadgetSite) {
113
CommonContainer.collapseGadget = function(gadgetSite) {
112
	CommonContainer.closeGadget(gadgetSite);
114
	CommonContainer.closeGadget(gadgetSite);
113
};
115
};
114

    
   
116

   
115
//display the pubsub 2 event details
117
//display the pubsub 2 event details
116
function log(message) {
118
function log(message) {
[+20] [20] 45 lines
/trunk/content/samplecontainer/examples/commoncontainer/cconviews.js
Revision 1220905 New Change
 
/trunk/content/samplecontainer/examples/commoncontainer/index.html
Revision 1220905 New Change
 
/trunk/content/samplecontainer/examples/commoncontainer/viewController.js
Revision 1220905 New Change
 
  1. /trunk/content/samplecontainer/examples/commoncontainer/assembler.js: Loading...
  2. /trunk/content/samplecontainer/examples/commoncontainer/cconviews.js: Loading...
  3. /trunk/content/samplecontainer/examples/commoncontainer/index.html: Loading...
  4. /trunk/content/samplecontainer/examples/commoncontainer/viewController.js: Loading...