rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zh...@apache.org
Subject svn commit: r1087520 [26/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...
Date Fri, 01 Apr 2011 00:29:38 GMT
Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/layout-manage.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/layout-manage.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/layout-manage.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/layout-manage.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,934 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+/** 
+ * Zhenhua Guo
+ * Community Grids Lab
+ * Pervasive Technology Lab
+ * Indiana University.
+ */
+
+/* TODO: Is this obsolete? */
+
+/** TODO
+ * (1) Add a "move to tab" in toolbar of every gadget.
+ * (2) Add tree navigation
+ */
+
+ /**
+  * The first parameter must not be URL encoded before being passed into this function.
+  */
+function getGadgetDefaultMetadata(gadgeturl, frameid){
+    var postbody = '{context:{}, gadgets:[{url:"'+
+                    gadgeturl+
+                   '", language:"en", country:"US"}]}';
+
+    var connection = new Ext.data.Connection({
+    });
+    connection.request({
+        method: 'POST',
+        // url: getBaseURL() + "gadgets/metadata",
+        url: getGadgetMetaBaseURL(), 
+        params: postbody,
+        success: function( response, options ) {
+            var resp = response.responseText;
+            var obj = eval('(' + resp + ')');
+            if(obj.gadgets.length > 0 ){
+                var height = obj.gadgets[0].height;
+                var iframe = document.getElementById(frameid);
+                if( iframe != null )
+                    iframe.style.height = height+'px';
+            }
+        },
+        failure : function( response, options ) {
+            //alert('fail');
+        }
+    });
+}
+
+/** When a user wants to move a gadget to another tab, this window is displayed to ask user
+ *  the gadget will be moved to which tab.
+ */
+function createGadgetMove2TabWin(gid){
+    var gadgetid = gid;
+    var movewindow = new Ext.Window({
+        title    : 'move this gadget to another tab',
+        closable : true,
+        width    : 270,
+        //height   : 350,
+        plain    : true
+        //closeAction: 'hide',
+    });
+    var move2tabliststore = new Ext.data.SimpleStore({
+        data: [],
+        fields: ['value', 'text']
+    });
+
+    var move2combo = new Ext.form.ComboBox({
+        typeAhead: true,
+        forceSelection: true,
+        editable: false,
+        mode: 'local',
+        triggerAction: 'all',
+        emptyText:'Select a tab...',
+        selectOnFocus:true,
+        id: 'tab-list-move2',
+        store: move2tabliststore,
+        displayField: 'text',
+        valueField: 'value',
+        fieldLabel: 'tab',
+        width: 200
+    });
+
+    var move2formpanel = new Ext.form.FormPanel({
+        labelWidth: 25,
+        frame: true,
+        title: '',
+        bodyStyle: 'padding:5px 5px 0',
+        autoHeight: true,
+        //defaults: { width: '80%' },
+        buttons: [{
+            text: 'Save',
+            type: 'submit',
+            handler: function(){ move2formpanel.getForm().submit(); }
+        }, {
+            text: 'cancel',
+            handler: function(){ movewindow.close(); }
+        }],
+        items: [move2combo],
+        onSubmit: Ext.emptyFn,
+        submit: function(){
+            //TODO
+            var tabid = move2combo.getValue();
+            if(tabid != ''){
+               /* procedure:
+                  (1) remove the gadget from current tab.
+                  (2) add the gadget to new tab.
+                  (3) modify underlying data structure
+                  (4) cgl.shindig.ui.layout.dragsourcepos[_gid_] 
+                        parent_colid: id/index of the column it belongs to.
+                        gadgetindex
+                */
+            }
+            alert("this functionality has not been implemented");
+            movewindow.close();
+        }
+    });
+
+    movewindow.add(move2formpanel);
+
+    var tablist = cgl.shindig.ui.layout.layoutobj.getTabNameIdList();
+    for(var i = 0; i < tablist.length ; ++i){
+        var tabid = tablist[i][0];
+        if( cgl.shindig.ui.layout.layoutobj.getTabByIndex(cgl.shindig.ui.layout.curactivetabidx).getTabId() ==tabid){
+            tablist.splice(i, 1);
+            break;
+        }
+    }
+    move2tabliststore.loadData(tablist);
+    return movewindow;
+}
+
+
+/**
+ * get an object that contains the parts included in the toolbar id.
+ *
+ */
+function getIdObjFromTbId(tbdivid) {
+    var gadgetid = tbdivid.substr(0, tbdivid.length-('_tb_'.length));
+    var idobj2 = getIdObjFromGId(gadgetid);
+    return Ext.applyIf({gid: gadgetid}, idobj2);
+}
+
+/**
+ * get an object that contains the parts included in the gadget id.
+ *
+ */
+function getIdObjFromGId(gadgetid) {
+    var ci = gadgetid.indexOf('_col_');
+    var gi = gadgetid.indexOf('_gadget_');
+    var tabindex = parseInt( gadgetid.substring( '_tab_'.length, ci ) );
+    var colindex = parseInt( gadgetid.substring( ci+'_col_'.length, gi) );
+    var gadgetindex = parseInt( gadgetid.substring( gi+'_gadget_'.length ) );
+    var columnid = gadgetid.substr(0, gi);
+    var tabid = gadgetid.substr(0, ci);
+
+    return {
+        colid: columnid,
+        tabid: tabid,
+        colidx: colindex,
+        gadgetidx: gadgetindex,
+        tabidx: tabindex
+    };
+}
+
+/** The toolbar of a gadget is not rendered from the start.
+  * It is only renderred when necessary.
+  * The renderring of toolbar should be executed only the first time the iframe is loaded.
+  * After that, if the iframe is reloaded or refreshed without refreshing the whole page, the toolbar
+  * should not be renderred again.
+  *
+  * @param tbdivid  id of the toolbar
+  */
+function renderAGadgetTB(tbdivid){
+    var tbidobj = getIdObjFromTbId(tbdivid);
+
+    //check whether the toolbar was rendered before.
+    if (cgl.shindig.ui.layout.tbrenderlist[tbdivid] != null) return;
+    
+    var _tb_ = createGadgetToolbar(tbdivid, false);
+
+    _tb_.getEl().addClassOnOver('toolbar-over');
+    /* Add drag and drop support */
+    // var _gid_ = tbdivid.substr(0, tbdivid.length-('_tb_'.length));
+    var _dd_ = new Ext.dd.DragSource(tbidobj.gid, {ddGroup:'group'});
+    _dd_.setHandleElId(tbdivid);
+    _dd_.resizeFrame = true;
+    _dd_.centerFrame = true;
+    
+    // var _colid_ = _gid_.substr(0, _gid_.indexOf('_gadget_'));
+    _dd_.parent_colid = tbidobj.colid;
+    _dd_.gadgetindex = tbidobj.gadgetidx;//parseInt( _gid_.substr(_gid_.indexOf('_gadget_') + '_gadget_'.length) );
+    
+    //mark this toolbar has been rendered.
+    cgl.shindig.ui.layout.tbrenderlist[tbdivid] = true;
+    
+    //store the drag source of this gadget.
+    // cgl.shindig.ui.layout.dragsourcepos[_gid_] = _dd_;
+    cgl.shindig.ui.layout.dragsourcepos[tbidobj.gid] = _dd_;
+}
+
+/**
+  * Maximize a gadget
+  * @param gadgetId id of the gadget to be maximized.
+  */
+function maximizeGadget(gadgetId) {
+    var idobj = getIdObjFromGId(gadgetId);
+    var tabele = Ext.get(idobj.tabid);
+    var firstChildEle = tabele.first();
+    firstChildEle.hide(false);
+
+    var gadget = cgl.shindig.ui.layout.layoutobj.getGadgetByIndex(idobj.tabidx, idobj.colidx, idobj.gadgetidx);
+    var escapedGadgetsrc = gadget.getEscapedGadgetSpecSrc();
+    var renderUrl = "${gadget.server.render}" + escapedGadgetsrc + "&view=canvas";
+    var newMaxGadgetEle = new Ext.Element(document.createElement("div"));
+    tabele.insertFirst(newMaxGadgetEle);
+    var frameid = gadgetId + "_iframe_max_";
+    var tbdivid = gadgetId + "_tb_";
+
+    var gadgetele = new Ext.Panel({//_tab_0_col_0_gadget_0
+        renderTo: newMaxGadgetEle.id,
+        width: "90%",
+        tbar: createMaximizedGadgetToolbar(tbdivid),
+        items: [{html: '<center><iframe id="'+frameid+
+            '" style="height:1000px;width:100%;border:none;"  src="'+ renderUrl+'"></iframe></center>'
+            }]
+    });
+    gadgetele.show();
+}
+
+/**
+ * Restore the default gadget display.
+ */
+function restoreGadget(gadgetId) {
+    var idobj = getIdObjFromGId(gadgetId);
+    var tabele = Ext.get(idobj.tabid);
+    var firstChildEle = tabele.first();
+    firstChildEle.remove();
+
+    firstChildEle = tabele.first();
+    firstChildEle.show();
+}
+
+/** create a toolbar for maximized gadget display.
+ *  @param tbdivid: id of the toolbar.
+ */
+function createMaximizedGadgetToolbar(tbdivid){
+
+    var _gid_ = tbdivid.substr(0, tbdivid.length-('_tb_'.length));
+
+    var btname = new Ext.Toolbar.TextItem({ 
+        xtype: 'tbtext', 
+        text: cgl.shindig.ui.layout.layoutobj.getGadgetNameByIDInTab(_gid_,cgl.shindig.ui.layout.curactivetabidx) });
+
+    var btrestore = new Ext.Toolbar.Button ({
+        xtype: 'tbbutton',
+        text:'restore',
+        tooltip: 'restore this gadget',
+        handler: function(){
+            restoreGadget(_gid_);
+        }});
+
+    var _tb_;
+    _tb_ = new Ext.Toolbar({ id: tbdivid+"_max_", items:[btname, "->", btrestore] });
+    return _tb_;
+}
+
+/** create a toolbar for default gadget display.
+ *  @param tbdivid: id of the toolbar.
+ *  @param isnewadded whether the toolbar belongs a newly created gadget. 
+ *         Lazy instantiation is used to render existing gadgets. For these gadgets, false should be passed in.
+ */
+function createGadgetToolbar(tbdivid, isnewadded){
+    var _gid_ = tbdivid.substr(0, tbdivid.length-('_tb_'.length));
+
+    var btname = new Ext.Toolbar.TextItem({ 
+        xtype: 'tbtext', 
+        text: cgl.shindig.ui.layout.layoutobj.getGadgetNameByIDInTab(_gid_,cgl.shindig.ui.layout.curactivetabidx) });
+
+    var btmax = new Ext.Toolbar.Button ({
+        xtype: 'tbbutton',
+        text:'maximize',
+        tooltip: 'maximize this gadget',
+        handler: function(){
+            // alert("maximization has not been implemented");
+            maximizeGadget(_gid_);
+        }});
+
+    var btmove = new Ext.Toolbar.Button( {
+        xtype: 'tbbutton',
+        text:'move',
+        tooltip: 'move this gadget to another tab',
+        handler: function(){
+            var mw = createGadgetMove2TabWin();
+            mw.show();
+        }
+    });
+    var btclose = new Ext.Toolbar.Button ({
+        xtype: 'tbbutton',
+        text:'x',
+        tooltip: 'remove this gadget',
+        handler: function(){
+            /** modifying underlying data structure */
+            var source = cgl.shindig.ui.layout.dragsourcepos[_gid_];
+            var _parent_colid_ = source.parent_colid;
+            var gadget_idx = source.gadgetindex;
+            var col_idx = parseInt( _parent_colid_.substr(_parent_colid_.lastIndexOf('_')+1) );
+            cgl.shindig.ui.layout.layoutobj.deleteGadget( cgl.shindig.ui.layout.curactivetabidx, col_idx, gadget_idx);
+            
+            delete source;
+            delete cgl.shindig.ui.layout.tbrenderlist[tbdivid];
+            delete cgl.shindig.ui.layout.dragsourcepos[_gid_];
+            
+            /** delete from ui */
+            var extEle = Ext.get(_gid_);
+            extEle.remove();
+        }
+    });
+
+    var _tb_;
+    if(isnewadded==false){
+        _tb_ = new Ext.Toolbar({ renderTo: tbdivid});
+        _tb_.add(btname, '->', btmax, btmove, btclose);
+    }else{
+        _tb_ = new Ext.Toolbar({ id: tbdivid, items:[btname, '->', btmax, btmove, btclose] });
+    }
+    return _tb_;
+}
+
+/** new namespaces and global variables */
+Ext.namespace('cgl.shindig.ui.layout');
+Ext.namespace('cgl.shindig.ui.layout.remoteservice');
+cgl.shindig.ui.layout.remoteservice.baseURL = null;
+cgl.shindig.ui.layout.remoteservice.layoutupdateaddress = getBaseURL() + "update/layout";
+cgl.shindig.ui.layout.remoteservice.getuinfoaddress = getBaseURL() + "users/";
+cgl.shindig.ui.layout.remoteservice.connection = null;
+cgl.shindig.ui.layout.json = null;
+cgl.shindig.ui.layout.userinfowin = null;
+
+//original json data will be converted to this internal representation
+cgl.shindig.ui.layout.layoutobj = null; 
+cgl.shindig.ui.layout.curactivetabidx = -1;
+
+/**
+ * The parameter of this function will be called when the page is loaded
+ */
+Ext.onReady(function (){
+    Ext.QuickTips.init();
+
+    Ext.apply(Ext.QuickTips.getQuickTip(), {
+        showDelay: 700
+    });
+
+    if( cgl.shindig.ui.layout.remoteservice.connection == null ){
+        cgl.shindig.ui.layout.remoteservice.connection = new Ext.data.Connection({
+            url: cgl.shindig.ui.layout.remoteservice.layoutupdateaddress
+        });
+    }
+    cgl.shindig.ui.layout.remoteservice.connection.request({//load initial data
+        method: 'GET',
+        url: cgl.shindig.ui.layout.remoteservice.layoutupdateaddress,
+        success: function( response, options ) {
+            cgl.shindig.ui.layout.json = eval('('+response.responseText+')');
+            if( cgl.shindig.ui.layout.json.error != null )
+                window.location.href = getURLWithoutPath()+cgl.shindig.ui.layout.json.redirect;
+            else
+                afterLoadData();
+        },
+        failure : function( response, options ) {
+            alert('init loading exception');
+            window.location.href = getBaseURL()+'www/sahara/sign.jsp';
+        }
+    });
+
+});
+
+/**
+ * Update user information. 
+ * @param form
+ * @param method which HTTP method to be used. Currently, only PUT is accepted.
+ * @param popwin
+ */
+function updateUserInfo(form, method, popwin){
+    var putuserdata = form.getValues(true);
+    var userdataobj = form.getValues(false);
+    var url = cgl.shindig.ui.layout.remoteservice.getuinfoaddress;
+
+    if( method != 'PUT' ){
+        showStatusText(statusbar, 'Update error: method specification is not correct');
+        return; 
+    }
+    if( cgl.shindig.ui.layout.remoteservice.connection == null ){ 
+        cgl.shindig.ui.layout.remoteservice.connection = new Ext.data.Connection({});
+    }       
+
+    cgl.shindig.ui.layout.remoteservice.connection.request({
+        method: method, 
+        url: url,
+        params: putuserdata,
+        success: function( response, options ) {
+            try{    
+                var obj = eval('('+response.responseText+')');
+                if( obj.error != null ){ 
+                    //window.location.href = getURLWithoutPath()+cgl.shindig.ui.layout.json.redirect;
+                    //showStatusText(statusbar, obj.error);
+                    popwin.setTitle( '<b style="color:red;">error: '+obj.error+'<b>');
+                } else{   
+                    popwin.setTitle( '<b style="color:green;">Your info has been update successfully<b>');
+                    /*
+                    (function(){
+                        getMainPanel().getComponent("mainpanelSouth").collapse();
+                    }).defer(2000);
+                    (function(){statusbar.hide();}).defer(4000);
+                    */
+                }
+            }catch(str){
+                alert("exception:"+str);
+            }
+        },
+        failure : function( response, options ) {
+            alert("network failure");
+        }
+    });
+}
+
+/** After user data is initially transferred from server to client, this function is invoked.
+ * The main task is to build user panel.
+ */
+function afterLoadData(){
+
+    /* based on the configuration string, generates a new javascript object */
+    cgl.shindig.ui.layout.layoutobj = cgl.shindig.ui.layout.generateLayoutObj(cgl.shindig.ui.layout.json);
+    cgl.shindig.ui.layout.remoteservice.getuinfoaddress += cgl.shindig.ui.layout.layoutobj.username;
+
+    var tabliststore = new Ext.data.SimpleStore({
+        data: cgl.shindig.ui.layout.layoutobj.getTabNameIdList(),
+        fields: ['value', 'text']
+    });
+
+    /* build the main panel. The main panel consists of
+     *   (1) top tool bar;
+     *   (2) middle tab panel.
+     */
+    var panel = new Ext.Panel({
+        renderTo: 'mymainpanel',
+        id: 'mainpanel',
+        tbar: new Ext.Toolbar({
+            id: 'toolbar',
+            renderTo: 'mytoolbar',
+            items: []
+        })
+    });
+  
+    var tabpanel = createTabPanel();
+
+    /* build the tab panel */
+    /*
+    var tabpanel = new Ext.TabPanel({
+        renderTo: 'tab',
+        //activeTab: 0, currently, we don't have any tab. All tabs are added dynamically.
+        height:1000,
+        deferredRender: false, 
+        layoutOnTabChange: true,
+        listeners: {
+            beforetabchange: function(tp, newtab, currenttab){
+                if( newtab != null ){
+                    var id = newtab.id;
+                    if( newtab.id == 'add-new-tab' ){
+                        return true;
+                    }
+                    return true;
+                }
+            }
+        }
+    });
+    */
+
+    /* configure the top toolbar */
+    var addtabbutton = createAddTabButton(tabpanel, tabliststore);
+    
+    /* create json viewer */
+    var jsonviewer = createJsonViewerButton();
+    
+    /** add the button which can be clicked to add a new gadget */
+    var addgadgetaction = createGadgetAddButton();
+ 
+    /* Then add the ui components (tab, column ,gadgets...) into the body element */
+    var layout = cgl.shindig.ui.layout.layoutobj;
+    for( var i = 0 ; i < layout.getTabCount(); ++i ){
+        var tab = layout.getTabByIndex(i);
+        tab.currentid = '_tab_'+i;
+        var html = TrimPath.processDOMTemplate('tab_template', tab);
+        tabpanel.add({
+            title: tab.getTabName(),
+            id:    tab.currentid,
+            html:  html,
+            height: 1000,
+            style: 'margin-left:5%;margin-right:5%;',
+            listeners: {
+                activate: function(){
+                    var _id_ = this.getId(); //should be like '_tab_0'
+                    var _prefix_ = '_tab_';
+                    var _tabindex_ = parseInt( _id_.substr(_prefix_.length) );
+                    var _tabobj_ = cgl.shindig.ui.layout.layoutobj.getTabByIndex(_tabindex_);
+                    for( var i = 0 ; i < _tabobj_.getColumnCount() ; ++i ){
+                        var _colid_ = _id_ + '_col_' + i;
+                        if( cgl.shindig.ui.layout.droptargetrenderedlist[_colid_] != null )
+                            continue;
+                        new Ext.dd.DropTarget(_colid_, {ddGroup: 'group'});
+                        cgl.shindig.ui.layout.droptargetrenderedlist[_colid_] = true;
+                    }
+                    cgl.shindig.ui.layout.curactivetabidx = _tabindex_;
+                }
+            }
+        });
+        if( i == 0 )//activate the first tab
+            tabpanel.activate(tab.currentid);
+    }
+
+    /** Then add toolbar to every gadget.
+      * We can only do it now because we only can add toolbar after the gadgets are inserted into the DOM tree.
+      * Change: now I am using on-demand gadget rendering. 
+      */
+    /*
+    for( var i = 0 ; i < layout.getTabCount(); ++i ){
+        var tab = layout.getTabByIndex(i);
+        for( var j = 0 ; j < tab.getColumnCount(); ++j ){
+            var col = tab.getColumnByIndex(j);
+            for( var k = 0 ; k < col.getGadgetCount(); ++k ){
+                var gadget = col.getGadgetByIndex(k);
+                var tabid = '_tab_'+i+'_col_'+j+'_gadget_'+k+'_tb_';
+                var _tb_ = new Ext.Toolbar({
+                    //renderTo: tabid
+                });
+                //_tb_.add({text:'menu1'});
+            }
+        }
+    }*/
+    //document.getElementById('debugdiv').innerHTML = cgl.shindig.ui.layout.tabhtml;
+    
+    /** combobox which allows users to select which tab to be deleted */
+    var combo = createRemoveTabCombo(tabliststore);
+    var removetabbtn = createRemoveTabButton(tabpanel, combo, tabliststore);
+
+    /* sync button. By clicking it, user can submit its layout data to remote server. */
+    var syncTBBtn = createSyncLayoutInfoButton();
+
+    /* theme selection box */
+    var themeselcombo = createThemeSelCombo();
+
+    /* click this button to see user info*/
+    var userinfobt = createUserInfoButton();
+
+    /* logout button */
+    var logoutbt = createLogoutButton();
+
+    var tb = panel.getTopToolbar();
+    tb.add(addtabbutton, jsonviewer, addgadgetaction);
+    tb.add(removetabbtn);
+    tb.add(combo);
+    tb.add(syncTBBtn);
+    tb.add('->');
+    tb.add(userinfobt);
+    tb.add(themeselcombo);
+    tb.add(logoutbt);
+};
+
+
+/** A sample javascript object which represents layout of a user.
+cgl.shindig.ui.layout.json = {
+    username: 'gerald',
+    layout: [
+        { tabname: 'tab1',
+          tabid:   'tab1_id',
+          column:  2,
+          content: [
+            { columnname: 'column1',
+              columnid: 'column1_id',
+              content: [
+                { gadgetname: 'test gadget 111',
+                  gadgetspecsrc: 'http://156.56.104.196:8080/dummyapp/',
+                  gadgetrendersrc: 'dummp url' },
+                { gadgetname: 'test gadget 111',
+                  gadgetspecsrc: 'http://156.56.104.196:8080/dummyapp/dummy.html',
+                  gadgetrendersrc: 'dummp url' }
+              ]
+            },
+            { columnname: 'column2',
+              columnid: 'column2_id',
+              content: [
+                { gadgetname: 'test gadget 121',
+                  gadgetspecsrc: 'http://156.56.104.196:8080/dummyapp/',
+                  gadgetrendersrc: 'dummp url' }
+              ]
+            }
+          ]
+        },
+        { tabname: 'tab2',
+          tabid:   'tab2_id',
+          column:  3,
+          content: [
+            { columnname: 'column1',
+              columnid: 'column1_id',
+              content: [
+                { gadgetname: 'test gadget 111',
+                  gadgetspecsrc: 'http://156.56.104.196:8080/dummyapp/',
+                  gadgetrendersrc: 'dummp url' },
+                { gadgetname: 'test gadget 111',
+                  gadgetspecsrc: 'http://156.56.104.196:8080/dummyapp/dummy.html',
+                  gadgetrendersrc: 'dummp url' }
+              ]
+            },
+            { columnname: 'column2',
+              columnid: 'column2_id',
+              content: [
+                { gadgetname: 'test gadget 121',
+                  gadgetspecsrc: 'http://156.56.104.196:8080/dummyapp/',
+                  gadgetrendersrc: 'dummp url' }
+              ]
+            },
+            { columnname: 'column3',
+              columnid: 'column1_id',
+              content: [
+                { gadgetname: 'test gadget 111',
+                  gadgetspecsrc: 'http://156.56.104.196:8080/dummyapp/',
+                  gadgetrendersrc: 'dummp url' },
+                { gadgetname: 'test gadget 111',
+                  gadgetspecsrc: 'http://156.56.104.196:8080/dummyapp/dummy.html',
+                  gadgetrendersrc: 'dummp url' }
+              ]
+            }
+          ]
+        }
+    ]
+};
+*/
+
+ /*******************************************************************************
+  *     Following code is related to layout representation and manipulation.   *
+  ******************************************************************************/
+
+/** this function generates a new object represents the layout based on the input json object or string */
+cgl.shindig.ui.layout.generateLayoutObj = function(jsonstr_or_obj){
+    //jsonstr_or_obj='({username:"gerald",layout:[{tabname:"tab1",tabid:"tab1_id",column:2,content:[{columnname:"column1",columnid:"column1_id",content:[{gadgetname:"test gadget 111",gadgetspecsrc:"http://156.56.104.196:8080/dummyapp/",gadgetrendersrc:"dummp url"},{gadgetname:"test gadget 111",gadgetspecsrc:"http://156.56.104.196:8080/dummyapp/dummy.html",gadgetrendersrc:"dummp url"}]},{columnname:"column2",columnid:"column2_id",content:[{gadgetname:"test gadget 121",gadgetspecsrc:"http://156.56.104.196:8080/dummyapp/",gadgetrendersrc:"dummp url"}]}]},{tabname:"tab2",tabid:"tab2_id",column:3,content:[{columnname:"column1",columnid:"column1_id",content:[{gadgetname:"test gadget 111",gadgetspecsrc:"http://156.56.104.196:8080/dummyapp/",gadgetrendersrc:"dummp url"},{gadgetname:"test gadget 111",gadgetspecsrc:"http://156.56.104.196:8080/dummyapp/dummy.html",gadgetrendersrc:"dummp url"}]},{columnname:"column2",columnid:"column2_id",content:[{gadgetname:"test gadget 121",gadgetspe
 csrc:"http://156.56.104.196:8080/dummyapp/",gadgetrendersrc:"dummp url"}]},{columnname:"column3",columnid:"column1_id",content:[{gadgetname:"test gadget 111",gadgetspecsrc:"http://156.56.104.196:8080/dummyapp/",gadgetrendersrc:"dummp url"},{gadgetname:"test gadget 111",gadgetspecsrc:"http://156.56.104.196:8080/dummyapp/dummy.html",gadgetrendersrc:"dummp url"}]}]}]})';
+    var obj = jsonstr_or_obj;
+    if( typeof jsonstr_or_obj == 'string' )
+        obj = eval(jsonstr_or_obj);
+    return new cgl.shindig.ui.layout.layoutclass(obj);
+};
+
+
+/*******************************************************************************
+ *     Following code is related to Drag-and-Drop                              *
+ *******************************************************************************/
+
+cgl.shindig.ui.layout.tbrenderlist = {};
+cgl.shindig.ui.layout.droptargetrenderedlist = {};
+cgl.shindig.ui.layout.dragsourcepos = {} ; //position of the drag source
+cgl.shindig.ui.layout.curactivetabidx = -1;
+
+/*
+cgl.shindig.ui.layout.draggable = function (){
+    var dd11 = new Ext.dd.DragSource('dd1-item1', {ddGroup:'group'});
+    var dd12 = new Ext.dd.DragSource('dd1-item2', {ddGroup:'group'});
+    var dd13 = new Ext.dd.DragSource('dd1-item3', {ddGroup:'group'});
+    dd11.setHandleElId('toolbar');
+    dd11.resizeFrame = true;
+    dd11.centerFrame = true;
+    dd12.resizeFrame = true;
+    dd12.centerFrame = true;
+    dd13.resizeFrame = true;
+    dd13.centerFrame = true;
+};*/
+
+
+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. 
+ * Not 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;
+}
+
+
+/*******************************************************************************
+ * Functions below are not used actually. But it is possible that they may be **
+ * used in the future.                                                        **
+ ******************************************************************************/
+function tbIdParse(tbdivid){
+    var _gid_ = tbdivid.substr(0, tbdivid.length-('_tb_'.length));
+    var _colid_ = _gid_.substr(0, _gid_.indexOf('_gadget_'));
+}
+
+cgl.shindig.ui.layout.generateJS = function(layoutobj){
+    if( layout instanceof cgl.shindig.ui.layout.layoutclass ){
+        
+    }else{
+        alert('you pass a parameter of wrong type into function cgl.shindig.ui.layout.generateJS');
+    }
+};
+

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/sign.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/sign.jsp?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/sign.jsp (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/sign.jsp Fri Apr  1 00:29:22 2011
@@ -0,0 +1,116 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+<!--
+	 This page is filtered during the Maven build. All "dollar sign" properties are replaced with their
+	 values from conf/ishindig.properties.
+-->
+
+<base href="${site.ishindig.base}/www/">
+
+<link rel="shortcut icon" href="../favicon.ico" >
+<!-- <link rel="icon" type="image/gif" href="../animated_favicon1.gif" > -->
+
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<title>${site.login.title}</title>
+<meta name="keywords" content="" />
+<meta name="description" content="" />
+<link rel="stylesheet" type="text/css" href="css/default.css" />
+<link rel="stylesheet" type="text/css" href="css/style_form.css" />
+<script type="text/javascript" src="tmtjs/tmt_core.js"></script>
+<script type="text/javascript" src="tmtjs/tmt_form.js"></script>
+<script type="text/javascript" src="tmtjs/tmt_validator.js"></script>
+<script type="text/javascript">
+</script>
+</head>
+
+<body>
+<div id="outer">
+  <div id="outer2">
+    <div id="header">
+      <h1>${site.login.header}</h1>
+      <h2>${site.login.subheader}</h2>
+      <%-- <div style="float:right;position:relative; right:0px; bottom:0px;">admin</div> --%>
+      <div style="padding-bottom:10px;">
+      <div style="float:right;position:relative; right:0px;
+        bottom:0px;border-bottom:1px solid blue;">
+        <a style="text-decoration:none;color:brown;" href="../adminlogin.html">Click Here for Admin Login</a>
+      </div>
+      </div>
+    </div>
+    
+    <div id="menu">
+      <fieldset style="border:none;">
+        <jsp:scriptlet>
+        Object action = request.getAttribute("action");
+        if( action != null ){
+          String act = (String)action;
+          if( act.compareTo("signin") == 0 ){
+            Object state = request.getAttribute("state");
+            if( state  != null ){
+              switch ((Integer)state){
+                case 0:
+                  break;
+                case 1:
+        </jsp:scriptlet>
+                  <h3 style="color:red;">User name or Password can not be null</h3>
+        <jsp:scriptlet>
+                  break;
+                case 2:
+        </jsp:scriptlet>
+                  <h3 style="color:red;">No user found. Make use you input correct user name</h3>
+        <jsp:scriptlet>
+                  break;
+                case 3:
+        </jsp:scriptlet>
+                  <h3 style="color:red;">Password incorrect</h3>
+        <jsp:scriptlet>
+                  break;
+              }
+            }
+          } else if( act.compareTo("signup") == 0 ){
+            Object state = request.getAttribute("state");
+            if( state  != null ){
+              switch ((Integer)state){
+                case 0:
+        </jsp:scriptlet>
+                  <b>Congratulations!! You have signed up your account. Now you can sign in.</b>
+        <jsp:scriptlet>
+                  break;
+                case 1:
+        </jsp:scriptlet>
+                  <h3 style="color:red;">It seems that you input some value which does not satisfy our requirement.</h3>
+        <jsp:scriptlet>
+                  break;
+                case 2:
+        </jsp:scriptlet>
+                  <h3 style="color:red;">The user name has been registered alreay. Take another user name.</h3>
+        <jsp:scriptlet>
+                  break;
+                case -1:
+        </jsp:scriptlet>
+                  <b>Congratulations!! Your openid has been authenticated. Now
+                  you need to create a new account in this site. And the
+                  authenticated openid will be bound to your new account
+                  automatically.</b>
+        <jsp:scriptlet>
+                  break;
+                default:
+        </jsp:scriptlet>
+                  Make sure you input correct value for each field.
+        <jsp:scriptlet>
+                    break;
+              }
+            }
+          }
+        }
+        </jsp:scriptlet>
+        <jsp:directive.include file="signinup.html.part"/>
+        </fieldset>
+      </div>
+    </div>
+    <jsp:directive.include file="footer.html.part"/>
+  </div>
+</body>
+</html>
+

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/signinup.html.part
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/signinup.html.part?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/signinup.html.part (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/signinup.html.part Fri Apr  1 00:29:22 2011
@@ -0,0 +1,927 @@
+<!-- 
+	  This page contains the sign-in and sign-up forms.  It is loaded by sign.jsp.
+-->
+<jsp:directive.page import="java.util.Map,java.util.Set,java.util.Iterator,java.util.Map.Entry"/>
+
+<jsp:scriptlet>
+<![CDATA[
+    Map sregmap = (Map)request.getAttribute("sregmap");
+    if( sregmap != null ){
+        StringBuilder sb = new StringBuilder("{");
+        Set entries = sregmap.entrySet();
+        Iterator it = entries.iterator();
+        boolean first = true;
+        while( it.hasNext() ){
+            if( first ){
+                first = false;
+            }else{
+                sb.append(",");
+            }
+            Map.Entry<String, String> entry = (Map.Entry<String,String>)it.next();
+            sb.append(entry.getKey());
+            sb.append(":\"");
+            sb.append(entry.getValue());
+            sb.append("\"");
+        }
+        sb.append("}");
+        out.write("<script type='text/javascript'>var openidattr='"+sb.toString()+"';</script>");
+    }
+    String claimedid = (String)request.getAttribute("claimed");
+    if( claimedid != null ){
+        out.write("<script type='text/javascript'>var openid=\""+claimedid+"\";</script>");
+    }
+]]>
+</jsp:scriptlet>
+
+<script type="text/javascript">
+function calculate_time_zone() {
+   var rightNow = new Date();
+   var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);  // jan 1st
+   var june1 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0); // june 1st
+   var temp = jan1.toGMTString();
+   var jan2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
+   temp = june1.toGMTString();
+   var june2 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
+   var std_time_offset = (jan1 - jan2) / (1000 * 60 * 60);
+   var daylight_time_offset = (june1 - june2) / (1000 * 60 * 60);
+   var dst;
+   if (std_time_offset == daylight_time_offset) {
+        dst = "0"; // daylight savings time is NOT observed
+   } else {
+        // positive is southern, negative is northern hemisphere
+        var hemisphere = std_time_offset - daylight_time_offset;
+        if (hemisphere >= 0)
+            std_time_offset = daylight_time_offset;
+        dst = "1"; // daylight savings time is observed
+   }
+   var i;
+   for (i = 0; i < document.getElementById('timezone').options.length; i++) {
+        if (document.getElementById('timezone').options[i].value == convert(std_time_offset)+","+dst) {
+            document.getElementById('timezone').selectedIndex = i;
+            break;
+        }
+   }
+}
+
+function convert(value) {
+    var hours = parseInt(value);
+    value -= parseInt(value);
+    value *= 60;
+    var mins = parseInt(value);
+    value -= parseInt(value);
+    value *= 60;
+    var secs = parseInt(value);
+    var display_hours = hours;
+    display_hours = (hours < 10 && hours > 0) ? "+0"+hours : "+"+hours; // positive
+    display_hours = (hours == 0) ? "0"+hours : display_hours; // handle GMT case (00:00)
+    display_hours = (hours < 0 && hours > -10) ? "-0"+Math.abs(hours) : display_hours; // neg
+    mins = (mins < 10) ? "0"+mins : mins;
+    return display_hours+":"+mins;
+}
+
+</script>
+
+<script type="text/javascript">
+// Country data table
+//
+// To edit the list, just delete a line or add a line. Order is important.
+// The order displayed here is the order it appears on the drop down.
+//
+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 TrimString(sInString) {
+  if ( sInString ) {
+    sInString = sInString.replace( /^\s+/g, "" );// strip leading
+    return sInString.replace( /\s+$/g, "" );// strip trailing
+  }
+}
+var postCountry = '';
+// Populates the country selected with the counties from the country list
+function populateCountry(defaultCountry) {
+  if ( postCountry != '' ) {
+    defaultCountry = postCountry;
+  }
+  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);
+}
+</script>
+
+
+<script LANGUAGE="JavaScript">
+/********************************************
+    Date selection
+ ********************************************/
+<!-- Begin
+//set todays date
+Now = new Date();
+NowDay = Now.getDate();
+NowMonth = Now.getMonth();
+NowYear = Now.getYear();
+if (NowYear < 2000) NowYear += 1900; //for Netscape
+
+//function for returning how many days there are in a month including leap years
+function DaysInMonth(WhichMonth, 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;
+  return DaysInMonth;
+}
+
+//function to change the available days in a months
+function ChangeOptionDays(Which)
+{
+  DaysObject = eval("document.userinfo_signup." + Which + "day");
+  MonthObject = eval("document.userinfo_signup." + Which + "month");
+  YearObject = eval("document.userinfo_signup." + Which + "year");
+
+  Month = MonthObject[MonthObject.selectedIndex].text;
+  Year = YearObject[YearObject.selectedIndex].text;
+
+  DaysForThisSelection = DaysInMonth(Month, Year);
+  CurrentDaysInSelection = DaysObject.length;
+  if (CurrentDaysInSelection > DaysForThisSelection)
+  {
+    for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
+    {
+      DaysObject.options[DaysObject.options.length - 1] = null
+    }
+  }
+  if (DaysForThisSelection > CurrentDaysInSelection)
+  {
+    for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
+    {
+      NewOption = new Option(DaysObject.options.length + 1, DaysObject.options.length + 1);
+      DaysObject[DaysObject.options.length] = NewOption;
+    }
+  }
+    if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
+}
+
+//function to set options to today
+function SetToToday(Which)
+{
+  DaysObject = eval("document.userinfo_signup." + Which + "day");
+  MonthObject = eval("document.userinfo_signup." + Which + "month");
+  YearObject = eval("document.userinfo_signup." + Which + "year");
+
+  YearObject[0].selected = true;
+  MonthObject[NowMonth].selected = true;
+
+  ChangeOptionDays(Which);
+
+  DaysObject[NowDay-1].selected = true;
+}
+
+//function to write option years plus x
+function WriteYearOptions(YearsBefore)
+{
+  line = "";
+  for (i=0; i<YearsBefore; i++)
+  {
+    line += "<OPTION value='"+(NowYear-i)+"'>";
+    line += NowYear - i;
+  }
+  return line;
+}
+//  End -->
+</script>
+
+<script type="text/javascript">
+
+function populateLanguage(defaultLanguage) {
+  var selObj = document.getElementById('language');
+  for (var loop = 0; loop < selObj.options.length; loop++) {
+    if( defaultLanguage == selObj.options[loop].value ){
+        selObj.selectedIndex = loop;
+        break;
+    }
+  }
+  if( loop == selObj.options.length )
+    selObj.selectedIndex = 0;
+}
+</script>
+
+<div id="column1">
+<h2 align="center">Sign in</h2>
+    <form name="userinfo_signin" action="../signin" tmt:validate="true" method="post">
+    <!--The signin action points to cgl.shindig.usermanage.servlet.SignIn.  See web.xml.-->
+        <table style="margin-left:0em;" cellpadding="0" border="0" cellspacing="5">
+            <tr><td>Screen name</td><td>
+                <input class="required" type="text" size= "30" name="screenname" tmt:required="true" tmt:message="Please insert your screen name or you screen is too short/long" tmt:minlength="6" tmt:maxlength="20"/><span style="font-family:verdana;"></span></td></tr>
+            <tr><td>Password</td><td>
+                <input class="required" type="password" size= "30" name="password" tmt:required="true" tmt:message="Please insert your password or you password is too short/long" tmt:minlength="6" tmt:maxlength="20"/></td></tr>
+            <tr><td colspan="2" align="center">
+            <input type="submit" name="submit" value="Submit" />
+            </td></tr>
+            <jsp:scriptlet>
+            <![CDATA[
+                String keyNextURLInReqObj = cgl.shindig.usermanage.servlet.SignIn.keyNextURLInReqObj;
+                String nextURL = (String)request.getAttribute(keyNextURLInReqObj);
+                String keyNextURL = cgl.shindig.usermanage.servlet.SignIn.keyNextURL;
+                if (nextURL == null) {
+                    nextURL = (String)request.getParameter(keyNextURLInReqObj);
+                } 
+                if (nextURL != null)
+                    out.write("<input type=\"hidden\" name=\"" + keyNextURL + 
+                            "\" value=\"" + nextURL + "\">");
+            ]]>
+            </jsp:scriptlet>
+        </table>
+    </form>
+    <p style="text-align:center;font-size:2em;margin:10px 4px;padding:0pt;">or</p>
+    OpenID<br>
+    <form action="openidsignin" name="openidsignin" method="get">
+		<!-- This points to cgl.shindig.usermanage.servlet.OpenIdAuth.  See web.xml -->
+        <dl class="field">
+            <input name="openid.claimed_id" id="openid.claimed_id" value="" class="openid textfield" style="width: 270px;" onfocus="this.select()">
+            
+            <br>
+            <jsp:scriptlet>
+            <![CDATA[
+                keyNextURLInReqObj = cgl.shindig.usermanage.servlet.SignIn.keyNextURLInReqObj;
+                nextURL = (String)request.getAttribute(keyNextURLInReqObj);
+                keyNextURL = cgl.shindig.usermanage.servlet.SignIn.keyNextURL;
+                if (nextURL == null) {
+                    nextURL = (String)request.getParameter(keyNextURLInReqObj);
+                } 
+                if (nextURL != null)
+                    out.write("<input type=\"hidden\" name=\"" + keyNextURL + 
+                            "\" value=\"" + nextURL + "\">");
+            ]]>
+            </jsp:scriptlet>
+            <input style="margin-left:20px;" name="submit" class="submit" value="Here we go!" type="submit">
+            
+            <div id="error_url" class="errors" style="display: none;">
+                <div id="error_url_empty">Please enter your OpenID URL</div>
+            </div>
+            <div id="invalid_url" class="errors" style="display: none;">
+                <div id="invalid_url_inner">You input an invalid URL</div>
+            </div>
+        <dd class="input">
+        </dd>
+        </dl> 
+        <p>
+    </form>
+
+	 <!--
+		  This is a link to CILogon.  Disabling it for now.
+		-->
+	 <!--
+    <div>   
+    <a href="../cilogon">CILogon</a>
+    </div>
+	 -->
+</div>
+<div id="column2">
+<h2 align="center">Sign up</h2>
+    <form name="userinfo_signup" action="../signup" tmt:validate="true" method="post">
+		<!-- This form action points to cgl.shindig.usermanage.servlet.SignUp.  See web.xml -->
+        <table style="margin-left:0em;" cellpadding="0" border="0" cellspacing="5">
+            <tr><td>First name</td><td>
+                 <input class="required" type="text" size= "30" name="firstname" tmt:required="true" tmt:message="Please insert your first name" tmt:minlength="1" tmt:maxlength="20"/> </td></tr>
+            <tr><td>Last name</td><td> 
+                <input class="required" type="text" size= "30" name="lastname" tmt:required="true" tmt:message="Please insert your last name" tmt:minlength="1" tmt:maxlength="20"/> </td></tr>
+<!--
+            <tr><td>Age</td><td> 
+                <input class="required" type="text" size= "30" name="age" tmt:required="true" tmt:errorclass="invalid" tmt:pattern="positiveinteger" tmt:maxnumber="150" tmt:filters="numbersonly" tmt:message="Please make sure you insert correct age value"/> </td></tr>
+-->
+            <tr><td>Country</td><td>
+        <select id='country' name='country'> </select>
+            </td></tr>
+            <tr><td>Date of Birth</td><td>
+<SELECT name="dobday" id="dobday"></SELECT>
+<SELECT name="dobmonth" id="dobmonth" onchange="ChangeOptionDays('dob')">
+    <OPTION value="1">Jan</OPTION>
+    <OPTION value="2">Feb</OPTION>
+    <OPTION value="3">Mar</OPTION>
+    <OPTION value="4">Apr</OPTION>
+    <OPTION value="5">May</OPTION>
+    <OPTION value="6">Jun</OPTION>
+    <OPTION value="7">Jul</OPTION>
+    <OPTION value="8">Aug</OPTION>
+    <OPTION value="9">Sep</OPTION>
+    <OPTION value="10">Oct</OPTION>
+    <OPTION value="11">Nov</OPTION>
+    <OPTION value="12">Dec</OPTION>
+</SELECT>
+<SELECT name="dobyear" id="dobyear" onchange="ChangeOptionDays('dob')">
+    <SCRIPT language="JavaScript">
+        document.write(WriteYearOptions(100));
+    </SCRIPT>
+</SELECT>
+
+            </td></tr>
+            <tr><td>Email</td><td><input type="text" name="email" size="30"></td></tr>
+            <tr><td>Gender</td><td>
+            <input type="radio" name="gender" value="M"/ id="male">
+                <label for="male">Male</label>&nbsp;&nbsp;&nbsp;&nbsp;
+            <input type="radio" name="gender" value="F"/ id="female"> 
+                <label for="female">Female</label>
+            </td></tr>
+
+            <tr><td>Postcode</td><td><input type="text" name="zipcode" size="30"></td></tr>
+            <tr><td>Language</td><td>
+            <select name="language" id="language">
+                    <option value="">-- None --</option>
+                    <option value="EN" selected>English</option>
+                    <option value="AB">Abkhazian</option>
+
+                    <option value="AA">Afar</option>
+                    <option value="AF">Afrikaans</option>
+                    <option value="SQ">Albanian</option>
+                    <option value="AM">Amharic</option>
+                    <option value="AR">Arabic</option>
+                    <option value="HY">Armenian</option>
+                    <option value="AS">Assamese</option>
+                    <option value="AY">Aymara</option>
+                    <option value="AZ">Azerbaijani</option>
+
+                    <option value="BA">Bashkir</option>
+                    <option value="EU">Basque</option>
+                    <option value="BN">Bengali</option>
+                    <option value="DZ">Bhutani</option>
+                    <option value="BH">Bihari</option>
+                    <option value="BI">Bislama</option>
+                    <option value="BR">Breton</option>
+                    <option value="BG">Bulgarian</option>
+                    <option value="MY">Burmese</option>
+
+                    <option value="BE">Byelorussian</option>
+                    <option value="KM">Cambodian</option>
+                    <option value="CA">Catalan</option>
+                    <option value="ZH_TW">Chinese (traditional)</option>
+                    <option value="ZH_CN">Chinese (simplified)</option>
+                    <option value="CO">Corsican</option>
+                    <option value="HR">Croatian</option>
+                    <option value="CS">Czech</option>
+                    <option value="DA">Danish</option>
+
+                    <option value="NL">Dutch</option>
+                    <option value="EO">Esperanto</option>
+                    <option value="ET">Estonian</option>
+                    <option value="FO">Faeroese</option>
+                    <option value="FJ">Fiji</option>
+                    <option value="FI">Finnish</option>
+                    <option value="FR">French</option>
+                    <option value="FY">Frisian</option>
+                    <option value="GD">Gaelic</option>
+
+                    <option value="GL">Galician</option>
+                    <option value="KA">Georgian</option>
+                    <option value="DE">German</option>
+                    <option value="EL">Greek</option>
+                    <option value="KL">Greenlandic</option>
+                    <option value="GN">Guarani</option>
+                    <option value="GU">Gujarati</option>
+                    <option value="HA">Hausa</option>
+                    <option value="IW">Hebrew</option>
+
+                    <option value="HI">Hindi</option>
+                    <option value="HU">Hungarian</option>
+                    <option value="IS">Icelandic</option>
+                    <option value="IN">Indonesian</option>
+                    <option value="IA">Interlingua</option>
+                    <option value="IE">Interlingue</option>
+                    <option value="IK">Inupiak</option>
+                    <option value="GA">Irish</option>
+                    <option value="IT">Italian</option>
+
+                    <option value="JA">Japanese</option>
+                    <option value="JW">Javanese</option>
+                    <option value="KN">Kannada</option>
+                    <option value="KS">Kashmiri</option>
+                    <option value="KK">Kazakh</option>
+                    <option value="RW">Kinyarwanda</option>
+                    <option value="KY">Kirghiz</option>
+                    <option value="RN">Kirundi</option>
+                    <option value="KO">Korean</option>
+
+                    <option value="KU">Kurdish</option>
+                    <option value="LO">Laothian</option>
+                    <option value="LA">Latin</option>
+                    <option value="LV">Latvian</option>
+                    <option value="LN">Lingala</option>
+                    <option value="LT">Lithuanian</option>
+                    <option value="MK">Macedonian</option>
+                    <option value="MG">Malagasy</option>
+                    <option value="MS">Malay</option>
+
+                    <option value="ML">Malayalam</option>
+                    <option value="MT">Maltese</option>
+                    <option value="MI">Maori</option>
+                    <option value="MR">Marathi</option>
+                    <option value="MO">Moldavian</option>
+                    <option value="MN">Mongolian</option>
+                    <option value="NA">Nauru</option>
+                    <option value="NE">Nepali</option>
+                    <option value="NO">Norwegian</option>
+
+                    <option value="OC">Occitan</option>
+                    <option value="OR">Oriya</option>
+                    <option value="OM">Oromo</option>
+                    <option value="PS">Pashto</option>
+                    <option value="FA">Persian</option>
+                    <option value="PL">Polish</option>
+                    <option value="PT">Portuguese</option>
+                    <option value="PT_BR">Português (Brasil)</option>
+                    <option value="PA">Punjabi</option>
+
+                    <option value="QU">Quechua</option>
+                    <option value="RM">Rhaeto-Romance</option>
+                    <option value="RO">Romanian</option>
+                    <option value="RU">Russian</option>
+                    <option value="SM">Samoan</option>
+                    <option value="SG">Sangro</option>
+                    <option value="SA">Sanskrit</option>
+                    <option value="SR">Serbian</option>
+                    <option value="SH">Serbo-Croatian</option>
+
+                    <option value="ST">Sesotho</option>
+                    <option value="TN">Setswana</option>
+                    <option value="SN">Shona</option>
+                    <option value="SD">Sindhi</option>
+                    <option value="SI">Singhalese</option>
+                    <option value="SS">Siswati</option>
+                    <option value="SK">Slovak</option>
+                    <option value="SL">Slovenian</option>
+                    <option value="SO">Somali</option>
+
+                    <option value="ES">Spanish</option>
+                    <option value="SU">Sudanese</option>
+                    <option value="SW">Swahili</option>
+                    <option value="SV">Swedish</option>
+                    <option value="TL">Tagalog</option>
+                    <option value="TG">Tajik</option>
+                    <option value="TA">Tamil</option>
+                    <option value="TT">Tatar</option>
+                    <option value="TE">Telugu</option>
+
+                    <option value="TH">Thai</option>
+                    <option value="BO">Tibetan</option>
+                    <option value="TI">Tigrinya</option>
+                    <option value="TO">Tonga</option>
+                    <option value="TS">Tsonga</option>
+                    <option value="TR">Turkish</option>
+                    <option value="TK">Turkmen</option>
+                    <option value="TW">Twi</option>
+                    <option value="UK">Ukrainian</option>
+
+                    <option value="UR">Urdu</option>
+                    <option value="UZ">Uzbek</option>
+                    <option value="VI">Vietnamese</option>
+                    <option value="VO">Volapuk</option>
+                    <option value="CY">Welsh</option>
+                    <option value="WO">Wolof</option>
+                    <option value="XH">Xhosa</option>
+                    <option value="JI">Yiddish</option>
+                    <option value="YO">Yoruba</option>
+
+                    <option value="ZU">Zulu</option>
+                    </select>
+            </td></tr>
+            <tr><td>Time Zone</td><td>
+            <select name='timezone' id='timezone' style='width:20em;'>
+    <option value='-12:00,0'>(-12:00) International Date Line West</option>
+    <option value='-11:00,0'>(-11:00) Midway Island, Samoa</option>
+    <option value='-10:00,0'>(-10:00) Hawaii</option>
+    <option value='-09:00,1'>(-09:00) Alaska</option>
+
+    <option value='-08:00,1'>(-08:00) Pacific Time (US & Canada)</option>
+    <option value='-07:00,0'>(-07:00) Arizona</option>
+    <option value='-07:00,1'>(-07:00) Mountain Time (US & Canada)</option>
+    <option value='-06:00,0'>(-06:00) Central America, Saskatchewan</option>
+    <option value='-06:00,1'>(-06:00) Central Time (US & Canada), Guadalajara, Mexico city</option>
+
+    <option value='-05:00,0'>(-05:00) Indiana, Bogota, Lima, Quito, Rio Branco</option>
+    <option value='-05:00,1'>(-05:00) Eastern time (US & Canada)</option>
+    <option value='-04:00,1'>(-04:00) Atlantic time (Canada), Manaus, Santiago</option>
+    <option value='-04:00,0'>(-04:00) Caracas, La Paz</option>
+    <option value='-03:30,1'>(-03:30) Newfoundland</option>
+    <option value='-03:00,1'>(-03:00) Greenland, Brasilia, Montevideo</option>
+
+    <option value='-03:00,0'>(-03:00) Buenos Aires, Georgetown</option>
+    <option value='-02:00,1'>(-02:00) Mid-Atlantic</option>
+    <option value='-01:00,1'>(-01:00) Azores</option>
+    <option value='-01:00,0'>(-01:00) Cape Verde Is.</option>
+    <option value='00:00,0'>(00:00) Casablanca, Monrovia, Reykjavik</option>
+    <option value='00:00,1'>(00:00) GMT: Dublin, Edinburgh, Lisbon, London</option>
+
+    <option value='+01:00,1'>(+01:00) Amsterdam, Berlin, Rome, Vienna, Prague, Brussels</option>
+    <option value='+01:00,0'>(+01:00) West Central Africa</option>
+    <option value='+02:00,1'>(+02:00) Amman, Athens, Istanbul, Beirut, Cairo, Jerusalem</option>
+    <option value='+02:00,0'>(+02:00) Harare, Pretoria</option>
+    <option value='+03:00,1'>(+03:00) Baghdad, Moscow, St. Petersburg, Volgograd</option>
+    <option value='+03:00,0'>(+03:00) Kuwait, Riyadh, Nairobi, Tbilisi</option>
+
+    <option value='+03:30,0'>(+03:30) Tehran</option>
+    <option value='+04:00,0'>(+04:00) Abu Dhadi, Muscat</option>
+    <option value='+04:00,1'>(+04:00) Baku, Yerevan</option>
+    <option value='+04:30,0'>(+04:30) Kabul</option>
+    <option value='+05:00,1'>(+05:00) Ekaterinburg</option>
+    <option value='+05:00,0'>(+05:00) Islamabad, Karachi, Tashkent</option>
+
+    <option value='+05:30,0'>(+05:30) Chennai, Kolkata, Mumbai, New Delhi, Sri Jayawardenepura</option>
+    <option value='+05:45,0'>(+05:45) Kathmandu</option>
+    <option value='+06:00,0'>(+06:00) Astana, Dhaka</option>
+    <option value='+06:00,1'>(+06:00) Almaty, Nonosibirsk</option>
+    <option value='+06:30,0'>(+06:30) Yangon (Rangoon)</option>
+    <option value='+07:00,1'>(+07:00) Krasnoyarsk</option>
+
+    <option value='+07:00,0'>(+07:00) Bangkok, Hanoi, Jakarta</option>
+    <option value='+08:00,0'>(+08:00) Beijing, Hong Kong, Singapore, Taipei</option>
+    <option value='+08:00,1'>(+08:00) Irkutsk, Ulaan Bataar, Perth</option>
+    <option value='+09:00,1'>(+09:00) Yakutsk</option>
+    <option value='+09:00,0'>(+09:00) Seoul, Osaka, Sapporo, Tokyo</option>
+    <option value='+09:30,0'>(+09:30) Darwin</option>
+
+    <option value='+09:30,1'>(+09:30) Adelaide</option>
+    <option value='+10:00,0'>(+10:00) Brisbane, Guam, Port Moresby</option>
+    <option value='+10:00,1'>(+10:00) Canberra, Melbourne, Sydney, Hobart, Vladivostok</option>
+    <option value='+11:00,0'>(+11:00) Magadan, Solomon Is., New Caledonia</option>
+    <option value='+12:00,1'>(+12:00) Auckland, Wellington</option>
+    <option value='+12:00,0'>(+12:00) Fiji, Kamchatka, Marshall Is.</option>
+
+    <option value='+13:00,0'>(+13:00) Nuku'alofa</option>
+        </select>
+</td></tr>
+            <tr><td colspan="2"><hr /></td></tr>
+            <tr><td>Screen name</td><td>
+                <input class="required" type="text" size= "30" name="screenname" 
+                    tmt:required="true" 
+                    tmt:message="Please insert your screen name or you screen is too short/long"
+                    tmt:minlength="6" tmt:maxlength="20"/>
+                </td>
+            </tr>
+
+            <tr><td>Password</td><td>
+                <input class="required" type="password" size= "30" name="password"
+                id="signup_password"
+                tmt:required="true"
+                tmt:message="Please insert your password or you password is too short/long"
+                tmt:minlength="6" tmt:maxlength="20"/>
+                </td>
+            </tr>
+
+            <tr><td>Repeat Password</td><td>
+                <input class="required" type="password" size= "30" name="password_repeat"
+                tmt:required="true"
+                tmt:message="Please insert two matching passwords."
+                tmt:minlength="6" tmt:maxlength="20"
+                tmt:equalto="signup_password" />
+                </td>
+            </tr>
+
+            <tr><td colspan="2" align="center">
+                <input type="submit" name="submit" value="Submit" />
+                <tr><td colspan="2" align="center">
+            </td></tr>
+        </table>
+        <input type="hidden" name="openid_hidden" value="">
+        <jsp:scriptlet>
+        <![CDATA[
+            keyNextURLInReqObj = cgl.shindig.usermanage.servlet.SignIn.keyNextURLInReqObj;
+            keyNextURL = cgl.shindig.usermanage.servlet.SignIn.keyNextURL;
+            nextURL = (String)request.getAttribute(keyNextURLInReqObj);
+            if (nextURL == null) {
+                nextURL = (String)request.getParameter(keyNextURLInReqObj);
+            } 
+            if (nextURL != null)
+                out.write("<input type=\"hidden\" name=\"" + keyNextURL + 
+                        "\" value=\"" + nextURL + "\">");
+        ]]>
+        </jsp:scriptlet>
+    </form>
+</div>
+
+<div style="margin-top:1em;clear:both;color:green;">
+Note: fields masked as '*' are necessary. Length of screen name, first name, last name and password must be between 6 and 20.
+</div>
+<!-- <div><a href="../../adminlogin.html">Admin</a></div> -->
+
+
+<script type="text/javascript">
+function pre_populate_openid(){
+    var form = document.userinfo_signup;
+    if(typeof openidattr != 'undefined'){
+        var openidsreobj = eval('('+openidattr+')');
+        /*
+        if( openidsreobj.nickname != null ){
+            form.nickname.value = openidsreobj.nickname;
+        }*/
+        if( openidsreobj.email != null ){
+            form.email.value = openidsreobj.email;
+        }
+        /* currently my app does not use this field.
+        if( openidsreobj.fullname != null ){
+        }*/
+        if( openidsreobj.dob != null ){
+        }
+        if( openidsreobj.gender != null ){
+            if( openidsreobj.gender == "M" ){
+                document.getElementById("male").checked = true;
+            }else if( openidsreobj.gender == "F" ){
+                document.getElementById("female").checked = true;
+            }else{
+                document.getElementById("male").checked = true;
+            }
+        }
+        if( openidsreobj.postcode != null ){
+            form.zipcode = openidsreobj.postcode;
+        }
+        if( openidsreobj.country != null ){
+            initCountry(openidsreobj.country);
+        }
+        if( openidsreobj.language != null ){
+             populateLanguage(openidsreobj.language);
+        }
+        if( openidsreobj.timezone != null ){
+            form.timezone = openidsreobj.timezone;
+        }
+    }
+    if(typeof openid != 'undefined'){
+        var ele = document.getElementById('openid.claimed_id');
+        ele.value=openid;
+        ele.readOnly=true;
+        form.openid_hidden.value = openid;
+    }
+}
+
+window.onload = function(){
+    initCountry('US');
+    calculate_time_zone();
+    SetToToday('dob');
+    pre_populate_openid();
+}
+</script>

Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/tmtjs/tmt_core.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/tmtjs/tmt_core.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/tmtjs/tmt_core.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/main/webapp/www/tmtjs/tmt_core.js Fri Apr  1 00:29:22 2011
@@ -0,0 +1,217 @@
+/** 
+* Copyright 2006-2008 massimocorner.com
+* License: http://www.massimocorner.com/license.htm
+* @author      Massimo Foti (massimo@massimocorner.com)
+* @version     0.3.2, 2008-05-07
+ */
+
+if(typeof(tmt) == "undefined"){
+	var tmt = {};
+}
+
+/**
+* Developed by John Resig
+* For additional info see:
+* http://ejohn.org/projects/flexible-javascript-events
+*/
+tmt.addEvent = function(obj, type, fn){
+	if(obj.addEventListener){
+		obj.addEventListener(type, fn, false);
+	}
+	else if(obj.attachEvent){
+		obj["e" + type + fn] = fn;
+		obj[type + fn] = function(){
+				obj["e" + type + fn](window.event);
+			}
+		obj.attachEvent("on" + type, obj[type+fn]);
+	}
+}
+
+/**
+* Sort of an equivalent of the famous $() function. Just with a better name :-)
+* Accepts either ids (strings) or DOM node references
+*/
+tmt.get = function(){
+	var returnNodes = new Array();
+	for(var i=0; i<arguments.length; i++){
+		var nodeElem = arguments[i];
+		if(typeof nodeElem == "string"){
+			nodeElem = document.getElementById(nodeElem);
+		}
+		if(arguments.length == 1){
+			return nodeElem;
+		}
+		returnNodes.push(nodeElem);
+	}
+	return returnNodes;
+}
+
+/**
+* Returns an array containing all child nodes. 
+* If no starting node is passed, assume the document is the starting point
+*/
+tmt.getAll = function(startNode){
+	// If no node was passed, use the document
+	var rootNode = (startNode) ? tmt.get(startNode) : document;
+	return rootNode.getElementsByTagName("*");
+}
+
+/**
+* Returns an array containing all child nodes. 
+* Unlike tmt.getAll, it return only elements of type Node.NODE_ELEMENT, no comments or other kind of nodes
+* If no starting node is passed, assume the document is the starting point
+*/
+tmt.getAllNodes = function(startNode){
+	var elements = tmt.getAll(startNode);
+	var nodesArray = [];
+	for(var i=0; i<elements.length; i++){
+		if(elements[i].nodeType == 1){
+			nodesArray.push(elements[i]);
+		}
+	}
+	return nodesArray;
+}
+
+/**
+* Returns an array containing all child nodes that contain the given attribute 
+* If no starting node is passed, assume the document is the starting point
+*/
+tmt.getNodesByAttribute = function(attName, startNode){
+	var nodes = tmt.getAll(startNode);
+	return tmt.filterNodesByAttribute(attName, nodes);
+}
+
+/**
+* Returns an array containing all child nodes that contain the given attribute matching a given value
+* If no starting node is passed, assume the document is the starting point
+*/
+tmt.getNodesByAttributeValue = function(attName, attValue, startNode){
+	var nodes = tmt.getAll(startNode);
+	return tmt.filterNodesByAttributeValue(attName, attValue, nodes);
+}
+
+/**
+* Out of a node list, returns an array containing all nodes that contain the given attribute
+*/
+tmt.filterNodesByAttribute = function(attName, nodes){
+	var filteredNodes = new Array();
+	for(var i=0; i<nodes.length; i++){
+		if(nodes[i].getAttribute(attName)){
+			filteredNodes.push(nodes[i]);
+		}
+	}
+	return filteredNodes;
+}
+
+/**
+* Out of a node list, returns an array containing all nodes that contain the given attribute matching a given value
+*/
+tmt.filterNodesByAttributeValue = function(attName, attValue, nodes){
+	var filteredNodes = new Array();
+	for(var i=0; i<nodes.length; i++){
+		if(nodes[i].getAttribute(attName) && (nodes[i].getAttribute(attName) == attValue)){
+			filteredNodes.push(nodes[i]);
+		}
+	}
+	return filteredNodes;
+}
+
+/**
+* Set the value of an attribute on a list of nodes. Accepts either an id (string) or DOM node reference
+*/
+tmt.setNodeAttribute = function(nodeList, attName, attValue){
+for(var i=0; i<nodeList.length; i++){
+		var nodeElem = tmt.get(nodeList[i]);
+		if(nodeElem){
+			nodeElem[attName] = attValue;
+		}
+	}
+}
+
+/**
+* Add a CSS class to a given node. Accepts either an id (string) or DOM node reference
+*/
+tmt.addClass = function(element, className){
+	var nodeElem = tmt.get(element);
+	if(!nodeElem || (tmt.hasClass(nodeElem, className) == true)){
+		return;
+	}
+	nodeElem.className += (nodeElem.className ? " " : "") + className;
+}
+
+/**
+* Check if a given node use a CSS class. Accepts either an id (string) or DOM node reference
+*/
+tmt.hasClass = function(element, className){
+	var nodeElem = tmt.get(element);
+	if(nodeElem){
+		return nodeElem.className.search(new RegExp("\\b" + className + "\\b")) != -1;
+	}
+	return null;
+}
+
+/**
+* Remove a CSS class from a given node. Accepts either an id (string) or DOM node reference
+*/
+tmt.removeClass = function(element, className){
+	var nodeElem = tmt.get(element);
+	if(!nodeElem || (tmt.hasClass(nodeElem, className) == false)){
+		return;
+	}
+	nodeElem.className = nodeElem.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
+}
+
+/**
+* Toggle a CSS class from a given node. Accepts either an id (string) or DOM node reference
+*/
+tmt.toggleClass = function(element, className){
+	var nodeElem = tmt.get(element);
+	if(tmt.hasClass(nodeElem, className)){
+		tmt.removeClass(nodeElem, className);
+	}
+	else{
+		tmt.addClass(nodeElem, className);
+	}
+}
+
+/**
+* Trim a given string
+*/
+tmt.trim = function(str){
+	return str.replace(/^\s+|\s+$/g, "");
+}
+
+/**
+* Replace special XML character with the equivalent entities
+*/
+tmt.encodeEntities = function(str){
+	if(str && str.search(/[&<>"]/) != -1){
+		str = str.replace(/&/g, "&amp;");
+		str = str.replace(/</g, "&lt;");
+		str = str.replace(/>/g, "&gt;");
+		str = str.replace(/"/g, "&quot;");
+	}
+	return str
+}
+
+/**
+* Replace XML's entities with the equivalent character
+*/
+tmt.unencodeEntities = function(str){
+	str = str.replace(/&amp;/g, "&");
+	str = str.replace(/&lt;/g, "<");
+	str = str.replace(/&gt;/g, ">");
+	str = str.replace(/&quot;/g, '"');
+	return str
+}
+
+/**
+* Turn a set of name/value pairs stored inside an object into a URI encoded string
+*/
+tmt.hashToEncodeURI = function(obj){
+	var values = [];
+	for(var x in obj){
+		values.push(encodeURIComponent(x) + "=" + encodeURIComponent(obj[x]));
+	}
+	return values.join("&");
+}
\ No newline at end of file



Mime
View raw message