You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by zh...@apache.org on 2011/04/01 02:29:38 UTC

svn commit: r1087520 [21/35] - in /incubator/rave/donations/ogce-gadget-container: ./ config/ config/shindig-1.1-BETA5/ config/shindig-2.0.0/ db-cleaner/ examples/ examples/src/ examples/src/main/ examples/src/main/java/ examples/src/main/java/cgl/ exa...

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/src/containers/inline/inline.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/src/containers/inline/inline.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/src/containers/inline/inline.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/src/containers/inline/inline.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,583 @@
+/*
+
+        Copyright 2006-2009 OpenAjax Alliance
+
+        Licensed 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.
+*/
+
+/**
+ * Create a new Inline Container.
+ * @constructor
+ * @extends OpenAjax.hub.Container
+ *
+ * InlineContainer implements the Container interface to provide a container
+ * that places components within the same browser frame as the main mashup
+ * application. As such, this container does not isolate client components into
+ * secure sandboxes.
+ * 
+ * @param {OpenAjax.hub.ManagedHub} hub
+ *    Managed Hub instance to which this Container belongs
+ * @param {String} clientID
+ *    A string ID that identifies a particular client of a Managed Hub. Unique
+ *    within the context of the ManagedHub.
+ * @param {Object} params  
+ *    Parameters used to instantiate the InlineContainer.
+ *    Once the constructor is called, the params object belongs exclusively to
+ *    the InlineContainer. The caller MUST not modify it.
+ *    The following are the pre-defined properties on params:
+ * @param {Function} params.Container.onSecurityAlert
+ *    Called when an attempted security breach is thwarted.  Function is defined
+ *    as follows:  function(container, securityAlert)
+ * @param {Function} [params.Container.onConnect]
+ *    Called when the client connects to the Managed Hub.  Function is defined
+ *    as follows:  function(container)
+ * @param {Function} [params.Container.onDisconnect]
+ *    Called when the client disconnects from the Managed Hub.  Function is
+ *    defined as follows:  function(container)
+ * @param {Object} [params.Container.scope]
+ *    Whenever one of the Container's callback functions is called, references
+ *    to "this" in the callback will refer to the scope object. If no scope is
+ *    provided, default is window.
+ * @param {Function} [params.Container.log]
+ *    Optional logger function. Would be used to log to console.log or
+ *    equivalent. 
+ *
+ * @throws {OpenAjax.hub.Error.BadParameters}   if required params are not
+ *    present or null
+ * @throws {OpenAjax.hub.Error.Duplicate}   if a Container with this clientID
+ *    already exists in the given Managed Hub
+ * @throws {OpenAjax.hub.Error.Disconnected}   if ManagedHub is not connected
+ */
+OpenAjax.hub.InlineContainer = function( hub, clientID, params )
+{
+    if ( ! hub || ! clientID || ! params ||
+            ! params.Container || ! params.Container.onSecurityAlert ) {
+        throw new Error(OpenAjax.hub.Error.BadParameters);
+    }
+    
+    this._params = params;
+    this._hub = hub;
+    this._id = clientID;
+    this._onSecurityAlert = params.Container.onSecurityAlert;
+    this._onConnect = params.Container.onConnect ? params.Container.onConnect : null;
+    this._onDisconnect = params.Container.onDisconnect ? params.Container.onDisconnect : null;
+    this._scope = params.Container.scope || window;
+    
+    if ( params.Container.log ) {
+        var that = this;
+        this._log = function( msg ) {
+            try {
+                params.Container.log.call( that._scope, "InlineContainer::" + clientID + ": " + msg );
+            } catch( e ) {
+                OpenAjax.hub._debugger();
+            }
+        };
+    } else {
+        this._log = function() {};
+    }
+    
+    this._connected = false;
+    this._subs = [];
+    this._subIndex = 0;
+
+    hub.addContainer( this );
+}
+
+    /*** OpenAjax.hub.Container interface implementation ***/
+
+OpenAjax.hub.InlineContainer.prototype.getHub = function() {
+	return this._hub;
+};
+
+OpenAjax.hub.InlineContainer.prototype.sendToClient = function( topic, data, subscriptionID )
+{
+    if ( this.isConnected() ) {
+        var sub = this._subs[ subscriptionID ];
+        try {
+            sub.cb.call( sub.sc, topic, data, sub.d );
+        } catch( e ) {
+            OpenAjax.hub._debugger();
+            this._client._log( "caught error from onData callback to HubClient.subscribe(): " + e.message );
+        }
+    }
+}
+
+OpenAjax.hub.InlineContainer.prototype.remove = function()
+{
+    if ( this.isConnected() ) {
+        this._disconnect();
+    }
+}
+
+OpenAjax.hub.InlineContainer.prototype.isConnected = function()
+{
+    return this._connected;
+}
+
+OpenAjax.hub.InlineContainer.prototype.getClientID = function()
+{
+    return this._id;
+}
+
+OpenAjax.hub.InlineContainer.prototype.getPartnerOrigin = function()
+{
+    if ( this._connected ) {
+        return window.location.protocol + "//" + window.location.hostname;
+    }
+    return null;
+}
+
+OpenAjax.hub.InlineContainer.prototype.getParameters = function()
+{
+    return this._params;
+}
+
+    /*** OpenAjax.hub.HubClient interface implementation ***/
+
+OpenAjax.hub.InlineContainer.prototype.connect = function( client, onComplete, scope )
+{
+    if ( this._connected ) {
+        throw new Error( OpenAjax.hub.Error.Duplicate );
+    }
+    
+    this._connected = true;
+    this._client = client;
+    
+    if ( this._onConnect ) {
+        try {
+            this._onConnect.call( this._scope, this );
+        } catch( e ) {
+            OpenAjax.hub._debugger();
+            this._log( "caught error from onConnect callback to constructor: " + e.message );
+        }
+    }
+    
+    this._invokeOnComplete( onComplete, scope, client, true );
+}
+
+OpenAjax.hub.InlineContainer.prototype.disconnect = function( client, onComplete, scope )
+{
+    if ( !this._connected ) {
+        throw new Error( OpenAjax.hub.Error.Disconnected );
+    }
+    
+    this._disconnect();
+
+    if ( this._onDisconnect ) {
+        try {
+            this._onDisconnect.call( this._scope, this );
+        } catch( e ) {
+            OpenAjax.hub._debugger();
+            this._log( "caught error from onDisconnect callback to constructor: " + e.message );
+        }
+    }
+    
+    this._invokeOnComplete( onComplete, scope, client, true );
+}
+
+    /*** OpenAjax.hub.Hub interface implementation ***/
+
+OpenAjax.hub.InlineContainer.prototype.subscribe = function( topic, onData, scope, onComplete, subscriberData )
+{
+    this._assertConn();
+    this._assertSubTopic( topic );
+    if ( ! onData ) {
+        throw new Error( OpenAjax.hub.Error.BadParameters );
+    }
+    
+    var subID = "" + this._subIndex++;
+    var success = false;
+    var msg = null;
+    try {
+        var handle = this._hub.subscribeForClient( this, topic, subID );
+        success = true;
+    } catch( e ) {
+        // failure
+        subID = null;
+        msg = e.message;
+    }
+    
+    scope = scope || window;
+    if ( success ) {
+        this._subs[ subID ] = { h: handle, cb: onData, sc: scope, d: subscriberData };
+    }
+    
+    this._invokeOnComplete( onComplete, scope, subID, success, msg );
+    return subID;
+}
+
+OpenAjax.hub.InlineContainer.prototype.publish = function( topic, data )
+{
+    this._assertConn();
+    this._assertPubTopic( topic );
+    this._hub.publishForClient( this, topic, data );
+}
+
+OpenAjax.hub.InlineContainer.prototype.unsubscribe = function( subscriptionID, onComplete, scope )
+{
+    this._assertConn();
+    if ( typeof subscriptionID === "undefined" || subscriptionID == null ) {
+        throw new Error( OpenAjax.hub.Error.BadParameters );
+    }
+    var sub = this._subs[ subscriptionID ];
+    if ( ! sub ) 
+        throw new Error( OpenAjax.hub.Error.NoSubscription );    
+    this._hub.unsubscribeForClient( this, sub.h );
+    delete this._subs[ subscriptionID ];
+    
+    this._invokeOnComplete( onComplete, scope, subscriptionID, true );
+}
+
+OpenAjax.hub.InlineContainer.prototype.getSubscriberData = function( subID )
+{
+    this._assertConn();
+    return this._getSubscription( subID ).d;
+}
+
+OpenAjax.hub.InlineContainer.prototype.getSubscriberScope = function( subID )
+{
+    this._assertConn();
+    return this._getSubscription( subID ).sc;
+}
+
+    /*** PRIVATE FUNCTIONS ***/
+
+OpenAjax.hub.InlineContainer.prototype._invokeOnComplete = function( func, scope, item, success, errorCode )
+{
+    if ( func ) { // onComplete is optional
+        try {
+            scope = scope || window;
+            func.call( scope, item, success, errorCode );
+        } catch( e ) {
+            OpenAjax.hub._debugger();
+            // _invokeOnComplete is only called for client interfaces (Hub and HubClient)
+            this._client._log( "caught error from onComplete callback: " + e.message );
+        }
+    }
+}
+
+OpenAjax.hub.InlineContainer.prototype._disconnect = function()
+{
+    for ( var subID in this._subs ) {
+        this._hub.unsubscribeForClient( this, this._subs[subID].h );
+    }
+    this._subs = [];
+    this._subIndex = 0;
+    this._connected = false;
+}
+
+OpenAjax.hub.InlineContainer.prototype._assertConn = function()
+{
+    if ( ! this._connected ) {
+        throw new Error( OpenAjax.hub.Error.Disconnected );
+    }
+}
+
+OpenAjax.hub.InlineContainer.prototype._assertPubTopic = function(topic) 
+{
+    if ((topic == null) || (topic == "") || (topic.indexOf("*") != -1) ||
+        (topic.indexOf("..") != -1) ||  (topic.charAt(0) == ".") ||
+        (topic.charAt(topic.length-1) == "."))
+    {
+        throw new Error(OpenAjax.hub.Error.BadParameters);
+    }
+}
+
+OpenAjax.hub.InlineContainer.prototype._assertSubTopic = function(topic) 
+{
+    if ( ! topic ) {
+        throw new Error(OpenAjax.hub.Error.BadParameters);
+    }
+    var path = topic.split(".");
+    var len = path.length;
+    for (var i = 0; i < len; i++) {
+        var p = path[i];
+        if ((p == "") ||
+           ((p.indexOf("*") != -1) && (p != "*") && (p != "**"))) {
+            throw new Error(OpenAjax.hub.Error.BadParameters);
+        }
+        if ((p == "**") && (i < len - 1)) {
+            throw new Error(OpenAjax.hub.Error.BadParameters);
+        }
+    }
+}
+
+OpenAjax.hub.InlineContainer.prototype._getSubscription = function( subID )
+{
+    var sub = this._subs[ subID ];
+    if ( sub ) {
+        return sub;
+    }
+    throw new Error( OpenAjax.hub.Error.NoSubscription );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Create a new InlineHubClient.
+ * @constructor
+ * @extends OpenAjax.hub.HubClient
+ * 
+ * @param {Object} params 
+ *    Parameters used to instantiate the HubClient.
+ *    Once the constructor is called, the params object belongs to the
+ *    HubClient. The caller MUST not modify it.
+ *    The following are the pre-defined properties on params:
+ * @param {Function} params.HubClient.onSecurityAlert
+ *     Called when an attempted security breach is thwarted
+ * @param {Object} [params.HubClient.scope]
+ *     Whenever one of the HubClient's callback functions is called,
+ *     references to "this" in the callback will refer to the scope object.
+ *     If not provided, the default is window.
+ * @param {Function} [params.HubClient.log]
+ *     Optional logger function. Would be used to log to console.log or
+ *     equivalent. 
+ * @param {OpenAjax.hub.InlineContainer} params.InlineHubClient.container
+ *     Specifies the InlineContainer to which this HubClient will connect
+ *  
+ * @throws {OpenAjax.hub.Error.BadParameters} if any of the required
+ *     parameters are missing
+ */
+OpenAjax.hub.InlineHubClient = function( params )
+{
+    if ( ! params || ! params.HubClient || ! params.HubClient.onSecurityAlert ||
+            ! params.InlineHubClient || ! params.InlineHubClient.container ) {
+        throw new Error(OpenAjax.hub.Error.BadParameters);
+    }
+    
+    this._params = params;
+    this._onSecurityAlert = params.HubClient.onSecurityAlert;
+    this._scope = params.HubClient.scope || window;
+    this._container = params.InlineHubClient.container;
+    
+    if ( params.HubClient.log ) {
+        var that = this;
+        this._log = function( msg ) {
+            try {
+                params.HubClient.log.call( that._scope, "InlineHubClient::" + that._container.getClientID() + ": " + msg );
+            } catch( e ) {
+                OpenAjax.hub._debugger();
+            }
+        };
+    } else {
+        this._log = function() {};
+    }
+}
+
+ /*** OpenAjax.hub.HubClient interface implementation ***/
+
+/**
+ * Requests a connection to the ManagedHub, via the InlineContainer
+ * associated with this InlineHubClient.
+ * 
+ * If the Container accepts the connection request, this HubClient's 
+ * state is set to CONNECTED and the HubClient invokes the 
+ * onComplete callback function.
+ * 
+ * If the Container refuses the connection request, the HubClient
+ * invokes the onComplete callback function with an error code. 
+ * The error code might, for example, indicate that the Container 
+ * is being destroyed.
+ * 
+ * If the HubClient is already connected, calling connect will cause
+ * the HubClient to immediately invoke the onComplete callback with
+ * the error code OpenAjax.hub.Error.Duplicate.
+ * 
+ * @param {Function} [onComplete]
+ *     Callback function to call when this operation completes.
+ * @param {Object} [scope]  
+ *     When the onComplete function is invoked, the JavaScript "this"
+ *     keyword refers to this scope object.
+ *     If no scope is provided, default is window.
+ *    
+ * In this implementation of InlineHubClient, this function operates 
+ * SYNCHRONOUSLY, so the onComplete callback function is invoked before 
+ * this connect function returns. Developers are cautioned that in  
+ * IframeHubClient implementations, this is not the case.
+ * 
+ * A client application may call InlineHubClient.disconnect and then call
+ * InlineHubClient.connect to reconnect to the Managed Hub.
+ */
+OpenAjax.hub.InlineHubClient.prototype.connect = function( onComplete, scope )
+{
+    this._container.connect( this, onComplete, scope );
+}
+
+/**
+ * Disconnect from the ManagedHub
+ * 
+ * Disconnect immediately:
+ * 
+ * 1. Sets the HubClient's state to DISCONNECTED.
+ * 2. Causes the HubClient to send a Disconnect request to the 
+ * 		associated Container. 
+ * 3. Ensures that the client application will receive no more
+ * 		onData or onComplete callbacks associated with this 
+ * 		connection, except for the disconnect function's own
+ * 		onComplete callback.
+ * 4. Automatically destroys all of the HubClient's subscriptions.
+ * 	
+ * @param {Function} [onComplete]
+ *     Callback function to call when this operation completes.
+ * @param {Object} [scope]  
+ *     When the onComplete function is invoked, the JavaScript "this"
+ *     keyword refers to the scope object.
+ *     If no scope is provided, default is window.
+ *    
+ * In this implementation of InlineHubClient, the disconnect function operates 
+ * SYNCHRONOUSLY, so the onComplete callback function is invoked before 
+ * this function returns. Developers are cautioned that in IframeHubClient 
+ * implementations, this is not the case.   
+ * 
+ * A client application is allowed to call HubClient.disconnect and 
+ * then call HubClient.connect in order to reconnect.
+ */
+OpenAjax.hub.InlineHubClient.prototype.disconnect = function( onComplete, scope )
+{
+    this._container.disconnect( this, onComplete, scope );
+}
+
+OpenAjax.hub.InlineHubClient.prototype.getPartnerOrigin = function()
+{
+    return this._container.getPartnerOrigin();
+}
+
+OpenAjax.hub.InlineHubClient.prototype.getClientID = function()
+{
+    return this._container.getClientID();
+}
+
+ /*** OpenAjax.hub.Hub interface implementation ***/
+
+/**
+ * Subscribe to a topic.
+ *
+ * @param {String} topic
+ *     A valid topic string. MAY include wildcards.
+ * @param {Function} onData   
+ *     Callback function that is invoked whenever an event is 
+ *     published on the topic
+ * @param {Object} [scope]
+ *     When onData callback or onComplete callback is invoked,
+ *     the JavaScript "this" keyword refers to this scope object.
+ *     If no scope is provided, default is window.
+ * @param {Function} [onComplete]
+ *     Invoked to tell the client application whether the 
+ *     subscribe operation succeeded or failed. 
+ * @param {*} [subscriberData]
+ *     Client application provides this data, which is handed
+ *     back to the client application in the subscriberData
+ *     parameter of the onData and onComplete callback functions.
+ * 
+ * @returns subscriptionID
+ *     Identifier representing the subscription. This identifier is an 
+ *     arbitrary ID string that is unique within this Hub instance
+ * @type {String}
+ * 
+ * @throws {OpenAjax.hub.Error.Disconnected} if this Hub instance is not in CONNECTED state
+ * @throws {OpenAjax.hub.Error.BadParameters} if the topic is invalid (e.g. contains an empty token)
+ *
+ * In this implementation of InlineHubClient, the subscribe function operates 
+ * Thus, onComplete is invoked before this function returns. Developers are 
+ * cautioned that in most implementations of HubClient, onComplete is invoked 
+ * after this function returns.
+ * 
+ * If unsubscribe is called before subscribe completes, the subscription is 
+ * immediately terminated, and onComplete is never invoked.
+ */
+OpenAjax.hub.InlineHubClient.prototype.subscribe = function( topic, onData, scope, onComplete, subscriberData )
+{
+    return this._container.subscribe( topic, onData, scope, onComplete, subscriberData );
+}
+
+/**
+ * Publish an event on 'topic' with the given data.
+ *
+ * @param {String} topic
+ *     A valid topic string. MUST NOT include wildcards.
+ * @param {*} data
+ *     Valid publishable data. To be portable across different
+ *     Container implementations, this value SHOULD be serializable
+ *     as JSON.
+ *     
+ * @throws {OpenAjax.hub.Error.Disconnected} if this Hub instance 
+ *     is not in CONNECTED state
+ * 
+ * In this implementation, publish operates SYNCHRONOUSLY. 
+ * Data will be delivered to subscribers after this function returns.
+ * In most implementations, publish operates synchronously, 
+ * delivering its data to the clients before this function returns.
+ */
+OpenAjax.hub.InlineHubClient.prototype.publish = function( topic, data )
+{
+    this._container.publish( topic, data );
+}
+
+/**
+ * Unsubscribe from a subscription
+ *
+ * @param {String} subscriptionID
+ *     A subscriptionID returned by InlineHubClient.prototype.subscribe()
+ * @param {Function} [onComplete]
+ *     Callback function invoked when unsubscribe completes
+ * @param {Object} [scope]
+ *     When onComplete callback function is invoked, the JavaScript "this"
+ *     keyword refers to this scope object.
+ *     
+ * @throws {OpenAjax.hub.Error.NoSubscription} if no such subscription is found
+ * 
+ * To facilitate cleanup, it is possible to call unsubscribe even 
+ * when the HubClient is in a DISCONNECTED state.
+ * 
+ * In this implementation of HubClient, this function operates SYNCHRONOUSLY. 
+ * Thus, onComplete is invoked before this function returns. Developers are 
+ * cautioned that in most implementations of HubClient, onComplete is invoked 
+ * after this function returns.
+ */
+OpenAjax.hub.InlineHubClient.prototype.unsubscribe = function( subscriptionID, onComplete, scope )
+{
+    this._container.unsubscribe( subscriptionID, onComplete, scope );
+}
+
+OpenAjax.hub.InlineHubClient.prototype.isConnected = function()
+{
+    return this._container.isConnected();
+}
+
+OpenAjax.hub.InlineHubClient.prototype.getScope = function()
+{
+    return this._scope;
+}
+
+OpenAjax.hub.InlineHubClient.prototype.getSubscriberData = function( subID )
+{
+    return this._container.getSubscriberData( subID );
+}
+
+OpenAjax.hub.InlineHubClient.prototype.getSubscriberScope = function( subID )
+{
+    return this._container.getSubscriberScope( subID );
+}
+
+/**
+ * Returns the params object associated with this Hub instance.
+ * Allows mix-in code to access parameters passed into constructor that created
+ * this Hub instance.
+ *
+ * @returns params  the params object associated with this Hub instance
+ * @type {Object}
+ */
+OpenAjax.hub.InlineHubClient.prototype.getParameters = function()
+{
+    return this._params;
+}

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/tunnel.html
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/tunnel.html?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/tunnel.html (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/tunnel.html Fri Apr  1 00:29:22 2011
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+
+        Copyright 2006-2009 OpenAjax Alliance
+
+        Licensed 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>
+	<head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>Hub Tunnel</title>
+        <script type="text/javascript"
+          src="https://ogce.svn.sourceforge.net/svnroot/ogce/ShindigOGCE/ishindig-trunk/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/src/OpenAjax.js"></script>
+        <script type="text/javascript"
+          src="https://ogce.svn.sourceforge.net/svnroot/ogce/ShindigOGCE/ishindig-trunk/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/src/containers/iframe/json2.js"></script>
+        <script type="text/javascript"
+          src="https://ogce.svn.sourceforge.net/svnroot/ogce/ShindigOGCE/ishindig-trunk/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/src/containers/iframe/crypto.js"></script>
+        <script type="text/javascript"
+          src="https://ogce.svn.sourceforge.net/svnroot/ogce/ShindigOGCE/ishindig-trunk/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/src/containers/iframe/iframe.js"></script>
+        <script type="text/javascript"
+          src="https://ogce.svn.sourceforge.net/svnroot/ogce/ShindigOGCE/ishindig-trunk/ishindig-webapp/src/main/webapp/www/js/OpenAjax_Hub/src/containers/iframe/FIM.js"></script>  
+        <script type="text/javascript"
+          src=https://ogce.svn.sourceforge.net/svnroot/ogce/ShindigOGCE/ishindig-trunk/ishindig-webapp/src/main/webapp/"www/js/OpenAjax_Hub/src/containers/iframe/NIX.js"></script>  
+        <script type="text/javascript">
+            function init() {
+                OpenAjax.hub.IframeContainer._tunnelLoaded();
+            }
+        </script>
+    </head>
+    <body onload="init();"></body>
+</html>

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/TextHrefField.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/TextHrefField.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/TextHrefField.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/TextHrefField.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,140 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+/*!
+ * Ext JS Library 3.0+
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+Ext.ns('Ext.ux.form');
+
+/**
+ * @class Ext.ux.form.TextHrefField
+ * @extends Ext.form.TextField
+ * Creates a file upload field.
+ * @xtype fileuploadfield
+ */
+Ext.ux.form.TextHrefField = Ext.extend(Ext.form.TextField,  {
+    hrefText: 'Open the file',
+    hrefImgURL: 'http://www.tripwiremagazine.com/wp-content/themes/freshnews/images/link-page.png',
+    hrefHoverText: 'click to open the file',
+
+    hrefOnly: false,
+    hrefHTImg: true,
+    hrefHTText: false,
+
+    hrefOffset: 3,
+
+    autoSize: Ext.emptyFn,
+
+    // private
+    initComponent: function(){
+        Ext.ux.form.TextHrefField.superclass.initComponent.call(this);
+    },
+
+    // private
+    onRender : function(ct, position){
+        Ext.ux.form.TextHrefField.superclass.onRender.call(this, ct, position);
+
+        this.wrap = this.el.wrap();
+
+        if (this.hrefHTImg == true) {
+            this.hrefEl = this.wrap.createChild({
+                tag: 'a',
+                href: this.value,
+                target: "_blank",
+                children: [{
+                    tag: 'img',
+                    style: "vertical-align:middle;padding-left:"+this.hrefOffset+"px;",
+                    src: this.hrefImgURL,
+                    title: this.hrefHoverText
+                }]
+                // cls: 'x-form-file',
+            });
+        } else {
+            this.hrefEl = this.wrap.createChild({
+                tag: 'a',
+                target: "_blank",
+                href: this.getValue(),
+                html: this.getValue(),
+                style: "padding-left:"+this.hrefOffset+"px;",
+                // cls: 'x-form-file',
+            });
+        }
+
+        if (this.hrefOnly == true) {
+            this.el.hide();
+            this.wrap.setWidth(this.hrefEl.getWidth());
+        } else {
+            if (w <= 1) // percentage
+                var w = this.wrap.getBox().width - this.hrefEl.getWidth() - this.hrefOffset;
+            else
+                var w = this.wrap.getWidth() - this.hrefEl.getWidth() - this.hrefOffset;
+            this.el.setWidth(w);
+        }
+    },
+
+    // private
+    onResize : function(w, h){
+        Ext.ux.form.TextHrefField.superclass.onResize.call(this, w, h);
+        this.wrap.setWidth(w);
+
+        if(!this.hrefOnly){
+            if (w <= 1) // percentage
+                var w = this.wrap.getBox().width - this.hrefEl.getWidth() - this.hrefOffset;
+            else
+                var w = this.wrap.getWidth() - this.hrefEl.getWidth() - this.hrefOffset;
+            this.el.setWidth(w);
+        }
+    },
+
+    // private
+    onDestroy: function(){
+        Ext.ux.form.TextHrefField.superclass.onDestroy.call(this);
+        Ext.destroy(this.hrefEl, this.wrap);
+    },
+
+    // private
+    preFocus : Ext.emptyFn,
+
+    // private
+    getResizeEl : function(){
+        return this.wrap;
+    },
+
+    // private
+    getPositionEl : function(){
+        return this.wrap;
+    },
+
+    // private
+    alignErrorIcon : function(){
+        this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
+    }
+
+});
+
+Ext.reg('texthreffield', Ext.ux.form.TextHrefField);
+
+// backwards compat
+Ext.form.TextHrefField = Ext.ux.form.TextHrefField;
+

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/countrypicker.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/countrypicker.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/countrypicker.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/countrypicker.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,144 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+var country = '\
+AF:Afghanistan|AL:Albania|DZ:Algeria|AS:American Samoa|AD:Andorra|\
+AO:Angola|AI:Anguilla|AQ:Antarctica|AG:Antigua and Barbuda|\
+AR:Argentina|AM:Armenia|AW:Aruba|AU:Australia|AT:Austria|\
+AZ:Azerbaijan|AP:Azores|BS:Bahamas|BH:Bahrain|BD:Bangladesh|\
+BB:Barbados|BY:Belarus|BE:Belgium|BZ:Belize|BJ:Benin|\
+BM:Bermuda|BT:Bhutan|BO:Bolivia|BA:Bosnia And Herzegowina|\
+XB:Bosnia-Herzegovina|BW:Botswana|BV:Bouvet Island|BR:Brazil|\
+IO:British Indian Ocean Territory|VG:British Virgin Islands|\
+BN:Brunei Darussalam|BG:Bulgaria|BF:Burkina Faso|BI:Burundi|\
+KH:Cambodia|CM:Cameroon|CA:Canada|CV:Cape Verde|KY:Cayman Islands|\
+CF:Central African Republic|TD:Chad|CL:Chile|CN:China|CX:Christmas Island|\
+CC:Cocos (Keeling) Islands|CO:Colombia|KM:Comoros|CG:Congo|\
+CD:Congo, The Democratic Republic O|CK:Cook Islands|XE:Corsica|\
+CR:Costa Rica|CI:Cote d` Ivoire (Ivory Coast)|HR:Croatia|CU:Cuba|\
+CY:Cyprus|CZ:Czech Republic|DK:Denmark|DJ:Djibouti|DM:Dominica|\
+DO:Dominican Republic|TP:East Timor|EC:Ecuador|EG:Egypt|\
+SV:El Salvador|GQ:Equatorial Guinea|ER:Eritrea|EE:Estonia|\
+ET:Ethiopia|FK:Falkland Islands (Malvinas)|FO:Faroe Islands|\
+FJ:Fiji|FI:Finland|FR:France (Includes Monaco)|FX:France, Metropolitan|\
+GF:French Guiana|PF:French Polynesia|TA:French Polynesia (Tahiti)|\
+TF:French Southern Territories|GA:Gabon|GM:Gambia|GE:Georgia|DE:Germany|\
+GH:Ghana|GI:Gibraltar|GR:Greece|GL:Greenland|GD:Grenada|\
+GP:Guadeloupe|GU:Guam|GT:Guatemala|GN:Guinea|GW:Guinea-Bissau|\
+GY:Guyana|HT:Haiti|HM:Heard And Mc Donald Islands|\
+VA:Holy See (Vatican City State)|HN:Honduras|HK:Hong Kong|\
+HU:Hungary|IS:Iceland|IN:India|ID:Indonesia|IR:Iran|\
+IQ:Iraq|IE:Ireland|EI:Ireland (Eire)|IL:Israel|IT:Italy|\
+JM:Jamaica|JP:Japan|JO:Jordan|KZ:Kazakhstan|KE:Kenya|\
+KI:Kiribati|KP:Korea, Democratic People\'S Repub|KW:Kuwait|\
+KG:Kyrgyzstan|LA:Laos|LV:Latvia|LB:Lebanon|LS:Lesotho|\
+LR:Liberia|LY:Libya|LI:Liechtenstein|LT:Lithuania|LU:Luxembourg|\
+MO:Macao|MK:Macedonia|MG:Madagascar|ME:Madeira Islands|MW:Malawi|\
+MY:Malaysia|MV:Maldives|ML:Mali|MT:Malta|MH:Marshall Islands|\
+MQ:Martinique|MR:Mauritania|MU:Mauritius|YT:Mayotte|MX:Mexico|\
+FM:Micronesia, Federated States Of|MD:Moldova, Republic Of|MC:Monaco|\
+MN:Mongolia|MS:Montserrat|MA:Morocco|MZ:Mozambique|MM:Myanmar (Burma)|\
+NA:Namibia|NR:Nauru|NP:Nepal|NL:Netherlands|AN:Netherlands Antilles|\
+NC:New Caledonia|NZ:New Zealand|NI:Nicaragua|NE:Niger|NG:Nigeria|\
+NU:Niue|NF:Norfolk Island|MP:Northern Mariana Islands|NO:Norway|\
+OM:Oman|PK:Pakistan|PW:Palau|PS:Palestinian Territory, Occupied|\
+PA:Panama|PG:Papua New Guinea|PY:Paraguay|PE:Peru|PH:Philippines|\
+PN:Pitcairn|PL:Poland|PT:Portugal|PR:Puerto Rico|QA:Qatar|\
+RE:Reunion|RO:Romania|RU:Russian Federation|RW:Rwanda|\
+KN:Saint Kitts And Nevis|SM:San Marino|ST:Sao Tome and Principe|\
+SA:Saudi Arabia|SN:Senegal|XS:Serbia-Montenegro|SC:Seychelles|\
+SL:Sierra Leone|SG:Singapore|SK:Slovak Republic|SI:Slovenia|\
+SB:Solomon Islands|SO:Somalia|ZA:South Africa|\
+GS:South Georgia And The South Sand|KR:South Korea|ES:Spain|LK:Sri Lanka|\
+NV:St. Christopher and Nevis|SH:St. Helena|LC:St. Lucia|\
+PM:St. Pierre and Miquelon|VC:St. Vincent and the Grenadines|SD:Sudan|\
+SR:Suriname|SJ:Svalbard And Jan Mayen Islands|SZ:Swaziland|SE:Sweden|\
+CH:Switzerland|SY:Syrian Arab Republic|TW:Taiwan|TJ:Tajikistan|\
+TZ:Tanzania|TH:Thailand|TG:Togo|TK:Tokelau|TO:Tonga|\
+TT:Trinidad and Tobago|XU:Tristan da Cunha|TN:Tunisia|TR:Turkey|\
+TM:Turkmenistan|TC:Turks and Caicos Islands|TV:Tuvalu|UG:Uganda|\
+UA:Ukraine|AE:United Arab Emirates|UK:United Kingdom|GB:Great Britain|\
+US:United States|UM:United States Minor Outlying Isl|UY:Uruguay|\
+UZ:Uzbekistan|VU:Vanuatu|XV:Vatican City|VE:Venezuela|VN:Vietnam|\
+VI:Virgin Islands (U.S.)|WF:Wallis and Furuna Islands|EH:Western Sahara|\
+WS:Western Samoa|YE:Yemen|YU:Yugoslavia|ZR:Zaire|ZM:Zambia|ZW:Zimbabwe|\
+'; 
+
+function cvtCountryString2Arr(countryStr){
+  var arr = [];
+  var countryLineArray = countryStr.split('|');  // Split into lines
+  for (var loop = 0; loop < countryLineArray.length; loop++) {
+    lineArray = countryLineArray[loop].split(':');
+    countryCode  = TrimString(lineArray[0]);
+    countryName  = TrimString(lineArray[1]);
+    arr = arr.push([countryCode, countryName]);
+  }
+  return arr;
+}
+
+function createCountryCombo(countryCode){
+    var arr = cvtCountryString2Arr(country);
+    var countrylist = new Ext.data.SimpleStore({
+        data: arr,
+        fields: ['code', 'name'] 
+    });
+    var combo = new Ext.form.ComboBox({
+        typeAhead: true,
+        forceSelection: true,
+        editable: false,
+        mode: 'local',
+        triggerAction: 'all',
+        emptyText:'Select a country...',
+        selectOnFocus:true,
+        id: 'country_list',
+        store: countrylist,
+        displayField: 'name', 
+        valueField: 'code' 
+    });
+    combo.setValue(countryCode);
+    return combo;
+}
+
+// Populates the country selected with the counties from the country list
+/*
+function populateCountry(defaultCountry) {
+  var countryLineArray = country.split('|');  // Split into lines
+  var selObj = document.getElementById('country');
+  selObj.options[0] = new Option('Select Country','');
+  selObj.selectedIndex = 0;
+  for (var loop = 0; loop < countryLineArray.length; loop++) {
+    lineArray = countryLineArray[loop].split(':');
+    countryCode  = TrimString(lineArray[0]);
+    countryName  = TrimString(lineArray[1]);
+    if ( countryCode != '' ) {
+      selObj.options[loop + 1] = new Option(countryName, countryCode);
+    }
+    if ( defaultCountry == countryCode ) {
+      selObj.selectedIndex = loop + 1;
+    }
+  }
+}
+
+function initCountry(country) {
+  populateCountry(country);
+}
+*/
+

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/customField.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/customField.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/customField.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/customField.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,67 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+/**
+ * @class Ext.ux.CustomContentField
+ * @extends Ext.form.Field
+ * Basic custom content field
+ * @constructor
+ * Creates a new custom content field
+ * @param {Object} config Configuration options
+ * @author Bart Wegrzyn <ba...@gmail.com>
+ */
+Ext.ux.CustomContentField = Ext.extend(Ext.form.Field, {
+    panel : null,
+    // private
+    defaultAutoCreate: {
+        tag: 'div',
+        cls: 'x-customcontent-field'
+    },
+
+    // private
+    initComponent: function() {
+        Ext.ux.CustomContentField.superclass.initComponent.call(this);
+    },
+
+    // private
+    initValue: Ext.emptyFn,
+
+    // private
+    onRender: function(ct, position){
+        Ext.ux.CustomContentField.superclass.onRender.call(this, ct, position);
+        if( this.panel ){
+            this.panel.render(this.el);
+        }
+    },
+    reset: function(){
+        if( this.panel && this.panel.reset )
+            this.panel.reset();
+    },
+
+    /**
+     * Returns the field element (ie. 'this')
+     */
+    getValue: function() {
+        return null;
+        //return this.contentCt;
+    }
+});
+Ext.reg('customcontent', Ext.ux.CustomContentField);

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/datepicker.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/datepicker.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/datepicker.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/datepicker.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,241 @@
+/*
+ *
+ * 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 file contains dropboxes by which users can
+ *  select a date.
+ *  It consists of three dropboxes:
+ *      day picker
+ *      month picker
+ *      year picker
+ ***************************************************/
+
+//function for returning how many days there are in a month including leap years
+function daysInMonth(WhichMonth, WhichYear)
+{
+  WhichYear = parseInt(WhichYear);
+  var DaysInMonth = 31;
+  if (WhichMonth == "Apr" || WhichMonth == "Jun" || WhichMonth == "Sep" || WhichMonth == "Nov") DaysInMonth = 30;
+  if (WhichMonth == "Feb" && (WhichYear/4) != Math.floor(WhichYear/4))  DaysInMonth = 28;
+  if (WhichMonth == "Feb" && (WhichYear/4) == Math.floor(WhichYear/4))  DaysInMonth = 29;
+  WhichMonth = parseInt(WhichMonth);
+  if( !isNaN(WhichMonth) ){
+      if (WhichMonth == 4 || WhichMonth == 6 || WhichMonth == 9 || WhichMonth == 11) DaysInMonth = 30;
+      if (WhichMonth == 2 && (WhichYear/4) != Math.floor(WhichYear/4))  DaysInMonth = 28;
+      if (WhichMonth == 2 && (WhichYear/4) == Math.floor(WhichYear/4))  DaysInMonth = 29;
+  }
+  return DaysInMonth;
+}
+
+function createDOBCombos(fieldLabel){
+    Now = new Date();
+    NowDay = Now.getDate();
+    NowMonth = Now.getMonth();
+    NowYear = Now.getYear();
+    if (NowYear < 2000) NowYear += 1900; //for Netscape
+
+    var yearbefore = 100;
+    var yeararr = [];
+    for(var i = 0 ; i < 100 ; ++i)
+        yeararr.push([''+(NowYear-i), ''+(NowYear-i)]);
+
+    var days31 = [];
+    for(var i = 1 ; i <= 31 ; ++i)
+        days31.push([i, i]);
+    var days30 = [];
+    for(var i = 1 ; i <= 30 ; ++i)
+        days30.push([i, i]);
+    var days29 = [];
+    for(var i = 1 ; i <= 29 ; ++i)
+        days29.push([i, i]);
+    var days28 = [];
+    for(var i = 1 ; i <= 28 ; ++i)
+        days28.push([i, i]);
+    
+    var montharr = [];
+    montharr.push([0, 'Jan']);
+    montharr.push([1, 'Feb']);
+    montharr.push([2, 'Mar']);
+    montharr.push([3, 'Apr']);
+    montharr.push([4, 'May']);
+    montharr.push([5, 'Jun']);
+    montharr.push([6, 'Jul']);
+    montharr.push([7, 'Aug']);
+    montharr.push([8, 'Sep']);
+    montharr.push([9, 'Oct']);
+    montharr.push([10, 'Nov']);
+    montharr.push([11, 'Dec']);
+
+    var monthstore = new Ext.data.SimpleStore({
+        data: montharr,
+        fields: ['code', 'name']
+    }); 
+    var onDOBChange = function( field, newvalue, oldvalue ){
+        var year = dobyearcombo.getValue();
+        var month = dobmonthcombo.getValue();
+        var ndays = daysInMonth(month+1, year);
+        switch (ndays){
+            case 28:
+                daystore.loadData(days28);
+                break;
+            case 29:
+                daystore.loadData(days29);
+                break;
+            case 30:
+                daystore.loadData(days30);
+                break;
+            case 31:
+                daystore.loadData(days31);
+                break;
+        }
+    };
+    var dobyearcombo = new Ext.form.ComboBox({
+        fieldLabel: 'year',
+        hideLabel: true,
+        name: 'dobyear',
+        id: 'userinfo_dob_year',
+        hiddenId: 'userinfo_dob_year_hide',
+        hiddenName: 'dobyear',
+        style:"width:50px;",
+        listWidth: 50,
+
+        typeAhead: true,
+        forceSelection: true,
+        editable: false,
+        mode: 'local',
+        triggerAction: 'all',
+        emptyText:'year',
+        selectOnFocus:true,
+        store: yeararr,
+        listeners:{
+            change: onDOBChange
+        },
+        columnWidth: 0.2
+    });
+    //dobyearcombo.setValue(NowYear);
+
+    var dobmonthcombo = new Ext.form.ComboBox({
+        fieldLabel: 'month',
+        hideLabel: true,
+        name: 'dobmonth',
+        hiddenId: 'userinfo_dob_month_hide',
+        hiddenName: 'dobmonth',
+        id: 'userinfo_dob_month',
+        style:"width:50px;",
+        listWidth: 50,
+
+        typeAhead: true,
+        forceSelection: true,
+        editable: false,
+        mode: 'local',
+        triggerAction: 'all',
+        emptyText:'month',
+        selectOnFocus:true,
+        //store: montharr,
+        store: montharr,
+        listeners:{
+            change: onDOBChange
+        },
+        columnWidth: 0.2
+    });
+    //dobmonthcombo.setValue(NowMonth);
+
+    var daystore = new Ext.data.SimpleStore({
+        data: days31,
+        fields: ['code', 'name']
+    }); 
+    var ndays = daysInMonth(NowMonth+1, NowYear);
+    switch (ndays){
+        case 28:
+            daystore.loadData(days28);
+            break;
+        case 29:
+            daystore.loadData(days29);
+            break;
+        case 30:
+            daystore.loadData(days30);
+            break;
+        case 31:
+            daystore.loadData(days31);
+            break;
+    }
+
+    var dobdaycombo = new Ext.form.ComboBox({
+        fieldLabel: 'day',
+        hideLabel: true,
+        name: 'dobday',
+        id: 'userinfo_dob_day',
+        hiddenId: 'userinfo_dob_day_hide',
+        hiddenName: 'dobday',
+        style:"width:50px;",
+        listWidth: 50,
+
+        typeAhead: true,
+        forceSelection: true,
+        editable: false,
+        mode: 'local',
+        triggerAction: 'all',
+        emptyText:'day',
+        selectOnFocus:true,
+        store: daystore,
+        displayField: 'name', 
+        valueField: 'code',
+        columnWidth: 0.2
+    });
+    //dobdaycombo.setValue(NowDay);
+
+    var fl = "Date of Birth";
+    if( arguments.length == 1 )
+        fl = fieldLabel;
+    var panel = new Ext.Panel({
+        layout: "column",
+        items:[dobdaycombo, dobyearcombo, dobmonthcombo],
+        reset: function(){
+            dobdaycombo.clearValue();
+            dobmonthcombo.clearValue();
+            dobyearcombo.clearValue();
+        }
+    });
+
+    var dobField = new Ext.ux.CustomContentField({
+        fieldLabel: fl,
+        id: 'dob',
+        panel: panel,
+        items: {items: [panel]},
+        cascade : function(fn, scope, args){
+            if(fn.apply(scope || this, args || [this]) !== false){ 
+                if(this.items){
+                    var cs = this.items.items;
+
+                    for(var i = 0, len = cs.length; i < len; i++){
+                        if(cs[i].cascade){
+                            cs[i].cascade(fn, scope, args);
+                        }else{  
+                            fn.apply(scope || cs[i], args || [cs[i]]);
+                        }       
+                    }       
+                }       
+            }       
+        }
+    });
+    return dobField;
+}
+

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs-new.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs-new.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs-new.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs-new.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,380 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+/****************************************************************************
+ *     Following code is related to Drag-and-Drop                           *
+ *     Code in this file is improved based on the original file             *
+ *     drag-and-drop-extjs.js.                                              *
+ ****************************************************************************/
+Ext.namespace("cgl.shindig.ui.layout");
+
+/* a drop target array indexed using the column id 
+ * (each column is a drop target) */
+cgl.shindig.ui.layout.droptargetrenderedlist = {};
+
+//position of the drag source
+cgl.shindig.ui.layout.dragsourcepos = {} ; 
+
+var _gadget_index_ = -1;
+
+// ----------------------------------------------------------------------------
+// body box is used to cover the whole canvas. However it is transparent so
+// that users don't notice it.
+// Now, it is used when drag-and-drop is carried out.
+// ----------------------------------------------------------------------------
+cgl.shindig.ui.layout.bodycoverbox = (function() {
+    var bodycoverbox = document.createElement('div');
+    bodycoverbox.style.display = "none";
+    bodycoverbox.style.border = ""
+    bodycoverbox.style.zIndex = "999996";
+    bodycoverbox.style.position = "absolute";
+    bodycoverbox.style.left = "0px";
+    bodycoverbox.style.top = "0px";
+    bodycoverbox.style.opacity = 0.0;
+    bodycoverbox.style.filter = "alpha(opacity=0)";
+    return bodycoverbox;
+}());
+
+/**
+ * Show the body box. It is appended to the html body.
+ */
+cgl.shindig.ui.layout.bodycoverboxshow = function (){
+    var bodyele = Ext.getBody();
+    var baseele = bodyele;
+    var el = cgl.shindig.ui.layout.bodycoverbox;
+    el.style.display="block";
+    el.style.backgroundColor = "silver";
+    el.style.height = bodyele.getHeight()+"px";
+    el.style.width = bodyele.getWidth()+"px";
+    baseele.dom.appendChild(el);
+    return el;
+}
+
+/** 
+ * Hide the body box and remove it from html body.
+ */
+cgl.shindig.ui.layout.bodycoverboxhide = function (){
+    var el = cgl.shindig.ui.layout.bodycoverbox;
+    el.style.display="none";
+    if (el.parentNode != null)
+        el.parentNode.removeChild(el);
+    return el;
+}
+
+
+// ----------------------------------------------------------------------------
+// dummy box is used to replace the gadget which is being dragged.
+// ----------------------------------------------------------------------------
+
+cgl.shindig.ui.layout.dummyboxaltid = "_dummybox_alt_";
+
+/* Type of dummybox is HTML element instead of extjs Ext.Element */
+cgl.shindig.ui.layout.dummybox = (function (){
+    var dummybox = document.createElement('div');
+    dummybox.style.display = "none";
+    dummybox.style.border = "3px dashed silver"
+    dummybox.setAttribute("id", "dummybox_id");
+    return dummybox;
+})();
+
+
+/* show the dummy box.
+ * When a gadget is dragged, size of the dummy box is adjusted and the dummy
+ * box is displayed in place of the gadget.
+ * Note: the parameter baseele is not a html dom element, but an Ext.Element
+ * object.
+ * @return dummy box HTML element
+ */
+cgl.shindig.ui.layout.dummyboxshow = function (baseele){
+    var el = cgl.shindig.ui.layout.dummybox;
+    el.style.display="block";
+    //el.style.backgroundColor = "silver";
+    if (arguments.length == 1){
+        el.style.height = baseele.getHeight()+"px";
+        el.style.width = baseele.getWidth()+"px";
+    }
+    return el;
+}
+
+/**
+ * Hide the dummy box.
+ * Note: we should remove the dummy box from its parent so that it does not
+ * mess up the code relying on the structure of the dom tree.
+ */
+cgl.shindig.ui.layout.dummyboxhide = function (){
+    var el = cgl.shindig.ui.layout.dummybox;
+    el.style.display="none";
+    el.parentNode.removeChild(el);
+    return el;
+}
+
+cgl.shindig.ui.layout.getDummydiv = function() {
+    return Ext.get('dummydiv');
+}
+
+// ----------------------------------------------------------------------------
+// Extend extjs drag-and-drop code to meet our needs.
+// ----------------------------------------------------------------------------
+Ext.namespace("cgl.shindig.ui.dnd");
+
+cgl.shindig.ui.dnd.DragSource = function(el, config) {
+    cgl.shindig.ui.dnd.DragSource.superclass.constructor.call(this,el,config);
+    this.proxy.animRepair = false; /* disable animation */
+};
+
+Ext.extend(cgl.shindig.ui.dnd.DragSource, Ext.dd.DragSource, {
+    b4StartDrag: function(x, y) {
+        /* remember the initial drop target that this element belongs to */
+        var parent_colid = this.parent_colid;
+        this.getDragData().lastOverDT = 
+            cgl.shindig.ui.layout.droptargetrenderedlist[parent_colid];
+ 
+        cgl.shindig.ui.dnd.DragSource.superclass.b4StartDrag.call(this, x, y);
+
+        /* constrain the drag-and-drop to the main tab panel */
+        /* this must be executed before the element is replaced a dummy box */
+        var layoutobj = cgl.shindig.ui.layout.layoutobj;
+        var tabid = layoutobj.makeTabId(cgl.shindig.ui.layout.curactivetabidx)
+        this.constrainTo(tabid, 0, true);
+
+        /* cover the whole canvas/page */
+        cgl.shindig.ui.layout.bodycoverboxshow();
+
+        /* Append a dummy box before the dragged gadget. */
+        /* Then move the dragged gadget to a dummy div which is hidden. */
+        var ele = Ext.get(this.getEl());
+        var db = cgl.shindig.ui.layout.dummyboxshow(ele);
+        ele.dom.parentNode.insertBefore(db, ele.dom);
+        cgl.shindig.ui.layout.getDummydiv().appendChild(ele);
+
+        _gadget_index_ = -1;
+    }, 
+    /*
+    afterDragDrop: function(e, id){
+        // If the mouse is unpressed outside the drop target, the Drop event
+        // is NOT triggered and this function is NOT called at all.
+        // So we move it to onEndDrag function which is called whether the
+        // drop event is captured or not.
+        cgl.shindig.ui.layout.bodycoverboxhide();
+    },
+    */
+    autoOffset : function(x, y) {
+        /* directly bypass the function in DragSource because it does NOT
+         * respect passed-in parameters
+         */
+        Ext.dd.DragSource.superclass.autoOffset.call(this, x, y);
+        // cgl.shindig.ui.dnd.DragSource.superclass.b4StartDrag.call(this, x, y);
+    },
+    /*
+     * Override this function to change content of the status proxy. 
+     */
+    /*
+    onInitDrag : function(x, y){
+        var clone = this.el.dom.cloneNode(true);
+        clone.id = Ext.id();
+        // this.proxy.update(clone);
+        this.onStartDrag(x, y);
+        return true;
+    },
+    */ 
+    /**
+     * This function is invoked when the drag ends. It does not necessarily
+     * result in a dragdrop event.
+     */
+    onEndDrag : function(data, e) {
+        cgl.shindig.ui.layout.bodycoverboxhide();
+        var layoutobj = cgl.shindig.ui.layout.layoutobj;
+        if (this.dragData.lastOverDT != null) {
+            // This means the mouse is unpressed outside drop target so that
+            // Drop event is not triggered.
+            var source = this, target = this.dragData.lastOverDT;
+            gadgetDrop(source, target);
+        }
+    }
+});
+
+cgl.shindig.ui.dnd.DropTarget = function(el, config) {
+    cgl.shindig.ui.dnd.DropTarget.superclass.constructor.call(this, el, config);
+};
+
+Ext.extend(cgl.shindig.ui.dnd.DropTarget, Ext.dd.DropTarget, {
+    notifyOver: function(source, e, data){
+        
+        /* remember the last drop target that this source moves over */
+        source.dragData.lastOverDT = this;
+
+        //get proxy of drag source
+        var dragEl = Ext.get(source.getDragEl());
+
+        //get target element
+        var dtEl = Ext.get(this.getEl());
+
+        //calculate the center of the drag source element.
+        var dragElCenter = [(dragEl.getLeft() + dragEl.getRight())/2,
+                            (dragEl.getTop()+dragEl.getBottom())/2];
+        var dragElCenterX = dragElCenter[0], dragElCenterY = dragElCenter[1];
+
+        var ele = null, minindex = -1;
+        var minxdist=99999, minydist=99999, mindist=99999, minele=null;
+        
+        var composite = dtEl.select('>div');
+        var eleCount = composite.getCount();
+        var xarray = [];
+        for( var i = 0 ; i < eleCount; i++ ){
+            ele = composite.item(i);
+            var center = [(ele.getLeft() + ele.getRight())/2, (ele.getTop()+ele.getBottom())/2];
+            var height = ele.getHeight();
+            var width = ele.getWidth();
+            xarray.push([center, height, width, i, ele.dom.getAttribute('id')]);
+        }
+        
+        var dummyBoxEl = Ext.get(cgl.shindig.ui.layout.dummybox);
+        var dummyBoxId = dummyBoxEl.id;
+
+        /**
+         * Check the new position of the dragged element.
+         * if position is -1, it means the dragged element should be appended to the end
+         */
+        xarray.sort(sortNumber);
+
+        var position = eleCount, positionChanged = true;
+        for( var i = 0 ; i < eleCount; i++ ){
+            if( dragElCenterY < xarray[i][0][1] ){
+                _gadget_index_ = position = i;
+                if( i == 0 ) {
+                    if (xarray[position][4] == dummyBoxId)
+                        positionChanged = false;
+                } else {
+                    var pdistpercent = (dragElCenterY - xarray[i-1][0][1])*2/xarray[i-1][1];
+                    var threshold = 0.3;
+                    if( pdistpercent < threshold ){
+                        position = position - 1;
+                        _gadget_index_ = position;
+                        if (xarray[position][4] == dummyBoxId)
+                            positionChanged = false;
+                        else {
+                            if (position > 0) {
+                                if (xarray[position-1][4] === dummyBoxId) {
+                                    positionChanged = false;
+                                    _gadget_index_ = position - 1;
+                                }
+                            }
+                        }
+                    }else{
+                        if (xarray[position-1][4] === dummyBoxId) {
+                            positionChanged = false;
+                            _gadget_index_ = position - 1;
+                        } else if(xarray[position][4] === dummyBoxId) {
+                            positionChanged = false;
+                        }
+                    }
+                }
+                break;
+            }
+        }
+
+        if (position == eleCount) {
+            if (eleCount > 0) {
+                if (xarray[position-1][4] === dummyBoxId) {
+                    positionChanged = false;
+                    _gadget_index_ = position - 1;
+                }
+            }
+        }
+
+
+        if (positionChanged == false) {
+            return cgl.shindig.ui.dnd.DropTarget.superclass.notifyOver.call(this, source, e, data);
+        }
+
+        _gadget_index_ = position;
+
+        if( position == eleCount ){//append
+            dtEl.appendChild(dummyBoxEl);
+        }else if( position == 0 ){//insert into the first place
+            dtEl.insertFirst(dummyBoxEl);
+        }else{//insert middle
+            dummyBoxEl.insertBefore(Ext.get(xarray[position][4]));
+        }
+
+        setTimeout(function(){adjustCurrentTabPanel();}, 500);
+
+        return cgl.shindig.ui.dnd.DropTarget.superclass.notifyOver.call(this, source, e, data);
+    },
+
+    notifyDrop: function(source, e, data){
+        gadgetDrop(source, this);
+    },
+    createFrame: function(){
+        //TODO: do we need this function??
+    }
+});
+
+/**
+ *
+ * @param gadgetIdx gadget index of the new position. (not exist now)
+ * @param source    drag source
+ * @param target    drop target
+ */
+function gadgetDrop(source, target) {
+    /** reset this property as early as possible to avoid possible racing
+     * with function onEndDrag
+     */
+    source.dragData.lastOverDT = null;
+
+    var layoutobj = cgl.shindig.ui.layout.layoutobj;
+
+    /* replace the dummy box with the dragged gadget itself */
+    // TODO: maybe we need to check that b4StartDrag has been invoked.
+    var dummybox = cgl.shindig.ui.layout.dummybox;
+    Ext.get(dummybox).replaceWith(Ext.get(source.getEl()));
+
+    if (_gadget_index_ == -1) {
+        // in case, drag starts, but notifyOver is not invoked.
+        return;
+    }
+
+    /* get new position of the dragged gadget */
+    var cur_colid = target.id;
+    var cur_col_index = layoutobj.parseGID(cur_colid)[1];
+    var cur_gadget_index = _gadget_index_;
+
+    /* the original position of the dragged gadget*/
+    var old_colid = source.parent_colid;
+    var old_col_index = layoutobj.parseGID(old_colid)[1];
+        var old_gadget_index = source.gadgetindex;
+
+    /* modify underlying data structure */
+    cgl.shindig.ui.layout.layoutobj.moveGadgetInATab(
+            [cgl.shindig.ui.layout.curactivetabidx, old_col_index, old_gadget_index],
+            [cgl.shindig.ui.layout.curactivetabidx, cur_col_index, cur_gadget_index]);
+    source.parent_colid = cur_colid;
+    source.gadgetindex = cur_gadget_index;
+
+    _gadget_index_ = -1;
+
+    adjustCurrentTabPanel();
+    cgl.shindig.ops.syncLayoutData(false);
+}
+
+function sortNumber(a, b) {
+    return a[0][1] - b[0][1];
+}

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs-old.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs-old.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs-old.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs-old.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,256 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+/*******************************************************************************
+ *     Following code is related to Drag-and-Drop                              *
+ *******************************************************************************/
+Ext.namespace("cgl.shindig.ui.layout");
+
+cgl.shindig.ui.layout.droptargetrenderedlist = {};
+cgl.shindig.ui.layout.dragsourcepos = {} ; //position of the drag source
+
+var _over_counter_ = 0;
+var _dragging_ = false;
+var _gadget_index_ = 10;
+var _drag_start_x = -1;
+var _drag_start_y = -1;
+var _ds_x;
+var _ds_y;
+
+Ext.override(Ext.dd.DragSource, {
+    onBeforeDrag: function(data, e){
+        var ele = Ext.get(this.getEl());
+        _ds_x = ele.getLeft();
+        _ds_y = ele.getTop();
+        _drag_start_x = e.getPageX();
+        _drag_start_y = e.getPageY();
+        this.getProxy().hide();//this is tricky
+        this.getProxy().getEl().setStyle({backgroundColor:"#ffFFFF",
+                                         filter:"alpha(opacity=75)",
+                                         opacity:0.75});
+        this.getProxy().getGhost().setStyle({backgroundColor:"FFFFFF",
+                                         filter:"alpha(opacity=90)",
+                                         opacity:0.9});
+    },
+    onDrag: function(e){
+        var sp = this.getProxy();
+        if( _dragging_ == false ){
+            sp.show();
+            sp.update("");
+            _dragging_ = true;
+
+            //append a dummy box before the dragged gadget. Then
+            //move the dragged element to a dummy div which is hidden.
+            var ele = Ext.get(this.getEl());
+            var db = cgl.shindig.ui.layout.dummyboxshow(ele);
+            ele.dom.parentNode.insertBefore(cgl.shindig.ui.layout.dummybox, ele.dom);
+            Ext.get('dummydiv').appendChild(ele);
+        }else{
+            sp.hide();
+            sp.getEl().setLocation(_ds_x - _drag_start_x + e.getPageX(), _ds_y - _drag_start_y + e.getPageY());
+            sp.getGhost().setLocation(_ds_x - _drag_start_x + e.getPageX(), _ds_y - _drag_start_y + e.getPageY());
+            sp.show();
+        }
+    },
+    afterDragDrop: function(e, id){
+        _dragging_ = false;
+        _drag_start_x = -1;
+        _drag_start_y = -1;
+    }
+});
+Ext.override(Ext.dd.DropTarget, {
+    notifyOver: function(source, e, data){
+        ++_over_counter_;
+        if( _over_counter_ % 1 != 0 ) {
+            return;
+        }
+        _over_counter_ = 0;
+        
+        //get proxy of drag source
+        var dragEl = Ext.get( source.getDragEl() );
+        //var el = Ext.get( source.getEl() );
+        var output = "";
+        
+        var dtele = Ext.get( this.getEl() );
+        var composite = dtele.select('>div');
+        
+        var dsele = Ext.get( source.getDragEl() );
+        var minxdist=99999, minydist=99999, mindist=99999, minele=null;
+        //calculate the center of the drag source element.
+        var dscenter = [(dsele.getLeft() + dsele.getRight())/2, (dsele.getTop()+dsele.getBottom())/2];
+        output += 'x:'+dscenter[0]+';y:'+dscenter[1];
+        var dsx = dscenter[0], dsy = dscenter[1];
+        var ele = null, minindex = -1;
+        
+        var xarray = [];
+        for( var i = 0 ; i < composite.getCount(); i++ ){
+            ele = composite.item(i);
+            var center = [(ele.getLeft() + ele.getRight())/2, (ele.getTop()+ele.getBottom())/2];
+            var height = ele.getHeight();
+            var width = ele.getWidth();
+            xarray.push([center, height, width, i]);
+        }
+        
+        xarray.sort(sortNumber);
+        position = -1;
+        var len = composite.getCount();
+        for( var i = 0 ; i < len; i++ ){
+            if( dsy < xarray[i][0][1] ){
+                if( i == 0 ) {
+                    position = 0;
+                }else {
+                    var pdistpercent = (dsy - xarray[i-1][0][1])*2/xarray[i-1][1];
+                    var threshold = 0.3;
+                    if( pdistpercent < threshold ){
+                        position = i - 1;
+                    }else{
+                        position = i;
+                    }
+                }
+                break;
+            }
+        }
+        
+        //var el = Ext.get( source.getEl() );
+        //type of el must be Ext.Element.
+        var el = Ext.get(cgl.shindig.ui.layout.dummybox);
+        if( position == -1 ){//append
+            if( len > 0 ){
+                var idx = xarray[len-1][3];
+                if( el.id != composite.item(idx).dom.getAttribute('id') ){
+                    //console.log('elid: '+el.id+ ";" +idx+'.'+composite.item(idx).dom.getAttribute('id'));
+                    _gadget_index_ = len;
+                    dtele.appendChild(el);
+                }else{
+                    _gadget_index_ = len - 1;
+                }
+            }else{
+                dtele.appendChild(el);
+                _gadget_index_ = 0;
+            }
+        }else if( position == 0 ){//insert into the first place
+            var idx = xarray[0][3];
+            if( el.id != composite.item(idx).dom.getAttribute('id') ){
+                _gadget_index_ = 0;
+                dtele.insertFirst(el);
+            }else{
+                _gadget_index_ = 0;
+            }
+        }else{//insert middle
+            var idx1 = xarray[i][3];
+            var idx2 = xarray[i-1][3];
+            if( el.id != composite.item(idx1).dom.getAttribute('id') && 
+                el.id != composite.item(idx2).dom.getAttribute('id') ){
+                _gadget_index_ = i;
+                el.insertBefore(composite.item(idx1));
+            }else if(el.id == composite.item(idx1).dom.id){//getAttribute('id')){
+                _gadget_index_ = i;
+            }else{
+                _gadget_index_ = i - 1;
+            }
+        }
+    },
+    notifyDrop: function(source, e, data){
+        _dragging_ = false;
+
+        /* replace the dummy box with the dragged gadget itself */
+        var _dummybox = cgl.shindig.ui.layout.dummybox;
+        Ext.get(_dummybox).replaceWith(Ext.get(source.getEl()));
+
+        /** the gadget is added to this column */
+        var _id_ = this.id;
+        var cur_col_index = parseInt( _id_.substr(_id_.lastIndexOf('_')+1) );
+        var cur_gadget_index = _gadget_index_;
+
+        
+        /** the original column which the gadget belonged to */
+        var _parent_colid_ = source.parent_colid;
+        var old_col_index = parseInt( _parent_colid_.substr(_parent_colid_.lastIndexOf('_')+1) );
+        var old_gadget_index = source.gadgetindex;
+
+        //alert("new:"+cur_col_index+"g:"+cur_gadget_index+"pos;"+position);
+        //alert("new:"+cur_col_index+"g:"+cur_gadget_index+"pos;"+position+ 'old:'+old_col_index+'g:'+old_gadget_index);
+        cgl.shindig.ui.layout.layoutobj.moveGadgetInATab(
+                [cgl.shindig.ui.layout.curactivetabidx,old_col_index,old_gadget_index],
+                [cgl.shindig.ui.layout.curactivetabidx,cur_col_index,cur_gadget_index]);
+        source.parent_colid = _id_;
+        source.gadgetindex = cur_gadget_index;
+        
+        /** modify underlying data structure */
+    },
+    createFrame: function(){
+    }
+});
+
+function sortNumber(a, b) {
+    return a[0][1] - b[0][1];
+}
+
+/* Dummy box is used when a gadget is dragged.
+ * When a gadget is dragged, size of the dummy box should be adjusted and the dummy box
+ * should be displayed (by default, it is hidden).
+ */
+cgl.shindig.ui.layout.dummybox = (function (){
+    var dummybox = document.createElement('div');
+    dummybox.style.display = "none";
+    dummybox.style.border = "3px dashed silver"
+    dummybox.style.id = "dummybox_id";
+    return dummybox;
+})();
+
+cgl.shindig.ui.layout.dummyboxaltid = "_dummybox_alt_";
+
+/*
+cgl.shindig.ui.layout.dummyboxinit = function (baseele){
+    var el = cgl.shindig.ui.layout.dummybox;
+    el.style.height = baseele.getHeight();
+    el.style.width = baseele.getWidth();
+    return el;
+    //el.id = baseele.id;
+    //baseele.id = cgl.shindig.ui.layout.dummyboxaltid;
+}
+*/
+
+/* show the dummy box. 
+ * Note the parameter baseele is not a html dom element, but an Ext.Element object.
+ */
+cgl.shindig.ui.layout.dummyboxshow = function (baseele){
+    var el = cgl.shindig.ui.layout.dummybox;
+    el.style.display="block";
+    //el.style.backgroundColor = "silver";
+    if (arguments.length == 1){
+        el.style.height = baseele.getHeight()+"px";
+        el.style.width = baseele.getWidth()+"px";
+        //el.id = baseele.id;
+        //baseele.id = cgl.shindig.ui.layout.dummyboxaltid;
+    }
+    return el;
+}
+
+/* Note: we should remove the dummy box from its parent so that it does not mess
+ * up the code relying on the dom tree.*/
+cgl.shindig.ui.layout.dummyboxhide = function (){
+    var el = cgl.shindig.ui.layout.dummybox;
+    el.style.display="none";
+    el.parentNode.removeChild(el);
+    return el;
+}
+

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/drag-and-drop-extjs.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,265 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+/*******************************************************************************
+ *     Following code is related to Drag-and-Drop                              *
+ *******************************************************************************/
+Ext.namespace("cgl.shindig.ui.layout");
+
+cgl.shindig.ui.layout.droptargetrenderedlist = {};
+cgl.shindig.ui.layout.dragsourcepos = {} ; //position of the drag source
+
+var _over_counter_ = 0;
+var _dragging_ = false;
+var _gadget_index_ = 10;
+var _drag_start_x = -1;
+var _drag_start_y = -1;
+var _ds_x;
+var _ds_y;
+
+Ext.override(Ext.dd.DragSource, {
+    onBeforeDrag: function(data, e){
+        var ele = Ext.get(this.getEl());
+        _ds_x = ele.getLeft();
+        _ds_y = ele.getTop();
+        _drag_start_x = e.getPageX();
+        _drag_start_y = e.getPageY();
+        this.getProxy().hide();//this is tricky
+        this.getProxy().getEl().setStyle({backgroundColor:"#ffFFFF",
+                                         filter:"alpha(opacity=75)",
+                                         opacity:0.75});
+        // this.getProxy().getGhost().setStyle({backgroundColor:"FFFFFF",
+        //                                  filter:"alpha(opacity=90)",
+        //                                  opacity:0.9});
+        this.getProxy().getGhost().hide();
+    },
+    onDrag: function(e){
+        var sp = this.getProxy();
+        if( _dragging_ == false ){
+            sp.show();
+            sp.update("");
+            _dragging_ = true;
+
+            //append a dummy box before the dragged gadget. Then
+            //move the dragged element to a dummy div which is hidden.
+            var ele = Ext.get(this.getEl());
+            var db = cgl.shindig.ui.layout.dummyboxshow(ele);
+            ele.dom.parentNode.insertBefore(cgl.shindig.ui.layout.dummybox, ele.dom);
+            Ext.get('dummydiv').appendChild(ele);
+        }else{
+            // sp.hide();
+            // sp.show();
+            // loadFirebugConsole();
+            // console.debug(_ds_y+","+e.getPageY());
+            // console.debug(sp.getEl().getTop() + "-" + sp.getEl().getTop(true));
+            var newx = _ds_x - _drag_start_x + e.getPageX();
+            var newy = _ds_y - _drag_start_y + e.getPageY();
+            // console.debug(newx+","+newy);
+            sp.getEl().setLeftTop( newx + 'px', (newy + 70) + 'px');
+            sp.getEl().setLeftTop( newx + 'px', newy + 'px');
+            // sp.getEl().setLocation(_ds_x - _drag_start_x + e.getPageX(), _ds_y - _drag_start_y + e.getPageY());
+            // sp.getGhost().setLocation(_ds_x - _drag_start_x + e.getPageX()-30, _ds_y - _drag_start_y + e.getPageY()-20);
+        }
+    },
+    afterDragDrop: function(e, id){
+        _dragging_ = false;
+        _drag_start_x = -1;
+        _drag_start_y = -1;
+    }
+});
+Ext.override(Ext.dd.DropTarget, {
+    notifyOver: function(source, e, data){
+        ++_over_counter_;
+        if( _over_counter_ % 1 != 0 ) {
+            return;
+        }
+        _over_counter_ = 0;
+        
+        //get proxy of drag source
+        var dragEl = Ext.get( source.getDragEl() );
+        //var el = Ext.get( source.getEl() );
+        var output = "";
+        
+        var dtele = Ext.get( this.getEl() );
+        var composite = dtele.select('>div');
+        
+        var dsele = Ext.get( source.getDragEl() );
+        var minxdist=99999, minydist=99999, mindist=99999, minele=null;
+        //calculate the center of the drag source element.
+        var dscenter = [(dsele.getLeft() + dsele.getRight())/2, (dsele.getTop()+dsele.getBottom())/2];
+        output += 'x:'+dscenter[0]+';y:'+dscenter[1];
+        var dsx = dscenter[0], dsy = dscenter[1];
+        var ele = null, minindex = -1;
+        
+        var xarray = [];
+        for( var i = 0 ; i < composite.getCount(); i++ ){
+            ele = composite.item(i);
+            var center = [(ele.getLeft() + ele.getRight())/2, (ele.getTop()+ele.getBottom())/2];
+            var height = ele.getHeight();
+            var width = ele.getWidth();
+            xarray.push([center, height, width, i]);
+        }
+        
+        xarray.sort(sortNumber);
+        position = -1;
+        var len = composite.getCount();
+        for( var i = 0 ; i < len; i++ ){
+            if( dsy < xarray[i][0][1] ){
+                if( i == 0 ) {
+                    position = 0;
+                }else {
+                    var pdistpercent = (dsy - xarray[i-1][0][1])*2/xarray[i-1][1];
+                    var threshold = 0.3;
+                    if( pdistpercent < threshold ){
+                        position = i - 1;
+                    }else{
+                        position = i;
+                    }
+                }
+                break;
+            }
+        }
+        
+        //var el = Ext.get( source.getEl() );
+        //type of el must be Ext.Element.
+        var el = Ext.get(cgl.shindig.ui.layout.dummybox);
+        if( position == -1 ){//append
+            if( len > 0 ){
+                var idx = xarray[len-1][3];
+                if( el.id != composite.item(idx).dom.getAttribute('id') ){
+                    //console.log('elid: '+el.id+ ";" +idx+'.'+composite.item(idx).dom.getAttribute('id'));
+                    _gadget_index_ = len;
+                    dtele.appendChild(el);
+                }else{
+                    _gadget_index_ = len - 1;
+                }
+            }else{
+                dtele.appendChild(el);
+                _gadget_index_ = 0;
+            }
+        }else if( position == 0 ){//insert into the first place
+            var idx = xarray[0][3];
+            if( el.id != composite.item(idx).dom.getAttribute('id') ){
+                _gadget_index_ = 0;
+                dtele.insertFirst(el);
+            }else{
+                _gadget_index_ = 0;
+            }
+        }else{//insert middle
+            var idx1 = xarray[i][3];
+            var idx2 = xarray[i-1][3];
+            if( el.id != composite.item(idx1).dom.getAttribute('id') && 
+                el.id != composite.item(idx2).dom.getAttribute('id') ){
+                _gadget_index_ = i;
+                el.insertBefore(composite.item(idx1));
+            }else if(el.id == composite.item(idx1).dom.id){//getAttribute('id')){
+                _gadget_index_ = i;
+            }else{
+                _gadget_index_ = i - 1;
+            }
+        }
+    },
+    notifyDrop: function(source, e, data){
+        _dragging_ = false;
+
+        /* replace the dummy box with the dragged gadget itself */
+        var _dummybox = cgl.shindig.ui.layout.dummybox;
+        Ext.get(_dummybox).replaceWith(Ext.get(source.getEl()));
+
+        /** the gadget is added to this column */
+        var _id_ = this.id;
+        var cur_col_index = parseInt( _id_.substr(_id_.lastIndexOf('_')+1) );
+        var cur_gadget_index = _gadget_index_;
+
+        
+        /** the original column which the gadget belonged to */
+        var _parent_colid_ = source.parent_colid;
+        var old_col_index = parseInt( _parent_colid_.substr(_parent_colid_.lastIndexOf('_')+1) );
+        var old_gadget_index = source.gadgetindex;
+
+        //alert("new:"+cur_col_index+"g:"+cur_gadget_index+"pos;"+position);
+        //alert("new:"+cur_col_index+"g:"+cur_gadget_index+"pos;"+position+ 'old:'+old_col_index+'g:'+old_gadget_index);
+        cgl.shindig.ui.layout.layoutobj.moveGadgetInATab(
+                [cgl.shindig.ui.layout.curactivetabidx,old_col_index,old_gadget_index],
+                [cgl.shindig.ui.layout.curactivetabidx,cur_col_index,cur_gadget_index]);
+        source.parent_colid = _id_;
+        source.gadgetindex = cur_gadget_index;
+        
+        /** modify underlying data structure */
+    },
+    createFrame: function(){
+    }
+});
+
+function sortNumber(a, b) {
+    return a[0][1] - b[0][1];
+}
+
+/* Dummy box is used when a gadget is dragged.
+ * When a gadget is dragged, size of the dummy box should be adjusted and the dummy box
+ * should be displayed (by default, it is hidden).
+ */
+cgl.shindig.ui.layout.dummybox = (function (){
+    var dummybox = document.createElement('div');
+    dummybox.style.display = "none";
+    dummybox.style.border = "3px dashed silver"
+    dummybox.style.id = "dummybox_id";
+    return dummybox;
+})();
+
+cgl.shindig.ui.layout.dummyboxaltid = "_dummybox_alt_";
+
+/*
+cgl.shindig.ui.layout.dummyboxinit = function (baseele){
+    var el = cgl.shindig.ui.layout.dummybox;
+    el.style.height = baseele.getHeight();
+    el.style.width = baseele.getWidth();
+    return el;
+    //el.id = baseele.id;
+    //baseele.id = cgl.shindig.ui.layout.dummyboxaltid;
+}
+*/
+
+/* show the dummy box. 
+ * Note the parameter baseele is not a html dom element, but an Ext.Element object.
+ */
+cgl.shindig.ui.layout.dummyboxshow = function (baseele){
+    var el = cgl.shindig.ui.layout.dummybox;
+    el.style.display="block";
+    //el.style.backgroundColor = "silver";
+    if (arguments.length == 1){
+        el.style.height = baseele.getHeight()+"px";
+        el.style.width = baseele.getWidth()+"px";
+        //el.id = baseele.id;
+        //baseele.id = cgl.shindig.ui.layout.dummyboxaltid;
+    }
+    return el;
+}
+
+/* Note: we should remove the dummy box from its parent so that it does not mess
+ * up the code relying on the dom tree.*/
+cgl.shindig.ui.layout.dummyboxhide = function (){
+    var el = cgl.shindig.ui.layout.dummybox;
+    el.style.display="none";
+    el.parentNode.removeChild(el);
+    return el;
+}
+

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/extauth.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/extauth.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/extauth.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/js/extauth.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,56 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+
+cgl.shindig.extAuth = function() {
+    
+    var index = 0;
+    var store = {};
+
+    register = function(name, url, title) {
+        store[index+""] = {"url":url, "title":title, "name":name};
+        ++index;
+    };
+
+    register("MyProxy",
+            "https://gf13.ucs.indiana.edu:7443/ishindig-webapp/www/authorization.html", 
+            "MyProxy Auth");
+
+    getAttr = function(index, attrName) {
+        return store[index+""][attrName];
+    };
+
+    getList = function() {
+        var arr = [];
+        for (var prop in store) {
+            if (store.hasOwnProperty(prop)) {
+                arr.push([store[prop]["name"], prop]);
+            }
+        }
+        return arr;
+    };
+
+    return {
+        "getAttr": getAttr,
+        "getList": getList
+    }
+}();
+